ultimatepos/public/build-communication/assets/app-Q1EcLaHW.js

10 lines
53 KiB
JavaScript
Vendored
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{u as y,s as mn,a as pn,d as Gt,n as We,r as hn,i as Ce,h as Lt,c as ne,w as Ve,b as U,p as Fe,g as Ue,e as le,o as S,f as P,j as o,k as xe,l as et,m as Q,t as C,q as _,v as Z,x as ze,y as ct,F as se,z as Ee,A as ie,B as Be,C as X,D as de,E as qe,G as vn,H as gn,I as _n,J as yn,K as bn}from"./meetings-D-ntg1mR.js";/*!
* vue-router v4.6.4
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/const Ne=typeof document<"u";function Ut(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function wn(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ut(e.default)}const H=Object.assign;function tt(e,t){const n={};for(const s in t){const a=t[s];n[s]=oe(a)?a.map(e):e(a)}return n}const Ge=()=>{},oe=Array.isArray;function vt(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Ht=/#/g,En=/&/g,Rn=/\//g,Cn=/=/g,An=/\?/g,jt=/\+/g,kn=/%5B/g,In=/%5D/g,Ft=/%5E/g,Nn=/%60/g,qt=/%7B/g,xn=/%7C/g,Kt=/%7D/g,Sn=/%20/g;function ut(e){return e==null?"":encodeURI(""+e).replace(xn,"|").replace(kn,"[").replace(In,"]")}function Pn(e){return ut(e).replace(qt,"{").replace(Kt,"}").replace(Ft,"^")}function at(e){return ut(e).replace(jt,"%2B").replace(Sn,"+").replace(Ht,"%23").replace(En,"%26").replace(Nn,"`").replace(qt,"{").replace(Kt,"}").replace(Ft,"^")}function On(e){return at(e).replace(Cn,"%3D")}function Tn(e){return ut(e).replace(Ht,"%23").replace(An,"%3F")}function Dn(e){return Tn(e).replace(Rn,"%2F")}function Le(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Mn=/\/$/,$n=e=>e.replace(Mn,"");function nt(e,t,n="/"){let s,a={},f="",p="";const b=t.indexOf("#");let r=t.indexOf("?");return r=b>=0&&r>b?-1:r,r>=0&&(s=t.slice(0,r),f=t.slice(r,b>0?b:t.length),a=e(f.slice(1))),b>=0&&(s=s||t.slice(0,b),p=t.slice(b,t.length)),s=Ln(s??t,n),{fullPath:s+f+p,path:s,query:a,hash:Le(p)}}function Vn(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function gt(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Bn(e,t,n){const s=t.matched.length-1,a=n.matched.length-1;return s>-1&&s===a&&Se(t.matched[s],n.matched[a])&&Wt(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Se(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Wt(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Gn(e[n],t[n]))return!1;return!0}function Gn(e,t){return oe(e)?_t(e,t):oe(t)?_t(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function _t(e,t){return oe(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Ln(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),a=s[s.length-1];(a===".."||a===".")&&s.push("");let f=n.length-1,p,b;for(p=0;p<s.length;p++)if(b=s[p],b!==".")if(b==="..")f>1&&f--;else break;return n.slice(0,f).join("/")+"/"+s.slice(p).join("/")}const _e={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let it=(function(e){return e.pop="pop",e.push="push",e})({}),st=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Un(e){if(!e)if(Ne){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),$n(e)}const Hn=/^[^#]+#/;function jn(e,t){return e.replace(Hn,"#")+t}function Fn(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Qe=()=>({left:window.scrollX,top:window.scrollY});function qn(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),a=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!a)return;t=Fn(a,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function yt(e,t){return(history.state?history.state.position-t:-1)+e}const lt=new Map;function Kn(e,t){lt.set(e,t)}function Wn(e){const t=lt.get(e);return lt.delete(e),t}function zn(e){return typeof e=="string"||e&&typeof e=="object"}function zt(e){return typeof e=="string"||typeof e=="symbol"}let F=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Qt=Symbol("");F.MATCHER_NOT_FOUND+"",F.NAVIGATION_GUARD_REDIRECT+"",F.NAVIGATION_ABORTED+"",F.NAVIGATION_CANCELLED+"",F.NAVIGATION_DUPLICATED+"";function Pe(e,t){return H(new Error,{type:e,[Qt]:!0},t)}function ue(e,t){return e instanceof Error&&Qt in e&&(t==null||!!(e.type&t))}const Qn=["params","query","hash"];function Yn(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Qn)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Jn(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;s<n.length;++s){const a=n[s].replace(jt," "),f=a.indexOf("="),p=Le(f<0?a:a.slice(0,f)),b=f<0?null:Le(a.slice(f+1));if(p in t){let r=t[p];oe(r)||(r=t[p]=[r]),r.push(b)}else t[p]=b}return t}function bt(e){let t="";for(let n in e){const s=e[n];if(n=On(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(oe(s)?s.map(a=>a&&at(a)):[s&&at(s)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+n,a!=null&&(t+="="+a))})}return t}function Xn(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=oe(s)?s.map(a=>a==null?null:""+a):s==null?s:""+s)}return t}const Zn=Symbol(""),wt=Symbol(""),dt=Symbol(""),Yt=Symbol(""),rt=Symbol("");function $e(){let e=[];function t(s){return e.push(s),()=>{const a=e.indexOf(s);a>-1&&e.splice(a,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ye(e,t,n,s,a,f=p=>p()){const p=s&&(s.enterCallbacks[a]=s.enterCallbacks[a]||[]);return()=>new Promise((b,r)=>{const d=u=>{u===!1?r(Pe(F.NAVIGATION_ABORTED,{from:n,to:t})):u instanceof Error?r(u):zn(u)?r(Pe(F.NAVIGATION_GUARD_REDIRECT,{from:t,to:u})):(p&&s.enterCallbacks[a]===p&&typeof u=="function"&&p.push(u),b())},v=f(()=>e.call(s&&s.instances[a],t,n,d));let i=Promise.resolve(v);e.length<3&&(i=i.then(d)),i.catch(u=>r(u))})}function ot(e,t,n,s,a=f=>f()){const f=[];for(const p of e)for(const b in p.components){let r=p.components[b];if(!(t!=="beforeRouteEnter"&&!p.instances[b]))if(Ut(r)){const d=(r.__vccOpts||r)[t];d&&f.push(ye(d,n,s,p,b,a))}else{let d=r();f.push(()=>d.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${b}" at "${p.path}"`);const i=wn(v)?v.default:v;p.mods[b]=v,p.components[b]=i;const u=(i.__vccOpts||i)[t];return u&&ye(u,n,s,p,b,a)()}))}}return f}function es(e,t){const n=[],s=[],a=[],f=Math.max(t.matched.length,e.matched.length);for(let p=0;p<f;p++){const b=t.matched[p];b&&(e.matched.find(d=>Se(d,b))?s.push(b):n.push(b));const r=e.matched[p];r&&(t.matched.find(d=>Se(d,r))||a.push(r))}return[n,s,a]}/*!
* vue-router v4.6.4
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/let ts=()=>location.protocol+"//"+location.host;function Jt(e,t){const{pathname:n,search:s,hash:a}=t,f=e.indexOf("#");if(f>-1){let p=a.includes(e.slice(f))?e.slice(f).length:1,b=a.slice(p);return b[0]!=="/"&&(b="/"+b),gt(b,"")}return gt(n,e)+s+a}function ns(e,t,n,s){let a=[],f=[],p=null;const b=({state:u})=>{const h=Jt(e,location),$=n.value,V=t.value;let L=0;if(u){if(n.value=h,t.value=u,p&&p===$){p=null;return}L=V?u.position-V.position:0}else s(h);a.forEach(T=>{T(n.value,$,{delta:L,type:it.pop,direction:L?L>0?st.forward:st.back:st.unknown})})};function r(){p=n.value}function d(u){a.push(u);const h=()=>{const $=a.indexOf(u);$>-1&&a.splice($,1)};return f.push(h),h}function v(){if(document.visibilityState==="hidden"){const{history:u}=window;if(!u.state)return;u.replaceState(H({},u.state,{scroll:Qe()}),"")}}function i(){for(const u of f)u();f=[],window.removeEventListener("popstate",b),window.removeEventListener("pagehide",v),document.removeEventListener("visibilitychange",v)}return window.addEventListener("popstate",b),window.addEventListener("pagehide",v),document.addEventListener("visibilitychange",v),{pauseListeners:r,listen:d,destroy:i}}function Et(e,t,n,s=!1,a=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:a?Qe():null}}function ss(e){const{history:t,location:n}=window,s={value:Jt(e,n)},a={value:t.state};a.value||f(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function f(r,d,v){const i=e.indexOf("#"),u=i>-1?(n.host&&document.querySelector("base")?e:e.slice(i))+r:ts()+e+r;try{t[v?"replaceState":"pushState"](d,"",u),a.value=d}catch(h){console.error(h),n[v?"replace":"assign"](u)}}function p(r,d){f(r,H({},t.state,Et(a.value.back,r,a.value.forward,!0),d,{position:a.value.position}),!0),s.value=r}function b(r,d){const v=H({},a.value,t.state,{forward:r,scroll:Qe()});f(v.current,v,!0),f(r,H({},Et(s.value,r,null),{position:v.position+1},d),!1),s.value=r}return{location:s,state:a,push:b,replace:p}}function os(e){e=Un(e);const t=ss(e),n=ns(e,t.state,t.location,t.replace);function s(f,p=!0){p||n.pauseListeners(),history.go(f)}const a=H({location:"",base:e,go:s,createHref:jn.bind(null,e)},t,n);return Object.defineProperty(a,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(a,"state",{enumerable:!0,get:()=>t.state.value}),a}let Re=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var z=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(z||{});const as={type:Re.Static,value:""},is=/[a-zA-Z0-9_]/;function ls(e){if(!e)return[[]];if(e==="/")return[[as]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${d}": ${h}`)}let n=z.Static,s=n;const a=[];let f;function p(){f&&a.push(f),f=[]}let b=0,r,d="",v="";function i(){d&&(n===z.Static?f.push({type:Re.Static,value:d}):n===z.Param||n===z.ParamRegExp||n===z.ParamRegExpEnd?(f.length>1&&(r==="*"||r==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),f.push({type:Re.Param,value:d,regexp:v,repeatable:r==="*"||r==="+",optional:r==="*"||r==="?"})):t("Invalid state to consume buffer"),d="")}function u(){d+=r}for(;b<e.length;){if(r=e[b++],r==="\\"&&n!==z.ParamRegExp){s=n,n=z.EscapeNext;continue}switch(n){case z.Static:r==="/"?(d&&i(),p()):r===":"?(i(),n=z.Param):u();break;case z.EscapeNext:u(),n=s;break;case z.Param:r==="("?n=z.ParamRegExp:is.test(r)?u():(i(),n=z.Static,r!=="*"&&r!=="?"&&r!=="+"&&b--);break;case z.ParamRegExp:r===")"?v[v.length-1]=="\\"?v=v.slice(0,-1)+r:n=z.ParamRegExpEnd:v+=r;break;case z.ParamRegExpEnd:i(),n=z.Static,r!=="*"&&r!=="?"&&r!=="+"&&b--,v="";break;default:t("Unknown state");break}}return n===z.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),i(),p(),a}const Rt="[^/]+?",rs={sensitive:!1,strict:!1,start:!0,end:!0};var ee=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(ee||{});const cs=/[.+*?^${}()[\]/\\]/g;function us(e,t){const n=H({},rs,t),s=[];let a=n.start?"^":"";const f=[];for(const d of e){const v=d.length?[]:[ee.Root];n.strict&&!d.length&&(a+="/");for(let i=0;i<d.length;i++){const u=d[i];let h=ee.Segment+(n.sensitive?ee.BonusCaseSensitive:0);if(u.type===Re.Static)i||(a+="/"),a+=u.value.replace(cs,"\\$&"),h+=ee.Static;else if(u.type===Re.Param){const{value:$,repeatable:V,optional:L,regexp:T}=u;f.push({name:$,repeatable:V,optional:L});const O=T||Rt;if(O!==Rt){h+=ee.BonusCustomRegExp;try{`${O}`}catch(D){throw new Error(`Invalid custom RegExp for param "${$}" (${O}): `+D.message)}}let I=V?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;i||(I=L&&d.length<2?`(?:/${I})`:"/"+I),L&&(I+="?"),a+=I,h+=ee.Dynamic,L&&(h+=ee.BonusOptional),V&&(h+=ee.BonusRepeatable),O===".*"&&(h+=ee.BonusWildcard)}v.push(h)}s.push(v)}if(n.strict&&n.end){const d=s.length-1;s[d][s[d].length-1]+=ee.BonusStrict}n.strict||(a+="/?"),n.end?a+="$":n.strict&&!a.endsWith("/")&&(a+="(?:/|$)");const p=new RegExp(a,n.sensitive?"":"i");function b(d){const v=d.match(p),i={};if(!v)return null;for(let u=1;u<v.length;u++){const h=v[u]||"",$=f[u-1];i[$.name]=h&&$.repeatable?h.split("/"):h}return i}function r(d){let v="",i=!1;for(const u of e){(!i||!v.endsWith("/"))&&(v+="/"),i=!1;for(const h of u)if(h.type===Re.Static)v+=h.value;else if(h.type===Re.Param){const{value:$,repeatable:V,optional:L}=h,T=$ in d?d[$]:"";if(oe(T)&&!V)throw new Error(`Provided param "${$}" is an array but it is not repeatable (* or + modifiers)`);const O=oe(T)?T.join("/"):T;if(!O)if(L)u.length<2&&(v.endsWith("/")?v=v.slice(0,-1):i=!0);else throw new Error(`Missing required param "${$}"`);v+=O}}return v||"/"}return{re:p,score:s,keys:f,parse:b,stringify:r}}function ds(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===ee.Static+ee.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===ee.Static+ee.Segment?1:-1:0}function Xt(e,t){let n=0;const s=e.score,a=t.score;for(;n<s.length&&n<a.length;){const f=ds(s[n],a[n]);if(f)return f;n++}if(Math.abs(a.length-s.length)===1){if(Ct(s))return 1;if(Ct(a))return-1}return a.length-s.length}function Ct(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const fs={strict:!1,end:!0,sensitive:!1};function ms(e,t,n){const s=us(ls(e.path),n),a=H(s,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function ps(e,t){const n=[],s=new Map;t=vt(fs,t);function a(i){return s.get(i)}function f(i,u,h){const $=!h,V=kt(i);V.aliasOf=h&&h.record;const L=vt(t,i),T=[V];if("alias"in i){const D=typeof i.alias=="string"?[i.alias]:i.alias;for(const R of D)T.push(kt(H({},V,{components:h?h.record.components:V.components,path:R,aliasOf:h?h.record:V})))}let O,I;for(const D of T){const{path:R}=D;if(u&&R[0]!=="/"){const g=u.record.path,w=g[g.length-1]==="/"?"":"/";D.path=u.record.path+(R&&w+R)}if(O=ms(D,u,L),h?h.alias.push(O):(I=I||O,I!==O&&I.alias.push(O),$&&i.name&&!It(O)&&p(i.name)),Zt(O)&&r(O),V.children){const g=V.children;for(let w=0;w<g.length;w++)f(g[w],O,h&&h.children[w])}h=h||O}return I?()=>{p(I)}:Ge}function p(i){if(zt(i)){const u=s.get(i);u&&(s.delete(i),n.splice(n.indexOf(u),1),u.children.forEach(p),u.alias.forEach(p))}else{const u=n.indexOf(i);u>-1&&(n.splice(u,1),i.record.name&&s.delete(i.record.name),i.children.forEach(p),i.alias.forEach(p))}}function b(){return n}function r(i){const u=gs(i,n);n.splice(u,0,i),i.record.name&&!It(i)&&s.set(i.record.name,i)}function d(i,u){let h,$={},V,L;if("name"in i&&i.name){if(h=s.get(i.name),!h)throw Pe(F.MATCHER_NOT_FOUND,{location:i});L=h.record.name,$=H(At(u.params,h.keys.filter(I=>!I.optional).concat(h.parent?h.parent.keys.filter(I=>I.optional):[]).map(I=>I.name)),i.params&&At(i.params,h.keys.map(I=>I.name))),V=h.stringify($)}else if(i.path!=null)V=i.path,h=n.find(I=>I.re.test(V)),h&&($=h.parse(V),L=h.record.name);else{if(h=u.name?s.get(u.name):n.find(I=>I.re.test(u.path)),!h)throw Pe(F.MATCHER_NOT_FOUND,{location:i,currentLocation:u});L=h.record.name,$=H({},u.params,i.params),V=h.stringify($)}const T=[];let O=h;for(;O;)T.unshift(O.record),O=O.parent;return{name:L,path:V,params:$,matched:T,meta:vs(T)}}e.forEach(i=>f(i));function v(){n.length=0,s.clear()}return{addRoute:f,resolve:d,removeRoute:p,clearRoutes:v,getRoutes:b,getRecordMatcher:a}}function At(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function kt(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:hs(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function hs(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function It(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function vs(e){return e.reduce((t,n)=>H(t,n.meta),{})}function gs(e,t){let n=0,s=t.length;for(;n!==s;){const f=n+s>>1;Xt(e,t[f])<0?s=f:n=f+1}const a=_s(e);return a&&(s=t.lastIndexOf(a,s-1)),s}function _s(e){let t=e;for(;t=t.parent;)if(Zt(t)&&Xt(e,t)===0)return t}function Zt({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Nt(e){const t=Ce(dt),n=Ce(Yt),s=ne(()=>{const r=y(e.to);return t.resolve(r)}),a=ne(()=>{const{matched:r}=s.value,{length:d}=r,v=r[d-1],i=n.matched;if(!v||!i.length)return-1;const u=i.findIndex(Se.bind(null,v));if(u>-1)return u;const h=xt(r[d-2]);return d>1&&xt(v)===h&&i[i.length-1].path!==h?i.findIndex(Se.bind(null,r[d-2])):u}),f=ne(()=>a.value>-1&&Es(n.params,s.value.params)),p=ne(()=>a.value>-1&&a.value===n.matched.length-1&&Wt(n.params,s.value.params));function b(r={}){if(ws(r)){const d=t[y(e.replace)?"replace":"push"](y(e.to)).catch(Ge);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:ne(()=>s.value.href),isActive:f,isExactActive:p,navigate:b}}function ys(e){return e.length===1?e[0]:e}const bs=Gt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Nt,setup(e,{slots:t}){const n=hn(Nt(e)),{options:s}=Ce(dt),a=ne(()=>({[St(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[St(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const f=t.default&&ys(t.default(n));return e.custom?f:Lt("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},f)}}}),Ke=bs;function ws(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Es(e,t){for(const n in t){const s=t[n],a=e[n];if(typeof s=="string"){if(s!==a)return!1}else if(!oe(a)||a.length!==s.length||s.some((f,p)=>f.valueOf()!==a[p].valueOf()))return!1}return!0}function xt(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const St=(e,t,n)=>e??t??n,Rs=Gt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Ce(rt),a=ne(()=>e.route||s.value),f=Ce(wt,0),p=ne(()=>{let d=y(f);const{matched:v}=a.value;let i;for(;(i=v[d])&&!i.components;)d++;return d}),b=ne(()=>a.value.matched[p.value]);Fe(wt,ne(()=>p.value+1)),Fe(Zn,b),Fe(rt,a);const r=U();return Ve(()=>[r.value,b.value,e.name],([d,v,i],[u,h,$])=>{v&&(v.instances[i]=d,h&&h!==v&&d&&d===u&&(v.leaveGuards.size||(v.leaveGuards=h.leaveGuards),v.updateGuards.size||(v.updateGuards=h.updateGuards))),d&&v&&(!h||!Se(v,h)||!u)&&(v.enterCallbacks[i]||[]).forEach(V=>V(d))},{flush:"post"}),()=>{const d=a.value,v=e.name,i=b.value,u=i&&i.components[v];if(!u)return Pt(n.default,{Component:u,route:d});const h=i.props[v],$=h?h===!0?d.params:typeof h=="function"?h(d):h:null,L=Lt(u,H({},$,t,{onVnodeUnmounted:T=>{T.component.isUnmounted&&(i.instances[v]=null)},ref:r}));return Pt(n.default,{Component:L,route:d})||L}}});function Pt(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const en=Rs;function Cs(e){const t=ps(e.routes,e),n=e.parseQuery||Jn,s=e.stringifyQuery||bt,a=e.history,f=$e(),p=$e(),b=$e(),r=pn(_e);let d=_e;Ne&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const v=tt.bind(null,c=>""+c),i=tt.bind(null,Dn),u=tt.bind(null,Le);function h(c,k){let E,x;return zt(c)?(E=t.getRecordMatcher(c),x=k):x=c,t.addRoute(x,E)}function $(c){const k=t.getRecordMatcher(c);k&&t.removeRoute(k)}function V(){return t.getRoutes().map(c=>c.record)}function L(c){return!!t.getRecordMatcher(c)}function T(c,k){if(k=H({},k||r.value),typeof c=="string"){const M=nt(n,c,k.path),q=t.resolve({path:M.path},k),te=a.createHref(M.fullPath);return H(M,q,{params:u(q.params),hash:Le(M.hash),redirectedFrom:void 0,href:te})}let E;if(c.path!=null)E=H({},c,{path:nt(n,c.path,k.path).path});else{const M=H({},c.params);for(const q in M)M[q]==null&&delete M[q];E=H({},c,{params:i(M)}),k.params=i(k.params)}const x=t.resolve(E,k),G=c.hash||"";x.params=v(u(x.params));const j=Vn(s,H({},c,{hash:Pn(G),path:x.path})),B=a.createHref(j);return H({fullPath:j,hash:G,query:s===bt?Xn(c.query):c.query||{}},x,{redirectedFrom:void 0,href:B})}function O(c){return typeof c=="string"?nt(n,c,r.value.path):H({},c)}function I(c,k){if(d!==c)return Pe(F.NAVIGATION_CANCELLED,{from:k,to:c})}function D(c){return w(c)}function R(c){return D(H(O(c),{replace:!0}))}function g(c,k){const E=c.matched[c.matched.length-1];if(E&&E.redirect){const{redirect:x}=E;let G=typeof x=="function"?x(c,k):x;return typeof G=="string"&&(G=G.includes("?")||G.includes("#")?G=O(G):{path:G},G.params={}),H({query:c.query,hash:c.hash,params:G.path!=null?{}:c.params},G)}}function w(c,k){const E=d=T(c),x=r.value,G=c.state,j=c.force,B=c.replace===!0,M=g(E,x);if(M)return w(H(O(M),{state:typeof M=="object"?H({},G,M.state):G,force:j,replace:B}),k||E);const q=E;q.redirectedFrom=k;let te;return!j&&Bn(s,x,E)&&(te=Pe(F.NAVIGATION_DUPLICATED,{to:q,from:x}),Te(x,x,!0,!1)),(te?Promise.resolve(te):me(q,x)).catch(J=>ue(J)?ue(J,F.NAVIGATION_GUARD_REDIRECT)?J:ve(J):Oe(J,q,x)).then(J=>{if(J){if(ue(J,F.NAVIGATION_GUARD_REDIRECT))return w(H({replace:B},O(J.to),{state:typeof J.to=="object"?H({},G,J.to.state):G,force:j}),k||q)}else J=be(q,x,!0,B,G);return pe(q,x,J),J})}function Y(c,k){const E=I(c,k);return E?Promise.reject(E):Promise.resolve()}function ae(c){const k=ke.values().next().value;return k&&typeof k.runWithContext=="function"?k.runWithContext(c):c()}function me(c,k){let E;const[x,G,j]=es(c,k);E=ot(x.reverse(),"beforeRouteLeave",c,k);for(const M of x)M.leaveGuards.forEach(q=>{E.push(ye(q,c,k))});const B=Y.bind(null,c,k);return E.push(B),ge(E).then(()=>{E=[];for(const M of f.list())E.push(ye(M,c,k));return E.push(B),ge(E)}).then(()=>{E=ot(G,"beforeRouteUpdate",c,k);for(const M of G)M.updateGuards.forEach(q=>{E.push(ye(q,c,k))});return E.push(B),ge(E)}).then(()=>{E=[];for(const M of j)if(M.beforeEnter)if(oe(M.beforeEnter))for(const q of M.beforeEnter)E.push(ye(q,c,k));else E.push(ye(M.beforeEnter,c,k));return E.push(B),ge(E)}).then(()=>(c.matched.forEach(M=>M.enterCallbacks={}),E=ot(j,"beforeRouteEnter",c,k,ae),E.push(B),ge(E))).then(()=>{E=[];for(const M of p.list())E.push(ye(M,c,k));return E.push(B),ge(E)}).catch(M=>ue(M,F.NAVIGATION_CANCELLED)?M:Promise.reject(M))}function pe(c,k,E){b.list().forEach(x=>ae(()=>x(c,k,E)))}function be(c,k,E,x,G){const j=I(c,k);if(j)return j;const B=k===_e,M=Ne?history.state:{};E&&(x||B?a.replace(c.fullPath,H({scroll:B&&M&&M.scroll},G)):a.push(c.fullPath,G)),r.value=c,Te(c,k,E,B),ve()}let ce;function K(){ce||(ce=a.listen((c,k,E)=>{if(!we.listening)return;const x=T(c),G=g(x,we.currentRoute.value);if(G){w(H(G,{replace:!0,force:!0}),x).catch(Ge);return}d=x;const j=r.value;Ne&&Kn(yt(j.fullPath,E.delta),Qe()),me(x,j).catch(B=>ue(B,F.NAVIGATION_ABORTED|F.NAVIGATION_CANCELLED)?B:ue(B,F.NAVIGATION_GUARD_REDIRECT)?(w(H(O(B.to),{force:!0}),x).then(M=>{ue(M,F.NAVIGATION_ABORTED|F.NAVIGATION_DUPLICATED)&&!E.delta&&E.type===it.pop&&a.go(-1,!1)}).catch(Ge),Promise.reject()):(E.delta&&a.go(-E.delta,!1),Oe(B,x,j))).then(B=>{B=B||be(x,j,!1),B&&(E.delta&&!ue(B,F.NAVIGATION_CANCELLED)?a.go(-E.delta,!1):E.type===it.pop&&ue(B,F.NAVIGATION_ABORTED|F.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),pe(x,j,B)}).catch(Ge)}))}let he=$e(),He=$e(),Ae;function Oe(c,k,E){ve(c);const x=He.list();return x.length?x.forEach(G=>G(c,k,E)):console.error(c),Promise.reject(c)}function Ye(){return Ae&&r.value!==_e?Promise.resolve():new Promise((c,k)=>{he.add([c,k])})}function ve(c){return Ae||(Ae=!c,K(),he.list().forEach(([k,E])=>c?E(c):k()),he.reset()),c}function Te(c,k,E,x){const{scrollBehavior:G}=e;if(!Ne||!G)return Promise.resolve();const j=!E&&Wn(yt(c.fullPath,0))||(x||!E)&&history.state&&history.state.scroll||null;return We().then(()=>G(c,k,j)).then(B=>B&&qn(B)).catch(B=>Oe(B,c,k))}const De=c=>a.go(c);let Me;const ke=new Set,we={currentRoute:r,listening:!0,addRoute:h,removeRoute:$,clearRoutes:t.clearRoutes,hasRoute:L,getRoutes:V,resolve:T,options:e,push:D,replace:R,go:De,back:()=>De(-1),forward:()=>De(1),beforeEach:f.add,beforeResolve:p.add,afterEach:b.add,onError:He.add,isReady:Ye,install(c){c.component("RouterLink",Ke),c.component("RouterView",en),c.config.globalProperties.$router=we,Object.defineProperty(c.config.globalProperties,"$route",{enumerable:!0,get:()=>y(r)}),Ne&&!Me&&r.value===_e&&(Me=!0,D(a.location).catch(x=>{}));const k={};for(const x in _e)Object.defineProperty(k,x,{get:()=>r.value[x],enumerable:!0});c.provide(dt,we),c.provide(Yt,mn(k)),c.provide(rt,r);const E=c.unmount;ke.add(c),c.unmount=function(){ke.delete(c),ke.size<1&&(d=_e,ce&&ce(),ce=null,r.value=_e,Me=!1,Ae=!1),E()}}};function ge(c){return c.reduce((k,E)=>k.then(()=>ae(E)),Promise.resolve())}return we}const ft=Symbol("commRealtime");function Ie(){const e=window.APP||{};return typeof window.Echo<"u"&&(e.PUSHER_ENABLED===!0||e.PUSHER_ENABLED==="1"||e.PUSHER_ENABLED===1)}function As(){const e=U(!1),t=Ue(),n=t.businessId,s=t.userId,a=new Map;let f=null,p=!1;const b=new Set;function r(I){return b.add(I),()=>b.delete(I)}function d(I,...D){b.forEach(R=>{var g;return(g=R[I])==null?void 0:g.call(R,...D)})}function v(I){return`business.${n}.chat.${I}`}function i(){return`business.${n}.user.${s}`}function u(I){if(!Ie()||!I)return;const D=parseInt(I,10);if(a.has(D))return;const R=v(D),g=window.Echo.private(R);g.listen(".message.sent",w=>d("onMessage",w,D)).listen(".user.typing",w=>d("onTyping",w,D)).listenForWhisper("typing",w=>{d("onTyping",{...w,room_id:w.room_id??D},D)}),a.set(D,{name:R,channel:g})}function h(I){const D=parseInt(I,10),R=a.get(D);!R||typeof window.Echo>"u"||(window.Echo.leave(R.name),a.delete(D))}function $(I){if(!Ie())return;const D=new Set((I||[]).map(R=>parseInt(R,10)));a.forEach((R,g)=>{D.has(g)||h(g)}),D.forEach(R=>u(R))}function V(){!Ie()||f||(f=i(),window.Echo.private(f).listen(".meeting.invite",I=>d("onMeetingInvite",I)))}function L(I,D={}){var w;if(!Ie())return!1;const R=parseInt(I,10),g=a.get(R);return(w=g==null?void 0:g.channel)!=null&&w.whisper?(g.channel.whisper("typing",{room_id:R,user_id:s,user_name:t.userName||D.user_name||"User",...D}),!0):!1}function T(){var g,w;if(!Ie()||p||!((w=(g=window.Echo)==null?void 0:g.connector)!=null&&w.pusher))return;p=!0;const I=window.Echo.connector.pusher.connection,D=()=>{e.value=!0,d("onConnected")},R=()=>{e.value=!1,d("onDisconnected")};I.bind("connected",D),I.bind("disconnected",R),I.bind("unavailable",R),I.bind("failed",R),I.state==="connected"&&D()}function O(){typeof window.Echo>"u"||(a.forEach(I=>window.Echo.leave(I.name)),a.clear(),f&&(window.Echo.leave(f),f=null),b.clear(),p=!1)}return{connected:e,register:r,isRealtimeEnabled:Ie,bindConnection:T,syncRoomSubscriptions:$,subscribeUserChannel:V,whisperTyping:L,cleanup:O}}function re(){var e;return((e=Ue().routes)==null?void 0:e.chat)||{}}function ks(){return le.get(re().colleagues).then(e=>e.data)}function Is(e={}){return le.get(re().rooms,{params:e}).then(t=>t.data)}function Ot(e){return le.get(`${re().rooms}/${e}`).then(t=>t.data)}function Ns(e,t={}){return le.get(`${re().rooms}/${e}/messages`,{params:t}).then(n=>n.data)}function xs(e,t){return le.post(`${re().rooms}/${e}/messages`,{body:t}).then(n=>n.data)}function Tt(e){return le.post(`${re().rooms}/${e}/read`)}function tn(){return le.post(re().heartbeat)}function Dt(e){return le.post(re().createRoom,e).then(t=>t.data)}function Ss(e,t){return le.post(`${re().rooms}/${e}/members`,{user_id:t}).then(n=>n.data)}function Ps(e,t){return le.delete(`${re().rooms}/${e}/members/${t}`).then(n=>n.data)}function Os(){const t=(Ue().presenceHeartbeatSeconds||60)*1e3;let n=null;function s(){if(n)return;const f=()=>tn().catch(()=>{});f(),n=setInterval(f,t)}function a(){n&&(clearInterval(n),n=null)}return{start:s,stop:a}}const mt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,a]of t)n[s]=a;return n},Ts={class:"no-print communication-shell"},Ds={class:"communication-head"},Ms={class:"communication-tabs"},$s={__name:"CommNav",setup(e){return(t,n)=>(S(),P("section",Ts,[o("div",Ds,[xe(y(Ke),{class:"communication-brand",to:{name:"communication.chat"}},{default:et(()=>[n[0]||(n[0]=o("i",{class:"fa fa-comments"},null,-1)),Q(" "+C(y(_)("module_name","Communication")),1)]),_:1})]),o("div",Ms,[xe(y(Ke),{class:Z(["communication-tab",{active:t.$route.name==="communication.chat"}]),to:{name:"communication.chat"}},{default:et(()=>[Q(C(y(_)("chat")),1)]),_:1},8,["class"]),xe(y(Ke),{class:Z(["communication-tab",{active:t.$route.name==="communication.meetings"}]),to:{name:"communication.meetings"}},{default:et(()=>[Q(C(y(_)("meetings")),1)]),_:1},8,["class"])])]))}},Vs=mt($s,[["__scopeId","data-v-9ed74ad8"]]),Bs={class:"comm-router-view"},Gs={__name:"App",setup(e){const t=As();Fe(ft,t);const n=Os();return ze(()=>{n.start(),t.isRealtimeEnabled()&&(t.bindConnection(),t.subscribeUserChannel())}),ct(()=>{n.stop(),t.cleanup()}),(s,a)=>(S(),P(se,null,[xe(Vs),o("div",Bs,[xe(y(en))])],64))}},Ls=mt(Gs,[["__scopeId","data-v-4e7bc162"]]);function fe(e){if(!e)return"";if(e.full_name)return String(e.full_name).trim();const n=[e.surname,e.first_name,e.last_name].filter(Boolean).join(" ").trim();return n||(e.username?e.username:e.email?e.email:"")}function Mt(e,t="You"){return e?fe(e)||t:""}function $t(e){var n,s;const t=(e||"?").trim().split(/\s+/);return(((n=t[0])==null?void 0:n[0])||"?")+(((s=t[1])==null?void 0:s[0])||"")}function Vt(e){var t;if(!e)return"";if((t=window.CommDate)!=null&&t.formatTime)return window.CommDate.formatTime(e);try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return""}}function Us(e){var t;if(!e)return"-";if((t=window.CommDate)!=null&&t.formatDateTime)return window.CommDate.formatDateTime(e);try{return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return"-"}}const Hs=["value","placeholder","disabled"],js=["disabled"],Fs={__name:"ChatComposer",props:{modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},placeholder:{type:String,default:""}},emits:["update:modelValue","submit","typing"],setup(e,{expose:t,emit:n}){const s=e,a=n,f=U(null);function p(){We(()=>{var d;return(d=f.value)==null?void 0:d.focus()})}function b(d){a("update:modelValue",d.target.value),a("typing")}function r(d){d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),!s.disabled&&!s.sending&&s.modelValue.trim()&&a("submit"))}return Ve(()=>s.disabled,(d,v)=>{v&&!d&&p()}),ze(()=>{s.disabled||p()}),t({focus:p}),(d,v)=>(S(),P("form",{class:"chat-composer-form",onSubmit:v[0]||(v[0]=Ee(i=>a("submit"),["prevent"]))},[o("textarea",{ref_key:"inputRef",ref:f,class:"comm-input chat-composer-input",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled||e.sending,rows:"1",autocomplete:"off",onInput:b,onKeydown:r},null,40,Hs),o("button",{type:"submit",class:"comm-btn comm-btn-primary",disabled:e.disabled||e.sending||!e.modelValue.trim()},[o("i",{class:Z(e.sending?"fa fa-spinner fa-spin":"fa fa-paper-plane")},null,2)],8,js)],32))}},qs={class:"chat-sidebar"},Ks={class:"comm-card"},Ws={class:"comm-card-header"},zs={class:"comm-card-title"},Qs=["title"],Ys={style:{padding:"12px 14px 0"}},Js=["placeholder"],Xs={class:"comm-tabs",style:{"margin-top":"10px"}},Zs={id:"room-list"},eo={key:0,class:"comm-empty"},to=["onClick"],no={class:"room-item-inner"},so={class:"comm-avatar comm-avatar-sm"},oo={key:0,class:"comm-online-dot"},ao={class:"room-item-body"},io={class:"room-item-top"},lo={class:"room-item-name"},ro={class:"text-muted"},co={class:"room-item-bottom"},uo={class:"room-item-preview"},fo={key:0,class:"comm-badge"},mo={class:"chat-main"},po={class:"comm-card chat-panel"},ho={class:"comm-card-header chat-panel-header"},vo={style:{display:"flex","align-items":"center",gap:"12px"}},go=["title"],_o={class:"comm-avatar"},yo={class:"comm-card-title"},bo={class:"text-muted"},wo={class:"chat-header-tools"},Eo=["placeholder"],Ro={class:"chat-body"},Co={key:0,class:"comm-empty"},Ao={class:"chat-bubble"},ko={key:0,class:"chat-bubble-name"},Io={class:"chat-bubble-body"},No={class:"chat-bubble-time"},xo={class:"chat-composer"},So={class:"modal-dialog"},Po={class:"modal-content",style:{"border-radius":"14px"}},Oo={class:"modal-header"},To={class:"modal-title"},Do={class:"modal-body"},Mo={value:""},$o=["value"],Vo={class:"modal-footer"},Bo={type:"submit",class:"comm-btn comm-btn-primary"},Go={class:"modal-dialog"},Lo={class:"modal-content",style:{"border-radius":"14px"}},Uo={class:"modal-header"},Ho={class:"modal-title"},jo={class:"modal-body"},Fo={class:"form-group"},qo={class:"form-group"},Ko=["value"],Wo={class:"modal-footer"},zo={type:"submit",class:"comm-btn comm-btn-primary"},Qo={class:"modal-dialog"},Yo={class:"modal-content",style:{"border-radius":"14px"}},Jo={class:"modal-header"},Xo={class:"modal-title"},Zo={class:"modal-body"},ea={class:"list-group"},ta={key:0,class:"comm-chip comm-chip-active"},na=["onClick"],sa=["onClick"],oa={key:0},aa={key:1},ia={class:"input-group"},la=["value"],ra={class:"input-group-btn"},ca={key:3,class:"modal-backdrop fade in"},ua={__name:"ChatApp",setup(e){const t=Ue(),n=t.userId,s=t.typingTimeoutMs||2500,a=(t.pollingFallbackSeconds||30)*1e3,f=U([]),p=U([]),b=U(!1),r=U("all"),d=U(""),v=U(""),i=U(null),u=U(null),h=U([]),$=U(""),V=U(!1),L=U(!1),T=U(!1),O=U(!1),I=U(!1),D=U(""),R=U(""),g=U([]),w=U("");let Y=null,ae=0,me=null,pe=null;const be=U(null),ce=U(null),K=Ce(ft);let he=null;function He(m,l){const N=m==null?void 0:m.message;N&&(G(l,N),parseInt(i.value,10)===parseInt(l,10)?(B(N),Tt(l).catch(()=>{})):j(l))}function Ae(m,l){const N=parseInt(m==null?void 0:m.user_id,10);if(!N||N===parseInt(n,10)||parseInt(i.value,10)!==parseInt(l,10))return;const W=m.user_name||fe(m.user)||_("group","User");$.value=_("user_typing",":name is typing...").replace(":name",W),clearTimeout(Y),Y=setTimeout(()=>{$.value=""},s)}function Oe(){ht()}function Ye(){Xe()}function ve(m){if(m.type==="group")return m.name||_("group","Group");const l=(m.members||[]).find(N=>N.id!==n);return l?fe(l):_("group","Group")}function Te(m){if(m.is_other_online!==void 0)return m.is_other_online;const l=(m.members||[]).find(N=>N.id!==n);return l?!!l.is_online:!1}const De=ne(()=>u.value?u.value.type==="direct"?Te(u.value)?_("online"):_("offline"):`${(u.value.members||[]).length} ${_("members","members")}`:""),Me=ne(()=>{var m;return((m=u.value)==null?void 0:m.type)==="group"});function ke(m){var N;const l=(m.latest_message||{}).body||"";return l?m.type==="group"&&((N=m.latest_message)!=null&&N.user)?`${Mt(m.latest_message.user,_("you"))}: ${l}`:l:""}function we(m){return parseInt(m.user_id,10)===parseInt(n,10)?_("you"):Mt(m.user)}function ge(m){return Me.value||parseInt(m.user_id,10)!==parseInt(n,10)}function c(m){const l=fe(m),N=m.username?` (@${m.username})`:"";return`${l}${N}${m.is_online?" ●":""}`}const k=ne(()=>{var m;return((m=u.value)==null?void 0:m.created_by)===n}),E=ne(()=>{var l;const m=new Set((((l=u.value)==null?void 0:l.members)||[]).map(N=>N.id));return f.value.filter(N=>!m.has(N.id))});function x(m){typeof window.toastr<"u"?window.toastr.error(m):alert(m)}function G(m,l){p.value=p.value.map(N=>parseInt(N.id,10)!==parseInt(m,10)?N:{...N,latest_message:l,last_message_at:l.created_at})}function j(m){p.value=p.value.map(l=>parseInt(l.id,10)!==parseInt(m,10)?l:{...l,unread_count:(l.unread_count||0)+1})}function B(m){m!=null&&m.body&&(h.value.some(l=>l.id&&m.id&&l.id===m.id)||(h.value.push(m),M()))}async function M(){await We(),be.value&&(be.value.scrollTop=be.value.scrollHeight)}async function q(){f.value=await ks()}async function te(){if(!b.value){b.value=!0;try{const m=await Is({q:d.value.trim(),type:r.value==="all"?"":r.value});p.value=m||[],K.syncRoomSubscriptions(p.value.map(l=>l.id))}finally{b.value=!1}}}async function J(m){const l=v.value.trim()?{search:v.value.trim()}:{};h.value=await Ns(m,l),await M()}async function nn(m){var l;i.value=m.id,u.value=m,V.value=!0,await J(m.id),await Tt(m.id),p.value=p.value.map(N=>parseInt(N.id,10)===parseInt(m.id,10)?{...N,unread_count:0}:N),await We(),(l=ce.value)==null||l.focus()}async function Je(m){var l;try{(l=m.members)!=null&&l.length||(m=await Ot(m.id)),await nn(m)}catch{x(_("send_failed"))}}function sn(){V.value=!1}async function on(m){var l,N;if(!(!m.trim()||!i.value||L.value)){L.value=!0;try{const W=await xs(i.value,m.trim());W!=null&&W.body?(B(W),G(i.value,W)):await J(i.value)}catch(W){x(((N=(l=W.response)==null?void 0:l.data)==null?void 0:N.message)||_("send_failed"))}finally{L.value=!1}}}const je=U("");async function an(){var l;const m=je.value;m.trim()&&(je.value="",await on(m),(l=ce.value)==null||l.focus())}function ln(){var l;if(!i.value)return;const m=Date.now();m-ae<1500||(ae=m,(l=K==null?void 0:K.whisperTyping)==null||l.call(K,i.value))}async function rn(){var m,l;if(D.value)try{const N=await Dt({type:"direct",user_id:D.value});T.value=!1,D.value="",await te(),N!=null&&N.id&&await Je(N)}catch(N){x(((l=(m=N.response)==null?void 0:m.data)==null?void 0:l.message)||_("send_failed"))}}async function cn(){var m,l;if(!(!R.value.trim()||!g.value.length))try{const N=await Dt({type:"group",name:R.value.trim(),member_ids:g.value});O.value=!1,R.value="",g.value=[],await te(),N!=null&&N.id&&await Je(N)}catch(N){x(((l=(m=N.response)==null?void 0:m.data)==null?void 0:l.message)||_("send_failed"))}}async function un(){!u.value&&i.value&&(u.value=await Ot(i.value)),I.value=!0}async function dn(){var m,l;if(!(!w.value||!i.value))try{u.value=await Ss(i.value,w.value),w.value="",await te()}catch(N){x(((l=(m=N.response)==null?void 0:m.data)==null?void 0:l.message)||_("send_failed"))}}async function pt(m){var l,N;if(i.value)try{const W=await Ps(i.value,m);parseInt(m,10)===parseInt(n,10)?(I.value=!1,i.value=null,u.value=null,V.value=!1,h.value=[]):u.value=W,await te()}catch(W){x(((N=(l=W.response)==null?void 0:l.data)==null?void 0:N.message)||_("send_failed"))}}function Xe(){me||(me=setInterval(()=>{tn().finally(te)},a))}function ht(){me&&(clearInterval(me),me=null)}return Ve(d,()=>{clearTimeout(pe),pe=setTimeout(te,300)}),Ve(r,()=>te()),Ve(v,()=>{clearTimeout(pe),pe=setTimeout(()=>{i.value&&J(i.value)},300)}),ze(async()=>{var m,l,N;he=(m=K==null?void 0:K.register)==null?void 0:m.call(K,{onMessage:He,onTyping:Ae,onConnected:Oe,onDisconnected:Ye}),await q(),await te(),(l=K==null?void 0:K.isRealtimeEnabled)!=null&&l.call(K)?(N=K.connected)!=null&&N.value||setTimeout(()=>{var W;(W=K.connected)!=null&&W.value||Xe()},5e3):Xe()}),ct(()=>{he==null||he(),ht(),clearTimeout(Y),clearTimeout(pe)}),(m,l)=>{var N,W;return S(),P("div",{class:Z(["chat-shell",{"room-open":V.value}])},[o("div",qs,[o("div",Ks,[o("div",Ws,[o("h3",zs,C(y(_)("chat")),1),o("div",null,[o("button",{type:"button",class:"comm-btn comm-btn-ghost btn-sm",title:y(_)("new_direct_chat"),onClick:l[0]||(l[0]=A=>T.value=!0)},[...l[20]||(l[20]=[o("i",{class:"fa fa-user-plus"},null,-1)])],8,Qs),o("button",{type:"button",class:"comm-btn comm-btn-primary btn-sm",onClick:l[1]||(l[1]=A=>O.value=!0)},[l[21]||(l[21]=o("i",{class:"fa fa-users"},null,-1)),Q(" "+C(y(_)("new_group")),1)])])]),o("div",Ys,[ie(o("input",{"onUpdate:modelValue":l[2]||(l[2]=A=>d.value=A),type:"text",class:"comm-input",placeholder:y(_)("search_chats")},null,8,Js),[[Be,d.value]]),o("div",Xs,[o("button",{type:"button",class:Z(["comm-tab",{active:r.value==="all"}]),onClick:l[3]||(l[3]=A=>r.value="all")},C(y(_)("filter_all")),3),o("button",{type:"button",class:Z(["comm-tab",{active:r.value==="direct"}]),onClick:l[4]||(l[4]=A=>r.value="direct")},C(y(_)("filter_direct")),3),o("button",{type:"button",class:Z(["comm-tab",{active:r.value==="group"}]),onClick:l[5]||(l[5]=A=>r.value="group")},C(y(_)("filter_group")),3)])]),o("div",Zs,[p.value.length?X("",!0):(S(),P("div",eo,[l[22]||(l[22]=o("i",{class:"fa fa-comments-o"},null,-1)),o("p",null,C(y(_)("no_rooms")),1)])),(S(!0),P(se,null,de(p.value,A=>(S(),P("div",{key:A.id,class:Z(["room-item",{active:i.value===A.id}]),onClick:Ze=>Je(A)},[o("div",no,[o("div",so,[Q(C(y($t)(ve(A)))+" ",1),A.type==="direct"&&Te(A)?(S(),P("span",oo)):X("",!0)]),o("div",ao,[o("div",io,[o("span",lo,C(ve(A)),1),o("small",ro,C(y(Vt)((A.latest_message||{}).created_at||A.last_message_at)),1)]),o("div",co,[o("small",uo,C(ke(A)),1),A.unread_count>0?(S(),P("span",fo,C(A.unread_count),1)):X("",!0)])])])],10,to))),128))])])]),o("div",mo,[o("div",po,[o("div",ho,[o("div",vo,[o("button",{type:"button",class:"chat-back-btn",title:y(_)("go_back","Back"),onClick:sn},[...l[23]||(l[23]=[o("i",{class:"fa fa-arrow-right"},null,-1)])],8,go),o("div",_o,C(u.value?y($t)(ve(u.value)):"?"),1),o("div",null,[o("h3",yo,C(u.value?ve(u.value):y(_)("select_chat")),1),o("small",bo,C(De.value),1)])]),o("div",wo,[i.value?ie((S(),P("input",{key:0,"onUpdate:modelValue":l[6]||(l[6]=A=>v.value=A),type:"text",class:"comm-input",placeholder:y(_)("search_messages")},null,8,Eo)),[[Be,v.value]]):X("",!0),((N=u.value)==null?void 0:N.type)==="group"?(S(),P("button",{key:1,type:"button",class:"comm-btn comm-btn-ghost btn-sm",onClick:un},[...l[24]||(l[24]=[o("i",{class:"fa fa-users"},null,-1)])])):X("",!0)])]),o("div",Ro,[o("div",{class:Z(["chat-typing-line",{visible:!!$.value}])},C($.value),3),o("div",{id:"chat-box",ref_key:"messageBox",ref:be},[h.value.length?X("",!0):(S(),P("div",Co,[l[25]||(l[25]=o("i",{class:"fa fa-comment-o"},null,-1)),o("p",null,C(i.value?y(_)("no_messages"):y(_)("select_chat")),1)])),(S(!0),P(se,null,de(h.value,A=>(S(),P("div",{key:A.id||`tmp-${A.created_at}-${A.user_id}`,class:Z(["chat-msg",parseInt(A.user_id,10)===parseInt(y(n),10)?"mine":"other"])},[o("div",Ao,[ge(A)?(S(),P("div",ko,C(we(A)),1)):X("",!0),o("div",Io,C(A.body),1),o("div",No,C(y(Vt)(A.created_at)),1)])],2))),128))],512),o("div",xo,[xe(Fs,{ref_key:"composerRef",ref:ce,modelValue:je.value,"onUpdate:modelValue":l[7]||(l[7]=A=>je.value=A),disabled:!i.value,sending:L.value,placeholder:y(_)("type_message"),onSubmit:an,onTyping:ln},null,8,["modelValue","disabled","sending","placeholder"])])])])]),T.value?(S(),P("div",{key:0,class:"modal fade in",style:{display:"block"},onClick:l[11]||(l[11]=Ee(A=>T.value=!1,["self"]))},[o("div",So,[o("div",Po,[o("div",Oo,[o("button",{type:"button",class:"close",onClick:l[8]||(l[8]=A=>T.value=!1)},"×"),o("h4",To,C(y(_)("new_direct_chat")),1)]),o("form",{onSubmit:Ee(rn,["prevent"])},[o("div",Do,[ie(o("select",{"onUpdate:modelValue":l[9]||(l[9]=A=>D.value=A),class:"form-control",required:""},[o("option",Mo,C(y(_)("select_colleague")),1),(S(!0),P(se,null,de(f.value,A=>(S(),P("option",{key:A.id,value:A.id},C(c(A)),9,$o))),128))],512),[[qe,D.value]])]),o("div",Vo,[o("button",{type:"button",class:"btn btn-default",onClick:l[10]||(l[10]=A=>T.value=!1)},C(y(_)("cancel","Cancel")),1),o("button",Bo,C(y(_)("start_chat")),1)])],32)])])])):X("",!0),O.value?(S(),P("div",{key:1,class:"modal fade in",style:{display:"block"},onClick:l[16]||(l[16]=Ee(A=>O.value=!1,["self"]))},[o("div",Go,[o("div",Lo,[o("div",Uo,[o("button",{type:"button",class:"close",onClick:l[12]||(l[12]=A=>O.value=!1)},"×"),o("h4",Ho,C(y(_)("new_group")),1)]),o("form",{onSubmit:Ee(cn,["prevent"])},[o("div",jo,[o("div",Fo,[o("label",null,C(y(_)("group_name")),1),ie(o("input",{"onUpdate:modelValue":l[13]||(l[13]=A=>R.value=A),type:"text",class:"comm-input",required:""},null,512),[[Be,R.value]])]),o("div",qo,[o("label",null,C(y(_)("group_members")),1),ie(o("select",{"onUpdate:modelValue":l[14]||(l[14]=A=>g.value=A),class:"form-control",multiple:"",required:""},[(S(!0),P(se,null,de(f.value,A=>(S(),P("option",{key:A.id,value:A.id},C(c(A).replace(" ●","")),9,Ko))),128))],512),[[qe,g.value]])])]),o("div",Wo,[o("button",{type:"button",class:"btn btn-default",onClick:l[15]||(l[15]=A=>O.value=!1)},C(y(_)("cancel","Cancel")),1),o("button",zo,C(y(_)("create_group")),1)])],32)])])])):X("",!0),I.value?(S(),P("div",{key:2,class:"modal fade in",style:{display:"block"},onClick:l[19]||(l[19]=Ee(A=>I.value=!1,["self"]))},[o("div",Qo,[o("div",Yo,[o("div",Jo,[o("button",{type:"button",class:"close",onClick:l[17]||(l[17]=A=>I.value=!1)},"×"),o("h4",Xo,C(y(_)("group_members")),1)]),o("div",Zo,[o("ul",ea,[(S(!0),P(se,null,de(((W=u.value)==null?void 0:W.members)||[],A=>{var Ze;return S(),P("li",{key:A.id,class:"list-group-item",style:{display:"flex","justify-content":"space-between","align-items":"center"}},[o("span",null,[Q(C(y(fe)(A))+" ",1),A.is_online?(S(),P("span",ta,C(y(_)("online")),1)):X("",!0)]),k.value&&A.id!==y(n)?(S(),P("button",{key:0,type:"button",class:"comm-btn comm-btn-danger btn-xs",onClick:fn=>pt(A.id)},C(y(_)("remove")),9,na)):A.id===y(n)&&((Ze=u.value)==null?void 0:Ze.type)==="group"?(S(),P("button",{key:1,type:"button",class:"comm-btn comm-btn-danger btn-xs",onClick:fn=>pt(A.id)},C(y(_)("leave_group")),9,sa)):X("",!0)])}),128))]),k.value?(S(),P("hr",oa)):X("",!0),k.value?(S(),P("div",aa,[o("label",null,C(y(_)("add_member")),1),o("div",ia,[ie(o("select",{"onUpdate:modelValue":l[18]||(l[18]=A=>w.value=A),class:"form-control"},[l[26]||(l[26]=o("option",{value:""},"-",-1)),(S(!0),P(se,null,de(E.value,A=>(S(),P("option",{key:A.id,value:A.id},C(y(fe)(A)),9,la))),128))],512),[[qe,w.value]]),o("span",ra,[o("button",{type:"button",class:"comm-btn comm-btn-primary",onClick:dn},C(y(_)("add")),1)])])])):X("",!0)])])])])):X("",!0),T.value||O.value||I.value?(S(),P("div",ca)):X("",!0)],2)}}},da=mt(ua,[["__scopeId","data-v-aeb3f79a"]]),fa={class:"row"},ma={class:"col-md-12"},pa={class:"comm-card",style:{"margin-bottom":"18px"}},ha={class:"comm-card-header"},va={class:"comm-card-title"},ga={style:{padding:"18px"}},_a={class:"row"},ya={class:"col-md-4"},ba={class:"form-group"},wa=["placeholder"],Ea={class:"col-md-3"},Ra={class:"form-group"},Ca={class:"col-md-3"},Aa={class:"form-group"},ka=["value"],Ia={class:"col-md-2"},Na={class:"form-group"},xa={style:{display:"block","margin-top":"8px"}},Sa=["disabled"],Pa={class:"comm-card"},Oa={class:"comm-card-header"},Ta={class:"comm-card-title"},Da={class:"comm-tabs"},Ma={class:"badge"},$a={class:"badge"},Va={class:"badge"},Ba={class:"badge"},Ga={style:{padding:"16px 18px 20px"}},La={key:0,class:"text-center",style:{padding:"30px"}},Ua={key:1,class:"comm-empty"},Ha={key:2,class:"row"},ja={style:{border:"1px solid #e7ecf3","border-radius":"14px",padding:"16px",background:"#fff",height:"100%"}},Fa={style:{display:"flex","justify-content":"space-between","align-items":"flex-start",gap:"10px"}},qa={style:{margin:"0 0 6px","font-weight":"600"}},Ka={style:{display:"flex",gap:"6px","flex-shrink":"0"}},Wa=["onClick"],za=["onClick"],Qa={style:{"margin-top":"12px","font-size":"13px",color:"#6b7a8c"}},Ya={style:{"margin-top":"6px"}},Ja={class:"text-muted"},Xa={__name:"MeetingsApp",setup(e){const t=Ue(),n=t.colleagues||[],s=t.userId,a=Ce(ft);let f=null;const p=U([]),b=U({all:0,scheduled:0,active:0,ended:0}),r=U(""),d=U(!1),v=U(!1),i=U({title:"",scheduled_at:"",participant_ids:[],start_now:!0});function u(R){const g=R==null?void 0:R.meeting,w=(g==null?void 0:g.title)||"",Y=(R==null?void 0:R.inviter_name)||(R==null?void 0:R.inviterName)||"",ae=_("meeting_invite_notification",":inviter invited you").replace(":inviter",Y).replace(":title",w);typeof window.toastr<"u"&&window.toastr.info(ae),T()}function h(R){return{scheduled:_("status_scheduled"),active:_("status_active"),ended:_("status_ended")}[R]||R}function $(R){return{scheduled:"comm-chip-scheduled",active:"comm-chip-active",ended:"comm-chip-ended"}[R]||"comm-chip-ended"}function V(R){typeof window.toastr<"u"?window.toastr.error(R):alert(R)}function L(R){typeof window.toastr<"u"&&window.toastr.success(R)}async function T(){var R;d.value=!0;try{const g=await gn(r.value);p.value=((R=g.meetings)==null?void 0:R.data)||[],b.value=g.counts||b.value}finally{d.value=!1}}async function O(){var R,g,w;if(i.value.title.trim()){v.value=!0;try{await _n({title:i.value.title.trim(),scheduled_at:i.value.scheduled_at||null,participant_ids:i.value.participant_ids,start_now:i.value.start_now?1:0}),i.value={title:"",scheduled_at:"",participant_ids:[],start_now:!0},(R=window.CommDate)!=null&&R.clearDateTimePicker&&window.CommDate.clearDateTimePicker("#meeting-scheduled-at"),L(_("meeting_created")),await T()}catch(Y){V(((w=(g=Y.response)==null?void 0:g.data)==null?void 0:w.message)||_("error","Error"))}finally{v.value=!1}}}function I(R){var w,Y;const g=`${((Y=(w=t.routes)==null?void 0:w.meetings)==null?void 0:Y.roomBase)||"/communication/meetings"}/${R}/room`;window.open(g,"_blank"),L(_("join_opened"))}async function D(R){if(confirm(_("confirm_end_meeting")))try{await yn(R),L(_("meeting_ended_success")),await T()}catch{V(_("error","Error"))}}return ze(()=>{var R,g;f=(R=a==null?void 0:a.register)==null?void 0:R.call(a,{onMeetingInvite:u}),(g=window.CommDate)!=null&&g.initDateTimePicker&&window.CommDate.initDateTimePicker(".comm-datetimepicker"),T()}),ct(()=>{f==null||f()}),(R,g)=>(S(),P("div",fa,[o("div",ma,[o("div",pa,[o("div",ha,[o("h3",va,[g[8]||(g[8]=o("i",{class:"fa fa-video-camera"},null,-1)),Q(" "+C(y(_)("create_meeting")),1)])]),o("div",ga,[o("form",{onSubmit:Ee(O,["prevent"])},[o("div",_a,[o("div",ya,[o("div",ba,[o("label",null,C(y(_)("meeting_title")),1),ie(o("input",{"onUpdate:modelValue":g[0]||(g[0]=w=>i.value.title=w),type:"text",class:"comm-input",placeholder:y(_)("meeting_title"),required:""},null,8,wa),[[Be,i.value.title]])])]),o("div",Ea,[o("div",Ra,[o("label",null,C(y(_)("scheduled_at")),1),ie(o("input",{"onUpdate:modelValue":g[1]||(g[1]=w=>i.value.scheduled_at=w),type:"text",id:"meeting-scheduled-at",class:"comm-input comm-datetimepicker",autocomplete:"off",readonly:""},null,512),[[Be,i.value.scheduled_at]])])]),o("div",Ca,[o("div",Aa,[o("label",null,C(y(_)("participants")),1),ie(o("select",{"onUpdate:modelValue":g[2]||(g[2]=w=>i.value.participant_ids=w),class:"form-control",multiple:"",style:{width:"100%"}},[(S(!0),P(se,null,de(y(n),w=>(S(),P("option",{key:w.id,value:w.id},C(y(fe)(w)),9,ka))),128))],512),[[qe,i.value.participant_ids]])])]),o("div",Ia,[o("div",Na,[g[9]||(g[9]=o("label",null," ",-1)),o("label",xa,[ie(o("input",{"onUpdate:modelValue":g[3]||(g[3]=w=>i.value.start_now=w),type:"checkbox","true-value":!0,"false-value":!1},null,512),[[vn,i.value.start_now]]),Q(" "+C(y(_)("start_now")),1)])])])]),o("button",{type:"submit",class:"comm-btn comm-btn-primary",disabled:v.value},[o("i",{class:Z(v.value?"fa fa-spinner fa-spin":"fa fa-plus")},null,2),Q(" "+C(y(_)("create_meeting")),1)],8,Sa)],32)])]),o("div",Pa,[o("div",Oa,[o("h3",Ta,C(y(_)("meetings")),1),o("div",Da,[o("button",{type:"button",class:Z(["comm-tab",{active:r.value===""}]),onClick:g[4]||(g[4]=w=>{r.value="",T()})},[Q(C(y(_)("filter_all"))+" ",1),o("span",Ma,C(b.value.all),1)],2),o("button",{type:"button",class:Z(["comm-tab",{active:r.value==="scheduled"}]),onClick:g[5]||(g[5]=w=>{r.value="scheduled",T()})},[Q(C(y(_)("status_scheduled"))+" ",1),o("span",$a,C(b.value.scheduled),1)],2),o("button",{type:"button",class:Z(["comm-tab",{active:r.value==="active"}]),onClick:g[6]||(g[6]=w=>{r.value="active",T()})},[Q(C(y(_)("status_active"))+" ",1),o("span",Va,C(b.value.active),1)],2),o("button",{type:"button",class:Z(["comm-tab",{active:r.value==="ended"}]),onClick:g[7]||(g[7]=w=>{r.value="ended",T()})},[Q(C(y(_)("status_ended"))+" ",1),o("span",Ba,C(b.value.ended),1)],2)])]),o("div",Ga,[d.value?(S(),P("div",La,[...g[10]||(g[10]=[o("i",{class:"fa fa-spinner fa-spin fa-2x"},null,-1)])])):p.value.length?(S(),P("div",Ha,[(S(!0),P(se,null,de(p.value,w=>(S(),P("div",{key:w.id,class:"col-md-6",style:{"margin-bottom":"14px"}},[o("div",ja,[o("div",Fa,[o("div",null,[o("h4",qa,C(w.title),1),o("span",{class:Z(["comm-chip",$(w.status)])},C(h(w.status)),3)]),o("div",Ka,[w.status!=="ended"?(S(),P("button",{key:0,type:"button",class:"comm-btn comm-btn-success btn-sm",onClick:Y=>I(w.id)},[g[12]||(g[12]=o("i",{class:"fa fa-sign-in"},null,-1)),Q(" "+C(y(_)("join_meeting")),1)],8,Wa)):X("",!0),w.created_by===y(s)&&w.status!=="ended"?(S(),P("button",{key:1,type:"button",class:"comm-btn comm-btn-danger btn-sm",onClick:Y=>D(w.id)},[g[13]||(g[13]=o("i",{class:"fa fa-stop"},null,-1)),Q(" "+C(y(_)("end_meeting")),1)],8,za)):X("",!0)])]),o("div",Qa,[o("div",null,[o("strong",null,C(y(_)("created_by"))+":",1),Q(" "+C(y(fe)(w.creator)),1)]),o("div",null,[o("strong",null,C(y(_)("scheduled_at"))+":",1),Q(" "+C(y(Us)(w.scheduled_at||w.started_at||w.created_at)),1)]),o("div",Ya,[o("strong",null,C(y(_)("participants"))+":",1),(S(!0),P(se,null,de(w.participants||[],(Y,ae)=>(S(),P("span",{key:Y.id},[ae?(S(),P(se,{key:0},[Q(", ")],64)):X("",!0),Q(" "+C(y(fe)(Y.user))+" ",1),o("small",Ja,"("+C(Y.role==="host"?y(_)("host"):y(_)("participant"))+")",1)]))),128))])])])]))),128))])):(S(),P("div",Ua,[g[11]||(g[11]=o("i",{class:"fa fa-video-camera"},null,-1)),o("p",null,C(y(_)("no_meetings")),1)]))])])])]))}},Za=Cs({history:os(),routes:[{path:"/communication/chat",name:"communication.chat",component:da},{path:"/communication/meetings",name:"communication.meetings",component:Xa}]}),Bt=document.getElementById("comm-app");Bt&&bn(Ls).use(Za).mount(Bt);