sm-click-library-ui 0.0.439 → 0.0.440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...a){const o=new this(n);return a.forEach(r=>o.set(r)),o}static accessor(n){const o=(this[Ro]=this[Ro]={accessors:{}}).accessors,r=this.prototype;function i(s){const l=fn(s);o[l]||(s0(r,s),o[l]=!0)}return U.isArray(n)?n.forEach(i):i(n),this}};nt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(nt.prototype,({value:t},n)=>{let a=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(o){this[a]=o}}}),U.freezeMethods(nt);function ya(t,n){const a=this||un,o=n||a,r=nt.from(o.headers);let i=o.data;return U.forEach(t,function(l){i=l.call(a,i,r.normalize(),n?n.status:void 0)}),r.normalize(),i}function Ho(t){return!!(t&&t.__CANCEL__)}function Wt(t,n,a){Se.call(this,t??"canceled",Se.ERR_CANCELED,n,a),this.name="CanceledError"}U.inherits(Wt,Se,{__CANCEL__:!0});function zo(t,n,a){const o=a.config.validateStatus;!a.status||!o||o(a.status)?t(a):n(new Se("Request failed with status code "+a.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function l0(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function c0(t,n){t=t||10;const a=new Array(t),o=new Array(t);let r=0,i=0,s;return n=n!==void 0?n:1e3,function(d){const u=Date.now(),c=o[i];s||(s=u),a[r]=d,o[r]=u;let h=i,m=0;for(;h!==r;)m+=a[h++],h=h%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),u-s<n)return;const p=c&&u-c;return p?Math.round(m*1e3/p):void 0}}function d0(t,n){let a=0,o=1e3/n,r,i;const s=(u,c=Date.now())=>{a=c,r=null,i&&(clearTimeout(i),i=null),t(...u)};return[(...u)=>{const c=Date.now(),h=c-a;h>=o?s(u,c):(r=u,i||(i=setTimeout(()=>{i=null,s(r)},o-h)))},()=>r&&s(r)]}const Fn=(t,n,a=3)=>{let o=0;const r=c0(50,250);return d0(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,d=s-o,u=r(d),c=s<=l;o=s;const h={loaded:s,total:l,progress:l?s/l:void 0,bytes:d,rate:u||void 0,estimated:u&&l&&c?(l-s)/u:void 0,event:i,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(h)},a)},jo=(t,n)=>{const a=t!=null;return[o=>n[0]({lengthComputable:a,total:t,loaded:o}),n[1]]},Go=t=>(...n)=>U.asap(()=>t(...n)),u0=Ue.hasStandardBrowserEnv?((t,n)=>a=>(a=new URL(a,Ue.origin),t.protocol===a.protocol&&t.host===a.host&&(n||t.port===a.port)))(new URL(Ue.origin),Ue.navigator&&/(msie|trident)/i.test(Ue.navigator.userAgent)):()=>!0,f0=Ue.hasStandardBrowserEnv?{write(t,n,a,o,r,i,s){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(n)}`];U.isNumber(a)&&l.push(`expires=${new Date(a).toUTCString()}`),U.isString(o)&&l.push(`path=${o}`),U.isString(r)&&l.push(`domain=${r}`),i===!0&&l.push("secure"),U.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function m0(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function h0(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function Io(t,n,a){let o=!m0(n);return t&&(o||a==!1)?h0(t,n):n}const qo=t=>t instanceof nt?{...t}:t;function Lt(t,n){n=n||{};const a={};function o(u,c,h,m){return U.isPlainObject(u)&&U.isPlainObject(c)?U.merge.call({caseless:m},u,c):U.isPlainObject(c)?U.merge({},c):U.isArray(c)?c.slice():c}function r(u,c,h,m){if(U.isUndefined(c)){if(!U.isUndefined(u))return o(void 0,u,h,m)}else return o(u,c,h,m)}function i(u,c){if(!U.isUndefined(c))return o(void 0,c)}function s(u,c){if(U.isUndefined(c)){if(!U.isUndefined(u))return o(void 0,u)}else return o(void 0,c)}function l(u,c,h){if(h in n)return o(u,c);if(h in t)return o(void 0,u)}const d={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,c,h)=>r(qo(u),qo(c),h,!0)};return U.forEach(Object.keys({...t,...n}),function(c){const h=d[c]||r,m=h(t[c],n[c],c);U.isUndefined(m)&&h!==l||(a[c]=m)}),a}const Wo=t=>{const n=Lt({},t);let{data:a,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:i,headers:s,auth:l}=n;if(n.headers=s=nt.from(s),n.url=$o(Io(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),U.isFormData(a)){if(Ue.hasStandardBrowserEnv||Ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(U.isFunction(a.getHeaders)){const d=a.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([c,h])=>{u.includes(c.toLowerCase())&&s.set(c,h)})}}if(Ue.hasStandardBrowserEnv&&(o&&U.isFunction(o)&&(o=o(n)),o||o!==!1&&u0(n.url))){const d=r&&i&&f0.read(i);d&&s.set(r,d)}return n},p0=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(a,o){const r=Wo(t);let i=r.data;const s=nt.from(r.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:u}=r,c,h,m,p,f;function g(){p&&p(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function k(){if(!y)return;const E=nt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),M={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:E,config:t,request:y};zo(function(R){a(R),g()},function(R){o(R),g()},M),y=null}"onloadend"in y?y.onloadend=k:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(k)},y.onabort=function(){y&&(o(new Se("Request aborted",Se.ECONNABORTED,t,y)),y=null)},y.onerror=function(v){const M=v&&v.message?v.message:"Network Error",A=new Se(M,Se.ERR_NETWORK,t,y);A.event=v||null,o(A),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const M=r.transitional||Oo;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),o(new Se(v,M.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,t,y)),y=null},i===void 0&&s.setContentType(null),"setRequestHeader"in y&&U.forEach(s.toJSON(),function(v,M){y.setRequestHeader(M,v)}),U.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),l&&l!=="json"&&(y.responseType=r.responseType),u&&([m,f]=Fn(u,!0),y.addEventListener("progress",m)),d&&y.upload&&([h,p]=Fn(d),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(c=E=>{y&&(o(!E||E.type?new Wt(null,t,y):E),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const w=l0(r.url);if(w&&Ue.protocols.indexOf(w)===-1){o(new Se("Unsupported protocol "+w+":",Se.ERR_BAD_REQUEST,t));return}y.send(i||null)})},g0=(t,n)=>{const{length:a}=t=t?t.filter(Boolean):[];if(n||a){let o=new AbortController,r;const i=function(u){if(!r){r=!0,l();const c=u instanceof Error?u:this.reason;o.abort(c instanceof Se?c:new Wt(c instanceof Error?c.message:c))}};let s=n&&setTimeout(()=>{s=null,i(new Se(`timeout ${n} of ms exceeded`,Se.ETIMEDOUT))},n);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:d}=o;return d.unsubscribe=()=>U.asap(l),d}},y0=function*(t,n){let a=t.byteLength;if(a<n){yield t;return}let o=0,r;for(;o<a;)r=o+n,yield t.slice(o,r),o=r},k0=async function*(t,n){for await(const a of x0(t))yield*y0(a,n)},x0=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:a,value:o}=await n.read();if(a)break;yield o}}finally{await n.cancel()}},Uo=(t,n,a,o)=>{const r=k0(t,n);let i=0,s,l=d=>{s||(s=!0,o&&o(d))};return new ReadableStream({async pull(d){try{const{done:u,value:c}=await r.next();if(u){l(),d.close();return}let h=c.byteLength;if(a){let m=i+=h;a(m)}d.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(d){return l(d),r.return()}},{highWaterMark:2})},Zo=64*1024,{isFunction:Ln}=U,b0=(({Request:t,Response:n})=>({Request:t,Response:n}))(U.global),{ReadableStream:Yo,TextEncoder:Xo}=U.global,Ko=(t,...n)=>{try{return!!t(...n)}catch{return!1}},w0=t=>{t=U.merge.call({skipUndefined:!0},b0,t);const{fetch:n,Request:a,Response:o}=t,r=n?Ln(n):typeof fetch=="function",i=Ln(a),s=Ln(o);if(!r)return!1;const l=r&&Ln(Yo),d=r&&(typeof Xo=="function"?(f=>g=>f.encode(g))(new Xo):async f=>new Uint8Array(await new a(f).arrayBuffer())),u=i&&l&&Ko(()=>{let f=!1;const g=new a(Ue.origin,{body:new Yo,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!g}),c=s&&l&&Ko(()=>U.isReadableStream(new o("").body)),h={stream:c&&(f=>f.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!h[f]&&(h[f]=(g,y)=>{let k=g&&g[f];if(k)return k.call(g);throw new Se(`Response type '${f}' is not supported`,Se.ERR_NOT_SUPPORT,y)})});const m=async f=>{if(f==null)return 0;if(U.isBlob(f))return f.size;if(U.isSpecCompliantForm(f))return(await new a(Ue.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(U.isArrayBufferView(f)||U.isArrayBuffer(f))return f.byteLength;if(U.isURLSearchParams(f)&&(f=f+""),U.isString(f))return(await d(f)).byteLength},p=async(f,g)=>{const y=U.toFiniteNumber(f.getContentLength());return y??m(g)};return async f=>{let{url:g,method:y,data:k,signal:w,cancelToken:E,timeout:v,onDownloadProgress:M,onUploadProgress:A,responseType:R,headers:S,withCredentials:x="same-origin",fetchOptions:N}=Wo(f),L=n||fetch;R=R?(R+"").toLowerCase():"text";let F=g0([w,E&&E.toAbortSignal()],v),B=null;const C=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let O;try{if(A&&u&&y!=="get"&&y!=="head"&&(O=await p(S,k))!==0){let _=new a(g,{method:"POST",body:k,duplex:"half"}),oe;if(U.isFormData(k)&&(oe=_.headers.get("content-type"))&&S.setContentType(oe),_.body){const[de,pe]=jo(O,Fn(Go(A)));k=Uo(_.body,Zo,de,pe)}}U.isString(x)||(x=x?"include":"omit");const Z=i&&"credentials"in a.prototype,Q={...N,signal:F,method:y.toUpperCase(),headers:S.normalize().toJSON(),body:k,duplex:"half",credentials:Z?x:void 0};B=i&&new a(g,Q);let ee=await(i?L(B,N):L(g,Q));const P=c&&(R==="stream"||R==="response");if(c&&(M||P&&C)){const _={};["status","statusText","headers"].forEach(ye=>{_[ye]=ee[ye]});const oe=U.toFiniteNumber(ee.headers.get("content-length")),[de,pe]=M&&jo(oe,Fn(Go(M),!0))||[];ee=new o(Uo(ee.body,Zo,de,()=>{pe&&pe(),C&&C()}),_)}R=R||"text";let H=await h[U.findKey(h,R)||"text"](ee,f);return!P&&C&&C(),await new Promise((_,oe)=>{zo(_,oe,{data:H,headers:nt.from(ee.headers),status:ee.status,statusText:ee.statusText,config:f,request:B})})}catch(Z){throw C&&C(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new Se("Network Error",Se.ERR_NETWORK,f,B),{cause:Z.cause||Z}):Se.from(Z,Z&&Z.code,f,B)}}},E0=new Map,Qo=t=>{let n=t&&t.env||{};const{fetch:a,Request:o,Response:r}=n,i=[o,r,a];let s=i.length,l=s,d,u,c=E0;for(;l--;)d=i[l],u=c.get(d),u===void 0&&c.set(d,u=l?new Map:w0(n)),c=u;return u};Qo();const ka={http:Is,xhr:p0,fetch:{get:Qo}};U.forEach(ka,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const Jo=t=>`- ${t}`,v0=t=>U.isFunction(t)||t===null||t===!1;function C0(t,n){t=U.isArray(t)?t:[t];const{length:a}=t;let o,r;const i={};for(let s=0;s<a;s++){o=t[s];let l;if(r=o,!v0(o)&&(r=ka[(l=String(o)).toLowerCase()],r===void 0))throw new Se(`Unknown adapter '${l}'`);if(r&&(U.isFunction(r)||(r=r.get(n))))break;i[l||"#"+s]=r}if(!r){const s=Object.entries(i).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=a?s.length>1?`since :
4
4
  `+s.map(Jo).join(`
5
5
  `):" "+Jo(s[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r}const er={getAdapter:C0,adapters:ka};function xa(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Wt(null,t)}function tr(t){return xa(t),t.headers=nt.from(t.headers),t.data=ya.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),er.getAdapter(t.adapter||un.adapter,t)(t).then(function(o){return xa(t),o.data=ya.call(t,t.transformResponse,o),o.headers=nt.from(o.headers),o},function(o){return Ho(o)||(xa(t),o&&o.response&&(o.response.data=ya.call(t,t.transformResponse,o.response),o.response.headers=nt.from(o.response.headers))),Promise.reject(o)})}const nr="1.13.1",$n={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{$n[t]=function(o){return typeof o===t||"a"+(n<1?"n ":" ")+t}});const ar={};$n.transitional=function(n,a,o){function r(i,s){return"[Axios v"+nr+"] Transitional option '"+i+"'"+s+(o?". "+o:"")}return(i,s,l)=>{if(n===!1)throw new Se(r(s," has been removed"+(a?" in "+a:"")),Se.ERR_DEPRECATED);return a&&!ar[s]&&(ar[s]=!0,console.warn(r(s," has been deprecated since v"+a+" and will be removed in the near future"))),n?n(i,s,l):!0}},$n.spelling=function(n){return(a,o)=>(console.warn(`${o} is likely a misspelling of ${n}`),!0)};function S0(t,n,a){if(typeof t!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const o=Object.keys(t);let r=o.length;for(;r-- >0;){const i=o[r],s=n[i];if(s){const l=t[i],d=l===void 0||s(l,i,t);if(d!==!0)throw new Se("option "+i+" must be "+d,Se.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Se("Unknown option "+i,Se.ERR_BAD_OPTION)}}const Pn={assertOptions:S0,validators:$n},pt=Pn.validators;let $t=class{constructor(n){this.defaults=n||{},this.interceptors={request:new Po,response:new Po}}async request(n,a){try{return await this._request(n,a)}catch(o){if(o instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
6
- `+i):o.stack=i}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=Lt(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&Pn.assertOptions(o,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean)},!1),r!=null&&(U.isFunction(r)?a.paramsSerializer={serialize:r}:Pn.assertOptions(r,{encode:pt.function,serialize:pt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),Pn.assertOptions(a,{baseUrl:pt.spelling("baseURL"),withXsrfToken:pt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=i&&U.merge(i.common,i[a.method]);i&&U.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),a.headers=nt.concat(s,i);const l=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(d=d&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,h=0,m;if(!d){const f=[tr.bind(this),void 0];for(f.unshift(...l),f.push(...u),m=f.length,c=Promise.resolve(a);h<m;)c=c.then(f[h++],f[h++]);return c}m=l.length;let p=a;for(;h<m;){const f=l[h++],g=l[h++];try{p=f(p)}catch(y){g.call(this,y);break}}try{c=tr.call(this,p)}catch(f){return Promise.reject(f)}for(h=0,m=u.length;h<m;)c=c.then(u[h++],u[h++]);return c}getUri(n){n=Lt(this.defaults,n);const a=Io(n.baseURL,n.url,n.allowAbsoluteUrls);return $o(a,n.params,n.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(n){$t.prototype[n]=function(a,o){return this.request(Lt(o||{},{method:n,url:a,data:(o||{}).data}))}}),U.forEach(["post","put","patch"],function(n){function a(o){return function(i,s,l){return this.request(Lt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}$t.prototype[n]=a(),$t.prototype[n+"Form"]=a(!0)});let B0=class $i{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(r);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new Wt(i,s,l),a(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const a=this._listeners.indexOf(n);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const n=new AbortController,a=o=>{n.abort(o)};return this.subscribe(a),n.signal.unsubscribe=()=>this.unsubscribe(a),n.signal}static source(){let n;return{token:new $i(function(r){n=r}),cancel:n}}};function V0(t){return function(a){return t.apply(null,a)}}function M0(t){return U.isObject(t)&&t.isAxiosError===!0}const ba={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ba).forEach(([t,n])=>{ba[n]=t});function or(t){const n=new $t(t),a=bo($t.prototype.request,n);return U.extend(a,$t.prototype,n,{allOwnKeys:!0}),U.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return or(Lt(t,r))},a}const Ge=or(un);Ge.Axios=$t,Ge.CanceledError=Wt,Ge.CancelToken=B0,Ge.isCancel=Ho,Ge.VERSION=nr,Ge.toFormData=Tn,Ge.AxiosError=Se,Ge.Cancel=Ge.CanceledError,Ge.all=function(n){return Promise.all(n)},Ge.spread=V0,Ge.isAxiosError=M0,Ge.mergeConfig=Lt,Ge.AxiosHeaders=nt,Ge.formToJSON=t=>_o(U.isHTMLForm(t)?new FormData(t):t),Ge.getAdapter=er.getAdapter,Ge.HttpStatusCode=ba,Ge.default=Ge;const{Axios:Wx,AxiosError:Ux,CanceledError:Zx,isCancel:Yx,CancelToken:Xx,VERSION:Kx,all:Qx,Cancel:Jx,isAxiosError:eb,spread:tb,toFormData:nb,AxiosHeaders:ab,HttpStatusCode:ob,formToJSON:rb,getAdapter:ib,mergeConfig:sb}=Ge,rr=Dt.defineStore("auth",{state:()=>({jwtToken:null}),actions:{setToken(t){this.jwtToken=t},clearToken(){this.jwtToken=null}},getters:{getToken:t=>t.jwtToken}}),at=Ge.create({baseURL:"https://back.dev-smclick.com.br/"});let wa=null;const N0=()=>(wa||(wa=rr()),wa);at.interceptors.request.use(t=>{try{const a=N0().jwtToken;a?t.headers.Authorization=`Bearer ${a}`:console.warn("JWT token não configurado em api request")}catch(n){console.warn("Erro ao acessar authStore no interceptor:",n)}return t},t=>Promise.reject(t));const A0="v1/api/attendances/attendant/",T0="v1/api/attendances/department/",Ea="v1/api/attendances/internal_chat/",D0="v1/api/instances/instance/",F0="v1/api/crm/event/scheduled_message/",L0="v1/api/crm/event/calendar",$0="v1/api/crm/products/",P0="v1/api/contacts/tag/",O0="/v1/api/contacts/segmentation_field/",va=Dt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${D0}`;const a=await at.get(n);this.instances=a.data,await Promise.all(this.instances.map(async o=>{o.isLoading=!0;try{const r=o.last_instance_status;r==="DISCONNECTED"||r==="UNDEFINED"?o.status=!1:o.status=!0}catch(r){console.log(r),o.status="Offline"}o.isLoading=!1})),this.count=this.instances.length,this.loaded=!0}catch(n){console.log("Erro ao buscar instâncias:",n),this.loaded=!0}},removeInstance(t){this.instances=this.instances.filter(n=>n.id!==t),this.count=this.instances.length},addInstance(t){const n=this.instances.findIndex(a=>a.id===t.id);n!==-1?this.instances[n]=t:this.instances.push(t),this.count=this.instances.length}}}),_0={class:"w-full relative text-current"},R0={class:"flex cursor-pointer justify-between items-center"},H0={key:0},z0={key:0},j0={key:1,class:"flex items-center gap-2"},G0={class:"flex gap-3 items-center flex-shrink-0"},I0={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},q0={key:1,class:"relative"},W0={style:{color:"#0081FB",width:"20px",height:"20px"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},U0={class:"my-auto text-center mx-auto group-hover:inline-block"},Z0={key:1,class:"flex justify-center"},Y0={class:"w-full"},X0={key:1,class:"flex items-center gap-2 justify-center"},K0={class:"flex px-4 items-center gap-2"},Q0={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},J0={class:"gap-2 rounded-b-lg flex overflow-y-auto p-2 shadow shadow-black dark:shadow-gray-400 bg-base-300 max-h-[200px] flex-col"},el={class:"select-none cursor-pointer w-full"},tl=["onClick","disabled"],nl={class:"flex w-full items-center pl-2 gap-3"},al={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},ol={key:1,class:"relative"},rl={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},il={key:0,class:"w-6 h-6 flex-shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},sl={class:"w-full text-center"},ll={class:"my-auto text-center mx-auto group-hover:inline-block"},cl={key:1,class:"flex justify-center"},dl={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},ul={key:1,class:"p-4"},ir={__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0}},emits:["update:modelValue","function","component-mounted"],setup(t,{emit:n}){const a=va(),o=e.ref(!1),r=e.ref(null),i=t,s=n;function l(d){r.value=d,s("function",d)}return e.watch(()=>i.modelValue,d=>{r.value=d},{immediate:!0}),e.watch(r,d=>{s("update:modelValue",d)}),e.onMounted(async()=>{if(r.value){const d=a.instances.find(u=>u.id===r.value.id);d&&(r.value.status=d.status)}s("component-mounted")}),(d,u)=>{const c=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",_0,[e.createElementVNode("div",{class:e.normalizeClass([{"rounded-b-none":o.value},"rounded-lg shadow dark:shadow-gray-400 shadow-gray-900 dark:bg-base-100 bg-base-100 text-center"])},[e.createElementVNode("div",R0,[e.createElementVNode("p",{onClick:u[0]||(u[0]=h=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",H0,[r.value?(e.openBlock(),e.createElementBlock("span",j0,[e.createElementVNode("header",G0,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",I0,[...u[3]||(u[3]=[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)])])):r.value.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",q0,[u[5]||(u[5]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(e.openBlock(),e.createElementBlock("svg",W0,[...u[4]||(u[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])]))])):e.createCommentVNode("",!0),r.value&&r.value.status!==void 0?(e.openBlock(),e.createBlock(c,{key:2,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.normalizeClass(["p-1 rounded text-sm px-3",{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"}])},[e.createElementVNode("div",U0,e.toDisplayString(r.value.status===!0?"Conectada":r.value.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[r.value.isLoading?(e.openBlock(),e.createElementBlock("div",Z0,[...u[6]||(u[6]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Y0,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",z0,e.toDisplayString(e.unref(a).instances?e.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",X0,[...u[7]||(u[7]=[e.createElementVNode("svg",{"aria-hidden":"true",class:"inline w-5 h-5 text-blue-300 animate-spin fill-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),e.createTextVNode("Inicializando instâncias...",-1)])]))]),e.createElementVNode("footer",K0,[e.createElementVNode("button",{onClick:u[1]||(u[1]=h=>(r.value=null,o.value=!1))},[...u[8]||(u[8]=[e.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.createElementVNode("button",{onClick:u[2]||(u[2]=h=>o.value=!o.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"rotate-180":o.value},"w-4 h-4 ease-out transition"]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[...u[9]||(u[9]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"},null,-1)])],2))])])])],2),o.value?(e.openBlock(),e.createElementBlock("nav",Q0,[e.createElementVNode("ul",J0,[e.unref(a).instances.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).instances,(h,m)=>{var p;return e.openBlock(),e.createElementBlock("li",el,[e.createElementVNode("button",{class:e.normalizeClass([r.value&&r.value.id===h.id?"bg-base-100":"bg-base-200 hover:bg-base-100","flex rounded-md justify-between items-center p-2 px-1 w-full"]),onClick:f=>(r.value=h,o.value=!1,l(h)),disabled:r.value&&r.value.id===h.id||t.type&&h.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((p=h.config)==null?void 0:p.webhooks)},[e.createElementVNode("div",nl,[h.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",al,[...u[10]||(u[10]=[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)])])):h.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",ol,[u[12]||(u[12]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(e.openBlock(),e.createElementBlock("svg",rl,[...u[11]||(u[11]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])]))])):e.createCommentVNode("",!0),e.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.type&&h.type!==t.type?"Não é possível utilizar esse tipo de Instância neste recurso":t.webhooks===!0?"Essa instância está com o Atendimento desabilitado":"Essa aplicação é somente para instâncias sem atendimento habilitado."),1)]),default:e.withCtx(()=>{var f;return[t.type&&h.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((f=h.config)==null?void 0:f.webhooks)?(e.openBlock(),e.createElementBlock("svg",il,[...u[13]||(u[13]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 10V7a4 4 0 1 1 8 0v3h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h1Zm2-3a2 2 0 1 1 4 0v3h-4V7Zm2 6a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)]}),_:2},1024),e.createElementVNode("p",sl,e.toDisplayString(h.name),1),e.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.normalizeClass(["p-1 rounded px-3",{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"}])},[e.createElementVNode("div",ll,e.toDisplayString(h.status===!0?"Conectada":h.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[h.isLoading?(e.openBlock(),e.createElementBlock("div",cl,[...u[14]||(u[14]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:2},1024)]),e.createElementVNode("div",dl,[h.telephone?(e.openBlock(),e.createBlock(c,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(h.telephone?`${h.telephone}`:""),1)]),default:e.withCtx(()=>[u[15]||(u[15]=e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M7.978 4a2.553 2.553 0 0 0-1.926.877C4.233 6.7 3.699 8.751 4.153 10.814c.44 1.995 1.778 3.893 3.456 5.572 1.68 1.679 3.577 3.018 5.57 3.459 2.062.456 4.115-.073 5.94-1.885a2.556 2.556 0 0 0 .001-3.861l-1.21-1.21a2.689 2.689 0 0 0-3.802 0l-.617.618a.806.806 0 0 1-1.14 0l-1.854-1.855a.807.807 0 0 1 0-1.14l.618-.62a2.692 2.692 0 0 0 0-3.803l-1.21-1.211A2.555 2.555 0 0 0 7.978 4Z"})],-1))]),_:2},1024)):e.createCommentVNode("",!0)])],10,tl)])}),256)):(e.openBlock(),e.createElementBlock("div",ul," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},fl=["aria-labelledby","aria-describedby"],ml={class:"cpk-popover__header border-base-100"},hl=["id"],pl=["disabled"],gl=["id"],yl={class:"cpk-popover__details bg-base-200 border border-base-100"},kl={class:"cpk-popover__footer"},xl=["disabled"],bl=["disabled"],wl={key:0,class:"loading-spinner"},El=Ce({__name:"confirmModal",props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:"Confirmar ação"},description:{type:String,default:""},confirmLabel:{type:String,default:"Confirmar"},cancelLabel:{type:String,default:"Cancelar"},loadingLabel:{type:String,default:"Processando…"},loading:{type:Boolean,default:!1},destructive:{type:Boolean,default:!1},context:{type:Object,default:()=>({})},anchorEl:{type:[HTMLElement,Object],default:null},anchorRect:{type:Object,default:null},placement:{type:String,default:"auto"},align:{type:String,default:"center"},offset:{type:Number,default:10},viewportPadding:{type:Number,default:8}},emits:["update:modelValue","confirm","cancel"],setup(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:v=>o("update:modelValue",v)}),i=e.ref(null),s=e.ref({left:0,top:0,p:"bottom"}),l={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function d(){o("cancel",a.context),r.value=!1}function u(){a.loading||o("confirm",a.context)}let c,h,m=[];function p(){if(a.anchorRect)return a.anchorRect;const v=a.anchorEl instanceof Element?a.anchorEl:null;if(v)return v.getBoundingClientRect();const M=document.activeElement instanceof Element?document.activeElement:null;return M?M.getBoundingClientRect():{left:window.__lastMouseX??window.innerWidth/2,top:window.__lastMouseY??window.innerHeight/2,width:1,height:1,right:(window.__lastMouseX??0)+1,bottom:(window.__lastMouseY??0)+1}}function f(){if(!r.value)return;const v=window.innerWidth,M=window.innerHeight,A=a.viewportPadding,R=p(),S=i.value?i.value.getBoundingClientRect():{width:320,height:200},x=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let N=x[0],L=0,F=0;const B=R.left+R.width/2-S.width/2,C=R.top+R.height/2-S.height/2,O=R.left,Z=R.left+R.width-S.width,Q=R.top,ee=R.top+R.height-S.height;for(const P of x){if(P==="bottom"&&(F=R.bottom+a.offset,L=a.align==="start"?O:a.align==="end"?Z:B,F+S.height+A<=M)){N="bottom";break}if(P==="top"&&(F=R.top-S.height-a.offset,L=a.align==="start"?O:a.align==="end"?Z:B,F>=A)){N="top";break}if(P==="right"&&(L=R.right+a.offset,F=a.align==="start"?Q:a.align==="end"?ee:C,L+S.width+A<=v)){N="right";break}if(P==="left"&&(L=R.left-S.width-a.offset,F=a.align==="start"?Q:a.align==="end"?ee:C,L>=A)){N="left";break}}L=Math.min(Math.max(A,L),v-S.width-A),F=Math.min(Math.max(A,F),M-S.height-A),s.value={left:L,top:F,p:N}}function g(){y();let M=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;M&&M!==document.body;)m.push(M),M=M.parentElement;m.push(window),m.forEach(A=>A.addEventListener("scroll",f,{passive:!0}))}function y(){m.forEach(v=>{var M;return(M=v.removeEventListener)==null?void 0:M.call(v,"scroll",f)}),m=[]}e.watch(()=>r.value,async v=>{var M;if(v){await e.nextTick(),f(),g(),c=new ResizeObserver(f),c.observe(document.body);const A=a.anchorEl instanceof Element?a.anchorEl:null;A&&((M=h==null?void 0:h.disconnect)==null||M.call(h),h=new ResizeObserver(f),h.observe(A)),window.addEventListener("resize",f),window.addEventListener("keydown",k)}else w()}),e.watch(()=>a.anchorEl,async v=>{var A;if(!r.value)return;await e.nextTick(),y(),g(),(A=h==null?void 0:h.disconnect)==null||A.call(h);const M=v instanceof Element?v:null;M&&(h=new ResizeObserver(f),h.observe(M)),f()}),e.watch(()=>a.anchorRect,()=>{r.value&&f()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&f()});function k(v){v.key==="Escape"&&d(),v.key==="Enter"&&u()}e.onMounted(()=>{window.addEventListener("mousemove",v=>{window.__lastMouseX=v.clientX,window.__lastMouseY=v.clientY},{passive:!0})}),e.onBeforeUnmount(w);function w(){y(),window.removeEventListener("resize",f),window.removeEventListener("keydown",k),c&&c.disconnect(),h&&h.disconnect()}const E=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(v,M)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:e.withModifiers(d,["self"])},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:i,class:e.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":t.loading,"is-danger":t.destructive}]]),style:e.normalizeStyle(E.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[e.createElementVNode("div",ml,[M[0]||(M[0]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),e.createElementVNode("h3",{class:"cpk-popover__title",id:l.title},e.toDisplayString(t.title),9,hl),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:d,disabled:t.loading,"aria-label":"Fechar"}," × ",8,pl)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},e.toDisplayString(t.description),9,gl)):e.createCommentVNode("",!0),e.createElementVNode("div",yl,[e.renderSlot(v.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",kl,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:d,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,xl),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button","cyber-button--md",t.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:u,disabled:t.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",wl)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,bl)])],14,fl)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-2f78365f"]]);function Ut(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function gt(t){return(n,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,l=a!=null&&a.width?String(a.width):s;r=t.formattingValues[l]||t.formattingValues[s]}else{const s=t.defaultWidth,l=a!=null&&a.width?String(a.width):t.defaultWidth;r=t.values[l]||t.values[s]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}function yt(t){return(n,a={})=>{const o=a.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const s=i[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(l)?Cl(l,h=>h.test(s)):vl(l,h=>h.test(s));let u;u=t.valueCallback?t.valueCallback(d):d,u=a.valueCallback?a.valueCallback(u):u;const c=n.slice(s.length);return{value:u,rest:c}}}function vl(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function Cl(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function sr(t){return(n,a={})=>{const o=n.match(t.matchPattern);if(!o)return null;const r=o[0],i=n.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;const l=n.slice(r.length);return{value:s,rest:l}}}const lr=6048e5,Sl=864e5,cr=Symbol.for("constructDateFrom");function rt(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&cr in t?t[cr](n):t instanceof Date?new t.constructor(n):new Date(n)}function Ca(t,...n){const a=rt.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let Bl={};function On(){return Bl}function ct(t,n){return rt(n||t,t)}function Pt(t,n){var l,d,u,c;const a=On(),o=(n==null?void 0:n.weekStartsOn)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??a.weekStartsOn??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,r=ct(t,n==null?void 0:n.in),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Vl(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+Pt(o,a)==+Pt(r,a)}const Ml={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Nl=(t,n,a)=>{let o;const r=Ml[t];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",n.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},Al={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tl=(t,n,a,o)=>Al[t],Dl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Fl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ll={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$l={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Pl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ol={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},_l={ordinalNumber:(t,n)=>{const a=Number(t),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:gt({values:Dl,defaultWidth:"wide"}),quarter:gt({values:Fl,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:Ll,defaultWidth:"wide"}),day:gt({values:$l,defaultWidth:"wide"}),dayPeriod:gt({values:Pl,defaultWidth:"wide",formattingValues:Ol,defaultFormattingWidth:"wide"})},Rl=/^(\d+)(th|st|nd|rd)?/i,Hl=/\d+/i,zl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jl={any:[/^b/i,/^(a|c)/i]},Gl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Il={any:[/1/i,/2/i,/3/i,/4/i]},ql={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Wl={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ul={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zl={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Yl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Kl={ordinalNumber:sr({matchPattern:Rl,parsePattern:Hl,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:jl,defaultParseWidth:"any"}),quarter:yt({matchPatterns:Gl,defaultMatchWidth:"wide",parsePatterns:Il,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:ql,defaultMatchWidth:"wide",parsePatterns:Wl,defaultParseWidth:"any"}),day:yt({matchPatterns:Ul,defaultMatchWidth:"wide",parsePatterns:Zl,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:Yl,defaultMatchWidth:"any",parsePatterns:Xl,defaultParseWidth:"any"})},Ql={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},e2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},t2={date:Ut({formats:Ql,defaultWidth:"full"}),time:Ut({formats:Jl,defaultWidth:"full"}),dateTime:Ut({formats:e2,defaultWidth:"full"})},n2={code:"en-US",formatDistance:Nl,formatLong:t2,formatRelative:Tl,localize:_l,match:Kl,options:{weekStartsOn:0,firstWeekContainsDate:1}},a2={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},o2=(t,n,a)=>{let o;const r=a2[t];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",String(n)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"em "+o:"há "+o:o},r2={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},i2={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},s2={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},l2={date:Ut({formats:r2,defaultWidth:"full"}),time:Ut({formats:i2,defaultWidth:"full"}),dateTime:Ut({formats:s2,defaultWidth:"full"})},c2={lastWeek:t=>{const n=t.getDay();return"'"+(n===0||n===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},d2=(t,n,a,o)=>{const r=c2[t];return typeof r=="function"?r(n):r},u2={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},f2={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},m2={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},h2={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},p2={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},g2={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},y2={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:gt({values:u2,defaultWidth:"wide"}),quarter:gt({values:f2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:m2,defaultWidth:"wide"}),day:gt({values:h2,defaultWidth:"wide"}),dayPeriod:gt({values:p2,defaultWidth:"wide",formattingValues:g2,defaultFormattingWidth:"wide"})},k2=/^(\d+)[ºªo]?/i,x2=/\d+/i,b2={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},w2={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},E2={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},v2={any:[/1/i,/2/i,/3/i,/4/i]},C2={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},S2={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},B2={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},V2={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},M2={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},N2={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},A2={ordinalNumber:sr({matchPattern:k2,parsePattern:x2,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:b2,defaultMatchWidth:"wide",parsePatterns:w2,defaultParseWidth:"any"}),quarter:yt({matchPatterns:E2,defaultMatchWidth:"wide",parsePatterns:v2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:C2,defaultMatchWidth:"wide",parsePatterns:S2,defaultParseWidth:"any"}),day:yt({matchPatterns:B2,defaultMatchWidth:"wide",parsePatterns:V2,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:M2,defaultMatchWidth:"any",parsePatterns:N2,defaultParseWidth:"any"})},dr={code:"pt-BR",formatDistance:o2,formatLong:l2,formatRelative:d2,localize:y2,match:A2,options:{weekStartsOn:0,firstWeekContainsDate:1}},T2={scheduled_messages:"Mensagem programada"};function D2(t){return T2[t]||t||"Evento"}function Sa(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function Zt(t){const n=t instanceof Date?t:new Date(t),a=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0");return`${a}-${o}`}function mn(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(u=>parseInt(u,10));let s=0,l=0;if(a){const[u,c]=a.split(":");s=parseInt(u||"0",10),l=parseInt(c||"0",10)}const d=new Date(o,(r||1)-1,i||1,s,l);return isNaN(d.getTime())?null:d}function F2(t){if(!t)return null;try{const n=String(t).replace(/(\.\d{3})\d+$/,"$1"),a=new Date(n);return isNaN(a.getTime())?null:a}catch{return null}}function _n(t){if(!t)return"";const n=t instanceof Date?t:new Date(t);if(isNaN(n.getTime()))return"";const a=String(n.getHours()).padStart(2,"0"),o=String(n.getMinutes()).padStart(2,"0");return`${a}:${o}`}function L2(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ba(t){if(!t)return null;const n=(t==null?void 0:t.params)||{},a=(n==null?void 0:n.schedule)||{},o=(t==null?void 0:t.info)||{},r=(o==null?void 0:o.entity)||{},i=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let l=null;if(a!=null&&a.time&&(l=mn(a.time)),!l&&(t!=null&&t.next_execution_at)&&(l=F2(t.next_execution_at)),!l)return null;const d=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,u=d&&(d.content||d.text)||"",c=(t==null?void 0:t.function)||(n==null?void 0:n.function)||"",h=D2(c),m=(u||"").trim();return{id:(t==null?void 0:t.id)||L2(),date:l,time:_n(l),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:h,content:m,functionName:c||null,chatId:(n==null?void 0:n.chat_id)||(o==null?void 0:o.id)||"",protocol:(o==null?void 0:o.protocol)??"",contactName:(r==null?void 0:r.name)||"Contato",contactPhoto:(r==null?void 0:r.photo)||"",departmentName:(i==null?void 0:i.name)||"",departmentId:(i==null?void 0:i.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:t}}function ur(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=Ba(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function $2(t="/crm_scheduled",n){var a;try{const o=((a=n==null?void 0:n.raw)==null?void 0:a.id)??(n==null?void 0:n.id)??n;if(o==null)throw new Error("ID inválido");const r=`${String(t).replace(/\/$/,"")}/${o}/`,i=await at.delete(r);return{ok:(i==null?void 0:i.status)>=200&&i.status<300,status:(i==null?void 0:i.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const fr={scheduled_messages:"#3b82f6"},mr=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function P2(t=""){let n=2166136261;for(let a=0;a<t.length;a++)n^=t.charCodeAt(a),n=Math.imul(n,16777619);return n>>>0}function O2(t={}){var s,l,d,u,c,h,m,p,f,g,y;const n=t.functionName||t.function||((s=t==null?void 0:t.params)==null?void 0:s.function);if(n)return`fn:${n}`;const a=(t==null?void 0:t.departmentName)||((d=(l=t==null?void 0:t.info)==null?void 0:l.department)==null?void 0:d.name)||((c=(u=t==null?void 0:t.info)==null?void 0:u.department)==null?void 0:c.id);if(a)return`dept:${a}`;const o=(t==null?void 0:t.instanceName)||((m=(h=t==null?void 0:t.info)==null?void 0:h.instance)==null?void 0:m.name)||((f=(p=t==null?void 0:t.info)==null?void 0:p.instance)==null?void 0:f.id);if(o)return`inst:${o}`;const r=(t==null?void 0:t.protocol)??((g=t==null?void 0:t.info)==null?void 0:g.protocol);if(r!=null)return`proto:${r}`;const i=(t==null?void 0:t.chatId)||((y=t==null?void 0:t.params)==null?void 0:y.chat_id);return i?`chat:${i}`:"misc"}function Rn(t={}){var r;const n=t.functionName||t.function||((r=t==null?void 0:t.params)==null?void 0:r.function);if(n&&Object.prototype.hasOwnProperty.call(fr,n))return fr[n];const a=O2(t),o=P2(String(a))%mr.length;return mr[o]}const Yt=Dt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let t=`${A0}`;const n=await at.get(t);this.attendants=n.data,this.count=this.attendants.length}catch(t){console.log("Erro ao buscar atendentes:",t)}},removeAttendants(t){this.attendants=this.attendants.filter(n=>n.id!==t)},addAttendants(t){const n=this.attendants.findIndex(a=>a.id===t.id);n!==-1?this.attendants[n]=t:this.attendants.push(t)}}}),_2={class:"itemc-head"},R2={class:"minw0"},H2={class:"itemc-title"},z2={class:"itemc-sub"},j2={class:"flex items-center gap-1"},G2={class:"itemc-actions"},I2={class:"flex flex-col items-center"},q2={class:"time-badge"},W2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},U2={class:"sched-pop__card bg-base-300",role:"dialog"},Z2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Y2={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},X2=["disabled"],K2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Q2={key:1,class:"loading-spinner"},J2={class:"itemsb-head"},ec=["src"],tc={key:1,class:"avatar avatar--placeholder bg-base-100"},nc={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},ac={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},oc={class:"itemsb-main"},rc={class:"itemsb-row"},ic={class:"itemsb-title truncate"},sc={class:"itemsb-time"},lc={class:"itemsb-sub"},cc={class:"items-attendant"},dc={class:"itemsb-content"},uc={key:0,class:"itemsb-actions"},fc=["disabled"],mc={key:0,class:"loading-spinner"},hc={class:"event-left"},pc={class:"event-line"},gc={class:"event-actions"},yc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},kc={class:"sched-pop__card bg-base-300",role:"dialog"},xc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},bc={class:"sched-pop__card bg-base-300",role:"dialog"},wc={class:"event-time"},Ec={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},vc={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Cc=["disabled"],Sc={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Bc={key:1,class:"loading-spinner"},Va=Ce({__name:"EventItem",props:{ev:{type:Object,required:!0},mode:{type:String,default:"compact"},getEventColor:{type:Function,default:null},viewOnly:{type:Boolean,default:!1}},emits:["open-message","open-chat","delete-message"],setup(t,{emit:n}){const a=Yt(),o=t,r=e.computed(()=>(o.getEventColor||Rn)(o.ev)),i=e.computed(()=>{var u;return((u=o.ev)==null?void 0:u.type)==="scheduled_messages"}),s=e.computed(()=>a.attendants.find(u=>u.is_me)||{}),l=u=>{const c=a.attendants.find(h=>h.id===u);return c?c.id===s.value.id?"Você":c.name||"Desconhecido":"Desconhecido"},d=e.computed(()=>{var c,h;const u=[];return(c=o.ev)!=null&&c.contactName&&u.push(o.ev.contactName),u.push(((h=o.ev)==null?void 0:h.departmentName)||"sem depto"),u.join(" • ")});return(u,c)=>{var h,m,p,f,g,y;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",_2,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",R2,[e.createElementVNode("div",H2,e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("div",z2,[e.createElementVNode("span",j2,[c[9]||(c[9]=e.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("footer",G2,[e.createElementVNode("div",I2,[e.createElementVNode("div",q2,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",W2,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["status-bar",(h=t.ev)!=null&&h.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",U2,[c[10]||(c[10]=e.createElementVNode("strong",null,"Status",-1)),c[11]||(c[11]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])]),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[0]||(c[0]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((m=t.ev)==null?void 0:m.status)===!0?(e.openBlock(),e.createElementBlock("svg",Z2,[...c[12]||(c[12]=[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Y2,[...c[13]||(c[13]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])]))])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[1]||(c[1]=k=>u.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",K2,[...c[14]||(c[14]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",Q2)):e.createCommentVNode("",!0)],8,X2)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[2]||(c[2]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[15]||(c[15]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)])])])],64)):t.mode==="sidebar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",J2,[e.createElementVNode("div",{class:"avatar-wrap",style:e.normalizeStyle({boxShadow:`0 0 0 1px ${r.value}`})},[t.ev.contactPhoto?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,ec)):(e.openBlock(),e.createElementBlock("div",tc,[...c[16]||(c[16]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",class:"icon-5 icon-muted"},[e.createElementVNode("path",{fill:"currentColor",d:"M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5m0 2c-4 0-8 2-8 4v2h16v-2c0-2-4-4-8-4Z"})],-1)])])),e.createElementVNode("div",nc,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-dot-avatar",(p=t.ev)!=null&&p.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",ac,[c[17]||(c[17]=e.createElementVNode("strong",null,"Status",-1)),c[18]||(c[18]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])],4),e.createElementVNode("div",oc,[e.createElementVNode("div",rc,[e.createElementVNode("span",ic,e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("span",sc,e.toDisplayString(t.ev.time),1)]),e.createElementVNode("div",lc,[e.createElementVNode("span",cc,[c[19]||(c[19]=e.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z"})],-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("p",dc,e.toDisplayString(t.ev.content||t.ev.title),1),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",uc,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:c[3]||(c[3]=k=>u.$emit("open-message",t.ev))},e.toDisplayString(((f=t.ev)==null?void 0:f.status)===!0?"Editar":"Visualizar"),1)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[4]||(c[4]=k=>u.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--sm cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",mc)):e.createCommentVNode("",!0),c[20]||(c[20]=e.createTextVNode(" Apagar ",-1))],8,fc)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:c[5]||(c[5]=k=>u.$emit("open-chat",t.ev))}," Abrir conversa ")):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",hc,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",pc,e.toDisplayString(d.value),1)]),e.createElementVNode("footer",gc,[e.createElementVNode("div",yc,[c[23]||(c[23]=e.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",kc,[c[21]||(c[21]=e.createElementVNode("strong",null,"Agendado por",-1)),c[22]||(c[22]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",xc,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(g=t.ev)!=null&&g.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[c[24]||(c[24]=e.createElementVNode("strong",null,"Status",-1)),c[25]||(c[25]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",wc,e.toDisplayString(t.ev.time),1),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[6]||(c[6]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((y=t.ev)==null?void 0:y.status)===!0?(e.openBlock(),e.createElementBlock("svg",Ec,[...c[26]||(c[26]=[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",vc,[...c[27]||(c[27]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])]))])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[7]||(c[7]=k=>u.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Sc,[...c[28]||(c[28]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",Bc)):e.createCommentVNode("",!0)],8,Cc)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[8]||(c[8]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[29]||(c[29]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)])])])],64))}}},[["__scopeId","data-v-ba8ebbe5"]]),St=new Map,hr=Dt.defineStore("scheduled",{state:()=>({baseUrl:L0,monthCache:{},loadingYM:new Set,errorByYM:{},loadedYM:new Set,filters:{}}),getters:{eventsOf:t=>n=>t.monthCache[n]||[],isLoading:t=>n=>t.loadingYM.has(n),errorOf:t=>n=>t.errorByYM[n]||""},actions:{setBaseUrl(t){this.baseUrl=t||"/crm_scheduled"},_setMonth(t,n){this.monthCache={...this.monthCache,[t]:n||[]}},_deleteMonth(t){const{[t]:n,...a}=this.monthCache;this.monthCache=a,this.loadingYM.delete(t);const{[t]:o,...r}=this.errorByYM;this.errorByYM=r,this.loadedYM.delete(t)},coerceHttps(t){return t&&t.startsWith("http://")?t.replace(/^http:\/\//i,"https://"):t},_appendMonth(t,n){if(!n||n.length===0)return;this.monthCache[t]||(this.monthCache[t]=[]);const a=new Set(this.monthCache[t].map(o=>o==null?void 0:o.id));for(const o of n)o&&(o.id&&a.has(o.id)||this.monthCache[t].push(o))},async ensureMonthLoaded(t){if(t||(t=Zt(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if(St.has(n))return St.get(n);this.loadingYM.add(t),this.errorByYM={...this.errorByYM,[t]:""};const a=(async()=>{var o,r;try{const i=`${this.baseUrl}?year_month=${encodeURIComponent(t)}&page_size=10`,s=await at.get(i),l=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],d=ur(l||[]);this._setMonth(t,d),this.loadedYM.add(t);let u=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);u&&(async()=>{var c,h;try{let m=u;for(;m;){const p=await at.get(m),f=Array.isArray(p==null?void 0:p.data)?p.data:((c=p==null?void 0:p.data)==null?void 0:c.results)||[],g=ur(f||[]);this._appendMonth(t,g),m=this.coerceHttps(((h=p==null?void 0:p.data)==null?void 0:h.next)||null)}}catch(m){console.warn("[scheduled] background paging error:",(m==null?void 0:m.message)||m)}})()}catch(i){const s=String((i==null?void 0:i.message)||i);throw this.errorByYM={...this.errorByYM,[t]:s},console.error("[scheduled] fetch error",t,s),this._setMonth(t,[]),this.loadedYM.delete(t),i}finally{St.delete(n),this.loadingYM.delete(t)}})();return St.set(n,a),a},async forceReload(t){t||(t=Zt(new Date));const n=`${this.baseUrl}|${t}`;St.delete(n),this._deleteMonth(t),this.loadedYM.delete(t),await this.ensureMonthLoaded(t)},findEventById(t){const n=String(t);for(const[a,o]of Object.entries(this.monthCache)){const r=(o||[]).findIndex(i=>{var d;const s=((d=i==null?void 0:i.raw)==null?void 0:d.id)!=null?String(i.raw.id):null,l=(i==null?void 0:i.id)!=null?String(i.id):null;return s===n||l===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:t,params:n}){var m,p,f,g,y,k,w,E,v,M,A,R,S;let a=null;if((m=n==null?void 0:n.schedule)!=null&&m.time){const x=n.schedule.time,N=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(x);if(N){const[,L,F,B,C="00",O="00"]=N;a=new Date(Number(L),Number(F)-1,Number(B),Number(C),Number(O),0,0)}else{const L=typeof x=="string"&&!x.includes("T")?x.replace(" ","T"):x;a=new Date(L)}}console.log(n);const o=x=>{var N,L,F,B;return a instanceof Date&&!isNaN(a)&&(x.date=a,x.time=_n(a)),((L=(N=n==null?void 0:n.message)==null?void 0:N[0])==null?void 0:L.content)!=null&&(x.content=n.message[0].content),x.raw=x.raw||{id:t},x.raw.params=x.raw.params||{},n!=null&&n.schedule&&(x.raw.params.schedule={...x.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(x.raw.params.scheduled_by=n.scheduled_by),n.department&&(x.raw.params.department=n.department),n!=null&&n.message&&(x.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(x.chatId=n.chat_id??x.chatId??""),n!=null&&n.entity&&(x.raw.params.entity={...x.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(x.contactName=n.entity.name??x.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(x.contactPhoto=n.entity.photo??x.contactPhoto??null,n.entity.photo&&(x.photo=n.entity.photo))),n!=null&&n.info&&(x.raw.params.info={...x.raw.params.info||{},...n.info},(F=n.info)!=null&&F.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(x.departmentName=n.info.department.name??x.departmentName),(B=n.info)!=null&&B.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(x.instanceName=n.info.instance.name??x.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(x.instanceStatus=n.info.instance.last_instance_status??x.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?x.title=n.title??x.title??"Mensagem programada":x.title=x.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(x.function=n.function??x.function??"scheduled_messages",x.type=n.function??x.type??"scheduled_messages"):(x.function=x.function||"scheduled_messages",x.type=x.type||"scheduled_messages"),x},r=this.findEventById(t);if(!r){const x=a instanceof Date&&!isNaN(a)?a:(()=>{var O;const B=(O=n==null?void 0:n.schedule)==null?void 0:O.time,C=typeof B=="string"&&!B.includes("T")?B.replace(" ","T"):B;return(mn==null?void 0:mn(C))||(C?new Date(C):new Date)})(),N=o({id:t,date:x,time:_n(x),title:(n==null?void 0:n.title)||"Mensagem programada",type:(n==null?void 0:n.function)||"scheduled_messages",status:(n==null?void 0:n.status)||"true",scheduled_by:(n==null?void 0:n.scheduled_by)||null,function:(n==null?void 0:n.function)||"scheduled_messages",content:((f=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:f.content)??"",raw:{id:t,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((y=n==null?void 0:n.entity)==null?void 0:y.photo)??null,departmentName:((w=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:w.name)??null,departmentId:((v=(E=n==null?void 0:n.info)==null?void 0:E.department)==null?void 0:v.id)??null,instanceName:((A=(M=n==null?void 0:n.info)==null?void 0:M.instance)==null?void 0:A.name)??null,instanceStatus:((S=(R=n==null?void 0:n.info)==null?void 0:R.instance)==null?void 0:S.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),L=Zt(N.date),F=this.monthCache[L]?[...this.monthCache[L],N]:[N];F.sort((B,C)=>B.date-C.date),this._setMonth(L,F);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],d={...l[s]},u=o({...d}),c=u.date instanceof Date?u.date:d.date,h=Zt(c);if(h===i){const x=[...l];x.splice(s,1,u),x.sort((N,L)=>N.date-L.date),this._setMonth(i,x)}else{const x=l.slice(0,s).concat(l.slice(s+1)),N=this.monthCache[h]?[...this.monthCache[h],u]:[u];N.sort((L,F)=>L.date-F.date),this.monthCache={...this.monthCache,[i]:x,[h]:N}}},removeFromCache(t){const n=this.findEventById(t);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],i=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,i),!0},insertNormalizedEvent(t){if(!t)return;const n=String(t.id),a=t.date instanceof Date?t.date:mn(t.date)||new Date,o=Zt(a),r={...t,id:n,date:a,time:t.time??_n(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var d;return String(((d=l==null?void 0:l.raw)==null?void 0:d.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,d)=>l.date-d.date),this._setMonth(o,i)},insertFromApiItem(t){const n=Ba(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=Ba(n);a&&this.insertNormalizedEvent(a)}},insertFromApiPage(t){const n=Array.isArray(t)?t:(t==null?void 0:t.results)||[];this.insertManyFromApi(n)},insertFromParams(t){return this.applyUpdateToCache(t)},hasEvent(t){return!!this.findEventById(t)},resetAll(){var t;this.monthCache={},this.loadingYM=new Set,this.errorByYM={},this.loadedYM=new Set,(t=St.clear)==null||t.call(St)}}}),Vc={class:"cpk-header bg-base-200"},Mc={class:"left"},Nc=["title"],Ac={class:"right"},Tc=["title"],Dc={class:"toggle"},Fc=["aria-pressed","title"],Lc={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},$c={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Pc=Ce({__name:"CalHeader",props:{month:String,year:[String,Number],isCompact:Boolean,viewMode:{type:String,default:"calendar"},filterCount:{type:Number,default:0}},emits:["prev","next","today","toggle-compact","set-view-mode","close-page","open-filter"],setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("header",Vc,[e.createElementVNode("div",Mc,[e.createElementVNode("button",{onClick:a[0]||(a[0]=o=>n.$emit("close-page")),class:"cyber-button cyber-button--sm btn-ghost nav hide-md-up","aria-label":"Fechar"},[...a[8]||(a[8]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[1]||(a[1]=o=>n.$emit("prev")),"aria-label":"Mês anterior"},[...a[9]||(a[9]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M15.5 19 9 12l6.5-7 1.5 1.3L12.3 12l4.7 5.7z"})],-1),e.createElementVNode("span",{class:"label-md"},"Anterior",-1)])]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent today",onClick:a[2]||(a[2]=o=>n.$emit("today")),"aria-label":"Hoje"},[...a[10]||(a[10]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor",d:"M11.6643 2.05648c.0197-.00699.1589-.05645.3357-.05645.1768 0 .316.04946.3357.05645l.0019.00067c.0461.01577.0846.03229.1092.04332.0514.02304.1015.04898.1449.07268.0896.04898.1957.11302.3102.18855.2291.15109.521.36725.8121.63689C14.247 3.49218 15 4.37 15 5.50003c0 1.12688-.7447 2.00396-1.2779 2.49995-.2531.23541-.5075.43043-.7221.57742V10h5c.5523 0 1 .4477 1 1v3h-4c-.0568 0-.1125.0048-.1667.0139-.0542-.0091-.1099-.0139-.1667-.0139H5v-3c0-.5523.44772-1 1-1h5V8.57622c-.2139-.14666-.4676-.34115-.7202-.57589C9.74664 7.50489 9 6.62764 9 5.50003c0-1.13003.753-2.00785 1.286-2.50144.2911-.26964.583-.4858.8121-.63689.1145-.07553.2206-.13957.3102-.18855.0434-.0237.0935-.04964.1449-.07268.0246-.01103.0631-.02755.1092-.04332l.0019-.00067ZM4 17.8377V21c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2.8243c-.0609.0534-.1248.1054-.1917.1556-.56.42-1.274.6687-2.1416.6687-.8677 0-1.5817-.2487-2.1417-.6687-.281-.2108-.5081-.4531-.6917-.7045-.1835.2514-.4106.4937-.6917.7045-.5599.42-1.2739.6687-2.1416.6687-.8677 0-1.5817-.2487-2.14169-.6687-.20142-.1511-.37514-.3184-.52499-.4936-.14984.1752-.32356.3425-.52499.4936-.55999.42-1.27398.6687-2.14166.6687s-1.58168-.2487-2.14167-.6687c-.20143-.1511-.37515-.3184-.525-.4936ZM5.2078 16c.0124.0314.0255.0628.03934.0939.11841.2664.27553.4856.47786.6374.19001.1425.47602.2687.94167.2687s.75165-.1262.94166-.2687c.20234-.1518.35945-.371.47786-.6374.01384-.0311.02694-.0625.03934-.0939H5.2078Zm5.3727.0939c-.0139-.0311-.027-.0625-.0394-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4778-.6374Zm5.6666 0c-.0138-.0311-.0269-.0625-.0393-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4779-.6374Z"})],-1),e.createElementVNode("span",{class:"label-md"},"Hoje",-1)])]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[3]||(a[3]=o=>n.$emit("next")),"aria-label":"Próximo mês"},[...a[11]||(a[11]=[e.createElementVNode("span",{class:"label-md"},"Próximo",-1),e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M8 19l6.5-7L8 5l-1.5 1.3L11.7 12 6.5 17.7z"})],-1)])])]),e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,Nc),e.createElementVNode("div",Ac,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost filter-btn",title:"Filtro de eventos",onClick:a[4]||(a[4]=o=>n.$emit("open-filter",o))},[a[12]||(a[12]=e.createElementVNode("svg",{class:"icon-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M5.05 3C3.291 3 2.352 5.024 3.51 6.317l5.422 6.059v4.874c0 .472.227.917.613 1.2l3.069 2.25c1.01.742 2.454.036 2.454-1.2v-7.124l5.422-6.059C21.647 5.024 20.708 3 18.95 3H5.05Z"})],-1)),t.filterCount>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:"filter-badge",title:`${t.filterCount} filtro${t.filterCount>1?"s":""} ativo${t.filterCount>1?"s":""}`},e.toDisplayString(t.filterCount),9,Tc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.viewMode==="calendar"?"is-active":""]),onClick:a[5]||(a[5]=o=>n.$emit("set-view-mode","calendar")),"aria-label":"Visão Calendário"},[...a[13]||(a[13]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M5 5a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1 2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a2 2 0 0 1 2-2ZM3 19v-7a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",{class:"label-lg"},"Calendário",-1)])],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.viewMode==="agenda"?"is-active":""]),onClick:a[6]||(a[6]=o=>n.$emit("set-view-mode","agenda")),"aria-label":"Visão Agenda"},[...a[14]||(a[14]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11 4.717c-2.286-.58-4.16-.756-7.045-.71A1.99 1.99 0 0 0 2 6v11c0 1.133.934 2.022 2.044 2.007 2.759-.38 4.5-.182 6.956.449V4.717Zm2 15.081c2.456-.631 4.198-.829 6.956-.791A2.013 2.013 0 0 0 22 16.999V6a1.99 1.99 0 0 0-1.955-1.993c-2.885-.046-4.76.13-7.045.71v15.081Z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",{class:"label-lg"},"Agenda",-1)])],2)]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm show-lg btn-ghost",onClick:a[7]||(a[7]=o=>n.$emit("toggle-compact")),"aria-pressed":t.isCompact,title:t.isCompact?"Sair do modo compacto":"Ativar modo compacto"},[t.isCompact?(e.openBlock(),e.createElementBlock("svg",$c,[...a[16]||(a[16]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4H4m0 0v4m0-4 5 5m7-5h4m0 0v4m0-4-5 5M8 20H4m0 0v-4m0 4 5-5m7 5h4m0 0v-4m0 4-5-5"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Lc,[...a[15]||(a[15]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8h4V4m12 4h-4V4M4 16h4v4m12-4h-4v4"},null,-1)])]))],8,Fc)])]))}},[["__scopeId","data-v-37b625a5"]]),Oc=["title"],_c={class:"week-header"},Rc=Ce({__name:"WeekDays",props:{weekDays:{type:Array,default:()=>[]},month:String,year:[String,Number]},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,Oc),e.createElementVNode("div",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.weekDays,o=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"week-cell"},e.toDisplayString(o),1))),128))])],64))}},[["__scopeId","data-v-756165d9"]]),Hc=["onClick"],zc={key:0,class:"cell-today-indicator show-lg"},jc={class:"cell-top"},Gc={class:"day-number"},Ic={key:1,class:"more"},qc={class:"bars-wrap"},Wc=4,Uc=8,pr=4,gr=2,Zc=1,Yc=Ce({__name:"CalendarGrid",props:{startOffset:Number,monthDays:Array,viewDate:Date,isCompact:Boolean,isSameMonthFn:Function,isSelectedDayFn:Function,isTodayFn:Function,selectDayFn:Function,eventsByDayFn:Function,dayEventCountFn:Function,eventBarsToShowFn:Function,dayEventOverflowFn:Function},setup(t){const n=t,a=e.ref({}),o=new Map;function r(f){const g=(f==null?void 0:f.clientWidth)||0,y=(f==null?void 0:f.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+pr)/(Wc+pr))),w=Math.max(0,Math.floor((y+gr)/(Uc+gr))),E=l(k,w),v=E.reduce((M,A)=>M+A,0);return{cols:k,rows:w,widths:E,sum:v}}function i(f,g){const y=r(g),k=a.value[f];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[f]:y})}function s(f,g){if(!g){const k=o.get(f);if(k&&(k.disconnect(),o.delete(f)),a.value[f]!=null){const w={...a.value};delete w[f],a.value=w}return}i(f,g);const y=new ResizeObserver(()=>i(f,g));y.observe(g),o.set(f,y)}e.onBeforeUnmount(()=>{o.forEach(f=>f.disconnect()),o.clear()});function l(f,g){if(f<=0||g<=0)return[];const y=[],k=.25;for(let w=0;w<g;w++){const E=w/Math.max(1,g-1),v=k+(1-k)*E,M=Math.max(1,Math.round(f*v));y.push(Math.min(M,f))}return y}function d(f,g){var v;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((v=a.value[f])==null?void 0:v.sum)??0;if(y<=k)return{bars:y,overflow:0};const w=Math.max(0,k-Zc),E=Math.max(0,y-w);return{bars:w,overflow:E}}function u(f,g){const y=a.value[f];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,E=d(f,g).bars,v=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,E):[])||[],M=k.map(()=>[]);let A=0;for(let R=k.length-1;R>=0&&A<v.length;R--){const S=Math.min(k[R],v.length-A);M[R]=v.slice(A,A+S),A+=S}return M}const c=e.ref(null);function h(f){return f&&f.nodeType===1&&typeof f.getBoundingClientRect=="function"}function m(f){if(!h(f))return;const g=c.value,y=g&&h(g)?g:f.offsetParent;if(!h(y))return;let k,w;try{k=f.getBoundingClientRect(),w=y.getBoundingClientRect()}catch{return}const E=y.scrollLeft||0,v=y.scrollTop||0;f.style.position="absolute",f.style.zIndex="0",f.style.top=`${k.top-w.top+v}px`,f.style.left=`${k.left-w.left+E}px`,f.style.width=`${k.width}px`,f.style.height=`${k.height}px`,f.style.pointerEvents="none"}function p(f){!f||!f.style||requestAnimationFrame(()=>{!f||!f.style||(f.style.position="",f.style.zIndex="",f.style.top="",f.style.left="",f.style.width="",f.style.height="",f.style.pointerEvents="")})}return(f,g)=>(e.openBlock(),e.createBlock(e.TransitionGroup,{name:"cal-fade","move-class":"cal-move",tag:"div",class:"cal-grid calendar-grid",appear:"",ref_key:"gridRef",ref:c,onBeforeLeave:m,onAfterLeave:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.startOffset,y=>(e.openBlock(),e.createElementBlock("div",{key:"x"+y,class:"cal-cell day-empty bg-base-300 border border-base-100"}))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.monthDays,(y,k)=>(e.openBlock(),e.createElementBlock("div",{key:y.key,style:e.normalizeStyle({"--i":k}),class:e.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[t.isSameMonthFn(y.date,t.viewDate)?"":"opacity-60",t.isSelectedDayFn(y.date)?"neon-selected":"",t.isTodayFn(y.date)?"is-today":"",t.dayEventCountFn(y.date)>0?"has-events":""]]),onClick:w=>t.selectDayFn(y.date)},[t.isTodayFn(y.date)?(e.openBlock(),e.createElementBlock("div",zc," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",jc,[e.createElementVNode("span",Gc,e.toDisplayString(y.date.getDate()),1)]),d(y.key,y.date).overflow>0?(e.openBlock(),e.createElementBlock("span",Ic," +"+e.toDisplayString(d(y.key,y.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",qc,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:w=>s(y.key,w)},[d(y.key,y.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u(y.key,y.date),(w,E)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+E,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w,(v,M)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+E+"-"+M,class:"vbar",style:e.normalizeStyle({background:e.unref(Rn)(v),boxShadow:`0 0 8px ${e.unref(Rn)(v)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,Hc))),128))]),_:1},512))}},[["__scopeId","data-v-26af06b5"]]),Xc={class:"agenda-section"},Kc={key:0,class:"empty-state"},Qc={key:1,class:"day-list"},Jc={class:"date-trail"},ed={class:"weekday-short"},td={class:"date-pill bg-base-200 border border-base-300"},nd={class:"date-pill-month"},ad={class:"date-pill-day"},od={class:"content-col"},rd={class:"day-header"},id={class:"agenda-title"},sd={class:"month-header-text"},ld={class:"events-list"},cd=Ce({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message"],setup(t,{emit:n}){return(a,o)=>(e.openBlock(),e.createElementBlock("section",Xc,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",Kc," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",Qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.days,r=>{var i;return e.openBlock(),e.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[e.createElementVNode("div",Jc,[e.createElementVNode("div",ed,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",td,[e.createElementVNode("div",nd,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",ad,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(Rn)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",od,[e.createElementVNode("div",rd,[e.createElementVNode("h3",id,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",sd,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.events,s=>(e.openBlock(),e.createElementBlock("li",{key:s.id,class:"event-item border border-base-100 bg-base-200 hover:bg-base-100"},[e.createVNode(Va,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=l=>a.$emit("open-message",l)),onOpenChat:o[1]||(o[1]=l=>a.$emit("open-chat",l)),onDeleteMessage:o[2]||(o[2]=l=>a.$emit("delete-message",l))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-2c977f25"]]),dd=["data-mode","data-empty"],ud=["disabled"],yr=Ce({__name:"EventsList",props:{loading:{type:Boolean,default:!1},selectedLabel:{type:String,default:""},selectedLabelLong:{type:String,default:""},events:{type:Array,default:()=>[]},mode:{type:String,default:"compact"}},emits:["reload","open-chat","open-message","delete-message"],setup(t){const n=t,a=e.computed(()=>n.mode==="compact"?n.selectedLabelLong||"Hoje":`Eventos em ${n.selectedLabel||"—"}`);return(o,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["bg-base-300 daylist",[t.mode==="compact"?"daylist--compact has-border border-base-200":"daylist--sidebar has-border border-base-200 supports-blur",{"daylist--tight":t.mode==="compact"&&!t.loading&&t.events.length===0}]]),"data-mode":t.mode,"data-empty":!t.loading&&t.events.length===0?"1":"0"},[e.createElementVNode("div",{class:e.normalizeClass(["daylist-header",t.mode==="compact"?"daylist-header--compact bg-base-300":"daylist-header--sidebar bg-base-300"])},[e.createElementVNode("h3",{class:e.normalizeClass(t.mode==="compact"?"daylist-title--compact":"daylist-title--sidebar")},e.toDisplayString(a.value),3),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:r[0]||(r[0]=i=>o.$emit("reload")),disabled:t.loading},e.toDisplayString(t.loading?"Atualizando…":"Atualizar"),9,ud)],2),t.loading?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["loading-text",t.mode==="compact"?"is-compact":"is-sidebar"])}," Carregando… ",2)]),_:1})):t.events.length===0?(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"fade"},{default:e.withCtx(()=>[...r[4]||(r[4]=[e.createElementVNode("div",{class:"empty-text"},"Sem eventos.",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.TransitionGroup,{key:2,name:"list","move-class":"list-move",tag:"ul",appear:"",class:e.normalizeClass([t.mode==="compact"?"list-compact has-border border-base-300 bg-base-200 supports-blur":"list-sidebar"])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.events,(i,s)=>(e.openBlock(),e.createElementBlock("li",{key:i.id,style:e.normalizeStyle({"--i":s}),class:e.normalizeClass(t.mode==="compact"?"item-compact hover:bg-base-100":"item-sidebar hover:z-10 has-border hover:bg-base-100 border-base-100 bg-base-200 ")},[e.createVNode(Va,{ev:i,mode:t.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=l=>o.$emit("open-message",l)),onOpenChat:r[2]||(r[2]=l=>o.$emit("open-chat",l)),onDeleteMessage:r[3]||(r[3]=l=>o.$emit("delete-message",l))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,dd))}},[["__scopeId","data-v-4ecbf2a5"]]),fd={class:"cpk-popover__header border-base-100"},md={class:"filter-body"},hd={class:"row"},pd=["checked"],gd={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},yd={class:"status-wrap"},kd={class:"seg"},xd=Ce({__name:"CalFilter",props:{open:{type:Boolean,default:!1},anchorEl:{type:[HTMLElement,Object],default:null},offset:{type:Number,default:8},align:{type:String,default:"center"},filters:{type:Object,default:()=>({})}},emits:["close","update:filters"],setup(t,{emit:n}){const a=t,o=n,r=Yt(),i=e.computed(()=>r.attendants.find(S=>S.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async S=>{var L,F,B;if(!S)return;await e.nextTick();const x=(L=i.value)!=null&&L.id?String(i.value.id):null;s.onlyMine=!!x&&String(((F=a.filters)==null?void 0:F.scheduled_by)??"")===x;const N=(B=a.filters)==null?void 0:B.status;s.status=N===!0||N===!1?N:null,y()},{immediate:!1});function l(S,x){if(!S)return{};const{[x]:N,...L}=S;return L}function d(S){var N;s.onlyMine=!!S.target.checked;const x=(N=i.value)!=null&&N.id?String(i.value.id):null;s.onlyMine&&x?o("update:filters",{...a.filters,scheduled_by:x}):o("update:filters",l(a.filters,"scheduled_by"))}function u(S){if(s.status===S){s.status=null;const x=l(a.filters,"status");o("update:filters",x)}else s.status=S,o("update:filters",{...a.filters,status:S})}const c=e.ref(null),h=e.ref({left:0,top:0,placed:"bottom"}),m=e.computed(()=>({position:"fixed",left:`${h.value.left}px`,top:`${h.value.top}px`}));function p(){const S=a.anchorEl instanceof Element?a.anchorEl:null;if(S!=null&&S.getBoundingClientRect)return S.getBoundingClientRect();const x=window.innerWidth/2,N=window.innerHeight/3;return{left:x,right:x,top:N,bottom:N,width:0,height:0}}function f(S,x,N,L){return{left:Math.max(8,Math.min(S,window.innerWidth-N-8)),top:Math.max(8,Math.min(x,window.innerHeight-L-8))}}function g(){const S=p(),x=c.value,N=(x==null?void 0:x.offsetWidth)??300,L=(x==null?void 0:x.offsetHeight)??220;let F=S.bottom+a.offset,B;if(a.align==="center"?B=S.left+S.width/2-N/2:a.align==="end"?B=S.right-N:B=S.left,F+L>window.innerHeight-4){const O=S.top-L-a.offset;O>=4?(F=O,h.value.placed="top"):h.value.placed="bottom"}else h.value.placed="bottom";const C=f(B,F,N,L);h.value={left:C.left,top:C.top,placed:h.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,w,E=[];function v(){M(),E=[window];const S=a.anchorEl instanceof Element?a.anchorEl:null;let x=S==null?void 0:S.parentElement;for(;x&&x!==document.body;){const N=getComputedStyle(x);/(auto|scroll)/.test(N.overflow+N.overflowY+N.overflowX)&&E.push(x),x=x.parentElement}E.forEach(N=>N.addEventListener("scroll",y,{passive:!0}))}function M(){E.forEach(S=>{var x;return(x=S.removeEventListener)==null?void 0:x.call(S,"scroll",y)}),E=[]}e.watch(()=>a.open,async S=>{var N,L,F,B;if(!S){M(),(N=k==null?void 0:k.disconnect)==null||N.call(k),(L=w==null?void 0:w.disconnect)==null||L.call(w);return}await e.nextTick(),y(),v(),(F=k==null?void 0:k.disconnect)==null||F.call(k),k=new ResizeObserver(y),k.observe(document.body),(B=w==null?void 0:w.disconnect)==null||B.call(w);const x=a.anchorEl instanceof Element?a.anchorEl:null;x&&(w=new ResizeObserver(y),w.observe(x)),window.addEventListener("resize",y)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),v(),y())});function A(S){S.key==="Escape"&&o("close")}function R(S){if(!a.open)return;const x=S.target,N=c.value;if(N&&N.contains(x))return;const L=a.anchorEl instanceof Element?a.anchorEl:null;L&&L.contains&&L.contains(x)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",R,!0),window.addEventListener("keydown",A)}),e.onBeforeUnmount(()=>{var S,x;document.removeEventListener("pointerdown",R,!0),window.removeEventListener("keydown",A),M(),(S=k==null?void 0:k.disconnect)==null||S.call(k),(x=w==null?void 0:w.disconnect)==null||x.call(w)}),(S,x)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:x[4]||(x[4]=e.withModifiers(N=>S.$emit("close"),["self"]))},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:c,class:"cpk-popover bg-base-300",style:e.normalizeStyle(m.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",fd,[x[5]||(x[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),x[6]||(x[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:x[0]||(x[0]=N=>S.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",md,[e.createElementVNode("label",hd,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:x[1]||(x[1]=N=>d(N)),"aria-label":"Exibir somente meus eventos"},null,40,pd),x[7]||(x[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",gd,[x[9]||(x[9]=e.createElementVNode("span",{class:"status-icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})])],-1)),e.createElementVNode("div",yd,[x[8]||(x[8]=e.createElementVNode("div",{class:"label-cpk"},[e.createTextVNode(" Status "),e.createElementVNode("span",{class:"sched-pop",tabindex:"0","aria-label":"Ajuda sobre status"},[e.createElementVNode("span",{class:"sched-pop__mark"},[e.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.008-3.018a1.502 1.502 0 0 1 2.522 1.159v.024a1.44 1.44 0 0 1-1.493 1.418 1 1 0 0 0-1.037.999V14a1 1 0 1 0 2 0v-.539a3.44 3.44 0 0 0 2.529-3.256 3.502 3.502 0 0 0-7-.255 1 1 0 0 0 2 .076c.014-.398.187-.774.48-1.044Zm.982 7.026a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2h-.01Z","clip-rule":"evenodd"})])]),e.createElementVNode("div",{class:"sched-pop__card bg-base-300",style:{"--popover-brd":"var(--cyber-border)",transform:"translate(-5%, -50%) scale(0.98)"}},[e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Ativos:"),e.createTextVNode(" Eventos que estão programados para ocorrer ")]),e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Executados:"),e.createTextVNode(" Eventos que já ocorreram ")])])])],-1)),e.createElementVNode("div",kd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:x[2]||(x[2]=N=>u(!0)),"aria-pressed":"state.status === true"}," Ativos ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!1?"is-active":""]),onClick:x[3]||(x[3]=N=>u(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-0aad9d42"]]),bd={class:"calendar-content"},wd={class:"calendar-stage-main"},Ed={key:0},kr=Ce({__name:"scheduledCalendar",props:{sourceUrl:{type:String,default:"/crm_scheduled"},initialDate:{type:[String,Date],default:()=>new Date}},emits:["open-chat","loaded","open-message","close-page"],setup(t,{expose:n,emit:a}){const o=t,r=hr();r.setBaseUrl(o.sourceUrl);const i=new Date,s=e.ref(u(o.initialDate)),l=e.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),d=e.ref("calendar");function u(b){if(b instanceof Date)return new Date(b.getFullYear(),b.getMonth(),1);if(typeof b=="string"){const[T,X]=b.split("-").map(ne=>parseInt(ne,10));return new Date(T||i.getFullYear(),(X||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function c(b){return new Date(b.getFullYear(),b.getMonth()+1,0).getDate()}function h(b){return new Date(b.getFullYear(),b.getMonth(),1).getDay()}function m(b,T){return b.getFullYear()===T.getFullYear()&&b.getMonth()===T.getMonth()}function p(b){return Sa(b,i)}function f(b){return Sa(b,l.value)}function g(b){l.value=new Date(b.getFullYear(),b.getMonth(),b.getDate()),m(b,s.value)||(s.value=new Date(b.getFullYear(),b.getMonth(),1))}function y(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function k(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function w(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const E=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],v=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],M=e.computed(()=>C(E[s.value.getMonth()])),A=e.computed(()=>s.value.getFullYear()),R=e.computed(()=>x(l.value)),S=e.computed(()=>`${N(l.value)} ${l.value.getDate()}`);function x(b){return`${String(b.getDate()).padStart(2,"0")}/${String(b.getMonth()+1).padStart(2,"0")}/${b.getFullYear()}`}function N(b){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][b.getDay()]}function L(b){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][b.getDay()]}function F(b){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][b.getMonth()]}function B(b){return E[b.getMonth()]}function C(b){return b.charAt(0).toUpperCase()+b.slice(1)}const O=e.computed(()=>h(s.value)),Z=e.computed(()=>{const b=c(s.value);return Array.from({length:b},(T,X)=>{const ne=X+1,se=new Date(s.value.getFullYear(),s.value.getMonth(),ne);return{key:`d${ne}`,date:se}})}),Q=e.ref({open:!1,anchorEl:null});function ee(b){Q.value.open=!0,Q.value.anchorEl=(b==null?void 0:b.currentTarget)||null}const{filters:P}=Dt.storeToRefs(r),H=e.computed(()=>Zt(s.value)),_=e.computed(()=>r.eventsOf(H.value)),oe={scheduled_by:b=>{var ne,se,fe;const T=(b==null?void 0:b.scheduled_by)??((se=(ne=b==null?void 0:b.raw)==null?void 0:ne.params)==null?void 0:se.scheduled_by)??((fe=b==null?void 0:b.raw)==null?void 0:fe.scheduled_by)??(b==null?void 0:b.created_by)??(b==null?void 0:b.attendant_id),X=typeof T=="object"&&T?T.id??T.attendant_id:T;return X!=null?String(X):""}};function de(b,T){const X=(T==null?void 0:T.value)??T;return!X||typeof X!="object"?!0:Object.entries(X).every(([ne,se])=>{var ve,Fe,xe;if(se==null||se===""||Array.isArray(se)&&se.length===0)return!0;const fe=oe[ne],me=(fe==null?void 0:fe(b))??(b==null?void 0:b[ne])??((ve=b==null?void 0:b.raw)==null?void 0:ve[ne])??((xe=(Fe=b==null?void 0:b.raw)==null?void 0:Fe.params)==null?void 0:xe[ne])??null,be=typeof me=="string"?me:me??"";if(typeof se=="function")return!!se(be,b);if(Array.isArray(se))return se.map(String).includes(String(be));if(typeof se=="object"){const{in:V,notIn:z,range:j,contains:D}=se;if(V&&!V.map(String).includes(String(be))||z&&z.map(String).includes(String(be)))return!1;if(j&&typeof be=="number"){const[G,W]=j;if(G!=null&&be<G||W!=null&&be>W)return!1}if(D!=null){const G=Array.isArray(be)?be:String(be).split(",");if(!(Array.isArray(D)?D:[D]).some(J=>G.map(String).includes(String(J))))return!1}return!0}return String(be)===String(se)})}const pe=e.computed(()=>(_.value||[]).filter(T=>de(T,P)));function ye(b){return pe.value.filter(T=>Sa(T.date,b))}const Ve=e.computed(()=>ye(l.value)),Le=e.computed(()=>[...Ve.value].sort((b,T)=>b.date-T.date));function Ae(b){return ye(b).length}function qe(b){return Math.min(3,Ae(b))}function _e(b){const T=Ae(b);return T>3?T-3:0}const $e=e.computed(()=>{const b=s.value.getFullYear(),T=s.value.getMonth(),X=new Map;for(const se of pe.value){const fe=se==null?void 0:se.date;if(!(fe instanceof Date)||fe.getFullYear()!==b||fe.getMonth()!==T)continue;const me=`${b}-${T+1}-${fe.getDate()}`;X.has(me)||X.set(me,{key:`ag-${me}`,date:new Date(b,T,fe.getDate()),events:[]}),X.get(me).events.push(se)}const ne=Array.from(X.values());for(const se of ne)se.events.sort((fe,me)=>fe.date-me.date);return ne.sort((se,fe)=>se.date-fe.date),ne}),Oe=e.ref(!1),ze=e.ref(!1),q=e.computed(()=>ze.value||Oe.value),re=e.computed(()=>q?"calendar-stage--compact":"calendar-stage--single");function he(){var X;const b=window.matchMedia("(max-width: 1280px)"),T=()=>ze.value=b.matches;T(),(X=b.addEventListener)==null||X.call(b,"change",T)}const ae=e.computed(()=>r.isLoading(H.value));e.computed(()=>r.errorOf(H.value));const K=e.ref({open:!1,loading:!1,context:null,title:"Confirmar exclusão",description:"Tem certeza que deseja apagar este item?",destructive:!0,anchorEl:null,confirmLabel:"Apagar",cancelLabel:"Cancelar",loadingLabel:"Apagando…"});function ce(b,T){K.value.open=!0,K.value.context={action:"delete-message",event:b},K.value.title="Confirmar exclusão",K.value.description="Tem certeza que deseja apagar este evento?",K.value.anchorEl=T&&T.currentTarget||typeof document<"u"&&document.activeElement||null,K.value.destructive=!0,K.value.confirmLabel="Apagar",K.value.loadingLabel="Apagando…"}async function $(b){if(b)try{K.value.loading=!0,b.action==="delete-message"&&await Y(b.event)}finally{K.value.loading=!1,K.value.open=!1,K.value.context=null}}function I(){K.value.open=!1,K.value.context=null}async function te(){await r.forceReload(H.value)}async function Y(b){var T;try{b.deleteLoading=!0;const X=((T=b==null?void 0:b.raw)==null?void 0:T.id)??(b==null?void 0:b.id)??b;if(X==null)throw new Error("Evento inválido para exclusão");const ne=await $2(F0,b);return ne!=null&&ne.ok&&(r.removeFromCache(String(X))||await r.forceReload(H.value)),ne}catch(X){return console.error(X),null}finally{b.deleteLoading=!1}}return e.onMounted(async()=>{if(he(),await r.ensureMonthLoaded(H.value),!ye(l.value).length&&pe.value.length){const b=pe.value[0];l.value=new Date(b.date.getFullYear(),b.date.getMonth(),b.date.getDate())}}),e.watch(()=>o.sourceUrl,async b=>{if(r.setBaseUrl(b),r.resetAll(),await r.ensureMonthLoaded(H.value),!ye(l.value).length&&pe.value.length){const T=pe.value[0];l.value=new Date(T.date.getFullYear(),T.date.getMonth(),T.date.getDate())}}),e.watch(H,async()=>{const b=s.value.getFullYear(),T=s.value.getMonth(),X=Math.min(l.value.getDate(),c(s.value));if(l.value=new Date(b,T,X),await r.ensureMonthLoaded(H.value),!ye(l.value).length&&pe.value.length){const ne=pe.value[0];l.value=new Date(ne.date.getFullYear(),ne.date.getMonth(),ne.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(b,T)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":q.value}])},[e.createElementVNode("div",bd,[T[15]||(T[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(Pc,{month:M.value,year:A.value,"is-compact":q.value,"view-mode":d.value,"filter-count":Object.keys(e.unref(P)).length,onPrev:y,onNext:k,onToday:w,onToggleCompact:T[0]||(T[0]=X=>Oe.value=!Oe.value),onSetViewMode:T[1]||(T[1]=X=>d.value=X),onClosePage:T[2]||(T[2]=X=>b.$emit("close-page")),onOpenFilter:ee},null,8,["month","year","is-compact","view-mode","filter-count"]),d.value==="calendar"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["calendar-stage",re.value])},[e.createElementVNode("div",wd,[e.createVNode(Rc,{"week-days":v,month:M.value,year:A.value},null,8,["month","year"]),e.createVNode(Yc,{"start-offset":O.value,"month-days":Z.value,"view-date":s.value,"is-compact":q.value,"is-same-month-fn":m,"is-selected-day-fn":f,"is-today-fn":p,"select-day-fn":g,"events-by-day-fn":ye,"day-event-count-fn":Ae,"event-bars-to-show-fn":qe,"day-event-overflow-fn":_e},null,8,["start-offset","month-days","view-date","is-compact"])]),q.value?(e.openBlock(),e.createBlock(yr,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:ae.value,"selected-label-long":S.value,events:Le.value,mode:"compact",onReload:te,onOpenChat:T[3]||(T[3]=X=>b.$emit("open-chat",X)),onOpenMessage:T[4]||(T[4]=X=>b.$emit("open-message",X)),onDeleteMessage:T[5]||(T[5]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(cd,{key:1,days:$e.value,"weekday-long":N,"weekday-short":L,"month-short":F,"month-label-of":B,year:A.value,onOpenChat:T[6]||(T[6]=X=>b.$emit("open-chat",X)),onOpenMessage:T[7]||(T[7]=X=>b.$emit("open-message",X)),onDeleteMessage:T[8]||(T[8]=(X,ne)=>ce(X,ne))},null,8,["days","year"]))]),e.createVNode(yr,{class:"calendar-daylist calendar-daylist--desktop",loading:ae.value,"selected-label":R.value,"selected-label-long":S.value,events:Le.value,mode:q.value?"compact":"sidebar",onReload:te,onOpenChat:T[9]||(T[9]=X=>b.$emit("open-chat",X)),onOpenMessage:T[10]||(T[10]=X=>b.$emit("open-message",X)),onDeleteMessage:T[11]||(T[11]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(El,{modelValue:K.value.open,"onUpdate:modelValue":T[12]||(T[12]=X=>K.value.open=X),title:K.value.title,description:K.value.description,destructive:K.value.destructive,"confirm-label":K.value.confirmLabel,"cancel-label":K.value.cancelLabel,loading:K.value.loading,"loading-label":K.value.loadingLabel,context:K.value.context,"anchor-el":K.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:$,onCancel:I},{details:e.withCtx(()=>{var X;return[(X=K.value.context)!=null&&X.event?(e.openBlock(),e.createElementBlock("div",Ed,[e.createVNode(Va,{"view-only":!0,mode:"sidebar",ev:K.value.context.event},null,8,["ev"])])):e.createCommentVNode("",!0)]}),_:1},8,["modelValue","title","description","destructive","confirm-label","cancel-label","loading","loading-label","context","anchor-el"]),e.createVNode(xd,{open:Q.value.open,"anchor-el":Q.value.anchorEl,filters:e.unref(P),"onUpdate:filters":T[13]||(T[13]=X=>e.isRef(P)?P.value=X:null),onClose:T[14]||(T[14]=X=>Q.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-9c3b18ef"]]),vd={class:"flex flex-col text-center"},Cd={class:"flex flex-col space-y-3 justify-center"},Sd={class:"space-x-4 flex-col text-black justify-center"},Bd=["onUpdate:modelValue","onInput","onKeydown"],xr={__name:"mfa",props:{eventHandling:{type:String,default:null}},emits:["filled","reset"],setup(t,{emit:n}){e.onMounted(()=>{r.value[0].focus()});const a=n,o=e.ref(Array(6).fill("")),r=e.ref([]);e.ref(!1);const i=u=>{const c=o.value[u];o.value[0]<1&&a("reset"),/^\d$/.test(c)?s(u):o.value[u]="",u===o.value.length-1&&o.value.every(h=>h!=="")&&d()},s=u=>{u<o.value.length-1&&o.value[u]&&r.value[u+1].focus()},l=(u,c)=>{c.key==="Backspace"&&!o.value[u]&&u>0&&r.value[u-1].focus()},d=()=>{const u=o.value.join("");a("filled",u)};return(u,c)=>(e.openBlock(),e.createElementBlock("section",vd,[e.createElementVNode("div",Cd,[e.createElementVNode("div",Sd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(h,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:m,"onUpdate:modelValue":p=>o.value[m]=p,class:e.normalizeClass([t.eventHandling==="check"?"checked_mfa":t.eventHandling==="err"?"err_mfa":"reset_input","inline-block w-10 h-10 rounded-md text-center"]),type:"text",maxlength:"1",onInput:p=>i(m),onKeydown:e.withKeys(p=>l(m,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,Bd)),[[e.vModelText,o.value[m]]])),128))])])]))}},Vd={class:"text-center flex gap-3"},Md={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},Nd={key:0,class:"items-center justify-center inline-flex"},Ad=["src"],Td={__name:"mfaQrCode",props:{base64:{type:String,default:""},dimensions:{type:Array,default:null},loading:{type:Boolean,default:!1},generated:{type:Boolean,default:!1}},emits:["generateQR"],setup(t,{emit:n}){const a=n;e.ref(!1);const o=t,r=()=>{a("generateQR")},i=e.computed(()=>o.base64?o.base64:l.value),s=e.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),l=e.ref("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAARGUlEQVR42u3dsZLbxhKFYejGpAOp9Jb7ACo9gMqx9JYbKOA6pwNfuly2yJ5lz5nuA/xfFSILwGAwanuxxz0frtfrdQMAA/+rHgAAjKJgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2GhTsD59+rR9+PBht0fkx48f2/l8/s955/N5+/HjR/XruTu+6Bgdv/r51dc/+vpd5cP1er1WD2Lb/nrhP3/+rB6GTDTN5/N5++OPP375z06n0/b29lY6/kfji4yMX/386usfff2uQsFaJJrm6N9i1a8p+2/Z6udXX//o63eVNj8SAkCEggXABgULgA0KFkIzPvhH1zidTk/9s07PCD0KFh56e3vbvnz5kr7O169fHxaFb9++/bIwnU6n7ffff5c/ZzQ+NHFt4uPHj9dt2+4er6+v1UNMjT/y6NwZr+n79+/X0+kU3mf1cTqdrt+/f396/KPnq8d39PW7ik2s4fX1dfv8+XP1MJ8efzTN6l+7Z3JUaityWplYxsj1j75+V+FHwoPoWqxGx/boz6ifrfPcHQ0FC4ANChYAGxQsADYoWCayv3JfkWVSjq06p4UeKFgmsjmhezmnaqM5q+qcFpqozlXcZHMsmyAjtL0jh6LOYd07RnNC91wul+vLy0t4n5eXl+vlcpl+/irV73/v63eV3eSw1E3GomlS57AeyfZzent723777beHf+ZyuWzn81ly/grq9jhHX7+r8CPhDmRzQiOF5NGfyZ4PjKJgAbBBwQJgg4IFwAYFayeqW6N0z0l1GAPyKFg7Ud3PqXtOqmsODe9Unau4OXqORTXuWf2i1FT9uqLnH82RZd//3tfvKuSwBkXTVJnDiszoF6VeJsp+XdHzj+TIsu9/7+t3FX4kPACHfk7KMUbXJiPmg4IFwAYFC4ANChYAGxSsJo7+K/fq5++eI8NfKFhNHD0nVP383XNk+L/qXMUNOZZfG80JZcefPb/KrBxVFut3Df4Lq7nz+bx9+/atehhtMT/HQsEyQE7oMebnOChYAGxQsADYoGABsEHBMrCibYx7Dsl9/BhDwWru7e1t+/Lli/w+7jkk9/FjUHWu4iabY6mWzbGo+kGN3r+7e/OT3Zdx1vWPvn5X2U0/rGrZfkLKflAj9+/u0fxk92Wccf2jr99V+JGwCYeeVZUezc+MuVNfH3NQsADYoGABsEHBAmCDggUL5KywbRQsmCBnhW3b+gQsohyI+xGJzn95ebleLpf/nDerH1Q2h+R+fnb+jr5+V7HJYbmLpjnal+5yudxtozJjX71sDsn9/Oy+jEdfv6tQsBbJFizO733+0dfvKnzDAmCDggXABgULgA0KVhPqnFH00Tl7/8z5M/p9VY4f61CwmlDnjL5+/fqwMGTv/+z5s/p9VY0fi1XnKjDH9mS+pjonNXpkqftpYY02sQbkRL+Wf6Q6JzUiu0zV/bSwBgVrJzIFa9vqc07Z8UWy40cPfMMCYIOCBcAGBQuADQoWynNSanxQ3w8K1sFV56TUVu3riEWqcxU3z+Z01PvSZY9VOZ9oHPf6ac16/mep+3mpxz+qOsfWff2OahNryOR01PvSZa3I+WT6ac14/swyUvfzUo9/RHWOLaNTTq1Nweqe08lST/PRc1LV4+/+fFlNygTfsAD4oGABsEHBAmBjFwUr++ty9QfFFb/OV/aDGpGdw+rxqzk/X6e5tS9Y2X5F6pzOqn5Kqn5Qo6J+W93Hr+b6fO36gVXnKm624hxR9ojGF+nar2k0J3XvcBl/xP39ZNdnFzaxBnWOKCsaX6Rzv6aRnNQjDuOP/hq4v5/s+uzCpmBFw3TPqXTv19Q955Qdf3Z9uT+fC/tvWACOg4IFwAYFC4ANCtYk1TkktcwYqsffYd/D7s/ngoI1SXUOSe3ZHFD1+Lvse9j9+WxU5yputmROJjq/66Huh1SdE1o1/up+WNU5wOzzdc2Z/RuxhgbU/ZCqc0Irxl/dD6s6B5h9vs45s3+iYDWhfr7q11y9b2L2+urnU8vOX/X6ueEbFgAbFCwANihYAGy0KVjO/YK66zA36hxX535e1bLz1+nZ2hQs135B3VXnhG7UOa6u/byqZeevy/r5W3WuYtSzOZFsP6fR416/oVn9mJ69v3p+Z53f9f1X55CO1u8q0ibWEMnkRLL9nEY86jc0ox9Ttl9YRLlvnnrfSPX7r84hHanfVcSmYHXPaWXvrz4/cvTxRar/mrjkpNTafMMCgAgFC4ANChYAGxYFq8v/eHnPipyLOieTuf6K91M5vo5xhdnP6KJ9were72dVzkWdk3n2+qveT9X42uWQ7sjmyGxU5ypu1P2Mnr3uNphz2WuOadX7UT3fXt5vdv3eO6pzZu/VJtag7meU/bV2Zl9E9xxTdP4I9TLLjq/7+1XGcqpzZu/RpmC590six/SYepnt/f1W5wi7aP8NCwBuKFgAbFCwANhoU7Dc+yWpc1LV+x5235ewcv2seL/KOXTImd20KVju/ZLUOanqfQ+770tYtX5WvV9Vvy2XnNnfqnMVs7j3S3r2/rPG1z0H5k71/o7WL6tNrCHLvV9Sdc6mew7MXeb9zli/e+mXtZuCVZ1zyU5jdc6mew7MXfecmIs237AAIELBAmCDggXAxmEKVvTRMqN6T7zs+Ebunxnj3j+oj1CuEfX76+QwBetezqW6X5K6n9SsflHP5sC69zNbRZUDVL+/dqpzFbNsohzTNphjyfZjyt4/oh5f9sh69vmqc2ar9s1UP/8qh4k1ZGX6Ja24f0Q9vqzsMsw8X3XObMW+mernX4WCNSiapur7R9Tjc38+9f2r14/6+Vc5zDcsAP4oWABsULAA2NhNwaruF9S5p1D3D6odcmzO/caOZDcFq7pfkOr+Wd1zUF1ybK79xg6nOldxo+qX1L1f0Oj4np2/0ePe83eZv6ocmVtO6d9mra8u2sQalP2SuvcLGhlf9JqU+/J1mL/KHJlTTulXZqyvLtoUrKP3Y6rO8WSvr54/cko51e9vlt18wwKwfxQsADYoWABstClY6n3f1NfPmPFBV7kvX/UH5+r7V6+PrOr5m6lNwVLv+6a+/rNm5YhU+/JV57iq71+9PrKq52+66lzFqOp+R6rxjR7dx199/+zxbL8zdT+tVYeLNrGGSHW/I+X4RqhfU3b82fFV9+vK9DtT99NawaQM9MlhhQMt7nekHp/7+LPj656zqs4JVj9/F22+YQFAhIIFwAYFC4ANi4LVod9RpLofV/U9qvd2VN9bmePbU05KrX3B6tLvKFLdj6t6/Kp+UmrZflVd+nkdRnWu4qY6h3Lv6NKPqyqHlt03z6WfVPecVbZfWXS4aBNrqM6hPNKhH1dlDi27b55DP6nuOatsv7JIkzIQalOwqnMokew0de93lR2/+v5q3XNW3dfHKu2/YQHADQULgA0KFgAbbQpW955D2Y/W2T9TPT/KflsdVPZjG/FofTjkFGdpU7C678v2bM5oNGcTXb96flT9trqo6sc26t76cMkpTlOdq8jK5pxm5VhUR5QD2su+c9kclDpHpbq/+/pbrU2sISObc5qRY1GKckB72Hcum4NS56iU43dffyvtomBtW33OSS07/u6vWf3+1M9/9PW3SptvWAAQoWABsEHBAmBjNwUrm6PpHKk4AuX7q+4n5r7+Oo1tNwUrm6Opzjkdner9VfcTc19/7XJ01bmKVdQ5mep+Rdnz3XNQz44ve3R5vntm9WPrYjexhog6J1Pdryj7a3X3HFRE2W+tw/M9MqMfWxeHKVjVOZ/qfkjdz1dz3zdS/fzdx3+zm29YAPaPggXABgULgI3DFCx1TkfZrygan7rf1oz77133OajOqc1ymIKlzumo+hVF41P325p1/73r3k+qOqc2TXWu4qZq371R7x3Xew/VvoSz5i97/+r3r35/qqN7zmu1NrGGyn33Rqh/La7clzCSzVmNiJaZ+v13b9+Sfb6jaFOwuu+rVp3jcb+/+/WrNflrWu4w37AA+KNgAbBBwQJgo03B6r7vnfIe1f2S1PdXv58j5MT28AwztClY3fe9U/Urqu6XpL6/+v0cJSfWPee1THWuAn+p7idVff8tyCNV5dRG7/8s9b6Ee8txtYk1HF11P6nq+0exg8qc2sj9M9T7Eu4px0XBaqK6X5H7/atzaurn7z7+Vdp8wwKACAULgA0KFgAbFKwmKvsVzeinpb4/sG0UrDaq+hXN6qelvj+wbVufHNbHjx/Lew8pjyzVvoEuR6T6/tn34z7+VdrEGj59+rT9/Pmzehgy2WlW7hvoIJq/6lhA9v24j38VCtYi2WnunlNSq36+7P33Pv5V+IYFwAYFC4ANChYAGxQsA10+eFap7heWHWP12LZNuy/lShSs5o6eU6ruFzaq+75/qn0pl6vOVdxEOazX19fqIabGH1Hv+xedf6/f02i/JlW/qKxZ/abU1O/n3tEtZxWxiTW8vr5unz9/rh7m0+OPplm971+m39RIvyZlv6isGf2m1H9N1O/nkU45qwg/EjZRHeqMmuNlzq/WeWwzniH7fNVr7z0oWABsULAA2KBgAbBBwdqBbE7pCPv6ZSMP1f3AMjmqSKecVYSCZS6bUzrKvn7ZnFZ1P7Bnc1SRdjmrSHWu4iabw9qSOZvoyI4/Et1fnXNS58BU98/miNT7AqqPWTkq+mG9UzaHVd2eI5vDyu7Ll6XOgSnvn80RqfcFVJuRo3Lph8WPhCbUWaLqLE7m/tmxu+e0Zry7R9eoXhv/RMECYIOCBcAGBQuADQpWE9X9iDrnlNRjn3WNStn5r15/oyhYTVT3I+qaU4rMmp/qflpZ2fmvXn/DqnMVN0fPYUWqcjKr+i1F18nm0J6dv2w/sFXnq99PF+SwBkXTlM1hRSpzMiv6LalzaJn5y/YDW3F+RqecVYSCNai6YFXvG5ed32h86udT7xtYfX5WkzIQ4hsWABsULAA2KFgAbFCwMETdb0mdA8pev/P5M7h8dKdgYYi635I6B5S9ftfzZ6nK0b1bda7ihhzWY9nxVVPnyKr7OWXvr86JPXt0y2kRaxgUTdPeYw1Z6hxZdT+n7P3VObGMTjktfiTEEup+S9X9nLL3z5y/915p/0TBAmCDggXABgULgA0KloEuHzwzuues1KKP5urzMzrM3w0Fq7m97wvYJWeldi/nlN2XUL0+uszf36pzFTfZHFa1bA6r676A6hzRqvGpr//se1t1qPe1XGU3Oaxq2RxW530B1TmiFeNTX1+dA8xS72u5Cj8SNlGddanMEa0YX/X1q+2hWG0bBQuAEQoWABsULAA2KFg7UJ1jUueAOly/MgeV1SlHlUXBMledY1LngLpcvyoHldUuR5VVnau4iXJM7kckOj/K0Tyb48rmrGY9f/frZw/VvoWjqvuFzWKTw3IXTXN2X75Mjiubs5rx/N2vn6Xct3BEdb+wWShYi2QLVvZ89fj2fv0s9fuPuDeAvOEbFgAbFCwANihYAGxQsJqo3LeO62vtYV/GLihYTVTtW8f1tfayL2MXbX5LCAAR/gsLgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgI0/AXRl5K/bYs25AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTAyLTExVDIwOjQzOjIzKzAwOjAwj4NP3QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wMi0xMVQyMDo0MzoyMyswMDowMP7e92EAAAAASUVORK5CYII=");return(d,u)=>(e.openBlock(),e.createElementBlock("div",Vd,[e.createElementVNode("section",Md,[t.generated?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.value,"btnQrCode"])},[t.loading?(e.openBlock(),e.createElementBlock("div",Nd,[...u[0]||(u[0]=[e.createElementVNode("div",{class:"loaderMFA"},null,-1)])])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"uppercase bg-base-300 p-2 z-40",onClick:r}," Gerar QR "))],2)),e.createElementVNode("img",{class:e.normalizeClass([[s.value,t.generated?"rounded-md":"rounded-none"],""]),src:i.value,alt:"QRCode"},null,10,Ad)])]))}};for(var We=[],Ma=0;Ma<256;++Ma)We.push((Ma+256).toString(16).slice(1));function Dd(t,n=0){return(We[t[n+0]]+We[t[n+1]]+We[t[n+2]]+We[t[n+3]]+"-"+We[t[n+4]]+We[t[n+5]]+"-"+We[t[n+6]]+We[t[n+7]]+"-"+We[t[n+8]]+We[t[n+9]]+"-"+We[t[n+10]]+We[t[n+11]]+We[t[n+12]]+We[t[n+13]]+We[t[n+14]]+We[t[n+15]]).toLowerCase()}var Hn,Fd=new Uint8Array(16);function Ld(){if(!Hn&&(Hn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hn(Fd)}var $d=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const br={randomUUID:$d};function Pd(t,n,a){if(br.randomUUID&&!t)return br.randomUUID();t=t||{};var o=t.random||(t.rng||Ld)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Dd(o)}function wr(){const t=Yt(),n=async l=>{const d=t.attendants.find(u=>u.id===l);if(d)try{const u=await at.get(`${Ea}?attendant=${l}&page=1`);d.messages=u.data.results.reverse(),d.hasNextPage=u.data.next!==null,d.currentPage=2,d.internal_chat={channel_id:u.data.channel_id,unread:0}}catch(u){console.error("Erro ao buscar mensagens:",u)}},a=async l=>{const d=t.attendants.find(u=>u.id===l);if(!(!d||!d.hasNextPage))try{const u=await at.get(`${Ea}?attendant=${l}&page=${d.currentPage}`);d.messages=[...u.data.results.reverse(),...d.messages],d.hasNextPage=u.data.next!==null,d.currentPage++}catch(u){console.error("Erro ao carregar mais mensagens:",u)}},o=(l,d,u)=>{const c=l==null?void 0:l.message;if(!c)return;const h=t.attendants.find(m=>{var p;return((p=m.internal_chat)==null?void 0:p.channel_id)===c.channel_id});h?(h.messages=h.messages||[],h.messages.find(p=>p.id===c.id)||(h.messages.push(c),(!d||h.id!==u)&&(h.internal_chat.unread=(h.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const d=t.attendants.find(u=>u.id===l);d&&(d.internal_chat.unread=0)},i=async(l,d,u,c=!1)=>{var f;const h=t.attendants.find(g=>g.id===l);if(!h||!((f=h.internal_chat)!=null&&f.channel_id))return;let m;c?m=d:m={type:"text",content:d};const p={id:Pd(),content:m,created_at:new Date().toISOString(),sender:u};h.messages.push(p);try{await at.post(`${Ea}${h.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const d=t.attendants.find(u=>u.id===l);return d?d.hasNextPage:!1};return{attendants:e.computed(()=>t.attendants),count:e.computed(()=>t.count),fetchMessagesForAtendente:n,loadMessagesForAtendente:a,addMessageToAtendente:o,sendMessageToAtendente:i,hasNextPageForAtendente:s,resetUnreadMessages:r}}const Od={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},_d={key:0,style:{"padding-top":"0.5rem"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Rd=["src"],Na=Ce({__name:"Avatar",props:{url:{type:String}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",Od,[t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,Rd)):(e.openBlock(),e.createElementBlock("svg",_d,[...a[0]||(a[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"},null,-1)])]))]))}},[["__scopeId","data-v-7d8b2820"]]),Hd={class:"attendants-container"},zd={class:"atendentes-list bg-base-300"},jd={key:0,class:"empty-message bg-base-200"},Gd=["onClick"],Id={class:"atendente-main"},qd={class:"atendente-name"},Wd={class:"flex items-center gap-4"},Ud={key:0,class:"message-indicator"},Zd={key:0,class:"chat-footer bg-base-200"},Er=Ce({__name:"ChatList",props:{atendentes:{type:Array,required:!0},attendant:{required:!0},mobile:{type:Boolean,default:!1}},emits:["atendenteSelecionado"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=d=>{o("atendenteSelecionado",d)},s=d=>{switch(d){case"Busy":return"bg-red-500";case"Online":return"bg-green-500";case"Away":return"bg-yellow-500";case"Offline":return"bg-gray-500";default:return"bg-purple-500"}},l=e.computed(()=>r.value?a.atendentes.filter(d=>d.name.toLowerCase().includes(r.value.toLowerCase())&&d.id!==a.attendant.id):a.atendentes.filter(d=>d.id!==a.attendant.id));return(d,u)=>(e.openBlock(),e.createElementBlock("div",Hd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=c=>r.value=c),class:e.normalizeClass(t.mobile?"search-input-mobile bg-base-300 border-b border-base-200":"search-input bg-base-300 border-b border-base-200"),placeholder:"Pesquise entre os atendentes..."},null,2),[[e.vModelText,r.value]]),e.createElementVNode("ul",zd,[l.value.length===0?(e.openBlock(),e.createElementBlock("li",jd,e.toDisplayString(t.atendentes.length===0?"Não há atendentes disponíveis":"Não há atendentes com esse nome"),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>(e.openBlock(),e.createElementBlock("li",{key:c.id,onClick:h=>i(c),class:e.normalizeClass([["atendente-item",c.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[e.createElementVNode("main",Id,[e.createVNode(Na,{url:c.photo},null,8,["url"]),e.createElementVNode("span",qd,e.toDisplayString(c.name),1)]),e.createElementVNode("footer",Wd,[c.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",Ud,e.toDisplayString(c.internal_chat.unread),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["status-indicator",s(c.login_status)])},null,2)]),u[1]||(u[1]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,Gd))),128))]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",Zd))]))}},[["__scopeId","data-v-dc8950e9"]]);function Yd(t,n=null){if(!t)return!1;const a=t.getBoundingClientRect(),o=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};return a.bottom>=o.top&&a.top<=o.bottom&&a.right>=o.left&&a.left<=o.right}async function Xd(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function Kd(t){let n=`0px 0px ${t.distance}px 0px`;t.top&&(n=`${t.distance}px 0px 0px 0px`);const a=new IntersectionObserver(o=>{o[0].isIntersecting&&(t.firstload&&t.emit(),t.firstload=!0)},{root:t.parentEl,rootMargin:n});return t.infiniteLoading.value&&a.observe(t.infiniteLoading.value),a}async function vr(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const Cr=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Qd={},Jd=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),e3={class:"container"},t3=Jd(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),n3=[t3];function a3(t,n){return e.openBlock(),e.createElementBlock("div",e3,n3)}const o3=Cr(Qd,[["render",a3],["__scopeId","data-v-d3e37633"]]),r3={class:"state-error"},Xt=Cr(e.defineComponent({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(t,{emit:n}){const a=t;let o=null,r=0;const i=e.ref(null),s=e.ref(""),{top:l,firstload:d,distance:u}=a,{identifier:c,target:h}=e.toRefs(a),m={infiniteLoading:i,top:l,firstload:d,distance:u,parentEl:null,emit(){r=(m.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await vr(m,r),Yd(i.value,m.parentEl)&&m.emit()},async complete(){s.value="complete",await vr(m,r),o==null||o.disconnect()},error(){s.value="error"}};function f(){o==null||o.disconnect(),o=Kd(m)}return e.watch(c,f),e.onMounted(async()=>{m.parentEl=await Xd(h),f()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"infiniteLoading",ref:i,class:"v3-infinite-loading"},[e.withDirectives(e.createElementVNode("div",null,[e.renderSlot(g.$slots,"spinner",{},()=>[e.createVNode(o3)],!0)],512),[[e.vShow,s.value=="loading"]]),s.value=="complete"?e.renderSlot(g.$slots,"complete",{key:0},()=>{var k;return[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.complete)||"No more results!"),1)]},!0):e.createCommentVNode("",!0),s.value=="error"?e.renderSlot(g.$slots,"error",{key:1,retry:m.emit},()=>{var k;return[e.createElementVNode("span",r3,[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.error)||"Oops something went wrong!"),1),e.createElementVNode("button",{class:"retry",onClick:y[0]||(y[0]=(...w)=>m.emit&&m.emit(...w))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function i3(t,n,a){const o=ct(t,a==null?void 0:a.in);return isNaN(n)?rt(t,NaN):(o.setDate(o.getDate()+n),o)}function zn(t,n){return Pt(t,{...n,weekStartsOn:1})}function Sr(t,n){const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=rt(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=zn(r),s=rt(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=zn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function Br(t){const n=ct(t),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+t-+a}function jn(t,n){const a=ct(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function s3(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n),i=jn(o),s=jn(r),l=+i-Br(i),d=+s-Br(s);return Math.round((l-d)/Sl)}function l3(t,n){const a=Sr(t,n),o=rt(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),zn(o)}function Aa(t){return rt(t,Date.now())}function Vr(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+jn(o)==+jn(r)}function c3(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function d3(t){return!(!c3(t)&&typeof t!="number"||isNaN(+ct(t)))}function u3(t,n){const a=ct(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function f3(t,n){const a=ct(t,n==null?void 0:n.in);return s3(a,u3(a))+1}function m3(t,n){const a=ct(t,n==null?void 0:n.in),o=+zn(a)-+l3(a);return Math.round(o/lr)+1}function Mr(t,n){var c,h,m,p;const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=On(),i=(n==null?void 0:n.firstWeekContainsDate)??((h=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=rt((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Pt(s,n),d=rt((n==null?void 0:n.in)||t,0);d.setFullYear(o,0,i),d.setHours(0,0,0,0);const u=Pt(d,n);return+a>=+l?o+1:+a>=+u?o:o-1}function h3(t,n){var l,d,u,c;const a=On(),o=(n==null?void 0:n.firstWeekContainsDate)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,r=Mr(t,n),i=rt((n==null?void 0:n.in)||t,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Pt(i,n)}function p3(t,n){const a=ct(t,n==null?void 0:n.in),o=+Pt(a,n)-+h3(a,n);return Math.round(o/lr)+1}function De(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const Bt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return De(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):De(a+1,2)},d(t,n){return De(t.getDate(),n.length)},a(t,n){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h(t,n){return De(t.getHours()%12||12,n.length)},H(t,n){return De(t.getHours(),n.length)},m(t,n){return De(t.getMinutes(),n.length)},s(t,n){return De(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return De(r,n.length)}},Kt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Nr={G:function(t,n,a){const o=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},y:function(t,n,a){if(n==="yo"){const o=t.getFullYear(),r=o>0?o:1-o;return a.ordinalNumber(r,{unit:"year"})}return Bt.y(t,n)},Y:function(t,n,a,o){const r=Mr(t,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return De(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):De(i,n.length)},R:function(t,n){const a=Sr(t);return De(a,n.length)},u:function(t,n){const a=t.getFullYear();return De(a,n.length)},Q:function(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return De(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return De(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,a){const o=t.getMonth();switch(n){case"M":case"MM":return Bt.M(t,n);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,a){const o=t.getMonth();switch(n){case"L":return String(o+1);case"LL":return De(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,a,o){const r=p3(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):De(r,n.length)},I:function(t,n,a){const o=m3(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):De(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):Bt.d(t,n)},D:function(t,n,a){const o=f3(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):De(o,n.length)},E:function(t,n,a){const o=t.getDay();switch(n){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,a,o){const r=t.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return De(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(r,{width:"short",context:"formatting"});case"eeee":default:return a.day(r,{width:"wide",context:"formatting"})}},c:function(t,n,a,o){const r=t.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return De(i,n.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(r,{width:"narrow",context:"standalone"});case"cccccc":return a.day(r,{width:"short",context:"standalone"});case"cccc":default:return a.day(r,{width:"wide",context:"standalone"})}},i:function(t,n,a){const o=t.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return De(r,n.length);case"io":return a.ordinalNumber(r,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,a){const r=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,a){const o=t.getHours();let r;switch(o===12?r=Kt.noon:o===0?r=Kt.midnight:r=o/12>=1?"pm":"am",n){case"b":case"bb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,a){const o=t.getHours();let r;switch(o>=17?r=Kt.evening:o>=12?r=Kt.afternoon:o>=4?r=Kt.morning:r=Kt.night,n){case"B":case"BB":case"BBB":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,a){if(n==="ho"){let o=t.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return Bt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):Bt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):Bt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):Bt.s(t,n)},S:function(t,n){return Bt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Tr(o);case"XXXX":case"XX":return Ot(o);case"XXXXX":case"XXX":default:return Ot(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return Tr(o);case"xxxx":case"xx":return Ot(o);case"xxxxx":case"xxx":default:return Ot(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Ar(o,":");case"OOOO":default:return"GMT"+Ot(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Ar(o,":");case"zzzz":default:return"GMT"+Ot(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return De(o,n.length)},T:function(t,n,a){return De(+t,n.length)}};function Ar(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),i=o%60;return i===0?a+String(r):a+String(r)+n+De(i,2)}function Tr(t,n){return t%60===0?(t>0?"-":"+")+De(Math.abs(t)/60,2):Ot(t,n)}function Ot(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=De(Math.trunc(o/60),2),i=De(o%60,2);return a+r+n+i}const Dr=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Fr=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},g3={p:Fr,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return Dr(t,n);let i;switch(o){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",Dr(o,n)).replace("{{time}}",Fr(r,n))}},y3=/^D+$/,k3=/^Y+$/,x3=["D","DD","YY","YYYY"];function b3(t){return y3.test(t)}function w3(t){return k3.test(t)}function E3(t,n,a){const o=v3(t,n,a);if(console.warn(o),x3.includes(t))throw new RangeError(o)}function v3(t,n,a){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const C3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,S3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B3=/^'([^]*?)'?$/,V3=/''/g,M3=/[a-zA-Z]/;function Lr(t,n,a){var c,h,m,p,f,g,y,k;const o=On(),r=(a==null?void 0:a.locale)??o.locale??n2,i=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(m=o.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(f=a==null?void 0:a.locale)==null?void 0:f.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=ct(t,a==null?void 0:a.in);if(!d3(l))throw new RangeError("Invalid time value");let d=n.match(S3).map(w=>{const E=w[0];if(E==="p"||E==="P"){const v=g3[E];return v(w,r.formatLong)}return w}).join("").match(C3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const E=w[0];if(E==="'")return{isToken:!1,value:N3(w)};if(Nr[E])return{isToken:!0,value:w};if(E.match(M3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:w}});r.localize.preprocessor&&(d=r.localize.preprocessor(l,d));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return d.map(w=>{if(!w.isToken)return w.value;const E=w.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&w3(E)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&b3(E))&&E3(E,n,String(t));const v=Nr[E[0]];return v(l,E,r.localize,u)}).join("")}function N3(t){const n=t.match(B3);return n?n[1].replace(V3,"'"):t}function A3(t,n){return Vl(rt(t,t),Aa(t),n)}function T3(t,n){return Vr(rt(t,t),Aa(t))}function D3(t,n,a){return i3(t,-1,a)}function F3(t,n){return Vr(rt(t,t),D3(Aa(t)))}/*! License details at fancyapps.com/license */const Te=t=>typeof t=="string";/*! License details at fancyapps.com/license */const Qt=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const L3=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const n=t.scrollHeight>t.clientHeight,a=window.getComputedStyle(t).overflowY,o=a.indexOf("hidden")!==-1,r=a.indexOf("visible")!==-1;return n&&!o&&!r},_t=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:L3(t)?t:_t(t.parentElement,n)};/*! License details at fancyapps.com/license */const wt=function(t){var n=new DOMParser().parseFromString(t,"text/html").body;if(n.childElementCount>1){for(var a=document.createElement("div");n.firstChild;)a.appendChild(n.firstChild);return a}let o=n.firstChild;return!o||o instanceof HTMLElement?o:((a=document.createElement("div")).appendChild(o),a)};/*! License details at fancyapps.com/license */const Be=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Ze=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function $r(t){return Ze(t)||Array.isArray(t)}function hn(t,n){const a=Object.keys(t),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const i=t[r],s=n[r];return typeof i=="function"?`${i}`==`${s}`:$r(i)&&$r(s)?hn(i,s):i===s})}/*! License details at fancyapps.com/license */const Pr=function(t){for(const n of Gn)n.getState()===Xe.Running&&n.tick(Ta?t-Ta:0);Ta=t,en=window.requestAnimationFrame(Pr)};var Xe,Vt,Jt;(function(t){t[t.Initializing=0]="Initializing",t[t.Running=1]="Running",t[t.Paused=2]="Paused",t[t.Completed=3]="Completed",t[t.Destroyed=4]="Destroyed"})(Xe||(Xe={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(Vt||(Vt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(Jt||(Jt={}));const Gn=new Set;let en=null,Ta=0;function Mt(){let t=Xe.Initializing,n=Vt.Ease,a=0,o=0,r=Mt.Easings.Linear,i=500,s=0,l=0,d=0,u=0,c=1/0,h=.01,m=.01,p=!1,f={},g=null,y={},k={},w={},E=0,v=0,M=Jt.Loop,A=Mt.Easings.Linear;const R=new Map;function S(B,...C){for(const O of R.get(B)||[])O(...C)}function x(B){return o=0,B?g=setTimeout(()=>{N()},B):N(),F}function N(){t=Xe.Running,S("start",y,k)}function L(){if(t=Xe.Completed,w={},S("end",y),t===Xe.Completed)if(a<E){if(a++,M===Jt.Reverse){const B=Object.assign({},f);f=Object.assign({},k),k=B}x(v)}else a=0;return F}const F={getState:function(){return t},easing:function(B){return r=B,n=Vt.Ease,w={},F},duration:function(B){return i=B,F},spring:function(B={}){n=Vt.Spring;const C={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:O,mass:Z,tension:Q,friction:ee,restDelta:P,restSpeed:H,maxSpeed:_,clamp:oe}=Object.assign(Object.assign({},C),B);return s=O,l=Z,d=Q,u=ee,m=P,h=H,c=_,p=oe,w={},F},isRunning:function(){return t===Xe.Running},isSpring:function(){return n===Vt.Spring},from:function(B){return y=Object.assign({},B),F},to:function(B){return k=B,F},repeat:function(B,C=0,O=Jt.Loop,Z){return E=B,v=C,M=O,A=Z||r,F},on:function(B,C){var O,Z;return O=B,Z=C,R.set(O,[...R.get(O)||[],Z]),F},off:function(B,C){var O,Z;return O=B,Z=C,R.has(O)&&R.set(O,R.get(O).filter(Q=>Q!==Z)),F},start:function(B){return hn(y,k)||(t=Xe.Initializing,f=Object.assign({},y),Gn.add(this),en||(en=window.requestAnimationFrame(Pr)),x(B)),F},pause:function(){return g&&(clearTimeout(g),g=null),t===Xe.Running&&(t=Xe.Paused,S("pause",y)),F},end:L,tick:function(B){B>50&&(B=50),o+=B;let C=0,O=!1;if(t!==Xe.Running)return F;if(n===Vt.Ease){C=Be(0,o/i,1),O=C===1;const Q=M===Jt.Reverse?A:r;for(const ee in y)y[ee]=f[ee]+(k[ee]-f[ee])*Q(C)}if(n===Vt.Spring){const Q=.001*B;let ee=0;for(const P in y){const H=k[P];let _=y[P];if(typeof H!="number"||isNaN(H)||typeof _!="number"||isNaN(_))continue;if(Math.abs(H-_)<=m){y[P]=H,w[P]=0;continue}w[P]||(typeof s=="object"&&typeof s[P]=="number"?w[P]=s[P]:w[P]=typeof s=="number"?s:0);let oe=w[P];oe=Be(-1*Math.abs(c),oe,Math.abs(c));const de=oe*l*u;oe+=((_>H?-1:1)*(Math.abs(H-_)*d)-de)/l*Q,_+=oe*Q;const pe=y[P]>H?_<H:_>H;let ye=Math.abs(oe)<h&&Math.abs(H-_)<=m;p&&pe&&(ye=!0),ye?(_=H,oe=0):ee++,y[P]=_,w[P]=oe}O=!ee}const Z=Object.assign({},k);return S("step",y,f,k,C),O&&t===Xe.Running&&hn(k,Z)&&(t=Xe.Completed,L()),F},getStartValues:function(){return f},getCurrentValues:function(){return y},getCurrentVelocities:function(){return w},getEndValues:function(){return k},destroy:function(){t=Xe.Destroyed,g&&(clearTimeout(g),g=null),f=y=k={},Gn.delete(this)}};return F}Mt.destroy=()=>{for(const t of Gn)t.destroy();en&&(cancelAnimationFrame(en),en=null)},Mt.Easings={Linear:function(t){return t},EaseIn:function(t){return t===0?0:Math.pow(2,10*t-10)},EaseOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},EaseInOut:function(t){return t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}};/*! License details at fancyapps.com/license */function pn(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function Da(t,n){const a=[],o=pn(t)?t[n]:t instanceof MouseEvent&&(n==="changedTouches"||t.type!=="mouseup")?[t]:[];for(const r of o)a.push({x:r.clientX,y:r.clientY,ts:Date.now()});return a}function Or(t){return Da(t,"touches")}function _r(t){return Da(t,"targetTouches")}function Rr(t){return Da(t,"changedTouches")}function Nt(t){const n=t[0],a=t[1]||n;return{x:(n.x+a.x)/2,y:(n.y+a.y)/2,ts:a.ts}}function In(t){const n=t[0],a=t[1]||t[0];return n&&a?-1*Math.sqrt((a.x-n.x)*(a.x-n.x)+(a.y-n.y)*(a.y-n.y)):0}const Hr=t=>{t.cancelable&&t.preventDefault()},At={passive:!1},$3={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let qn=!1,gn=!0;const tn=(t,n)=>{let a,o,r,i=Object.assign(Object.assign({},$3),n),s=[],l=[],d=[],u=!1,c=!1,h=!1,m=!1,p=0,f=0,g=0,y=0,k=0,w=0,E=0,v=0,M=0,A=[],R=0,S=0;const x=new Map;function N(P){const H=In(l),_=In(d),oe=H&&_?H/_:0,de=Math.abs(E)>Math.abs(v)?E:v,pe={srcEvent:a,isPanRecognized:u,isSwipeRecognized:c,firstTouch:s,previousTouch:d,currentTouch:l,deltaX:g,deltaY:y,offsetX:k,offsetY:w,velocityX:E,velocityY:v,velocity:de,angle:M,axis:r,scale:oe,center:o};for(const ye of x.get(P)||[])ye(pe)}function L(P){const H=Date.now();if(A=A.filter(_=>!_.ts||_.ts>H-100),P&&A.push(P),E=0,v=0,A.length>3){const _=A[0],oe=A[A.length-1];if(_&&oe){const de=oe.x-_.x,pe=oe.y-_.y,ye=_.ts&&oe.ts?oe.ts-_.ts:0;ye>0&&(E=Math.abs(de)>3?de/(ye/30):0,v=Math.abs(pe)>3?pe/(ye/30):0)}}}function F(P){if(typeof MouseEvent<"u"&&P instanceof MouseEvent){if(qn)return}else qn=!0;const H=P.composedPath()[0],_=i.ignore.join(",");if(H.matches(_)||H.closest(_))return;if(typeof MouseEvent<"u"&&P instanceof MouseEvent){if(!P.buttons||P.button!==0)return;Hr(P)}P instanceof MouseEvent&&(window.addEventListener("mousemove",B),window.addEventListener("mouseup",C)),window.addEventListener("blur",O),a=P,l=_r(P),s=[...l],d=[],f=l.length,o=Nt(l),f===1&&(u=!1,c=!1,h=!1),f&&L(Nt(l));const oe=Date.now(),de=oe-(p||oe);m=de>0&&de<=250&&f===1,p=oe,clearTimeout(R),N("start")}function B(P){var H;if(!s.length||P.defaultPrevented)return;a=P,d=[...l],l=Or(P);const _=Nt(d),oe=Nt(Or(P));if(L(oe),f=l.length,o=oe,d.length===l.length?(g=oe.x-_.x,y=oe.y-_.y):(g=0,y=0),s.length){const de=Nt(s);k=oe.x-de.x,w=oe.y-de.y}if(l.length>1){const de=In(l),pe=In(d);Math.abs(de-pe)>=.1&&(h=!0,N("pinch"))}u||(u=Math.abs(k)>i.panThreshold||Math.abs(w)>i.panThreshold,u&&(gn=!1,clearTimeout(S),S=0,M=Math.abs(180*Math.atan2(w,k)/Math.PI),r=M>45&&M<135?"y":"x",s=[...l],d=[...l],k=0,w=0,g=0,y=0,(H=window.getSelection())===null||H===void 0||H.removeAllRanges(),N("panstart"))),u&&(g||y)&&N("pan"),N("move")}function C(P){if(a=P,!s.length)return;const H=_r(P),_=Rr(P);if(f=H.length,o=Nt(_),_.length&&L(Nt(_)),d=[...l],l=[...H],s=[...H],f>0)N("end"),u=!1,c=!1,A=[];else{const oe=i.swipeThreshold;(Math.abs(E)>oe||Math.abs(v)>oe)&&(c=!0),u&&N("panend"),c&&N("swipe"),u||c||h||(N("tap"),m?N("doubleTap"):R=setTimeout(function(){N("singleTap")},250)),N("end"),Z()}}function O(){clearTimeout(R),Z(),u&&N("panend"),N("end")}function Z(){qn=!1,u=!1,c=!1,m=!1,f=0,A=[],l=[],d=[],s=[],g=0,y=0,k=0,w=0,E=0,v=0,M=0,r=void 0,window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",C),window.removeEventListener("blur",O),gn||S||(S=setTimeout(()=>{gn=!0,S=0},100))}function Q(P){const H=P.target;qn=!1,H&&!P.defaultPrevented&&(gn||(Hr(P),P.stopPropagation()))}const ee={init:function(){return t&&(t.addEventListener("click",Q,At),t.addEventListener("mousedown",F,At),t.addEventListener("touchstart",F,At),t.addEventListener("touchmove",B,At),t.addEventListener("touchend",C),t.addEventListener("touchcancel",C)),ee},on:function(P,H){return function(_,oe){x.set(_,[...x.get(_)||[],oe])}(P,H),ee},off:function(P,H){return x.has(P)&&x.set(P,x.get(P).filter(_=>_!==H)),ee},isPointerDown:()=>f>0,destroy:function(){clearTimeout(R),clearTimeout(S),S=0,t&&(t.removeEventListener("click",Q,At),t.removeEventListener("mousedown",F,At),t.removeEventListener("touchstart",F,At),t.removeEventListener("touchmove",B,At),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",C)),t=null,Z()}};return ee};tn.isClickAllowed=()=>gn;/*! License details at fancyapps.com/license */const Fa={IMAGE_ERROR:"This image couldn't be loaded. <br /> Please try again later.",MOVE_UP:"Move up",MOVE_DOWN:"Move down",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",TOGGLE_FULL:"Toggle zoom level",TOGGLE_1TO1:"Toggle zoom level",ITERATE_ZOOM:"Toggle zoom level",ROTATE_CCW:"Rotate counterclockwise",ROTATE_CW:"Rotate clockwise",FLIP_X:"Flip horizontally",FLIP_Y:"Flip vertically",RESET:"Reset",TOGGLE_FS:"Toggle fullscreen"};/*! License details at fancyapps.com/license */const we=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const Ke=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ye=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Rt=t=>{t.cancelable&&t.preventDefault()},Qe=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n),kt=t=>t instanceof HTMLImageElement;var ge,zr;(function(t){t.Reset="reset",t.Zoom="zoom",t.ZoomIn="zoomIn",t.ZoomOut="zoomOut",t.ZoomTo="zoomTo",t.ToggleCover="toggleCover",t.ToggleFull="toggleFull",t.ToggleMax="toggleMax",t.IterateZoom="iterateZoom",t.Pan="pan",t.Swipe="swipe",t.Move="move",t.MoveLeft="moveLeft",t.MoveRight="moveRight",t.MoveUp="moveUp",t.MoveDown="moveDown",t.RotateCCW="rotateCCW",t.RotateCW="rotateCW",t.FlipX="flipX",t.FlipY="flipY",t.ToggleFS="toggleFS"})(ge||(ge={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}(zr||(zr={}));const ft={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},La={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:ge.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:Fa,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:ge.Zoom,width:"auto"};let Wn,jr=0,Gr=0,Un=0;const $a=(t,n={},a={})=>{let o,r,i,s,l,d,u,c,h=0,m=Object.assign(Object.assign({},La),n),p={},f=Object.assign({},ft),g=Object.assign({},ft);const y=[];function k($){let I=m[$];return I&&typeof I=="function"?I(ce):I}function w(){return t&&t.parentElement&&o&&h===3}const E=new Map;function v($,...I){const te=[...E.get($)||[]];m.on&&te.push(m.on[$]);for(const Y of te)Y&&Y instanceof Function&&Y(ce,...I);$!=="*"&&v("*",$,...I)}function M($){if(!w())return;const I=$.target;if(_t(I))return;const te=Date.now(),Y=[-$.deltaX||0,-$.deltaY||0,-$.detail||0].reduce(function(se,fe){return Math.abs(fe)>Math.abs(se)?fe:se}),b=Be(-1,Y,1);v("wheel",$,b);const T=k("wheelAction");if(!T||$.defaultPrevented)return;const X=g.scale;let ne=X*(b>0?1.5:.5);if(T===ge.Zoom){const se=Math.abs($.deltaY)<100&&Math.abs($.deltaX)<100;if(te-Gr<(se?200:45))return void Rt($);Gr=te;const fe=Q(),me=_();if(Qe(ne)<Qe(fe)&&Qe(X)<=Qe(fe)?(Un+=Math.abs(b),ne=fe):Qe(ne)>Qe(me)&&Qe(X)>=Qe(me)?(Un+=Math.abs(b),ne=me):(Un=0,ne=Be(fe,ne,me)),Un>7)return}switch(Rt($),T){case ge.Pan:ye(T,{srcEvent:$,deltaX:2*-$.deltaX,deltaY:2*-$.deltaY});break;case ge.Zoom:ye(ge.ZoomTo,{srcEvent:$,scale:ne,center:{x:$.clientX,y:$.clientY}});break;default:ye(T,{srcEvent:$})}}function A($){var I,te;const Y=$.composedPath()[0];if(!tn.isClickAllowed()||!Qt(Y)||$.defaultPrevented||!(t!=null&&t.contains(Y))||Y.hasAttribute("disabled")||Y.hasAttribute("aria-disabled"))return;const b=Y.closest("[data-panzoom-action]"),T=(I=b==null?void 0:b.dataset)===null||I===void 0?void 0:I.panzoomAction,X=((te=b==null?void 0:b.dataset)===null||te===void 0?void 0:te.panzoomValue)||"";if(T){switch(Rt($),T){case ge.ZoomTo:case ge.ZoomIn:case ge.ZoomOut:ye(T,{scale:parseFloat(X||"")||void 0});break;case ge.MoveLeft:case ge.MoveRight:ye(T,{deltaX:parseFloat(X||"")||void 0});break;case ge.MoveUp:case ge.MoveDown:ye(T,{deltaY:parseFloat(X||"")||void 0});break;case ge.ToggleFS:ae();break;default:ye(T)}return}if(!(o!=null&&o.contains(Y)))return;const ne={srcEvent:$};if(ye(k("clickAction"),ne),k("dblClickAction")){const se=Date.now(),fe=se-(jr||se);jr=se,fe>0&&fe<=250?(Wn&&(clearTimeout(Wn),Wn=void 0),ye(k("dblClickAction"),ne)):Wn=setTimeout(()=>{ye(k("singleClickAction"),ne)},250)}}function R($){if(c=$,!w()||!C()||f.scale<=1||g.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const I=O(g.scale);if(!I)return;const{x:te,y:Y}=I;ye(ge.Pan,{deltaX:te-g.x,deltaY:Y-g.y})}function S(){var $;t&&(Ke(t,"is-loading"),($=t.querySelector(".f-spinner"))===null||$===void 0||$.remove())}function x(){if(!t||!r)return;if(S(),kt(r)&&(!r.complete||!r.naturalWidth))return h=2,o==null||o.classList.add("has-error"),void v("error");v("loaded");const{width:$,height:I}=F();kt(r)&&(r.setAttribute("width",$+""),r.setAttribute("height",I+"")),o&&(Ke(o,"has-error"),kt(r)&&(o.setAttribute("width",$+""),o.setAttribute("height",I+""),o.style.aspectRatio=`${$/I||""}`)),d=Mt().on("start",(Y,b)=>{b.angle!==void 0&&(b.angle=90*Math.round(b.angle/90)),b.flipX!==void 0&&(b.flipX=b.flipX>0?1:-1),b.flipY!==void 0&&(b.flipY=b.flipY>0?1:-1),g=Object.assign(Object.assign({},ft),b),pe(),v("animationStart")}).on("pause",Y=>{g=Object.assign(Object.assign({},ft),Y)}).on("step",Y=>{if(!w())return void(d==null||d.end());if(f=Object.assign(Object.assign({},ft),Y),C()||!k("bounds")||q()||g.scale>f.scale||g.scale<ee())return void Ve();const b=oe(g.scale);let T=!1,X=!1,ne=!1,se=!1;f.x<b.x[0]&&(T=!0),f.x>b.x[1]&&(X=!0),f.y<b.y[0]&&(se=!0),f.y>b.y[1]&&(ne=!0);let fe=!1,me=!1,be=!1,ve=!1;g.x<b.x[0]&&(fe=!0),g.x>b.x[1]&&(me=!0),g.y<b.y[0]&&(ve=!0),g.y>b.y[1]&&(be=!0);let Fe=!1;(X&&me||T&&fe)&&(g.x=Be(b.x[0],g.x,b.x[1]),Fe=!0),(ne&&be||se&&ve)&&(g.y=Be(b.y[0],g.y,b.y[1]),Fe=!0),Fe&&d&&d.spring({tension:94,friction:17,maxSpeed:555*g.scale,restDelta:.1,restSpeed:.1,velocity:d.getCurrentVelocities()}).from(f).to(g).start(),Ve()}).on("end",()=>{l!=null&&l.isPointerDown()||de(),d!=null&&d.isRunning()||(pe(),v("animationEnd"))}),function(){const Y=k("gestures");if(!Y||!s||!r)return;let b=!1;l=tn(s,Y).on("start",T=>{if(!k("gestures")||!d||!w()||C())return;const X=T.srcEvent;(f.scale>1||T.currentTouch.length>1)&&(X==null||X.stopPropagation(),d.pause(),b=!0),T.currentTouch.length===1&&v("touchStart")}).on("move",T=>{var X;b&&(g.scale!==1||T.currentTouch.length>1)&&(Rt(T.srcEvent),(X=T.srcEvent)===null||X===void 0||X.stopPropagation())}).on("pan",T=>{if(!b)return;const X=T.srcEvent;(g.scale!==1||T.currentTouch.length>1)&&(Rt(X),ye(ge.Pan,T))}).on("swipe",T=>{b&&g.scale>1&&ye(ge.Swipe,T)}).on("tap",T=>{v("click",T)}).on("singleTap",T=>{v("singleClick",T)}).on("doubleTap",T=>{v("dblClick",T)}).on("pinch",T=>{b&&(T.scale>ee()?ye(ge.ZoomIn,T):T.scale<ee()?ye(ge.ZoomOut,T):ye(ge.Pan,T))}).on("end",T=>{b&&(T.currentTouch.length?(T.srcEvent.stopPropagation(),Rt(T.srcEvent),d==null||d.end()):(b=!1,pe(),de(),v("touchEnd")))}).init()}(),s&&(s.addEventListener("wheel",M,{passive:!1}),y.push(()=>{s==null||s.removeEventListener("wheel",M,{passive:!1})})),t==null||t.addEventListener("click",A),document==null||document.addEventListener("mousemove",R),y.push(()=>{t==null||t.removeEventListener("click",A),document==null||document.removeEventListener("mousemove",R)});const te=N();f=Object.assign({},te),g=Object.assign({},te),h=3,Ve(),pe(),v("ready"),requestAnimationFrame(()=>{S(),s&&(s.style.visibility="")})}function N(){const $=Object.assign({},k("startPos")||{});let I=$.scale,te=1;te=typeof I=="string"?Z(I):typeof I=="number"?I:ee();const Y=Object.assign(Object.assign(Object.assign({},ft),$),{scale:te}),b=C()?O(te):void 0;if(b){const{x:T,y:X}=b;Y.x=T,Y.y=X}return Y}function L(){const $={top:0,left:0,width:0,height:0};if(o){const I=o.getBoundingClientRect();g.angle%180==90?($.top=I.top+.5*I.height-.5*I.width,$.left=I.left+.5*I.width-.5*I.height,$.width=I.height,$.height=I.width):($.top=I.top,$.left=I.left,$.width=I.width,$.height=I.height)}return $}function F(){let $=k("width"),I=k("height");if(r&&$==="auto"){const te=r.getAttribute("width");$=te?parseFloat(te+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):kt(s)?s.naturalWidth:kt(r)?r.naturalWidth:(o==null?void 0:o.getBoundingClientRect().width)||0}else $=Te($)?parseFloat($):$;if(r&&I==="auto"){const te=r.getAttribute("height");I=te?parseFloat(te+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):kt(s)?s.naturalHeight:kt(r)?r.naturalHeight:(o==null?void 0:o.getBoundingClientRect().height)||0}else I=Te(I)?parseFloat(I):I;return{width:$,height:I}}function B(){const $=L();return{width:$.width,height:$.height}}function C(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function O($){const I=c||k("event"),te=o==null?void 0:o.getBoundingClientRect();if(!I||!te||$<=1)return{x:0,y:0};const Y=(I.clientX||0)-te.left,b=(I.clientY||0)-te.top,{width:T,height:X}=B(),ne=oe($);if($>1){const ve=k("mouseMoveFactor");ve>1&&($*=ve)}let se=T*$,fe=X*$,me=.5*(se-T)-Y/T*100/100*(se-T),be=.5*(fe-X)-b/X*100/100*(fe-X);return me=Be(ne.x[0],me,ne.x[1]),be=Be(ne.y[0],be,ne.y[1]),{x:me,y:be}}function Z($="base"){if(!t)return 1;const I=t.getBoundingClientRect(),te=L(),{width:Y,height:b}=F(),T=me=>{if(typeof me=="number")return me;switch(me){case"min":case"base":return 1;case"cover":return Math.max(I.height/te.height,I.width/te.width)||1;case"full":case"max":{const be=g.angle%180==90?b:Y;return be&&te.width?be/te.width:1}}},X=k("minScale"),ne=k("maxScale"),se=Math.min(T("full"),T(X)),fe=typeof ne=="number"?T("full")*ne:Math.min(T("full"),T(ne));switch($){case"min":return se;case"base":return Be(se,1,fe);case"cover":return T("cover");case"full":return Math.min(fe,T("full"));case"max":return fe}}function Q(){return Z("min")}function ee(){return Z("base")}function P(){return Z("cover")}function H(){return Z("full")}function _(){return Z("max")}function oe($){const I={x:[0,0],y:[0,0]},te=t==null?void 0:t.getBoundingClientRect();if(!te)return I;const Y=L(),b=te.width,T=te.height;let X=Y.width,ne=Y.height,se=$=$===void 0?g.scale:$,fe=$;if(C()&&$>1){const me=k("mouseMoveFactor");me>1&&(X*$>b+.01&&(se*=me),ne*$>T+.01&&(fe*=me))}return X*=se,ne*=fe,$>1&&(X>b&&(I.x[0]=.5*(b-X),I.x[1]=.5*(X-b)),I.x[0]-=.5*(Y.left-te.left),I.x[1]-=.5*(Y.left-te.left),I.x[0]-=.5*(Y.left+Y.width-te.right),I.x[1]-=.5*(Y.left+Y.width-te.right),ne>T&&(I.y[0]=.5*(T-ne),I.y[1]=.5*(ne-T)),I.y[0]-=.5*(Y.top-te.top),I.y[1]-=.5*(Y.top-te.top),I.y[0]-=.5*(Y.top+Y.height-te.bottom),I.y[1]-=.5*(Y.top+Y.height-te.bottom)),I}function de(){if(!w()||!k("bounds")||!d)return;const $=Q(),I=_(),te=Be($,g.scale,I);if(g.scale<$-.01||g.scale>I+.01)return void ye(ge.ZoomTo,{scale:te});if(d.isRunning()||q())return;const Y=oe(te);g.x<Y.x[0]||g.x>Y.x[1]||g.y<Y.y[0]||g.y>Y.y[1]?(g.x=Be(Y.x[0],g.x,Y.x[1]),g.y=Be(Y.y[0],g.y,Y.y[1]),d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:d.getCurrentVelocities()}),d.from(f).to(g).start()):Ve()}function pe($){var I;if(!w())return;const te=ze(),Y=q(),b=re(),T=he(),X=Ae(),ne=qe();Ye(o,"is-fullsize",T),Ye(o,"is-expanded",b),Ye(o,"is-dragging",Y),Ye(o,"can-drag",te),Ye(o,"will-zoom-in",X),Ye(o,"will-zoom-out",ne);const se=$e(),fe=Oe(),me=_e(),be=!w();for(const ve of((I=$||t)===null||I===void 0?void 0:I.querySelectorAll("[data-panzoom-action]"))||[]){const Fe=ve.dataset.panzoomAction;let xe=!1;if(be)xe=!0;else switch(Fe){case ge.ZoomIn:se||(xe=!0);break;case ge.ZoomOut:me||(xe=!0);break;case ge.ToggleFull:{fe||me||(xe=!0);const V=ve.querySelector("g");V&&(V.style.display=T&&!xe?"none":"");break}case ge.IterateZoom:{se||me||(xe=!0);const V=ve.querySelector("g");V&&(V.style.display=se||xe?"":"none");break}case ge.ToggleCover:case ge.ToggleMax:se||me||(xe=!0)}xe?(ve.setAttribute("aria-disabled",""),ve.setAttribute("tabindex","-1")):(ve.removeAttribute("aria-disabled"),ve.removeAttribute("tabindex"))}}function ye($,I){var te;if(!($&&t&&r&&d&&w())||$===ge.Swipe&&Math.abs(d.getCurrentVelocities().scale)>.01)return;const Y=Object.assign({},g);let b=Object.assign({},g),T=oe(C()?Y.scale:f.scale);const X=d.getCurrentVelocities(),ne=L(),se=(((te=(I=I||{}).currentTouch)===null||te===void 0?void 0:te.length)||0)>1,fe=I.velocityX||0,me=I.velocityY||0;let be=I.center;I.srcEvent&&(be=Nt(Rr(I.srcEvent)));let ve=I.deltaX||0,Fe=I.deltaY||0;switch($){case ge.MoveRight:ve=I.deltaX||100;break;case ge.MoveLeft:ve=I.deltaX||-100;break;case ge.MoveUp:Fe=I.deltaY||-100;break;case ge.MoveDown:Fe=I.deltaY||100}let xe=[];switch($){case ge.Reset:b=Object.assign({},ft),b.scale=ee();break;case ge.Pan:case ge.Move:case ge.MoveLeft:case ge.MoveRight:case ge.MoveUp:case ge.MoveDown:if(q()){let j=1,D=1;b.x<=T.x[0]&&fe<=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-T.x[0]))),j*=.2),b.x>=T.x[1]&&fe>=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-T.x[1]))),j*=.2),b.y<=T.y[0]&&me<=0&&(D=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-T.y[0]))),D*=.2),b.y>=T.y[1]&&me>=0&&(D=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-T.y[1]))),D*=.2),b.x+=ve*j,b.y+=Fe*D}else b.x=Be(T.x[0],b.x+ve,T.x[1]),b.y=Be(T.y[0],b.y+Fe,T.y[1]);break;case ge.Swipe:const V=(j=0)=>Math.sign(j)*Math.pow(Math.abs(j),1.5);b.x+=Be(-1e3,V(fe),1e3),b.y+=Be(-1e3,V(me),1e3),me&&!fe&&(b.x=Be(T.x[0],b.x,T.x[1])),!me&&fe&&(b.y=Be(T.y[0],b.y,T.y[1])),X.x=fe,X.y=me;break;case ge.ZoomTo:b.scale=I.scale||1;break;case ge.ZoomIn:b.scale=b.scale*(I.scale||2),se||(b.scale=Math.min(b.scale,_()));break;case ge.ZoomOut:b.scale=b.scale*(I.scale||.5),se||(b.scale=Math.max(b.scale,Q()));break;case ge.ToggleCover:xe=[ee(),P()];break;case ge.ToggleFull:xe=[ee(),H()];break;case ge.ToggleMax:xe=[ee(),_()];break;case ge.IterateZoom:xe=[ee(),H(),_()];break;case ge.Zoom:const z=H();b.scale>=z-.05?b.scale=ee():b.scale=Math.min(z,b.scale*(I.scale||2));break;case ge.RotateCW:b.angle+=90;break;case ge.RotateCCW:b.angle-=90;break;case ge.FlipX:b.flipX*=-1;break;case ge.FlipY:b.flipY*=-1}if(f.angle!==void 0&&Math.abs(f.angle)>=360&&(b.angle-=360*Math.floor(f.angle/360),f.angle-=360*Math.floor(f.angle/360)),xe.length){const V=xe.findIndex(z=>z>b.scale+1e-4);b.scale=xe[V]||xe[0]}if(se&&(b.scale=Be(Q()*(se?.8:1),b.scale,_()*(se?1.6:1))),C()){const V=O(b.scale);if(V){const{x:z,y:j}=V;b.x=z,b.y=j}}else if(Math.abs(b.scale-Y.scale)>1e-4){let V=0,z=0;if(be)V=be.x,z=be.y;else{const J=t.getBoundingClientRect();V=J.x+.5*J.width,z=J.y+.5*J.height}let j=V-ne.left,D=z-ne.top;j-=.5*ne.width,D-=.5*ne.height;const G=(j-Y.x)/Y.scale,W=(D-Y.y)/Y.scale;b.x=j-G*b.scale,b.y=D-W*b.scale,!se&&k("bounds")&&(T=oe(b.scale),b.x=Be(T.x[0],b.x,T.x[1]),b.y=Be(T.y[0],b.y,T.y[1]))}if($===ge.Swipe){let V=94,z=17,j=500*b.scale,D=X;d.spring({tension:V,friction:z,maxSpeed:j,restDelta:.1,restSpeed:.1,velocity:D})}else $===ge.Pan||se?d.spring({tension:900,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:X});if(I.velocity===0||hn(f,b))f=Object.assign({},b),g=Object.assign({},b),d.end(),Ve(),pe();else{if(hn(g,b))return;d.from(f).to(b).start()}v("action",$)}function Ve(){if(!r||!o||!s)return;const{width:$,height:I}=F();Object.assign(o.style,{maxWidth:`min(${$}px, 100%)`,maxHeight:`min(${I}px, 100%)`});const te=function(){const{width:ve,height:Fe}=F(),{width:xe,height:V}=B();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:xe,fitHeight:V,fullWidth:ve,fullHeight:Fe};let{x:z,y:j,scale:D,angle:G,flipX:W,flipY:J}=f,ie=1/H(),ue=ve,le=Fe,ke=f.scale*ie,Ee=g.scale*ie;const Me=Math.max(xe,V),Ne=Math.min(xe,V);ve>Fe?(ue=Me,le=Ne):(ue=Ne,le=Me),ke=ve>Fe?Me*D/ve||1:Me*D/Fe||1;let je=ue?ve*Ee:0,it=le?Fe*Ee:0,st=ue&&le?ve*ke/je:0;return z=z+.5*ue-.5*je,j=j+.5*le-.5*it,{x:z,y:j,width:je,height:it,scale:st,flipX:W,flipY:J,angle:G,fitWidth:xe,fitHeight:V,fullWidth:ve,fullHeight:Fe}}(),{x:Y,y:b,width:T,height:X,scale:ne,angle:se,flipX:fe,flipY:me}=te;let be=`translate(${Qe(Y)}px, ${Qe(b)}px)`;be+=fe!==1||me!==1?` scaleX(${Qe(ne*fe)}) scaleY(${Qe(ne*me)})`:` scale(${Qe(ne)})`,se!==0&&(be+=` rotate(${se}deg)`),s.style.width=`${Qe(T)}px`,s.style.height=`${Qe(X)}px`,s.style.transform=`${be}`,v("render")}function Le(){let $=g.scale;const I=k("clickAction");let te=ee();if(I){let Y=[];switch(I){case ge.ZoomIn:te=2*$;break;case ge.ZoomOut:te=.5*$;break;case ge.ToggleCover:Y=[ee(),P()];break;case ge.ToggleFull:Y=[ee(),H()];break;case ge.ToggleMax:Y=[ee(),_()];break;case ge.IterateZoom:Y=[ee(),H(),_()];break;case ge.Zoom:const b=H();te=$>=b-.05?ee():Math.min(b,2*$)}if(Y.length){const b=Y.findIndex(T=>T>$+1e-4);te=Y[b]||ee()}}return te=Be(Q(),te,_()),te}function Ae(){return!!(w()&&Le()>g.scale)}function qe(){return!!(w()&&Le()<g.scale)}function _e(){return!!(w()&&g.scale>Q())}function $e(){return!!(w()&&g.scale<_())}function Oe(){return!!(w()&&g.scale<H())}function ze(){return!(!(w()&&re()&&l)||C())}function q(){return!(!w()||!(l!=null&&l.isPointerDown())||C())}function re(){return!!(w()&&g.scale>ee())}function he(){return!!(w()&&g.scale>=H())}function ae(){const $="in-fullscreen",I="with-panzoom-in-fullscreen";t==null||t.classList.toggle($);const te=t==null?void 0:t.classList.contains($);te?(document.documentElement.classList.add(I),document.addEventListener("keydown",K,!0)):(document.documentElement.classList.remove(I),document.removeEventListener("keydown",K,!0)),Ve(),v(te?"enterFS":"exitFS")}function K($){$.key!=="Escape"||$.defaultPrevented||ae()}const ce={canDrag:ze,canZoomIn:$e,canZoomOut:_e,canZoomToFull:Oe,destroy:function(){v("destroy");for(const $ of Object.values(p))$==null||$.destroy(ce);for(const $ of y)$();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),s&&(s.style.width="",s.style.height="",s.style.transform=""),o=void 0,r=void 0,s=void 0,f=Object.assign({},ft),g=Object.assign({},ft),d==null||d.destroy(),d=void 0,l==null||l.destroy(),l=void 0,h=4,ce},emit:v,execute:ye,getBoundaries:oe,getContainer:function(){return t},getContent:function(){return r},getFullDim:F,getGestures:function(){return l},getMousemovePos:O,getOptions:function(){return m},getPlugins:function(){return p},getScale:Z,getStartPosition:N,getState:function(){return h},getTransform:function($){return $===!0?g:f},getTween:function(){return d},getViewport:function(){return s},getWrapper:function(){return o},init:function(){return h=0,v("init"),function(){for(const[$,I]of Object.entries(Object.assign(Object.assign({},a),m.plugins||{})))if($&&!p[$]&&I instanceof Function){const te=I();te.init(ce),p[$]=te}v("initPlugins")}(),function(){const $=Object.assign(Object.assign({},La.classes),k("classes"));if(t&&(we(t,$.container),r=t.querySelector("."+$.content),!!r)){if(r.setAttribute("draggable","false"),o=t.querySelector("."+$.wrapper),o||(o=document.createElement("div"),we(o,$.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),s=t.querySelector("."+$.viewport),s||(s=document.createElement("div"),we(s,$.viewport),s.insertAdjacentElement("afterbegin",r),o.insertAdjacentElement("beforeend",s)),i=r.cloneNode(!0),i.removeAttribute("id"),o.insertAdjacentElement("afterbegin",i),r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),s instanceof HTMLPictureElement&&(s=s.querySelector("img")),s&&(s.style.visibility="hidden",k("protected"))){s.addEventListener("contextmenu",te=>{Rt(te)});const I=document.createElement("div");we(I,"f-panzoom__protected"),s.appendChild(I)}v("initLayout")}}(),function(){if(t&&o&&!u){let $=null;u=new ResizeObserver(()=>{w()&&($=$||requestAnimationFrame(()=>{w()&&(pe(),de(),v("refresh")),$=null}))}),u.observe(o),y.push(()=>{u==null||u.disconnect(),u=void 0,$&&(cancelAnimationFrame($),$=null)})}}(),function(){if(!t||!r)return;if(!kt(r)||!kt(i))return void x();const $=()=>{r&&kt(r)&&r.decode().then(()=>{x()}).catch(()=>{x()})};if(h=1,t.classList.add("is-loading"),v("loading"),i.src&&i.complete)return void $();(function(){if(!t||t!=null&&t.querySelector(".f-spinner"))return;const I=k("spinnerTpl"),te=wt(I);te&&(te.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",te))})(),i.addEventListener("load",$,!1),i.addEventListener("error",$,!1),y.push(()=>{i==null||i.removeEventListener("load",$,!1),i==null||i.removeEventListener("error",$,!1)})}(),ce},isDragging:q,isExpanded:re,isFullsize:he,isMousemoveMode:C,localize:function($,I=[]){const te=k("l10n")||{};$=String($).replace(/\{\{(\w+)\}\}/g,(Y,b)=>te[b]||Y);for(let Y=0;Y<I.length;Y++)$=$.split(I[Y][0]).join(I[Y][1]);return $=$.replace(/\{\{(.*?)\}\}/g,(Y,b)=>b)},off:function($,I){for(const te of $ instanceof Array?$:[$])E.has(te)&&E.set(te,E.get(te).filter(Y=>Y!==I));return ce},on:function($,I){for(const te of $ instanceof Array?$:[$])E.set(te,[...E.get(te)||[],I]);return ce},toggleFS:ae,updateControls:pe,version:"6.1.3",willZoomIn:Ae,willZoomOut:qe};return ce};$a.l10n={en_EN:Fa},$a.getDefaults=()=>La;/*! License details at fancyapps.com/license */const Pa=(t,n)=>{let a=[];return t.childNodes.forEach(o=>{o.nodeType!==Node.ELEMENT_NODE||n&&!o.matches(n)||a.push(o)}),a};/*! License details at fancyapps.com/license */const ot=(t,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([i,s])=>{const l=Array.isArray(s)?[]:{};t[i]||Object.assign(t,{[i]:l}),Ze(s)?Object.assign(t[i],ot(t[i],s)):Array.isArray(s)?Object.assign(t,{[i]:[...s]}):Object.assign(t,{[i]:s})})}return t};/*! License details at fancyapps.com/license */const Zn=function(t=0,n=0,a=0,o=0,r=0,i=!1){const s=(t-n)/(a-n)*(r-o)+o;return i?o<r?Be(o,s,r):Be(r,s,o):s};/*! License details at fancyapps.com/license */const Oa=Object.assign(Object.assign({},Fa),{ERROR:"Something went wrong. <br /> Please try again later.",NEXT:"Next page",PREV:"Previous page",GOTO:"Go to page #%d",DOWNLOAD:"Download",TOGGLE_FULLSCREEN:"Toggle full-screen mode",TOGGLE_EXPAND:"Toggle full-size mode",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_AUTOPLAY:"Toggle slideshow"});/*! License details at fancyapps.com/license */const Ht=t=>{t.cancelable&&t.preventDefault()},nn={adaptiveHeight:!1,center:!0,classes:{container:"f-carousel",isEnabled:"is-enabled",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",hasAdaptiveHeight:"has-adaptive-height",viewport:"f-carousel__viewport",slide:"f-carousel__slide",isSelected:"is-selected"},dragFree:!1,enabled:!0,errorTpl:'<div class="f-html">{{ERROR}}</div>',fill:!1,infinite:!0,initialPage:0,l10n:Oa,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:160,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let Ir,qr=0;const Yn=(t,n={},a={})=>{qr++;let o,r,i,s,l,d=0,u=Object.assign({},nn),c=Object.assign({},nn),h={},m=null,p=null,f=!1,g=!1,y=!1,k=!1,w="height",E=0,v=!0,M=0,A=0,R=0,S=0,x="*",N=[],L=[];const F=new Set;let B=[],C=[],O=0,Z=0,Q=0;function ee(V,...z){let j=c[V];return j&&j instanceof Function?j(xe,...z):j}function P(V,z=[]){const j=ee("l10n")||{};V=String(V).replace(/\{\{(\w+)\}\}/g,(D,G)=>j[G]||D);for(let D=0;D<z.length;D++)V=V.split(z[D][0]).join(z[D][1]);return V=V.replace(/\{\{(.*?)\}\}/g,(D,G)=>G)}const H=new Map;function _(V,...z){const j=[...H.get(V)||[]];c.on&&j.push(c.on[V]);for(const D of j)D&&D instanceof Function&&D(xe,...z);V!=="*"&&_("*",V,...z)}function oe(){var V,z;const j=ot({},nn,u);ot(j,nn,u);let D="";const G=u.breakpoints||{};if(G)for(const[W,J]of Object.entries(G))window.matchMedia(W).matches&&(D+=W,ot(j,J));if(l===void 0||D!==l){if(l=D,d!==0){let W=(z=(V=C[M])===null||V===void 0?void 0:V.slides[0])===null||z===void 0?void 0:z.index;W===void 0&&(W=c.initialSlide),j.initialSlide=W,j.slides=[];for(const J of N)J.isVirtual&&j.slides.push(J)}be(),c=j,ee("enabled")!==!1&&(d=0,_("init"),function(){for(const[W,J]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(W&&!h[W]&&J instanceof Function){const ie=J();ie.init(xe,Yn),h[W]=ie}_("initPlugins")}(),function(){if(!m)return;const W=ee("classes")||{};we(m,W.container);const J=ee("style");if(J&&Ze(J))for(const[ie,ue]of Object.entries(J))m.style.setProperty(ie,ue);p=m.querySelector(`.${W.viewport}`),p||(p=document.createElement("div"),we(p,W.viewport),p.append(...Pa(m,`.${W.slide}`)),m.insertAdjacentElement("afterbegin",p)),m.carousel=xe,_("initLayout")}(),function(){if(!p)return;const W=ee("classes")||{};N=[],[...Pa(p,`.${W.slide}`)].forEach(J=>{if(J.parentElement){const ie=re(Object.assign({el:J,isVirtual:!1},J.dataset||{}));_("createSlide",ie),N.push(ie)}}),ce();for(const J of N)_("addSlide",J);q(ee("slides"));for(const J of N){const ie=J.el;(ie==null?void 0:ie.parentElement)===p&&(we(ie,c.classes.slide),we(ie,J.class),ne(J),_("attachSlideEl",J))}_("initSlides")}(),$(),d=1,we(m,(ee("classes")||{}).isEnabled||""),me(),Le(),r=Mt().on("start",()=>{o&&o.isPointerDown()||(Ve(),me())}).on("step",W=>{const J=E;E=W.pos,E!==J&&(v=!1,me())}).on("end",W=>{o!=null&&o.isPointerDown()||(E=W.pos,r&&!g&&(E<R||E>S)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(R,E,S)}).start():v||(v=!0,_("settle")))}),pe(),function(){if(!m||!p)return;m.addEventListener("click",b,{passive:!1}),document.addEventListener("mousemove",de);const W=p.getBoundingClientRect();if(O=W.height,Z=W.width,!i){let J=null;i=new ResizeObserver(()=>{J||(J=requestAnimationFrame(()=>{(function(){if(d!==1||!p)return;const ie=C.length,ue=p.getBoundingClientRect(),le=ue.height,ke=ue.width;ie>1&&(k&&Math.abs(le-O)<.5||!k&&Math.abs(ke-Z)<.5)||($(),pe(),O=le,Z=ke,k&&!le||!k&&!ke||m&&p&&(ie===C.length&&(o!=null&&o.isPointerDown())||(ee("dragFree")&&(g||E>R&&E<S)?(Ve(),me()):se(M,{transition:!1}))))})(),J=null}))}),i.observe(p)}}(),_("ready"))}}function de(V){Ir=V}function pe(){ee("gestures")===!1?o&&(o.destroy(),o=void 0):o||function(){const V=ee("gestures");!o&&V!==!1&&p&&(o=tn(p,V).on("start",z=>{var j,D;if(!r)return;const{srcEvent:G}=z;k&&pn(G)&&!_t(G.target)&&Ht(G),r.pause(),r.getCurrentVelocities().pos=0;const W=(j=C[M])===null||j===void 0?void 0:j.slides[0];W&&F.has(W.index)&&W.el&&(E=W.offset||0,E+=(function(J){const ie=window.getComputedStyle(J),ue=new DOMMatrixReadOnly(ie.transform);return{width:ue.m41||0,height:ue.m42||0}}(W.el)[w]||0)*(y&&!k?1:-1)),te(),g||(E<R||E>S)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((D=r.getCurrentVelocities())===null||D===void 0?void 0:D.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(R,E,S)}).start()}).on("move",z=>{var j,D;const{srcEvent:G,axis:W}=z,J=G.target;if(W||(Ht(G),G.stopPropagation(),G.stopImmediatePropagation()),(W==="y"&&k||W==="x"&&!k)&&(Ht(G),G.stopPropagation()),!W)return;const{deltaX:ie,deltaY:ue}=z;if(!r||pn(G)&&((j=G.touches)===null||j===void 0?void 0:j.length)>1||W==="y"&&!k||W==="x"&&k||J&&_t(J)&&(W!=="x"||k))return;const le=y&&!k?1:-1;let ke=k?ue:ie,Ee=r!=null&&r.isRunning()?r.getEndValues().pos:E,Me=1;g||(Ee<=R&&ke*le<0?(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-R))||0)),Me*=.2):Ee>=S&&ke*le>0&&(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-S))||0)),Me*=.2)),Ee+=ke*Me*le,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((D=r.getCurrentVelocities())===null||D===void 0?void 0:D.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Ee}).start()}).on("panstart",z=>{(z==null?void 0:z.axis)===(k?"y":"x")&&we(p,"is-dragging")}).on("panend",()=>{Ke(p,"is-dragging")}).on("end",z=>{var j,D;const{srcEvent:G,axis:W,velocityX:J,velocityY:ie,currentTouch:ue}=z;if(ue.length>0||!r)return;const le=G.target,ke=le&&_t(le)&&!(W==="x"&&!k);k&&pn(G)&&!z.axis&&b(G);const Ee=C.length,Me=ee("dragFree");if(!Ee)return;const Ne=ee("vertical")?ie:J;let je=r!=null&&r.isRunning()?r.getEndValues().pos:E;const it=y&&!k?1:-1;if(ke||(je+=Ne*(Me?5:1)*it),!g&&(Ne*it<=0&&je<R||Ne*it>=0&&je>S)){let lt=0;return Math.abs(Ne)>0&&(lt=2*Math.abs(Ne),lt=Math.min(.3*$e(),lt)),je=Be(R+-1*lt,je,S+lt),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start()}if(Me||!((j=h.Autoscroll)===null||j===void 0)&&j.isEnabled())return void(Math.abs(Ne)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start():r.isRunning()||v||(v=!0,_("settle")));if(!Me&&!(!((D=h.Autoscroll)===null||D===void 0)&&D.isEnabled())&&(!z.offsetX&&!z.offsetY||W==="y"&&!k||W==="x"&&k))return void se(M,{transition:"tween"});let st=qe(je);Math.abs(Ne)>10&&st===M&&(st+=Ne>0?y&&!k?1:-1:y&&!k?-1:1),se(st,{transition:"tween",tween:{velocity:-1*Ne}})}).init())}(),Ye(p,"is-draggable",!!o&&C.length>0)}function ye(V="*"){var z;const j=[];for(const D of N)(V==="*"||D.class&&D.class.includes(V)||D.el&&(!((z=D.el)===null||z===void 0)&&z.classList.contains(V)))&&j.push(D);s=void 0,x=V,L=[...j]}function Ve(){if(!r)return;const V=qe(r!=null&&r.isRunning()?r.getEndValues().pos:E);V!==M&&(s=M,M=V,ne(),Le(),Ae(),_("change",M,s))}function Le(){var V,z;if(!m)return;for(const G of m.querySelectorAll("[data-carousel-index]"))G.innerHTML=M+"";for(const G of m.querySelectorAll("[data-carousel-page]"))G.innerHTML=M+1+"";for(const G of m.querySelectorAll("[data-carousel-pages]"))G.innerHTML=C.length+"";for(const G of m.querySelectorAll("[data-carousel-go-to]"))parseInt(((V=G.dataset)===null||V===void 0?void 0:V.carouselGoTo)||"-1",10)===M?G.setAttribute("aria-current","true"):G.removeAttribute("aria-current");for(const G of m.querySelectorAll("[data-carousel-go-prev]"))G.toggleAttribute("aria-disabled",!ve()),ve()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");for(const G of m.querySelectorAll("[data-carousel-go-next]"))G.toggleAttribute("aria-disabled",!Fe()),Fe()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");let j=!1;const D=(z=C[M])===null||z===void 0?void 0:z.slides[0];D&&(D.downloadSrc||D.type==="image"&&D.src)&&(j=!0);for(const G of m.querySelectorAll("[data-carousel-download]"))G.toggleAttribute("aria-disabled",!j)}function Ae(V){var z;V||(V=(z=C[M])===null||z===void 0?void 0:z.slides[0]);const j=V==null?void 0:V.el;if(j)for(const D of j.querySelectorAll("[data-slide-index]"))D.innerHTML=V.index+1+""}function qe(V){var z,j,D;if(!C.length)return 0;const G=Oe();let W=V;g?W-=Math.floor((V-((z=C[0])===null||z===void 0?void 0:z.pos))/G)*G||0:W=Be((j=C[0])===null||j===void 0?void 0:j.pos,V,(D=C[C.length-1])===null||D===void 0?void 0:D.pos);const J=new Map;let ie=0;for(const le of C){const ke=Math.abs(le.pos-W),Ee=Math.abs(le.pos-W-G),Me=Math.abs(le.pos-W+G),Ne=Math.min(ke,Ee,Me);J.set(ie,Ne),ie++}const ue=J.size>0?[...J.entries()].reduce((le,ke)=>ke[1]<le[1]?ke:le):[M,0];return parseInt(ue[0])}function _e(){return Q}function $e(){let V=0;return p&&(p.childElementCount||(p.style.display="grid"),V=p.getBoundingClientRect()[w]||0,p.style.display=""),V}function Oe(V=!0){return L.length?L.reduce((z,j)=>z+j.dim,0)+(L.length-(g&&V?0:1))*Q:0}function ze(V){const z=Oe(),j=$e();if(!z||!p||!j)return[];const D=[];V=V===void 0?E:V,g&&(V-=Math.floor(V/z)*z||0);let G=0,W=0;if(f){const ie=p.getBoundingClientRect();G=Math.abs(ie[k?"top":"left"]),W=Math.abs(window[k?"innerHeight":"innerWidth"]-ie[k?"bottom":"right"])}let J=0;for(let ie of L){const ue=(le=0)=>{D.indexOf(ie)>-1||(ie.pos=J-V+le||0,ie.offset+le>V-ie.dim-G+.51&&ie.offset+le<V+j+W-.51&&D.push(ie))};ie.offset=J,g&&(ue(z),ue(-1*z)),ue(),J+=ie.dim+Q}return D}function q(V,z){const j=[];for(const D of Array.isArray(V)?V:[V]){const G=re(Object.assign(Object.assign({},D),{isVirtual:!0}));G.el||(G.el=document.createElement("div")),_("createSlide",G),j.push(G)}N.splice(z===void 0?N.length:z,0,...j),ce();for(const D of j)_("addSlide",D),he(D);return ye(x),j}function re(V){return(Te(V)||V instanceof HTMLElement)&&(V={html:V}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},V)}function he(V){let z=V.el;if(!V||!z)return;const j=V.html?V.html instanceof HTMLElement?V.html:wt(V.html):void 0;j&&(we(j,"f-html"),V.htmlEl=j,we(z,"has-html"),z.append(j),_("contentReady",V))}function ae(V){if(!p||!V)return;let z=V.el;if(z){if(z.setAttribute("index",V.index+""),z.parentElement!==p){let j;we(z,c.classes.slide),we(z,V.class),ne(V);for(const D of N)if(D.index>V.index){j=D.el;break}p.insertBefore(z,j&&p.contains(j)?j:null),_("attachSlideEl",V)}return Ae(V),z}}function K(V){const z=V==null?void 0:V.el;z&&(z.remove(),I(z),_("detachSlideEl",V))}function ce(){for(let V=0;V<N.length;V++){const z=N[V],j=z.el;j&&(z.index!==V&&I(j),j.setAttribute("index",`${V}`)),z.index=V}}function $(){var V,z,j,D,G;if(!m||!p)return;y=ee("rtl"),k=ee("vertical"),w=k?"height":"width";const W=ee("classes");if(Ye(m,W.isLTR,!y),Ye(m,W.isRTL,y),Ye(m,W.isHorizontal,!k),Ye(m,W.isVertical,k),Ye(m,W.hasAdaptiveHeight,ee("adaptiveHeight")),!$e())return;const J=window.getComputedStyle(p);f=J.getPropertyValue("overflow-"+(k?"y":"x"))==="visible",Q=p&&parseFloat(J.getPropertyValue("--f-carousel-gap"))||0;const ie=function(){let ue=0;if(p){let le=document.createElement("div");le.style.display="block",we(le,c.classes.slide),p.appendChild(le),ue=le.getBoundingClientRect()[w],le.remove(),le=void 0}return ue}();for(const ue of L){const le=ue.el;let ke=0;if(!ue.isVirtual&&le&&Qt(le)){let Ee=!1;le.parentElement&&le.parentElement===p||(p.appendChild(le),Ee=!0),ke=le.getBoundingClientRect()[w],Ee&&((V=le.parentElement)===null||V===void 0||V.removeChild(le))}else ke=ie;ue.dim=ke}if(g=!1,ee("infinite")){g=!0;const ue=Oe();let le=$e();if(f){const ke=p.getBoundingClientRect();le+=ke.left,le+=ke.right-ke.width}for(let ke=0;ke<L.length;ke++){const Ee=((z=L[ke])===null||z===void 0?void 0:z.dim)+Q;if(ue-Ee<le&&ue-Ee-le<Ee){g=!1;break}}}(function(){var ue;if(!m)return;const le=$e(),ke=Oe(!1);let Ee=ee("slidesPerPage");Ee=Ee==="auto"?1/0:parseFloat(Ee+""),C=[];let Me=0,Ne=0;for(const Re of L)(!C.length||Me+Re.dim-le>.05||Ne>=Ee)&&(C.push({index:C.length,slides:[],dim:0,offset:0,pos:0}),Me=0,Ne=0),(ue=C[C.length-1])===null||ue===void 0||ue.slides.push(Re),Me+=Re.dim+Q,Ne++;const je=ee("center"),it=ee("fill");let st=0;for(const Re of C){Re.dim=(Re.slides.length-1)*Q;for(const dt of Re.slides)Re.dim+=dt.dim;Re.offset=st,Re.pos=st,je!==!1&&(Re.pos-=.5*(le-Re.dim)),it&&!g&&ke>le&&(Re.pos=Be(0,Re.pos,ke-le)),st+=Re.dim+Q}const lt=[];let bt;for(const Re of C){const dt=Object.assign({},Re);bt&&Math.abs(dt.pos-bt.pos)<.1?(bt.dim+=dt.dim,bt.slides=[...bt.slides,...dt.slides]):(bt=dt,dt.index=lt.length,lt.push(dt))}C=lt,M=Be(0,M,C.length-1)})(),R=((j=C[0])===null||j===void 0?void 0:j.pos)||0,S=((D=C[C.length-1])===null||D===void 0?void 0:D.pos)||0,d===0?function(){var ue;s=void 0,M=ee("initialPage");const le=ee("initialSlide")||void 0;le!==void 0&&(M=xe.getPageIndex(le)||0),M=Be(0,M,C.length-1),E=((ue=C[M])===null||ue===void 0?void 0:ue.pos)||0,A=E}():A=((G=C[M||0])===null||G===void 0?void 0:G.pos)||0,_("refresh"),Le()}function I(V){if(!V||!Qt(V))return;const z=parseInt(V.getAttribute("index")||"-1");let j="";for(const G of Array.from(V.classList)){const W=G.match(/^f-(\w+)(Out|In)$/);W&&W[1]&&(j=W[1]+"")}if(!V||!j)return;const D=[`f-${j}Out`,`f-${j}In`,"to-prev","to-next","from-prev","from-next"];V.removeEventListener("animationend",Y),Ke(V,D.join(" ")),F.delete(z)}function te(){if(!p)return;const V=F.size>0;for(const z of L)I(z.el);F.clear(),V&&me()}function Y(V){var z;((z=V.animationName)===null||z===void 0?void 0:z.substring(0,2))==="f-"&&(I(V.target),F.size||(Ke(m,"in-transition"),!v&&Math.abs(xe.getPosition(!0)-A)<.5&&(v=!0,_("settle"))),me())}function b(V){var z;if(V.defaultPrevented)return;const j=V.composedPath()[0];if(j.closest("[data-carousel-go-prev]"))return Ht(V),void xe.prev();if(j.closest("[data-carousel-go-next]"))return Ht(V),void xe.next();const D=j.closest("[data-carousel-go-to]");if(D)return Ht(V),void xe.goTo(parseFloat(D.dataset.carouselGoTo||"")||0);if(j.closest("[data-carousel-download]")){Ht(V);const G=(z=C[M])===null||z===void 0?void 0:z.slides[0];if(G&&(G.downloadSrc||G.type==="image"&&G.src)){const W=G.downloadFilename,J=document.createElement("a"),ie=G.downloadSrc||G.src||"";J.href=ie,J.target="_blank",J.download=W||ie,J.click()}}else _("click",V)}function T(V){var z;const j=V.el;j&&((z=j.querySelector(".f-spinner"))===null||z===void 0||z.remove())}function X(V){var z;const j=V.el;j&&((z=j.querySelector(".f-html.is-error"))===null||z===void 0||z.remove(),Ke(j,"has-error"))}function ne(V){var z;V||(V=(z=C[M])===null||z===void 0?void 0:z.slides[0]);const j=V==null?void 0:V.el;if(!j)return;let D=ee("formatCaption",V);D===void 0&&(D=V.caption),D=D||"";const G=ee("captionEl");if(G&&G instanceof HTMLElement){if(V.index!==M)return;if(Te(D)&&(G.innerHTML=P(D+"")),D instanceof HTMLElement){if(D.parentElement===G)return;G.innerHTML="",D.parentElement&&(D=D.cloneNode(!0)),G.append(D)}return}if(!D)return;let W=V.captionEl||j.querySelector(".f-caption");!W&&D instanceof HTMLElement&&D.classList.contains("f-caption")&&(W=D),W||(W=document.createElement("div"),we(W,"f-caption"),Te(D)?W.innerHTML=P(D+""):D instanceof HTMLElement&&(D.parentElement&&(D=D.cloneNode(!0)),W.append(D)));const J=`f-caption-${qr}_${V.index}`;W.setAttribute("id",J),W.dataset.selectable="true",we(j,"has-caption"),j.setAttribute("aria-labelledby",J),V.captionEl=W,j.insertAdjacentElement("beforeend",W)}function se(V,z={}){var j,D;let{transition:G,tween:W}=Object.assign({transition:c.transition,tween:c.tween},z||{});if(!m||!r)return;const J=C.length;if(!J||function(le,ke){var Ee,Me,Ne,je;if(!(m&&r&&ke&&Te(ke)&&ke!=="tween")||((Ee=C[M])===null||Ee===void 0?void 0:Ee.slides.length)>1)return!1;const it=C.length;let st=le>M?1:-1;le=g?(le%it+it)%it:Be(0,le,it-1),y&&(st*=-1);const lt=(Me=C[M])===null||Me===void 0?void 0:Me.slides[0],bt=lt==null?void 0:lt.index,Re=(Ne=C[le])===null||Ne===void 0?void 0:Ne.slides[0],dt=Re==null?void 0:Re.index,Li=(je=C[le])===null||je===void 0?void 0:je.pos;if(dt===void 0||bt===void 0||bt===dt||E===Li||Math.abs($e()-((Re==null?void 0:Re.dim)||0))>1)return!1;v=!1,r.pause(),te(),we(m,"in-transition"),E=A=Li;const on=ae(lt),rn=ae(Re);return Ve(),on&&(F.add(bt),on.style.transform="",on.addEventListener("animationend",Y),Ke(on,c.classes.isSelected),on.inert=!1,we(on,`f-${ke}Out to-${st>0?"next":"prev"}`)),rn&&(F.add(dt),rn.style.transform="",rn.addEventListener("animationend",Y),we(rn,c.classes.isSelected),rn.inert=!1,we(rn,`f-${ke}In from-${st>0?"prev":"next"}`)),me(),!0}(V,G))return;V=g?(V%J+J)%J:Be(0,V,J-1),A=((j=C[V||0])===null||j===void 0?void 0:j.pos)||0;const ue=r.isRunning()?r.getEndValues().pos:E;if(Math.abs(A-ue)<1)return E=A,M!==V&&(ne(),s=M,M=V,Le(),Ae(),_("change",M,s)),me(),void(v||(v=!0,_("settle")));if(r.pause(),te(),g){const le=Oe(),ke=Math.floor((ue-((D=C[0])===null||D===void 0?void 0:D.pos))/le)||0,Ee=A+ke*le;A=[Ee+le,Ee,Ee-le].reduce(function(Me,Ne){return Math.abs(Ne-ue)<Math.abs(Me-ue)?Ne:Me})}G!==!1&&Ze(W)?r.spring(ot({},c.tween,W)).from({pos:E}).to({pos:A}).start():(E=A,Ve(),me(),v||(v=!0,_("settle")))}function fe(V){var z;let j=E;if(g&&V!==!0){const D=Oe();j-=(Math.floor((E-((z=C[0])===null||z===void 0?void 0:z.pos)||0)/D)||0)*D}return j}function me(){var V;if(!m||!p)return;B=ze();const z=new Set,j=[],D=C[M],G=c.setTransform;let W;for(const J of L){const ie=F.has(J.index),ue=B.indexOf(J)>-1,le=((V=D==null?void 0:D.slides)===null||V===void 0?void 0:V.indexOf(J))>-1;if(J.isVirtual&&!ie&&!ue)continue;let ke=ae(J);if(ke&&(j.push(J),le&&z.add(ke),ee("adaptiveHeight")&&le)){const Ee=(ke.firstElementChild||ke).getBoundingClientRect().height;W=W==null?Ee:Math.max(W,Ee)}}p&&W&&(p.style.height=`${W}px`),[...Pa(p,`.${c.classes.slide}`)].forEach(J=>{Ye(J,c.classes.isSelected,z.has(J));const ie=N[parseInt(J.getAttribute("index")||"-1")];if(!ie)return J.remove(),void I(J);const ue=F.has(ie.index),le=B.indexOf(ie)>-1;if(ie.isVirtual&&!ue&&!le)return void K(ie);if(J.inert=!le,G===!1)return;let ke=ie.pos?Math.round(1e4*ie.pos)/1e4:0,Ee=0,Me=0,Ne=0,je=0;ue||(Ee=k?0:y?-1*ke:ke,Me=k?ke:0,Ne=Zn(Ee,0,ie.dim,0,100),je=Zn(Me,0,ie.dim,0,100)),G instanceof Function&&!ue?G(xe,ie,{x:Ee,y:Me,xPercent:Ne,yPercent:je}):J.style.transform=Ee||Me?`translate3d(${Ne}%, ${je}%,0)`:""}),_("render",j)}function be(){m==null||m.removeEventListener("click",b),document.removeEventListener("mousemove",de),F.clear(),i==null||i.disconnect(),i=void 0;for(const V of N){let z=V.el;z&&Qt(z)&&(V.state=void 0,T(V),X(V),V.isVirtual?(K(V),V.el=void 0):(I(z),z.style.transform="",p&&!p.contains(z)&&p.appendChild(z)))}for(const V of Object.values(h))V==null||V.destroy();h={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const[V,z]of Object.entries(c.classes||{}))V!=="container"&&Ke(m,z);Ke(p,"is-draggable")}function ve(){return g||M>0}function Fe(){return g||M<C.length-1}const xe={add:function(V,z){var j;let D=E;const G=M,W=Oe(),J=r!=null&&r.isRunning()?r.getEndValues().pos:E,ie=W&&Math.floor((J-(((j=C[0])===null||j===void 0?void 0:j.pos)||0))/W)||0;return q(V,z),ye(x),$(),r&&W&&(G===M&&(D-=ie*W),D===A?E=A:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:D}).to({pos:A}).start()),me(),xe},canGoPrev:ve,canGoNext:Fe,destroy:function(){return _("destroy"),window.removeEventListener("resize",oe),be(),H.clear(),m=null,C=[],N=[],c=Object.assign({},nn),h={},L=[],l=void 0,x="*",d=2,xe},emit:_,filter:function(V="*"){return ye(V),$(),E=Be(R,E,S),me(),_("filter",V),xe},getContainer:function(){return m},getGapDim:_e,getGestures:function(){return o},getLastMouseMove:function(){return Ir},getOption:function(V){return ee(V)},getOptions:function(){return c},getPage:function(){return C[M]},getPageIndex:function(V){if(V!==void 0){for(const z of C||[])for(const j of z.slides)if(j.index===V)return z.index;return-1}return M},getPageIndexFromPosition:qe,getPageProgress:function(V,z){var j;V===void 0&&(V=M);const D=C[V];if(!D)return V>M?-1:1;const G=Oe(),W=_e();let J=D.pos,ie=fe();if(g&&z!==!0){const ue=Math.floor((ie-((j=C[0])===null||j===void 0?void 0:j.pos))/G)||0;ie-=ue*G,J=[J+G,J,J-G].reduce(function(le,ke){return Math.abs(ke-ie)<Math.abs(le-ie)?ke:le})}return(ie-J)/(D.dim+W)||0},getPageVisibility:function(V){var z;V===void 0&&(V=M);const j=C[V];if(!j)return V>M?-1:1;const D=fe(),G=$e();let W=j.pos;if(g){const J=Oe(),ie=W+(Math.floor((D-((z=C[0])===null||z===void 0?void 0:z.pos))/J)||0)*J;W=[ie+J,ie,ie-J].reduce(function(ue,le){return Math.abs(le-D)<Math.abs(ue-D)?le:ue})}return W>D&&W+j.dim<D+G?1:W<D?(W+j.dim-D)/j.dim||0:W+j.dim>D+G&&(D+G-W)/j.dim||0},getPages:function(){return C},getPlugins:function(){return h},getPosition:fe,getSlides:function(){return N},getState:function(){return d},getTotalSlideDim:Oe,getTween:function(){return r},getViewport:function(){return p},getViewportDim:$e,getVisibleSlides:function(V){return V===void 0?B:ze(V)},goTo:se,hasNavigated:function(){return s!==void 0},hideError:X,hideLoading:T,init:function(){if(!t||!Qt(t))throw new Error("No Element found");return d!==0&&(be(),d=0),m=t,u=n,window.removeEventListener("resize",oe),u.breakpoints&&window.addEventListener("resize",oe),oe(),xe},isInfinite:function(){return g},isInTransition:function(){return F.size>0},isRTL:function(){return y},isSettled:function(){return v},isVertical:function(){return k},localize:function(V,z=[]){return P(V,z)},next:function(V={}){return se(M+1,V),xe},off:function(V,z){for(const j of V instanceof Array?V:[V])H.has(j)&&H.set(j,H.get(j).filter(D=>D!==z));return xe},on:function(V,z){for(const j of V instanceof Array?V:[V])H.set(j,[...H.get(j)||[],z]);return xe},prev:function(V={}){return se(M-1,V),xe},reInit:function(V={},z={}){return be(),d=0,l=void 0,x="*",n=V,u=V,a=z,oe(),xe},remove:function(V){V===void 0&&(V=N.length-1);const z=N[V];return z&&(_("removeSlide",z),z.el&&(I(z.el),z.el.remove(),z.el=void 0),N.splice(V,1),ye(x),$(),E=Be(R,E,S),me()),xe},setPosition:function(V){E=V,Ve(),me()},showError:function(V,z){T(V),X(V);const j=V.el;if(j){const D=document.createElement("div");we(D,"f-html"),we(D,"is-error"),D.innerHTML=P(z||"<p>{{ERROR}}</p>"),V.htmlEl=D,we(j,"has-html"),we(j,"has-error"),j.insertAdjacentElement("afterbegin",D),_("contentReady",V)}return xe},showLoading:function(V){const z=V.el,j=z==null?void 0:z.querySelector(".f-spinner");if(!z||j)return xe;const D=ee("spinnerTpl"),G=wt(D);return G&&(we(G,"f-spinner"),z.insertAdjacentElement("beforeend",G)),xe},version:"6.1.3"};return xe};Yn.l10n={en_EN:Oa},Yn.getDefaults=()=>nn;/*! License details at fancyapps.com/license */const Wr=(t=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,i=r.body,s=r.documentElement;if(t){if(i.classList.contains(o))return;let l=window.innerWidth-s.getBoundingClientRect().width;l<0&&(l=0),s.style.setProperty(n,`${l}px`);const d=parseFloat(window.getComputedStyle(i).marginRight);d&&i.style.setProperty(a,`${d}px`),i.classList.add(o)}else i.classList.remove(o),i.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function Xn(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const zt=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const Ur={tpl:t=>`<img class="f-panzoom__content"
6
+ `+i):o.stack=i}catch{}}throw o}}_request(n,a){typeof n=="string"?(a=a||{},a.url=n):a=n||{},a=Lt(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&Pn.assertOptions(o,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean)},!1),r!=null&&(U.isFunction(r)?a.paramsSerializer={serialize:r}:Pn.assertOptions(r,{encode:pt.function,serialize:pt.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),Pn.assertOptions(a,{baseUrl:pt.spelling("baseURL"),withXsrfToken:pt.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let s=i&&U.merge(i.common,i[a.method]);i&&U.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),a.headers=nt.concat(s,i);const l=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(d=d&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,h=0,m;if(!d){const f=[tr.bind(this),void 0];for(f.unshift(...l),f.push(...u),m=f.length,c=Promise.resolve(a);h<m;)c=c.then(f[h++],f[h++]);return c}m=l.length;let p=a;for(;h<m;){const f=l[h++],g=l[h++];try{p=f(p)}catch(y){g.call(this,y);break}}try{c=tr.call(this,p)}catch(f){return Promise.reject(f)}for(h=0,m=u.length;h<m;)c=c.then(u[h++],u[h++]);return c}getUri(n){n=Lt(this.defaults,n);const a=Io(n.baseURL,n.url,n.allowAbsoluteUrls);return $o(a,n.params,n.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(n){$t.prototype[n]=function(a,o){return this.request(Lt(o||{},{method:n,url:a,data:(o||{}).data}))}}),U.forEach(["post","put","patch"],function(n){function a(o){return function(i,s,l){return this.request(Lt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}$t.prototype[n]=a(),$t.prototype[n+"Form"]=a(!0)});let B0=class $i{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(i){a=i});const o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(r);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new Wt(i,s,l),a(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const a=this._listeners.indexOf(n);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const n=new AbortController,a=o=>{n.abort(o)};return this.subscribe(a),n.signal.unsubscribe=()=>this.unsubscribe(a),n.signal}static source(){let n;return{token:new $i(function(r){n=r}),cancel:n}}};function V0(t){return function(a){return t.apply(null,a)}}function M0(t){return U.isObject(t)&&t.isAxiosError===!0}const ba={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ba).forEach(([t,n])=>{ba[n]=t});function or(t){const n=new $t(t),a=bo($t.prototype.request,n);return U.extend(a,$t.prototype,n,{allOwnKeys:!0}),U.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return or(Lt(t,r))},a}const Ge=or(un);Ge.Axios=$t,Ge.CanceledError=Wt,Ge.CancelToken=B0,Ge.isCancel=Ho,Ge.VERSION=nr,Ge.toFormData=Tn,Ge.AxiosError=Se,Ge.Cancel=Ge.CanceledError,Ge.all=function(n){return Promise.all(n)},Ge.spread=V0,Ge.isAxiosError=M0,Ge.mergeConfig=Lt,Ge.AxiosHeaders=nt,Ge.formToJSON=t=>_o(U.isHTMLForm(t)?new FormData(t):t),Ge.getAdapter=er.getAdapter,Ge.HttpStatusCode=ba,Ge.default=Ge;const{Axios:qx,AxiosError:Wx,CanceledError:Ux,isCancel:Zx,CancelToken:Yx,VERSION:Xx,all:Kx,Cancel:Qx,isAxiosError:Jx,spread:eb,toFormData:tb,AxiosHeaders:nb,HttpStatusCode:ab,formToJSON:ob,getAdapter:rb,mergeConfig:ib}=Ge,rr=Dt.defineStore("auth",{state:()=>({jwtToken:null}),actions:{setToken(t){this.jwtToken=t},clearToken(){this.jwtToken=null}},getters:{getToken:t=>t.jwtToken}}),at=Ge.create({baseURL:"https://back.dev-smclick.com.br/"});let wa=null;const N0=()=>(wa||(wa=rr()),wa);at.interceptors.request.use(t=>{try{const a=N0().jwtToken;a?t.headers.Authorization=`Bearer ${a}`:console.warn("JWT token não configurado em api request")}catch(n){console.warn("Erro ao acessar authStore no interceptor:",n)}return t},t=>Promise.reject(t));const A0="v1/api/attendances/attendant/",T0="v1/api/attendances/department/",Ea="v1/api/attendances/internal_chat/",D0="v1/api/instances/instance/",F0="v1/api/crm/event/scheduled_message/",L0="v1/api/crm/event/calendar",$0="v1/api/crm/products/",P0="v1/api/contacts/tag/",O0="/v1/api/contacts/segmentation_field/",va=Dt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${D0}`;const a=await at.get(n);this.instances=a.data,await Promise.all(this.instances.map(async o=>{o.isLoading=!0;try{const r=o.last_instance_status;r==="DISCONNECTED"||r==="UNDEFINED"?o.status=!1:o.status=!0}catch(r){console.log(r),o.status="Offline"}o.isLoading=!1})),this.count=this.instances.length,this.loaded=!0}catch(n){console.log("Erro ao buscar instâncias:",n),this.loaded=!0}},removeInstance(t){this.instances=this.instances.filter(n=>n.id!==t),this.count=this.instances.length},addInstance(t){const n=this.instances.findIndex(a=>a.id===t.id);n!==-1?this.instances[n]=t:this.instances.push(t),this.count=this.instances.length}}}),_0={class:"w-full relative text-current"},R0={class:"flex cursor-pointer justify-between items-center"},H0={key:0},z0={key:0},j0={key:1,class:"flex items-center gap-2"},G0={class:"flex gap-3 items-center flex-shrink-0"},I0={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},q0={key:1,class:"relative"},W0={style:{color:"#0081FB",width:"20px",height:"20px"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},U0={class:"my-auto text-center mx-auto group-hover:inline-block"},Z0={key:1,class:"flex justify-center"},Y0={class:"w-full"},X0={key:1,class:"flex items-center gap-2 justify-center"},K0={class:"flex px-4 items-center gap-2"},Q0={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},J0={class:"gap-2 rounded-b-lg flex overflow-y-auto p-2 shadow shadow-black dark:shadow-gray-400 bg-base-300 max-h-[200px] flex-col"},el={class:"select-none cursor-pointer w-full"},tl=["onClick","disabled"],nl={class:"flex w-full items-center pl-2 gap-3"},al={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},ol={key:1,class:"relative"},rl={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},il={key:0,class:"w-6 h-6 flex-shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},sl={class:"w-full text-center"},ll={class:"my-auto text-center mx-auto group-hover:inline-block"},cl={key:1,class:"flex justify-center"},dl={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},ul={key:1,class:"p-4"},ir={__name:"index",props:{modelValue:{type:Object,default:null},type:{type:String},webhooks:{type:Boolean,default:void 0}},emits:["update:modelValue","function","component-mounted"],setup(t,{emit:n}){const a=va(),o=e.ref(!1),r=e.ref(null),i=t,s=n;function l(d){r.value=d,s("function",d)}return e.watch(()=>i.modelValue,d=>{r.value=d},{immediate:!0}),e.watch(r,d=>{s("update:modelValue",d)}),e.onMounted(async()=>{if(r.value){const d=a.instances.find(u=>u.id===r.value.id);d&&(r.value.status=d.status)}s("component-mounted")}),(d,u)=>{const c=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",_0,[e.createElementVNode("div",{class:e.normalizeClass([{"rounded-b-none":o.value},"rounded-lg shadow dark:shadow-gray-400 shadow-gray-900 dark:bg-base-100 bg-base-100 text-center"])},[e.createElementVNode("div",R0,[e.createElementVNode("p",{onClick:u[0]||(u[0]=h=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",H0,[r.value?(e.openBlock(),e.createElementBlock("span",j0,[e.createElementVNode("header",G0,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",I0,[...u[3]||(u[3]=[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)])])):r.value.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",q0,[u[5]||(u[5]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(e.openBlock(),e.createElementBlock("svg",W0,[...u[4]||(u[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])]))])):e.createCommentVNode("",!0),r.value&&r.value.status!==void 0?(e.openBlock(),e.createBlock(c,{key:2,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.normalizeClass(["p-1 rounded text-sm px-3",{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"}])},[e.createElementVNode("div",U0,e.toDisplayString(r.value.status===!0?"Conectada":r.value.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[r.value.isLoading?(e.openBlock(),e.createElementBlock("div",Z0,[...u[6]||(u[6]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{"bg-red-500":r.value.status===!1,"bg-green-500":r.value.status===!0,"bg-purple-500":r.value.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Y0,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",z0,e.toDisplayString(e.unref(a).instances?e.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",X0,[...u[7]||(u[7]=[e.createElementVNode("svg",{"aria-hidden":"true",class:"inline w-5 h-5 text-blue-300 animate-spin fill-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),e.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),e.createTextVNode("Inicializando instâncias...",-1)])]))]),e.createElementVNode("footer",K0,[e.createElementVNode("button",{onClick:u[1]||(u[1]=h=>(r.value=null,o.value=!1))},[...u[8]||(u[8]=[e.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.createElementVNode("button",{onClick:u[2]||(u[2]=h=>o.value=!o.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"rotate-180":o.value},"w-4 h-4 ease-out transition"]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[...u[9]||(u[9]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"},null,-1)])],2))])])])],2),o.value?(e.openBlock(),e.createElementBlock("nav",Q0,[e.createElementVNode("ul",J0,[e.unref(a).instances.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).instances,(h,m)=>{var p;return e.openBlock(),e.createElementBlock("li",el,[e.createElementVNode("button",{class:e.normalizeClass([r.value&&r.value.id===h.id?"bg-base-100":"bg-base-200 hover:bg-base-100","flex rounded-md justify-between items-center p-2 px-1 w-full"]),onClick:f=>(r.value=h,o.value=!1,l(h)),disabled:r.value&&r.value.id===h.id||t.type&&h.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((p=h.config)==null?void 0:p.webhooks)},[e.createElementVNode("div",nl,[h.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",al,[...u[10]||(u[10]=[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"},null,-1)])])):h.type==="whatsapp-api-official"?(e.openBlock(),e.createElementBlock("div",ol,[u[12]||(u[12]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-4 h-4 flex-shrink-0 text-green-400",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})],-1)),(e.openBlock(),e.createElementBlock("svg",rl,[...u[11]||(u[11]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"},null,-1)])]))])):e.createCommentVNode("",!0),e.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.type&&h.type!==t.type?"Não é possível utilizar esse tipo de Instância neste recurso":t.webhooks===!0?"Essa instância está com o Atendimento desabilitado":"Essa aplicação é somente para instâncias sem atendimento habilitado."),1)]),default:e.withCtx(()=>{var f;return[t.type&&h.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((f=h.config)==null?void 0:f.webhooks)?(e.openBlock(),e.createElementBlock("svg",il,[...u[13]||(u[13]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 10V7a4 4 0 1 1 8 0v3h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h1Zm2-3a2 2 0 1 1 4 0v3h-4V7Zm2 6a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)]}),_:2},1024),e.createElementVNode("p",sl,e.toDisplayString(h.name),1),e.createVNode(c,{class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("main",{class:e.normalizeClass(["p-1 rounded px-3",{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"}])},[e.createElementVNode("div",ll,e.toDisplayString(h.status===!0?"Conectada":h.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[h.isLoading?(e.openBlock(),e.createElementBlock("div",cl,[...u[14]||(u[14]=[e.createElementVNode("div",{class:"h-5 w-5 border-t-transparent border-solid animate-spin rounded-full border-white border-4"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{"bg-red-500":h.status===!1,"bg-green-500":h.status===!0,"bg-purple-500":h.status==="Offline"},"text-xs w-5 h-5 py-1 shadow flex justify-start shadow-gray-900 dark:shadow-gray-400 rounded-full cursor-pointer transition-all duration-200 ease-in-out"])},null,2))]),_:2},1024)]),e.createElementVNode("div",dl,[h.telephone?(e.openBlock(),e.createBlock(c,{key:0,class:"dark:popper-light popper-dark",hover:!0,placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(h.telephone?`${h.telephone}`:""),1)]),default:e.withCtx(()=>[u[15]||(u[15]=e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M7.978 4a2.553 2.553 0 0 0-1.926.877C4.233 6.7 3.699 8.751 4.153 10.814c.44 1.995 1.778 3.893 3.456 5.572 1.68 1.679 3.577 3.018 5.57 3.459 2.062.456 4.115-.073 5.94-1.885a2.556 2.556 0 0 0 .001-3.861l-1.21-1.21a2.689 2.689 0 0 0-3.802 0l-.617.618a.806.806 0 0 1-1.14 0l-1.854-1.855a.807.807 0 0 1 0-1.14l.618-.62a2.692 2.692 0 0 0 0-3.803l-1.21-1.211A2.555 2.555 0 0 0 7.978 4Z"})],-1))]),_:2},1024)):e.createCommentVNode("",!0)])],10,tl)])}),256)):(e.openBlock(),e.createElementBlock("div",ul," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},fl=["aria-labelledby","aria-describedby"],ml={class:"cpk-popover__header border-base-100"},hl=["id"],pl=["disabled"],gl=["id"],yl={class:"cpk-popover__details bg-base-200 border border-base-100"},kl={class:"cpk-popover__footer"},xl=["disabled"],bl=["disabled"],wl={key:0,class:"loading-spinner"},El=Ce({__name:"confirmModal",props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:"Confirmar ação"},description:{type:String,default:""},confirmLabel:{type:String,default:"Confirmar"},cancelLabel:{type:String,default:"Cancelar"},loadingLabel:{type:String,default:"Processando…"},loading:{type:Boolean,default:!1},destructive:{type:Boolean,default:!1},context:{type:Object,default:()=>({})},anchorEl:{type:[HTMLElement,Object],default:null},anchorRect:{type:Object,default:null},placement:{type:String,default:"auto"},align:{type:String,default:"center"},offset:{type:Number,default:10},viewportPadding:{type:Number,default:8}},emits:["update:modelValue","confirm","cancel"],setup(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:v=>o("update:modelValue",v)}),i=e.ref(null),s=e.ref({left:0,top:0,p:"bottom"}),l={title:`cpk-popover-title-${Math.random().toString(36).slice(2)}`,desc:`cpk-popover-desc-${Math.random().toString(36).slice(2)}`};function d(){o("cancel",a.context),r.value=!1}function u(){a.loading||o("confirm",a.context)}let c,h,m=[];function p(){if(a.anchorRect)return a.anchorRect;const v=a.anchorEl instanceof Element?a.anchorEl:null;if(v)return v.getBoundingClientRect();const M=document.activeElement instanceof Element?document.activeElement:null;return M?M.getBoundingClientRect():{left:window.__lastMouseX??window.innerWidth/2,top:window.__lastMouseY??window.innerHeight/2,width:1,height:1,right:(window.__lastMouseX??0)+1,bottom:(window.__lastMouseY??0)+1}}function f(){if(!r.value)return;const v=window.innerWidth,M=window.innerHeight,A=a.viewportPadding,R=p(),S=i.value?i.value.getBoundingClientRect():{width:320,height:200},x=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let N=x[0],L=0,F=0;const B=R.left+R.width/2-S.width/2,C=R.top+R.height/2-S.height/2,O=R.left,Z=R.left+R.width-S.width,Q=R.top,ee=R.top+R.height-S.height;for(const P of x){if(P==="bottom"&&(F=R.bottom+a.offset,L=a.align==="start"?O:a.align==="end"?Z:B,F+S.height+A<=M)){N="bottom";break}if(P==="top"&&(F=R.top-S.height-a.offset,L=a.align==="start"?O:a.align==="end"?Z:B,F>=A)){N="top";break}if(P==="right"&&(L=R.right+a.offset,F=a.align==="start"?Q:a.align==="end"?ee:C,L+S.width+A<=v)){N="right";break}if(P==="left"&&(L=R.left-S.width-a.offset,F=a.align==="start"?Q:a.align==="end"?ee:C,L>=A)){N="left";break}}L=Math.min(Math.max(A,L),v-S.width-A),F=Math.min(Math.max(A,F),M-S.height-A),s.value={left:L,top:F,p:N}}function g(){y();let M=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;M&&M!==document.body;)m.push(M),M=M.parentElement;m.push(window),m.forEach(A=>A.addEventListener("scroll",f,{passive:!0}))}function y(){m.forEach(v=>{var M;return(M=v.removeEventListener)==null?void 0:M.call(v,"scroll",f)}),m=[]}e.watch(()=>r.value,async v=>{var M;if(v){await e.nextTick(),f(),g(),c=new ResizeObserver(f),c.observe(document.body);const A=a.anchorEl instanceof Element?a.anchorEl:null;A&&((M=h==null?void 0:h.disconnect)==null||M.call(h),h=new ResizeObserver(f),h.observe(A)),window.addEventListener("resize",f),window.addEventListener("keydown",k)}else w()}),e.watch(()=>a.anchorEl,async v=>{var A;if(!r.value)return;await e.nextTick(),y(),g(),(A=h==null?void 0:h.disconnect)==null||A.call(h);const M=v instanceof Element?v:null;M&&(h=new ResizeObserver(f),h.observe(M)),f()}),e.watch(()=>a.anchorRect,()=>{r.value&&f()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&f()});function k(v){v.key==="Escape"&&d(),v.key==="Enter"&&u()}e.onMounted(()=>{window.addEventListener("mousemove",v=>{window.__lastMouseX=v.clientX,window.__lastMouseY=v.clientY},{passive:!0})}),e.onBeforeUnmount(w);function w(){y(),window.removeEventListener("resize",f),window.removeEventListener("keydown",k),c&&c.disconnect(),h&&h.disconnect()}const E=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(v,M)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:e.withModifiers(d,["self"])},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:i,class:e.normalizeClass(["cpk-popover bg-base-300",[{"is-loading":t.loading,"is-danger":t.destructive}]]),style:e.normalizeStyle(E.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[e.createElementVNode("div",ml,[M[0]||(M[0]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"!",-1)),e.createElementVNode("h3",{class:"cpk-popover__title",id:l.title},e.toDisplayString(t.title),9,hl),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:d,disabled:t.loading,"aria-label":"Fechar"}," × ",8,pl)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},e.toDisplayString(t.description),9,gl)):e.createCommentVNode("",!0),e.createElementVNode("div",yl,[e.renderSlot(v.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",kl,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:d,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,xl),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button","cyber-button--md",t.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:u,disabled:t.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",wl)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,bl)])],14,fl)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-2f78365f"]]);function Ut(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function gt(t){return(n,a)=>{const o=a!=null&&a.context?String(a.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,l=a!=null&&a.width?String(a.width):s;r=t.formattingValues[l]||t.formattingValues[s]}else{const s=t.defaultWidth,l=a!=null&&a.width?String(a.width):t.defaultWidth;r=t.values[l]||t.values[s]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}function yt(t){return(n,a={})=>{const o=a.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const s=i[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(l)?Cl(l,h=>h.test(s)):vl(l,h=>h.test(s));let u;u=t.valueCallback?t.valueCallback(d):d,u=a.valueCallback?a.valueCallback(u):u;const c=n.slice(s.length);return{value:u,rest:c}}}function vl(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function Cl(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function sr(t){return(n,a={})=>{const o=n.match(t.matchPattern);if(!o)return null;const r=o[0],i=n.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;const l=n.slice(r.length);return{value:s,rest:l}}}const lr=6048e5,Sl=864e5,cr=Symbol.for("constructDateFrom");function rt(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&cr in t?t[cr](n):t instanceof Date?new t.constructor(n):new Date(n)}function Ca(t,...n){const a=rt.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let Bl={};function On(){return Bl}function ct(t,n){return rt(n||t,t)}function Pt(t,n){var l,d,u,c;const a=On(),o=(n==null?void 0:n.weekStartsOn)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??a.weekStartsOn??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,r=ct(t,n==null?void 0:n.in),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Vl(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+Pt(o,a)==+Pt(r,a)}const Ml={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Nl=(t,n,a)=>{let o;const r=Ml[t];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",n.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},Al={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tl=(t,n,a,o)=>Al[t],Dl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Fl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ll={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$l={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Pl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ol={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},_l={ordinalNumber:(t,n)=>{const a=Number(t),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:gt({values:Dl,defaultWidth:"wide"}),quarter:gt({values:Fl,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:Ll,defaultWidth:"wide"}),day:gt({values:$l,defaultWidth:"wide"}),dayPeriod:gt({values:Pl,defaultWidth:"wide",formattingValues:Ol,defaultFormattingWidth:"wide"})},Rl=/^(\d+)(th|st|nd|rd)?/i,Hl=/\d+/i,zl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jl={any:[/^b/i,/^(a|c)/i]},Gl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Il={any:[/1/i,/2/i,/3/i,/4/i]},ql={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Wl={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ul={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zl={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Yl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Kl={ordinalNumber:sr({matchPattern:Rl,parsePattern:Hl,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:jl,defaultParseWidth:"any"}),quarter:yt({matchPatterns:Gl,defaultMatchWidth:"wide",parsePatterns:Il,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:ql,defaultMatchWidth:"wide",parsePatterns:Wl,defaultParseWidth:"any"}),day:yt({matchPatterns:Ul,defaultMatchWidth:"wide",parsePatterns:Zl,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:Yl,defaultMatchWidth:"any",parsePatterns:Xl,defaultParseWidth:"any"})},Ql={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},e2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},t2={date:Ut({formats:Ql,defaultWidth:"full"}),time:Ut({formats:Jl,defaultWidth:"full"}),dateTime:Ut({formats:e2,defaultWidth:"full"})},n2={code:"en-US",formatDistance:Nl,formatLong:t2,formatRelative:Tl,localize:_l,match:Kl,options:{weekStartsOn:0,firstWeekContainsDate:1}},a2={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},o2=(t,n,a)=>{let o;const r=a2[t];return typeof r=="string"?o=r:n===1?o=r.one:o=r.other.replace("{{count}}",String(n)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"em "+o:"há "+o:o},r2={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},i2={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},s2={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},l2={date:Ut({formats:r2,defaultWidth:"full"}),time:Ut({formats:i2,defaultWidth:"full"}),dateTime:Ut({formats:s2,defaultWidth:"full"})},c2={lastWeek:t=>{const n=t.getDay();return"'"+(n===0||n===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},d2=(t,n,a,o)=>{const r=c2[t];return typeof r=="function"?r(n):r},u2={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},f2={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},m2={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},h2={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},p2={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},g2={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},y2={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:gt({values:u2,defaultWidth:"wide"}),quarter:gt({values:f2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gt({values:m2,defaultWidth:"wide"}),day:gt({values:h2,defaultWidth:"wide"}),dayPeriod:gt({values:p2,defaultWidth:"wide",formattingValues:g2,defaultFormattingWidth:"wide"})},k2=/^(\d+)[ºªo]?/i,x2=/\d+/i,b2={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},w2={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},E2={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},v2={any:[/1/i,/2/i,/3/i,/4/i]},C2={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},S2={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},B2={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},V2={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},M2={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},N2={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},A2={ordinalNumber:sr({matchPattern:k2,parsePattern:x2,valueCallback:t=>parseInt(t,10)}),era:yt({matchPatterns:b2,defaultMatchWidth:"wide",parsePatterns:w2,defaultParseWidth:"any"}),quarter:yt({matchPatterns:E2,defaultMatchWidth:"wide",parsePatterns:v2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:yt({matchPatterns:C2,defaultMatchWidth:"wide",parsePatterns:S2,defaultParseWidth:"any"}),day:yt({matchPatterns:B2,defaultMatchWidth:"wide",parsePatterns:V2,defaultParseWidth:"any"}),dayPeriod:yt({matchPatterns:M2,defaultMatchWidth:"any",parsePatterns:N2,defaultParseWidth:"any"})},dr={code:"pt-BR",formatDistance:o2,formatLong:l2,formatRelative:d2,localize:y2,match:A2,options:{weekStartsOn:0,firstWeekContainsDate:1}},T2={scheduled_messages:"Mensagem programada"};function D2(t){return T2[t]||t||"Evento"}function Sa(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function Zt(t){const n=t instanceof Date?t:new Date(t),a=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0");return`${a}-${o}`}function mn(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(u=>parseInt(u,10));let s=0,l=0;if(a){const[u,c]=a.split(":");s=parseInt(u||"0",10),l=parseInt(c||"0",10)}const d=new Date(o,(r||1)-1,i||1,s,l);return isNaN(d.getTime())?null:d}function F2(t){if(!t)return null;try{const n=String(t).replace(/(\.\d{3})\d+$/,"$1"),a=new Date(n);return isNaN(a.getTime())?null:a}catch{return null}}function _n(t){if(!t)return"";const n=t instanceof Date?t:new Date(t);if(isNaN(n.getTime()))return"";const a=String(n.getHours()).padStart(2,"0"),o=String(n.getMinutes()).padStart(2,"0");return`${a}:${o}`}function L2(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ba(t){if(!t)return null;const n=(t==null?void 0:t.params)||{},a=(n==null?void 0:n.schedule)||{},o=(t==null?void 0:t.info)||{},r=(o==null?void 0:o.entity)||{},i=(o==null?void 0:o.department)||{},s=(o==null?void 0:o.instance)||{};let l=null;if(a!=null&&a.time&&(l=mn(a.time)),!l&&(t!=null&&t.next_execution_at)&&(l=F2(t.next_execution_at)),!l)return null;const d=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,u=d&&(d.content||d.text)||"",c=(t==null?void 0:t.function)||(n==null?void 0:n.function)||"",h=D2(c),m=(u||"").trim();return{id:(t==null?void 0:t.id)||L2(),date:l,time:_n(l),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:h,content:m,functionName:c||null,chatId:(n==null?void 0:n.chat_id)||(o==null?void 0:o.id)||"",protocol:(o==null?void 0:o.protocol)??"",contactName:(r==null?void 0:r.name)||"Contato",contactPhoto:(r==null?void 0:r.photo)||"",departmentName:(i==null?void 0:i.name)||"",departmentId:(i==null?void 0:i.id)||null,instanceName:(s==null?void 0:s.name)||"",raw:t}}function ur(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=Ba(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function $2(t="/crm_scheduled",n){var a;try{const o=((a=n==null?void 0:n.raw)==null?void 0:a.id)??(n==null?void 0:n.id)??n;if(o==null)throw new Error("ID inválido");const r=`${String(t).replace(/\/$/,"")}/${o}/`,i=await at.delete(r);return{ok:(i==null?void 0:i.status)>=200&&i.status<300,status:(i==null?void 0:i.status)??0}}catch(o){return console.error("Error erasing scheduled event:",o),{ok:!1,status:0}}}const fr={scheduled_messages:"#3b82f6"},mr=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function P2(t=""){let n=2166136261;for(let a=0;a<t.length;a++)n^=t.charCodeAt(a),n=Math.imul(n,16777619);return n>>>0}function O2(t={}){var s,l,d,u,c,h,m,p,f,g,y;const n=t.functionName||t.function||((s=t==null?void 0:t.params)==null?void 0:s.function);if(n)return`fn:${n}`;const a=(t==null?void 0:t.departmentName)||((d=(l=t==null?void 0:t.info)==null?void 0:l.department)==null?void 0:d.name)||((c=(u=t==null?void 0:t.info)==null?void 0:u.department)==null?void 0:c.id);if(a)return`dept:${a}`;const o=(t==null?void 0:t.instanceName)||((m=(h=t==null?void 0:t.info)==null?void 0:h.instance)==null?void 0:m.name)||((f=(p=t==null?void 0:t.info)==null?void 0:p.instance)==null?void 0:f.id);if(o)return`inst:${o}`;const r=(t==null?void 0:t.protocol)??((g=t==null?void 0:t.info)==null?void 0:g.protocol);if(r!=null)return`proto:${r}`;const i=(t==null?void 0:t.chatId)||((y=t==null?void 0:t.params)==null?void 0:y.chat_id);return i?`chat:${i}`:"misc"}function Rn(t={}){var r;const n=t.functionName||t.function||((r=t==null?void 0:t.params)==null?void 0:r.function);if(n&&Object.prototype.hasOwnProperty.call(fr,n))return fr[n];const a=O2(t),o=P2(String(a))%mr.length;return mr[o]}const Yt=Dt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let t=`${A0}`;const n=await at.get(t);this.attendants=n.data,this.count=this.attendants.length}catch(t){console.log("Erro ao buscar atendentes:",t)}},removeAttendants(t){this.attendants=this.attendants.filter(n=>n.id!==t)},addAttendants(t){const n=this.attendants.findIndex(a=>a.id===t.id);n!==-1?this.attendants[n]=t:this.attendants.push(t)}}}),_2={class:"itemc-head"},R2={class:"minw0"},H2={class:"itemc-title"},z2={class:"itemc-sub"},j2={class:"flex items-center gap-1"},G2={class:"itemc-actions"},I2={class:"flex flex-col items-center"},q2={class:"time-badge"},W2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},U2={class:"sched-pop__card bg-base-300",role:"dialog"},Z2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Y2={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},X2=["disabled"],K2={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Q2={key:1,class:"loading-spinner"},J2={class:"itemsb-head"},ec=["src"],tc={key:1,class:"avatar avatar--placeholder bg-base-100"},nc={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},ac={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},oc={class:"itemsb-main"},rc={class:"itemsb-row"},ic={class:"itemsb-title truncate"},sc={class:"itemsb-time"},lc={class:"itemsb-sub"},cc={class:"items-attendant"},dc={class:"itemsb-content"},uc={key:0,class:"itemsb-actions"},fc=["disabled"],mc={key:0,class:"loading-spinner"},hc={class:"event-left"},pc={class:"event-line"},gc={class:"event-actions"},yc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},kc={class:"sched-pop__card bg-base-300",role:"dialog"},xc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},bc={class:"sched-pop__card bg-base-300",role:"dialog"},wc={class:"event-time"},Ec={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},vc={key:1,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Cc=["disabled"],Sc={key:0,class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},Bc={key:1,class:"loading-spinner"},Va=Ce({__name:"EventItem",props:{ev:{type:Object,required:!0},mode:{type:String,default:"compact"},getEventColor:{type:Function,default:null},viewOnly:{type:Boolean,default:!1}},emits:["open-message","open-chat","delete-message"],setup(t,{emit:n}){const a=Yt(),o=t,r=e.computed(()=>(o.getEventColor||Rn)(o.ev)),i=e.computed(()=>{var u;return((u=o.ev)==null?void 0:u.type)==="scheduled_messages"}),s=e.computed(()=>a.attendants.find(u=>u.is_me)||{}),l=u=>{const c=a.attendants.find(h=>h.id===u);return c?c.id===s.value.id?"Você":c.name||"Desconhecido":"Desconhecido"},d=e.computed(()=>{var c,h;const u=[];return(c=o.ev)!=null&&c.contactName&&u.push(o.ev.contactName),u.push(((h=o.ev)==null?void 0:h.departmentName)||"sem depto"),u.join(" • ")});return(u,c)=>{var h,m,p,f,g,y;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",_2,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",R2,[e.createElementVNode("div",H2,e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("div",z2,[e.createElementVNode("span",j2,[c[9]||(c[9]=e.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("footer",G2,[e.createElementVNode("div",I2,[e.createElementVNode("div",q2,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",W2,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["status-bar",(h=t.ev)!=null&&h.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",U2,[c[10]||(c[10]=e.createElementVNode("strong",null,"Status",-1)),c[11]||(c[11]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])]),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[0]||(c[0]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((m=t.ev)==null?void 0:m.status)===!0?(e.openBlock(),e.createElementBlock("svg",Z2,[...c[12]||(c[12]=[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Y2,[...c[13]||(c[13]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])]))])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[1]||(c[1]=k=>u.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",K2,[...c[14]||(c[14]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",Q2)):e.createCommentVNode("",!0)],8,X2)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[2]||(c[2]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[15]||(c[15]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)])])])],64)):t.mode==="sidebar"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",J2,[e.createElementVNode("div",{class:"avatar-wrap",style:e.normalizeStyle({boxShadow:`0 0 0 1px ${r.value}`})},[t.ev.contactPhoto?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.ev.contactPhoto,alt:"",class:"avatar",loading:"lazy"},null,8,ec)):(e.openBlock(),e.createElementBlock("div",tc,[...c[16]||(c[16]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",class:"icon-5 icon-muted"},[e.createElementVNode("path",{fill:"currentColor",d:"M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5m0 2c-4 0-8 2-8 4v2h16v-2c0-2-4-4-8-4Z"})],-1)])])),e.createElementVNode("div",nc,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-dot-avatar",(p=t.ev)!=null&&p.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",ac,[c[17]||(c[17]=e.createElementVNode("strong",null,"Status",-1)),c[18]||(c[18]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])],4),e.createElementVNode("div",oc,[e.createElementVNode("div",rc,[e.createElementVNode("span",ic,e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("span",sc,e.toDisplayString(t.ev.time),1)]),e.createElementVNode("div",lc,[e.createElementVNode("span",cc,[c[19]||(c[19]=e.createElementVNode("svg",{class:"icon-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z"})],-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])])])]),e.createElementVNode("p",dc,e.toDisplayString(t.ev.content||t.ev.title),1),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",uc,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:c[3]||(c[3]=k=>u.$emit("open-message",t.ev))},e.toDisplayString(((f=t.ev)==null?void 0:f.status)===!0?"Editar":"Visualizar"),1)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[4]||(c[4]=k=>u.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--sm cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",mc)):e.createCommentVNode("",!0),c[20]||(c[20]=e.createTextVNode(" Apagar ",-1))],8,fc)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:c[5]||(c[5]=k=>u.$emit("open-chat",t.ev))}," Abrir conversa ")):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",hc,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",pc,e.toDisplayString(d.value),1)]),e.createElementVNode("footer",gc,[e.createElementVNode("div",yc,[c[23]||(c[23]=e.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a7 7 0 0 0-7 7 3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1a1 1 0 0 0 1-1V9a5 5 0 1 1 10 0v7.083A2.919 2.919 0 0 1 14.083 19H14a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h1a2 2 0 0 0 1.732-1h.351a4.917 4.917 0 0 0 4.83-4H19a3 3 0 0 0 3-3v-2a3 3 0 0 0-3-3 7 7 0 0 0-7-7Zm1.45 3.275a4 4 0 0 0-4.352.976 1 1 0 0 0 1.452 1.376 2.001 2.001 0 0 1 2.836-.067 1 1 0 1 0 1.386-1.442 4 4 0 0 0-1.321-.843Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",kc,[c[21]||(c[21]=e.createElementVNode("strong",null,"Agendado por",-1)),c[22]||(c[22]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",xc,[t.ev.status!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-bar",(g=t.ev)!=null&&g.status?"status--up":"status--down"])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[c[24]||(c[24]=e.createElementVNode("strong",null,"Status",-1)),c[25]||(c[25]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",wc,e.toDisplayString(t.ev.time),1),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c[6]||(c[6]=k=>u.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((y=t.ev)==null?void 0:y.status)===!0?(e.openBlock(),e.createElementBlock("svg",Ec,[...c[26]||(c[26]=[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",vc,[...c[27]||(c[27]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.998 7.78C6.729 6.345 9.198 5 12 5c2.802 0 5.27 1.345 7.002 2.78a12.713 12.713 0 0 1 2.096 2.183c.253 .344 .465 .682 .618 .997 .14 .286 .284 .658 .284 1.04s-.145 .754 -.284 1.04a6.6 6.6 0 0 1-.618 .997 12.712 12.712 0 0 1-2.096 2.183C17.271 17.655 14.802 19 12 19c-2.802 0-5.27-1.345-7.002-2.78a12.712 12.712 0 0 1-2.096-2.183 6.6 6.6 0 0 1-.618-.997C2.144 12.754 2 12.382 2 12s.145-.754 .284-1.04c.153-.315 .365-.653 .618-.997A12.714 12.714 0 0 1 4.998 7.78ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","clip-rule":"evenodd"},null,-1)])]))])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c[7]||(c[7]=k=>u.$emit("delete-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--danger","aria-label":"Apagar evento",disabled:t.ev.deleteLoading||!t.ev.status},[t.ev.deleteLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Sc,[...c[28]||(c[28]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z","clip-rule":"evenodd"},null,-1)])])),t.ev.deleteLoading?(e.openBlock(),e.createElementBlock("div",Bc)):e.createCommentVNode("",!0)],8,Cc)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:c[8]||(c[8]=k=>u.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},[...c[29]||(c[29]=[e.createElementVNode("svg",{class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.559 4.544c.355-.35.834-.544 1.33-.544H19.11c.496 0 .975.194 1.33.544.356.35.559.829.559 1.331v9.25c0 .502-.203.981-.559 1.331-.355.35-.834.544-1.33.544H15.5l-2.7 3.6a1 1 0 0 1-1.6 0L8.5 17H4.889c-.496 0-.975-.194-1.33-.544A1.868 1.868 0 0 1 3 15.125v-9.25c0-.502.203-.981.559-1.331ZM7.556 7.5a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Zm0 3.5a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2H7.556Z","clip-rule":"evenodd"})],-1)])])])],64))}}},[["__scopeId","data-v-ba8ebbe5"]]),St=new Map,hr=Dt.defineStore("scheduled",{state:()=>({baseUrl:L0,monthCache:{},loadingYM:new Set,errorByYM:{},loadedYM:new Set,filters:{}}),getters:{eventsOf:t=>n=>t.monthCache[n]||[],isLoading:t=>n=>t.loadingYM.has(n),errorOf:t=>n=>t.errorByYM[n]||""},actions:{setBaseUrl(t){this.baseUrl=t||"/crm_scheduled"},_setMonth(t,n){this.monthCache={...this.monthCache,[t]:n||[]}},_deleteMonth(t){const{[t]:n,...a}=this.monthCache;this.monthCache=a,this.loadingYM.delete(t);const{[t]:o,...r}=this.errorByYM;this.errorByYM=r,this.loadedYM.delete(t)},coerceHttps(t){return t&&t.startsWith("http://")?t.replace(/^http:\/\//i,"https://"):t},_appendMonth(t,n){if(!n||n.length===0)return;this.monthCache[t]||(this.monthCache[t]=[]);const a=new Set(this.monthCache[t].map(o=>o==null?void 0:o.id));for(const o of n)o&&(o.id&&a.has(o.id)||this.monthCache[t].push(o))},async ensureMonthLoaded(t){if(t||(t=Zt(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if(St.has(n))return St.get(n);this.loadingYM.add(t),this.errorByYM={...this.errorByYM,[t]:""};const a=(async()=>{var o,r;try{const i=`${this.baseUrl}?year_month=${encodeURIComponent(t)}&page_size=10`,s=await at.get(i),l=Array.isArray(s==null?void 0:s.data)?s.data:((o=s==null?void 0:s.data)==null?void 0:o.results)||[],d=ur(l||[]);this._setMonth(t,d),this.loadedYM.add(t);let u=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);u&&(async()=>{var c,h;try{let m=u;for(;m;){const p=await at.get(m),f=Array.isArray(p==null?void 0:p.data)?p.data:((c=p==null?void 0:p.data)==null?void 0:c.results)||[],g=ur(f||[]);this._appendMonth(t,g),m=this.coerceHttps(((h=p==null?void 0:p.data)==null?void 0:h.next)||null)}}catch(m){console.warn("[scheduled] background paging error:",(m==null?void 0:m.message)||m)}})()}catch(i){const s=String((i==null?void 0:i.message)||i);throw this.errorByYM={...this.errorByYM,[t]:s},console.error("[scheduled] fetch error",t,s),this._setMonth(t,[]),this.loadedYM.delete(t),i}finally{St.delete(n),this.loadingYM.delete(t)}})();return St.set(n,a),a},async forceReload(t){t||(t=Zt(new Date));const n=`${this.baseUrl}|${t}`;St.delete(n),this._deleteMonth(t),this.loadedYM.delete(t),await this.ensureMonthLoaded(t)},findEventById(t){const n=String(t);for(const[a,o]of Object.entries(this.monthCache)){const r=(o||[]).findIndex(i=>{var d;const s=((d=i==null?void 0:i.raw)==null?void 0:d.id)!=null?String(i.raw.id):null,l=(i==null?void 0:i.id)!=null?String(i.id):null;return s===n||l===n});if(r!==-1)return{ym:a,idx:r}}return null},applyUpdateToCache({id:t,params:n}){var m,p,f,g,y,k,w,E,v,M,A,R,S;let a=null;if((m=n==null?void 0:n.schedule)!=null&&m.time){const x=n.schedule.time,N=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(x);if(N){const[,L,F,B,C="00",O="00"]=N;a=new Date(Number(L),Number(F)-1,Number(B),Number(C),Number(O),0,0)}else{const L=typeof x=="string"&&!x.includes("T")?x.replace(" ","T"):x;a=new Date(L)}}console.log(n);const o=x=>{var N,L,F,B;return a instanceof Date&&!isNaN(a)&&(x.date=a,x.time=_n(a)),((L=(N=n==null?void 0:n.message)==null?void 0:N[0])==null?void 0:L.content)!=null&&(x.content=n.message[0].content),x.raw=x.raw||{id:t},x.raw.params=x.raw.params||{},n!=null&&n.schedule&&(x.raw.params.schedule={...x.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(x.raw.params.scheduled_by=n.scheduled_by),n.department&&(x.raw.params.department=n.department),n!=null&&n.message&&(x.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(x.chatId=n.chat_id??x.chatId??""),n!=null&&n.entity&&(x.raw.params.entity={...x.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(x.contactName=n.entity.name??x.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(x.contactPhoto=n.entity.photo??x.contactPhoto??null,n.entity.photo&&(x.photo=n.entity.photo))),n!=null&&n.info&&(x.raw.params.info={...x.raw.params.info||{},...n.info},(F=n.info)!=null&&F.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(x.departmentName=n.info.department.name??x.departmentName),(B=n.info)!=null&&B.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(x.instanceName=n.info.instance.name??x.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(x.instanceStatus=n.info.instance.last_instance_status??x.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?x.title=n.title??x.title??"Mensagem programada":x.title=x.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(x.function=n.function??x.function??"scheduled_messages",x.type=n.function??x.type??"scheduled_messages"):(x.function=x.function||"scheduled_messages",x.type=x.type||"scheduled_messages"),x},r=this.findEventById(t);if(!r){const x=a instanceof Date&&!isNaN(a)?a:(()=>{var O;const B=(O=n==null?void 0:n.schedule)==null?void 0:O.time,C=typeof B=="string"&&!B.includes("T")?B.replace(" ","T"):B;return(mn==null?void 0:mn(C))||(C?new Date(C):new Date)})(),N=o({id:t,date:x,time:_n(x),title:(n==null?void 0:n.title)||"Mensagem programada",type:(n==null?void 0:n.function)||"scheduled_messages",status:(n==null?void 0:n.status)||"true",scheduled_by:(n==null?void 0:n.scheduled_by)||null,function:(n==null?void 0:n.function)||"scheduled_messages",content:((f=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:f.content)??"",raw:{id:t,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((y=n==null?void 0:n.entity)==null?void 0:y.photo)??null,departmentName:((w=(k=n==null?void 0:n.info)==null?void 0:k.department)==null?void 0:w.name)??null,departmentId:((v=(E=n==null?void 0:n.info)==null?void 0:E.department)==null?void 0:v.id)??null,instanceName:((A=(M=n==null?void 0:n.info)==null?void 0:M.instance)==null?void 0:A.name)??null,instanceStatus:((S=(R=n==null?void 0:n.info)==null?void 0:R.instance)==null?void 0:S.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),L=Zt(N.date),F=this.monthCache[L]?[...this.monthCache[L],N]:[N];F.sort((B,C)=>B.date-C.date),this._setMonth(L,F);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],d={...l[s]},u=o({...d}),c=u.date instanceof Date?u.date:d.date,h=Zt(c);if(h===i){const x=[...l];x.splice(s,1,u),x.sort((N,L)=>N.date-L.date),this._setMonth(i,x)}else{const x=l.slice(0,s).concat(l.slice(s+1)),N=this.monthCache[h]?[...this.monthCache[h],u]:[u];N.sort((L,F)=>L.date-F.date),this.monthCache={...this.monthCache,[i]:x,[h]:N}}},removeFromCache(t){const n=this.findEventById(t);if(!n)return!1;const{ym:a,idx:o}=n,r=this.monthCache[a]||[],i=r.slice(0,o).concat(r.slice(o+1));return this._setMonth(a,i),!0},insertNormalizedEvent(t){if(!t)return;const n=String(t.id),a=t.date instanceof Date?t.date:mn(t.date)||new Date,o=Zt(a),r={...t,id:n,date:a,time:t.time??_n(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var d;return String(((d=l==null?void 0:l.raw)==null?void 0:d.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,d)=>l.date-d.date),this._setMonth(o,i)},insertFromApiItem(t){const n=Ba(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=Ba(n);a&&this.insertNormalizedEvent(a)}},insertFromApiPage(t){const n=Array.isArray(t)?t:(t==null?void 0:t.results)||[];this.insertManyFromApi(n)},insertFromParams(t){return this.applyUpdateToCache(t)},hasEvent(t){return!!this.findEventById(t)},resetAll(){var t;this.monthCache={},this.loadingYM=new Set,this.errorByYM={},this.loadedYM=new Set,(t=St.clear)==null||t.call(St)}}}),Vc={class:"cpk-header bg-base-200"},Mc={class:"left"},Nc=["title"],Ac={class:"right"},Tc=["title"],Dc={class:"toggle"},Fc=["aria-pressed","title"],Lc={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},$c={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Pc=Ce({__name:"CalHeader",props:{month:String,year:[String,Number],isCompact:Boolean,viewMode:{type:String,default:"calendar"},filterCount:{type:Number,default:0}},emits:["prev","next","today","toggle-compact","set-view-mode","close-page","open-filter"],setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("header",Vc,[e.createElementVNode("div",Mc,[e.createElementVNode("button",{onClick:a[0]||(a[0]=o=>n.$emit("close-page")),class:"cyber-button cyber-button--sm btn-ghost nav hide-md-up","aria-label":"Fechar"},[...a[8]||(a[8]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[1]||(a[1]=o=>n.$emit("prev")),"aria-label":"Mês anterior"},[...a[9]||(a[9]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M15.5 19 9 12l6.5-7 1.5 1.3L12.3 12l4.7 5.7z"})],-1),e.createElementVNode("span",{class:"label-md"},"Anterior",-1)])]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent today",onClick:a[2]||(a[2]=o=>n.$emit("today")),"aria-label":"Hoje"},[...a[10]||(a[10]=[e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor",d:"M11.6643 2.05648c.0197-.00699.1589-.05645.3357-.05645.1768 0 .316.04946.3357.05645l.0019.00067c.0461.01577.0846.03229.1092.04332.0514.02304.1015.04898.1449.07268.0896.04898.1957.11302.3102.18855.2291.15109.521.36725.8121.63689C14.247 3.49218 15 4.37 15 5.50003c0 1.12688-.7447 2.00396-1.2779 2.49995-.2531.23541-.5075.43043-.7221.57742V10h5c.5523 0 1 .4477 1 1v3h-4c-.0568 0-.1125.0048-.1667.0139-.0542-.0091-.1099-.0139-.1667-.0139H5v-3c0-.5523.44772-1 1-1h5V8.57622c-.2139-.14666-.4676-.34115-.7202-.57589C9.74664 7.50489 9 6.62764 9 5.50003c0-1.13003.753-2.00785 1.286-2.50144.2911-.26964.583-.4858.8121-.63689.1145-.07553.2206-.13957.3102-.18855.0434-.0237.0935-.04964.1449-.07268.0246-.01103.0631-.02755.1092-.04332l.0019-.00067ZM4 17.8377V21c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2.8243c-.0609.0534-.1248.1054-.1917.1556-.56.42-1.274.6687-2.1416.6687-.8677 0-1.5817-.2487-2.1417-.6687-.281-.2108-.5081-.4531-.6917-.7045-.1835.2514-.4106.4937-.6917.7045-.5599.42-1.2739.6687-2.1416.6687-.8677 0-1.5817-.2487-2.14169-.6687-.20142-.1511-.37514-.3184-.52499-.4936-.14984.1752-.32356.3425-.52499.4936-.55999.42-1.27398.6687-2.14166.6687s-1.58168-.2487-2.14167-.6687c-.20143-.1511-.37515-.3184-.525-.4936ZM5.2078 16c.0124.0314.0255.0628.03934.0939.11841.2664.27553.4856.47786.6374.19001.1425.47602.2687.94167.2687s.75165-.1262.94166-.2687c.20234-.1518.35945-.371.47786-.6374.01384-.0311.02694-.0625.03934-.0939H5.2078Zm5.3727.0939c-.0139-.0311-.027-.0625-.0394-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4778-.6374Zm5.6666 0c-.0138-.0311-.0269-.0625-.0393-.0939h2.9177c-.0124.0314-.0255.0628-.0393.0939-.1184.2664-.2755.4856-.4779.6374-.19.1425-.476.2687-.9416.2687-.4657 0-.7517-.1262-.9417-.2687-.2023-.1518-.3594-.371-.4779-.6374Z"})],-1),e.createElementVNode("span",{class:"label-md"},"Hoje",-1)])]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost nav",onClick:a[3]||(a[3]=o=>n.$emit("next")),"aria-label":"Próximo mês"},[...a[11]||(a[11]=[e.createElementVNode("span",{class:"label-md"},"Próximo",-1),e.createElementVNode("svg",{class:"icon-4",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M8 19l6.5-7L8 5l-1.5 1.3L11.7 12 6.5 17.7z"})],-1)])])]),e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,Nc),e.createElementVNode("div",Ac,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm btn-ghost filter-btn",title:"Filtro de eventos",onClick:a[4]||(a[4]=o=>n.$emit("open-filter",o))},[a[12]||(a[12]=e.createElementVNode("svg",{class:"icon-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M5.05 3C3.291 3 2.352 5.024 3.51 6.317l5.422 6.059v4.874c0 .472.227.917.613 1.2l3.069 2.25c1.01.742 2.454.036 2.454-1.2v-7.124l5.422-6.059C21.647 5.024 20.708 3 18.95 3H5.05Z"})],-1)),t.filterCount>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:"filter-badge",title:`${t.filterCount} filtro${t.filterCount>1?"s":""} ativo${t.filterCount>1?"s":""}`},e.toDisplayString(t.filterCount),9,Tc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.viewMode==="calendar"?"is-active":""]),onClick:a[5]||(a[5]=o=>n.$emit("set-view-mode","calendar")),"aria-label":"Visão Calendário"},[...a[13]||(a[13]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M5 5a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1h1a1 1 0 0 0 1-1 1 1 0 1 1 2 0 1 1 0 0 0 1 1 2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a2 2 0 0 1 2-2ZM3 19v-7a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",{class:"label-lg"},"Calendário",-1)])],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--sm btn-ghost",t.viewMode==="agenda"?"is-active":""]),onClick:a[6]||(a[6]=o=>n.$emit("set-view-mode","agenda")),"aria-label":"Visão Agenda"},[...a[14]||(a[14]=[e.createElementVNode("svg",{class:"icon-5",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11 4.717c-2.286-.58-4.16-.756-7.045-.71A1.99 1.99 0 0 0 2 6v11c0 1.133.934 2.022 2.044 2.007 2.759-.38 4.5-.182 6.956.449V4.717Zm2 15.081c2.456-.631 4.198-.829 6.956-.791A2.013 2.013 0 0 0 22 16.999V6a1.99 1.99 0 0 0-1.955-1.993c-2.885-.046-4.76.13-7.045.71v15.081Z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",{class:"label-lg"},"Agenda",-1)])],2)]),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm show-lg btn-ghost",onClick:a[7]||(a[7]=o=>n.$emit("toggle-compact")),"aria-pressed":t.isCompact,title:t.isCompact?"Sair do modo compacto":"Ativar modo compacto"},[t.isCompact?(e.openBlock(),e.createElementBlock("svg",$c,[...a[16]||(a[16]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4H4m0 0v4m0-4 5 5m7-5h4m0 0v4m0-4-5 5M8 20H4m0 0v-4m0 4 5-5m7 5h4m0 0v-4m0 4-5-5"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Lc,[...a[15]||(a[15]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8h4V4m12 4h-4V4M4 16h4v4m12-4h-4v4"},null,-1)])]))],8,Fc)])]))}},[["__scopeId","data-v-37b625a5"]]),Oc=["title"],_c={class:"week-header"},Rc=Ce({__name:"WeekDays",props:{weekDays:{type:Array,default:()=>[]},month:String,year:[String,Number]},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h2",{class:"month-title",title:`${t.month} ${t.year}`},e.toDisplayString(t.month)+" "+e.toDisplayString(t.year),9,Oc),e.createElementVNode("div",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.weekDays,o=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"week-cell"},e.toDisplayString(o),1))),128))])],64))}},[["__scopeId","data-v-756165d9"]]),Hc=["onClick"],zc={key:0,class:"cell-today-indicator show-lg"},jc={class:"cell-top"},Gc={class:"day-number"},Ic={key:1,class:"more"},qc={class:"bars-wrap"},Wc=4,Uc=8,pr=4,gr=2,Zc=1,Yc=Ce({__name:"CalendarGrid",props:{startOffset:Number,monthDays:Array,viewDate:Date,isCompact:Boolean,isSameMonthFn:Function,isSelectedDayFn:Function,isTodayFn:Function,selectDayFn:Function,eventsByDayFn:Function,dayEventCountFn:Function,eventBarsToShowFn:Function,dayEventOverflowFn:Function},setup(t){const n=t,a=e.ref({}),o=new Map;function r(f){const g=(f==null?void 0:f.clientWidth)||0,y=(f==null?void 0:f.clientHeight)||0;if(!g||!y)return{cols:0,rows:0,widths:[],sum:0};const k=Math.max(0,Math.floor((g+pr)/(Wc+pr))),w=Math.max(0,Math.floor((y+gr)/(Uc+gr))),E=l(k,w),v=E.reduce((M,A)=>M+A,0);return{cols:k,rows:w,widths:E,sum:v}}function i(f,g){const y=r(g),k=a.value[f];(!k||k.cols!==y.cols||k.rows!==y.rows||k.sum!==y.sum)&&(a.value={...a.value,[f]:y})}function s(f,g){if(!g){const k=o.get(f);if(k&&(k.disconnect(),o.delete(f)),a.value[f]!=null){const w={...a.value};delete w[f],a.value=w}return}i(f,g);const y=new ResizeObserver(()=>i(f,g));y.observe(g),o.set(f,y)}e.onBeforeUnmount(()=>{o.forEach(f=>f.disconnect()),o.clear()});function l(f,g){if(f<=0||g<=0)return[];const y=[],k=.25;for(let w=0;w<g;w++){const E=w/Math.max(1,g-1),v=k+(1-k)*E,M=Math.max(1,Math.round(f*v));y.push(Math.min(M,f))}return y}function d(f,g){var v;const y=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,k=((v=a.value[f])==null?void 0:v.sum)??0;if(y<=k)return{bars:y,overflow:0};const w=Math.max(0,k-Zc),E=Math.max(0,y-w);return{bars:w,overflow:E}}function u(f,g){const y=a.value[f];if(!y||y.rows===0||y.cols===0)return[];const{widths:k}=y,E=d(f,g).bars,v=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,E):[])||[],M=k.map(()=>[]);let A=0;for(let R=k.length-1;R>=0&&A<v.length;R--){const S=Math.min(k[R],v.length-A);M[R]=v.slice(A,A+S),A+=S}return M}const c=e.ref(null);function h(f){return f&&f.nodeType===1&&typeof f.getBoundingClientRect=="function"}function m(f){if(!h(f))return;const g=c.value,y=g&&h(g)?g:f.offsetParent;if(!h(y))return;let k,w;try{k=f.getBoundingClientRect(),w=y.getBoundingClientRect()}catch{return}const E=y.scrollLeft||0,v=y.scrollTop||0;f.style.position="absolute",f.style.zIndex="0",f.style.top=`${k.top-w.top+v}px`,f.style.left=`${k.left-w.left+E}px`,f.style.width=`${k.width}px`,f.style.height=`${k.height}px`,f.style.pointerEvents="none"}function p(f){!f||!f.style||requestAnimationFrame(()=>{!f||!f.style||(f.style.position="",f.style.zIndex="",f.style.top="",f.style.left="",f.style.width="",f.style.height="",f.style.pointerEvents="")})}return(f,g)=>(e.openBlock(),e.createBlock(e.TransitionGroup,{name:"cal-fade","move-class":"cal-move",tag:"div",class:"cal-grid calendar-grid",appear:"",ref_key:"gridRef",ref:c,onBeforeLeave:m,onAfterLeave:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.startOffset,y=>(e.openBlock(),e.createElementBlock("div",{key:"x"+y,class:"cal-cell day-empty bg-base-300 border border-base-100"}))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.monthDays,(y,k)=>(e.openBlock(),e.createElementBlock("div",{key:y.key,style:e.normalizeStyle({"--i":k}),class:e.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[t.isSameMonthFn(y.date,t.viewDate)?"":"opacity-60",t.isSelectedDayFn(y.date)?"neon-selected":"",t.isTodayFn(y.date)?"is-today":"",t.dayEventCountFn(y.date)>0?"has-events":""]]),onClick:w=>t.selectDayFn(y.date)},[t.isTodayFn(y.date)?(e.openBlock(),e.createElementBlock("div",zc," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",jc,[e.createElementVNode("span",Gc,e.toDisplayString(y.date.getDate()),1)]),d(y.key,y.date).overflow>0?(e.openBlock(),e.createElementBlock("span",Ic," +"+e.toDisplayString(d(y.key,y.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",qc,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:w=>s(y.key,w)},[d(y.key,y.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u(y.key,y.date),(w,E)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+E,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w,(v,M)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+E+"-"+M,class:"vbar",style:e.normalizeStyle({background:e.unref(Rn)(v),boxShadow:`0 0 8px ${e.unref(Rn)(v)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,Hc))),128))]),_:1},512))}},[["__scopeId","data-v-26af06b5"]]),Xc={class:"agenda-section"},Kc={key:0,class:"empty-state"},Qc={key:1,class:"day-list"},Jc={class:"date-trail"},ed={class:"weekday-short"},td={class:"date-pill bg-base-200 border border-base-300"},nd={class:"date-pill-month"},ad={class:"date-pill-day"},od={class:"content-col"},rd={class:"day-header"},id={class:"agenda-title"},sd={class:"month-header-text"},ld={class:"events-list"},cd=Ce({__name:"AgendaList",props:{days:{type:Array,default:()=>[]},weekdayLong:Function,weekdayShort:Function,monthShort:Function,monthLabelOf:Function,year:Number},emits:["open-chat","open-message","delete-message"],setup(t,{emit:n}){return(a,o)=>(e.openBlock(),e.createElementBlock("section",Xc,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",Kc," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",Qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.days,r=>{var i;return e.openBlock(),e.createElementBlock("li",{key:r.key,class:"day-item border-base-200"},[e.createElementVNode("div",Jc,[e.createElementVNode("div",ed,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",td,[e.createElementVNode("div",nd,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",ad,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(Rn)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",od,[e.createElementVNode("div",rd,[e.createElementVNode("h3",id,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",sd,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.events,s=>(e.openBlock(),e.createElementBlock("li",{key:s.id,class:"event-item border border-base-100 bg-base-200 hover:bg-base-100"},[e.createVNode(Va,{ev:s,mode:"agenda",onOpenMessage:o[0]||(o[0]=l=>a.$emit("open-message",l)),onOpenChat:o[1]||(o[1]=l=>a.$emit("open-chat",l)),onDeleteMessage:o[2]||(o[2]=l=>a.$emit("delete-message",l))},null,8,["ev"])]))),128))])])])}),128))]))]))}},[["__scopeId","data-v-2c977f25"]]),dd=["data-mode","data-empty"],ud=["disabled"],yr=Ce({__name:"EventsList",props:{loading:{type:Boolean,default:!1},selectedLabel:{type:String,default:""},selectedLabelLong:{type:String,default:""},events:{type:Array,default:()=>[]},mode:{type:String,default:"compact"}},emits:["reload","open-chat","open-message","delete-message"],setup(t){const n=t,a=e.computed(()=>n.mode==="compact"?n.selectedLabelLong||"Hoje":`Eventos em ${n.selectedLabel||"—"}`);return(o,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["bg-base-300 daylist",[t.mode==="compact"?"daylist--compact has-border border-base-200":"daylist--sidebar has-border border-base-200 supports-blur",{"daylist--tight":t.mode==="compact"&&!t.loading&&t.events.length===0}]]),"data-mode":t.mode,"data-empty":!t.loading&&t.events.length===0?"1":"0"},[e.createElementVNode("div",{class:e.normalizeClass(["daylist-header",t.mode==="compact"?"daylist-header--compact bg-base-300":"daylist-header--sidebar bg-base-300"])},[e.createElementVNode("h3",{class:e.normalizeClass(t.mode==="compact"?"daylist-title--compact":"daylist-title--sidebar")},e.toDisplayString(a.value),3),e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:r[0]||(r[0]=i=>o.$emit("reload")),disabled:t.loading},e.toDisplayString(t.loading?"Atualizando…":"Atualizar"),9,ud)],2),t.loading?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:"fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["loading-text",t.mode==="compact"?"is-compact":"is-sidebar"])}," Carregando… ",2)]),_:1})):t.events.length===0?(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"fade"},{default:e.withCtx(()=>[...r[4]||(r[4]=[e.createElementVNode("div",{class:"empty-text"},"Sem eventos.",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.TransitionGroup,{key:2,name:"list","move-class":"list-move",tag:"ul",appear:"",class:e.normalizeClass([t.mode==="compact"?"list-compact has-border border-base-300 bg-base-200 supports-blur":"list-sidebar"])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.events,(i,s)=>(e.openBlock(),e.createElementBlock("li",{key:i.id,style:e.normalizeStyle({"--i":s}),class:e.normalizeClass(t.mode==="compact"?"item-compact hover:bg-base-100":"item-sidebar hover:z-10 has-border hover:bg-base-100 border-base-100 bg-base-200 ")},[e.createVNode(Va,{ev:i,mode:t.mode==="compact"?"compact":"sidebar",onOpenMessage:r[1]||(r[1]=l=>o.$emit("open-message",l)),onOpenChat:r[2]||(r[2]=l=>o.$emit("open-chat",l)),onDeleteMessage:r[3]||(r[3]=l=>o.$emit("delete-message",l))},null,8,["ev","mode"])],6))),128))]),_:1},8,["class"]))],10,dd))}},[["__scopeId","data-v-4ecbf2a5"]]),fd={class:"cpk-popover__header border-base-100"},md={class:"filter-body"},hd={class:"row"},pd=["checked"],gd={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},yd={class:"status-wrap"},kd={class:"seg"},xd=Ce({__name:"CalFilter",props:{open:{type:Boolean,default:!1},anchorEl:{type:[HTMLElement,Object],default:null},offset:{type:Number,default:8},align:{type:String,default:"center"},filters:{type:Object,default:()=>({})}},emits:["close","update:filters"],setup(t,{emit:n}){const a=t,o=n,r=Yt(),i=e.computed(()=>r.attendants.find(S=>S.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async S=>{var L,F,B;if(!S)return;await e.nextTick();const x=(L=i.value)!=null&&L.id?String(i.value.id):null;s.onlyMine=!!x&&String(((F=a.filters)==null?void 0:F.scheduled_by)??"")===x;const N=(B=a.filters)==null?void 0:B.status;s.status=N===!0||N===!1?N:null,y()},{immediate:!1});function l(S,x){if(!S)return{};const{[x]:N,...L}=S;return L}function d(S){var N;s.onlyMine=!!S.target.checked;const x=(N=i.value)!=null&&N.id?String(i.value.id):null;s.onlyMine&&x?o("update:filters",{...a.filters,scheduled_by:x}):o("update:filters",l(a.filters,"scheduled_by"))}function u(S){if(s.status===S){s.status=null;const x=l(a.filters,"status");o("update:filters",x)}else s.status=S,o("update:filters",{...a.filters,status:S})}const c=e.ref(null),h=e.ref({left:0,top:0,placed:"bottom"}),m=e.computed(()=>({position:"fixed",left:`${h.value.left}px`,top:`${h.value.top}px`}));function p(){const S=a.anchorEl instanceof Element?a.anchorEl:null;if(S!=null&&S.getBoundingClientRect)return S.getBoundingClientRect();const x=window.innerWidth/2,N=window.innerHeight/3;return{left:x,right:x,top:N,bottom:N,width:0,height:0}}function f(S,x,N,L){return{left:Math.max(8,Math.min(S,window.innerWidth-N-8)),top:Math.max(8,Math.min(x,window.innerHeight-L-8))}}function g(){const S=p(),x=c.value,N=(x==null?void 0:x.offsetWidth)??300,L=(x==null?void 0:x.offsetHeight)??220;let F=S.bottom+a.offset,B;if(a.align==="center"?B=S.left+S.width/2-N/2:a.align==="end"?B=S.right-N:B=S.left,F+L>window.innerHeight-4){const O=S.top-L-a.offset;O>=4?(F=O,h.value.placed="top"):h.value.placed="bottom"}else h.value.placed="bottom";const C=f(B,F,N,L);h.value={left:C.left,top:C.top,placed:h.value.placed}}function y(){g(),requestAnimationFrame(g)}let k,w,E=[];function v(){M(),E=[window];const S=a.anchorEl instanceof Element?a.anchorEl:null;let x=S==null?void 0:S.parentElement;for(;x&&x!==document.body;){const N=getComputedStyle(x);/(auto|scroll)/.test(N.overflow+N.overflowY+N.overflowX)&&E.push(x),x=x.parentElement}E.forEach(N=>N.addEventListener("scroll",y,{passive:!0}))}function M(){E.forEach(S=>{var x;return(x=S.removeEventListener)==null?void 0:x.call(S,"scroll",y)}),E=[]}e.watch(()=>a.open,async S=>{var N,L,F,B;if(!S){M(),(N=k==null?void 0:k.disconnect)==null||N.call(k),(L=w==null?void 0:w.disconnect)==null||L.call(w);return}await e.nextTick(),y(),v(),(F=k==null?void 0:k.disconnect)==null||F.call(k),k=new ResizeObserver(y),k.observe(document.body),(B=w==null?void 0:w.disconnect)==null||B.call(w);const x=a.anchorEl instanceof Element?a.anchorEl:null;x&&(w=new ResizeObserver(y),w.observe(x)),window.addEventListener("resize",y)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),v(),y())});function A(S){S.key==="Escape"&&o("close")}function R(S){if(!a.open)return;const x=S.target,N=c.value;if(N&&N.contains(x))return;const L=a.anchorEl instanceof Element?a.anchorEl:null;L&&L.contains&&L.contains(x)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",R,!0),window.addEventListener("keydown",A)}),e.onBeforeUnmount(()=>{var S,x;document.removeEventListener("pointerdown",R,!0),window.removeEventListener("keydown",A),M(),(S=k==null?void 0:k.disconnect)==null||S.call(k),(x=w==null?void 0:w.disconnect)==null||x.call(w)}),(S,x)=>(e.openBlock(),e.createBlock(e.Transition,{name:"cpk-layer",appear:""},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cpk-popover-layer",onMousedown:x[4]||(x[4]=e.withModifiers(N=>S.$emit("close"),["self"]))},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:c,class:"cpk-popover bg-base-300",style:e.normalizeStyle(m.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",fd,[x[5]||(x[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),x[6]||(x[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:x[0]||(x[0]=N=>S.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",md,[e.createElementVNode("label",hd,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:x[1]||(x[1]=N=>d(N)),"aria-label":"Exibir somente meus eventos"},null,40,pd),x[7]||(x[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",gd,[x[9]||(x[9]=e.createElementVNode("span",{class:"status-icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})])],-1)),e.createElementVNode("div",yd,[x[8]||(x[8]=e.createElementVNode("div",{class:"label-cpk"},[e.createTextVNode(" Status "),e.createElementVNode("span",{class:"sched-pop",tabindex:"0","aria-label":"Ajuda sobre status"},[e.createElementVNode("span",{class:"sched-pop__mark"},[e.createElementVNode("svg",{class:"icon-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.008-3.018a1.502 1.502 0 0 1 2.522 1.159v.024a1.44 1.44 0 0 1-1.493 1.418 1 1 0 0 0-1.037.999V14a1 1 0 1 0 2 0v-.539a3.44 3.44 0 0 0 2.529-3.256 3.502 3.502 0 0 0-7-.255 1 1 0 0 0 2 .076c.014-.398.187-.774.48-1.044Zm.982 7.026a1 1 0 1 0 0 2H12a1 1 0 1 0 0-2h-.01Z","clip-rule":"evenodd"})])]),e.createElementVNode("div",{class:"sched-pop__card bg-base-300",style:{"--popover-brd":"var(--cyber-border)",transform:"translate(-5%, -50%) scale(0.98)"}},[e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Ativos:"),e.createTextVNode(" Eventos que estão programados para ocorrer ")]),e.createElementVNode("div",null,[e.createElementVNode("span",{style:{"font-weight":"600"}},"Executados:"),e.createTextVNode(" Eventos que já ocorreram ")])])])],-1)),e.createElementVNode("div",kd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:x[2]||(x[2]=N=>u(!0)),"aria-pressed":"state.status === true"}," Ativos ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!1?"is-active":""]),onClick:x[3]||(x[3]=N=>u(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-0aad9d42"]]),bd={class:"calendar-content"},wd={class:"calendar-stage-main"},Ed={key:0},kr=Ce({__name:"scheduledCalendar",props:{sourceUrl:{type:String,default:"/crm_scheduled"},initialDate:{type:[String,Date],default:()=>new Date}},emits:["open-chat","loaded","open-message","close-page"],setup(t,{expose:n,emit:a}){const o=t,r=hr();r.setBaseUrl(o.sourceUrl);const i=new Date,s=e.ref(u(o.initialDate)),l=e.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),d=e.ref("calendar");function u(b){if(b instanceof Date)return new Date(b.getFullYear(),b.getMonth(),1);if(typeof b=="string"){const[T,X]=b.split("-").map(ne=>parseInt(ne,10));return new Date(T||i.getFullYear(),(X||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function c(b){return new Date(b.getFullYear(),b.getMonth()+1,0).getDate()}function h(b){return new Date(b.getFullYear(),b.getMonth(),1).getDay()}function m(b,T){return b.getFullYear()===T.getFullYear()&&b.getMonth()===T.getMonth()}function p(b){return Sa(b,i)}function f(b){return Sa(b,l.value)}function g(b){l.value=new Date(b.getFullYear(),b.getMonth(),b.getDate()),m(b,s.value)||(s.value=new Date(b.getFullYear(),b.getMonth(),1))}function y(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function k(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function w(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const E=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],v=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],M=e.computed(()=>C(E[s.value.getMonth()])),A=e.computed(()=>s.value.getFullYear()),R=e.computed(()=>x(l.value)),S=e.computed(()=>`${N(l.value)} ${l.value.getDate()}`);function x(b){return`${String(b.getDate()).padStart(2,"0")}/${String(b.getMonth()+1).padStart(2,"0")}/${b.getFullYear()}`}function N(b){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][b.getDay()]}function L(b){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][b.getDay()]}function F(b){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][b.getMonth()]}function B(b){return E[b.getMonth()]}function C(b){return b.charAt(0).toUpperCase()+b.slice(1)}const O=e.computed(()=>h(s.value)),Z=e.computed(()=>{const b=c(s.value);return Array.from({length:b},(T,X)=>{const ne=X+1,se=new Date(s.value.getFullYear(),s.value.getMonth(),ne);return{key:`d${ne}`,date:se}})}),Q=e.ref({open:!1,anchorEl:null});function ee(b){Q.value.open=!0,Q.value.anchorEl=(b==null?void 0:b.currentTarget)||null}const{filters:P}=Dt.storeToRefs(r),H=e.computed(()=>Zt(s.value)),_=e.computed(()=>r.eventsOf(H.value)),oe={scheduled_by:b=>{var ne,se,fe;const T=(b==null?void 0:b.scheduled_by)??((se=(ne=b==null?void 0:b.raw)==null?void 0:ne.params)==null?void 0:se.scheduled_by)??((fe=b==null?void 0:b.raw)==null?void 0:fe.scheduled_by)??(b==null?void 0:b.created_by)??(b==null?void 0:b.attendant_id),X=typeof T=="object"&&T?T.id??T.attendant_id:T;return X!=null?String(X):""}};function de(b,T){const X=(T==null?void 0:T.value)??T;return!X||typeof X!="object"?!0:Object.entries(X).every(([ne,se])=>{var ve,Fe,xe;if(se==null||se===""||Array.isArray(se)&&se.length===0)return!0;const fe=oe[ne],me=(fe==null?void 0:fe(b))??(b==null?void 0:b[ne])??((ve=b==null?void 0:b.raw)==null?void 0:ve[ne])??((xe=(Fe=b==null?void 0:b.raw)==null?void 0:Fe.params)==null?void 0:xe[ne])??null,be=typeof me=="string"?me:me??"";if(typeof se=="function")return!!se(be,b);if(Array.isArray(se))return se.map(String).includes(String(be));if(typeof se=="object"){const{in:V,notIn:z,range:j,contains:D}=se;if(V&&!V.map(String).includes(String(be))||z&&z.map(String).includes(String(be)))return!1;if(j&&typeof be=="number"){const[G,W]=j;if(G!=null&&be<G||W!=null&&be>W)return!1}if(D!=null){const G=Array.isArray(be)?be:String(be).split(",");if(!(Array.isArray(D)?D:[D]).some(J=>G.map(String).includes(String(J))))return!1}return!0}return String(be)===String(se)})}const pe=e.computed(()=>(_.value||[]).filter(T=>de(T,P)));function ye(b){return pe.value.filter(T=>Sa(T.date,b))}const Ve=e.computed(()=>ye(l.value)),Le=e.computed(()=>[...Ve.value].sort((b,T)=>b.date-T.date));function Ae(b){return ye(b).length}function qe(b){return Math.min(3,Ae(b))}function _e(b){const T=Ae(b);return T>3?T-3:0}const $e=e.computed(()=>{const b=s.value.getFullYear(),T=s.value.getMonth(),X=new Map;for(const se of pe.value){const fe=se==null?void 0:se.date;if(!(fe instanceof Date)||fe.getFullYear()!==b||fe.getMonth()!==T)continue;const me=`${b}-${T+1}-${fe.getDate()}`;X.has(me)||X.set(me,{key:`ag-${me}`,date:new Date(b,T,fe.getDate()),events:[]}),X.get(me).events.push(se)}const ne=Array.from(X.values());for(const se of ne)se.events.sort((fe,me)=>fe.date-me.date);return ne.sort((se,fe)=>se.date-fe.date),ne}),Oe=e.ref(!1),ze=e.ref(!1),q=e.computed(()=>ze.value||Oe.value),re=e.computed(()=>q?"calendar-stage--compact":"calendar-stage--single");function he(){var X;const b=window.matchMedia("(max-width: 1280px)"),T=()=>ze.value=b.matches;T(),(X=b.addEventListener)==null||X.call(b,"change",T)}const ae=e.computed(()=>r.isLoading(H.value));e.computed(()=>r.errorOf(H.value));const K=e.ref({open:!1,loading:!1,context:null,title:"Confirmar exclusão",description:"Tem certeza que deseja apagar este item?",destructive:!0,anchorEl:null,confirmLabel:"Apagar",cancelLabel:"Cancelar",loadingLabel:"Apagando…"});function ce(b,T){K.value.open=!0,K.value.context={action:"delete-message",event:b},K.value.title="Confirmar exclusão",K.value.description="Tem certeza que deseja apagar este evento?",K.value.anchorEl=T&&T.currentTarget||typeof document<"u"&&document.activeElement||null,K.value.destructive=!0,K.value.confirmLabel="Apagar",K.value.loadingLabel="Apagando…"}async function $(b){if(b)try{K.value.loading=!0,b.action==="delete-message"&&await Y(b.event)}finally{K.value.loading=!1,K.value.open=!1,K.value.context=null}}function I(){K.value.open=!1,K.value.context=null}async function te(){await r.forceReload(H.value)}async function Y(b){var T;try{b.deleteLoading=!0;const X=((T=b==null?void 0:b.raw)==null?void 0:T.id)??(b==null?void 0:b.id)??b;if(X==null)throw new Error("Evento inválido para exclusão");const ne=await $2(F0,b);return ne!=null&&ne.ok&&(r.removeFromCache(String(X))||await r.forceReload(H.value)),ne}catch(X){return console.error(X),null}finally{b.deleteLoading=!1}}return e.onMounted(async()=>{if(he(),await r.ensureMonthLoaded(H.value),!ye(l.value).length&&pe.value.length){const b=pe.value[0];l.value=new Date(b.date.getFullYear(),b.date.getMonth(),b.date.getDate())}}),e.watch(()=>o.sourceUrl,async b=>{if(r.setBaseUrl(b),r.resetAll(),await r.ensureMonthLoaded(H.value),!ye(l.value).length&&pe.value.length){const T=pe.value[0];l.value=new Date(T.date.getFullYear(),T.date.getMonth(),T.date.getDate())}}),e.watch(H,async()=>{const b=s.value.getFullYear(),T=s.value.getMonth(),X=Math.min(l.value.getDate(),c(s.value));if(l.value=new Date(b,T,X),await r.ensureMonthLoaded(H.value),!ye(l.value).length&&pe.value.length){const ne=pe.value[0];l.value=new Date(ne.date.getFullYear(),ne.date.getMonth(),ne.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(b,T)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":q.value}])},[e.createElementVNode("div",bd,[T[15]||(T[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(Pc,{month:M.value,year:A.value,"is-compact":q.value,"view-mode":d.value,"filter-count":Object.keys(e.unref(P)).length,onPrev:y,onNext:k,onToday:w,onToggleCompact:T[0]||(T[0]=X=>Oe.value=!Oe.value),onSetViewMode:T[1]||(T[1]=X=>d.value=X),onClosePage:T[2]||(T[2]=X=>b.$emit("close-page")),onOpenFilter:ee},null,8,["month","year","is-compact","view-mode","filter-count"]),d.value==="calendar"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["calendar-stage",re.value])},[e.createElementVNode("div",wd,[e.createVNode(Rc,{"week-days":v,month:M.value,year:A.value},null,8,["month","year"]),e.createVNode(Yc,{"start-offset":O.value,"month-days":Z.value,"view-date":s.value,"is-compact":q.value,"is-same-month-fn":m,"is-selected-day-fn":f,"is-today-fn":p,"select-day-fn":g,"events-by-day-fn":ye,"day-event-count-fn":Ae,"event-bars-to-show-fn":qe,"day-event-overflow-fn":_e},null,8,["start-offset","month-days","view-date","is-compact"])]),q.value?(e.openBlock(),e.createBlock(yr,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:ae.value,"selected-label-long":S.value,events:Le.value,mode:"compact",onReload:te,onOpenChat:T[3]||(T[3]=X=>b.$emit("open-chat",X)),onOpenMessage:T[4]||(T[4]=X=>b.$emit("open-message",X)),onDeleteMessage:T[5]||(T[5]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(cd,{key:1,days:$e.value,"weekday-long":N,"weekday-short":L,"month-short":F,"month-label-of":B,year:A.value,onOpenChat:T[6]||(T[6]=X=>b.$emit("open-chat",X)),onOpenMessage:T[7]||(T[7]=X=>b.$emit("open-message",X)),onDeleteMessage:T[8]||(T[8]=(X,ne)=>ce(X,ne))},null,8,["days","year"]))]),e.createVNode(yr,{class:"calendar-daylist calendar-daylist--desktop",loading:ae.value,"selected-label":R.value,"selected-label-long":S.value,events:Le.value,mode:q.value?"compact":"sidebar",onReload:te,onOpenChat:T[9]||(T[9]=X=>b.$emit("open-chat",X)),onOpenMessage:T[10]||(T[10]=X=>b.$emit("open-message",X)),onDeleteMessage:T[11]||(T[11]=(X,ne)=>ce(X,ne))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(El,{modelValue:K.value.open,"onUpdate:modelValue":T[12]||(T[12]=X=>K.value.open=X),title:K.value.title,description:K.value.description,destructive:K.value.destructive,"confirm-label":K.value.confirmLabel,"cancel-label":K.value.cancelLabel,loading:K.value.loading,"loading-label":K.value.loadingLabel,context:K.value.context,"anchor-el":K.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:$,onCancel:I},{details:e.withCtx(()=>{var X;return[(X=K.value.context)!=null&&X.event?(e.openBlock(),e.createElementBlock("div",Ed,[e.createVNode(Va,{"view-only":!0,mode:"sidebar",ev:K.value.context.event},null,8,["ev"])])):e.createCommentVNode("",!0)]}),_:1},8,["modelValue","title","description","destructive","confirm-label","cancel-label","loading","loading-label","context","anchor-el"]),e.createVNode(xd,{open:Q.value.open,"anchor-el":Q.value.anchorEl,filters:e.unref(P),"onUpdate:filters":T[13]||(T[13]=X=>e.isRef(P)?P.value=X:null),onClose:T[14]||(T[14]=X=>Q.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-9c3b18ef"]]),vd={class:"flex flex-col text-center"},Cd={class:"flex flex-col space-y-3 justify-center"},Sd={class:"space-x-4 flex-col text-black justify-center"},Bd=["onUpdate:modelValue","onInput","onKeydown"],xr={__name:"mfa",props:{eventHandling:{type:String,default:null}},emits:["filled","reset"],setup(t,{emit:n}){e.onMounted(()=>{r.value[0].focus()});const a=n,o=e.ref(Array(6).fill("")),r=e.ref([]);e.ref(!1);const i=u=>{const c=o.value[u];o.value[0]<1&&a("reset"),/^\d$/.test(c)?s(u):o.value[u]="",u===o.value.length-1&&o.value.every(h=>h!=="")&&d()},s=u=>{u<o.value.length-1&&o.value[u]&&r.value[u+1].focus()},l=(u,c)=>{c.key==="Backspace"&&!o.value[u]&&u>0&&r.value[u-1].focus()},d=()=>{const u=o.value.join("");a("filled",u)};return(u,c)=>(e.openBlock(),e.createElementBlock("section",vd,[e.createElementVNode("div",Cd,[e.createElementVNode("div",Sd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(h,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:m,"onUpdate:modelValue":p=>o.value[m]=p,class:e.normalizeClass([t.eventHandling==="check"?"checked_mfa":t.eventHandling==="err"?"err_mfa":"reset_input","inline-block w-10 h-10 rounded-md text-center"]),type:"text",maxlength:"1",onInput:p=>i(m),onKeydown:e.withKeys(p=>l(m,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,Bd)),[[e.vModelText,o.value[m]]])),128))])])]))}},Vd={class:"text-center flex gap-3"},Md={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},Nd={key:0,class:"items-center justify-center inline-flex"},Ad=["src"],Td={__name:"mfaQrCode",props:{base64:{type:String,default:""},dimensions:{type:Array,default:null},loading:{type:Boolean,default:!1},generated:{type:Boolean,default:!1}},emits:["generateQR"],setup(t,{emit:n}){const a=n;e.ref(!1);const o=t,r=()=>{a("generateQR")},i=e.computed(()=>o.base64?o.base64:l.value),s=e.computed(()=>`w-${o.dimensions[0]} h-${o.dimensions[1]}`),l=e.ref("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAARGUlEQVR42u3dsZLbxhKFYejGpAOp9Jb7ACo9gMqx9JYbKOA6pwNfuly2yJ5lz5nuA/xfFSILwGAwanuxxz0frtfrdQMAA/+rHgAAjKJgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2KBgAbBBwQJgg4IFwAYFC4ANChYAGxQsADYoWABsULAA2GhTsD59+rR9+PBht0fkx48f2/l8/s955/N5+/HjR/XruTu+6Bgdv/r51dc/+vpd5cP1er1WD2Lb/nrhP3/+rB6GTDTN5/N5++OPP375z06n0/b29lY6/kfji4yMX/386usfff2uQsFaJJrm6N9i1a8p+2/Z6udXX//o63eVNj8SAkCEggXABgULgA0KFkIzPvhH1zidTk/9s07PCD0KFh56e3vbvnz5kr7O169fHxaFb9++/bIwnU6n7ffff5c/ZzQ+NHFt4uPHj9dt2+4er6+v1UNMjT/y6NwZr+n79+/X0+kU3mf1cTqdrt+/f396/KPnq8d39PW7ik2s4fX1dfv8+XP1MJ8efzTN6l+7Z3JUaityWplYxsj1j75+V+FHwoPoWqxGx/boz6ifrfPcHQ0FC4ANChYAGxQsADYoWCayv3JfkWVSjq06p4UeKFgmsjmhezmnaqM5q+qcFpqozlXcZHMsmyAjtL0jh6LOYd07RnNC91wul+vLy0t4n5eXl+vlcpl+/irV73/v63eV3eSw1E3GomlS57AeyfZzent723777beHf+ZyuWzn81ly/grq9jhHX7+r8CPhDmRzQiOF5NGfyZ4PjKJgAbBBwQJgg4IFwAYFayeqW6N0z0l1GAPyKFg7Ud3PqXtOqmsODe9Unau4OXqORTXuWf2i1FT9uqLnH82RZd//3tfvKuSwBkXTVJnDiszoF6VeJsp+XdHzj+TIsu9/7+t3FX4kPACHfk7KMUbXJiPmg4IFwAYFC4ANChYAGxSsJo7+K/fq5++eI8NfKFhNHD0nVP383XNk+L/qXMUNOZZfG80JZcefPb/KrBxVFut3Df4Lq7nz+bx9+/atehhtMT/HQsEyQE7oMebnOChYAGxQsADYoGABsEHBMrCibYx7Dsl9/BhDwWru7e1t+/Lli/w+7jkk9/FjUHWu4iabY6mWzbGo+kGN3r+7e/OT3Zdx1vWPvn5X2U0/rGrZfkLKflAj9+/u0fxk92Wccf2jr99V+JGwCYeeVZUezc+MuVNfH3NQsADYoGABsEHBAmCDggUL5KywbRQsmCBnhW3b+gQsohyI+xGJzn95ebleLpf/nDerH1Q2h+R+fnb+jr5+V7HJYbmLpjnal+5yudxtozJjX71sDsn9/Oy+jEdfv6tQsBbJFizO733+0dfvKnzDAmCDggXABgULgA0KVhPqnFH00Tl7/8z5M/p9VY4f61CwmlDnjL5+/fqwMGTv/+z5s/p9VY0fi1XnKjDH9mS+pjonNXpkqftpYY02sQbkRL+Wf6Q6JzUiu0zV/bSwBgVrJzIFa9vqc07Z8UWy40cPfMMCYIOCBcAGBQuADQoWynNSanxQ3w8K1sFV56TUVu3riEWqcxU3z+Z01PvSZY9VOZ9oHPf6ac16/mep+3mpxz+qOsfWff2OahNryOR01PvSZa3I+WT6ac14/swyUvfzUo9/RHWOLaNTTq1Nweqe08lST/PRc1LV4+/+fFlNygTfsAD4oGABsEHBAmBjFwUr++ty9QfFFb/OV/aDGpGdw+rxqzk/X6e5tS9Y2X5F6pzOqn5Kqn5Qo6J+W93Hr+b6fO36gVXnKm624hxR9ojGF+nar2k0J3XvcBl/xP39ZNdnFzaxBnWOKCsaX6Rzv6aRnNQjDuOP/hq4v5/s+uzCpmBFw3TPqXTv19Q955Qdf3Z9uT+fC/tvWACOg4IFwAYFC4ANCtYk1TkktcwYqsffYd/D7s/ngoI1SXUOSe3ZHFD1+Lvse9j9+WxU5yputmROJjq/66Huh1SdE1o1/up+WNU5wOzzdc2Z/RuxhgbU/ZCqc0Irxl/dD6s6B5h9vs45s3+iYDWhfr7q11y9b2L2+urnU8vOX/X6ueEbFgAbFCwANihYAGy0KVjO/YK66zA36hxX535e1bLz1+nZ2hQs135B3VXnhG7UOa6u/byqZeevy/r5W3WuYtSzOZFsP6fR416/oVn9mJ69v3p+Z53f9f1X55CO1u8q0ibWEMnkRLL9nEY86jc0ox9Ttl9YRLlvnnrfSPX7r84hHanfVcSmYHXPaWXvrz4/cvTxRar/mrjkpNTafMMCgAgFC4ANChYAGxYFq8v/eHnPipyLOieTuf6K91M5vo5xhdnP6KJ9were72dVzkWdk3n2+qveT9X42uWQ7sjmyGxU5ypu1P2Mnr3uNphz2WuOadX7UT3fXt5vdv3eO6pzZu/VJtag7meU/bV2Zl9E9xxTdP4I9TLLjq/7+1XGcqpzZu/RpmC590six/SYepnt/f1W5wi7aP8NCwBuKFgAbFCwANhoU7Dc+yWpc1LV+x5235ewcv2seL/KOXTImd20KVju/ZLUOanqfQ+770tYtX5WvV9Vvy2XnNnfqnMVs7j3S3r2/rPG1z0H5k71/o7WL6tNrCHLvV9Sdc6mew7MXeb9zli/e+mXtZuCVZ1zyU5jdc6mew7MXfecmIs237AAIELBAmCDggXAxmEKVvTRMqN6T7zs+Ebunxnj3j+oj1CuEfX76+QwBetezqW6X5K6n9SsflHP5sC69zNbRZUDVL+/dqpzFbNsohzTNphjyfZjyt4/oh5f9sh69vmqc2ar9s1UP/8qh4k1ZGX6Ja24f0Q9vqzsMsw8X3XObMW+mernX4WCNSiapur7R9Tjc38+9f2r14/6+Vc5zDcsAP4oWABsULAA2NhNwaruF9S5p1D3D6odcmzO/caOZDcFq7pfkOr+Wd1zUF1ybK79xg6nOldxo+qX1L1f0Oj4np2/0ePe83eZv6ocmVtO6d9mra8u2sQalP2SuvcLGhlf9JqU+/J1mL/KHJlTTulXZqyvLtoUrKP3Y6rO8WSvr54/cko51e9vlt18wwKwfxQsADYoWABstClY6n3f1NfPmPFBV7kvX/UH5+r7V6+PrOr5m6lNwVLv+6a+/rNm5YhU+/JV57iq71+9PrKq52+66lzFqOp+R6rxjR7dx199/+zxbL8zdT+tVYeLNrGGSHW/I+X4RqhfU3b82fFV9+vK9DtT99NawaQM9MlhhQMt7nekHp/7+LPj656zqs4JVj9/F22+YQFAhIIFwAYFC4ANi4LVod9RpLofV/U9qvd2VN9bmePbU05KrX3B6tLvKFLdj6t6/Kp+UmrZflVd+nkdRnWu4qY6h3Lv6NKPqyqHlt03z6WfVPecVbZfWXS4aBNrqM6hPNKhH1dlDi27b55DP6nuOatsv7JIkzIQalOwqnMokew0de93lR2/+v5q3XNW3dfHKu2/YQHADQULgA0KFgAbbQpW955D2Y/W2T9TPT/KflsdVPZjG/FofTjkFGdpU7C678v2bM5oNGcTXb96flT9trqo6sc26t76cMkpTlOdq8jK5pxm5VhUR5QD2su+c9kclDpHpbq/+/pbrU2sISObc5qRY1GKckB72Hcum4NS56iU43dffyvtomBtW33OSS07/u6vWf3+1M9/9PW3SptvWAAQoWABsEHBAmBjNwUrm6PpHKk4AuX7q+4n5r7+Oo1tNwUrm6Opzjkdner9VfcTc19/7XJ01bmKVdQ5mep+Rdnz3XNQz44ve3R5vntm9WPrYjexhog6J1Pdryj7a3X3HFRE2W+tw/M9MqMfWxeHKVjVOZ/qfkjdz1dz3zdS/fzdx3+zm29YAPaPggXABgULgI3DFCx1TkfZrygan7rf1oz77133OajOqc1ymIKlzumo+hVF41P325p1/73r3k+qOqc2TXWu4qZq371R7x3Xew/VvoSz5i97/+r3r35/qqN7zmu1NrGGyn33Rqh/La7clzCSzVmNiJaZ+v13b9+Sfb6jaFOwuu+rVp3jcb+/+/WrNflrWu4w37AA+KNgAbBBwQJgo03B6r7vnfIe1f2S1PdXv58j5MT28AwztClY3fe9U/Urqu6XpL6/+v0cJSfWPee1THWuAn+p7idVff8tyCNV5dRG7/8s9b6Ee8txtYk1HF11P6nq+0exg8qc2sj9M9T7Eu4px0XBaqK6X5H7/atzaurn7z7+Vdp8wwKACAULgA0KFgAbFKwmKvsVzeinpb4/sG0UrDaq+hXN6qelvj+wbVufHNbHjx/Lew8pjyzVvoEuR6T6/tn34z7+VdrEGj59+rT9/Pmzehgy2WlW7hvoIJq/6lhA9v24j38VCtYi2WnunlNSq36+7P33Pv5V+IYFwAYFC4ANChYAGxQsA10+eFap7heWHWP12LZNuy/lShSs5o6eU6ruFzaq+75/qn0pl6vOVdxEOazX19fqIabGH1Hv+xedf6/f02i/JlW/qKxZ/abU1O/n3tEtZxWxiTW8vr5unz9/rh7m0+OPplm971+m39RIvyZlv6isGf2m1H9N1O/nkU45qwg/EjZRHeqMmuNlzq/WeWwzniH7fNVr7z0oWABsULAA2KBgAbBBwdqBbE7pCPv6ZSMP1f3AMjmqSKecVYSCZS6bUzrKvn7ZnFZ1P7Bnc1SRdjmrSHWu4iabw9qSOZvoyI4/Et1fnXNS58BU98/miNT7AqqPWTkq+mG9UzaHVd2eI5vDyu7Ll6XOgSnvn80RqfcFVJuRo3Lph8WPhCbUWaLqLE7m/tmxu+e0Zry7R9eoXhv/RMECYIOCBcAGBQuADQpWE9X9iDrnlNRjn3WNStn5r15/oyhYTVT3I+qaU4rMmp/qflpZ2fmvXn/DqnMVN0fPYUWqcjKr+i1F18nm0J6dv2w/sFXnq99PF+SwBkXTlM1hRSpzMiv6LalzaJn5y/YDW3F+RqecVYSCNai6YFXvG5ed32h86udT7xtYfX5WkzIQ4hsWABsULAA2KFgAbFCwMETdb0mdA8pev/P5M7h8dKdgYYi635I6B5S9ftfzZ6nK0b1bda7ihhzWY9nxVVPnyKr7OWXvr86JPXt0y2kRaxgUTdPeYw1Z6hxZdT+n7P3VObGMTjktfiTEEup+S9X9nLL3z5y/915p/0TBAmCDggXABgULgA0KloEuHzwzuues1KKP5urzMzrM3w0Fq7m97wvYJWeldi/nlN2XUL0+uszf36pzFTfZHFa1bA6r676A6hzRqvGpr//se1t1qPe1XGU3Oaxq2RxW530B1TmiFeNTX1+dA8xS72u5Cj8SNlGddanMEa0YX/X1q+2hWG0bBQuAEQoWABsULAA2KFg7UJ1jUueAOly/MgeV1SlHlUXBMledY1LngLpcvyoHldUuR5VVnau4iXJM7kckOj/K0Tyb48rmrGY9f/frZw/VvoWjqvuFzWKTw3IXTXN2X75Mjiubs5rx/N2vn6Xct3BEdb+wWShYi2QLVvZ89fj2fv0s9fuPuDeAvOEbFgAbFCwANihYAGxQsJqo3LeO62vtYV/GLihYTVTtW8f1tfayL2MXbX5LCAAR/gsLgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgA0KFgAbFCwANihYAGxQsADYoGABsEHBAmCDggXABgULgI0/AXRl5K/bYs25AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTAyLTExVDIwOjQzOjIzKzAwOjAwj4NP3QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wMi0xMVQyMDo0MzoyMyswMDowMP7e92EAAAAASUVORK5CYII=");return(d,u)=>(e.openBlock(),e.createElementBlock("div",Vd,[e.createElementVNode("section",Md,[t.generated?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.value,"btnQrCode"])},[t.loading?(e.openBlock(),e.createElementBlock("div",Nd,[...u[0]||(u[0]=[e.createElementVNode("div",{class:"loaderMFA"},null,-1)])])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"uppercase bg-base-300 p-2 z-40",onClick:r}," Gerar QR "))],2)),e.createElementVNode("img",{class:e.normalizeClass([[s.value,t.generated?"rounded-md":"rounded-none"],""]),src:i.value,alt:"QRCode"},null,10,Ad)])]))}};for(var We=[],Ma=0;Ma<256;++Ma)We.push((Ma+256).toString(16).slice(1));function Dd(t,n=0){return(We[t[n+0]]+We[t[n+1]]+We[t[n+2]]+We[t[n+3]]+"-"+We[t[n+4]]+We[t[n+5]]+"-"+We[t[n+6]]+We[t[n+7]]+"-"+We[t[n+8]]+We[t[n+9]]+"-"+We[t[n+10]]+We[t[n+11]]+We[t[n+12]]+We[t[n+13]]+We[t[n+14]]+We[t[n+15]]).toLowerCase()}var Hn,Fd=new Uint8Array(16);function Ld(){if(!Hn&&(Hn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hn(Fd)}var $d=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const br={randomUUID:$d};function Pd(t,n,a){if(br.randomUUID&&!t)return br.randomUUID();t=t||{};var o=t.random||(t.rng||Ld)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Dd(o)}function wr(){const t=Yt(),n=async l=>{const d=t.attendants.find(u=>u.id===l);if(d)try{const u=await at.get(`${Ea}?attendant=${l}&page=1`);d.messages=u.data.results.reverse(),d.hasNextPage=u.data.next!==null,d.currentPage=2,d.internal_chat={channel_id:u.data.channel_id,unread:0}}catch(u){console.error("Erro ao buscar mensagens:",u)}},a=async l=>{const d=t.attendants.find(u=>u.id===l);if(!(!d||!d.hasNextPage))try{const u=await at.get(`${Ea}?attendant=${l}&page=${d.currentPage}`);d.messages=[...u.data.results.reverse(),...d.messages],d.hasNextPage=u.data.next!==null,d.currentPage++}catch(u){console.error("Erro ao carregar mais mensagens:",u)}},o=(l,d,u)=>{const c=l==null?void 0:l.message;if(!c)return;const h=t.attendants.find(m=>{var p;return((p=m.internal_chat)==null?void 0:p.channel_id)===c.channel_id});h?(h.messages=h.messages||[],h.messages.find(p=>p.id===c.id)||(h.messages.push(c),(!d||h.id!==u)&&(h.internal_chat.unread=(h.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const d=t.attendants.find(u=>u.id===l);d&&(d.internal_chat.unread=0)},i=async(l,d,u,c=!1)=>{var f;const h=t.attendants.find(g=>g.id===l);if(!h||!((f=h.internal_chat)!=null&&f.channel_id))return;let m;c?m=d:m={type:"text",content:d};const p={id:Pd(),content:m,created_at:new Date().toISOString(),sender:u};h.messages.push(p);try{await at.post(`${Ea}${h.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const d=t.attendants.find(u=>u.id===l);return d?d.hasNextPage:!1};return{attendants:e.computed(()=>t.attendants),count:e.computed(()=>t.count),fetchMessagesForAtendente:n,loadMessagesForAtendente:a,addMessageToAtendente:o,sendMessageToAtendente:i,hasNextPageForAtendente:s,resetUnreadMessages:r}}const Od={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},_d={key:0,style:{"padding-top":"0.5rem"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Rd=["src"],Na=Ce({__name:"Avatar",props:{url:{type:String}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",Od,[t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,Rd)):(e.openBlock(),e.createElementBlock("svg",_d,[...a[0]||(a[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"},null,-1)])]))]))}},[["__scopeId","data-v-7d8b2820"]]),Hd={class:"attendants-container"},zd={class:"atendentes-list bg-base-300"},jd={key:0,class:"empty-message bg-base-200"},Gd=["onClick"],Id={class:"atendente-main"},qd={class:"atendente-name"},Wd={class:"flex items-center gap-4"},Ud={key:0,class:"message-indicator"},Zd={key:0,class:"chat-footer bg-base-200"},Er=Ce({__name:"ChatList",props:{atendentes:{type:Array,required:!0},attendant:{required:!0},mobile:{type:Boolean,default:!1}},emits:["atendenteSelecionado"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=d=>{o("atendenteSelecionado",d)},s=d=>{switch(d){case"Busy":return"bg-red-500";case"Online":return"bg-green-500";case"Away":return"bg-yellow-500";case"Offline":return"bg-gray-500";default:return"bg-purple-500"}},l=e.computed(()=>r.value?a.atendentes.filter(d=>d.name.toLowerCase().includes(r.value.toLowerCase())&&d.id!==a.attendant.id):a.atendentes.filter(d=>d.id!==a.attendant.id));return(d,u)=>(e.openBlock(),e.createElementBlock("div",Hd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=c=>r.value=c),class:e.normalizeClass(t.mobile?"search-input-mobile bg-base-300 border-b border-base-200":"search-input bg-base-300 border-b border-base-200"),placeholder:"Pesquise entre os atendentes..."},null,2),[[e.vModelText,r.value]]),e.createElementVNode("ul",zd,[l.value.length===0?(e.openBlock(),e.createElementBlock("li",jd,e.toDisplayString(t.atendentes.length===0?"Não há atendentes disponíveis":"Não há atendentes com esse nome"),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>(e.openBlock(),e.createElementBlock("li",{key:c.id,onClick:h=>i(c),class:e.normalizeClass([["atendente-item",c.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[e.createElementVNode("main",Id,[e.createVNode(Na,{url:c.photo},null,8,["url"]),e.createElementVNode("span",qd,e.toDisplayString(c.name),1)]),e.createElementVNode("footer",Wd,[c.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",Ud,e.toDisplayString(c.internal_chat.unread),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["status-indicator",s(c.login_status)])},null,2)]),u[1]||(u[1]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,Gd))),128))]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",Zd))]))}},[["__scopeId","data-v-dc8950e9"]]);function Yd(t,n=null){if(!t)return!1;const a=t.getBoundingClientRect(),o=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};return a.bottom>=o.top&&a.top<=o.bottom&&a.right>=o.left&&a.left<=o.right}async function Xd(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function Kd(t){let n=`0px 0px ${t.distance}px 0px`;t.top&&(n=`${t.distance}px 0px 0px 0px`);const a=new IntersectionObserver(o=>{o[0].isIntersecting&&(t.firstload&&t.emit(),t.firstload=!0)},{root:t.parentEl,rootMargin:n});return t.infiniteLoading.value&&a.observe(t.infiniteLoading.value),a}async function vr(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const Cr=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Qd={},Jd=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),e3={class:"container"},t3=Jd(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),n3=[t3];function a3(t,n){return e.openBlock(),e.createElementBlock("div",e3,n3)}const o3=Cr(Qd,[["render",a3],["__scopeId","data-v-d3e37633"]]),r3={class:"state-error"},Xt=Cr(e.defineComponent({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(t,{emit:n}){const a=t;let o=null,r=0;const i=e.ref(null),s=e.ref(""),{top:l,firstload:d,distance:u}=a,{identifier:c,target:h}=e.toRefs(a),m={infiniteLoading:i,top:l,firstload:d,distance:u,parentEl:null,emit(){r=(m.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await vr(m,r),Yd(i.value,m.parentEl)&&m.emit()},async complete(){s.value="complete",await vr(m,r),o==null||o.disconnect()},error(){s.value="error"}};function f(){o==null||o.disconnect(),o=Kd(m)}return e.watch(c,f),e.onMounted(async()=>{m.parentEl=await Xd(h),f()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"infiniteLoading",ref:i,class:"v3-infinite-loading"},[e.withDirectives(e.createElementVNode("div",null,[e.renderSlot(g.$slots,"spinner",{},()=>[e.createVNode(o3)],!0)],512),[[e.vShow,s.value=="loading"]]),s.value=="complete"?e.renderSlot(g.$slots,"complete",{key:0},()=>{var k;return[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.complete)||"No more results!"),1)]},!0):e.createCommentVNode("",!0),s.value=="error"?e.renderSlot(g.$slots,"error",{key:1,retry:m.emit},()=>{var k;return[e.createElementVNode("span",r3,[e.createElementVNode("span",null,e.toDisplayString(((k=g.slots)==null?void 0:k.error)||"Oops something went wrong!"),1),e.createElementVNode("button",{class:"retry",onClick:y[0]||(y[0]=(...w)=>m.emit&&m.emit(...w))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function i3(t,n,a){const o=ct(t,a==null?void 0:a.in);return isNaN(n)?rt(t,NaN):(o.setDate(o.getDate()+n),o)}function zn(t,n){return Pt(t,{...n,weekStartsOn:1})}function Sr(t,n){const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=rt(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=zn(r),s=rt(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=zn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function Br(t){const n=ct(t),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+t-+a}function jn(t,n){const a=ct(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function s3(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n),i=jn(o),s=jn(r),l=+i-Br(i),d=+s-Br(s);return Math.round((l-d)/Sl)}function l3(t,n){const a=Sr(t,n),o=rt(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),zn(o)}function Aa(t){return rt(t,Date.now())}function Vr(t,n,a){const[o,r]=Ca(a==null?void 0:a.in,t,n);return+jn(o)==+jn(r)}function c3(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function d3(t){return!(!c3(t)&&typeof t!="number"||isNaN(+ct(t)))}function u3(t,n){const a=ct(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function f3(t,n){const a=ct(t,n==null?void 0:n.in);return s3(a,u3(a))+1}function m3(t,n){const a=ct(t,n==null?void 0:n.in),o=+zn(a)-+l3(a);return Math.round(o/lr)+1}function Mr(t,n){var c,h,m,p;const a=ct(t,n==null?void 0:n.in),o=a.getFullYear(),r=On(),i=(n==null?void 0:n.firstWeekContainsDate)??((h=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=rt((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Pt(s,n),d=rt((n==null?void 0:n.in)||t,0);d.setFullYear(o,0,i),d.setHours(0,0,0,0);const u=Pt(d,n);return+a>=+l?o+1:+a>=+u?o:o-1}function h3(t,n){var l,d,u,c;const a=On(),o=(n==null?void 0:n.firstWeekContainsDate)??((d=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((c=(u=a.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,r=Mr(t,n),i=rt((n==null?void 0:n.in)||t,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Pt(i,n)}function p3(t,n){const a=ct(t,n==null?void 0:n.in),o=+Pt(a,n)-+h3(a,n);return Math.round(o/lr)+1}function De(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const Bt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return De(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):De(a+1,2)},d(t,n){return De(t.getDate(),n.length)},a(t,n){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h(t,n){return De(t.getHours()%12||12,n.length)},H(t,n){return De(t.getHours(),n.length)},m(t,n){return De(t.getMinutes(),n.length)},s(t,n){return De(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return De(r,n.length)}},Kt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Nr={G:function(t,n,a){const o=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},y:function(t,n,a){if(n==="yo"){const o=t.getFullYear(),r=o>0?o:1-o;return a.ordinalNumber(r,{unit:"year"})}return Bt.y(t,n)},Y:function(t,n,a,o){const r=Mr(t,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return De(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):De(i,n.length)},R:function(t,n){const a=Sr(t);return De(a,n.length)},u:function(t,n){const a=t.getFullYear();return De(a,n.length)},Q:function(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return De(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,a){const o=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return De(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,a){const o=t.getMonth();switch(n){case"M":case"MM":return Bt.M(t,n);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,a){const o=t.getMonth();switch(n){case"L":return String(o+1);case"LL":return De(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,a,o){const r=p3(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):De(r,n.length)},I:function(t,n,a){const o=m3(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):De(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):Bt.d(t,n)},D:function(t,n,a){const o=f3(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):De(o,n.length)},E:function(t,n,a){const o=t.getDay();switch(n){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,a,o){const r=t.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return De(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(r,{width:"short",context:"formatting"});case"eeee":default:return a.day(r,{width:"wide",context:"formatting"})}},c:function(t,n,a,o){const r=t.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return De(i,n.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(r,{width:"narrow",context:"standalone"});case"cccccc":return a.day(r,{width:"short",context:"standalone"});case"cccc":default:return a.day(r,{width:"wide",context:"standalone"})}},i:function(t,n,a){const o=t.getDay(),r=o===0?7:o;switch(n){case"i":return String(r);case"ii":return De(r,n.length);case"io":return a.ordinalNumber(r,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,a){const r=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,a){const o=t.getHours();let r;switch(o===12?r=Kt.noon:o===0?r=Kt.midnight:r=o/12>=1?"pm":"am",n){case"b":case"bb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,a){const o=t.getHours();let r;switch(o>=17?r=Kt.evening:o>=12?r=Kt.afternoon:o>=4?r=Kt.morning:r=Kt.night,n){case"B":case"BB":case"BBB":return a.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,a){if(n==="ho"){let o=t.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return Bt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):Bt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):De(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):Bt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):Bt.s(t,n)},S:function(t,n){return Bt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Tr(o);case"XXXX":case"XX":return Ot(o);case"XXXXX":case"XXX":default:return Ot(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return Tr(o);case"xxxx":case"xx":return Ot(o);case"xxxxx":case"xxx":default:return Ot(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Ar(o,":");case"OOOO":default:return"GMT"+Ot(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Ar(o,":");case"zzzz":default:return"GMT"+Ot(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return De(o,n.length)},T:function(t,n,a){return De(+t,n.length)}};function Ar(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),i=o%60;return i===0?a+String(r):a+String(r)+n+De(i,2)}function Tr(t,n){return t%60===0?(t>0?"-":"+")+De(Math.abs(t)/60,2):Ot(t,n)}function Ot(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=De(Math.trunc(o/60),2),i=De(o%60,2);return a+r+n+i}const Dr=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Fr=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},g3={p:Fr,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return Dr(t,n);let i;switch(o){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",Dr(o,n)).replace("{{time}}",Fr(r,n))}},y3=/^D+$/,k3=/^Y+$/,x3=["D","DD","YY","YYYY"];function b3(t){return y3.test(t)}function w3(t){return k3.test(t)}function E3(t,n,a){const o=v3(t,n,a);if(console.warn(o),x3.includes(t))throw new RangeError(o)}function v3(t,n,a){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const C3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,S3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B3=/^'([^]*?)'?$/,V3=/''/g,M3=/[a-zA-Z]/;function Lr(t,n,a){var c,h,m,p,f,g,y,k;const o=On(),r=(a==null?void 0:a.locale)??o.locale??n2,i=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(m=o.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(f=a==null?void 0:a.locale)==null?void 0:f.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((k=(y=o.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=ct(t,a==null?void 0:a.in);if(!d3(l))throw new RangeError("Invalid time value");let d=n.match(S3).map(w=>{const E=w[0];if(E==="p"||E==="P"){const v=g3[E];return v(w,r.formatLong)}return w}).join("").match(C3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const E=w[0];if(E==="'")return{isToken:!1,value:N3(w)};if(Nr[E])return{isToken:!0,value:w};if(E.match(M3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:w}});r.localize.preprocessor&&(d=r.localize.preprocessor(l,d));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return d.map(w=>{if(!w.isToken)return w.value;const E=w.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&w3(E)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&b3(E))&&E3(E,n,String(t));const v=Nr[E[0]];return v(l,E,r.localize,u)}).join("")}function N3(t){const n=t.match(B3);return n?n[1].replace(V3,"'"):t}function A3(t,n){return Vl(rt(t,t),Aa(t),n)}function T3(t,n){return Vr(rt(t,t),Aa(t))}function D3(t,n,a){return i3(t,-1,a)}function F3(t,n){return Vr(rt(t,t),D3(Aa(t)))}/*! License details at fancyapps.com/license */const Te=t=>typeof t=="string";/*! License details at fancyapps.com/license */const Qt=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const L3=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const n=t.scrollHeight>t.clientHeight,a=window.getComputedStyle(t).overflowY,o=a.indexOf("hidden")!==-1,r=a.indexOf("visible")!==-1;return n&&!o&&!r},_t=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:L3(t)?t:_t(t.parentElement,n)};/*! License details at fancyapps.com/license */const wt=function(t){var n=new DOMParser().parseFromString(t,"text/html").body;if(n.childElementCount>1){for(var a=document.createElement("div");n.firstChild;)a.appendChild(n.firstChild);return a}let o=n.firstChild;return!o||o instanceof HTMLElement?o:((a=document.createElement("div")).appendChild(o),a)};/*! License details at fancyapps.com/license */const Be=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Ze=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function $r(t){return Ze(t)||Array.isArray(t)}function hn(t,n){const a=Object.keys(t),o=Object.keys(n);return a.length===o.length&&a.every(r=>{const i=t[r],s=n[r];return typeof i=="function"?`${i}`==`${s}`:$r(i)&&$r(s)?hn(i,s):i===s})}/*! License details at fancyapps.com/license */const Pr=function(t){for(const n of Gn)n.getState()===Xe.Running&&n.tick(Ta?t-Ta:0);Ta=t,en=window.requestAnimationFrame(Pr)};var Xe,Vt,Jt;(function(t){t[t.Initializing=0]="Initializing",t[t.Running=1]="Running",t[t.Paused=2]="Paused",t[t.Completed=3]="Completed",t[t.Destroyed=4]="Destroyed"})(Xe||(Xe={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(Vt||(Vt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(Jt||(Jt={}));const Gn=new Set;let en=null,Ta=0;function Mt(){let t=Xe.Initializing,n=Vt.Ease,a=0,o=0,r=Mt.Easings.Linear,i=500,s=0,l=0,d=0,u=0,c=1/0,h=.01,m=.01,p=!1,f={},g=null,y={},k={},w={},E=0,v=0,M=Jt.Loop,A=Mt.Easings.Linear;const R=new Map;function S(B,...C){for(const O of R.get(B)||[])O(...C)}function x(B){return o=0,B?g=setTimeout(()=>{N()},B):N(),F}function N(){t=Xe.Running,S("start",y,k)}function L(){if(t=Xe.Completed,w={},S("end",y),t===Xe.Completed)if(a<E){if(a++,M===Jt.Reverse){const B=Object.assign({},f);f=Object.assign({},k),k=B}x(v)}else a=0;return F}const F={getState:function(){return t},easing:function(B){return r=B,n=Vt.Ease,w={},F},duration:function(B){return i=B,F},spring:function(B={}){n=Vt.Spring;const C={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:O,mass:Z,tension:Q,friction:ee,restDelta:P,restSpeed:H,maxSpeed:_,clamp:oe}=Object.assign(Object.assign({},C),B);return s=O,l=Z,d=Q,u=ee,m=P,h=H,c=_,p=oe,w={},F},isRunning:function(){return t===Xe.Running},isSpring:function(){return n===Vt.Spring},from:function(B){return y=Object.assign({},B),F},to:function(B){return k=B,F},repeat:function(B,C=0,O=Jt.Loop,Z){return E=B,v=C,M=O,A=Z||r,F},on:function(B,C){var O,Z;return O=B,Z=C,R.set(O,[...R.get(O)||[],Z]),F},off:function(B,C){var O,Z;return O=B,Z=C,R.has(O)&&R.set(O,R.get(O).filter(Q=>Q!==Z)),F},start:function(B){return hn(y,k)||(t=Xe.Initializing,f=Object.assign({},y),Gn.add(this),en||(en=window.requestAnimationFrame(Pr)),x(B)),F},pause:function(){return g&&(clearTimeout(g),g=null),t===Xe.Running&&(t=Xe.Paused,S("pause",y)),F},end:L,tick:function(B){B>50&&(B=50),o+=B;let C=0,O=!1;if(t!==Xe.Running)return F;if(n===Vt.Ease){C=Be(0,o/i,1),O=C===1;const Q=M===Jt.Reverse?A:r;for(const ee in y)y[ee]=f[ee]+(k[ee]-f[ee])*Q(C)}if(n===Vt.Spring){const Q=.001*B;let ee=0;for(const P in y){const H=k[P];let _=y[P];if(typeof H!="number"||isNaN(H)||typeof _!="number"||isNaN(_))continue;if(Math.abs(H-_)<=m){y[P]=H,w[P]=0;continue}w[P]||(typeof s=="object"&&typeof s[P]=="number"?w[P]=s[P]:w[P]=typeof s=="number"?s:0);let oe=w[P];oe=Be(-1*Math.abs(c),oe,Math.abs(c));const de=oe*l*u;oe+=((_>H?-1:1)*(Math.abs(H-_)*d)-de)/l*Q,_+=oe*Q;const pe=y[P]>H?_<H:_>H;let ye=Math.abs(oe)<h&&Math.abs(H-_)<=m;p&&pe&&(ye=!0),ye?(_=H,oe=0):ee++,y[P]=_,w[P]=oe}O=!ee}const Z=Object.assign({},k);return S("step",y,f,k,C),O&&t===Xe.Running&&hn(k,Z)&&(t=Xe.Completed,L()),F},getStartValues:function(){return f},getCurrentValues:function(){return y},getCurrentVelocities:function(){return w},getEndValues:function(){return k},destroy:function(){t=Xe.Destroyed,g&&(clearTimeout(g),g=null),f=y=k={},Gn.delete(this)}};return F}Mt.destroy=()=>{for(const t of Gn)t.destroy();en&&(cancelAnimationFrame(en),en=null)},Mt.Easings={Linear:function(t){return t},EaseIn:function(t){return t===0?0:Math.pow(2,10*t-10)},EaseOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},EaseInOut:function(t){return t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}};/*! License details at fancyapps.com/license */function pn(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function Da(t,n){const a=[],o=pn(t)?t[n]:t instanceof MouseEvent&&(n==="changedTouches"||t.type!=="mouseup")?[t]:[];for(const r of o)a.push({x:r.clientX,y:r.clientY,ts:Date.now()});return a}function Or(t){return Da(t,"touches")}function _r(t){return Da(t,"targetTouches")}function Rr(t){return Da(t,"changedTouches")}function Nt(t){const n=t[0],a=t[1]||n;return{x:(n.x+a.x)/2,y:(n.y+a.y)/2,ts:a.ts}}function In(t){const n=t[0],a=t[1]||t[0];return n&&a?-1*Math.sqrt((a.x-n.x)*(a.x-n.x)+(a.y-n.y)*(a.y-n.y)):0}const Hr=t=>{t.cancelable&&t.preventDefault()},At={passive:!1},$3={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let qn=!1,gn=!0;const tn=(t,n)=>{let a,o,r,i=Object.assign(Object.assign({},$3),n),s=[],l=[],d=[],u=!1,c=!1,h=!1,m=!1,p=0,f=0,g=0,y=0,k=0,w=0,E=0,v=0,M=0,A=[],R=0,S=0;const x=new Map;function N(P){const H=In(l),_=In(d),oe=H&&_?H/_:0,de=Math.abs(E)>Math.abs(v)?E:v,pe={srcEvent:a,isPanRecognized:u,isSwipeRecognized:c,firstTouch:s,previousTouch:d,currentTouch:l,deltaX:g,deltaY:y,offsetX:k,offsetY:w,velocityX:E,velocityY:v,velocity:de,angle:M,axis:r,scale:oe,center:o};for(const ye of x.get(P)||[])ye(pe)}function L(P){const H=Date.now();if(A=A.filter(_=>!_.ts||_.ts>H-100),P&&A.push(P),E=0,v=0,A.length>3){const _=A[0],oe=A[A.length-1];if(_&&oe){const de=oe.x-_.x,pe=oe.y-_.y,ye=_.ts&&oe.ts?oe.ts-_.ts:0;ye>0&&(E=Math.abs(de)>3?de/(ye/30):0,v=Math.abs(pe)>3?pe/(ye/30):0)}}}function F(P){if(typeof MouseEvent<"u"&&P instanceof MouseEvent){if(qn)return}else qn=!0;const H=P.composedPath()[0],_=i.ignore.join(",");if(H.matches(_)||H.closest(_))return;if(typeof MouseEvent<"u"&&P instanceof MouseEvent){if(!P.buttons||P.button!==0)return;Hr(P)}P instanceof MouseEvent&&(window.addEventListener("mousemove",B),window.addEventListener("mouseup",C)),window.addEventListener("blur",O),a=P,l=_r(P),s=[...l],d=[],f=l.length,o=Nt(l),f===1&&(u=!1,c=!1,h=!1),f&&L(Nt(l));const oe=Date.now(),de=oe-(p||oe);m=de>0&&de<=250&&f===1,p=oe,clearTimeout(R),N("start")}function B(P){var H;if(!s.length||P.defaultPrevented)return;a=P,d=[...l],l=Or(P);const _=Nt(d),oe=Nt(Or(P));if(L(oe),f=l.length,o=oe,d.length===l.length?(g=oe.x-_.x,y=oe.y-_.y):(g=0,y=0),s.length){const de=Nt(s);k=oe.x-de.x,w=oe.y-de.y}if(l.length>1){const de=In(l),pe=In(d);Math.abs(de-pe)>=.1&&(h=!0,N("pinch"))}u||(u=Math.abs(k)>i.panThreshold||Math.abs(w)>i.panThreshold,u&&(gn=!1,clearTimeout(S),S=0,M=Math.abs(180*Math.atan2(w,k)/Math.PI),r=M>45&&M<135?"y":"x",s=[...l],d=[...l],k=0,w=0,g=0,y=0,(H=window.getSelection())===null||H===void 0||H.removeAllRanges(),N("panstart"))),u&&(g||y)&&N("pan"),N("move")}function C(P){if(a=P,!s.length)return;const H=_r(P),_=Rr(P);if(f=H.length,o=Nt(_),_.length&&L(Nt(_)),d=[...l],l=[...H],s=[...H],f>0)N("end"),u=!1,c=!1,A=[];else{const oe=i.swipeThreshold;(Math.abs(E)>oe||Math.abs(v)>oe)&&(c=!0),u&&N("panend"),c&&N("swipe"),u||c||h||(N("tap"),m?N("doubleTap"):R=setTimeout(function(){N("singleTap")},250)),N("end"),Z()}}function O(){clearTimeout(R),Z(),u&&N("panend"),N("end")}function Z(){qn=!1,u=!1,c=!1,m=!1,f=0,A=[],l=[],d=[],s=[],g=0,y=0,k=0,w=0,E=0,v=0,M=0,r=void 0,window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",C),window.removeEventListener("blur",O),gn||S||(S=setTimeout(()=>{gn=!0,S=0},100))}function Q(P){const H=P.target;qn=!1,H&&!P.defaultPrevented&&(gn||(Hr(P),P.stopPropagation()))}const ee={init:function(){return t&&(t.addEventListener("click",Q,At),t.addEventListener("mousedown",F,At),t.addEventListener("touchstart",F,At),t.addEventListener("touchmove",B,At),t.addEventListener("touchend",C),t.addEventListener("touchcancel",C)),ee},on:function(P,H){return function(_,oe){x.set(_,[...x.get(_)||[],oe])}(P,H),ee},off:function(P,H){return x.has(P)&&x.set(P,x.get(P).filter(_=>_!==H)),ee},isPointerDown:()=>f>0,destroy:function(){clearTimeout(R),clearTimeout(S),S=0,t&&(t.removeEventListener("click",Q,At),t.removeEventListener("mousedown",F,At),t.removeEventListener("touchstart",F,At),t.removeEventListener("touchmove",B,At),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",C)),t=null,Z()}};return ee};tn.isClickAllowed=()=>gn;/*! License details at fancyapps.com/license */const Fa={IMAGE_ERROR:"This image couldn't be loaded. <br /> Please try again later.",MOVE_UP:"Move up",MOVE_DOWN:"Move down",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",TOGGLE_FULL:"Toggle zoom level",TOGGLE_1TO1:"Toggle zoom level",ITERATE_ZOOM:"Toggle zoom level",ROTATE_CCW:"Rotate counterclockwise",ROTATE_CW:"Rotate clockwise",FLIP_X:"Flip horizontally",FLIP_Y:"Flip vertically",RESET:"Reset",TOGGLE_FS:"Toggle fullscreen"};/*! License details at fancyapps.com/license */const we=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const Ke=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ye=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Rt=t=>{t.cancelable&&t.preventDefault()},Qe=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n),kt=t=>t instanceof HTMLImageElement;var ge,zr;(function(t){t.Reset="reset",t.Zoom="zoom",t.ZoomIn="zoomIn",t.ZoomOut="zoomOut",t.ZoomTo="zoomTo",t.ToggleCover="toggleCover",t.ToggleFull="toggleFull",t.ToggleMax="toggleMax",t.IterateZoom="iterateZoom",t.Pan="pan",t.Swipe="swipe",t.Move="move",t.MoveLeft="moveLeft",t.MoveRight="moveRight",t.MoveUp="moveUp",t.MoveDown="moveDown",t.RotateCCW="rotateCCW",t.RotateCW="rotateCW",t.FlipX="flipX",t.FlipY="flipY",t.ToggleFS="toggleFS"})(ge||(ge={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}(zr||(zr={}));const ft={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},La={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:ge.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:Fa,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:ge.Zoom,width:"auto"};let Wn,jr=0,Gr=0,Un=0;const $a=(t,n={},a={})=>{let o,r,i,s,l,d,u,c,h=0,m=Object.assign(Object.assign({},La),n),p={},f=Object.assign({},ft),g=Object.assign({},ft);const y=[];function k($){let I=m[$];return I&&typeof I=="function"?I(ce):I}function w(){return t&&t.parentElement&&o&&h===3}const E=new Map;function v($,...I){const te=[...E.get($)||[]];m.on&&te.push(m.on[$]);for(const Y of te)Y&&Y instanceof Function&&Y(ce,...I);$!=="*"&&v("*",$,...I)}function M($){if(!w())return;const I=$.target;if(_t(I))return;const te=Date.now(),Y=[-$.deltaX||0,-$.deltaY||0,-$.detail||0].reduce(function(se,fe){return Math.abs(fe)>Math.abs(se)?fe:se}),b=Be(-1,Y,1);v("wheel",$,b);const T=k("wheelAction");if(!T||$.defaultPrevented)return;const X=g.scale;let ne=X*(b>0?1.5:.5);if(T===ge.Zoom){const se=Math.abs($.deltaY)<100&&Math.abs($.deltaX)<100;if(te-Gr<(se?200:45))return void Rt($);Gr=te;const fe=Q(),me=_();if(Qe(ne)<Qe(fe)&&Qe(X)<=Qe(fe)?(Un+=Math.abs(b),ne=fe):Qe(ne)>Qe(me)&&Qe(X)>=Qe(me)?(Un+=Math.abs(b),ne=me):(Un=0,ne=Be(fe,ne,me)),Un>7)return}switch(Rt($),T){case ge.Pan:ye(T,{srcEvent:$,deltaX:2*-$.deltaX,deltaY:2*-$.deltaY});break;case ge.Zoom:ye(ge.ZoomTo,{srcEvent:$,scale:ne,center:{x:$.clientX,y:$.clientY}});break;default:ye(T,{srcEvent:$})}}function A($){var I,te;const Y=$.composedPath()[0];if(!tn.isClickAllowed()||!Qt(Y)||$.defaultPrevented||!(t!=null&&t.contains(Y))||Y.hasAttribute("disabled")||Y.hasAttribute("aria-disabled"))return;const b=Y.closest("[data-panzoom-action]"),T=(I=b==null?void 0:b.dataset)===null||I===void 0?void 0:I.panzoomAction,X=((te=b==null?void 0:b.dataset)===null||te===void 0?void 0:te.panzoomValue)||"";if(T){switch(Rt($),T){case ge.ZoomTo:case ge.ZoomIn:case ge.ZoomOut:ye(T,{scale:parseFloat(X||"")||void 0});break;case ge.MoveLeft:case ge.MoveRight:ye(T,{deltaX:parseFloat(X||"")||void 0});break;case ge.MoveUp:case ge.MoveDown:ye(T,{deltaY:parseFloat(X||"")||void 0});break;case ge.ToggleFS:ae();break;default:ye(T)}return}if(!(o!=null&&o.contains(Y)))return;const ne={srcEvent:$};if(ye(k("clickAction"),ne),k("dblClickAction")){const se=Date.now(),fe=se-(jr||se);jr=se,fe>0&&fe<=250?(Wn&&(clearTimeout(Wn),Wn=void 0),ye(k("dblClickAction"),ne)):Wn=setTimeout(()=>{ye(k("singleClickAction"),ne)},250)}}function R($){if(c=$,!w()||!C()||f.scale<=1||g.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const I=O(g.scale);if(!I)return;const{x:te,y:Y}=I;ye(ge.Pan,{deltaX:te-g.x,deltaY:Y-g.y})}function S(){var $;t&&(Ke(t,"is-loading"),($=t.querySelector(".f-spinner"))===null||$===void 0||$.remove())}function x(){if(!t||!r)return;if(S(),kt(r)&&(!r.complete||!r.naturalWidth))return h=2,o==null||o.classList.add("has-error"),void v("error");v("loaded");const{width:$,height:I}=F();kt(r)&&(r.setAttribute("width",$+""),r.setAttribute("height",I+"")),o&&(Ke(o,"has-error"),kt(r)&&(o.setAttribute("width",$+""),o.setAttribute("height",I+""),o.style.aspectRatio=`${$/I||""}`)),d=Mt().on("start",(Y,b)=>{b.angle!==void 0&&(b.angle=90*Math.round(b.angle/90)),b.flipX!==void 0&&(b.flipX=b.flipX>0?1:-1),b.flipY!==void 0&&(b.flipY=b.flipY>0?1:-1),g=Object.assign(Object.assign({},ft),b),pe(),v("animationStart")}).on("pause",Y=>{g=Object.assign(Object.assign({},ft),Y)}).on("step",Y=>{if(!w())return void(d==null||d.end());if(f=Object.assign(Object.assign({},ft),Y),C()||!k("bounds")||q()||g.scale>f.scale||g.scale<ee())return void Ve();const b=oe(g.scale);let T=!1,X=!1,ne=!1,se=!1;f.x<b.x[0]&&(T=!0),f.x>b.x[1]&&(X=!0),f.y<b.y[0]&&(se=!0),f.y>b.y[1]&&(ne=!0);let fe=!1,me=!1,be=!1,ve=!1;g.x<b.x[0]&&(fe=!0),g.x>b.x[1]&&(me=!0),g.y<b.y[0]&&(ve=!0),g.y>b.y[1]&&(be=!0);let Fe=!1;(X&&me||T&&fe)&&(g.x=Be(b.x[0],g.x,b.x[1]),Fe=!0),(ne&&be||se&&ve)&&(g.y=Be(b.y[0],g.y,b.y[1]),Fe=!0),Fe&&d&&d.spring({tension:94,friction:17,maxSpeed:555*g.scale,restDelta:.1,restSpeed:.1,velocity:d.getCurrentVelocities()}).from(f).to(g).start(),Ve()}).on("end",()=>{l!=null&&l.isPointerDown()||de(),d!=null&&d.isRunning()||(pe(),v("animationEnd"))}),function(){const Y=k("gestures");if(!Y||!s||!r)return;let b=!1;l=tn(s,Y).on("start",T=>{if(!k("gestures")||!d||!w()||C())return;const X=T.srcEvent;(f.scale>1||T.currentTouch.length>1)&&(X==null||X.stopPropagation(),d.pause(),b=!0),T.currentTouch.length===1&&v("touchStart")}).on("move",T=>{var X;b&&(g.scale!==1||T.currentTouch.length>1)&&(Rt(T.srcEvent),(X=T.srcEvent)===null||X===void 0||X.stopPropagation())}).on("pan",T=>{if(!b)return;const X=T.srcEvent;(g.scale!==1||T.currentTouch.length>1)&&(Rt(X),ye(ge.Pan,T))}).on("swipe",T=>{b&&g.scale>1&&ye(ge.Swipe,T)}).on("tap",T=>{v("click",T)}).on("singleTap",T=>{v("singleClick",T)}).on("doubleTap",T=>{v("dblClick",T)}).on("pinch",T=>{b&&(T.scale>ee()?ye(ge.ZoomIn,T):T.scale<ee()?ye(ge.ZoomOut,T):ye(ge.Pan,T))}).on("end",T=>{b&&(T.currentTouch.length?(T.srcEvent.stopPropagation(),Rt(T.srcEvent),d==null||d.end()):(b=!1,pe(),de(),v("touchEnd")))}).init()}(),s&&(s.addEventListener("wheel",M,{passive:!1}),y.push(()=>{s==null||s.removeEventListener("wheel",M,{passive:!1})})),t==null||t.addEventListener("click",A),document==null||document.addEventListener("mousemove",R),y.push(()=>{t==null||t.removeEventListener("click",A),document==null||document.removeEventListener("mousemove",R)});const te=N();f=Object.assign({},te),g=Object.assign({},te),h=3,Ve(),pe(),v("ready"),requestAnimationFrame(()=>{S(),s&&(s.style.visibility="")})}function N(){const $=Object.assign({},k("startPos")||{});let I=$.scale,te=1;te=typeof I=="string"?Z(I):typeof I=="number"?I:ee();const Y=Object.assign(Object.assign(Object.assign({},ft),$),{scale:te}),b=C()?O(te):void 0;if(b){const{x:T,y:X}=b;Y.x=T,Y.y=X}return Y}function L(){const $={top:0,left:0,width:0,height:0};if(o){const I=o.getBoundingClientRect();g.angle%180==90?($.top=I.top+.5*I.height-.5*I.width,$.left=I.left+.5*I.width-.5*I.height,$.width=I.height,$.height=I.width):($.top=I.top,$.left=I.left,$.width=I.width,$.height=I.height)}return $}function F(){let $=k("width"),I=k("height");if(r&&$==="auto"){const te=r.getAttribute("width");$=te?parseFloat(te+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):kt(s)?s.naturalWidth:kt(r)?r.naturalWidth:(o==null?void 0:o.getBoundingClientRect().width)||0}else $=Te($)?parseFloat($):$;if(r&&I==="auto"){const te=r.getAttribute("height");I=te?parseFloat(te+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):kt(s)?s.naturalHeight:kt(r)?r.naturalHeight:(o==null?void 0:o.getBoundingClientRect().height)||0}else I=Te(I)?parseFloat(I):I;return{width:$,height:I}}function B(){const $=L();return{width:$.width,height:$.height}}function C(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function O($){const I=c||k("event"),te=o==null?void 0:o.getBoundingClientRect();if(!I||!te||$<=1)return{x:0,y:0};const Y=(I.clientX||0)-te.left,b=(I.clientY||0)-te.top,{width:T,height:X}=B(),ne=oe($);if($>1){const ve=k("mouseMoveFactor");ve>1&&($*=ve)}let se=T*$,fe=X*$,me=.5*(se-T)-Y/T*100/100*(se-T),be=.5*(fe-X)-b/X*100/100*(fe-X);return me=Be(ne.x[0],me,ne.x[1]),be=Be(ne.y[0],be,ne.y[1]),{x:me,y:be}}function Z($="base"){if(!t)return 1;const I=t.getBoundingClientRect(),te=L(),{width:Y,height:b}=F(),T=me=>{if(typeof me=="number")return me;switch(me){case"min":case"base":return 1;case"cover":return Math.max(I.height/te.height,I.width/te.width)||1;case"full":case"max":{const be=g.angle%180==90?b:Y;return be&&te.width?be/te.width:1}}},X=k("minScale"),ne=k("maxScale"),se=Math.min(T("full"),T(X)),fe=typeof ne=="number"?T("full")*ne:Math.min(T("full"),T(ne));switch($){case"min":return se;case"base":return Be(se,1,fe);case"cover":return T("cover");case"full":return Math.min(fe,T("full"));case"max":return fe}}function Q(){return Z("min")}function ee(){return Z("base")}function P(){return Z("cover")}function H(){return Z("full")}function _(){return Z("max")}function oe($){const I={x:[0,0],y:[0,0]},te=t==null?void 0:t.getBoundingClientRect();if(!te)return I;const Y=L(),b=te.width,T=te.height;let X=Y.width,ne=Y.height,se=$=$===void 0?g.scale:$,fe=$;if(C()&&$>1){const me=k("mouseMoveFactor");me>1&&(X*$>b+.01&&(se*=me),ne*$>T+.01&&(fe*=me))}return X*=se,ne*=fe,$>1&&(X>b&&(I.x[0]=.5*(b-X),I.x[1]=.5*(X-b)),I.x[0]-=.5*(Y.left-te.left),I.x[1]-=.5*(Y.left-te.left),I.x[0]-=.5*(Y.left+Y.width-te.right),I.x[1]-=.5*(Y.left+Y.width-te.right),ne>T&&(I.y[0]=.5*(T-ne),I.y[1]=.5*(ne-T)),I.y[0]-=.5*(Y.top-te.top),I.y[1]-=.5*(Y.top-te.top),I.y[0]-=.5*(Y.top+Y.height-te.bottom),I.y[1]-=.5*(Y.top+Y.height-te.bottom)),I}function de(){if(!w()||!k("bounds")||!d)return;const $=Q(),I=_(),te=Be($,g.scale,I);if(g.scale<$-.01||g.scale>I+.01)return void ye(ge.ZoomTo,{scale:te});if(d.isRunning()||q())return;const Y=oe(te);g.x<Y.x[0]||g.x>Y.x[1]||g.y<Y.y[0]||g.y>Y.y[1]?(g.x=Be(Y.x[0],g.x,Y.x[1]),g.y=Be(Y.y[0],g.y,Y.y[1]),d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:d.getCurrentVelocities()}),d.from(f).to(g).start()):Ve()}function pe($){var I;if(!w())return;const te=ze(),Y=q(),b=re(),T=he(),X=Ae(),ne=qe();Ye(o,"is-fullsize",T),Ye(o,"is-expanded",b),Ye(o,"is-dragging",Y),Ye(o,"can-drag",te),Ye(o,"will-zoom-in",X),Ye(o,"will-zoom-out",ne);const se=$e(),fe=Oe(),me=_e(),be=!w();for(const ve of((I=$||t)===null||I===void 0?void 0:I.querySelectorAll("[data-panzoom-action]"))||[]){const Fe=ve.dataset.panzoomAction;let xe=!1;if(be)xe=!0;else switch(Fe){case ge.ZoomIn:se||(xe=!0);break;case ge.ZoomOut:me||(xe=!0);break;case ge.ToggleFull:{fe||me||(xe=!0);const V=ve.querySelector("g");V&&(V.style.display=T&&!xe?"none":"");break}case ge.IterateZoom:{se||me||(xe=!0);const V=ve.querySelector("g");V&&(V.style.display=se||xe?"":"none");break}case ge.ToggleCover:case ge.ToggleMax:se||me||(xe=!0)}xe?(ve.setAttribute("aria-disabled",""),ve.setAttribute("tabindex","-1")):(ve.removeAttribute("aria-disabled"),ve.removeAttribute("tabindex"))}}function ye($,I){var te;if(!($&&t&&r&&d&&w())||$===ge.Swipe&&Math.abs(d.getCurrentVelocities().scale)>.01)return;const Y=Object.assign({},g);let b=Object.assign({},g),T=oe(C()?Y.scale:f.scale);const X=d.getCurrentVelocities(),ne=L(),se=(((te=(I=I||{}).currentTouch)===null||te===void 0?void 0:te.length)||0)>1,fe=I.velocityX||0,me=I.velocityY||0;let be=I.center;I.srcEvent&&(be=Nt(Rr(I.srcEvent)));let ve=I.deltaX||0,Fe=I.deltaY||0;switch($){case ge.MoveRight:ve=I.deltaX||100;break;case ge.MoveLeft:ve=I.deltaX||-100;break;case ge.MoveUp:Fe=I.deltaY||-100;break;case ge.MoveDown:Fe=I.deltaY||100}let xe=[];switch($){case ge.Reset:b=Object.assign({},ft),b.scale=ee();break;case ge.Pan:case ge.Move:case ge.MoveLeft:case ge.MoveRight:case ge.MoveUp:case ge.MoveDown:if(q()){let j=1,D=1;b.x<=T.x[0]&&fe<=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-T.x[0]))),j*=.2),b.x>=T.x[1]&&fe>=0&&(j=Math.max(.01,1-Math.abs(1/ne.width*Math.abs(b.x-T.x[1]))),j*=.2),b.y<=T.y[0]&&me<=0&&(D=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-T.y[0]))),D*=.2),b.y>=T.y[1]&&me>=0&&(D=Math.max(.01,1-Math.abs(1/ne.height*Math.abs(b.y-T.y[1]))),D*=.2),b.x+=ve*j,b.y+=Fe*D}else b.x=Be(T.x[0],b.x+ve,T.x[1]),b.y=Be(T.y[0],b.y+Fe,T.y[1]);break;case ge.Swipe:const V=(j=0)=>Math.sign(j)*Math.pow(Math.abs(j),1.5);b.x+=Be(-1e3,V(fe),1e3),b.y+=Be(-1e3,V(me),1e3),me&&!fe&&(b.x=Be(T.x[0],b.x,T.x[1])),!me&&fe&&(b.y=Be(T.y[0],b.y,T.y[1])),X.x=fe,X.y=me;break;case ge.ZoomTo:b.scale=I.scale||1;break;case ge.ZoomIn:b.scale=b.scale*(I.scale||2),se||(b.scale=Math.min(b.scale,_()));break;case ge.ZoomOut:b.scale=b.scale*(I.scale||.5),se||(b.scale=Math.max(b.scale,Q()));break;case ge.ToggleCover:xe=[ee(),P()];break;case ge.ToggleFull:xe=[ee(),H()];break;case ge.ToggleMax:xe=[ee(),_()];break;case ge.IterateZoom:xe=[ee(),H(),_()];break;case ge.Zoom:const z=H();b.scale>=z-.05?b.scale=ee():b.scale=Math.min(z,b.scale*(I.scale||2));break;case ge.RotateCW:b.angle+=90;break;case ge.RotateCCW:b.angle-=90;break;case ge.FlipX:b.flipX*=-1;break;case ge.FlipY:b.flipY*=-1}if(f.angle!==void 0&&Math.abs(f.angle)>=360&&(b.angle-=360*Math.floor(f.angle/360),f.angle-=360*Math.floor(f.angle/360)),xe.length){const V=xe.findIndex(z=>z>b.scale+1e-4);b.scale=xe[V]||xe[0]}if(se&&(b.scale=Be(Q()*(se?.8:1),b.scale,_()*(se?1.6:1))),C()){const V=O(b.scale);if(V){const{x:z,y:j}=V;b.x=z,b.y=j}}else if(Math.abs(b.scale-Y.scale)>1e-4){let V=0,z=0;if(be)V=be.x,z=be.y;else{const J=t.getBoundingClientRect();V=J.x+.5*J.width,z=J.y+.5*J.height}let j=V-ne.left,D=z-ne.top;j-=.5*ne.width,D-=.5*ne.height;const G=(j-Y.x)/Y.scale,W=(D-Y.y)/Y.scale;b.x=j-G*b.scale,b.y=D-W*b.scale,!se&&k("bounds")&&(T=oe(b.scale),b.x=Be(T.x[0],b.x,T.x[1]),b.y=Be(T.y[0],b.y,T.y[1]))}if($===ge.Swipe){let V=94,z=17,j=500*b.scale,D=X;d.spring({tension:V,friction:z,maxSpeed:j,restDelta:.1,restSpeed:.1,velocity:D})}else $===ge.Pan||se?d.spring({tension:900,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):d.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:X});if(I.velocity===0||hn(f,b))f=Object.assign({},b),g=Object.assign({},b),d.end(),Ve(),pe();else{if(hn(g,b))return;d.from(f).to(b).start()}v("action",$)}function Ve(){if(!r||!o||!s)return;const{width:$,height:I}=F();Object.assign(o.style,{maxWidth:`min(${$}px, 100%)`,maxHeight:`min(${I}px, 100%)`});const te=function(){const{width:ve,height:Fe}=F(),{width:xe,height:V}=B();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:xe,fitHeight:V,fullWidth:ve,fullHeight:Fe};let{x:z,y:j,scale:D,angle:G,flipX:W,flipY:J}=f,ie=1/H(),ue=ve,le=Fe,ke=f.scale*ie,Ee=g.scale*ie;const Me=Math.max(xe,V),Ne=Math.min(xe,V);ve>Fe?(ue=Me,le=Ne):(ue=Ne,le=Me),ke=ve>Fe?Me*D/ve||1:Me*D/Fe||1;let je=ue?ve*Ee:0,it=le?Fe*Ee:0,st=ue&&le?ve*ke/je:0;return z=z+.5*ue-.5*je,j=j+.5*le-.5*it,{x:z,y:j,width:je,height:it,scale:st,flipX:W,flipY:J,angle:G,fitWidth:xe,fitHeight:V,fullWidth:ve,fullHeight:Fe}}(),{x:Y,y:b,width:T,height:X,scale:ne,angle:se,flipX:fe,flipY:me}=te;let be=`translate(${Qe(Y)}px, ${Qe(b)}px)`;be+=fe!==1||me!==1?` scaleX(${Qe(ne*fe)}) scaleY(${Qe(ne*me)})`:` scale(${Qe(ne)})`,se!==0&&(be+=` rotate(${se}deg)`),s.style.width=`${Qe(T)}px`,s.style.height=`${Qe(X)}px`,s.style.transform=`${be}`,v("render")}function Le(){let $=g.scale;const I=k("clickAction");let te=ee();if(I){let Y=[];switch(I){case ge.ZoomIn:te=2*$;break;case ge.ZoomOut:te=.5*$;break;case ge.ToggleCover:Y=[ee(),P()];break;case ge.ToggleFull:Y=[ee(),H()];break;case ge.ToggleMax:Y=[ee(),_()];break;case ge.IterateZoom:Y=[ee(),H(),_()];break;case ge.Zoom:const b=H();te=$>=b-.05?ee():Math.min(b,2*$)}if(Y.length){const b=Y.findIndex(T=>T>$+1e-4);te=Y[b]||ee()}}return te=Be(Q(),te,_()),te}function Ae(){return!!(w()&&Le()>g.scale)}function qe(){return!!(w()&&Le()<g.scale)}function _e(){return!!(w()&&g.scale>Q())}function $e(){return!!(w()&&g.scale<_())}function Oe(){return!!(w()&&g.scale<H())}function ze(){return!(!(w()&&re()&&l)||C())}function q(){return!(!w()||!(l!=null&&l.isPointerDown())||C())}function re(){return!!(w()&&g.scale>ee())}function he(){return!!(w()&&g.scale>=H())}function ae(){const $="in-fullscreen",I="with-panzoom-in-fullscreen";t==null||t.classList.toggle($);const te=t==null?void 0:t.classList.contains($);te?(document.documentElement.classList.add(I),document.addEventListener("keydown",K,!0)):(document.documentElement.classList.remove(I),document.removeEventListener("keydown",K,!0)),Ve(),v(te?"enterFS":"exitFS")}function K($){$.key!=="Escape"||$.defaultPrevented||ae()}const ce={canDrag:ze,canZoomIn:$e,canZoomOut:_e,canZoomToFull:Oe,destroy:function(){v("destroy");for(const $ of Object.values(p))$==null||$.destroy(ce);for(const $ of y)$();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),s&&(s.style.width="",s.style.height="",s.style.transform=""),o=void 0,r=void 0,s=void 0,f=Object.assign({},ft),g=Object.assign({},ft),d==null||d.destroy(),d=void 0,l==null||l.destroy(),l=void 0,h=4,ce},emit:v,execute:ye,getBoundaries:oe,getContainer:function(){return t},getContent:function(){return r},getFullDim:F,getGestures:function(){return l},getMousemovePos:O,getOptions:function(){return m},getPlugins:function(){return p},getScale:Z,getStartPosition:N,getState:function(){return h},getTransform:function($){return $===!0?g:f},getTween:function(){return d},getViewport:function(){return s},getWrapper:function(){return o},init:function(){return h=0,v("init"),function(){for(const[$,I]of Object.entries(Object.assign(Object.assign({},a),m.plugins||{})))if($&&!p[$]&&I instanceof Function){const te=I();te.init(ce),p[$]=te}v("initPlugins")}(),function(){const $=Object.assign(Object.assign({},La.classes),k("classes"));if(t&&(we(t,$.container),r=t.querySelector("."+$.content),!!r)){if(r.setAttribute("draggable","false"),o=t.querySelector("."+$.wrapper),o||(o=document.createElement("div"),we(o,$.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),s=t.querySelector("."+$.viewport),s||(s=document.createElement("div"),we(s,$.viewport),s.insertAdjacentElement("afterbegin",r),o.insertAdjacentElement("beforeend",s)),i=r.cloneNode(!0),i.removeAttribute("id"),o.insertAdjacentElement("afterbegin",i),r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),s instanceof HTMLPictureElement&&(s=s.querySelector("img")),s&&(s.style.visibility="hidden",k("protected"))){s.addEventListener("contextmenu",te=>{Rt(te)});const I=document.createElement("div");we(I,"f-panzoom__protected"),s.appendChild(I)}v("initLayout")}}(),function(){if(t&&o&&!u){let $=null;u=new ResizeObserver(()=>{w()&&($=$||requestAnimationFrame(()=>{w()&&(pe(),de(),v("refresh")),$=null}))}),u.observe(o),y.push(()=>{u==null||u.disconnect(),u=void 0,$&&(cancelAnimationFrame($),$=null)})}}(),function(){if(!t||!r)return;if(!kt(r)||!kt(i))return void x();const $=()=>{r&&kt(r)&&r.decode().then(()=>{x()}).catch(()=>{x()})};if(h=1,t.classList.add("is-loading"),v("loading"),i.src&&i.complete)return void $();(function(){if(!t||t!=null&&t.querySelector(".f-spinner"))return;const I=k("spinnerTpl"),te=wt(I);te&&(te.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",te))})(),i.addEventListener("load",$,!1),i.addEventListener("error",$,!1),y.push(()=>{i==null||i.removeEventListener("load",$,!1),i==null||i.removeEventListener("error",$,!1)})}(),ce},isDragging:q,isExpanded:re,isFullsize:he,isMousemoveMode:C,localize:function($,I=[]){const te=k("l10n")||{};$=String($).replace(/\{\{(\w+)\}\}/g,(Y,b)=>te[b]||Y);for(let Y=0;Y<I.length;Y++)$=$.split(I[Y][0]).join(I[Y][1]);return $=$.replace(/\{\{(.*?)\}\}/g,(Y,b)=>b)},off:function($,I){for(const te of $ instanceof Array?$:[$])E.has(te)&&E.set(te,E.get(te).filter(Y=>Y!==I));return ce},on:function($,I){for(const te of $ instanceof Array?$:[$])E.set(te,[...E.get(te)||[],I]);return ce},toggleFS:ae,updateControls:pe,version:"6.1.3",willZoomIn:Ae,willZoomOut:qe};return ce};$a.l10n={en_EN:Fa},$a.getDefaults=()=>La;/*! License details at fancyapps.com/license */const Pa=(t,n)=>{let a=[];return t.childNodes.forEach(o=>{o.nodeType!==Node.ELEMENT_NODE||n&&!o.matches(n)||a.push(o)}),a};/*! License details at fancyapps.com/license */const ot=(t,...n)=>{const a=n.length;for(let o=0;o<a;o++){const r=n[o]||{};Object.entries(r).forEach(([i,s])=>{const l=Array.isArray(s)?[]:{};t[i]||Object.assign(t,{[i]:l}),Ze(s)?Object.assign(t[i],ot(t[i],s)):Array.isArray(s)?Object.assign(t,{[i]:[...s]}):Object.assign(t,{[i]:s})})}return t};/*! License details at fancyapps.com/license */const Zn=function(t=0,n=0,a=0,o=0,r=0,i=!1){const s=(t-n)/(a-n)*(r-o)+o;return i?o<r?Be(o,s,r):Be(r,s,o):s};/*! License details at fancyapps.com/license */const Oa=Object.assign(Object.assign({},Fa),{ERROR:"Something went wrong. <br /> Please try again later.",NEXT:"Next page",PREV:"Previous page",GOTO:"Go to page #%d",DOWNLOAD:"Download",TOGGLE_FULLSCREEN:"Toggle full-screen mode",TOGGLE_EXPAND:"Toggle full-size mode",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_AUTOPLAY:"Toggle slideshow"});/*! License details at fancyapps.com/license */const Ht=t=>{t.cancelable&&t.preventDefault()},nn={adaptiveHeight:!1,center:!0,classes:{container:"f-carousel",isEnabled:"is-enabled",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",hasAdaptiveHeight:"has-adaptive-height",viewport:"f-carousel__viewport",slide:"f-carousel__slide",isSelected:"is-selected"},dragFree:!1,enabled:!0,errorTpl:'<div class="f-html">{{ERROR}}</div>',fill:!1,infinite:!0,initialPage:0,l10n:Oa,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:160,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let Ir,qr=0;const Yn=(t,n={},a={})=>{qr++;let o,r,i,s,l,d=0,u=Object.assign({},nn),c=Object.assign({},nn),h={},m=null,p=null,f=!1,g=!1,y=!1,k=!1,w="height",E=0,v=!0,M=0,A=0,R=0,S=0,x="*",N=[],L=[];const F=new Set;let B=[],C=[],O=0,Z=0,Q=0;function ee(V,...z){let j=c[V];return j&&j instanceof Function?j(xe,...z):j}function P(V,z=[]){const j=ee("l10n")||{};V=String(V).replace(/\{\{(\w+)\}\}/g,(D,G)=>j[G]||D);for(let D=0;D<z.length;D++)V=V.split(z[D][0]).join(z[D][1]);return V=V.replace(/\{\{(.*?)\}\}/g,(D,G)=>G)}const H=new Map;function _(V,...z){const j=[...H.get(V)||[]];c.on&&j.push(c.on[V]);for(const D of j)D&&D instanceof Function&&D(xe,...z);V!=="*"&&_("*",V,...z)}function oe(){var V,z;const j=ot({},nn,u);ot(j,nn,u);let D="";const G=u.breakpoints||{};if(G)for(const[W,J]of Object.entries(G))window.matchMedia(W).matches&&(D+=W,ot(j,J));if(l===void 0||D!==l){if(l=D,d!==0){let W=(z=(V=C[M])===null||V===void 0?void 0:V.slides[0])===null||z===void 0?void 0:z.index;W===void 0&&(W=c.initialSlide),j.initialSlide=W,j.slides=[];for(const J of N)J.isVirtual&&j.slides.push(J)}be(),c=j,ee("enabled")!==!1&&(d=0,_("init"),function(){for(const[W,J]of Object.entries(Object.assign(Object.assign({},a),c.plugins||{})))if(W&&!h[W]&&J instanceof Function){const ie=J();ie.init(xe,Yn),h[W]=ie}_("initPlugins")}(),function(){if(!m)return;const W=ee("classes")||{};we(m,W.container);const J=ee("style");if(J&&Ze(J))for(const[ie,ue]of Object.entries(J))m.style.setProperty(ie,ue);p=m.querySelector(`.${W.viewport}`),p||(p=document.createElement("div"),we(p,W.viewport),p.append(...Pa(m,`.${W.slide}`)),m.insertAdjacentElement("afterbegin",p)),m.carousel=xe,_("initLayout")}(),function(){if(!p)return;const W=ee("classes")||{};N=[],[...Pa(p,`.${W.slide}`)].forEach(J=>{if(J.parentElement){const ie=re(Object.assign({el:J,isVirtual:!1},J.dataset||{}));_("createSlide",ie),N.push(ie)}}),ce();for(const J of N)_("addSlide",J);q(ee("slides"));for(const J of N){const ie=J.el;(ie==null?void 0:ie.parentElement)===p&&(we(ie,c.classes.slide),we(ie,J.class),ne(J),_("attachSlideEl",J))}_("initSlides")}(),$(),d=1,we(m,(ee("classes")||{}).isEnabled||""),me(),Le(),r=Mt().on("start",()=>{o&&o.isPointerDown()||(Ve(),me())}).on("step",W=>{const J=E;E=W.pos,E!==J&&(v=!1,me())}).on("end",W=>{o!=null&&o.isPointerDown()||(E=W.pos,r&&!g&&(E<R||E>S)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(R,E,S)}).start():v||(v=!0,_("settle")))}),pe(),function(){if(!m||!p)return;m.addEventListener("click",b,{passive:!1}),document.addEventListener("mousemove",de);const W=p.getBoundingClientRect();if(O=W.height,Z=W.width,!i){let J=null;i=new ResizeObserver(()=>{J||(J=requestAnimationFrame(()=>{(function(){if(d!==1||!p)return;const ie=C.length,ue=p.getBoundingClientRect(),le=ue.height,ke=ue.width;ie>1&&(k&&Math.abs(le-O)<.5||!k&&Math.abs(ke-Z)<.5)||($(),pe(),O=le,Z=ke,k&&!le||!k&&!ke||m&&p&&(ie===C.length&&(o!=null&&o.isPointerDown())||(ee("dragFree")&&(g||E>R&&E<S)?(Ve(),me()):se(M,{transition:!1}))))})(),J=null}))}),i.observe(p)}}(),_("ready"))}}function de(V){Ir=V}function pe(){ee("gestures")===!1?o&&(o.destroy(),o=void 0):o||function(){const V=ee("gestures");!o&&V!==!1&&p&&(o=tn(p,V).on("start",z=>{var j,D;if(!r)return;const{srcEvent:G}=z;k&&pn(G)&&!_t(G.target)&&Ht(G),r.pause(),r.getCurrentVelocities().pos=0;const W=(j=C[M])===null||j===void 0?void 0:j.slides[0];W&&F.has(W.index)&&W.el&&(E=W.offset||0,E+=(function(J){const ie=window.getComputedStyle(J),ue=new DOMMatrixReadOnly(ie.transform);return{width:ue.m41||0,height:ue.m42||0}}(W.el)[w]||0)*(y&&!k?1:-1)),te(),g||(E<R||E>S)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((D=r.getCurrentVelocities())===null||D===void 0?void 0:D.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Be(R,E,S)}).start()}).on("move",z=>{var j,D;const{srcEvent:G,axis:W}=z,J=G.target;if(W||(Ht(G),G.stopPropagation(),G.stopImmediatePropagation()),(W==="y"&&k||W==="x"&&!k)&&(Ht(G),G.stopPropagation()),!W)return;const{deltaX:ie,deltaY:ue}=z;if(!r||pn(G)&&((j=G.touches)===null||j===void 0?void 0:j.length)>1||W==="y"&&!k||W==="x"&&k||J&&_t(J)&&(W!=="x"||k))return;const le=y&&!k?1:-1;let ke=k?ue:ie,Ee=r!=null&&r.isRunning()?r.getEndValues().pos:E,Me=1;g||(Ee<=R&&ke*le<0?(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-R))||0)),Me*=.2):Ee>=S&&ke*le>0&&(Me=Math.max(.01,1-(Math.abs(1/$e()*Math.abs(Ee-S))||0)),Me*=.2)),Ee+=ke*Me*le,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((D=r.getCurrentVelocities())===null||D===void 0?void 0:D.pos)||0,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:Ee}).start()}).on("panstart",z=>{(z==null?void 0:z.axis)===(k?"y":"x")&&we(p,"is-dragging")}).on("panend",()=>{Ke(p,"is-dragging")}).on("end",z=>{var j,D;const{srcEvent:G,axis:W,velocityX:J,velocityY:ie,currentTouch:ue}=z;if(ue.length>0||!r)return;const le=G.target,ke=le&&_t(le)&&!(W==="x"&&!k);k&&pn(G)&&!z.axis&&b(G);const Ee=C.length,Me=ee("dragFree");if(!Ee)return;const Ne=ee("vertical")?ie:J;let je=r!=null&&r.isRunning()?r.getEndValues().pos:E;const it=y&&!k?1:-1;if(ke||(je+=Ne*(Me?5:1)*it),!g&&(Ne*it<=0&&je<R||Ne*it>=0&&je>S)){let lt=0;return Math.abs(Ne)>0&&(lt=2*Math.abs(Ne),lt=Math.min(.3*$e(),lt)),je=Be(R+-1*lt,je,S+lt),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start()}if(Me||!((j=h.Autoscroll)===null||j===void 0)&&j.isEnabled())return void(Math.abs(Ne)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Ne,restDelta:1,restSpeed:1}).from({pos:E}).to({pos:je}).start():r.isRunning()||v||(v=!0,_("settle")));if(!Me&&!(!((D=h.Autoscroll)===null||D===void 0)&&D.isEnabled())&&(!z.offsetX&&!z.offsetY||W==="y"&&!k||W==="x"&&k))return void se(M,{transition:"tween"});let st=qe(je);Math.abs(Ne)>10&&st===M&&(st+=Ne>0?y&&!k?1:-1:y&&!k?-1:1),se(st,{transition:"tween",tween:{velocity:-1*Ne}})}).init())}(),Ye(p,"is-draggable",!!o&&C.length>0)}function ye(V="*"){var z;const j=[];for(const D of N)(V==="*"||D.class&&D.class.includes(V)||D.el&&(!((z=D.el)===null||z===void 0)&&z.classList.contains(V)))&&j.push(D);s=void 0,x=V,L=[...j]}function Ve(){if(!r)return;const V=qe(r!=null&&r.isRunning()?r.getEndValues().pos:E);V!==M&&(s=M,M=V,ne(),Le(),Ae(),_("change",M,s))}function Le(){var V,z;if(!m)return;for(const G of m.querySelectorAll("[data-carousel-index]"))G.innerHTML=M+"";for(const G of m.querySelectorAll("[data-carousel-page]"))G.innerHTML=M+1+"";for(const G of m.querySelectorAll("[data-carousel-pages]"))G.innerHTML=C.length+"";for(const G of m.querySelectorAll("[data-carousel-go-to]"))parseInt(((V=G.dataset)===null||V===void 0?void 0:V.carouselGoTo)||"-1",10)===M?G.setAttribute("aria-current","true"):G.removeAttribute("aria-current");for(const G of m.querySelectorAll("[data-carousel-go-prev]"))G.toggleAttribute("aria-disabled",!ve()),ve()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");for(const G of m.querySelectorAll("[data-carousel-go-next]"))G.toggleAttribute("aria-disabled",!Fe()),Fe()?G.removeAttribute("tabindex"):G.setAttribute("tabindex","-1");let j=!1;const D=(z=C[M])===null||z===void 0?void 0:z.slides[0];D&&(D.downloadSrc||D.type==="image"&&D.src)&&(j=!0);for(const G of m.querySelectorAll("[data-carousel-download]"))G.toggleAttribute("aria-disabled",!j)}function Ae(V){var z;V||(V=(z=C[M])===null||z===void 0?void 0:z.slides[0]);const j=V==null?void 0:V.el;if(j)for(const D of j.querySelectorAll("[data-slide-index]"))D.innerHTML=V.index+1+""}function qe(V){var z,j,D;if(!C.length)return 0;const G=Oe();let W=V;g?W-=Math.floor((V-((z=C[0])===null||z===void 0?void 0:z.pos))/G)*G||0:W=Be((j=C[0])===null||j===void 0?void 0:j.pos,V,(D=C[C.length-1])===null||D===void 0?void 0:D.pos);const J=new Map;let ie=0;for(const le of C){const ke=Math.abs(le.pos-W),Ee=Math.abs(le.pos-W-G),Me=Math.abs(le.pos-W+G),Ne=Math.min(ke,Ee,Me);J.set(ie,Ne),ie++}const ue=J.size>0?[...J.entries()].reduce((le,ke)=>ke[1]<le[1]?ke:le):[M,0];return parseInt(ue[0])}function _e(){return Q}function $e(){let V=0;return p&&(p.childElementCount||(p.style.display="grid"),V=p.getBoundingClientRect()[w]||0,p.style.display=""),V}function Oe(V=!0){return L.length?L.reduce((z,j)=>z+j.dim,0)+(L.length-(g&&V?0:1))*Q:0}function ze(V){const z=Oe(),j=$e();if(!z||!p||!j)return[];const D=[];V=V===void 0?E:V,g&&(V-=Math.floor(V/z)*z||0);let G=0,W=0;if(f){const ie=p.getBoundingClientRect();G=Math.abs(ie[k?"top":"left"]),W=Math.abs(window[k?"innerHeight":"innerWidth"]-ie[k?"bottom":"right"])}let J=0;for(let ie of L){const ue=(le=0)=>{D.indexOf(ie)>-1||(ie.pos=J-V+le||0,ie.offset+le>V-ie.dim-G+.51&&ie.offset+le<V+j+W-.51&&D.push(ie))};ie.offset=J,g&&(ue(z),ue(-1*z)),ue(),J+=ie.dim+Q}return D}function q(V,z){const j=[];for(const D of Array.isArray(V)?V:[V]){const G=re(Object.assign(Object.assign({},D),{isVirtual:!0}));G.el||(G.el=document.createElement("div")),_("createSlide",G),j.push(G)}N.splice(z===void 0?N.length:z,0,...j),ce();for(const D of j)_("addSlide",D),he(D);return ye(x),j}function re(V){return(Te(V)||V instanceof HTMLElement)&&(V={html:V}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},V)}function he(V){let z=V.el;if(!V||!z)return;const j=V.html?V.html instanceof HTMLElement?V.html:wt(V.html):void 0;j&&(we(j,"f-html"),V.htmlEl=j,we(z,"has-html"),z.append(j),_("contentReady",V))}function ae(V){if(!p||!V)return;let z=V.el;if(z){if(z.setAttribute("index",V.index+""),z.parentElement!==p){let j;we(z,c.classes.slide),we(z,V.class),ne(V);for(const D of N)if(D.index>V.index){j=D.el;break}p.insertBefore(z,j&&p.contains(j)?j:null),_("attachSlideEl",V)}return Ae(V),z}}function K(V){const z=V==null?void 0:V.el;z&&(z.remove(),I(z),_("detachSlideEl",V))}function ce(){for(let V=0;V<N.length;V++){const z=N[V],j=z.el;j&&(z.index!==V&&I(j),j.setAttribute("index",`${V}`)),z.index=V}}function $(){var V,z,j,D,G;if(!m||!p)return;y=ee("rtl"),k=ee("vertical"),w=k?"height":"width";const W=ee("classes");if(Ye(m,W.isLTR,!y),Ye(m,W.isRTL,y),Ye(m,W.isHorizontal,!k),Ye(m,W.isVertical,k),Ye(m,W.hasAdaptiveHeight,ee("adaptiveHeight")),!$e())return;const J=window.getComputedStyle(p);f=J.getPropertyValue("overflow-"+(k?"y":"x"))==="visible",Q=p&&parseFloat(J.getPropertyValue("--f-carousel-gap"))||0;const ie=function(){let ue=0;if(p){let le=document.createElement("div");le.style.display="block",we(le,c.classes.slide),p.appendChild(le),ue=le.getBoundingClientRect()[w],le.remove(),le=void 0}return ue}();for(const ue of L){const le=ue.el;let ke=0;if(!ue.isVirtual&&le&&Qt(le)){let Ee=!1;le.parentElement&&le.parentElement===p||(p.appendChild(le),Ee=!0),ke=le.getBoundingClientRect()[w],Ee&&((V=le.parentElement)===null||V===void 0||V.removeChild(le))}else ke=ie;ue.dim=ke}if(g=!1,ee("infinite")){g=!0;const ue=Oe();let le=$e();if(f){const ke=p.getBoundingClientRect();le+=ke.left,le+=ke.right-ke.width}for(let ke=0;ke<L.length;ke++){const Ee=((z=L[ke])===null||z===void 0?void 0:z.dim)+Q;if(ue-Ee<le&&ue-Ee-le<Ee){g=!1;break}}}(function(){var ue;if(!m)return;const le=$e(),ke=Oe(!1);let Ee=ee("slidesPerPage");Ee=Ee==="auto"?1/0:parseFloat(Ee+""),C=[];let Me=0,Ne=0;for(const Re of L)(!C.length||Me+Re.dim-le>.05||Ne>=Ee)&&(C.push({index:C.length,slides:[],dim:0,offset:0,pos:0}),Me=0,Ne=0),(ue=C[C.length-1])===null||ue===void 0||ue.slides.push(Re),Me+=Re.dim+Q,Ne++;const je=ee("center"),it=ee("fill");let st=0;for(const Re of C){Re.dim=(Re.slides.length-1)*Q;for(const dt of Re.slides)Re.dim+=dt.dim;Re.offset=st,Re.pos=st,je!==!1&&(Re.pos-=.5*(le-Re.dim)),it&&!g&&ke>le&&(Re.pos=Be(0,Re.pos,ke-le)),st+=Re.dim+Q}const lt=[];let bt;for(const Re of C){const dt=Object.assign({},Re);bt&&Math.abs(dt.pos-bt.pos)<.1?(bt.dim+=dt.dim,bt.slides=[...bt.slides,...dt.slides]):(bt=dt,dt.index=lt.length,lt.push(dt))}C=lt,M=Be(0,M,C.length-1)})(),R=((j=C[0])===null||j===void 0?void 0:j.pos)||0,S=((D=C[C.length-1])===null||D===void 0?void 0:D.pos)||0,d===0?function(){var ue;s=void 0,M=ee("initialPage");const le=ee("initialSlide")||void 0;le!==void 0&&(M=xe.getPageIndex(le)||0),M=Be(0,M,C.length-1),E=((ue=C[M])===null||ue===void 0?void 0:ue.pos)||0,A=E}():A=((G=C[M||0])===null||G===void 0?void 0:G.pos)||0,_("refresh"),Le()}function I(V){if(!V||!Qt(V))return;const z=parseInt(V.getAttribute("index")||"-1");let j="";for(const G of Array.from(V.classList)){const W=G.match(/^f-(\w+)(Out|In)$/);W&&W[1]&&(j=W[1]+"")}if(!V||!j)return;const D=[`f-${j}Out`,`f-${j}In`,"to-prev","to-next","from-prev","from-next"];V.removeEventListener("animationend",Y),Ke(V,D.join(" ")),F.delete(z)}function te(){if(!p)return;const V=F.size>0;for(const z of L)I(z.el);F.clear(),V&&me()}function Y(V){var z;((z=V.animationName)===null||z===void 0?void 0:z.substring(0,2))==="f-"&&(I(V.target),F.size||(Ke(m,"in-transition"),!v&&Math.abs(xe.getPosition(!0)-A)<.5&&(v=!0,_("settle"))),me())}function b(V){var z;if(V.defaultPrevented)return;const j=V.composedPath()[0];if(j.closest("[data-carousel-go-prev]"))return Ht(V),void xe.prev();if(j.closest("[data-carousel-go-next]"))return Ht(V),void xe.next();const D=j.closest("[data-carousel-go-to]");if(D)return Ht(V),void xe.goTo(parseFloat(D.dataset.carouselGoTo||"")||0);if(j.closest("[data-carousel-download]")){Ht(V);const G=(z=C[M])===null||z===void 0?void 0:z.slides[0];if(G&&(G.downloadSrc||G.type==="image"&&G.src)){const W=G.downloadFilename,J=document.createElement("a"),ie=G.downloadSrc||G.src||"";J.href=ie,J.target="_blank",J.download=W||ie,J.click()}}else _("click",V)}function T(V){var z;const j=V.el;j&&((z=j.querySelector(".f-spinner"))===null||z===void 0||z.remove())}function X(V){var z;const j=V.el;j&&((z=j.querySelector(".f-html.is-error"))===null||z===void 0||z.remove(),Ke(j,"has-error"))}function ne(V){var z;V||(V=(z=C[M])===null||z===void 0?void 0:z.slides[0]);const j=V==null?void 0:V.el;if(!j)return;let D=ee("formatCaption",V);D===void 0&&(D=V.caption),D=D||"";const G=ee("captionEl");if(G&&G instanceof HTMLElement){if(V.index!==M)return;if(Te(D)&&(G.innerHTML=P(D+"")),D instanceof HTMLElement){if(D.parentElement===G)return;G.innerHTML="",D.parentElement&&(D=D.cloneNode(!0)),G.append(D)}return}if(!D)return;let W=V.captionEl||j.querySelector(".f-caption");!W&&D instanceof HTMLElement&&D.classList.contains("f-caption")&&(W=D),W||(W=document.createElement("div"),we(W,"f-caption"),Te(D)?W.innerHTML=P(D+""):D instanceof HTMLElement&&(D.parentElement&&(D=D.cloneNode(!0)),W.append(D)));const J=`f-caption-${qr}_${V.index}`;W.setAttribute("id",J),W.dataset.selectable="true",we(j,"has-caption"),j.setAttribute("aria-labelledby",J),V.captionEl=W,j.insertAdjacentElement("beforeend",W)}function se(V,z={}){var j,D;let{transition:G,tween:W}=Object.assign({transition:c.transition,tween:c.tween},z||{});if(!m||!r)return;const J=C.length;if(!J||function(le,ke){var Ee,Me,Ne,je;if(!(m&&r&&ke&&Te(ke)&&ke!=="tween")||((Ee=C[M])===null||Ee===void 0?void 0:Ee.slides.length)>1)return!1;const it=C.length;let st=le>M?1:-1;le=g?(le%it+it)%it:Be(0,le,it-1),y&&(st*=-1);const lt=(Me=C[M])===null||Me===void 0?void 0:Me.slides[0],bt=lt==null?void 0:lt.index,Re=(Ne=C[le])===null||Ne===void 0?void 0:Ne.slides[0],dt=Re==null?void 0:Re.index,Li=(je=C[le])===null||je===void 0?void 0:je.pos;if(dt===void 0||bt===void 0||bt===dt||E===Li||Math.abs($e()-((Re==null?void 0:Re.dim)||0))>1)return!1;v=!1,r.pause(),te(),we(m,"in-transition"),E=A=Li;const on=ae(lt),rn=ae(Re);return Ve(),on&&(F.add(bt),on.style.transform="",on.addEventListener("animationend",Y),Ke(on,c.classes.isSelected),on.inert=!1,we(on,`f-${ke}Out to-${st>0?"next":"prev"}`)),rn&&(F.add(dt),rn.style.transform="",rn.addEventListener("animationend",Y),we(rn,c.classes.isSelected),rn.inert=!1,we(rn,`f-${ke}In from-${st>0?"prev":"next"}`)),me(),!0}(V,G))return;V=g?(V%J+J)%J:Be(0,V,J-1),A=((j=C[V||0])===null||j===void 0?void 0:j.pos)||0;const ue=r.isRunning()?r.getEndValues().pos:E;if(Math.abs(A-ue)<1)return E=A,M!==V&&(ne(),s=M,M=V,Le(),Ae(),_("change",M,s)),me(),void(v||(v=!0,_("settle")));if(r.pause(),te(),g){const le=Oe(),ke=Math.floor((ue-((D=C[0])===null||D===void 0?void 0:D.pos))/le)||0,Ee=A+ke*le;A=[Ee+le,Ee,Ee-le].reduce(function(Me,Ne){return Math.abs(Ne-ue)<Math.abs(Me-ue)?Ne:Me})}G!==!1&&Ze(W)?r.spring(ot({},c.tween,W)).from({pos:E}).to({pos:A}).start():(E=A,Ve(),me(),v||(v=!0,_("settle")))}function fe(V){var z;let j=E;if(g&&V!==!0){const D=Oe();j-=(Math.floor((E-((z=C[0])===null||z===void 0?void 0:z.pos)||0)/D)||0)*D}return j}function me(){var V;if(!m||!p)return;B=ze();const z=new Set,j=[],D=C[M],G=c.setTransform;let W;for(const J of L){const ie=F.has(J.index),ue=B.indexOf(J)>-1,le=((V=D==null?void 0:D.slides)===null||V===void 0?void 0:V.indexOf(J))>-1;if(J.isVirtual&&!ie&&!ue)continue;let ke=ae(J);if(ke&&(j.push(J),le&&z.add(ke),ee("adaptiveHeight")&&le)){const Ee=(ke.firstElementChild||ke).getBoundingClientRect().height;W=W==null?Ee:Math.max(W,Ee)}}p&&W&&(p.style.height=`${W}px`),[...Pa(p,`.${c.classes.slide}`)].forEach(J=>{Ye(J,c.classes.isSelected,z.has(J));const ie=N[parseInt(J.getAttribute("index")||"-1")];if(!ie)return J.remove(),void I(J);const ue=F.has(ie.index),le=B.indexOf(ie)>-1;if(ie.isVirtual&&!ue&&!le)return void K(ie);if(J.inert=!le,G===!1)return;let ke=ie.pos?Math.round(1e4*ie.pos)/1e4:0,Ee=0,Me=0,Ne=0,je=0;ue||(Ee=k?0:y?-1*ke:ke,Me=k?ke:0,Ne=Zn(Ee,0,ie.dim,0,100),je=Zn(Me,0,ie.dim,0,100)),G instanceof Function&&!ue?G(xe,ie,{x:Ee,y:Me,xPercent:Ne,yPercent:je}):J.style.transform=Ee||Me?`translate3d(${Ne}%, ${je}%,0)`:""}),_("render",j)}function be(){m==null||m.removeEventListener("click",b),document.removeEventListener("mousemove",de),F.clear(),i==null||i.disconnect(),i=void 0;for(const V of N){let z=V.el;z&&Qt(z)&&(V.state=void 0,T(V),X(V),V.isVirtual?(K(V),V.el=void 0):(I(z),z.style.transform="",p&&!p.contains(z)&&p.appendChild(z)))}for(const V of Object.values(h))V==null||V.destroy();h={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const[V,z]of Object.entries(c.classes||{}))V!=="container"&&Ke(m,z);Ke(p,"is-draggable")}function ve(){return g||M>0}function Fe(){return g||M<C.length-1}const xe={add:function(V,z){var j;let D=E;const G=M,W=Oe(),J=r!=null&&r.isRunning()?r.getEndValues().pos:E,ie=W&&Math.floor((J-(((j=C[0])===null||j===void 0?void 0:j.pos)||0))/W)||0;return q(V,z),ye(x),$(),r&&W&&(G===M&&(D-=ie*W),D===A?E=A:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:D}).to({pos:A}).start()),me(),xe},canGoPrev:ve,canGoNext:Fe,destroy:function(){return _("destroy"),window.removeEventListener("resize",oe),be(),H.clear(),m=null,C=[],N=[],c=Object.assign({},nn),h={},L=[],l=void 0,x="*",d=2,xe},emit:_,filter:function(V="*"){return ye(V),$(),E=Be(R,E,S),me(),_("filter",V),xe},getContainer:function(){return m},getGapDim:_e,getGestures:function(){return o},getLastMouseMove:function(){return Ir},getOption:function(V){return ee(V)},getOptions:function(){return c},getPage:function(){return C[M]},getPageIndex:function(V){if(V!==void 0){for(const z of C||[])for(const j of z.slides)if(j.index===V)return z.index;return-1}return M},getPageIndexFromPosition:qe,getPageProgress:function(V,z){var j;V===void 0&&(V=M);const D=C[V];if(!D)return V>M?-1:1;const G=Oe(),W=_e();let J=D.pos,ie=fe();if(g&&z!==!0){const ue=Math.floor((ie-((j=C[0])===null||j===void 0?void 0:j.pos))/G)||0;ie-=ue*G,J=[J+G,J,J-G].reduce(function(le,ke){return Math.abs(ke-ie)<Math.abs(le-ie)?ke:le})}return(ie-J)/(D.dim+W)||0},getPageVisibility:function(V){var z;V===void 0&&(V=M);const j=C[V];if(!j)return V>M?-1:1;const D=fe(),G=$e();let W=j.pos;if(g){const J=Oe(),ie=W+(Math.floor((D-((z=C[0])===null||z===void 0?void 0:z.pos))/J)||0)*J;W=[ie+J,ie,ie-J].reduce(function(ue,le){return Math.abs(le-D)<Math.abs(ue-D)?le:ue})}return W>D&&W+j.dim<D+G?1:W<D?(W+j.dim-D)/j.dim||0:W+j.dim>D+G&&(D+G-W)/j.dim||0},getPages:function(){return C},getPlugins:function(){return h},getPosition:fe,getSlides:function(){return N},getState:function(){return d},getTotalSlideDim:Oe,getTween:function(){return r},getViewport:function(){return p},getViewportDim:$e,getVisibleSlides:function(V){return V===void 0?B:ze(V)},goTo:se,hasNavigated:function(){return s!==void 0},hideError:X,hideLoading:T,init:function(){if(!t||!Qt(t))throw new Error("No Element found");return d!==0&&(be(),d=0),m=t,u=n,window.removeEventListener("resize",oe),u.breakpoints&&window.addEventListener("resize",oe),oe(),xe},isInfinite:function(){return g},isInTransition:function(){return F.size>0},isRTL:function(){return y},isSettled:function(){return v},isVertical:function(){return k},localize:function(V,z=[]){return P(V,z)},next:function(V={}){return se(M+1,V),xe},off:function(V,z){for(const j of V instanceof Array?V:[V])H.has(j)&&H.set(j,H.get(j).filter(D=>D!==z));return xe},on:function(V,z){for(const j of V instanceof Array?V:[V])H.set(j,[...H.get(j)||[],z]);return xe},prev:function(V={}){return se(M-1,V),xe},reInit:function(V={},z={}){return be(),d=0,l=void 0,x="*",n=V,u=V,a=z,oe(),xe},remove:function(V){V===void 0&&(V=N.length-1);const z=N[V];return z&&(_("removeSlide",z),z.el&&(I(z.el),z.el.remove(),z.el=void 0),N.splice(V,1),ye(x),$(),E=Be(R,E,S),me()),xe},setPosition:function(V){E=V,Ve(),me()},showError:function(V,z){T(V),X(V);const j=V.el;if(j){const D=document.createElement("div");we(D,"f-html"),we(D,"is-error"),D.innerHTML=P(z||"<p>{{ERROR}}</p>"),V.htmlEl=D,we(j,"has-html"),we(j,"has-error"),j.insertAdjacentElement("afterbegin",D),_("contentReady",V)}return xe},showLoading:function(V){const z=V.el,j=z==null?void 0:z.querySelector(".f-spinner");if(!z||j)return xe;const D=ee("spinnerTpl"),G=wt(D);return G&&(we(G,"f-spinner"),z.insertAdjacentElement("beforeend",G)),xe},version:"6.1.3"};return xe};Yn.l10n={en_EN:Oa},Yn.getDefaults=()=>nn;/*! License details at fancyapps.com/license */const Wr=(t=!0,n="--f-scrollbar-compensate",a="--f-body-margin",o="hide-scrollbar")=>{const r=document,i=r.body,s=r.documentElement;if(t){if(i.classList.contains(o))return;let l=window.innerWidth-s.getBoundingClientRect().width;l<0&&(l=0),s.style.setProperty(n,`${l}px`);const d=parseFloat(window.getComputedStyle(i).marginRight);d&&i.style.setProperty(a,`${d}px`),i.classList.add(o)}else i.classList.remove(o),i.style.setProperty(a,""),r.documentElement.style.setProperty(n,"")};/*! License details at fancyapps.com/license */function Xn(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const zt=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const Ur={tpl:t=>`<img class="f-panzoom__content"
7
7
  ${t.srcset?'data-lazy-srcset="{{srcset}}"':""}
8
8
  ${t.sizes?'data-lazy-sizes="{{sizes}}"':""}
9
9
  data-lazy-src="{{src}}" alt="{{alt}}" />`},P3=()=>{let t;function n(c,h){const m=t==null?void 0:t.getOptions().Zoomable;let p=(Ze(m)?Object.assign(Object.assign({},Ur),m):Ur)[c];return p&&typeof p=="function"&&h?p(h):p}function a(){t&&t.getOptions().Zoomable!==!1&&(t.on("addSlide",i),t.on("removeSlide",s),t.on("attachSlideEl",l),t.on("click",r),t.on("change",o),t.on("ready",o))}function o(){d();const c=(t==null?void 0:t.getVisibleSlides())||[];if(c.length>1||(t==null?void 0:t.getOption("transition"))==="slide")for(const h of c){const m=h.panzoomRef;m&&((t==null?void 0:t.getPage().slides)||[]).indexOf(h)<0&&m.execute(ge.ZoomTo,Object.assign({},m.getStartPosition()))}}function r(c,h){const m=h.target;m&&!h.defaultPrevented&&m.dataset.panzoomAction&&u(m.dataset.panzoomAction)}function i(c,h){const m=h.el;if(!t||!m||h.panzoomRef)return;const p=h.src||h.lazySrc||"",f=h.alt||h.caption||`Image #${h.index}`,g=h.srcset||h.lazySrcset||"",y=h.sizes||h.lazySizes||"";if(p&&Te(p)&&!h.html&&(!h.type||h.type==="image")){h.type="image",h.thumbSrc=h.thumbSrc||p;let M=n("tpl",h);M=zt(M,"{{src}}",p+""),M=zt(M,"{{srcset}}",g+""),M=zt(M,"{{sizes}}",y+""),m.insertAdjacentHTML("afterbegin",M)}const k=m.querySelector(".f-panzoom__content");if(!k)return;k.setAttribute("alt",f+"");const w=h.width&&h.width!=="auto"?parseFloat(h.width+""):"auto",E=h.height&&h.height!=="auto"?parseFloat(h.height+""):"auto",v=$a(m,Object.assign({width:w,height:E,classes:{container:"f-zoomable"},event:()=>t==null?void 0:t.getLastMouseMove(),spinnerTpl:()=>(t==null?void 0:t.getOption("spinnerTpl"))||""},n("Panzoom")));v.on("*",(M,A,...R)=>{t&&(A==="loading"&&(h.state=0),A==="loaded"&&(h.state=1),A==="error"&&(h.state=2,t==null||t.showError(h,"{{IMAGE_ERROR}}")),t.emit(`panzoom:${A}`,h,...R),A==="ready"&&t.emit("contentReady",h),h.index===(t==null?void 0:t.getPageIndex())&&d())}),h.panzoomRef=v}function s(c,h){h.panzoomRef&&(h.panzoomRef.destroy(),h.panzoomRef=void 0)}function l(c,h){const m=h.panzoomRef;if(m)switch(m.getState()){case 0:m.init();break;case 3:m.execute(ge.ZoomTo,Object.assign(Object.assign({},m.getStartPosition()),{velocity:0}))}}function d(){var c,h;const m=(t==null?void 0:t.getContainer())||void 0,p=(h=(c=t==null?void 0:t.getPage())===null||c===void 0?void 0:c.slides[0])===null||h===void 0?void 0:h.panzoomRef;if(m)if(p)p.updateControls(m);else for(const f of m.querySelectorAll("[data-panzoom-action]")||[])f.setAttribute("aria-disabled",""),f.setAttribute("tabindex","-1")}function u(c,...h){var m;(m=t==null?void 0:t.getPage().slides[0].panzoomRef)===null||m===void 0||m.execute(c,...h)}return{init:function(c){t=c,t.on("initPlugins",a)},destroy:function(){if(t){t.off("initPlugins",a),t.off("addSlide",i),t.off("removeSlide",s),t.off("attachSlideEl",l),t.off("click",r),t.off("change",o),t.off("ready",o);for(const c of t.getSlides())s(0,c)}t=void 0},execute:u}};/*! License details at fancyapps.com/license */const Zr={syncOnChange:!1,syncOnClick:!0,syncOnHover:!1},Yr=()=>{let t,n;function a(){const p=t==null?void 0:t.getOptions().Sync;return Ze(p)?Object.assign(Object.assign({},Zr),p):Zr}function o(p){var f,g,y;t&&p&&(n=p,t.getOptions().classes=Object.assign(Object.assign({},t.getOptions().classes),{isSelected:""}),t.getOptions().initialSlide=((g=(f=n.getPage())===null||f===void 0?void 0:f.slides[0])===null||g===void 0?void 0:g.index)||0,a().syncOnChange&&t.on("change",s),a().syncOnClick&&t.on("click",d),a().syncOnHover&&((y=t.getViewport())===null||y===void 0||y.addEventListener("mouseover",u)),function(){!t||!n||(t.on("ready",i),t.on("refresh",c),n.on("change",l),n.on("filter",h))}())}function r(){const p=a().target;t&&p&&o(p)}function i(){m()}function s(){var p;if(t&&n){const f=((p=t.getPage())===null||p===void 0?void 0:p.slides)||[],g=n.getPageIndex(f[0].index||0);g>-1&&n.goTo(g,t.hasNavigated()?void 0:{tween:!1,transition:!1}),m()}}function l(){var p;if(t&&n){const f=t.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);f>-1&&t.goTo(f,n.hasNavigated()?void 0:{tween:!1,transition:!1}),m()}}function d(p,f){var g;if(!t||!n||!((g=t.getTween())===null||g===void 0)&&g.isRunning())return;const y=t==null?void 0:t.getOptions().classes.slide;if(!y)return;const k=y?f.target.closest(`.${y}`):null;if(k){const w=parseInt(k.getAttribute("index")||"")||0,E=n.getPageIndex(w);n.goTo(E)}}function u(p){t&&d(0,p)}function c(){var p;if(t&&n){const f=t.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);f>-1&&t.goTo(f,{tween:!1,transition:!1}),m()}}function h(p,f){t&&n&&(t.filter(f),l())}function m(){var p,f,g;if(!n)return;const y=((f=(p=n.getPage())===null||p===void 0?void 0:p.slides[0])===null||f===void 0?void 0:f.index)||0;for(const k of(t==null?void 0:t.getSlides())||[])(g=k.el)===null||g===void 0||g.classList.toggle("is-selected",k.index===y)}return{init:function(p){t=p,t.on("initSlides",r)},destroy:function(){var p;t==null||t.off("ready",i),t==null||t.off("refresh",c),t==null||t.off("change",s),t==null||t.off("click",d),(p=t==null?void 0:t.getViewport())===null||p===void 0||p.removeEventListener("mouseover",u),n==null||n.off("change",l),n==null||n.off("filter",h),n=void 0,t==null||t.off("initSlides",r),t=void 0},getTarget:function(){return n}}};/*! License details at fancyapps.com/license */const Xr={showLoading:!0,preload:1},Kn="is-lazyloading",Kr="is-lazyloaded",Qr="has-lazyerror",Jr=()=>{let t;function n(){const r=t==null?void 0:t.getOptions().Lazyload;return Ze(r)?Object.assign(Object.assign({},Xr),r):Xr}function a(r){var i;const s=r.el;if(!s)return;const l="[data-lazy-src],[data-lazy-srcset],[data-lazy-bg]",d=Array.from(s.querySelectorAll(l));s.matches(l)&&d.push(s);for(const u of d){const c=u.dataset.lazySrc,h=u.dataset.lazySrcset,m=u.dataset.lazySizes,p=u.dataset.lazyBg,f=(u instanceof HTMLImageElement||u instanceof HTMLSourceElement)&&(c||h),g=u instanceof HTMLElement&&p;if(!f&&!g)continue;const y=c||h||p;if(y){if(f&&y){const k=(i=u.parentElement)===null||i===void 0?void 0:i.classList.contains("f-panzoom__wrapper");n().showLoading&&(t==null||t.showLoading(r)),u.addEventListener("load",()=>{t==null||t.hideLoading(r),Ke(u,Qr),u instanceof HTMLImageElement?u.decode().then(()=>{Ke(u,Kn),we(u,Kr)}):(Ke(u,Kn),we(u,Kr)),k||t==null||t.emit("lazyLoad:loaded",r,u,y)}),u.addEventListener("error",()=>{t==null||t.hideLoading(r),Ke(u,Kn),we(u,Qr),k||t==null||t.emit("lazyLoad:error",r,u,y)}),u.classList.add("f-lazyload"),u.classList.add(Kn),k||t==null||t.emit("lazyLoad:load",r,u,y),c&&(u.src=c),h&&(u.srcset=h),m&&(u.sizes=m)}else g&&(document.body.contains(u)||(document.createElement("img").src=p),u.style.backgroundImage=`url('${p}')`);delete u.dataset.lazySrc,delete u.dataset.lazySrcset,delete u.dataset.lazySizes,delete u.dataset.lazyBg}}}function o(){if(!t)return;const r=[...t.getVisibleSlides()],i=n().preload;if(i>0){const s=t.getPosition(),l=t.getViewportDim();r.push(...t.getVisibleSlides(s+l*i),...t.getVisibleSlides(s-l*i))}for(const s of r)a(s)}return{init:function(r){t=r,t.on("render",o)},destroy:function(){t==null||t.off("render",o),t=void 0}}};/*! License details at fancyapps.com/license */const e1='<svg width="24" height="24" viewBox="0 0 24 24" tabindex="-1">',t1="</svg>",n1={prevTpl:e1+'<path d="M15 3l-9 9 9 9"></path>'+t1,nextTpl:e1+'<path d="M9 3l9 9-9 9"></path>'+t1},O3=()=>{let t,n,a;function o(){const l=t==null?void 0:t.getOptions().Arrows;return Ze(l)?Object.assign(Object.assign({},n1),l):n1}function r(l){if(!t)return;const d=`<button data-carousel-go-${l} tabindex="0" class="f-button is-arrow is-${l}" title="{{${l.toUpperCase()}}}">`+o()[`${l}Tpl`]+"</button",u=wt(t.localize(d))||void 0;return u&&we(u,o()[`${l}Class`]),u}function i(){var l;n==null||n.remove(),n=void 0,a==null||a.remove(),a=void 0,(l=t==null?void 0:t.getContainer())===null||l===void 0||l.classList.remove("has-arrows")}function s(){t&&t.getOptions().Arrows!==!1&&t.getPages().length>1?(function(){if(!t)return;const l=t.getViewport();l&&(n||(n=r("prev"),n&&l.insertAdjacentElement("beforebegin",n)),a||(a=r("next"),a&&l.insertAdjacentElement("afterend",a)),Ye(t.getContainer(),"has-arrows",!(!n&&!a)))}(),t&&(n==null||n.toggleAttribute("aria-disabled",!t.canGoPrev()),a==null||a.toggleAttribute("aria-disabled",!t.canGoNext()))):i()}return{init:function(l){t=l.on(["change","refresh"],s)},destroy:function(){i(),t==null||t.off(["change","refresh"],s),t=void 0}}};/*! License details at fancyapps.com/license */const a1='<circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/>',_a='<g><line x1="11" y1="8" x2="11" y2="14"></line></g>'+a1,_3={moveLeft:["moveLeft","MOVE_LEFT",'<path d="M5 12h14M5 12l6 6M5 12l6-6"/>'],moveRight:["moveRight","MOVE_RIGHT",'<path d="M5 12h14M13 18l6-6M13 6l6 6"/>'],moveUp:["moveUp","MOVE_UP",'<path d="M12 5v14M18 11l-6-6M6 11l6-6"/>'],moveDown:["moveDown","MOVE_DOWN",'<path d="M12 5v14M18 13l-6 6M6 13l6 6"/>'],zoomOut:["zoomOut","ZOOM_OUT",a1],zoomIn:["zoomIn","ZOOM_IN",_a],toggleFull:["toggleFull","TOGGLE_FULL",_a],iterateZoom:["iterateZoom","ITERATE_ZOOM",_a],toggle1to1:["toggleFull","TOGGLE_FULL",'<path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/>'],rotateCCW:["rotateCCW","ROTATE_CCW",'<path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/>'],rotateCW:["rotateCW","ROTATE_CW",'<path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/>'],flipX:["flipX","FLIP_X",'<path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/>'],flipY:["flipY","FLIP_Y",'<path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/>'],reset:["reset","RESET",'<path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'],toggleFS:["toggleFS","TOGGLE_FS",'<g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g>']},Ra={};for(const[t,n]of Object.entries(_3))Ra[t]={tpl:`<button data-panzoom-action="${n[0]}" class="f-button" title="{{${n[1]}}}"><svg>${n[2]}</svg></button>`};/*! License details at fancyapps.com/license */var o1;(function(t){t.Left="left",t.middle="middle",t.right="right"})(o1||(o1={}));const r1=Object.assign({counter:{tpl:'<div class="f-counter"><span data-carousel-page></span>/<span data-carousel-pages></span></div>'},download:{tpl:'<button data-carousel-download class="f-button" title="{{DOWNLOAD}}"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></button>'},autoplay:{tpl:'<button data-autoplay-action="toggle" class="f-button" title="{{TOGGLE_AUTOPLAY}}"><svg><g><path d="M5 3.5 19 12 5 20.5Z"/></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},thumbs:{tpl:'<button data-thumbs-action="toggle" class="f-button" title="{{TOGGLE_THUMBS}}"><svg><rect width="18" height="14" x="3" y="3" rx="2"/><path d="M4 21h1M9 21h1M14 21h1M19 21h1"/></svg></button>'}},Ra),i1={absolute:!1,display:{left:[],middle:["zoomIn","zoomOut","toggle1to1","rotateCCW","rotateCW","flipX","flipY","reset"],right:[]},enabled:"auto",items:{}},s1=()=>{let t,n;function a(r){const i=t==null?void 0:t.getOptions().Toolbar;let s=(Ze(i)?Object.assign(Object.assign({},i1),i):i1)[r];return s&&typeof s=="function"&&t?s(t):s}function o(){var r,i;if(!(t!=null&&t.getOptions().Toolbar)||!t||n)return;const s=t.getContainer();if(!s)return;let l=a("enabled");if(!l)return;const d=a("absolute"),u=t.getSlides().length>1;let c=!1,h=!1;for(const k of t.getSlides())k.panzoomRef&&(c=!0),(k.downloadSrc||k.type==="image"&&k.src)&&(h=!0);const m=((r=t.getPlugins().Thumbs)===null||r===void 0?void 0:r.isEnabled())||!1,p=u&&t.getPlugins().Autoplay||!1,f=t.getPlugins().Fullscreen&&(document.fullscreenEnabled||document.webkitFullscreenEnabled);if(l==="auto"&&(l=c),!l)return;n=s.querySelector(".f-carousel__toolbar")||void 0,n||(n=document.createElement("div"),n.classList.add("f-carousel__toolbar"));const g=a("display"),y=ot({},r1,a("items"));for(const k of["left","middle","right"]){const w=g[k]||[],E=document.createElement("div");E.classList.add("f-carousel__toolbar__column"),E.classList.add(`is-${k}`);for(const v of w){let M;if(Te(v)){if(v==="counter"&&!u||v==="autoplay"&&!p||Ra[v]&&!c||v==="fullscreen"&&!f||v==="thumbs"&&!m||v==="download"&&!h)continue;M=y[v]}if(Ze(v)&&(M=v),M&&M.tpl){let A=t.localize(M.tpl);A=A.split("<svg>").join('<svg tabindex="-1" width="24" height="24" viewBox="0 0 24 24">');const R=wt(A);R&&(typeof M.click=="function"&&t&&R.addEventListener("click",S=>{S.preventDefault(),S.stopPropagation(),typeof M.click=="function"&&t&&M.click(t,S)}),E.append(R))}}n.append(E)}if(n.childElementCount){if(d&&n.classList.add("is-absolute"),!n.parentElement){const k=a("parentEl");k?k.insertAdjacentElement("afterbegin",n):(i=t.getViewport())===null||i===void 0||i.insertAdjacentElement("beforebegin",n)}s.contains(n)&&s.classList.add("has-toolbar")}}return{init:function(r){t=r,t==null||t.on("initSlides",o)},destroy:function(){var r;t==null||t.off("initSlides",o),(r=t==null?void 0:t.getContainer())===null||r===void 0||r.classList.remove("has-toolbar"),n==null||n.remove(),n=void 0},add:function(r,i){r1[r]=i},isEnabled:function(){return!!n}}};/*! License details at fancyapps.com/license */const l1={autoStart:!0,pauseOnHover:!0,showProgressbar:!0,timeout:2e3},R3=()=>{let t,n,a=!1,o=!1,r=!1,i=null;function s(M){const A=t==null?void 0:t.getOptions().Autoplay;let R=(Ze(A)?Object.assign(Object.assign({},l1),A):l1)[M];return R&&typeof R=="function"&&t?R(t):R}function l(){clearTimeout(n),n=void 0}function d(){if(!t||!a||r||o||n||!t.isSettled()||function(){var A;const R=((A=t==null?void 0:t.getPage())===null||A===void 0?void 0:A.slides)||[];for(const S of R)if(S.state===0)return!0;return!1}())return;(function(){var A,R,S,x;if(!t||(h(),!s("showProgressbar")))return;let N=s("progressbarParentEl");if(!N&&(!((A=t.getPlugins().Toolbar)===null||A===void 0)&&A.isEnabled())&&(N=t.getContainer()),!N&&((R=t.getPlugins().Toolbar)===null||R===void 0?void 0:R.isEnabled())!==!0){const F=((S=t.getPages()[0])===null||S===void 0?void 0:S.slides)||[],B=((x=t.getPage())===null||x===void 0?void 0:x.slides)||[];F.length===1&&B.length===1&&(N=B[0].el)}if(N||(N=t.getViewport()),!N)return;i=document.createElement("div"),we(i,"f-progressbar"),N.prepend(i);const L=s("timeout")||1e3;i.style.animationDuration=`${L}ms`})();const M=s("timeout");n=setTimeout(()=>{t&&a&&!o&&(t.isInfinite()||t.getPageIndex()!==t.getPages().length-1?t.next():t.goTo(0))},M)}function u(){var M;if(!t||t.getPages().length<2||t.getOptions().Autoplay===!1||a)return;a=!0,t.emit("autoplay:start",s("timeout")),we(t.getContainer(),"has-autoplay"),(M=t.getTween())===null||M===void 0||M.on("start",k);const A=t==null?void 0:t.getContainer();A&&s("pauseOnHover")&&matchMedia("(hover: hover)").matches&&(A.addEventListener("mouseenter",w,!1),A.addEventListener("mouseleave",E,!1)),t.on("change",g),t.on("settle",y),t.on("contentReady",p),t.on("panzoom:touchStart",c),t.on("panzoom:wheel",c),t.isSettled()&&d()}function c(){var M;if(l(),h(),t){if(a){t.emit("autoplay:end"),(M=t.getTween())===null||M===void 0||M.off("start",k);const A=t.getContainer();A&&(A.classList.remove("has-autoplay"),A.removeEventListener("mouseenter",w,!1),A.removeEventListener("mouseleave",E,!1))}t.off("change",g),t.off("settle",y),t.off("contentReady",p),t.off("panzoom:touchStart",c),t.off("panzoom:wheel",c)}a=!1,o=!1}function h(){i&&(i.remove(),i=null)}function m(){t&&t.getPages().length>1&&s("autoStart")&&u()}function p(){d()}function f(M,A){const R=A.target;R&&!A.defaultPrevented&&R.dataset.autoplayAction==="toggle"&&v.toggle()}function g(){!t||!(t!=null&&t.isInfinite())&&t.getPageIndex()===t.getPages().length-1?c():(h(),l())}function y(){d()}function k(){l(),h()}function w(){r=!0,a&&(h(),l())}function E(){r=!1,a&&!o&&(t!=null&&t.isSettled())&&d()}const v={init:function(M){t=M,t.on("ready",m),t.on("click",f)},destroy:function(){c(),t==null||t.off("ready",m),t==null||t.off("click",f),t=void 0},isEnabled:()=>a,pause:function(){o=!0,l()},resume:function(){o=!1,a&&!r&&d()},start(){u()},stop(){c()},toggle(){a?c():u()}};return v};/*! License details at fancyapps.com/license */const Ha={Carousel:{Lazyload:{showLoading:!1}},minCount:2,showOnStart:!0,thumbTpl:'<button aria-label="Slide to #{{page}}"><img draggable="false" alt="{{alt}}" data-lazy-src="{{src}}" /></button>',type:"modern"};let za;const H3=()=>{let t,n,a,o,r,i=0,s=0,l=!0;function d(B){const C=t==null?void 0:t.getOptions().Thumbs;let O=(Ze(C)?Object.assign(Object.assign({},Ha),C):Ha)[B];return O&&typeof O=="function"&&t?O(t):O}function u(){if(!t||(t==null?void 0:t.getOptions().Thumbs)===!1)return!1;let B=0;for(const C of t.getSlides())C.thumbSrc&&B++;return B>=d("minCount")}function c(){return d("type")==="modern"}function h(){return d("type")==="scrollable"}function m(){const B=[],C=(t==null?void 0:t.getSlides())||[];for(const O of C)B.push({index:O.index,class:O.thumbClass,html:p(O)});return B}function p(B){const C=B.thumb?B.thumb instanceof HTMLImageElement?B.thumb.src:B.thumb:B.thumbSrc||void 0,O=B.thumbAlt===void 0?`Thumbnail #${B.index}`:B.thumbAlt+"";let Z=d("thumbTpl");return Z=zt(Z,"{{alt}}",O),Z=zt(Z,"{{src}}",C+""),Z=zt(Z,"{{index}}",`${B.index}`),Z=zt(Z,"{{page}}",`${B.index||1}`),Z}function f(B){return`<div index="${B.index||0}" class="f-thumbs__slide ${B.class||""}">${B.html||""}</div>`}function g(B=!1){var C;const O=t==null?void 0:t.getContainer();if(!t||!O||a||!u())return;const Z=((C=d("Carousel"))===null||C===void 0?void 0:C.classes)||{};if(Z.container=Z.container||"f-thumbs",!a){const Q=O.nextElementSibling;Q!=null&&Q.classList.contains(Z.container)&&(a=Q)}if(!a){a=document.createElement("div");const Q=d("parentEl");Q?Q.insertAdjacentElement("beforeend",a):O.insertAdjacentElement("afterend",a)}we(a,Z.container),we(a,"f-thumbs"),we(a,`is-${d("type")}`),B&&we(a,"is-hidden")}function y(){if(!a||!h())return;o=document.createElement("div"),we(o,"f-thumbs__viewport");let B="";for(const C of m())typeof(C.html||"")=="string"&&(B+=f(C));o.innerHTML=B,a.append(o),a.addEventListener("click",C=>{C.preventDefault();const O=C.target.closest("[index]"),Z=parseInt((O==null?void 0:O.getAttribute("index"))||"-1");t&&Z>-1&&t.goTo(Z)}),r=new IntersectionObserver(C=>{C.forEach(O=>{O.isIntersecting&&O.target instanceof HTMLImageElement&&(O.target.src=O.target.getAttribute("data-lazy-src")+"",O.target.removeAttribute("data-lazy-src"),r==null||r.unobserve(O.target))})},{root:o,rootMargin:"100px"}),a.querySelectorAll("[data-lazy-src]").forEach(C=>{r==null||r.observe(C)}),t==null||t.emit("thumbs:ready")}function k(){var B;if(!za||!t||!a||h()||n)return;const C=m();if(!C.length)return;const O=ot({},{Sync:{target:t},Lazyload:{preload:1},slides:C,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",slide:"f-thumbs__slide"},center:!0,fill:!c(),infinite:!1,dragFree:!0,rtl:t.getOptions().rtl||!1,slidesPerPage:Z=>{let Q=0;return c()&&(function(){if(!c()||!a)return;const ee=P=>a&&parseFloat(getComputedStyle(a).getPropertyValue("--f-thumb-"+P))||0;i=ee("width"),s=ee("clip-width")}(),Q=4*(i-s)),Z&&Z.getTotalSlideDim()<=Z.getViewportDim()-Q?1/0:1}},Ha.Carousel||{},d("Carousel")||{});n=za(a,O,{Sync:Yr,Lazyload:Jr}),n.on("ready",()=>{we(a,"is-syncing"),t==null||t.emit("thumbs:ready"),c()&&(t==null||t.on("render",M))}),n.on("destroy",()=>{t==null||t.emit("thumbs:destroy")}),n.init(),(B=n.getGestures())===null||B===void 0||B.on("start",()=>{l=!1}),n.on("click",(Z,Q)=>{const ee=Q.target;if(ee){const P=ee.matches("button")?ee:ee.firstElementChild;P&&P.matches("button")&&(Q.preventDefault(),P.focus({preventScroll:!0}))}}),we(t.getContainer(),"has-thumbs"),F()}function w(){u()&&d("showOnStart")&&(g(),y())}function E(){var B;u()&&(k(),t==null||t.on("addSlide",R),t==null||t.on("removeSlide",S),t==null||t.on("click",x),t==null||t.on("refresh",N),(B=t==null?void 0:t.getGestures())===null||B===void 0||B.on("start",v),L(!0))}function v(){var B,C;l=!0,!((B=document.activeElement)===null||B===void 0)&&B.closest(".f-thumbs")&&((C=document.activeElement)===null||C===void 0||C.blur())}function M(){var B,C;a==null||a.classList.toggle("is-syncing",(t==null?void 0:t.hasNavigated())===!1||((B=t==null?void 0:t.getTween())===null||B===void 0?void 0:B.isRunning())),F(),!((C=t==null?void 0:t.getGestures())===null||C===void 0)&&C.isPointerDown()&&function(){if(!c()||!t||!n||!l)return;const O=n.getTween(),Z=n.getPages(),Q=t.getPageIndex()||0,ee=t.getPageProgress()||0;if(!(t&&Z&&Z[Q]&&O))return;const P=O.isRunning()?O.getCurrentValues().pos:n.getPosition();if(P===void 0)return;let H=Z[Q].pos+ee*(i-s);H=Be(Z[0].pos,H,Z[Z.length-1].pos),O.from({pos:P}).to({pos:H}).start()}()}function A(){l=!0,L()}function R(B,C){const O={html:p(C)};if(n)n.add(O,C.index);else if(o){const Z=wt(f(O));if(Z){o.append(Z);const Q=Z.querySelector("img");Q&&(r==null||r.observe(Q))}}}function S(B,C){var O;n?n.remove(C.index):o&&((O=o.querySelector(`[index="${C.index}"]`))===null||O===void 0||O.remove())}function x(B,C){var O;const Z=C.target;C.defaultPrevented||((O=Z==null?void 0:Z.dataset)===null||O===void 0?void 0:O.thumbsAction)!=="toggle"||(a||(g(!0),y(),k()),a&&a.classList.toggle("is-hidden"))}function N(){L()}function L(B=!1){if(!t||!o||!h())return;const C=t.getPageIndex();o.querySelectorAll(".is-selected").forEach(Z=>{Z.classList.remove("is-selected")});const O=o.querySelector(`[index="${C}"]`);if(O){O.classList.add("is-selected");const Z=o.getBoundingClientRect(),Q=O.getBoundingClientRect(),ee=O.offsetTop-o.offsetTop-.5*Z.height+.5*Q.height,P=O.scrollLeft-o.scrollLeft-.5*Z.width+.5*Q.width;o.scrollTo({top:ee,left:P,behavior:B?"instant":"smooth"})}}function F(){if(!c()||!t||!n)return;const B=(n==null?void 0:n.getSlides())||[];let C=-.5*i;for(const O of B){const Z=O.el;if(!Z)continue;let Q=t.getPageProgress(O.index)||0;Q=Math.max(-1,Math.min(1,Q)),Q>-1&&Q<1&&(C+=.5*i*(1-Math.abs(Q))),Q=Math.round(1e4*Q)/1e4,C=Math.round(1e4*C)/1e4,Z.style.setProperty("--progress",`${Math.abs(Q)}`),Z.style.setProperty("--shift",`${t!=null&&t.isRTL()?-1*C:C}px`),Q>-1&&Q<1&&(C+=.5*i*(1-Math.abs(Q)))}}return{init:function(B,C){za=C,t=B,t.on("ready",E),t.on("initSlides",w),t.on("change",A)},destroy:function(){var B,C;h()&&(t==null||t.emit("thumbs:destroy")),t==null||t.off("ready",E),t==null||t.off("initSlides",w),t==null||t.off("change",A),t==null||t.off("render",M),t==null||t.off("addSlide",R),t==null||t.off("click",x),t==null||t.off("refresh",N),(B=t==null?void 0:t.getGestures())===null||B===void 0||B.off("start",v),(C=t==null?void 0:t.getContainer())===null||C===void 0||C.classList.remove("has-thumbs"),t=void 0,n==null||n.destroy(),n=void 0,a==null||a.remove(),a=void 0},getCarousel:function(){return n},getContainer:function(){return a},getType:function(){return d("type")},isEnabled:u}};/*! License details at fancyapps.com/license */const c1={iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"}},z3=()=>{let t;function n(r,i){let s=i.src;if(!Te(s))return;let l=i.type;if(!l){if(l||(s.charAt(0)==="#"?l="inline":s.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.((a)?png|avif|gif|jp(g|eg)|pjp(eg)?|jfif|svg|webp|bmp|ico|tif(f)?)((\?|#).*)?$)/i)?l="image":s.match(/\.(pdf)((\?|#).*)?$/i)?l="pdf":s.match(/\.(html|php)((\?|#).*)?$/i)&&(l="iframe")),!l){const d=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i);d&&(s=`https://maps.google.${d[1]}/?ll=${(d[2]?d[2]+"&z="+Math.floor(parseFloat(d[3]))+(d[4]?d[4].replace(/^\//,"&"):""):d[4]+"").replace(/\?/,"&")}&output=${d[4]&&d[4].indexOf("layer=c")>0?"svembed":"embed"}`,l="gmap")}if(!l){const d=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i);d&&(s=`https://maps.google.${d[1]}/maps?q=${d[2].replace("query=","q=").replace("api=1","")}&output=embed`,l="gmap")}i.src=s,i.type=l}}function a(r,i){i.type!=="iframe"&&i.type!=="pdf"&&i.type!=="gmap"||function(s){if(!t||!s.el||!s.src)return;const l=document.createElement("iframe");l.classList.add("f-iframe");for(const[u,c]of Object.entries(function(){const h=t==null?void 0:t.getOptions().Html;return Ze(h)?Object.assign(Object.assign({},c1),h):c1}().iframeAttr||{}))l.setAttribute(u,c);l.onerror=()=>{t&&t.getState()===1&&t.showError(s,"{{IFRAME_ERROR}}")},l.src=s.src;const d=document.createElement("div");if(d.classList.add("f-html"),d.append(l),s.width){let u=`${s.width}`;u.match(/^\d+$/)&&(u+="px"),d.style.maxWidth=`${u}`}if(s.height){let u=`${s.height}`;u.match(/^\d+$/)&&(u+="px"),d.style.maxHeight=`${u}`}if(s.aspectRatio){const u=s.el.getBoundingClientRect();d.style.aspectRatio=`${s.aspectRatio}`,d.style[u.width>u.height?"width":"height"]="auto",d.style[u.width>u.height?"maxWidth":"maxHeight"]="none"}s.contentEl=l,s.htmlEl=d,s.el.classList.add("has-html"),s.el.classList.add("has-iframe"),s.el.classList.add(`has-${s.type}`),s.el.prepend(d),t.emit("contentReady",s)}(i)}function o(r,i){var s,l;i.type!=="iframe"&&i.type!=="pdf"&&i.type!=="gmap"||(t==null||t.hideError(i),(s=i.contentEl)===null||s===void 0||s.remove(),i.contentEl=void 0,(l=i.htmlEl)===null||l===void 0||l.remove(),i.htmlEl=void 0)}return{init:function(r){t=r,t.on("addSlide",n),t.on("attachSlideEl",a),t.on("detachSlideEl",o)},destroy:function(){t==null||t.off("addSlide",n),t==null||t.off("attachSlideEl",a),t==null||t.off("detachSlideEl",o),t=void 0}}};/*! License details at fancyapps.com/license */const d1=(t,n={})=>{const a=new URL(t),o=new URLSearchParams(a.search),r=new URLSearchParams;for(const[l,d]of[...o,...Object.entries(n)]){let u=d+"";if(l==="t"){let c=u.match(/((\d*)m)?(\d*)s?/);c&&r.set("start",60*parseInt(c[2]||"0")+parseInt(c[3]||"0")+"")}else r.set(l,u)}let i=r+"",s=t.match(/#t=((.*)?\d+s)/);return s&&(i+=`#t=${s[1]}`),i},u1={autoplay:!1,html5videoTpl:`<video class="f-html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
@@ -90,7 +90,7 @@
90
90
  <source src="${f}" type="${g}" />
91
91
  Seu navegador não suporta vídeo.
92
92
  </video>
93
- `,caption:y}]):Pe.show([{src:f,type:"image",caption:y}]))},c=()=>{const f=document.createElement("canvas"),g=320,y=180;f.width=g,f.height=y;const k=f.getContext("2d");return k.fillStyle="black",k.fillRect(0,0,g,y),f.toDataURL("image/png")};function h(f,g=1){return new Promise((y,k)=>{const w=document.createElement("video");w.src=f,w.crossOrigin="anonymous",w.muted=!0,w.playsInline=!0,w.preload="auto",w.addEventListener("loadeddata",()=>{w.readyState>=2&&(w.currentTime=g)}),w.addEventListener("seeked",()=>{const E=document.createElement("canvas");E.width=w.videoWidth,E.height=w.videoHeight,E.getContext("2d").drawImage(w,0,0,E.width,E.height);const M=E.toDataURL("image/png");y(M)})})}const m=f=>typeof f=="string"&&f.startsWith("data:")&&f.includes(";base64,"),p=f=>{const g=Math.floor(f/60),y=(f%60).toFixed(0),k=g.toString().padStart(2,"0"),w=y.toString().padStart(2,"0");return`${k}:${w}`};return e.onMounted(async()=>{try{const f=await h(n.base64),g=f&&f!=="data:,";a.value=g?f:c()}catch(f){console.error("Erro ao gerar thumbnail:",f),a.value=c()}}),(f,g)=>(e.openBlock(),e.createElementBlock("main",{class:e.normalizeClass({main_preview_files_container_message:t.mode==="message",main_preview_files_container_miniature:t.mode==="miniature","main_preview_files_container_preview bg-base-200":t.mode==="preview"})},[!t.isMobile&&i.value?(e.openBlock(),e.createElementBlock("section",h4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"iframe_preview_files",src:t.base64,frameborder:"0"},null,8,p4)):(e.openBlock(),e.createElementBlock("svg",g4,[...g[6]||(g[6]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"},null,-1)])]))])):t.isMobile&&i.value&&t.mode==="message"?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(t.mode==="message"?"flex flex-col bg-base-300 p-2 rounded-md gap-2":"")},[e.createElementVNode("span",y4,[g[7]||(g[7]=e.createElementVNode("svg",{class:"size-8 text-primary","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",k4,e.toDisplayString(t.fileName),1)]),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",x4,[e.createElementVNode("button",{class:"bg-base-200 p-2 text-primary w-full text-xs rounded-md hover:bg-base-100",onClick:g[0]||(g[0]=y=>f.$emit("open-mobile-pdf"))}," Abrir PDF ")])):e.createCommentVNode("",!0)],2)):s.value?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[1]||(g[1]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[e.createElementVNode("div",b4,[e.createElementVNode("div",w4,[(e.openBlock(),e.createElementBlock("svg",E4,[...g[8]||(g[8]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",v4,[...g[9]||(g[9]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",C4,[...g[10]||(g[10]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",S4,[...g[11]||(g[11]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:m(t.base64)?t.base64:t.base64.replace("+","%2B")},null,10,B4)])):d(t.mimetype)?(e.openBlock(),e.createElementBlock("section",V4,[t.mode==="preview"?(e.openBlock(),e.createElementBlock("video",{key:0,width:"300",height:"150",controls:"",src:t.base64},[e.createElementVNode("source",{src:t.base64,type:t.mimetype},null,8,N4)],8,M4)):t.mode==="miniature"?(e.openBlock(),e.createElementBlock("svg",A4,[...g[12]||(g[12]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14 7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7Zm2 9.387 4.684 1.562A1 1 0 0 0 22 17V7a1 1 0 0 0-1.316-.949L16 7.613v8.774Z","clip-rule":"evenodd"},null,-1)])])):t.mode==="message"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[2]||(g[2]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[a.value?(e.openBlock(),e.createElementBlock("section",T4,[e.createElementVNode("div",D4,[g[17]||(g[17]=e.createElementVNode("svg",{class:"size-12 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",F4,[(e.openBlock(),e.createElementBlock("svg",L4,[...g[13]||(g[13]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",$4,[...g[14]||(g[14]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",P4,[...g[15]||(g[15]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",O4,[...g[16]||(g[16]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:a.value},null,10,_4)])):(e.openBlock(),e.createElementBlock("span",R4,[...g[18]||(g[18]=[e.createElementVNode("span",{class:"loader-preview-lib"},null,-1)])]))])):e.createCommentVNode("",!0)])):l.value?(e.openBlock(),e.createElementBlock("section",H4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("section",z4,[e.createVNode(M1,{avatar:t.avatar,audio:t.base64,onDuration:g[3]||(g[3]=y=>o.value=y),onCurrentTime:g[4]||(g[4]=y=>r.value=y)},null,8,["avatar","audio"])])):(e.openBlock(),e.createElementBlock("svg",j4,[...g[19]||(g[19]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 8a1 1 0 0 1 1 1v3a4.006 4.006 0 0 0 4 4h4a4.006 4.006 0 0 0 4-4V9a1 1 0 1 1 2 0v3.001A6.006 6.006 0 0 1 14.001 18H13v2h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2H9.999A6.006 6.006 0 0 1 4 12.001V9a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1),e.createElementVNode("path",{d:"M7 6a4 4 0 0 1 4-4h2a4 4 0 0 1 4 4v5a4 4 0 0 1-4 4h-2a4 4 0 0 1-4-4V6Z"},null,-1)])]))])):(e.openBlock(),e.createElementBlock("div",{key:5,class:e.normalizeClass(t.mode==="message"?"generic_files":"")},[g[20]||(g[20]=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"size-8 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z","clip-rule":"evenodd"})])],-1)),t.mode==="message"?(e.openBlock(),e.createElementBlock("span",G4,[e.createElementVNode("p",I4,e.toDisplayString(t.fileName),1),e.createElementVNode("button",{class:"download_btn_generic_files",onClick:g[5]||(g[5]=y=>f.$emit("download"))}," Baixar arquivo ")])):e.createCommentVNode("",!0)],2)),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",q4,[e.renderSlot(f.$slots,"content-message",{},void 0,!0),e.createElementVNode("div",{class:e.normalizeClass([o.value?"justify-between":" justify-end","flex w-full"])},[l.value&&o.value?(e.openBlock(),e.createElementBlock("p",W4,e.toDisplayString(p(o.value))+" - "+e.toDisplayString(r.value?p(r.value):"00:00"),1)):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"time-message",{},void 0,!0)],2)])):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-6405f10f"]]),U4={props:{audioStream:MediaStream},data(){return{audioContext:null,analyser:null}},mounted(){this.initializeAudio()},methods:{initializeAudio(){this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.analyser=this.audioContext.createAnalyser();const t=this.$refs.canvas,n=t.getContext("2d");this.audioContext.createMediaStreamSource(this.audioStream).connect(this.analyser),this.analyser.fftSize=256;const o=this.analyser.frequencyBinCount,r=new Uint8Array(o),i=()=>{this.analyser.getByteFrequencyData(r),n.clearRect(0,0,t.width,t.height);const s=t.width/o*2.5,l=t.height/2;let d=0;n.strokeStyle="green",n.lineWidth=2,n.beginPath(),n.moveTo(0,l),n.lineTo(t.width,l),n.stroke(),r.forEach(u=>{const c=u;n.fillStyle=`rgb(50, ${c+100}, 50)`,n.fillRect(d,l-c/2,s,c),d+=s+1}),this.audioStream.active&&requestAnimationFrame(i)};i()}}},Z4={ref:"canvas",width:"200",height:"40",class:"mx-auto flex items-center rounded"};function Y4(t,n,a,o,r,i){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("canvas",Z4,null,512)])}const X4=Ce(U4,[["render",Y4],["__scopeId","data-v-49dbe3dd"]]),K4={key:0,class:"flex w-full items-center space-x-3 text-white dark:text-black"},Q4=["disabled"],J4=["disabled"],e5={key:0,class:"size-4 hover:text-red-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 10 16"},t5={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 hover:text-emerald-500"},n5={key:5,class:"flex w-full items-center space-x-2"},a5={class:"text-xs"},o5={key:0},r5={key:1,class:"flex items-center px-2 pr-[21px]"},i5=Ce({__name:"audioRecorder",props:{canSendMessage:Boolean,sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","b64Audio"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(null),i=e.ref(!1),s=e.ref(!1),l=e.ref(0),d=e.ref(0),u=e.ref(null),c=e.ref(null),h=e.ref(null),m=e.ref(null),p=e.ref(0),f=e.ref(0),g=e.ref(null),y=e.ref(!1),k=e.ref(!1),w=B=>{p.value=B},E=B=>{f.value=B},v=B=>{const C=Math.floor(B/60),O=(B%60).toFixed(0),Z=C.toString().padStart(2,"0"),Q=O.toString().padStart(2,"0");return`${Z}:${Q}`},M=async()=>{try{c.value=null,m.value=await navigator.mediaDevices.getUserMedia({audio:!0}),r.value=new MediaRecorder(m.value),r.value.ondataavailable=A,r.value.start(),R(),i.value=!0,o("recording",!0)}catch(B){console.error("Erro ao iniciar a gravação:",B)}},A=B=>{B.data.size>0&&!y.value&&(u.value=new Blob([B.data]),g.value=URL.createObjectURL(u.value),N())},R=()=>{let B=Date.now();h.value=setInterval(()=>{l.value=d.value+Math.floor((Date.now()-B)/1e3)},1e3)},S=async()=>{c.value=null,r.value&&i.value&&(s.value?(r.value.resume(),R()):(r.value.pause(),clearInterval(h.value),d.value=l.value),s.value=!s.value)},x=async()=>{r.value&&i.value&&(await r.value.stop(),clearInterval(h.value),i.value=!1,s.value=!1,N()),m.value&&m.value.getTracks().forEach(B=>B.stop())},N=async()=>{if(u.value){const B=new Blob([u.value],{type:"audio/mpeg"}),C=new FileReader;C.onload=()=>{c.value=C.result},C.readAsDataURL(B)}},L=async()=>{k.value=!0,o("b64Audio",c.value);const C={type:"file",media:{name:"audio",mimetype:(O=>O?O.split(";")[0].split(":")[1]:null)(c.value),data:c.value}};await a.sendAudioToAttendant(a.selectedAttendant.id,C,a.attendant,!0),o("recording",!1),k.value=!1,m.value=null,c.value=null,u.value=null,i.value=!1,s.value=!1,l.value=0},F=async()=>{y.value=!0,i.value=!1,o("recording",!1),await r.value.stop(),m.value&&(m.value.getTracks().forEach(B=>B.stop()),m.value=null),u.value=null,clearInterval(h.value),c.value=null,s.value=!1,l.value=0};return(B,C)=>{var O;return k.value?(e.openBlock(),e.createElementBlock("div",r5,[...C[9]||(C[9]=[e.createElementVNode("span",{class:"loader-audio-recorder"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",K4,[!i.value&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["send-audio-button",{recording:i.value}]),disabled:i.value||!t.canSendMessage,onClick:C[0]||(C[0]=Z=>(M(),d.value=0,y.value=!1))},[...C[3]||(C[3]=[e.createElementVNode("svg",{class:"start-recording-icon","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 19"},[e.createElementVNode("path",{d:"M15 5a1 1 0 0 0-1 1v3a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6a1 1 0 0 0-2 0v3a6.006 6.006 0 0 0 6 6h1v2H5a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9v-2h1a6.006 6.006 0 0 0 6-6V6a1 1 0 0 0-1-1Z"}),e.createElementVNode("path",{d:"M9 0H7a3 3 0 0 0-3 3v5a3 3 0 0 0 3 3h2a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3Z"})],-1)])],10,Q4)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"rounded-full bg-red-500 p-1.5 hover:bg-red-600",onClick:C[1]||(C[1]=Z=>F())},[...C[4]||(C[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})],-1)])])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!i.value&&!s.value,onClick:S},[s.value?(e.openBlock(),e.createElementBlock("svg",t5,[...C[6]||(C[6]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 7.5V18M15 7.5V18M3 16.811V8.69c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 010 1.954l-7.108 4.061A1.125 1.125 0 013 16.811z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",e5,[...C[5]||(C[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M0 .8C0 .358.32 0 .714 0h1.429c.394 0 .714.358.714.8v14.4c0 .442-.32.8-.714.8H.714a.678.678 0 0 1-.505-.234A.851.851 0 0 1 0 15.2V.8Zm7.143 0c0-.442.32-.8.714-.8h1.429c.19 0 .37.084.505.234.134.15.209.354.209.566v14.4c0 .442-.32.8-.714.8H7.857c-.394 0-.714-.358-.714-.8V.8Z","clip-rule":"evenodd"},null,-1)])]))],8,J4)):e.createCommentVNode("",!0),(i.value||u.value)&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full p-1.5 hover:bg-gray-100 hover:text-light",onClick:x},[...C[7]||(C[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})],-1)])])):e.createCommentVNode("",!0),m.value&&i.value&&!s.value?(e.openBlock(),e.createBlock(X4,{key:4,"audio-stream":m.value},null,8,["audio-stream"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",n5,[e.createVNode(M1,{avatar:((O=t.attendant)==null?void 0:O.photo)||null,audio:c.value,onDuration:w,onCurrentTime:E},null,8,["avatar","audio"]),e.createElementVNode("main",a5,[e.createElementVNode("div",null,e.toDisplayString(v(f.value)),1),i.value||u.value?(e.openBlock(),e.createElementBlock("div",o5,e.toDisplayString(v(l.value)),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"rounded-full p-2 hover:bg-base-100",onClick:C[2]||(C[2]=Z=>L())},[...C[8]||(C[8]=[e.createElementVNode("svg",{class:"size-5 text-base-200 rotate-90","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})],-1)])])):e.createCommentVNode("",!0)]))}}},[["__scopeId","data-v-fe1e6df5"]]);function s5(t){return{all:t=t||new Map,on:function(n,a){var o=t.get(n);o?o.push(a):t.set(n,[a])},off:function(n,a){var o=t.get(n);o&&(a?o.splice(o.indexOf(a)>>>0,1):t.set(n,[]))},emit:function(n,a){var o=t.get(n);o&&o.slice().map(function(r){r(a)}),(o=t.get("*"))&&o.slice().map(function(r){r(n,a)})}}}const N1=s5();let A1=0;const l5=()=>{const t=A1;return A1+=1,t},T1=(t,n)=>{const a={...t,id:l5(),group:t.group||""};return N1.emit("notify",{notification:a,timeout:n}),()=>N1.emit("close",a.id)};/*! Capacitor: https://capacitorjs.com/ - MIT License */var an;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(an||(an={}));class Xa extends Error{constructor(n,a,o){super(n),this.message=n,this.code=a,this.data=o}}const c5=t=>{var n,a;return t!=null&&t.androidBridge?"android":!((a=(n=t==null?void 0:t.webkit)===null||n===void 0?void 0:n.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},d5=t=>{const n=t.CapacitorCustomPlatform||null,a=t.Capacitor||{},o=a.Plugins=a.Plugins||{},r=()=>n!==null?n.name:c5(t),i=()=>r()!=="web",s=h=>{const m=u.get(h);return!!(m!=null&&m.platforms.has(r())||l(h))},l=h=>{var m;return(m=a.PluginHeaders)===null||m===void 0?void 0:m.find(p=>p.name===h)},d=h=>t.console.error(h),u=new Map,c=(h,m={})=>{const p=u.get(h);if(p)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),p.proxy;const f=r(),g=l(h);let y;const k=async()=>(!y&&f in m?y=typeof m[f]=="function"?y=await m[f]():y=m[f]:n!==null&&!y&&"web"in m&&(y=typeof m.web=="function"?y=await m.web():y=m.web),y),w=(S,x)=>{var N,L;if(g){const F=g==null?void 0:g.methods.find(B=>x===B.name);if(F)return F.rtype==="promise"?B=>a.nativePromise(h,x.toString(),B):(B,C)=>a.nativeCallback(h,x.toString(),B,C);if(S)return(N=S[x])===null||N===void 0?void 0:N.bind(S)}else{if(S)return(L=S[x])===null||L===void 0?void 0:L.bind(S);throw new Xa(`"${h}" plugin is not implemented on ${f}`,an.Unimplemented)}},E=S=>{let x;const N=(...L)=>{const F=k().then(B=>{const C=w(B,S);if(C){const O=C(...L);return x=O==null?void 0:O.remove,O}else throw new Xa(`"${h}.${S}()" is not implemented on ${f}`,an.Unimplemented)});return S==="addListener"&&(F.remove=async()=>x()),F};return N.toString=()=>`${S.toString()}() { [capacitor code] }`,Object.defineProperty(N,"name",{value:S,writable:!1,configurable:!1}),N},v=E("addListener"),M=E("removeListener"),A=(S,x)=>{const N=v({eventName:S},x),L=async()=>{const B=await N;M({eventName:S,callbackId:B},x)},F=new Promise(B=>N.then(()=>B({remove:L})));return F.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await L()},F},R=new Proxy({},{get(S,x){switch(x){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?A:v;case"removeListener":return M;default:return E(x)}}});return o[h]=R,u.set(h,{name:h,proxy:R,platforms:new Set([...Object.keys(m),...g?[f]:[]])}),R};return a.convertFileSrc||(a.convertFileSrc=h=>h),a.getPlatform=r,a.handleError=d,a.isNativePlatform=i,a.isPluginAvailable=s,a.registerPlugin=c,a.Exception=Xa,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},ea=(t=>t.Capacitor=d5(t))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),wn=ea.registerPlugin;class ta{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(n,a){let o=!1;this.listeners[n]||(this.listeners[n]=[],o=!0),this.listeners[n].push(a);const i=this.windowListeners[n];i&&!i.registered&&this.addWindowListener(i),o&&this.sendRetainedArgumentsForEvent(n);const s=async()=>this.removeListener(n,a);return Promise.resolve({remove:s})}async removeAllListeners(){this.listeners={};for(const n in this.windowListeners)this.removeWindowListener(this.windowListeners[n]);this.windowListeners={}}notifyListeners(n,a,o){const r=this.listeners[n];if(!r){if(o){let i=this.retainedEventArguments[n];i||(i=[]),i.push(a),this.retainedEventArguments[n]=i}return}r.forEach(i=>i(a))}hasListeners(n){var a;return!!(!((a=this.listeners[n])===null||a===void 0)&&a.length)}registerWindowListener(n,a){this.windowListeners[a]={registered:!1,windowEventName:n,pluginEventName:a,handler:o=>{this.notifyListeners(a,o)}}}unimplemented(n="not implemented"){return new ea.Exception(n,an.Unimplemented)}unavailable(n="not available"){return new ea.Exception(n,an.Unavailable)}async removeListener(n,a){const o=this.listeners[n];if(!o)return;const r=o.indexOf(a);this.listeners[n].splice(r,1),this.listeners[n].length||this.removeWindowListener(this.windowListeners[n])}addWindowListener(n){window.addEventListener(n.windowEventName,n.handler),n.registered=!0}removeWindowListener(n){n&&(window.removeEventListener(n.windowEventName,n.handler),n.registered=!1)}sendRetainedArgumentsForEvent(n){const a=this.retainedEventArguments[n];a&&(delete this.retainedEventArguments[n],a.forEach(o=>{this.notifyListeners(n,o)}))}}const D1=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),F1=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class u5 extends ta{async getCookies(){const n=document.cookie,a={};return n.split(";").forEach(o=>{if(o.length<=0)return;let[r,i]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=F1(r).trim(),i=F1(i).trim(),a[r]=i}),a}async setCookie(n){try{const a=D1(n.key),o=D1(n.value),r=`; expires=${(n.expires||"").replace("expires=","")}`,i=(n.path||"/").replace("path=",""),s=n.url!=null&&n.url.length>0?`domain=${n.url}`:"";document.cookie=`${a}=${o||""}${r}; path=${i}; ${s};`}catch(a){return Promise.reject(a)}}async deleteCookie(n){try{document.cookie=`${n.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const n=document.cookie.split(";")||[];for(const a of n)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(n){return Promise.reject(n)}}async clearAllCookies(){try{await this.clearCookies()}catch(n){return Promise.reject(n)}}}wn("CapacitorCookies",{web:()=>new u5});const f5=async t=>new Promise((n,a)=>{const o=new FileReader;o.onload=()=>{const r=o.result;n(r.indexOf(",")>=0?r.split(",")[1]:r)},o.onerror=r=>a(r),o.readAsDataURL(t)}),m5=(t={})=>{const n=Object.keys(t);return Object.keys(t).map(r=>r.toLocaleLowerCase()).reduce((r,i,s)=>(r[i]=t[n[s]],r),{})},h5=(t,n=!0)=>t?Object.entries(t).reduce((o,r)=>{const[i,s]=r;let l,d;return Array.isArray(s)?(d="",s.forEach(u=>{l=n?encodeURIComponent(u):u,d+=`${i}=${l}&`}),d.slice(0,-1)):(l=n?encodeURIComponent(s):s,d=`${i}=${l}`),`${o}&${d}`},"").substr(1):null,L1=(t,n={})=>{const a=Object.assign({method:t.method||"GET",headers:t.headers},n),r=m5(t.headers)["content-type"]||"";if(typeof t.data=="string")a.body=t.data;else if(r.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[s,l]of Object.entries(t.data||{}))i.set(s,l);a.body=i.toString()}else if(r.includes("multipart/form-data")||t.data instanceof FormData){const i=new FormData;if(t.data instanceof FormData)t.data.forEach((l,d)=>{i.append(d,l)});else for(const l of Object.keys(t.data))i.append(l,t.data[l]);a.body=i;const s=new Headers(a.headers);s.delete("content-type"),a.headers=s}else(r.includes("application/json")||typeof t.data=="object")&&(a.body=JSON.stringify(t.data));return a};class p5 extends ta{async request(n){const a=L1(n,n.webFetchExtra),o=h5(n.params,n.shouldEncodeUrlParams),r=o?`${n.url}?${o}`:n.url,i=await fetch(r,a),s=i.headers.get("content-type")||"";let{responseType:l="text"}=i.ok?n:{};s.includes("application/json")&&(l="json");let d,u;switch(l){case"arraybuffer":case"blob":u=await i.blob(),d=await f5(u);break;case"json":d=await i.json();break;case"document":case"text":default:d=await i.text()}const c={};return i.headers.forEach((h,m)=>{c[m]=h}),{data:d,headers:c,status:i.status,url:i.url}}async get(n){return this.request(Object.assign(Object.assign({},n),{method:"GET"}))}async post(n){return this.request(Object.assign(Object.assign({},n),{method:"POST"}))}async put(n){return this.request(Object.assign(Object.assign({},n),{method:"PUT"}))}async patch(n){return this.request(Object.assign(Object.assign({},n),{method:"PATCH"}))}async delete(n){return this.request(Object.assign(Object.assign({},n),{method:"DELETE"}))}}wn("CapacitorHttp",{web:()=>new p5});const na={RECORDING:"RECORDING",PAUSED:"PAUSED",NONE:"NONE"},jt=wn("VoiceRecorder",{web:()=>Promise.resolve().then(()=>$x).then(t=>new t.VoiceRecorderWeb)});function $1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M8.25 4.5a3.75 3.75 0 1 1 7.5 0v8.25a3.75 3.75 0 1 1-7.5 0V4.5Z"}),e.createElementVNode("path",{d:"M6 10.5a.75.75 0 0 1 .75.75v1.5a5.25 5.25 0 1 0 10.5 0v-1.5a.75.75 0 0 1 1.5 0v1.5a6.751 6.751 0 0 1-6 6.709v2.291h3a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h3v-2.291a6.751 6.751 0 0 1-6-6.709v-1.5A.75.75 0 0 1 6 10.5Z"})])}function g5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function P1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z","clip-rule":"evenodd"})])}function y5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z","clip-rule":"evenodd"})])}function k5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z","clip-rule":"evenodd"})])}const x5={key:0,class:"bg-base-300 absolute bottom-14 left-0 z-50 flex w-full items-center justify-between rounded-t-2xl p-3"},b5={class:"flex h-11 items-center"},w5={key:0},E5={key:0},v5={key:1,class:"flex w-full justify-between rounded-lg border-2 border-gray-500 p-2 px-4"},C5={key:1},S5={class:"flex w-full items-center justify-between gap-2"},B5=["disabled"],V5=["disabled"],M5={key:1,class:"loader-mobile-audio-recorder"},N5=Ce({__name:"mobileAudioRecorder",props:{disableBtn:{type:Boolean,default:!1},sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","paused"],setup(t,{emit:n}){const a=n,o=t,r=e.ref(null),i=e.ref(!1),s=e.ref(0),l=e.ref(null),d=e.ref([]),u=e.ref(null),c=e.ref("00:00"),h=e.ref(!1),m=e.ref(null);let p=0;e.onUnmounted(()=>{R()});const f=()=>{let C;try{if(d.value.length>0){const O=d.value.map(ee=>{const P=atob(ee),H=new Array(P.length);for(let oe=0;oe<P.length;oe++)H[oe]=P.charCodeAt(oe);const _=new Uint8Array(H);return new Blob([_],{type:u.value})}),Z=new Blob(O,{type:u.value}),Q=URL.createObjectURL(Z);return C=new Audio(Q),C}}catch(O){console.error("Erro ao criar o objeto Audio:",O)}},g=C=>{C==="play"?(m.value.currentTime=p,m.value.oncanplay=()=>{m.value.play().then(()=>{h.value=!0}).catch(O=>{console.error("Erro ao tentar reproduzir o áudio:",O)})},m.value.onended=()=>{h.value=!1,p=0},m.value.onerror=O=>{console.error("Erro ao carregar o áudio:",O)},m.value.load()):C==="pause"&&(m.value&&!m.value.paused?(h.value=!1,m.value.pause()):console.error("Nenhum áudio está tocando no momento"))},y=C=>{const O=Math.floor(C/60),Z=(C%60).toFixed(0),Q=O.toString().padStart(2,"0"),ee=Z.toString().padStart(2,"0");return`${Q}:${ee}`},k=()=>{s.value++,c.value=y(s.value)},w=()=>{l.value&&clearInterval(l.value),l.value=setInterval(k,1e3)},E=()=>{l.value&&clearInterval(l.value)},v=async()=>{let{value:C}=await jt.hasAudioRecordingPermission();if(C)try{jt.startRecording(),a("recording",!0),r.value="started",w()}catch(O){console.error(O)}else T1({group:"error",title:"Erro",text:"Permissões de microfone desativadas, ajuste nas configurações do dispositivo"},4e3)},M=()=>{try{a("paused",!0),r.value="paused",R(),E()}catch(C){console.error(C)}},A=()=>{try{m.value&&(m.value.pause(),h.value=!1),a("paused",!1),r.value="started",v(),w()}catch(C){console.error(C)}},R=async()=>{(await jt.getCurrentStatus()).status!=="NONE"&&await jt.stopRecording().then(O=>{u.value=O.value.mimeType,d.value.push(O.value.recordDataBase64),m.value=f(),E()})},S=async()=>{const C=await jt.getCurrentStatus();C.status==="RECORDING"?(await R(),a("paused",!1),a("recording",!1),r.value=null,d.value=[],i.value=!1,s.value=0,c.value=y(0)):C.status==="NONE"&&(a("recording",!1),a("paused",!1),r.value=null,i.value=!1,d.value=[],s.value=0,c.value=y(0))},x=async()=>{await jt.getCurrentStatus(),m.value&&(m.value.pause(),h.value=!1),S()};function N(C){const O=atob(C),Z=O.length,Q=new Uint8Array(Z);for(let ee=0;ee<Z;ee++)Q[ee]=O.charCodeAt(ee);return Q}function L(C){let O=C.reduce((ee,P)=>ee+P.length,0),Z=new Uint8Array(O),Q=0;return C.forEach(ee=>{Z.set(ee,Q),Q+=ee.length}),Z}function F(C){let O="",Z=C.byteLength;for(let Q=0;Q<Z;Q++)O+=String.fromCharCode(C[Q]);return btoa(O)}const B=async()=>{i.value=!0,(await jt.getCurrentStatus()).status==="RECORDING"&&await R();try{const O=d.value.map(N),Z=L(O),Q=F(Z),ee=`data:${u.value};base64,${Q}`,H={type:"file",media:{name:"audio",mimetype:(_=>_?_.split(";")[0].split(":")[1]:null)(ee),data:ee}};console.log("payload",JSON.stringify(H)),await o.sendAudioToAttendant(o.selectedAttendant.id,H,o.attendant,!0),S()}catch(O){S(),console.error("Erro ao enviar áudio:",O),T1({group:"error",title:"Erro",text:"Erro ao enviar áudio, tente novamente."},4e3);return}};return(C,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"bounce"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",x5,[e.createElementVNode("div",b5,[r.value!="paused"?(e.openBlock(),e.createElementBlock("section",w5,"Gravando")):e.createCommentVNode("",!0)]),r.value!="paused"?(e.openBlock(),e.createElementBlock("section",E5,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("section",v5,[h.value?(e.openBlock(),e.createElementBlock("button",C5,[e.createVNode(e.unref(P1),{class:"size-6 cursor-pointer",onClick:O[1]||(O[1]=Z=>g("pause"))})])):(e.openBlock(),e.createElementBlock("button",{key:0,onClick:O[0]||(O[0]=Z=>g("play"))},[e.createVNode(e.unref(y5),{class:"size-6 cursor-pointer"})])),O[7]||(O[7]=e.createElementVNode("div",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",S5,[r.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:O[2]||(O[2]=Z=>x())},[e.createVNode(e.unref(k5),{class:"ml-2 size-6 cursor-pointer text-red-500/80 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:O[3]||(O[3]=Z=>A())},[e.createVNode(e.unref($1),{class:"size-7 cursor-pointer text-green-500/90 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="started"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:O[4]||(O[4]=Z=>M())},[e.createVNode(e.unref(P1),{class:"size-7 cursor-pointer text-green-500 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("button",{key:4,disabled:i.value,class:"mr-2 flex items-center justify-center rounded-full bg-primary p-2 drop-shadow-md",onClick:O[6]||(O[6]=Z=>B())},[i.value?(e.openBlock(),e.createElementBlock("span",M5)):(e.openBlock(),e.createBlock(e.unref(g5),{key:0,class:"size-5 cursor-pointer"}))],8,V5)):(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full bg-primary p-2 send-audio-button",disabled:t.disableBtn,onClick:O[5]||(O[5]=Z=>v())},[e.createVNode(e.unref($1),{class:"hover:text-white size-5"})],8,B5))])],64))}},[["__scopeId","data-v-becd1b1f"]]),A5={class:"messages-container bg-base-300"},T5={class:"header-intern bg-base-300"},D5={class:"atendente-name"},F5={key:0,class:"date-separator bg-base-100/50"},L5={class:"date-separator-text"},$5={key:0,class:"dropdown-container-internal-messages"},P5=["onClick"],O5={class:"message-time"},_5={key:1},R5={class:"message-time"},H5={class:"input-area"},O1=Ce({__name:"ChatMessages",props:{isMobile:{type:Boolean,default:!1},selectedAtendente:{type:Object,required:!0},attendant:{required:!0},loadMessagesForAtendente:{type:Function,required:!0},sendMessageToAtendente:{type:Function,required:!0},hasNextPageForAtendente:{type:Function,required:!0},downloadFilesMobile:{type:Function},openMobilePdf:{type:Function}},emits:["send-files","voltar"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=e.ref(null),s=e.ref(!1),l=e.ref(!1),d=e.ref(!1),u=e.computed(()=>{var S;return((S=a.selectedAtendente)==null?void 0:S.messages)||[]}),c=S=>{a.isMobile&&a.openMobilePdf(S)},h=(S,x)=>{if(S)if(a.isMobile){const L=S.mimetype.split("/")[1],F={url:S.mimetype==="image/svg+xml"?S.data.replace("+","%2B"):S.data,type:L,title:S.name};a.downloadFilesMobile(F,x)}else R(S.data,x)},m=e.computed(()=>a.hasNextPageForAtendente(a.selectedAtendente.id)),p=S=>{const x=new Date(S),N=x.getHours(),L=x.getMinutes();return`${N.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`},f=S=>{const x=new Date(S);return T3(x)?"Hoje":F3(x)?"Ontem":A3(x)?Lr(x,"EEEE",{locale:dr}):Lr(x,"dd 'de' MMMM 'de' yyyy",{locale:dr})},g=S=>{if(S===0)return!0;const x=new Date(u.value[S].created_at),N=new Date(u.value[S-1].created_at);return x.toDateString()!==N.toDateString()},y=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),E())},k=()=>{i.value&&i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},w=async S=>{try{if(!m.value){S.complete();return}const x=i.value.scrollHeight,N=i.value.scrollTop;await a.loadMessagesForAtendente(a.selectedAtendente.id),await e.nextTick(),i.value.scrollTop=i.value.scrollHeight-x+N-32,S.loaded()}catch(x){console.error(x),S.complete()}},E=async()=>{if(r.value.trim()!=="")try{const S=JSON.parse(JSON.stringify(r.value));r.value="",await a.sendMessageToAtendente(a.selectedAtendente.id,S,a.attendant),await e.nextTick(),k()}catch(S){console.error("Erro ao enviar mensagem:",S)}},v=()=>{E();const S=document.querySelector(".send-button");S.classList.add("clicked"),setTimeout(()=>{S.classList.remove("clicked")},200)},M=()=>{o("send-files");const S=document.querySelector(".send-files-button");S.classList.add("clicked"),setTimeout(()=>{S.classList.remove("clicked")},200)};e.onMounted(async()=>{await e.nextTick(()=>{k(),s.value=!0})}),e.watch(()=>{var S;return(S=u.value)==null?void 0:S.length},(S,x)=>{u.value&&A()&&setTimeout(()=>{i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},100)});function A(){const x=i.value.scrollTop+i.value.clientHeight;return i.value.scrollHeight-x<=80}const R=async(S,x="undefined")=>{const N=S.endsWith("svg+xml");try{const L=await fetch(N?S.replace("+","%2B"):S);if(!L.ok)throw new Error("Erro ao baixar o arquivo");const F=L.headers.get("Content-Type"),B=await L.arrayBuffer(),C=F&&F!=="application/octet-stream"?F:"audio/mp3",O=new Blob([B],{type:C}),Z=window.URL.createObjectURL(O),Q=document.createElement("a");Q.href=Z;const ee=F.endsWith("aac")?`${x}.mp3`:x;Q.download=ee,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),window.URL.revokeObjectURL(Z)}catch(L){console.error("Erro no download:",L)}};return(S,x)=>{const N=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("div",A5,[e.createElementVNode("div",T5,[e.createElementVNode("button",{onClick:x[0]||(x[0]=L=>o("voltar")),class:"back-button"},[...x[4]||(x[4]=[e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M14.502 7.046h-2.5v-.928a2.122 2.122 0 0 0-1.199-1.954 1.827 1.827 0 0 0-1.984.311L3.71 8.965a2.2 2.2 0 0 0 0 3.24L8.82 16.7a1.829 1.829 0 0 0 1.985.31 2.121 2.121 0 0 0 1.199-1.959v-.928h1a2.025 2.025 0 0 1 1.999 2.047V19a1 1 0 0 0 1.275.961 6.59 6.59 0 0 0 4.662-7.22 6.593 6.593 0 0 0-6.437-5.695Z"})],-1)])]),e.createVNode(Na,{url:t.selectedAtendente.photo},null,8,["url"]),e.createElementVNode("h3",D5,e.toDisplayString(t.selectedAtendente.name),1)]),e.createElementVNode("div",{class:"message-area",ref_key:"chatArea",ref:i},[!d.value&&m.value&&s.value?(e.openBlock(),e.createBlock(e.unref(Xt),{key:0,onInfinite:w,distance:30,top:!0,direction:"top",class:"p-3"},{complete:e.withCtx(()=>[...x[5]||(x[5]=[e.createElementVNode("span",null,null,-1)])]),spinner:e.withCtx(()=>[...x[6]||(x[6]=[e.createElementVNode("div",{class:"loading"},[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})])],-1)])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(L,F)=>(e.openBlock(),e.createElementBlock("div",{key:F},[g(F)?(e.openBlock(),e.createElementBlock("div",F5,[x[7]||(x[7]=e.createElementVNode("div",{class:"date-separator-line"},null,-1)),e.createElementVNode("div",L5,e.toDisplayString(f(L.created_at)),1),x[8]||(x[8]=e.createElementVNode("div",{class:"date-separator-line"},null,-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["message",{me:L.sender.id===t.attendant.id,"not-me":L.sender.id!==t.attendant.id,"new-message":F===u.value.length-1}])},[e.createElementVNode("div",{class:e.normalizeClass(["relative",L.sender.id===t.attendant.id?"text-right":"text-left"])},[L.content&&L.content.media&&L.content.media.data?(e.openBlock(),e.createElementBlock("div",$5,[e.createVNode(N,{hover:"",class:"label-popper-internal-messages",placement:"left"},{content:e.withCtx(()=>[e.createElementVNode("button",{class:"download-button-internal-messages",onClick:B=>h(L.content.media,L.content.media.name)}," Baixar ",8,P5)]),default:e.withCtx(()=>[x[9]||(x[9]=e.createElementVNode("button",{class:"dropdown-toggle-internal-messages"},[e.createElementVNode("svg",{class:"dropdown-icon-internal-messages","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"})])],-1))]),_:2},1024)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["shadow shadow-gray-900 dark:shadow-gray-500",["message-content",{me:L.sender.id===t.attendant.id,"not-me":L.sender.id!==t.attendant.id}]])},[L.content&&L.content.media&&L.content.media.data?(e.openBlock(),e.createBlock(Ya,{key:0,mode:"message",isMobile:t.isMobile,onDownload:B=>h(L.content.media,L.content.media.name),onOpenMobilePdf:B=>c(L.content.media.data),avatar:L.sender.id===t.attendant.id?t.attendant.photo:L.sender.photo,fileName:L.content.media.name,base64:L.content.media.data,mimetype:L.content.media.mimetype},{"content-message":e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(L.content.content),1)]),"time-message":e.withCtx(()=>[e.createElementVNode("div",O5,e.toDisplayString(p(L.created_at)),1)]),_:2},1032,["isMobile","onDownload","onOpenMobilePdf","avatar","fileName","base64","mimetype"])):(e.openBlock(),e.createElementBlock("section",_5,[e.createElementVNode("p",null,e.toDisplayString(L.content.content),1),e.createElementVNode("div",R5,e.toDisplayString(p(L.created_at)),1)]))],2)],2)],2)]))),128))])],512),e.createElementVNode("div",H5,[e.withDirectives(e.createElementVNode("textarea",{type:"text","onUpdate:modelValue":x[1]||(x[1]=L=>r.value=L),class:"message-input bg-base-300 focus:ring-0",placeholder:"Digite sua mensagem...",onKeydown:y},null,544),[[e.vModelText,r.value]]),e.createElementVNode("button",{onClick:M,class:"send-files-button"},[...x[10]||(x[10]=[e.createElementVNode("svg",{class:"size-5 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8v8a5 5 0 1 0 10 0V6.5a3.5 3.5 0 1 0-7 0V15a2 2 0 0 0 4 0V8"})],-1)])]),r.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:v,class:"send-button"},[...x[11]||(x[11]=[e.createElementVNode("svg",{class:"size-5 text-white rotate-90","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})],-1)])])):(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["bg-base-300",["send-audio-button",{recording:l.value}]])},[t.isMobile?(e.openBlock(),e.createBlock(N5,{key:0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:x[2]||(x[2]=L=>l.value=L)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"])):(e.openBlock(),e.createBlock(i5,{key:1,"can-send-message":!0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:x[3]||(x[3]=L=>l.value=L)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"]))],2))])])}}},[["__scopeId","data-v-5bc3a393"]]),z5={},j5={class:"loading"};function G5(t,n){return e.openBlock(),e.createElementBlock("div",j5,[...n[0]||(n[0]=[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-30",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)])])}const _1=Ce(z5,[["render",G5],["__scopeId","data-v-bd52ddea"]]);/**
93
+ `,caption:y}]):Pe.show([{src:f,type:"image",caption:y}]))},c=()=>{const f=document.createElement("canvas"),g=320,y=180;f.width=g,f.height=y;const k=f.getContext("2d");return k.fillStyle="black",k.fillRect(0,0,g,y),f.toDataURL("image/png")};function h(f,g=1){return new Promise((y,k)=>{const w=document.createElement("video");w.src=f,w.crossOrigin="anonymous",w.muted=!0,w.playsInline=!0,w.preload="auto",w.addEventListener("loadeddata",()=>{w.readyState>=2&&(w.currentTime=g)}),w.addEventListener("seeked",()=>{const E=document.createElement("canvas");E.width=w.videoWidth,E.height=w.videoHeight,E.getContext("2d").drawImage(w,0,0,E.width,E.height);const M=E.toDataURL("image/png");y(M)})})}const m=f=>typeof f=="string"&&f.startsWith("data:")&&f.includes(";base64,"),p=f=>{const g=Math.floor(f/60),y=(f%60).toFixed(0),k=g.toString().padStart(2,"0"),w=y.toString().padStart(2,"0");return`${k}:${w}`};return e.onMounted(async()=>{try{const f=await h(n.base64),g=f&&f!=="data:,";a.value=g?f:c()}catch(f){console.error("Erro ao gerar thumbnail:",f),a.value=c()}}),(f,g)=>(e.openBlock(),e.createElementBlock("main",{class:e.normalizeClass({main_preview_files_container_message:t.mode==="message",main_preview_files_container_miniature:t.mode==="miniature","main_preview_files_container_preview bg-base-200":t.mode==="preview"})},[!t.isMobile&&i.value?(e.openBlock(),e.createElementBlock("section",h4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"iframe_preview_files",src:t.base64,frameborder:"0"},null,8,p4)):(e.openBlock(),e.createElementBlock("svg",g4,[...g[6]||(g[6]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"},null,-1)])]))])):t.isMobile&&i.value&&t.mode==="message"?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(t.mode==="message"?"flex flex-col bg-base-300 p-2 rounded-md gap-2":"")},[e.createElementVNode("span",y4,[g[7]||(g[7]=e.createElementVNode("svg",{class:"size-8 text-primary","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",k4,e.toDisplayString(t.fileName),1)]),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",x4,[e.createElementVNode("button",{class:"bg-base-200 p-2 text-primary w-full text-xs rounded-md hover:bg-base-100",onClick:g[0]||(g[0]=y=>f.$emit("open-mobile-pdf"))}," Abrir PDF ")])):e.createCommentVNode("",!0)],2)):s.value?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[1]||(g[1]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[e.createElementVNode("div",b4,[e.createElementVNode("div",w4,[(e.openBlock(),e.createElementBlock("svg",E4,[...g[8]||(g[8]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",v4,[...g[9]||(g[9]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",C4,[...g[10]||(g[10]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",S4,[...g[11]||(g[11]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:m(t.base64)?t.base64:t.base64.replace("+","%2B")},null,10,B4)])):d(t.mimetype)?(e.openBlock(),e.createElementBlock("section",V4,[t.mode==="preview"?(e.openBlock(),e.createElementBlock("video",{key:0,width:"300",height:"150",controls:"",src:t.base64},[e.createElementVNode("source",{src:t.base64,type:t.mimetype},null,8,N4)],8,M4)):t.mode==="miniature"?(e.openBlock(),e.createElementBlock("svg",A4,[...g[12]||(g[12]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14 7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7Zm2 9.387 4.684 1.562A1 1 0 0 0 22 17V7a1 1 0 0 0-1.316-.949L16 7.613v8.774Z","clip-rule":"evenodd"},null,-1)])])):t.mode==="message"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:g[2]||(g[2]=y=>u(t.base64,t.mimetype)),class:"video_message_preview_container"},[a.value?(e.openBlock(),e.createElementBlock("section",T4,[e.createElementVNode("div",D4,[g[17]||(g[17]=e.createElementVNode("svg",{class:"size-12 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",F4,[(e.openBlock(),e.createElementBlock("svg",L4,[...g[13]||(g[13]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",$4,[...g[14]||(g[14]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",P4,[...g[15]||(g[15]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e.openBlock(),e.createElementBlock("svg",O4,[...g[16]||(g[16]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])]),e.createElementVNode("img",{class:e.normalizeClass(["preview_img",t.mode]),src:a.value},null,10,_4)])):(e.openBlock(),e.createElementBlock("span",R4,[...g[18]||(g[18]=[e.createElementVNode("span",{class:"loader-preview-lib"},null,-1)])]))])):e.createCommentVNode("",!0)])):l.value?(e.openBlock(),e.createElementBlock("section",H4,[t.mode!=="miniature"?(e.openBlock(),e.createElementBlock("section",z4,[e.createVNode(M1,{avatar:t.avatar,audio:t.base64,onDuration:g[3]||(g[3]=y=>o.value=y),onCurrentTime:g[4]||(g[4]=y=>r.value=y)},null,8,["avatar","audio"])])):(e.openBlock(),e.createElementBlock("svg",j4,[...g[19]||(g[19]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 8a1 1 0 0 1 1 1v3a4.006 4.006 0 0 0 4 4h4a4.006 4.006 0 0 0 4-4V9a1 1 0 1 1 2 0v3.001A6.006 6.006 0 0 1 14.001 18H13v2h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2H9.999A6.006 6.006 0 0 1 4 12.001V9a1 1 0 0 1 1-1Z","clip-rule":"evenodd"},null,-1),e.createElementVNode("path",{d:"M7 6a4 4 0 0 1 4-4h2a4 4 0 0 1 4 4v5a4 4 0 0 1-4 4h-2a4 4 0 0 1-4-4V6Z"},null,-1)])]))])):(e.openBlock(),e.createElementBlock("div",{key:5,class:e.normalizeClass(t.mode==="message"?"generic_files":"")},[g[20]||(g[20]=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"size-8 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z","clip-rule":"evenodd"})])],-1)),t.mode==="message"?(e.openBlock(),e.createElementBlock("span",G4,[e.createElementVNode("p",I4,e.toDisplayString(t.fileName),1),e.createElementVNode("button",{class:"download_btn_generic_files",onClick:g[5]||(g[5]=y=>f.$emit("download"))}," Baixar arquivo ")])):e.createCommentVNode("",!0)],2)),t.mode==="message"?(e.openBlock(),e.createElementBlock("div",q4,[e.renderSlot(f.$slots,"content-message",{},void 0,!0),e.createElementVNode("div",{class:e.normalizeClass([o.value?"justify-between":" justify-end","flex w-full"])},[l.value&&o.value?(e.openBlock(),e.createElementBlock("p",W4,e.toDisplayString(p(o.value))+" - "+e.toDisplayString(r.value?p(r.value):"00:00"),1)):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"time-message",{},void 0,!0)],2)])):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-6405f10f"]]),U4={props:{audioStream:MediaStream},data(){return{audioContext:null,analyser:null}},mounted(){this.initializeAudio()},methods:{initializeAudio(){this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.analyser=this.audioContext.createAnalyser();const t=this.$refs.canvas,n=t.getContext("2d");this.audioContext.createMediaStreamSource(this.audioStream).connect(this.analyser),this.analyser.fftSize=256;const o=this.analyser.frequencyBinCount,r=new Uint8Array(o),i=()=>{this.analyser.getByteFrequencyData(r),n.clearRect(0,0,t.width,t.height);const s=t.width/o*2.5,l=t.height/2;let d=0;n.strokeStyle="green",n.lineWidth=2,n.beginPath(),n.moveTo(0,l),n.lineTo(t.width,l),n.stroke(),r.forEach(u=>{const c=u;n.fillStyle=`rgb(50, ${c+100}, 50)`,n.fillRect(d,l-c/2,s,c),d+=s+1}),this.audioStream.active&&requestAnimationFrame(i)};i()}}},Z4={ref:"canvas",width:"200",height:"40",class:"mx-auto flex items-center rounded"};function Y4(t,n,a,o,r,i){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("canvas",Z4,null,512)])}const X4=Ce(U4,[["render",Y4],["__scopeId","data-v-49dbe3dd"]]),K4={key:0,class:"flex w-full items-center space-x-3 text-white dark:text-black"},Q4=["disabled"],J4=["disabled"],e5={key:0,class:"size-4 hover:text-red-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 10 16"},t5={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 hover:text-emerald-500"},n5={key:5,class:"flex w-full items-center space-x-2"},a5={class:"text-xs"},o5={key:0},r5={key:1,class:"flex items-center px-2 pr-[21px]"},i5=Ce({__name:"audioRecorder",props:{canSendMessage:Boolean,sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","b64Audio"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(null),i=e.ref(!1),s=e.ref(!1),l=e.ref(0),d=e.ref(0),u=e.ref(null),c=e.ref(null),h=e.ref(null),m=e.ref(null),p=e.ref(0),f=e.ref(0),g=e.ref(null),y=e.ref(!1),k=e.ref(!1),w=B=>{p.value=B},E=B=>{f.value=B},v=B=>{const C=Math.floor(B/60),O=(B%60).toFixed(0),Z=C.toString().padStart(2,"0"),Q=O.toString().padStart(2,"0");return`${Z}:${Q}`},M=async()=>{try{c.value=null,m.value=await navigator.mediaDevices.getUserMedia({audio:!0}),r.value=new MediaRecorder(m.value),r.value.ondataavailable=A,r.value.start(),R(),i.value=!0,o("recording",!0)}catch(B){console.error("Erro ao iniciar a gravação:",B)}},A=B=>{B.data.size>0&&!y.value&&(u.value=new Blob([B.data]),g.value=URL.createObjectURL(u.value),N())},R=()=>{let B=Date.now();h.value=setInterval(()=>{l.value=d.value+Math.floor((Date.now()-B)/1e3)},1e3)},S=async()=>{c.value=null,r.value&&i.value&&(s.value?(r.value.resume(),R()):(r.value.pause(),clearInterval(h.value),d.value=l.value),s.value=!s.value)},x=async()=>{r.value&&i.value&&(await r.value.stop(),clearInterval(h.value),i.value=!1,s.value=!1,N()),m.value&&m.value.getTracks().forEach(B=>B.stop())},N=async()=>{if(u.value){const B=new Blob([u.value],{type:"audio/mpeg"}),C=new FileReader;C.onload=()=>{c.value=C.result},C.readAsDataURL(B)}},L=async()=>{k.value=!0,o("b64Audio",c.value);const C={type:"file",media:{name:"audio",mimetype:(O=>O?O.split(";")[0].split(":")[1]:null)(c.value),data:c.value}};await a.sendAudioToAttendant(a.selectedAttendant.id,C,a.attendant,!0),o("recording",!1),k.value=!1,m.value=null,c.value=null,u.value=null,i.value=!1,s.value=!1,l.value=0},F=async()=>{y.value=!0,i.value=!1,o("recording",!1),await r.value.stop(),m.value&&(m.value.getTracks().forEach(B=>B.stop()),m.value=null),u.value=null,clearInterval(h.value),c.value=null,s.value=!1,l.value=0};return(B,C)=>{var O;return k.value?(e.openBlock(),e.createElementBlock("div",r5,[...C[9]||(C[9]=[e.createElementVNode("span",{class:"loader-audio-recorder"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",K4,[!i.value&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["send-audio-button",{recording:i.value}]),disabled:i.value||!t.canSendMessage,onClick:C[0]||(C[0]=Z=>(M(),d.value=0,y.value=!1))},[...C[3]||(C[3]=[e.createElementVNode("svg",{class:"start-recording-icon","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 19"},[e.createElementVNode("path",{d:"M15 5a1 1 0 0 0-1 1v3a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6a1 1 0 0 0-2 0v3a6.006 6.006 0 0 0 6 6h1v2H5a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9v-2h1a6.006 6.006 0 0 0 6-6V6a1 1 0 0 0-1-1Z"}),e.createElementVNode("path",{d:"M9 0H7a3 3 0 0 0-3 3v5a3 3 0 0 0 3 3h2a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3Z"})],-1)])],10,Q4)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"rounded-full bg-red-500 p-1.5 hover:bg-red-600",onClick:C[1]||(C[1]=Z=>F())},[...C[4]||(C[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})],-1)])])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!i.value&&!s.value,onClick:S},[s.value?(e.openBlock(),e.createElementBlock("svg",t5,[...C[6]||(C[6]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 7.5V18M15 7.5V18M3 16.811V8.69c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 010 1.954l-7.108 4.061A1.125 1.125 0 013 16.811z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",e5,[...C[5]||(C[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M0 .8C0 .358.32 0 .714 0h1.429c.394 0 .714.358.714.8v14.4c0 .442-.32.8-.714.8H.714a.678.678 0 0 1-.505-.234A.851.851 0 0 1 0 15.2V.8Zm7.143 0c0-.442.32-.8.714-.8h1.429c.19 0 .37.084.505.234.134.15.209.354.209.566v14.4c0 .442-.32.8-.714.8H7.857c-.394 0-.714-.358-.714-.8V.8Z","clip-rule":"evenodd"},null,-1)])]))],8,J4)):e.createCommentVNode("",!0),(i.value||u.value)&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full p-1.5 hover:bg-gray-100 hover:text-light",onClick:x},[...C[7]||(C[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})],-1)])])):e.createCommentVNode("",!0),m.value&&i.value&&!s.value?(e.openBlock(),e.createBlock(X4,{key:4,"audio-stream":m.value},null,8,["audio-stream"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",n5,[e.createVNode(M1,{avatar:((O=t.attendant)==null?void 0:O.photo)||null,audio:c.value,onDuration:w,onCurrentTime:E},null,8,["avatar","audio"]),e.createElementVNode("main",a5,[e.createElementVNode("div",null,e.toDisplayString(v(f.value)),1),i.value||u.value?(e.openBlock(),e.createElementBlock("div",o5,e.toDisplayString(v(l.value)),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"rounded-full p-2 hover:bg-base-100",onClick:C[2]||(C[2]=Z=>L())},[...C[8]||(C[8]=[e.createElementVNode("svg",{class:"size-5 text-base-200 rotate-90","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})],-1)])])):e.createCommentVNode("",!0)]))}}},[["__scopeId","data-v-fe1e6df5"]]);function s5(t){return{all:t=t||new Map,on:function(n,a){var o=t.get(n);o?o.push(a):t.set(n,[a])},off:function(n,a){var o=t.get(n);o&&(a?o.splice(o.indexOf(a)>>>0,1):t.set(n,[]))},emit:function(n,a){var o=t.get(n);o&&o.slice().map(function(r){r(a)}),(o=t.get("*"))&&o.slice().map(function(r){r(n,a)})}}}const N1=s5();let A1=0;const l5=()=>{const t=A1;return A1+=1,t},T1=(t,n)=>{const a={...t,id:l5(),group:t.group||""};return N1.emit("notify",{notification:a,timeout:n}),()=>N1.emit("close",a.id)};/*! Capacitor: https://capacitorjs.com/ - MIT License */var an;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(an||(an={}));class Xa extends Error{constructor(n,a,o){super(n),this.message=n,this.code=a,this.data=o}}const c5=t=>{var n,a;return t!=null&&t.androidBridge?"android":!((a=(n=t==null?void 0:t.webkit)===null||n===void 0?void 0:n.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},d5=t=>{const n=t.CapacitorCustomPlatform||null,a=t.Capacitor||{},o=a.Plugins=a.Plugins||{},r=()=>n!==null?n.name:c5(t),i=()=>r()!=="web",s=h=>{const m=u.get(h);return!!(m!=null&&m.platforms.has(r())||l(h))},l=h=>{var m;return(m=a.PluginHeaders)===null||m===void 0?void 0:m.find(p=>p.name===h)},d=h=>t.console.error(h),u=new Map,c=(h,m={})=>{const p=u.get(h);if(p)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),p.proxy;const f=r(),g=l(h);let y;const k=async()=>(!y&&f in m?y=typeof m[f]=="function"?y=await m[f]():y=m[f]:n!==null&&!y&&"web"in m&&(y=typeof m.web=="function"?y=await m.web():y=m.web),y),w=(S,x)=>{var N,L;if(g){const F=g==null?void 0:g.methods.find(B=>x===B.name);if(F)return F.rtype==="promise"?B=>a.nativePromise(h,x.toString(),B):(B,C)=>a.nativeCallback(h,x.toString(),B,C);if(S)return(N=S[x])===null||N===void 0?void 0:N.bind(S)}else{if(S)return(L=S[x])===null||L===void 0?void 0:L.bind(S);throw new Xa(`"${h}" plugin is not implemented on ${f}`,an.Unimplemented)}},E=S=>{let x;const N=(...L)=>{const F=k().then(B=>{const C=w(B,S);if(C){const O=C(...L);return x=O==null?void 0:O.remove,O}else throw new Xa(`"${h}.${S}()" is not implemented on ${f}`,an.Unimplemented)});return S==="addListener"&&(F.remove=async()=>x()),F};return N.toString=()=>`${S.toString()}() { [capacitor code] }`,Object.defineProperty(N,"name",{value:S,writable:!1,configurable:!1}),N},v=E("addListener"),M=E("removeListener"),A=(S,x)=>{const N=v({eventName:S},x),L=async()=>{const B=await N;M({eventName:S,callbackId:B},x)},F=new Promise(B=>N.then(()=>B({remove:L})));return F.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await L()},F},R=new Proxy({},{get(S,x){switch(x){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?A:v;case"removeListener":return M;default:return E(x)}}});return o[h]=R,u.set(h,{name:h,proxy:R,platforms:new Set([...Object.keys(m),...g?[f]:[]])}),R};return a.convertFileSrc||(a.convertFileSrc=h=>h),a.getPlatform=r,a.handleError=d,a.isNativePlatform=i,a.isPluginAvailable=s,a.registerPlugin=c,a.Exception=Xa,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},ea=(t=>t.Capacitor=d5(t))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),wn=ea.registerPlugin;class ta{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(n,a){let o=!1;this.listeners[n]||(this.listeners[n]=[],o=!0),this.listeners[n].push(a);const i=this.windowListeners[n];i&&!i.registered&&this.addWindowListener(i),o&&this.sendRetainedArgumentsForEvent(n);const s=async()=>this.removeListener(n,a);return Promise.resolve({remove:s})}async removeAllListeners(){this.listeners={};for(const n in this.windowListeners)this.removeWindowListener(this.windowListeners[n]);this.windowListeners={}}notifyListeners(n,a,o){const r=this.listeners[n];if(!r){if(o){let i=this.retainedEventArguments[n];i||(i=[]),i.push(a),this.retainedEventArguments[n]=i}return}r.forEach(i=>i(a))}hasListeners(n){var a;return!!(!((a=this.listeners[n])===null||a===void 0)&&a.length)}registerWindowListener(n,a){this.windowListeners[a]={registered:!1,windowEventName:n,pluginEventName:a,handler:o=>{this.notifyListeners(a,o)}}}unimplemented(n="not implemented"){return new ea.Exception(n,an.Unimplemented)}unavailable(n="not available"){return new ea.Exception(n,an.Unavailable)}async removeListener(n,a){const o=this.listeners[n];if(!o)return;const r=o.indexOf(a);this.listeners[n].splice(r,1),this.listeners[n].length||this.removeWindowListener(this.windowListeners[n])}addWindowListener(n){window.addEventListener(n.windowEventName,n.handler),n.registered=!0}removeWindowListener(n){n&&(window.removeEventListener(n.windowEventName,n.handler),n.registered=!1)}sendRetainedArgumentsForEvent(n){const a=this.retainedEventArguments[n];a&&(delete this.retainedEventArguments[n],a.forEach(o=>{this.notifyListeners(n,o)}))}}const D1=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),F1=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class u5 extends ta{async getCookies(){const n=document.cookie,a={};return n.split(";").forEach(o=>{if(o.length<=0)return;let[r,i]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=F1(r).trim(),i=F1(i).trim(),a[r]=i}),a}async setCookie(n){try{const a=D1(n.key),o=D1(n.value),r=`; expires=${(n.expires||"").replace("expires=","")}`,i=(n.path||"/").replace("path=",""),s=n.url!=null&&n.url.length>0?`domain=${n.url}`:"";document.cookie=`${a}=${o||""}${r}; path=${i}; ${s};`}catch(a){return Promise.reject(a)}}async deleteCookie(n){try{document.cookie=`${n.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const n=document.cookie.split(";")||[];for(const a of n)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(n){return Promise.reject(n)}}async clearAllCookies(){try{await this.clearCookies()}catch(n){return Promise.reject(n)}}}wn("CapacitorCookies",{web:()=>new u5});const f5=async t=>new Promise((n,a)=>{const o=new FileReader;o.onload=()=>{const r=o.result;n(r.indexOf(",")>=0?r.split(",")[1]:r)},o.onerror=r=>a(r),o.readAsDataURL(t)}),m5=(t={})=>{const n=Object.keys(t);return Object.keys(t).map(r=>r.toLocaleLowerCase()).reduce((r,i,s)=>(r[i]=t[n[s]],r),{})},h5=(t,n=!0)=>t?Object.entries(t).reduce((o,r)=>{const[i,s]=r;let l,d;return Array.isArray(s)?(d="",s.forEach(u=>{l=n?encodeURIComponent(u):u,d+=`${i}=${l}&`}),d.slice(0,-1)):(l=n?encodeURIComponent(s):s,d=`${i}=${l}`),`${o}&${d}`},"").substr(1):null,L1=(t,n={})=>{const a=Object.assign({method:t.method||"GET",headers:t.headers},n),r=m5(t.headers)["content-type"]||"";if(typeof t.data=="string")a.body=t.data;else if(r.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[s,l]of Object.entries(t.data||{}))i.set(s,l);a.body=i.toString()}else if(r.includes("multipart/form-data")||t.data instanceof FormData){const i=new FormData;if(t.data instanceof FormData)t.data.forEach((l,d)=>{i.append(d,l)});else for(const l of Object.keys(t.data))i.append(l,t.data[l]);a.body=i;const s=new Headers(a.headers);s.delete("content-type"),a.headers=s}else(r.includes("application/json")||typeof t.data=="object")&&(a.body=JSON.stringify(t.data));return a};class p5 extends ta{async request(n){const a=L1(n,n.webFetchExtra),o=h5(n.params,n.shouldEncodeUrlParams),r=o?`${n.url}?${o}`:n.url,i=await fetch(r,a),s=i.headers.get("content-type")||"";let{responseType:l="text"}=i.ok?n:{};s.includes("application/json")&&(l="json");let d,u;switch(l){case"arraybuffer":case"blob":u=await i.blob(),d=await f5(u);break;case"json":d=await i.json();break;case"document":case"text":default:d=await i.text()}const c={};return i.headers.forEach((h,m)=>{c[m]=h}),{data:d,headers:c,status:i.status,url:i.url}}async get(n){return this.request(Object.assign(Object.assign({},n),{method:"GET"}))}async post(n){return this.request(Object.assign(Object.assign({},n),{method:"POST"}))}async put(n){return this.request(Object.assign(Object.assign({},n),{method:"PUT"}))}async patch(n){return this.request(Object.assign(Object.assign({},n),{method:"PATCH"}))}async delete(n){return this.request(Object.assign(Object.assign({},n),{method:"DELETE"}))}}wn("CapacitorHttp",{web:()=>new p5});const na={RECORDING:"RECORDING",PAUSED:"PAUSED",NONE:"NONE"},jt=wn("VoiceRecorder",{web:()=>Promise.resolve().then(()=>Lx).then(t=>new t.VoiceRecorderWeb)});function $1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M8.25 4.5a3.75 3.75 0 1 1 7.5 0v8.25a3.75 3.75 0 1 1-7.5 0V4.5Z"}),e.createElementVNode("path",{d:"M6 10.5a.75.75 0 0 1 .75.75v1.5a5.25 5.25 0 1 0 10.5 0v-1.5a.75.75 0 0 1 1.5 0v1.5a6.751 6.751 0 0 1-6 6.709v2.291h3a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h3v-2.291a6.751 6.751 0 0 1-6-6.709v-1.5A.75.75 0 0 1 6 10.5Z"})])}function g5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function P1(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z","clip-rule":"evenodd"})])}function y5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z","clip-rule":"evenodd"})])}function k5(t,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z","clip-rule":"evenodd"})])}const x5={key:0,class:"bg-base-300 absolute bottom-14 left-0 z-50 flex w-full items-center justify-between rounded-t-2xl p-3"},b5={class:"flex h-11 items-center"},w5={key:0},E5={key:0},v5={key:1,class:"flex w-full justify-between rounded-lg border-2 border-gray-500 p-2 px-4"},C5={key:1},S5={class:"flex w-full items-center justify-between gap-2"},B5=["disabled"],V5=["disabled"],M5={key:1,class:"loader-mobile-audio-recorder"},N5=Ce({__name:"mobileAudioRecorder",props:{disableBtn:{type:Boolean,default:!1},sendAudioToAttendant:{type:Function,required:!0},selectedAttendant:{type:Object,required:!0},attendant:{required:!0}},emits:["audio-sent","recording","paused"],setup(t,{emit:n}){const a=n,o=t,r=e.ref(null),i=e.ref(!1),s=e.ref(0),l=e.ref(null),d=e.ref([]),u=e.ref(null),c=e.ref("00:00"),h=e.ref(!1),m=e.ref(null);let p=0;e.onUnmounted(()=>{R()});const f=()=>{let C;try{if(d.value.length>0){const O=d.value.map(ee=>{const P=atob(ee),H=new Array(P.length);for(let oe=0;oe<P.length;oe++)H[oe]=P.charCodeAt(oe);const _=new Uint8Array(H);return new Blob([_],{type:u.value})}),Z=new Blob(O,{type:u.value}),Q=URL.createObjectURL(Z);return C=new Audio(Q),C}}catch(O){console.error("Erro ao criar o objeto Audio:",O)}},g=C=>{C==="play"?(m.value.currentTime=p,m.value.oncanplay=()=>{m.value.play().then(()=>{h.value=!0}).catch(O=>{console.error("Erro ao tentar reproduzir o áudio:",O)})},m.value.onended=()=>{h.value=!1,p=0},m.value.onerror=O=>{console.error("Erro ao carregar o áudio:",O)},m.value.load()):C==="pause"&&(m.value&&!m.value.paused?(h.value=!1,m.value.pause()):console.error("Nenhum áudio está tocando no momento"))},y=C=>{const O=Math.floor(C/60),Z=(C%60).toFixed(0),Q=O.toString().padStart(2,"0"),ee=Z.toString().padStart(2,"0");return`${Q}:${ee}`},k=()=>{s.value++,c.value=y(s.value)},w=()=>{l.value&&clearInterval(l.value),l.value=setInterval(k,1e3)},E=()=>{l.value&&clearInterval(l.value)},v=async()=>{let{value:C}=await jt.hasAudioRecordingPermission();if(C)try{jt.startRecording(),a("recording",!0),r.value="started",w()}catch(O){console.error(O)}else T1({group:"error",title:"Erro",text:"Permissões de microfone desativadas, ajuste nas configurações do dispositivo"},4e3)},M=()=>{try{a("paused",!0),r.value="paused",R(),E()}catch(C){console.error(C)}},A=()=>{try{m.value&&(m.value.pause(),h.value=!1),a("paused",!1),r.value="started",v(),w()}catch(C){console.error(C)}},R=async()=>{(await jt.getCurrentStatus()).status!=="NONE"&&await jt.stopRecording().then(O=>{u.value=O.value.mimeType,d.value.push(O.value.recordDataBase64),m.value=f(),E()})},S=async()=>{const C=await jt.getCurrentStatus();C.status==="RECORDING"?(await R(),a("paused",!1),a("recording",!1),r.value=null,d.value=[],i.value=!1,s.value=0,c.value=y(0)):C.status==="NONE"&&(a("recording",!1),a("paused",!1),r.value=null,i.value=!1,d.value=[],s.value=0,c.value=y(0))},x=async()=>{await jt.getCurrentStatus(),m.value&&(m.value.pause(),h.value=!1),S()};function N(C){const O=atob(C),Z=O.length,Q=new Uint8Array(Z);for(let ee=0;ee<Z;ee++)Q[ee]=O.charCodeAt(ee);return Q}function L(C){let O=C.reduce((ee,P)=>ee+P.length,0),Z=new Uint8Array(O),Q=0;return C.forEach(ee=>{Z.set(ee,Q),Q+=ee.length}),Z}function F(C){let O="",Z=C.byteLength;for(let Q=0;Q<Z;Q++)O+=String.fromCharCode(C[Q]);return btoa(O)}const B=async()=>{i.value=!0,(await jt.getCurrentStatus()).status==="RECORDING"&&await R();try{const O=d.value.map(N),Z=L(O),Q=F(Z),ee=`data:${u.value};base64,${Q}`,H={type:"file",media:{name:"audio",mimetype:(_=>_?_.split(";")[0].split(":")[1]:null)(ee),data:ee}};console.log("payload",JSON.stringify(H)),await o.sendAudioToAttendant(o.selectedAttendant.id,H,o.attendant,!0),S()}catch(O){S(),console.error("Erro ao enviar áudio:",O),T1({group:"error",title:"Erro",text:"Erro ao enviar áudio, tente novamente."},4e3);return}};return(C,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"bounce"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",x5,[e.createElementVNode("div",b5,[r.value!="paused"?(e.openBlock(),e.createElementBlock("section",w5,"Gravando")):e.createCommentVNode("",!0)]),r.value!="paused"?(e.openBlock(),e.createElementBlock("section",E5,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("section",v5,[h.value?(e.openBlock(),e.createElementBlock("button",C5,[e.createVNode(e.unref(P1),{class:"size-6 cursor-pointer",onClick:O[1]||(O[1]=Z=>g("pause"))})])):(e.openBlock(),e.createElementBlock("button",{key:0,onClick:O[0]||(O[0]=Z=>g("play"))},[e.createVNode(e.unref(y5),{class:"size-6 cursor-pointer"})])),O[7]||(O[7]=e.createElementVNode("div",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",S5,[r.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:O[2]||(O[2]=Z=>x())},[e.createVNode(e.unref(k5),{class:"ml-2 size-6 cursor-pointer text-red-500/80 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="paused"?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:O[3]||(O[3]=Z=>A())},[e.createVNode(e.unref($1),{class:"size-7 cursor-pointer text-green-500/90 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value==="started"?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:O[4]||(O[4]=Z=>M())},[e.createVNode(e.unref(P1),{class:"size-7 cursor-pointer text-green-500 drop-shadow-md"})])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("button",{key:4,disabled:i.value,class:"mr-2 flex items-center justify-center rounded-full bg-primary p-2 drop-shadow-md",onClick:O[6]||(O[6]=Z=>B())},[i.value?(e.openBlock(),e.createElementBlock("span",M5)):(e.openBlock(),e.createBlock(e.unref(g5),{key:0,class:"size-5 cursor-pointer"}))],8,V5)):(e.openBlock(),e.createElementBlock("button",{key:3,class:"rounded-full bg-primary p-2 send-audio-button",disabled:t.disableBtn,onClick:O[5]||(O[5]=Z=>v())},[e.createVNode(e.unref($1),{class:"hover:text-white size-5"})],8,B5))])],64))}},[["__scopeId","data-v-becd1b1f"]]),A5={class:"messages-container bg-base-300"},T5={class:"header-intern bg-base-300"},D5={class:"atendente-name"},F5={key:0,class:"date-separator bg-base-100/50"},L5={class:"date-separator-text"},$5={key:0,class:"dropdown-container-internal-messages"},P5=["onClick"],O5={class:"message-time"},_5={key:1},R5={class:"message-time"},H5={class:"input-area"},O1=Ce({__name:"ChatMessages",props:{isMobile:{type:Boolean,default:!1},selectedAtendente:{type:Object,required:!0},attendant:{required:!0},loadMessagesForAtendente:{type:Function,required:!0},sendMessageToAtendente:{type:Function,required:!0},hasNextPageForAtendente:{type:Function,required:!0},downloadFilesMobile:{type:Function},openMobilePdf:{type:Function}},emits:["send-files","voltar"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),i=e.ref(null),s=e.ref(!1),l=e.ref(!1),d=e.ref(!1),u=e.computed(()=>{var S;return((S=a.selectedAtendente)==null?void 0:S.messages)||[]}),c=S=>{a.isMobile&&a.openMobilePdf(S)},h=(S,x)=>{if(S)if(a.isMobile){const L=S.mimetype.split("/")[1],F={url:S.mimetype==="image/svg+xml"?S.data.replace("+","%2B"):S.data,type:L,title:S.name};a.downloadFilesMobile(F,x)}else R(S.data,x)},m=e.computed(()=>a.hasNextPageForAtendente(a.selectedAtendente.id)),p=S=>{const x=new Date(S),N=x.getHours(),L=x.getMinutes();return`${N.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`},f=S=>{const x=new Date(S);return T3(x)?"Hoje":F3(x)?"Ontem":A3(x)?Lr(x,"EEEE",{locale:dr}):Lr(x,"dd 'de' MMMM 'de' yyyy",{locale:dr})},g=S=>{if(S===0)return!0;const x=new Date(u.value[S].created_at),N=new Date(u.value[S-1].created_at);return x.toDateString()!==N.toDateString()},y=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),E())},k=()=>{i.value&&i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},w=async S=>{try{if(!m.value){S.complete();return}const x=i.value.scrollHeight,N=i.value.scrollTop;await a.loadMessagesForAtendente(a.selectedAtendente.id),await e.nextTick(),i.value.scrollTop=i.value.scrollHeight-x+N-32,S.loaded()}catch(x){console.error(x),S.complete()}},E=async()=>{if(r.value.trim()!=="")try{const S=JSON.parse(JSON.stringify(r.value));r.value="",await a.sendMessageToAtendente(a.selectedAtendente.id,S,a.attendant),await e.nextTick(),k()}catch(S){console.error("Erro ao enviar mensagem:",S)}},v=()=>{E();const S=document.querySelector(".send-button");S.classList.add("clicked"),setTimeout(()=>{S.classList.remove("clicked")},200)},M=()=>{o("send-files");const S=document.querySelector(".send-files-button");S.classList.add("clicked"),setTimeout(()=>{S.classList.remove("clicked")},200)};e.onMounted(async()=>{await e.nextTick(()=>{k(),s.value=!0})}),e.watch(()=>{var S;return(S=u.value)==null?void 0:S.length},(S,x)=>{u.value&&A()&&setTimeout(()=>{i.value.scrollTo({top:i.value.scrollHeight,behavior:"instant"})},100)});function A(){const x=i.value.scrollTop+i.value.clientHeight;return i.value.scrollHeight-x<=80}const R=async(S,x="undefined")=>{const N=S.endsWith("svg+xml");try{const L=await fetch(N?S.replace("+","%2B"):S);if(!L.ok)throw new Error("Erro ao baixar o arquivo");const F=L.headers.get("Content-Type"),B=await L.arrayBuffer(),C=F&&F!=="application/octet-stream"?F:"audio/mp3",O=new Blob([B],{type:C}),Z=window.URL.createObjectURL(O),Q=document.createElement("a");Q.href=Z;const ee=F.endsWith("aac")?`${x}.mp3`:x;Q.download=ee,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),window.URL.revokeObjectURL(Z)}catch(L){console.error("Erro no download:",L)}};return(S,x)=>{const N=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("div",A5,[e.createElementVNode("div",T5,[e.createElementVNode("button",{onClick:x[0]||(x[0]=L=>o("voltar")),class:"back-button"},[...x[4]||(x[4]=[e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M14.502 7.046h-2.5v-.928a2.122 2.122 0 0 0-1.199-1.954 1.827 1.827 0 0 0-1.984.311L3.71 8.965a2.2 2.2 0 0 0 0 3.24L8.82 16.7a1.829 1.829 0 0 0 1.985.31 2.121 2.121 0 0 0 1.199-1.959v-.928h1a2.025 2.025 0 0 1 1.999 2.047V19a1 1 0 0 0 1.275.961 6.59 6.59 0 0 0 4.662-7.22 6.593 6.593 0 0 0-6.437-5.695Z"})],-1)])]),e.createVNode(Na,{url:t.selectedAtendente.photo},null,8,["url"]),e.createElementVNode("h3",D5,e.toDisplayString(t.selectedAtendente.name),1)]),e.createElementVNode("div",{class:"message-area",ref_key:"chatArea",ref:i},[!d.value&&m.value&&s.value?(e.openBlock(),e.createBlock(e.unref(Xt),{key:0,onInfinite:w,distance:30,top:!0,direction:"top",class:"p-3"},{complete:e.withCtx(()=>[...x[5]||(x[5]=[e.createElementVNode("span",null,null,-1)])]),spinner:e.withCtx(()=>[...x[6]||(x[6]=[e.createElementVNode("div",{class:"loading"},[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})])],-1)])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(L,F)=>(e.openBlock(),e.createElementBlock("div",{key:F},[g(F)?(e.openBlock(),e.createElementBlock("div",F5,[x[7]||(x[7]=e.createElementVNode("div",{class:"date-separator-line"},null,-1)),e.createElementVNode("div",L5,e.toDisplayString(f(L.created_at)),1),x[8]||(x[8]=e.createElementVNode("div",{class:"date-separator-line"},null,-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["message",{me:L.sender.id===t.attendant.id,"not-me":L.sender.id!==t.attendant.id,"new-message":F===u.value.length-1}])},[e.createElementVNode("div",{class:e.normalizeClass(["relative",L.sender.id===t.attendant.id?"text-right":"text-left"])},[L.content&&L.content.media&&L.content.media.data?(e.openBlock(),e.createElementBlock("div",$5,[e.createVNode(N,{hover:"",class:"label-popper-internal-messages",placement:"left"},{content:e.withCtx(()=>[e.createElementVNode("button",{class:"download-button-internal-messages",onClick:B=>h(L.content.media,L.content.media.name)}," Baixar ",8,P5)]),default:e.withCtx(()=>[x[9]||(x[9]=e.createElementVNode("button",{class:"dropdown-toggle-internal-messages"},[e.createElementVNode("svg",{class:"dropdown-icon-internal-messages","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"})])],-1))]),_:2},1024)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["shadow shadow-gray-900 dark:shadow-gray-500",["message-content",{me:L.sender.id===t.attendant.id,"not-me":L.sender.id!==t.attendant.id}]])},[L.content&&L.content.media&&L.content.media.data?(e.openBlock(),e.createBlock(Ya,{key:0,mode:"message",isMobile:t.isMobile,onDownload:B=>h(L.content.media,L.content.media.name),onOpenMobilePdf:B=>c(L.content.media.data),avatar:L.sender.id===t.attendant.id?t.attendant.photo:L.sender.photo,fileName:L.content.media.name,base64:L.content.media.data,mimetype:L.content.media.mimetype},{"content-message":e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(L.content.content),1)]),"time-message":e.withCtx(()=>[e.createElementVNode("div",O5,e.toDisplayString(p(L.created_at)),1)]),_:2},1032,["isMobile","onDownload","onOpenMobilePdf","avatar","fileName","base64","mimetype"])):(e.openBlock(),e.createElementBlock("section",_5,[e.createElementVNode("p",null,e.toDisplayString(L.content.content),1),e.createElementVNode("div",R5,e.toDisplayString(p(L.created_at)),1)]))],2)],2)],2)]))),128))])],512),e.createElementVNode("div",H5,[e.withDirectives(e.createElementVNode("textarea",{type:"text","onUpdate:modelValue":x[1]||(x[1]=L=>r.value=L),class:"message-input bg-base-300 focus:ring-0",placeholder:"Digite sua mensagem...",onKeydown:y},null,544),[[e.vModelText,r.value]]),e.createElementVNode("button",{onClick:M,class:"send-files-button"},[...x[10]||(x[10]=[e.createElementVNode("svg",{class:"size-5 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8v8a5 5 0 1 0 10 0V6.5a3.5 3.5 0 1 0-7 0V15a2 2 0 0 0 4 0V8"})],-1)])]),r.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:v,class:"send-button"},[...x[11]||(x[11]=[e.createElementVNode("svg",{class:"size-5 text-white rotate-90","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})],-1)])])):(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["bg-base-300",["send-audio-button",{recording:l.value}]])},[t.isMobile?(e.openBlock(),e.createBlock(N5,{key:0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:x[2]||(x[2]=L=>l.value=L)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"])):(e.openBlock(),e.createBlock(i5,{key:1,"can-send-message":!0,attendant:t.attendant,selectedAttendant:t.selectedAtendente,sendAudioToAttendant:t.sendMessageToAtendente,onRecording:x[3]||(x[3]=L=>l.value=L)},null,8,["attendant","selectedAttendant","sendAudioToAttendant"]))],2))])])}}},[["__scopeId","data-v-5bc3a393"]]),z5={},j5={class:"loading"};function G5(t,n){return e.openBlock(),e.createElementBlock("div",j5,[...n[0]||(n[0]=[e.createElementVNode("svg",{class:"spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-30",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)])])}const _1=Ce(z5,[["render",G5],["__scopeId","data-v-bd52ddea"]]);/**
94
94
  * Vue 3 Carousel 0.16.0
95
95
  * (c) 2025
96
96
  * @license MIT
@@ -129,4 +129,4 @@ $bm_rt = loopOut('cycle', 0);`},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,
129
129
  c5.426-1.969,11.42-1.629,16.591,0.935c5.171,2.565,9.08,7.133,10.792,12.646L353.732,451.163z M296.189,175.873
130
130
  c-5.686-1.423-12.815-2.847-22.064-2.847c-47.017,0-84.035,46.27-84.035,101.11c0,27.053,12.117,44.117,35.594,44.117
131
131
  c26.346,0,54.125-33.443,60.527-74.754L296.189,175.873z"/>
132
- </svg>`,info:a.content.info??"Nome que será atribuído no Produto",type:a.content.type??"text",placeholder:a.content.placeholder??"Integração de sistemas",empty:a.content.empty??!1,data:a.content.data??""}),i=e.ref(r.data);e.watch(i,l=>{o("update:content",{...r,data:l})},{immediate:!0,deep:!0}),e.watch(()=>a.content,l=>{l.data!==i.value&&(i.value=l.data),l.empty!==r.empty&&(r.empty=l.empty)},{deep:!0});const s=e.computed(()=>r.empty&&!i.value);return(l,d)=>{const u=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",My,[e.createElementVNode("header",Ny,[e.createElementVNode("p",Ay,e.toDisplayString(r.title),1),r.info?(e.openBlock(),e.createBlock(u,{key:0,hover:"",content:r.info,placement:"top",arrow:""},{default:e.withCtx(()=>[...d[2]||(d[2]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1},8,["content"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["input__container",s.value?"input__container--error":"",r.type==="textArea"?"textArea":""])},[r.type!=="textArea"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.value?"text-red-500":"text-base-100"),innerHTML:r.svg},null,10,Ty)):e.createCommentVNode("",!0),r.type!=="textArea"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:r.type,key:r.type,placeholder:r.placeholder,"onUpdate:modelValue":d[0]||(d[0]=c=>i.value=c),class:e.normalizeClass([s.value?"empty":null,"input__field"])},null,10,Dy)),[[e.vModelDynamic,i.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:2,class:e.normalizeClass([s.value?"empty":null,"input__field h-full resize-y"]),"onUpdate:modelValue":d[1]||(d[1]=c=>i.value=c),placeholder:r.placeholder},null,10,Fy)),[[e.vModelText,i.value]]),s.value?(e.openBlock(),e.createElementBlock("span",Ly," Campo obrigatório ")):e.createCommentVNode("",!0)],2)])}}},[["__scopeId","data-v-3673f915"]]),$y=["onClick"],Py={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Oy=["onClick"],_y={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},hi=Ce({__name:"simpleSelect",props:{modelValue:{type:[Array,String,Number,Object],default:()=>[]},options:{type:Array,required:!0,default:()=>[]},placeholder:{type:String,default:"Selecione uma opção..."},multiple:{type:Boolean,default:!1},theme:{type:String,default:"bg-base-300 border-base-300"},teleportTo:{type:String,default:null}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({});Bn(i,()=>r.value=!1);const d=()=>{if(!a.teleportTo||!s.value)return;const p=s.value.getBoundingClientRect();l.value={position:"fixed",top:`${p.bottom+6}px`,left:`${p.left}px`,width:`${p.width}px`,zIndex:9999}};e.watch(r,p=>{p&&d()});const u=[];e.onMounted(()=>{if(a.teleportTo){const p=()=>{r.value&&d()};window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),u.push(["scroll",p],["resize",p])}}),e.onUnmounted(()=>{u.forEach(([p,f])=>window.removeEventListener(p,f,p==="scroll"?!0:void 0))});const c=p=>a.multiple&&Array.isArray(a.modelValue)?a.modelValue.includes(p):a.modelValue===p,h=p=>{if(a.multiple){const f=Array.isArray(a.modelValue)?[...a.modelValue]:[],g=f.indexOf(p);g===-1?f.push(p):f.splice(g,1),o("update:modelValue",f)}else o("update:modelValue",p),r.value=!1},m=e.computed(()=>{if(a.multiple&&Array.isArray(a.modelValue))return a.modelValue.length===0?a.placeholder:a.options.filter(g=>a.modelValue.includes(g.value)).map(g=>g.name).join(", ");const p=a.options.find(f=>f.value===a.modelValue);return(p==null?void 0:p.name)||a.placeholder});return(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:"relative w-full",ref_key:"dropdownRef",ref:i},[e.createElementVNode("div",{onClick:f[0]||(f[0]=g=>r.value=!r.value),class:e.normalizeClass(["flex flex-wrap items-center justify-between p-3 gap-2 rounded-md cursor-pointer transition",t.theme]),ref_key:"triggerRef",ref:s},[e.createElementVNode("span",{class:e.normalizeClass(["text-xs truncate max-w-full",m.value===t.placeholder?"text-gray-400":"text-white"])},e.toDisplayString(m.value),3),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["size-3 text-white transition-transform duration-300",r.value?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...f[1]||(f[1]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"},null,-1)])],2))],2),r.value&&!t.teleportTo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute flex flex-col z-10 mt-1.5 w-full shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>h(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",Py,[...f[2]||(f[2]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,$y))),128))],2)):e.createCommentVNode("",!0),r.value&&t.teleportTo?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:t.teleportTo},[e.createElementVNode("div",{style:e.normalizeStyle(l.value),class:e.normalizeClass(["flex flex-col shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>h(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",_y,[...f[3]||(f[3]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,Oy))),128))],6)],8,["to"])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-3ee440f9"]]),Ry={class:"flex gap-2"},ao=Ce({__name:"outcomeButton",props:{outcome:{type:String,default:null}},emits:["update:outcome","change"],setup(t,{emit:n}){const a=t,o=n;async function r(l){const d=a.outcome===l?null:l;o("update:outcome",d),o("change",d)}const i=e.computed(()=>a.outcome==="won"),s=e.computed(()=>a.outcome==="lost");return(l,d)=>(e.openBlock(),e.createElementBlock("div",Ry,[e.createElementVNode("button",{onClick:d[0]||(d[0]=u=>r("won")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-won":i.value}])},[d[3]||(d[3]=e.createElementVNode("p",null,"Ganho",-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-won":i.value},"text-white size-4"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none"},[...d[2]||(d[2]=[e.createElementVNode("path",{d:"M3.16666 6.37502C3.74962 6.37502 4.2222 6.85073 4.22222 7.43752V15.9375C4.22222 16.5243 3.74963 17 3.16666 17H1.05555C0.472588 17 0 16.5243 0 15.9375V7.43752C1.50967e-05 6.85073 0.472597 6.37502 1.05555 6.37502H3.16666Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.48143 1.4454C9.79496 -0.637173 11.5194 0.143216 11.5194 0.143216C13.863 1.75728 13.005 4.80783 12.2832 6.13118H17.4424C19.5307 6.65187 19.0768 8.34354 18.5887 9.12465C19.5056 10.7905 18.4191 11.7716 17.7609 12.0538C18.1175 13.7717 17.0601 14.4178 16.4869 14.5264C16.8944 16.4004 15.5533 16.9564 14.8314 17H10.436C8.49997 16.9999 6.19055 16.1753 5.27777 15.7632V7.368C9.03523 5.6108 9.09933 3.98356 9.48143 1.4454Z",fill:"CurrentColor"},null,-1)])],2))],2),e.createElementVNode("button",{onClick:d[1]||(d[1]=u=>r("lost")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-lost":s.value}])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-lost":s.value},"text-white size-4 mt-0.8"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 19",fill:"none"},[...d[4]||(d[4]=[e.createElementVNode("path",{d:"M15.8333 10.625C15.2504 10.625 14.7778 10.1493 14.7778 9.56249L14.7778 1.0625C14.7778 0.475698 15.2504 1.57955e-06 15.8333 1.63051e-06L17.9444 1.81507e-06C18.5274 1.86603e-06 19 0.475698 19 1.0625L19 9.56249C19 10.1493 18.5274 10.625 17.9444 10.625L15.8333 10.625Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.51857 15.5546C9.20504 17.6372 7.48065 16.8568 7.48065 16.8568C5.13698 15.2427 5.99503 12.1922 6.71681 10.8688L1.55759 10.8688C-0.530671 10.3481 -0.0768444 8.65646 0.411319 7.87535C-0.50562 6.20951 0.580926 5.22844 1.23906 4.94622C0.882549 3.22832 1.93994 2.5822 2.51315 2.47363C2.10564 0.59965 3.44673 0.0436064 4.16864 6.1075e-07L8.56403 9.95007e-07C10.5 0.000138493 12.8095 0.824657 13.7222 1.23682L13.7222 9.632C9.96477 11.3892 9.90067 13.0164 9.51857 15.5546Z",fill:"CurrentColor"},null,-1)])],2)),d[5]||(d[5]=e.createElementVNode("p",null,"Perdido",-1))],2)]))}},[["__scopeId","data-v-cde71744"]]),Hy=["disabled"],zy=["onMousemove","onClick"],oo=Ce({__name:"ratingInput",props:{modelValue:{type:Number,default:0},size:{type:Number,default:24},gap:{type:Number,default:4},onRate:{type:Function,default:null},readonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(a.modelValue),i=e.ref(0);e.watch(()=>a.modelValue,c=>{r.value=c});const s=e.computed(()=>i.value||r.value);function l(c){const h=s.value-c+1;return h>=1?"100%":h>=.5?"50%":h>0?`${h*100}%`:"0%"}function d(c,h){const m=c.currentTarget.getBoundingClientRect(),p=c.offsetX<m.width/2;i.value=h-(p?.5:0)}function u(c,h){const m=c.currentTarget.getBoundingClientRect(),p=c.offsetX<m.width/2,f=h-(p?.5:0);r.value=r.value===f?0:f,o("update:modelValue",r.value),typeof a.onRate=="function"&&a.onRate(r.value)}return(c,h)=>(e.openBlock(),e.createElementBlock("main",{disabled:a.readonly,class:"flex select-none",style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,m=>e.createElementVNode("div",{key:m,class:e.normalizeClass(["relative",{"cursor-pointer":!a.readonly,"cursor-default":a.readonly}]),style:e.normalizeStyle({width:`${t.size}px`,height:`${t.size}px`}),onMousemove:p=>!a.readonly&&d(p,m),onMouseleave:h[0]||(h[0]=p=>!a.readonly&&(i.value=0)),onClick:p=>!a.readonly&&u(p,m)},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"absolute top-0 left-0 color-disabled",style:e.normalizeStyle({width:`${t.size}px`,height:`${t.size}px`})},[...h[1]||(h[1]=[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"},null,-1)])],4)),e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full overflow-hidden transition-all duration-150",{"text-primary":!i.value,"text-hover":i.value>0}]),style:e.normalizeStyle({width:l(m),height:`${t.size}px`})},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:e.normalizeStyle({width:`${t.size}px`,height:`${t.size}px`})},[...h[2]||(h[2]=[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"},null,-1)])],4))],6)],46,zy)),64))],12,Hy))}},[["__scopeId","data-v-c786170c"]]),jy={key:0,class:"flex items-center justify-center overflow-hidden h-svh"},Gy={key:1,class:"flex flex-col overflow-hidden"},Iy={key:0,class:"sticky top-0 z-50 bg-base-300 py-1 px-1.5 flex gap-2"},qy={class:"total-price-badge"},Wy={key:1,class:"flex-1 overflow-y-auto flex flex-col gap-2 px-2"},Uy={class:"w-full text-gray-500 list-none list-inside dark:text-gray-400 divide-y divide-base-200"},Zy={class:"flex gap-2 items-center"},Yy=["src"],Xy={key:1,class:"size-8 rounded-md flex items-center justify-center border border-base-200"},Ky={class:"flex flex-col items-start"},Qy=["title"],Jy={class:"text-[10px] flex gap-1 items-center"},ek={class:"text-xs font-semibold font-sans"},tk={key:0,class:"font-sans text-primary text-white font-semibold"},nk={class:"text-primary"},ak={class:"flex flex-col gap-1"},ok={class:"flex gap-1"},rk=["onClick"],ik=["onClick"],sk={key:2,class:"h-full flex flex-col items-center justify-center"},lk={key:0,class:"text-gray-200 text-[10px] md:text-xs font-sans"},ck=Ce({__name:"listProducts",props:{modelValue:{type:Array,default:()=>[]},allProducts:{type:Object,default:()=>{}}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref([]),s=e.ref([...a.modelValue]),l=e.ref(1),d=e.ref(null),u=e.ref(null),c=e.computed(()=>s.value.reduce((A,R)=>{var N;const S=((N=R.product)==null?void 0:N.price)||R.price||0,x=R.quantity||0;return A+S*x},0)),h=e.computed(()=>{const A={};return s.value.forEach(R=>{A[R.product.id]=R.quantity}),A}),m=A=>h.value[A.id]||0,p=A=>{const R=s.value.find(S=>S.product.id===A.id);R?R.quantity++:s.value.push({product:{...A},quantity:1})},f=A=>{const R=s.value.find(S=>S.product.id===A.id);R&&(R.quantity>0?R.quantity--:R.quantity=0)},g=(A,R)=>{const S=new URLSearchParams,x=A;return Object.keys(R).forEach(N=>S.append(N,R[N])),`${x}?${S.toString()}`},y=async A=>{try{const{data:R}=await at.get(g($0,{page:l.value,...A})),{results:S,next:x,previous:N}=R;if(d.value=x,u.value=N,l.value===1)i.value=S;else{const L=new Set(i.value.map(B=>B.id)),F=S.filter(B=>!L.has(B.id));i.value=[...i.value,...F]}d.value&&(l.value+=1)}catch(R){console.error("Erro ao buscar produtos:",R)}};e.onMounted(async()=>{var A;a.allProducts&&((A=a.allProducts.results)==null?void 0:A.length)>0?(i.value=a.allProducts.results,d.value=a.allProducts.next||null,u.value=a.allProducts.previous||null,l.value=2):await y()}),e.watch(s,A=>{o("update:modelValue",A)},{deep:!0});const k=e.ref(!1),w=async A=>{if(!k.value){k.value=!0;try{if(!d.value){A.complete();return}await y(),d.value?A.loaded():A.complete()}catch(R){console.error("Erro ao carregar produtos:",R),A.complete()}finally{k.value=!1}}},E=e.ref({query:""}),v=e.ref(!1);let M;return e.watch(E,()=>{clearTimeout(M),M=setTimeout(async()=>{const{query:A}=E.value;l.value=1,v.value=!!A,r.value=!0,await y({query:A}),r.value=!1},500)},{deep:!0}),(A,R)=>{const S=e.resolveComponent("SimpleLoader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",jy,[e.createVNode(S)])):(e.openBlock(),e.createElementBlock("main",Gy,[i.value.length===0&&v.value||!v.value&&i.value.length>0?(e.openBlock(),e.createElementBlock("header",Iy,[e.withDirectives(e.createElementVNode("input",{class:"w-full text-xs bg-base-300 rounded-md pt-1.5 outline-none border-none focus:outline-none focus:ring-0 focus:shadow-none",type:"text",placeholder:"Buscar...","onUpdate:modelValue":R[0]||(R[0]=x=>E.value.query=x)},null,512),[[e.vModelText,E.value.query]]),e.createElementVNode("section",qy," Valor total: "+e.toDisplayString(c.value.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})),1)])):e.createCommentVNode("",!0),i.value.length>0?(e.openBlock(),e.createElementBlock("div",Wy,[e.createElementVNode("ul",Uy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(x,N)=>(e.openBlock(),e.createElementBlock("li",{class:"flex w-full justify-between items-center py-2",key:x.id},[e.createElementVNode("div",Zy,[e.createElementVNode("section",null,[x.photo?(e.openBlock(),e.createElementBlock("img",{key:0,class:"size-8 rounded-md",src:x.photo,alt:""},null,8,Yy)):(e.openBlock(),e.createElementBlock("div",Xy,[...R[1]||(R[1]=[e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M4 19v2c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2H4Z"}),e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M9 3c0-.55228.44772-1 1-1h8c.5523 0 1 .44772 1 1v3c0 .55228-.4477 1-1 1h-2v1h2c.5096 0 .9376.38314.9939.88957L19.8951 17H4.10498l.90116-8.11043C5.06241 8.38314 5.49047 8 6.00002 8H12V7h-2c-.55228 0-1-.44772-1-1V3Zm1.01 8H8.00002v2.01H10.01V11Zm.99 0h2.01v2.01H11V11Zm5.01 0H14v2.01h2.01V11Zm-8.00998 3H10.01v2.01H8.00002V14ZM13.01 14H11v2.01h2.01V14Zm.99 0h2.01v2.01H14V14ZM11 4h6v1h-6V4Z","clip-rule":"evenodd"})],-1)])]))]),e.createElementVNode("section",Ky,[e.createElementVNode("p",{title:x.name,class:e.normalizeClass(["text-xs text-start font-semibold truncate max-w-32",m(x)>0?"text-white":""])},e.toDisplayString(x.name),11,Qy),e.createElementVNode("span",Jy,[e.createElementVNode("p",ek," R$ "+e.toDisplayString(x.price.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})),1),m(x)>0?(e.openBlock(),e.createElementBlock("p",tk,[e.createTextVNode(" - x "+e.toDisplayString(m(x))+" = ",1),e.createElementVNode("a",nk,e.toDisplayString((x.price*m(x)).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("section",ak,[e.createElementVNode("p",{class:e.normalizeClass(["text-xs font-semibold font-sans products-and-services_badge",x.recurrence])},e.toDisplayString(x.recurrence==="monthly"?"Mensal":"Único"),3),e.createElementVNode("div",ok,[e.createElementVNode("button",{class:"action-list-button",onClick:L=>f(x)}," - ",8,rk),e.createElementVNode("p",{class:e.normalizeClass(["w-5 text-xs flex items-center justify-center font-semibold font-sans",m(x)>0?"text-white":""])},e.toDisplayString(m(x)),3),e.createElementVNode("button",{class:"action-list-button",onClick:L=>p(x)}," + ",8,ik)])])]))),128))]),d.value?(e.openBlock(),e.createBlock(e.unref(Xt),{key:0,onInfinite:w,class:"p-3 bg-base-300"},{spinner:e.withCtx(()=>[...R[2]||(R[2]=[e.createElementVNode("section",{class:"w-full justify-center items-center flex"},[e.createElementVNode("div",{class:"size-4 animate-spin rounded-full border-4 border-solid border-white border-t-transparent"})],-1)])]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),!r.value&&i.value.length<=0?(e.openBlock(),e.createElementBlock("section",sk,[R[4]||(R[4]=e.createElementVNode("p",{class:"text-gray-200 text-xs md:text-base font-sans"}," Nenhum item encontrado ",-1)),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",lk,[...R[3]||(R[3]=[e.createTextVNode(" Comece criando seu primeiro na aba ",-1),e.createElementVNode("strong",null,"Produtos",-1)])]))])):e.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-aaa205b7"]]),dk={},uk={class:"flex items-center justify-center h-full"};function fk(t,n){return e.openBlock(),e.createElementBlock("div",uk,[...n[0]||(n[0]=[e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1)])])}const ro=Ce(dk,[["render",fk],["__scopeId","data-v-3f0502dd"]]),mk={key:0,class:"flex items-center justify-center overflow-hidden h-svh"},hk={key:1,class:"rounded-md lg:h-svh bg-base-200 border border-white/10 shadow-sm transition-shadow duration-200 hover:shadow-md p-1"},pk={class:"flex flex-col gap-2"},gk=["onUpdate:modelValue"],yk={class:"text-[10px] font-sans"},kk=["onUpdate:modelValue"],xk=["onUpdate:modelValue"],bk={key:2,class:"rounded-md h-svh bg-base-200 border border-white/10 shadow-sm transition-shadow duration-200 hover:shadow-md p-1 flex flex-col items-center justify-center gap-2"},wk=Ce({__name:"listSegmentationsFields",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(s(a.modelValue)),i=e.ref(!1);function s(d){return JSON.parse(JSON.stringify(d))}const l=async()=>{try{i.value=!0;const d=await at.get(O0);r.value=d.data}catch(d){console.error("Error fetching segmentation fields:",d)}finally{i.value=!1}};return e.onMounted(()=>{a.modelValue.length===0&&l()}),e.watch(r,d=>{JSON.stringify(d)!==JSON.stringify(a.modelValue)&&o("update:modelValue",s(d))},{deep:!0}),(d,u)=>{const c=e.resolveComponent("SimpleSelect");return i.value?(e.openBlock(),e.createElementBlock("div",mk,[e.createVNode(ro)])):r.value.length>0?(e.openBlock(),e.createElementBlock("div",hk,[u[0]||(u[0]=e.createElementVNode("header",{class:"text-start w-full items-center justify-between flex mb-2 px-1"},[e.createElementVNode("p",{class:"text-sm font-semibold"},"Campos Personalizados")],-1)),e.createElementVNode("div",pk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,h=>(e.openBlock(),e.createElementBlock("section",{key:h.id},[e.createElementVNode("div",{class:e.normalizeClass(["flex gap-1 rounded-md",h.type==="bool"?"flex-row items-center":"flex-col items-start"])},[h.type==="bool"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,class:"checkbox size-4 rounded-sm",type:"checkbox","onUpdate:modelValue":m=>h.content=m},null,8,gk)),[[e.vModelCheckbox,h.content]]):e.createCommentVNode("",!0),e.createElementVNode("p",yk,e.toDisplayString(h.name),1),h.type==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,class:"input_field",type:"text","onUpdate:modelValue":m=>h.content=m},null,8,kk)),[[e.vModelText,h.content]]):e.createCommentVNode("",!0),h.type==="float"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,class:"input_field",type:"number","onUpdate:modelValue":m=>h.content=m},null,8,xk)),[[e.vModelText,h.content]]):e.createCommentVNode("",!0),h.type==="list"?(e.openBlock(),e.createBlock(c,{key:3,modelValue:h.content,"onUpdate:modelValue":m=>h.content=m,options:h.additional_info.list.options.map(m=>({value:m,name:m})),placeholder:"Selecione uma opção",theme:"bg-base-300 border-base-100","teleport-to":"body"},null,8,["modelValue","onUpdate:modelValue","options"])):e.createCommentVNode("",!0)],2)]))),128))])])):(e.openBlock(),e.createElementBlock("section",bk,[...u[1]||(u[1]=[e.createElementVNode("p",{class:"text-gray-200 text-xs md:text-base font-sans"}," Nenhum item encontrado ",-1),e.createElementVNode("p",{class:"text-gray-200 text-[10px] md:text-xs font-sans"},[e.createTextVNode(" Comece criando seu primeiro na aba "),e.createElementVNode("strong",null,"Campos Personalizados")],-1)])]))}}},[["__scopeId","data-v-4ffa4dbc"]]),Ek={class:"modal-form-head"},vk={class:"modal_responsive"},Ck={style:{"min-height":"100%"},class:"flex min-h-full items-center justify-center text-center"},Sk={class:"modal-form-container"},Bk={class:"flex justify-between p-2.5 rounded-t-2xl bg-base-300 items-center text-current"},Vk={class:"flex items-center gap-2"},Mk={class:"flex flex-col items-start"},Nk={class:"text-lg font-semibold"},Ak={key:0,class:"text-xs text-gray-400"},Tk={class:"flex gap-2 items-center"},Dk={class:"grid grid-cols-2 h-full min-h-0"},Fk={class:"flex flex-col h-full min-h-0 px-1 py-2"},Lk={title:"Não é possível alterar a foto do cliente neste momento",class:"flex items-center justify-center w-full"},$k=["src"],Pk={key:1,class:"bg-base-300 p-2 rounded-xl size-24 flex items-center justify-center border border-base-100 cursor-not-allowed"},Ok={class:"flex flex-col gap-1.5 w-full h-full overflow-y-auto overflow-x-hidden"},_k={class:"w-full"},Rk={class:"flex flex-col gap-2 w-full"},Hk={class:"flex items-center justify-between px-1"},zk={key:0,class:"flex flex-1 min-h-0 flex-col gap-2"},jk={class:"flex items-center justify-between px-1"},Gk={class:"w-full h-full bg-base-300 rounded-lg flex flex-col min-h-0"},Ik={class:"bg-base-300 flex flex-col h-full min-h-0 overflow-hidden"},qk={key:0,class:"flex gap-1 px-1.5"},Wk=["disabled"],Uk={class:"flex flex-col gap-2 flex-1 min-h-0 px-1.5 pt-1.5 overflow-hidden"},Zk={class:"flex w-full relative"},Yk={key:0,class:"text-xs absolute z-50 -bottom-2 left-1 bg-base-300 px-2 py-0.5 rounded-lg text-red-500 select-none shadow-sm shadow-base-100"},Xk={class:"segmentation-section"},Kk={class:"products-list-section flex-1 min-h-0 overflow-y-auto"},Qk={class:"modal_end_button"},Jk=["disabled"],ex={key:0,class:"size-4 animate-spin rounded-full border-4 border-solid text-white border-t-transparent"},tx={key:1,class:"text-xs font-semibold"},pi=Ce({__name:"clientsForm",props:{form:{type:Object,default:()=>({tags:[],country:"BR",name:"",photo:null,raw_telephone:"",telephone:"",whatsapp_id:"",whatsapp_jid:"",whatsapp_lid:null,rating:null,outcome:null,created_at:"",updated_at:"",client:"",products:[],notes:""})},save:{type:Function,default:()=>{}},hasCrmPlus:{type:Boolean,default:!1},allProducts:{type:Object,default:()=>{}},allTags:{type:Object,default:()=>{}}},emits:["close","save"],setup(t,{emit:n}){const a=n,o=e.ref("data"),r=t,i=e.reactive({...r.form}),s=e.ref(!1),l=e.ref(!1),d=e.ref([{title:"Nome",info:!1,type:"text",placeholder:"Digite o nome do contato",empty:e.computed(()=>l.value?l.value.some(p=>p.startsWith("name")):!1),data:e.computed({get:()=>i.name,set:p=>i.name=p})},{title:"Descrição",info:"Descreva o produto para facilitar a identificação",type:"textArea",placeholder:"Automatize fluxos de trabalho com integração rápida e segura entre sistemas.",empty:!1,data:e.computed({get:()=>i.notes,set:p=>i.notes=p})}]),u=e.computed(()=>r.form.mode==="edit"?"Editar cliente":"Adicionar Novo Cliente"),c=p=>{var g,y;const f=[];return(g=p.name)!=null&&g.trim()||f.push("name"),(y=p.telephone)!=null&&y.trim()||f.push("telephone"),f},h=e.computed(()=>l.value?l.value.some(p=>p.startsWith("telephone")):!1),m=async()=>{try{if(s.value=!0,l.value=c(i),l.value.length>0)return;await r.save(i)}catch(p){console.error(p)}finally{s.value=!1}};return e.watch(()=>r.form,p=>{Object.assign(i,e.toRaw(p))},{deep:!0,immediate:!0}),(p,f)=>{var k,w,E;const g=e.resolveComponent("Popper"),y=e.resolveComponent("vue-tel-input");return e.openBlock(),e.createElementBlock("div",Ek,[f[24]||(f[24]=e.createElementVNode("div",{class:"modal-form-background"},null,-1)),e.createElementVNode("div",vk,[e.createElementVNode("div",Ck,[e.createElementVNode("div",Sk,[e.createElementVNode("div",{class:e.normalizeClass([{noCrmPlus:!t.hasCrmPlus},"clients-form-background relative rounded-2xl bg-base-200 backdrop-blur-lg"])},[e.createElementVNode("div",Bk,[e.createElementVNode("span",Vk,[f[14]||(f[14]=e.createElementVNode("svg",{class:"size-6 text-green-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("span",Mk,[e.createElementVNode("p",Nk,e.toDisplayString(u.value),1),i.id?(e.openBlock(),e.createElementBlock("p",Ak," ID: "+e.toDisplayString(i.id),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("section",Tk,[e.createElementVNode("button",{class:"bg-base-200 p-1.5 rounded-md hover:bg-base-200/70 transition",onClick:f[0]||(f[0]=v=>a("close"))},[...f[15]||(f[15]=[e.createElementVNode("svg",{class:"size-4 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])])])]),e.createElementVNode("div",Dk,[e.createElementVNode("section",Fk,[e.createElementVNode("div",{class:e.normalizeClass([t.hasCrmPlus?"justify-between":"justify-center","flex flex-col gap-2 items-center"])},[t.hasCrmPlus?(e.openBlock(),e.createBlock(ao,{key:0,outcome:i.outcome,"onUpdate:outcome":f[1]||(f[1]=v=>i.outcome=v)},null,8,["outcome"])):e.createCommentVNode("",!0),e.createElementVNode("div",Lk,[i.photo?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f[2]||(f[2]=v=>p.viewSingleImage(i.photo))},[e.createElementVNode("img",{src:i.photo,alt:"",class:"size-24 object-cover rounded-md cursor-not-allowed"},null,8,$k)])):(e.openBlock(),e.createElementBlock("span",Pk,[...f[16]||(f[16]=[e.createElementVNode("svg",{class:"size-14","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z","clip-rule":"evenodd"})],-1)])]))]),t.hasCrmPlus?(e.openBlock(),e.createBlock(oo,{key:1,modelValue:i.rating,"onUpdate:modelValue":f[3]||(f[3]=v=>i.rating=v)},null,8,["modelValue"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",Ok,[e.createElementVNode("div",_k,[e.createVNode(no,{"onUpdate:content":f[4]||(f[4]=v=>d.value[0].data=v.data),content:d.value[0]},null,8,["content"])]),e.createElementVNode("div",Rk,[e.createElementVNode("header",Hk,[f[18]||(f[18]=e.createElementVNode("p",{class:"text-xs font-medium text-left"}," Escolha suas etiquetas ",-1)),e.createVNode(g,{hover:"",content:"Etiquetas que estão atribuídas ao cliente",placement:"top",arrow:""},{default:e.withCtx(()=>[...f[17]||(f[17]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1})]),e.createVNode(to,{teleportTo:"body",maxHeight:"10rem",allTags:t.allTags,modelValue:i.tags,"onUpdate:modelValue":f[5]||(f[5]=v=>i.tags=v)},null,8,["allTags","modelValue"])]),t.hasCrmPlus?(e.openBlock(),e.createElementBlock("div",zk,[e.createElementVNode("header",jk,[f[20]||(f[20]=e.createElementVNode("p",{class:"text-xs font-medium text-left"}," Anotações sobre o cliente ",-1)),e.createVNode(g,{hover:"",content:"Anotações adicionais sobre o cliente",placement:"top",arrow:""},{default:e.withCtx(()=>[...f[19]||(f[19]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1})]),e.createElementVNode("div",Gk,[e.withDirectives(e.createElementVNode("textarea",{class:"form-text-area flex-1 h-full min-h-0","onUpdate:modelValue":f[6]||(f[6]=v=>i.notes=v),maxlength:"1000","aria-label":"Anotações do cliente"},null,512),[[e.vModelText,i.notes]]),e.createElementVNode("div",{class:e.normalizeClass(["text-[10px] bg-base-300 px-1 rounded-md text-right mb-1 mr-1",((k=i.notes)==null?void 0:k.length)>900?"text-red-500":((w=i.notes)==null?void 0:w.length)>700?"text-yellow-500":"text-gray-400"])},e.toDisplayString(((E=i.notes)==null?void 0:E.length)||0)+"/1000 ",3)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("section",Ik,[t.hasCrmPlus?(e.openBlock(),e.createElementBlock("div",qk,[e.createElementVNode("button",{class:e.normalizeClass(["toggle-page-button",{selected:o.value==="data"}]),onClick:f[7]||(f[7]=v=>o.value="data")}," Informações ",2),e.createElementVNode("button",{class:e.normalizeClass(["toggle-page-button",{selected:o.value==="products"}]),disabled:!t.hasCrmPlus,onClick:f[8]||(f[8]=v=>o.value="products")},[...f[21]||(f[21]=[e.createElementVNode("p",null,"Produtos",-1)])],10,Wk)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",Uk,[e.createElementVNode("div",{class:e.normalizeClass([h.value&&!i.telephone?"border-red-500":"border-white/10","rounded-md bg-base-200 border shadow-sm transition-shadow duration-200 hover:shadow-md"])},[f[23]||(f[23]=e.createElementVNode("h1",{class:"text-start w-full items-center justify-between flex p-2"},[e.createElementVNode("p",{class:"text-xs font-semibold"},"Contatos")],-1)),e.createElementVNode("div",Zk,[f[22]||(f[22]=e.createElementVNode("span",{style:{"border-bottom-left-radius":"0.4rem"},class:"bg-base-300 rounded-bl-lg rounded-t-none flex justify-center items-center w-8"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"size-4 text-gray-500 ml-1.5",viewBox:"0 0 17 17"},[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})])],-1)),e.createVNode(y,{class:"z-40 w-full",onCountryChanged:f[9]||(f[9]=v=>i.country=v.iso2),mode:"national",validCharactersOnly:!0,defaultCountry:i.country,inputOptions:{placeholder:"Coloque seu telefone",showDialCode:!1,required:!0,searchBoxPlaceholder:"Brazil"},dropdownOptions:{showSearchBox:!0,showFlags:!0,searchBoxPlaceholder:"Brazil"},modelValue:i.telephone,"onUpdate:modelValue":f[10]||(f[10]=v=>i.telephone=v)},null,8,["defaultCountry","modelValue"]),h.value&&!i.telephone?(e.openBlock(),e.createElementBlock("span",Yk," Campo obrigatorio ")):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",Xk,[e.createVNode(wk,{modelValue:i.segmentation_fields,"onUpdate:modelValue":f[11]||(f[11]=v=>i.segmentation_fields=v)},null,8,["modelValue"])])],512),[[e.vShow,o.value==="data"]]),e.withDirectives(e.createElementVNode("div",Kk,[e.createVNode(ck,{allProducts:t.allProducts,modelValue:i.products,"onUpdate:modelValue":f[12]||(f[12]=v=>i.products=v)},null,8,["allProducts","modelValue"])],512),[[e.vShow,o.value==="products"]])])]),e.createElementVNode("div",Qk,[e.createElementVNode("button",{disabled:s.value,class:"bg-green-500 py-2 px-4 rounded-lg text-sm font-medium hover:bg-green-500/80 transition-colors flex gap-2 items-center justify-center min-w-32",onClick:f[13]||(f[13]=v=>m())},[s.value?(e.openBlock(),e.createElementBlock("div",ex)):(e.openBlock(),e.createElementBlock("p",tx,"Salvar"))],8,Jk)])],2)])])])])}}},[["__scopeId","data-v-6d1e9e05"]]),nx={class:"flex justify-center items-center"},ax={class:"text-[8px] font-bold"},ox={class:"tag-view-popper-content-text"},rx={class:"flex"},ix={class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 25 100",style:{color:"#d1d5db"}},sx={style:{backgroundColor:"#d1d5db"},class:"w-full ml-[-0.5rem] rounded-r-md inline-flex items-center justify-center p-0.5 border-b-2 border-gray-900"},lx={class:"text-[8px] text-black font-bold"},cx={class:"max-h-64 overflow-y-auto hide-scrollbar"},dx={class:"flex flex-col gap-2"},ux={class:"tag-view-popper-content-text"},fx={key:1},gi=Ce({__name:"tagView",props:{clients:{type:Object,required:!0}},setup(t){const n=t;return e.computed(()=>{var a,o;return((o=(a=n.clients)==null?void 0:a.tags)==null?void 0:o.slice(0,4))||[]}),(a,o)=>{const r=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",nx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags.slice(0,4),(i,s)=>(e.openBlock(),e.createBlock(r,{class:"tag-view-theme",arrow:"",hover:"",key:s},{content:e.withCtx(()=>[e.createElementVNode("p",ox,e.toDisplayString(i.name),1)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex",e.unref(vn)(i.color)])},[(e.openBlock(),e.createElementBlock("svg",{class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 30 100",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{style:e.normalizeStyle({backgroundColor:i.color||"#fff"}),class:"w-full ml-[-0.10rem] rounded-r-md inline-flex items-center justify-center px-1 py-0.5 border-b-2 border-gray-900"},[e.createElementVNode("p",ax,e.toDisplayString(i.name.charAt(0).toUpperCase()),1)],4)],2)]),_:2},1024))),128)),t.clients.tags.length>4?(e.openBlock(),e.createBlock(r,{key:0,arrow:"",hover:"",class:"tag-view-theme"},{content:e.withCtx(()=>[e.createElementVNode("section",cx,[e.createElementVNode("div",dx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id||i.name,class:"relative inline-flex items-center rounded-md overflow-hidden"},[(e.openBlock(),e.createElementBlock("svg",{class:"size-6","aria-hidden":"true",viewBox:"0 0 75 100",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[2]||(o[2]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{class:e.normalizeClass(["p-0.5 w-full text-sm font-semibold truncate text-start -ml-2",e.unref(vn)(i.color)]),style:e.normalizeStyle(["max-width: 12rem",{background:i.color||"#fff"}])},[e.createElementVNode("p",ux,e.toDisplayString(i.name),1)],6)]))),128))])])]),default:e.withCtx(()=>[e.createElementVNode("div",rx,[(e.openBlock(),e.createElementBlock("svg",ix,[...o[1]||(o[1]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])])),e.createElementVNode("span",sx,[e.createElementVNode("p",lx," +"+e.toDisplayString(t.clients.tags.length-4),1)])])]),_:1})):e.createCommentVNode("",!0),!t.clients.tags||t.clients.tags.length===0?(e.openBlock(),e.createElementBlock("span",fx,"-")):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-e2356f0a"]]),yi=Ce({__name:"floating-dev",setup(t){const n=e.ref(!1),a=e.ref({x:30,y:30}),o=e.ref({x:0,y:0}),r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({vertical:"bottom",horizontal:"right"}),d=e.computed(()=>({position:"fixed",left:`${a.value.x}px`,top:`${a.value.y}px`,zIndex:1e3,cursor:r.value?"grabbing":"grab"})),u=e.computed(()=>{const g={position:"absolute",background:"#fff",borderRadius:"10px",boxShadow:"0 4px 15px rgba(0, 0, 0, 0.2)",width:"280px",maxWidth:"90vw",zIndex:1001};return l.value.vertical==="top"?g.bottom="60px":g.top="60px",l.value.horizontal==="left"?g.right="0":g.left="0",g});async function c(){if(n.value){n.value=!1;return}n.value=!0,await e.nextTick(),h()}function h(){if(!i.value||!s.value)return;const g=i.value.getBoundingClientRect(),y=s.value.offsetWidth,k=s.value.offsetHeight,w={top:g.top,bottom:window.innerHeight-(g.top+g.height),left:g.left,right:window.innerWidth-(g.left+g.width)};l.value.vertical=w.bottom<k&&w.top>k?"top":"bottom",l.value.horizontal=w.right<y&&w.left>y?"left":"right"}function m(g){r.value=!0;const y=g.type.includes("touch")?g.touches[0]:g;o.value={x:y.clientX-a.value.x,y:y.clientY-a.value.y},document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p),document.addEventListener("touchend",f)}function p(g){if(!r.value)return;const y=g.type.includes("touch")?g.touches[0]:g,k=y.clientX-o.value.x,w=y.clientY-o.value.y,E=window.innerWidth-i.value.offsetWidth,v=window.innerHeight-i.value.offsetHeight;a.value.x=Math.min(Math.max(0,k),E),a.value.y=Math.min(Math.max(0,w),v)}function f(){r.value=!1,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",f)}return e.onBeforeUnmount(f),(g,y)=>(e.openBlock(),e.createElementBlock("div",{class:"floating-widget",style:e.normalizeStyle(d.value),ref_key:"widgetRef",ref:i,onMousedown:m,onTouchstart:m},[e.createElementVNode("button",{class:"floating-button",onClick:e.withModifiers(c,["stop"]),"aria-label":"Abrir painel flutuante"},[...y[0]||(y[0]=[e.createElementVNode("svg",{class:"floating-button-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[e.createElementVNode("path",{d:"M370 378c28.89 23.52 46 46.07 46 86M142 378c-28.89 23.52-46 46.06-46 86M384 208c28.89-23.52 32-56.07 32-96M128 206c-28.89-23.52-32-54.06-32-94M464 288.13h-80M128 288.13H48M256 192v256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M256 448h0c-70.4 0-128-57.6-128-128v-96.07c0-65.07 57.6-96 128-96h0c70.4 0 128 25.6 128 96V320c0 70.4-57.6 128-128 128z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M179.43 143.52a49.08 49.08 0 01-3.43-15.73A80 80 0 01255.79 48h.42A80 80 0 01336 127.79a41.91 41.91 0 01-3.12 14.3",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1)])]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"floating-panel",ref_key:"panelRef",ref:s,style:e.normalizeStyle(u.value)},[e.renderSlot(g.$slots,"default",{},()=>[y[1]||(y[1]=e.createElementVNode("p",{style:{"text-align":"center","font-size":"0.9rem"}}," Adicione seu conteúdo aqui 👇 ",-1))],!0)],4)):e.createCommentVNode("",!0)]),_:3})],36))}},[["__scopeId","data-v-7767be25"]]);Dt.defineStore("debug",{state:()=>({message:"Debug store initialized"}),actions:{logMessage(){console.log(this.message)}}});function mx(t){t.component("primarySelect",yo),t.component("departSelect",ei),t.component("attendantSelect",ti),t.component("SimpleModal",ko),t.component("simpleCard",xo),t.component("instanceSelect",ir),t.component("calendarEvents",kr),t.component("MFA",xr),t.component("MfaQrCode",Td),t.component("chatWindow",Q1),t.component("FilterSelectLib",ni),t.component("MobileInternalChat",J1),t.component("RandomAvatar",ii),t.component("MinModal",si),t.component("LibPatchNotes",di),t.component("BtnNewUpdates",ui),t.component("LibPhotoPicker",fi),t.component("SelectMultipleDepartments",mi),t.component("PrimaryInput",no),t.component("SimpleSelect",hi),t.component("FloatingDev",yi),t.component("RatingInput",oo),t.component("TagView",gi),t.component("ClientsForm",pi),t.component("SelectMultipleTags",to),t.component("SimpleLoader",ro),t.component("OutcomeButton",ao)}function ki(t,n="add"){const a=eo();n==="add"?a.addDepartments(t):n==="delete"?a.removeDepartments(t):n==="update"?(a.departments=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibDeparts.`)}function xi(t,n="add"){const a=Yt();n==="add"?a.addAttendants(t):n==="delete"?a.removeAttendants(t):n==="update"?(a.attendants=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibAttendants.`)}function bi(t,n="add"){const a=va();n==="add"?a.addInstance(t):n==="delete"?a.removeInstance(t):n==="update"?(a.instances=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibInstances.`)}async function wi(t,n,a,o=[],r=[],i=[]){try{const s=await rr(t);n&&await s.setToken(n),a&&(at.defaults.baseURL=a);const l=eo(t);r.length>0&&(l.departments=r,l.count=r.length);const d=Yt(t);o.length>0&&(d.attendants=o,d.count=o.length),await va(t).fetchInstances()}catch(s){console.error("Erro no setupLibrary:",s)}}function Ei(t){return vn(t)}const hx={install:mx,setupLibrary:wi,attLibDeparts:ki,attLibAttendants:xi,attLibInstances:bi,primarySelect:yo,simpleModal:ko,simpleCard:xo,instanceSelect:ir,SimpleSelect:hi,FloatingDev:yi,calendar:kr,SimpleLoader:ro,MFA:xr,chatWindow:Q1,departSelect:ei,attendantSelect:ti,FilterSelectLib:ni,MobileInternalChat:J1,RandomAvatar:ii,MinModal:si,libPatchNotes:di,btnNewUpdates:ui,LibPhotoPicker:fi,SelectMultipleDepartments:mi,SelectMultipleTags:to,PrimaryInput:no,getWithContrastColor:Ei,RatingInput:oo,TagView:gi,ClientsForm:pi,OutcomeButton:ao};function px(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return new Proxy({},{get(o,r){return(i,s,l)=>{const d=t.Capacitor.Plugins[a];if(d===void 0){l(new Error(`Capacitor plugin ${a} not found`));return}if(typeof d[r]!="function"){l(new Error(`Method ${r} not found in Capacitor plugin ${a}`));return}(async()=>{try{const u=await d[r](i);s(u)}catch(u){l(u)}})()}}})}})}function gx(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return t.cordova.plugins[a]}})}function yx(t=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!t?px(window):window.cordova!==void 0&&gx(window))}var vi;(function(t){t.Documents="DOCUMENTS",t.Data="DATA",t.Library="LIBRARY",t.Cache="CACHE",t.External="EXTERNAL",t.ExternalStorage="EXTERNAL_STORAGE",t.ExternalCache="EXTERNAL_CACHE",t.LibraryNoCloud="LIBRARY_NO_CLOUD",t.Temporary="TEMPORARY"})(vi||(vi={}));var io;(function(t){t.UTF8="utf8",t.ASCII="ascii",t.UTF16="utf16"})(io||(io={}));const sa=wn("Filesystem",{web:()=>Promise.resolve().then(()=>Ox).then(t=>new t.FilesystemWeb)});yx();const kx=wn("BlobWriter");function xx(t){return window.btoa(Array.from(new Uint8Array(t)).map(function(n){return String.fromCharCode(n)}).join(""))}function bx({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function(){return new Promise(function(r,i){function s(d){i(d.target.error)}const l=window.indexedDB.open("Disc");l.onerror=s,l.onsuccess=function(){const u=l.result.transaction("FileStorage","readwrite");u.onerror=s;const c=u.objectStore("FileStorage"),h=`/${n}/${t.replace(/^\//,"")}`,m=c.get(h);m.onsuccess=function(){m.result.size=a.size,m.result.content=a;const p=c.put(m.result);p.onsuccess=function(){r(void 0)}}}})})}function Ci({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function r(){if(a.size===0)return Promise.resolve();const i=3*128*1024,s=a.slice(0,i);return a=a.slice(i),new Response(s).arrayBuffer().then(function(d){return sa.appendFile({directory:n,path:t,data:xx(d)})}).then(r)})}function wx(t){const{path:n,directory:a,blob:o,fast_mode:r=!1,recursive:i,on_fallback:s}=t;return!o||!Number.isSafeInteger(o.size)||typeof o.type!="string"?Promise.reject(new Error("Not a Blob.")):ea.getPlatform()==="web"?r?bx(t):Ci(t):Promise.all([kx.get_config(),sa.getUri({path:n,directory:a})]).then(function([l,d]){const u=d.uri.replace("file://","");return(window.CapacitorWebFetch||window.fetch)(l.base_url+u+(i?"?recursive=true":""),{headers:{authorization:l.auth_token},method:"put",body:o}).then(function(h){if(h.status!==204)throw new Error("Bad HTTP status: "+h.status);return d.uri})}).catch(function(d){return s!==void 0&&s(d),Ci(t)})}const Ex=Object.freeze(wx);function vx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Si={};function Cx(t){return t&&t.__esModule?t:{default:t}}var Sx=Cx,so={exports:{}},Bi;function Bx(){return Bi||(Bi=1,function(t){var n=function(a){var o=Object.prototype,r=o.hasOwnProperty,i=Object.defineProperty||function(P,H,_){P[H]=_.value},s,l=typeof Symbol=="function"?Symbol:{},d=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function h(P,H,_){return Object.defineProperty(P,H,{value:_,enumerable:!0,configurable:!0,writable:!0}),P[H]}try{h({},"")}catch{h=function(H,_,oe){return H[_]=oe}}function m(P,H,_,oe){var de=H&&H.prototype instanceof E?H:E,pe=Object.create(de.prototype),ye=new Z(oe||[]);return i(pe,"_invoke",{value:F(P,_,ye)}),pe}a.wrap=m;function p(P,H,_){try{return{type:"normal",arg:P.call(H,_)}}catch(oe){return{type:"throw",arg:oe}}}var f="suspendedStart",g="suspendedYield",y="executing",k="completed",w={};function E(){}function v(){}function M(){}var A={};h(A,d,function(){return this});var R=Object.getPrototypeOf,S=R&&R(R(Q([])));S&&S!==o&&r.call(S,d)&&(A=S);var x=M.prototype=E.prototype=Object.create(A);v.prototype=M,i(x,"constructor",{value:M,configurable:!0}),i(M,"constructor",{value:v,configurable:!0}),v.displayName=h(M,c,"GeneratorFunction");function N(P){["next","throw","return"].forEach(function(H){h(P,H,function(_){return this._invoke(H,_)})})}a.isGeneratorFunction=function(P){var H=typeof P=="function"&&P.constructor;return H?H===v||(H.displayName||H.name)==="GeneratorFunction":!1},a.mark=function(P){return Object.setPrototypeOf?Object.setPrototypeOf(P,M):(P.__proto__=M,h(P,c,"GeneratorFunction")),P.prototype=Object.create(x),P},a.awrap=function(P){return{__await:P}};function L(P,H){function _(pe,ye,Ve,Le){var Ae=p(P[pe],P,ye);if(Ae.type==="throw")Le(Ae.arg);else{var qe=Ae.arg,_e=qe.value;return _e&&typeof _e=="object"&&r.call(_e,"__await")?H.resolve(_e.__await).then(function($e){_("next",$e,Ve,Le)},function($e){_("throw",$e,Ve,Le)}):H.resolve(_e).then(function($e){qe.value=$e,Ve(qe)},function($e){return _("throw",$e,Ve,Le)})}}var oe;function de(pe,ye){function Ve(){return new H(function(Le,Ae){_(pe,ye,Le,Ae)})}return oe=oe?oe.then(Ve,Ve):Ve()}i(this,"_invoke",{value:de})}N(L.prototype),h(L.prototype,u,function(){return this}),a.AsyncIterator=L,a.async=function(P,H,_,oe,de){de===void 0&&(de=Promise);var pe=new L(m(P,H,_,oe),de);return a.isGeneratorFunction(H)?pe:pe.next().then(function(ye){return ye.done?ye.value:pe.next()})};function F(P,H,_){var oe=f;return function(pe,ye){if(oe===y)throw new Error("Generator is already running");if(oe===k){if(pe==="throw")throw ye;return ee()}for(_.method=pe,_.arg=ye;;){var Ve=_.delegate;if(Ve){var Le=B(Ve,_);if(Le){if(Le===w)continue;return Le}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(oe===f)throw oe=k,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);oe=y;var Ae=p(P,H,_);if(Ae.type==="normal"){if(oe=_.done?k:g,Ae.arg===w)continue;return{value:Ae.arg,done:_.done}}else Ae.type==="throw"&&(oe=k,_.method="throw",_.arg=Ae.arg)}}}function B(P,H){var _=H.method,oe=P.iterator[_];if(oe===s)return H.delegate=null,_==="throw"&&P.iterator.return&&(H.method="return",H.arg=s,B(P,H),H.method==="throw")||_!=="return"&&(H.method="throw",H.arg=new TypeError("The iterator does not provide a '"+_+"' method")),w;var de=p(oe,P.iterator,H.arg);if(de.type==="throw")return H.method="throw",H.arg=de.arg,H.delegate=null,w;var pe=de.arg;if(!pe)return H.method="throw",H.arg=new TypeError("iterator result is not an object"),H.delegate=null,w;if(pe.done)H[P.resultName]=pe.value,H.next=P.nextLoc,H.method!=="return"&&(H.method="next",H.arg=s);else return pe;return H.delegate=null,w}N(x),h(x,c,"Generator"),h(x,d,function(){return this}),h(x,"toString",function(){return"[object Generator]"});function C(P){var H={tryLoc:P[0]};1 in P&&(H.catchLoc=P[1]),2 in P&&(H.finallyLoc=P[2],H.afterLoc=P[3]),this.tryEntries.push(H)}function O(P){var H=P.completion||{};H.type="normal",delete H.arg,P.completion=H}function Z(P){this.tryEntries=[{tryLoc:"root"}],P.forEach(C,this),this.reset(!0)}a.keys=function(P){var H=Object(P),_=[];for(var oe in H)_.push(oe);return _.reverse(),function de(){for(;_.length;){var pe=_.pop();if(pe in H)return de.value=pe,de.done=!1,de}return de.done=!0,de}};function Q(P){if(P){var H=P[d];if(H)return H.call(P);if(typeof P.next=="function")return P;if(!isNaN(P.length)){var _=-1,oe=function de(){for(;++_<P.length;)if(r.call(P,_))return de.value=P[_],de.done=!1,de;return de.value=s,de.done=!0,de};return oe.next=oe}}return{next:ee}}a.values=Q;function ee(){return{value:s,done:!0}}return Z.prototype={constructor:Z,reset:function(P){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(O),!P)for(var H in this)H.charAt(0)==="t"&&r.call(this,H)&&!isNaN(+H.slice(1))&&(this[H]=s)},stop:function(){this.done=!0;var P=this.tryEntries[0],H=P.completion;if(H.type==="throw")throw H.arg;return this.rval},dispatchException:function(P){if(this.done)throw P;var H=this;function _(Le,Ae){return pe.type="throw",pe.arg=P,H.next=Le,Ae&&(H.method="next",H.arg=s),!!Ae}for(var oe=this.tryEntries.length-1;oe>=0;--oe){var de=this.tryEntries[oe],pe=de.completion;if(de.tryLoc==="root")return _("end");if(de.tryLoc<=this.prev){var ye=r.call(de,"catchLoc"),Ve=r.call(de,"finallyLoc");if(ye&&Ve){if(this.prev<de.catchLoc)return _(de.catchLoc,!0);if(this.prev<de.finallyLoc)return _(de.finallyLoc)}else if(ye){if(this.prev<de.catchLoc)return _(de.catchLoc,!0)}else if(Ve){if(this.prev<de.finallyLoc)return _(de.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(P,H){for(var _=this.tryEntries.length-1;_>=0;--_){var oe=this.tryEntries[_];if(oe.tryLoc<=this.prev&&r.call(oe,"finallyLoc")&&this.prev<oe.finallyLoc){var de=oe;break}}de&&(P==="break"||P==="continue")&&de.tryLoc<=H&&H<=de.finallyLoc&&(de=null);var pe=de?de.completion:{};return pe.type=P,pe.arg=H,de?(this.method="next",this.next=de.finallyLoc,w):this.complete(pe)},complete:function(P,H){if(P.type==="throw")throw P.arg;return P.type==="break"||P.type==="continue"?this.next=P.arg:P.type==="return"?(this.rval=this.arg=P.arg,this.method="return",this.next="end"):P.type==="normal"&&H&&(this.next=H),w},finish:function(P){for(var H=this.tryEntries.length-1;H>=0;--H){var _=this.tryEntries[H];if(_.finallyLoc===P)return this.complete(_.completion,_.afterLoc),O(_),w}},catch:function(P){for(var H=this.tryEntries.length-1;H>=0;--H){var _=this.tryEntries[H];if(_.tryLoc===P){var oe=_.completion;if(oe.type==="throw"){var de=oe.arg;O(_)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(P,H,_){return this.delegate={iterator:Q(P),resultName:H,nextLoc:_},this.method==="next"&&(this.arg=s),w}},a}(t.exports);try{regeneratorRuntime=n}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}(so)),so.exports}var lo,Vi;function Vx(){return Vi||(Vi=1,lo=Bx()),lo}var co,Mi;function Mx(){if(Mi)return co;Mi=1;function t(a,o,r,i,s,l,d){try{var u=a[l](d),c=u.value}catch(h){r(h);return}u.done?o(c):Promise.resolve(c).then(i,s)}function n(a){return function(){var o=this,r=arguments;return new Promise(function(i,s){var l=a.apply(o,r);function d(c){t(l,i,s,d,u,"next",c)}function u(c){t(l,i,s,d,u,"throw",c)}d(void 0)})}}return co=n,co}(function(t){var n=Sx;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var a=n(Vx()),o=n(Mx());function r(s){return i.apply(this,arguments)}function i(){return(i=(0,o.default)(a.default.mark(function s(l){var d,u;return a.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return d=document.createElement("video"),u=new Promise(function(h,m){d.addEventListener("loadedmetadata",function(){d.duration===1/0?(d.currentTime=Number.MAX_SAFE_INTEGER,d.ontimeupdate=function(){d.ontimeupdate=null,h(d.duration),d.currentTime=0}):h(d.duration)}),d.onerror=function(p){return m(p.target.error)}}),d.src=typeof l=="string"||l instanceof String?l:window.URL.createObjectURL(l),c.abrupt("return",u);case 4:case"end":return c.stop()}},s)}))).apply(this,arguments)}})(Si);const Nx=vx(Si),Tt=()=>({value:!0}),Cn=()=>({value:!1}),Ax=()=>new Error("MISSING_PERMISSION"),Tx=()=>new Error("ALREADY_RECORDING"),Dx=()=>new Error("DEVICE_CANNOT_VOICE_RECORD"),Ni=()=>new Error("FAILED_TO_RECORD"),Fx=()=>new Error("EMPTY_RECORDING"),uo=()=>new Error("RECORDING_HAS_NOT_STARTED"),Ai=()=>new Error("FAILED_TO_FETCH_RECORDING"),fo=()=>new Error("COULD_NOT_QUERY_PERMISSION_STATUS"),Ti={"audio/aac":".aac","audio/mp4":".mp3","audio/webm;codecs=opus":".ogg","audio/webm":".ogg","audio/ogg;codecs=opus":".ogg"},Di=()=>new Promise(()=>{});class ht{constructor(){this.mediaRecorder=null,this.chunks=[],this.pendingResult=Di()}static async canDeviceVoiceRecord(){var n;return((n=navigator==null?void 0:navigator.mediaDevices)===null||n===void 0?void 0:n.getUserMedia)==null||ht.getSupportedMimeType()==null?Cn():Tt()}async startRecording(n){if(this.mediaRecorder!=null)throw Tx();if(!(await ht.canDeviceVoiceRecord()).value)throw Dx();if(!(await ht.hasAudioRecordingPermission().catch(()=>Tt())).value)throw Ax();return navigator.mediaDevices.getUserMedia({audio:!0}).then(r=>this.onSuccessfullyStartedRecording(r,n)).catch(this.onFailedToStartRecording.bind(this))}async stopRecording(){if(this.mediaRecorder==null)throw uo();try{return this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(n=>n.stop()),this.pendingResult}catch{throw Ai()}finally{this.prepareInstanceForNextOperation()}}static async hasAudioRecordingPermission(){return navigator.permissions.query==null?navigator.mediaDevices==null?Promise.reject(fo()):navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>{throw fo()}):navigator.permissions.query({name:"microphone"}).then(n=>({value:n.state==="granted"})).catch(()=>{throw fo()})}static async requestAudioRecordingPermission(){return(await ht.hasAudioRecordingPermission().catch(()=>Cn())).value?Tt():navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>Cn())}pauseRecording(){if(this.mediaRecorder==null)throw uo();return this.mediaRecorder.state==="recording"?(this.mediaRecorder.pause(),Promise.resolve(Tt())):Promise.resolve(Cn())}resumeRecording(){if(this.mediaRecorder==null)throw uo();return this.mediaRecorder.state==="paused"?(this.mediaRecorder.resume(),Promise.resolve(Tt())):Promise.resolve(Cn())}getCurrentStatus(){return this.mediaRecorder==null?Promise.resolve({status:na.NONE}):this.mediaRecorder.state==="recording"?Promise.resolve({status:na.RECORDING}):this.mediaRecorder.state==="paused"?Promise.resolve({status:na.PAUSED}):Promise.resolve({status:na.NONE})}static getSupportedMimeType(){if((MediaRecorder==null?void 0:MediaRecorder.isTypeSupported)==null)return null;const n=Object.keys(Ti).find(a=>MediaRecorder.isTypeSupported(a));return n??null}onSuccessfullyStartedRecording(n,a){return this.pendingResult=new Promise((o,r)=>{this.mediaRecorder=new MediaRecorder(n),this.mediaRecorder.onerror=()=>{this.prepareInstanceForNextOperation(),r(Ni())},this.mediaRecorder.onstop=async()=>{var i,s,l;const d=ht.getSupportedMimeType();if(d==null){this.prepareInstanceForNextOperation(),r(Ai());return}const u=new Blob(this.chunks,{type:d});if(u.size<=0){this.prepareInstanceForNextOperation(),r(Fx());return}let c,h;a!=null?(c=`${(l=(s=(i=a.subDirectory)===null||i===void 0?void 0:i.match(/^\/?(.+[^/])\/?$/))===null||s===void 0?void 0:s[1])!==null&&l!==void 0?l:""}/recording-${new Date().getTime()}${Ti[d]}`,await Ex({blob:u,directory:a.directory,fast_mode:!0,path:c,recursive:!0})):h=await ht.blobToBase64(u);const m=await Nx(u);this.prepareInstanceForNextOperation(),o({value:{recordDataBase64:h,mimeType:d,msDuration:m*1e3,path:c}})},this.mediaRecorder.ondataavailable=i=>this.chunks.push(i.data),this.mediaRecorder.start()}),Tt()}onFailedToStartRecording(){throw this.prepareInstanceForNextOperation(),Ni()}static blobToBase64(n){return new Promise(a=>{const o=new FileReader;o.onloadend=()=>{const r=String(o.result),i=r.split("base64,"),s=i.length>1?i[1]:r;a(s.trim())},o.readAsDataURL(n)})}prepareInstanceForNextOperation(){if(this.mediaRecorder!=null&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.stop()}catch(n){console.warn("While trying to stop a media recorder, an error was thrown",n)}this.pendingResult=Di(),this.mediaRecorder=null,this.chunks=[]}}class Lx extends ta{constructor(){super(...arguments),this.voiceRecorderInstance=new ht}canDeviceVoiceRecord(){return ht.canDeviceVoiceRecord()}hasAudioRecordingPermission(){return ht.hasAudioRecordingPermission()}requestAudioRecordingPermission(){return ht.requestAudioRecordingPermission()}startRecording(n){return this.voiceRecorderInstance.startRecording(n)}stopRecording(){return this.voiceRecorderInstance.stopRecording()}pauseRecording(){return this.voiceRecorderInstance.pauseRecording()}resumeRecording(){return this.voiceRecorderInstance.resumeRecording()}getCurrentStatus(){return this.voiceRecorderInstance.getCurrentStatus()}}const $x=Object.freeze(Object.defineProperty({__proto__:null,VoiceRecorderWeb:Lx},Symbol.toStringTag,{value:"Module"}));function Fi(t){const n=t.split("/").filter(o=>o!=="."),a=[];return n.forEach(o=>{o===".."&&a.length>0&&a[a.length-1]!==".."?a.pop():a.push(o)}),a.join("/")}function Px(t,n){t=Fi(t),n=Fi(n);const a=t.split("/"),o=n.split("/");return t!==n&&a.every((r,i)=>r===o[i])}class la extends ta{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME="Disc",this._writeCmds=["add","put","delete"],this.downloadFile=async n=>{var a,o;const r=L1(n,n.webFetchExtra),i=await fetch(n.url,r);let s;if(!n.progress)s=await i.blob();else if(!(i!=null&&i.body))s=new Blob;else{const d=i.body.getReader();let u=0;const c=[],h=i.headers.get("content-type"),m=parseInt(i.headers.get("content-length")||"0",10);for(;;){const{done:g,value:y}=await d.read();if(g)break;c.push(y),u+=(y==null?void 0:y.length)||0;const k={url:n.url,bytes:u,contentLength:m};this.notifyListeners("progress",k)}const p=new Uint8Array(u);let f=0;for(const g of c)typeof g>"u"||(p.set(g,f),f+=g.length);s=new Blob([p.buffer],{type:h||void 0})}return{path:(await this.writeFile({path:n.path,directory:(a=n.directory)!==null&&a!==void 0?a:void 0,recursive:(o=n.recursive)!==null&&o!==void 0?o:!1,data:s})).uri,blob:s}}}readFileInChunks(n,a){throw this.unavailable("Method not implemented.")}async initDb(){if(this._db!==void 0)return this._db;if(!("indexedDB"in window))throw this.unavailable("This browser doesn't support IndexedDB");return new Promise((n,a)=>{const o=indexedDB.open(this.DB_NAME,this.DB_VERSION);o.onupgradeneeded=la.doUpgrade,o.onsuccess=()=>{this._db=o.result,n(o.result)},o.onerror=()=>a(o.error),o.onblocked=()=>{console.warn("db blocked")}})}static doUpgrade(n){const o=n.target.result;switch(n.oldVersion){case 0:case 1:default:o.objectStoreNames.contains("FileStorage")&&o.deleteObjectStore("FileStorage"),o.createObjectStore("FileStorage",{keyPath:"path"}).createIndex("by_folder","folder")}}async dbRequest(n,a){const o=this._writeCmds.indexOf(n)!==-1?"readwrite":"readonly";return this.initDb().then(r=>new Promise((i,s)=>{const u=r.transaction(["FileStorage"],o).objectStore("FileStorage")[n](...a);u.onsuccess=()=>i(u.result),u.onerror=()=>s(u.error)}))}async dbIndexRequest(n,a,o){const r=this._writeCmds.indexOf(a)!==-1?"readwrite":"readonly";return this.initDb().then(i=>new Promise((s,l)=>{const h=i.transaction(["FileStorage"],r).objectStore("FileStorage").index(n)[a](...o);h.onsuccess=()=>s(h.result),h.onerror=()=>l(h.error)}))}getPath(n,a){const o=a!==void 0?a.replace(/^[/]+|[/]+$/g,""):"";let r="";return n!==void 0&&(r+="/"+n),a!==""&&(r+="/"+o),r}async clear(){(await this.initDb()).transaction(["FileStorage"],"readwrite").objectStore("FileStorage").clear()}async readFile(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(o===void 0)throw Error("File does not exist.");return{data:o.content?o.content:""}}async writeFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=n.recursive,s=await this.dbRequest("get",[a]);if(s&&s.type==="directory")throw Error("The supplied path is a directory.");const l=a.substr(0,a.lastIndexOf("/"));if(await this.dbRequest("get",[l])===void 0){const h=l.indexOf("/",1);if(h!==-1){const m=l.substr(h);await this.mkdir({path:m,directory:n.directory,recursive:i})}}if(!r&&!(o instanceof Blob)&&(o=o.indexOf(",")>=0?o.split(",")[1]:o,!this.isBase64String(o)))throw Error("The supplied data is not valid base64 content.");const u=Date.now(),c={path:a,folder:l,type:"file",size:o instanceof Blob?o.size:o.length,ctime:u,mtime:u,content:o};return await this.dbRequest("put",[c]),{uri:c.path}}async appendFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=a.substr(0,a.lastIndexOf("/")),s=Date.now();let l=s;const d=await this.dbRequest("get",[a]);if(d&&d.type==="directory")throw Error("The supplied path is a directory.");if(await this.dbRequest("get",[i])===void 0){const h=i.indexOf("/",1);if(h!==-1){const m=i.substr(h);await this.mkdir({path:m,directory:n.directory,recursive:!0})}}if(!r&&!this.isBase64String(o))throw Error("The supplied data is not valid base64 content.");if(d!==void 0){if(d.content instanceof Blob)throw Error("The occupied entry contains a Blob object which cannot be appended to.");d.content!==void 0&&!r?o=btoa(atob(d.content)+atob(o)):o=d.content+o,l=d.ctime}const c={path:a,folder:i,type:"file",size:o.length,ctime:l,mtime:s,content:o};await this.dbRequest("put",[c])}async deleteFile(n){const a=this.getPath(n.directory,n.path);if(await this.dbRequest("get",[a])===void 0)throw Error("File does not exist.");if((await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)])).length!==0)throw Error("Folder is not empty.");await this.dbRequest("delete",[a])}async mkdir(n){const a=this.getPath(n.directory,n.path),o=n.recursive,r=a.substr(0,a.lastIndexOf("/")),i=(a.match(/\//g)||[]).length,s=await this.dbRequest("get",[r]),l=await this.dbRequest("get",[a]);if(i===1)throw Error("Cannot create Root directory");if(l!==void 0)throw Error("Current directory does already exist.");if(!o&&i!==2&&s===void 0)throw Error("Parent directory must exist");if(o&&i!==2&&s===void 0){const c=r.substr(r.indexOf("/",1));await this.mkdir({path:c,directory:n.directory,recursive:o})}const d=Date.now(),u={path:a,folder:r,type:"directory",size:0,ctime:d,mtime:d};await this.dbRequest("put",[u])}async rmdir(n){const{path:a,directory:o,recursive:r}=n,i=this.getPath(o,a),s=await this.dbRequest("get",[i]);if(s===void 0)throw Error("Folder does not exist.");if(s.type!=="directory")throw Error("Requested path is not a directory");const l=await this.readdir({path:a,directory:o});if(l.files.length!==0&&!r)throw Error("Folder is not empty");for(const d of l.files){const u=`${a}/${d.name}`;(await this.stat({path:u,directory:o})).type==="file"?await this.deleteFile({path:u,directory:o}):await this.rmdir({path:u,directory:o,recursive:r})}await this.dbRequest("delete",[i])}async readdir(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(n.path!==""&&o===void 0)throw Error("Folder does not exist.");const r=await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)]);return{files:await Promise.all(r.map(async s=>{let l=await this.dbRequest("get",[s]);return l===void 0&&(l=await this.dbRequest("get",[s+"/"])),{name:s.substring(a.length+1),type:l.type,size:l.size,ctime:l.ctime,mtime:l.mtime,uri:l.path}}))}}async getUri(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);return o===void 0&&(o=await this.dbRequest("get",[a+"/"])),{uri:(o==null?void 0:o.path)||a}}async stat(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);if(o===void 0&&(o=await this.dbRequest("get",[a+"/"])),o===void 0)throw Error("Entry does not exist.");return{name:o.path.substring(a.length+1),type:o.type,size:o.size,ctime:o.ctime,mtime:o.mtime,uri:o.path}}async rename(n){await this._copy(n,!0)}async copy(n){return this._copy(n,!1)}async requestPermissions(){return{publicStorage:"granted"}}async checkPermissions(){return{publicStorage:"granted"}}async _copy(n,a=!1){let{toDirectory:o}=n;const{to:r,from:i,directory:s}=n;if(!r||!i)throw Error("Both to and from must be provided");o||(o=s);const l=this.getPath(s,i),d=this.getPath(o,r);if(l===d)return{uri:d};if(Px(l,d))throw Error("To path cannot contain the from path");let u;try{u=await this.stat({path:r,directory:o})}catch{const f=r.split("/");f.pop();const g=f.join("/");if(f.length>0&&(await this.stat({path:g,directory:o})).type!=="directory")throw new Error("Parent directory of the to path is a file")}if(u&&u.type==="directory")throw new Error("Cannot overwrite a directory with a file");const c=await this.stat({path:i,directory:s}),h=async(p,f,g)=>{const y=this.getPath(o,p),k=await this.dbRequest("get",[y]);k.ctime=f,k.mtime=g,await this.dbRequest("put",[k])},m=c.ctime?c.ctime:Date.now();switch(c.type){case"file":{const p=await this.readFile({path:i,directory:s});a&&await this.deleteFile({path:i,directory:s});let f;!(p.data instanceof Blob)&&!this.isBase64String(p.data)&&(f=io.UTF8);const g=await this.writeFile({path:r,directory:o,data:p.data,encoding:f});return a&&await h(r,m,c.mtime),g}case"directory":{if(u)throw Error("Cannot move a directory over an existing object");try{await this.mkdir({path:r,directory:o,recursive:!1}),a&&await h(r,m,c.mtime)}catch{}const p=(await this.readdir({path:i,directory:s})).files;for(const f of p)await this._copy({from:`${i}/${f.name}`,to:`${r}/${f.name}`,directory:s,toDirectory:o},a);a&&await this.rmdir({path:i,directory:s})}}return{uri:d}}isBase64String(n){try{return btoa(atob(n))==n}catch{return!1}}}la._debug=!0;const Ox=Object.freeze(Object.defineProperty({__proto__:null,FilesystemWeb:la},Symbol.toStringTag,{value:"Module"}));et.attLibAttendants=xi,et.attLibDeparts=ki,et.attLibInstances=bi,et.default=hx,et.getWithContrastColor=Ei,et.setupLibrary=wi,et.useScheduledStore=hr,Object.defineProperties(et,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
132
+ </svg>`,info:a.content.info??"Nome que será atribuído no Produto",type:a.content.type??"text",placeholder:a.content.placeholder??"Integração de sistemas",empty:a.content.empty??!1,data:a.content.data??""}),i=e.ref(r.data);e.watch(i,l=>{o("update:content",{...r,data:l})},{immediate:!0,deep:!0}),e.watch(()=>a.content,l=>{l.data!==i.value&&(i.value=l.data),l.empty!==r.empty&&(r.empty=l.empty)},{deep:!0});const s=e.computed(()=>r.empty&&!i.value);return(l,d)=>{const u=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",My,[e.createElementVNode("header",Ny,[e.createElementVNode("p",Ay,e.toDisplayString(r.title),1),r.info?(e.openBlock(),e.createBlock(u,{key:0,hover:"",content:r.info,placement:"top",arrow:""},{default:e.withCtx(()=>[...d[2]||(d[2]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1},8,["content"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["input__container",s.value?"input__container--error":"",r.type==="textArea"?"textArea":""])},[r.type!=="textArea"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.value?"text-red-500":"text-base-100"),innerHTML:r.svg},null,10,Ty)):e.createCommentVNode("",!0),r.type!=="textArea"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:r.type,key:r.type,placeholder:r.placeholder,"onUpdate:modelValue":d[0]||(d[0]=c=>i.value=c),class:e.normalizeClass([s.value?"empty":null,"input__field"])},null,10,Dy)),[[e.vModelDynamic,i.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:2,class:e.normalizeClass([s.value?"empty":null,"input__field h-full resize-y"]),"onUpdate:modelValue":d[1]||(d[1]=c=>i.value=c),placeholder:r.placeholder},null,10,Fy)),[[e.vModelText,i.value]]),s.value?(e.openBlock(),e.createElementBlock("span",Ly," Campo obrigatório ")):e.createCommentVNode("",!0)],2)])}}},[["__scopeId","data-v-3673f915"]]),$y=["onClick"],Py={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Oy=["onClick"],_y={key:0,xmlns:"http://www.w3.org/2000/svg",class:"size-4 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},hi=Ce({__name:"simpleSelect",props:{modelValue:{type:[Array,String,Number,Object],default:()=>[]},options:{type:Array,required:!0,default:()=>[]},placeholder:{type:String,default:"Selecione uma opção..."},multiple:{type:Boolean,default:!1},theme:{type:String,default:"bg-base-300 border-base-300"},teleportTo:{type:String,default:null}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({});Bn(i,()=>r.value=!1);const d=()=>{if(!a.teleportTo||!s.value)return;const p=s.value.getBoundingClientRect();l.value={position:"fixed",top:`${p.bottom+6}px`,left:`${p.left}px`,width:`${p.width}px`,zIndex:9999}};e.watch(r,p=>{p&&d()});const u=[];e.onMounted(()=>{if(a.teleportTo){const p=()=>{r.value&&d()};window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),u.push(["scroll",p],["resize",p])}}),e.onUnmounted(()=>{u.forEach(([p,f])=>window.removeEventListener(p,f,p==="scroll"?!0:void 0))});const c=p=>a.multiple&&Array.isArray(a.modelValue)?a.modelValue.includes(p):a.modelValue===p,h=p=>{if(a.multiple){const f=Array.isArray(a.modelValue)?[...a.modelValue]:[],g=f.indexOf(p);g===-1?f.push(p):f.splice(g,1),o("update:modelValue",f)}else o("update:modelValue",p),r.value=!1},m=e.computed(()=>{if(a.multiple&&Array.isArray(a.modelValue))return a.modelValue.length===0?a.placeholder:a.options.filter(g=>a.modelValue.includes(g.value)).map(g=>g.name).join(", ");const p=a.options.find(f=>f.value===a.modelValue);return(p==null?void 0:p.name)||a.placeholder});return(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:"relative w-full",ref_key:"dropdownRef",ref:i},[e.createElementVNode("div",{onClick:f[0]||(f[0]=g=>r.value=!r.value),class:e.normalizeClass(["flex flex-wrap items-center justify-between p-3 gap-2 rounded-md cursor-pointer transition",t.theme]),ref_key:"triggerRef",ref:s},[e.createElementVNode("span",{class:e.normalizeClass(["text-xs truncate max-w-full",m.value===t.placeholder?"text-gray-400":"text-white"])},e.toDisplayString(m.value),3),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["size-3 text-white transition-transform duration-300",r.value?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...f[1]||(f[1]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"},null,-1)])],2))],2),r.value&&!t.teleportTo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute flex flex-col z-10 mt-1.5 w-full shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>h(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",Py,[...f[2]||(f[2]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,$y))),128))],2)):e.createCommentVNode("",!0),r.value&&t.teleportTo?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:t.teleportTo},[e.createElementVNode("div",{style:e.normalizeStyle(l.value),class:e.normalizeClass(["flex flex-col shadow-sm border rounded-md max-h-64 overflow-y-auto hide-scrollbar",t.theme])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass([c(g.value)?"bg-green-500/30 hover:bg-green-500/50":"hover:bg-base-200","flex items-center justify-between gap-2 px-3 py-2 text-left text-sm cursor-pointer transition w-full"]),onClick:y=>h(g.value)},[e.createElementVNode("span",null,e.toDisplayString(g.name),1),c(g.value)?(e.openBlock(),e.createElementBlock("svg",_y,[...f[3]||(f[3]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):e.createCommentVNode("",!0)],10,Oy))),128))],6)],8,["to"])):e.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-3ee440f9"]]),Ry={class:"flex gap-2"},ao=Ce({__name:"outcomeButton",props:{outcome:{type:String,default:null}},emits:["update:outcome","change"],setup(t,{emit:n}){const a=t,o=n;async function r(l){const d=a.outcome===l?null:l;o("update:outcome",d),o("change",d)}const i=e.computed(()=>a.outcome==="won"),s=e.computed(()=>a.outcome==="lost");return(l,d)=>(e.openBlock(),e.createElementBlock("div",Ry,[e.createElementVNode("button",{onClick:d[0]||(d[0]=u=>r("won")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-won":i.value}])},[d[3]||(d[3]=e.createElementVNode("p",null,"Ganho",-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-won":i.value},"text-white size-4"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none"},[...d[2]||(d[2]=[e.createElementVNode("path",{d:"M3.16666 6.37502C3.74962 6.37502 4.2222 6.85073 4.22222 7.43752V15.9375C4.22222 16.5243 3.74963 17 3.16666 17H1.05555C0.472588 17 0 16.5243 0 15.9375V7.43752C1.50967e-05 6.85073 0.472597 6.37502 1.05555 6.37502H3.16666Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.48143 1.4454C9.79496 -0.637173 11.5194 0.143216 11.5194 0.143216C13.863 1.75728 13.005 4.80783 12.2832 6.13118H17.4424C19.5307 6.65187 19.0768 8.34354 18.5887 9.12465C19.5056 10.7905 18.4191 11.7716 17.7609 12.0538C18.1175 13.7717 17.0601 14.4178 16.4869 14.5264C16.8944 16.4004 15.5533 16.9564 14.8314 17H10.436C8.49997 16.9999 6.19055 16.1753 5.27777 15.7632V7.368C9.03523 5.6108 9.09933 3.98356 9.48143 1.4454Z",fill:"CurrentColor"},null,-1)])],2))],2),e.createElementVNode("button",{onClick:d[1]||(d[1]=u=>r("lost")),class:e.normalizeClass(["button_outcome-base",{"button_outcome-active-lost":s.value}])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([{"svg_outcome-active-lost":s.value},"text-white size-4 mt-0.8"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 19",fill:"none"},[...d[4]||(d[4]=[e.createElementVNode("path",{d:"M15.8333 10.625C15.2504 10.625 14.7778 10.1493 14.7778 9.56249L14.7778 1.0625C14.7778 0.475698 15.2504 1.57955e-06 15.8333 1.63051e-06L17.9444 1.81507e-06C18.5274 1.86603e-06 19 0.475698 19 1.0625L19 9.56249C19 10.1493 18.5274 10.625 17.9444 10.625L15.8333 10.625Z",fill:"CurrentColor"},null,-1),e.createElementVNode("path",{d:"M9.51857 15.5546C9.20504 17.6372 7.48065 16.8568 7.48065 16.8568C5.13698 15.2427 5.99503 12.1922 6.71681 10.8688L1.55759 10.8688C-0.530671 10.3481 -0.0768444 8.65646 0.411319 7.87535C-0.50562 6.20951 0.580926 5.22844 1.23906 4.94622C0.882549 3.22832 1.93994 2.5822 2.51315 2.47363C2.10564 0.59965 3.44673 0.0436064 4.16864 6.1075e-07L8.56403 9.95007e-07C10.5 0.000138493 12.8095 0.824657 13.7222 1.23682L13.7222 9.632C9.96477 11.3892 9.90067 13.0164 9.51857 15.5546Z",fill:"CurrentColor"},null,-1)])],2)),d[5]||(d[5]=e.createElementVNode("p",null,"Perdido",-1))],2)]))}},[["__scopeId","data-v-cde71744"]]),Hy=["disabled"],zy=["onMousemove","onClick"],oo=Ce({__name:"ratingInput",props:{modelValue:{type:Number,default:0},size:{type:Number,default:24},gap:{type:Number,default:4},onRate:{type:Function,default:null},readonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(a.modelValue),i=e.ref(0);e.watch(()=>a.modelValue,c=>{r.value=c});const s=e.computed(()=>i.value||r.value);function l(c){const h=s.value-c+1;return h>=1?"100%":h>=.5?"50%":h>0?`${h*100}%`:"0%"}function d(c,h){const m=c.currentTarget.getBoundingClientRect(),p=c.offsetX<m.width/2;i.value=h-(p?.5:0)}function u(c,h){const m=c.currentTarget.getBoundingClientRect(),p=c.offsetX<m.width/2,f=h-(p?.5:0);r.value=r.value===f?0:f,o("update:modelValue",r.value),typeof a.onRate=="function"&&a.onRate(r.value)}return(c,h)=>(e.openBlock(),e.createElementBlock("main",{disabled:a.readonly,class:"flex select-none",style:e.normalizeStyle({gap:`${t.gap}px`})},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,m=>e.createElementVNode("div",{key:m,class:e.normalizeClass(["relative",{"cursor-pointer":!a.readonly,"cursor-default":a.readonly}]),style:e.normalizeStyle({width:`${t.size}px`,height:`${t.size}px`}),onMousemove:p=>!a.readonly&&d(p,m),onMouseleave:h[0]||(h[0]=p=>!a.readonly&&(i.value=0)),onClick:p=>!a.readonly&&u(p,m)},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"absolute top-0 left-0 color-disabled",style:e.normalizeStyle({width:`${t.size}px`,height:`${t.size}px`})},[...h[1]||(h[1]=[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"},null,-1)])],4)),e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full overflow-hidden transition-all duration-150",{"text-primary":!i.value,"text-hover":i.value>0}]),style:e.normalizeStyle({width:l(m),height:`${t.size}px`})},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:e.normalizeStyle({width:`${t.size}px`,height:`${t.size}px`})},[...h[2]||(h[2]=[e.createElementVNode("path",{d:"M13.849 4.22c-.684-1.626-3.014-1.626-3.698 0L8.397 8.387l-4.552.361c-1.775.14-2.495 2.331-1.142 3.477l3.468 2.937-1.06 4.392c-.413 1.713 1.472 3.067 2.992 2.149L12 19.35l3.897 2.354c1.52.918 3.405-.436 2.992-2.15l-1.06-4.39 3.468-2.938c1.353-1.146.633-3.336-1.142-3.477l-4.552-.36-1.754-4.17Z"},null,-1)])],4))],6)],46,zy)),64))],12,Hy))}},[["__scopeId","data-v-c786170c"]]),jy={key:0,class:"flex items-center justify-center overflow-hidden h-svh"},Gy={key:1,class:"flex flex-col overflow-hidden"},Iy={key:0,class:"sticky top-0 z-50 bg-base-300 py-1 px-1.5 flex gap-2"},qy={class:"total-price-badge"},Wy={key:1,class:"flex-1 overflow-y-auto flex flex-col gap-2 px-2"},Uy={class:"w-full text-gray-500 list-none list-inside dark:text-gray-400 divide-y divide-base-200"},Zy={class:"flex gap-2 items-center"},Yy=["src"],Xy={key:1,class:"size-8 rounded-md flex items-center justify-center border border-base-200"},Ky={class:"flex flex-col items-start"},Qy=["title"],Jy={class:"text-[10px] flex gap-1 items-center"},ek={class:"text-xs font-semibold font-sans"},tk={key:0,class:"font-sans text-primary text-white font-semibold"},nk={class:"text-primary"},ak={class:"flex flex-col gap-1"},ok={class:"flex gap-1"},rk=["onClick"],ik=["onClick"],sk={key:2,class:"h-full flex flex-col items-center justify-center"},lk={key:0,class:"text-gray-200 text-[10px] md:text-xs font-sans"},ck=Ce({__name:"listProducts",props:{modelValue:{type:Array,default:()=>[]},allProducts:{type:Object,default:()=>{}}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),i=e.ref([]),s=e.ref([...a.modelValue]),l=e.ref(1),d=e.ref(null),u=e.ref(null),c=e.computed(()=>s.value.reduce((A,R)=>{var N;const S=((N=R.product)==null?void 0:N.price)||R.price||0,x=R.quantity||0;return A+S*x},0)),h=e.computed(()=>{const A={};return s.value.forEach(R=>{A[R.product.id]=R.quantity}),A}),m=A=>h.value[A.id]||0,p=A=>{const R=s.value.find(S=>S.product.id===A.id);R?R.quantity++:s.value.push({product:{...A},quantity:1})},f=A=>{const R=s.value.find(S=>S.product.id===A.id);R&&(R.quantity>0?R.quantity--:R.quantity=0)},g=(A,R)=>{const S=new URLSearchParams,x=A;return Object.keys(R).forEach(N=>S.append(N,R[N])),`${x}?${S.toString()}`},y=async A=>{try{const{data:R}=await at.get(g($0,{page:l.value,...A})),{results:S,next:x,previous:N}=R;if(d.value=x,u.value=N,l.value===1)i.value=S;else{const L=new Set(i.value.map(B=>B.id)),F=S.filter(B=>!L.has(B.id));i.value=[...i.value,...F]}d.value&&(l.value+=1)}catch(R){console.error("Erro ao buscar produtos:",R)}};e.onMounted(async()=>{var A;a.allProducts&&((A=a.allProducts.results)==null?void 0:A.length)>0?(i.value=a.allProducts.results,d.value=a.allProducts.next||null,u.value=a.allProducts.previous||null,l.value=2):await y()}),e.watch(s,A=>{o("update:modelValue",A)},{deep:!0});const k=e.ref(!1),w=async A=>{if(!k.value){k.value=!0;try{if(!d.value){A.complete();return}await y(),d.value?A.loaded():A.complete()}catch(R){console.error("Erro ao carregar produtos:",R),A.complete()}finally{k.value=!1}}},E=e.ref({query:""}),v=e.ref(!1);let M;return e.watch(E,()=>{clearTimeout(M),M=setTimeout(async()=>{const{query:A}=E.value;l.value=1,v.value=!!A,r.value=!0,await y({query:A}),r.value=!1},500)},{deep:!0}),(A,R)=>{const S=e.resolveComponent("SimpleLoader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createElementBlock("div",jy,[e.createVNode(S)])):(e.openBlock(),e.createElementBlock("main",Gy,[i.value.length===0&&v.value||!v.value&&i.value.length>0?(e.openBlock(),e.createElementBlock("header",Iy,[e.withDirectives(e.createElementVNode("input",{class:"w-full text-xs bg-base-300 rounded-md pt-1.5 outline-none border-none focus:outline-none focus:ring-0 focus:shadow-none",type:"text",placeholder:"Buscar...","onUpdate:modelValue":R[0]||(R[0]=x=>E.value.query=x)},null,512),[[e.vModelText,E.value.query]]),e.createElementVNode("section",qy," Valor total: "+e.toDisplayString(c.value.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})),1)])):e.createCommentVNode("",!0),i.value.length>0?(e.openBlock(),e.createElementBlock("div",Wy,[e.createElementVNode("ul",Uy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(x,N)=>(e.openBlock(),e.createElementBlock("li",{class:"flex w-full justify-between items-center py-2",key:x.id},[e.createElementVNode("div",Zy,[e.createElementVNode("section",null,[x.photo?(e.openBlock(),e.createElementBlock("img",{key:0,class:"size-8 rounded-md",src:x.photo,alt:""},null,8,Yy)):(e.openBlock(),e.createElementBlock("div",Xy,[...R[1]||(R[1]=[e.createElementVNode("svg",{class:"w-6 h-6","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"currentColor",d:"M4 19v2c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-2H4Z"}),e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M9 3c0-.55228.44772-1 1-1h8c.5523 0 1 .44772 1 1v3c0 .55228-.4477 1-1 1h-2v1h2c.5096 0 .9376.38314.9939.88957L19.8951 17H4.10498l.90116-8.11043C5.06241 8.38314 5.49047 8 6.00002 8H12V7h-2c-.55228 0-1-.44772-1-1V3Zm1.01 8H8.00002v2.01H10.01V11Zm.99 0h2.01v2.01H11V11Zm5.01 0H14v2.01h2.01V11Zm-8.00998 3H10.01v2.01H8.00002V14ZM13.01 14H11v2.01h2.01V14Zm.99 0h2.01v2.01H14V14ZM11 4h6v1h-6V4Z","clip-rule":"evenodd"})],-1)])]))]),e.createElementVNode("section",Ky,[e.createElementVNode("p",{title:x.name,class:e.normalizeClass(["text-xs text-start font-semibold truncate max-w-32",m(x)>0?"text-white":""])},e.toDisplayString(x.name),11,Qy),e.createElementVNode("span",Jy,[e.createElementVNode("p",ek," R$ "+e.toDisplayString(x.price.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})),1),m(x)>0?(e.openBlock(),e.createElementBlock("p",tk,[e.createTextVNode(" - x "+e.toDisplayString(m(x))+" = ",1),e.createElementVNode("a",nk,e.toDisplayString((x.price*m(x)).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("section",ak,[e.createElementVNode("p",{class:e.normalizeClass(["text-xs font-semibold font-sans products-and-services_badge",x.recurrence])},e.toDisplayString(x.recurrence==="monthly"?"Mensal":"Único"),3),e.createElementVNode("div",ok,[e.createElementVNode("button",{class:"action-list-button",onClick:L=>f(x)}," - ",8,rk),e.createElementVNode("p",{class:e.normalizeClass(["w-5 text-xs flex items-center justify-center font-semibold font-sans",m(x)>0?"text-white":""])},e.toDisplayString(m(x)),3),e.createElementVNode("button",{class:"action-list-button",onClick:L=>p(x)}," + ",8,ik)])])]))),128))]),d.value?(e.openBlock(),e.createBlock(e.unref(Xt),{key:0,onInfinite:w,class:"p-3 bg-base-300"},{spinner:e.withCtx(()=>[...R[2]||(R[2]=[e.createElementVNode("section",{class:"w-full justify-center items-center flex"},[e.createElementVNode("div",{class:"size-4 animate-spin rounded-full border-4 border-solid border-white border-t-transparent"})],-1)])]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),!r.value&&i.value.length<=0?(e.openBlock(),e.createElementBlock("section",sk,[R[4]||(R[4]=e.createElementVNode("p",{class:"text-gray-200 text-xs md:text-base font-sans"}," Nenhum item encontrado ",-1)),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",lk,[...R[3]||(R[3]=[e.createTextVNode(" Comece criando seu primeiro na aba ",-1),e.createElementVNode("strong",null,"Produtos",-1)])]))])):e.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-aaa205b7"]]),dk={},uk={class:"flex items-center justify-center h-full"};function fk(t,n){return e.openBlock(),e.createElementBlock("div",uk,[...n[0]||(n[0]=[e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1),e.createElementVNode("span",{class:"products-and-services_bar"},null,-1)])])}const ro=Ce(dk,[["render",fk],["__scopeId","data-v-3f0502dd"]]),mk={key:0,class:"flex items-center justify-center overflow-hidden h-svh"},hk={key:1},pk={class:"flex flex-col gap-2 p-2"},gk=["id","onUpdate:modelValue"],yk=["for","title"],kk=["id","onUpdate:modelValue"],xk=["id","onUpdate:modelValue"],bk={key:2,class:"rounded-md h-svh bg-base-200 border border-white/10 shadow-sm transition-shadow duration-200 hover:shadow-md p-1 flex flex-col items-center justify-center gap-2"},wk=Ce({__name:"listSegmentationsFields",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(s(a.modelValue)),i=e.ref(!1);function s(d){return JSON.parse(JSON.stringify(d))}const l=async()=>{try{i.value=!0;const d=await at.get(O0);r.value=d.data}catch(d){console.error("Error fetching segmentation fields:",d)}finally{i.value=!1}};return e.onMounted(()=>{a.modelValue.length===0&&l()}),e.watch(r,d=>{JSON.stringify(d)!==JSON.stringify(a.modelValue)&&o("update:modelValue",s(d))},{deep:!0}),(d,u)=>{const c=e.resolveComponent("SimpleSelect");return i.value?(e.openBlock(),e.createElementBlock("div",mk,[e.createVNode(ro)])):r.value.length>0?(e.openBlock(),e.createElementBlock("div",hk,[u[0]||(u[0]=e.createElementVNode("header",{style:{"z-index":"9999"},class:"sticky bg-base-200 top-0 text-start w-full items-center justify-between flex mb-2 px-2 py-2"},[e.createElementVNode("p",{class:"text-xs font-semibold"},"Campos Personalizados")],-1)),e.createElementVNode("div",pk,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,h=>(e.openBlock(),e.createElementBlock("section",{key:h.id},[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full gap-1.5 rounded-md",h.type==="bool"?"flex-row items-center":"flex-col items-start"])},[h.type==="bool"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,id:"seg-label-"+h.id,class:"checkbox size-4 rounded-sm",type:"checkbox","onUpdate:modelValue":m=>h.content=m},null,8,gk)),[[e.vModelCheckbox,h.content]]):e.createCommentVNode("",!0),e.createElementVNode("label",{for:"seg-label-"+h.id,class:"text-xs text-[12px] font-sans font-semibold",title:h.type==="string"?"texto":h.type==="bool"?"verdadeiro/falso":h.type==="float"?"número":h.type==="list"?"lista":"Desconhecido"},e.toDisplayString(h.name),9,yk),h.type==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"seg-label-"+h.id,placeholder:"campo do tipo texto",class:"input_field",type:"text","onUpdate:modelValue":m=>h.content=m},null,8,kk)),[[e.vModelText,h.content]]):e.createCommentVNode("",!0),h.type==="float"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,id:"seg-label-"+h.id,placeholder:"campo do tipo número",class:"input_field",type:"number","onUpdate:modelValue":m=>h.content=m},null,8,xk)),[[e.vModelText,h.content]]):e.createCommentVNode("",!0),h.type==="list"?(e.openBlock(),e.createBlock(c,{key:3,modelValue:h.content,"onUpdate:modelValue":m=>h.content=m,options:h.additional_info.list.options.map(m=>({value:m,name:m})),placeholder:"Selecione uma opção",theme:"bg-base-300 border-base-100","teleport-to":"body"},null,8,["modelValue","onUpdate:modelValue","options"])):e.createCommentVNode("",!0)],2)]))),128))])])):(e.openBlock(),e.createElementBlock("section",bk,[...u[1]||(u[1]=[e.createElementVNode("p",{class:"text-gray-200 text-xs md:text-base font-sans"}," Nenhum item encontrado ",-1),e.createElementVNode("p",{class:"text-gray-200 text-[10px] md:text-xs font-sans"},[e.createTextVNode(" Comece criando seu primeiro na aba "),e.createElementVNode("strong",null,"Campos Personalizados")],-1)])]))}}},[["__scopeId","data-v-633feaac"]]),Ek={class:"modal-form-head"},vk={class:"modal_responsive"},Ck={style:{"min-height":"100%"},class:"flex min-h-full items-center justify-center text-center"},Sk={class:"modal-form-container"},Bk={class:"flex justify-between p-2.5 rounded-t-2xl bg-base-300 items-center text-current"},Vk={class:"flex items-center gap-2"},Mk={class:"flex flex-col items-start"},Nk={class:"text-lg font-semibold"},Ak={key:0,class:"text-xs text-gray-400"},Tk={class:"flex gap-2 items-center"},Dk={class:"grid grid-cols-2 h-full min-h-0"},Fk={class:"flex flex-col h-full min-h-0 px-1 py-2"},Lk={title:"Não é possível alterar a foto do cliente neste momento",class:"flex items-center justify-center w-full"},$k=["src"],Pk={key:1,class:"bg-base-300 p-2 rounded-xl size-24 flex items-center justify-center border border-base-100 cursor-not-allowed"},Ok={class:"flex flex-col gap-1.5 w-full h-full overflow-y-auto overflow-x-hidden"},_k={class:"w-full"},Rk={class:"flex flex-col gap-2 w-full"},Hk={class:"flex items-center justify-between px-1"},zk={key:0,class:"flex flex-1 min-h-0 flex-col gap-2"},jk={class:"flex items-center justify-between px-1"},Gk={class:"w-full h-full bg-base-300 rounded-lg flex flex-col min-h-0"},Ik={class:"bg-base-300 rounded-l-md px-0.5 py-1 flex flex-col h-full min-h-0 overflow-hidden"},qk={key:0,class:"flex gap-1 px-1.5"},Wk=["disabled"],Uk={class:"flex w-full relative"},Zk={key:0,class:"text-xs absolute z-50 -bottom-2 left-1 bg-base-300 px-2 py-0.5 rounded-lg text-red-500 select-none shadow-sm shadow-base-100"},Yk={class:"flex-1 min-h-0 overflow-y-auto bg-base-200 rounded-md border border-white/10 shadow-sm transition-shadow duration-200 hover:shadow-md"},Xk={class:"flex-1 min-h-0 overflow-y-auto"},Kk={class:"modal_end_button"},Qk=["disabled"],Jk={key:0,class:"size-4 animate-spin rounded-full border-4 border-solid text-white border-t-transparent"},ex={key:1,class:"text-xs font-semibold"},pi=Ce({__name:"clientsForm",props:{form:{type:Object,default:()=>({tags:[],country:"BR",name:"",photo:null,raw_telephone:"",telephone:"",whatsapp_id:"",whatsapp_jid:"",whatsapp_lid:null,rating:null,outcome:null,created_at:"",updated_at:"",client:"",products:[],notes:""})},save:{type:Function,default:()=>{}},hasCrmPlus:{type:Boolean,default:!1},allProducts:{type:Object,default:()=>{}},allTags:{type:Object,default:()=>{}}},emits:["close","save"],setup(t,{emit:n}){const a=n,o=e.ref("data"),r=t,i=e.reactive({...r.form}),s=e.ref(!1),l=e.ref(!1),d=e.ref([{title:"Nome",info:!1,type:"text",placeholder:"Digite o nome do contato",empty:e.computed(()=>l.value?l.value.some(p=>p.startsWith("name")):!1),data:e.computed({get:()=>i.name,set:p=>i.name=p})},{title:"Descrição",info:"Descreva o produto para facilitar a identificação",type:"textArea",placeholder:"Automatize fluxos de trabalho com integração rápida e segura entre sistemas.",empty:!1,data:e.computed({get:()=>i.notes,set:p=>i.notes=p})}]),u=e.computed(()=>r.form.mode==="edit"?"Editar cliente":"Adicionar Novo Cliente"),c=p=>{var g,y;const f=[];return(g=p.name)!=null&&g.trim()||f.push("name"),(y=p.telephone)!=null&&y.trim()||f.push("telephone"),f},h=e.computed(()=>l.value?l.value.some(p=>p.startsWith("telephone")):!1),m=async()=>{try{if(s.value=!0,l.value=c(i),l.value.length>0)return;await r.save(i)}catch(p){console.error(p)}finally{s.value=!1}};return e.watch(()=>r.form,p=>{Object.assign(i,e.toRaw(p))},{deep:!0,immediate:!0}),(p,f)=>{var k,w,E;const g=e.resolveComponent("Popper"),y=e.resolveComponent("vue-tel-input");return e.openBlock(),e.createElementBlock("div",Ek,[f[24]||(f[24]=e.createElementVNode("div",{class:"modal-form-background"},null,-1)),e.createElementVNode("div",vk,[e.createElementVNode("div",Ck,[e.createElementVNode("div",Sk,[e.createElementVNode("div",{class:e.normalizeClass([{noCrmPlus:!t.hasCrmPlus},"clients-form-background relative rounded-2xl bg-base-200 backdrop-blur-lg"])},[e.createElementVNode("div",Bk,[e.createElementVNode("span",Vk,[f[14]||(f[14]=e.createElementVNode("svg",{class:"size-6 text-green-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z","clip-rule":"evenodd"})],-1)),e.createElementVNode("span",Mk,[e.createElementVNode("p",Nk,e.toDisplayString(u.value),1),i.id?(e.openBlock(),e.createElementBlock("p",Ak," ID: "+e.toDisplayString(i.id),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("section",Tk,[e.createElementVNode("button",{class:"bg-base-200 p-1.5 rounded-md hover:bg-base-200/70 transition",onClick:f[0]||(f[0]=v=>a("close"))},[...f[15]||(f[15]=[e.createElementVNode("svg",{class:"size-4 text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 17.94 6M18 18 6.06 6"})],-1)])])])]),e.createElementVNode("div",Dk,[e.createElementVNode("section",Fk,[e.createElementVNode("div",{class:e.normalizeClass([t.hasCrmPlus?"justify-between":"justify-center","flex flex-col gap-2 items-center"])},[t.hasCrmPlus?(e.openBlock(),e.createBlock(ao,{key:0,outcome:i.outcome,"onUpdate:outcome":f[1]||(f[1]=v=>i.outcome=v)},null,8,["outcome"])):e.createCommentVNode("",!0),e.createElementVNode("div",Lk,[i.photo?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f[2]||(f[2]=v=>p.viewSingleImage(i.photo))},[e.createElementVNode("img",{src:i.photo,alt:"",class:"size-24 object-cover rounded-md cursor-not-allowed"},null,8,$k)])):(e.openBlock(),e.createElementBlock("span",Pk,[...f[16]||(f[16]=[e.createElementVNode("svg",{class:"size-14","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-2 9a4 4 0 0 0-4 4v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-1a4 4 0 0 0-4-4h-4Z","clip-rule":"evenodd"})],-1)])]))]),t.hasCrmPlus?(e.openBlock(),e.createBlock(oo,{key:1,modelValue:i.rating,"onUpdate:modelValue":f[3]||(f[3]=v=>i.rating=v)},null,8,["modelValue"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",Ok,[e.createElementVNode("div",_k,[e.createVNode(no,{"onUpdate:content":f[4]||(f[4]=v=>d.value[0].data=v.data),content:d.value[0]},null,8,["content"])]),e.createElementVNode("div",Rk,[e.createElementVNode("header",Hk,[f[18]||(f[18]=e.createElementVNode("p",{class:"text-xs font-medium text-left"}," Escolha suas etiquetas ",-1)),e.createVNode(g,{hover:"",content:"Etiquetas que estão atribuídas ao cliente",placement:"top",arrow:""},{default:e.withCtx(()=>[...f[17]||(f[17]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1})]),e.createVNode(to,{teleportTo:"body",maxHeight:"10rem",allTags:t.allTags,modelValue:i.tags,"onUpdate:modelValue":f[5]||(f[5]=v=>i.tags=v)},null,8,["allTags","modelValue"])]),t.hasCrmPlus?(e.openBlock(),e.createElementBlock("div",zk,[e.createElementVNode("header",jk,[f[20]||(f[20]=e.createElementVNode("p",{class:"text-xs font-medium text-left"}," Anotações sobre o cliente ",-1)),e.createVNode(g,{hover:"",content:"Anotações adicionais sobre o cliente",placement:"top",arrow:""},{default:e.withCtx(()=>[...f[19]||(f[19]=[e.createElementVNode("svg",{class:"size-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z"})],-1)])]),_:1})]),e.createElementVNode("div",Gk,[e.withDirectives(e.createElementVNode("textarea",{class:"form-text-area flex-1 h-full min-h-0","onUpdate:modelValue":f[6]||(f[6]=v=>i.notes=v),maxlength:"1000","aria-label":"Anotações do cliente"},null,512),[[e.vModelText,i.notes]]),e.createElementVNode("div",{class:e.normalizeClass(["text-[10px] bg-base-300 px-1 rounded-md text-right mb-1 mr-1",((k=i.notes)==null?void 0:k.length)>900?"text-red-500":((w=i.notes)==null?void 0:w.length)>700?"text-yellow-500":"text-gray-400"])},e.toDisplayString(((E=i.notes)==null?void 0:E.length)||0)+"/1000 ",3)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("section",Ik,[t.hasCrmPlus?(e.openBlock(),e.createElementBlock("div",qk,[e.createElementVNode("button",{class:e.normalizeClass(["toggle-page-button",{selected:o.value==="data"}]),onClick:f[7]||(f[7]=v=>o.value="data")}," Informações ",2),e.createElementVNode("button",{class:e.normalizeClass(["toggle-page-button",{selected:o.value==="products"}]),disabled:!t.hasCrmPlus,onClick:f[8]||(f[8]=v=>o.value="products")},[...f[21]||(f[21]=[e.createElementVNode("p",null,"Produtos",-1)])],10,Wk)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([t.hasCrmPlus?"pt-1.5":"pt-0","flex flex-col gap-2 flex-1 min-h-0 px-1.5 overflow-hidden"])},[e.createElementVNode("div",{class:e.normalizeClass([h.value&&!i.telephone?"border-red-500":"border-white/10","rounded-md bg-base-200 border shadow-sm transition-shadow duration-200 hover:shadow-md"])},[f[23]||(f[23]=e.createElementVNode("h1",{class:"text-start w-full items-center justify-between flex p-2"},[e.createElementVNode("p",{class:"text-xs font-semibold"},"Contatos")],-1)),e.createElementVNode("div",Uk,[f[22]||(f[22]=e.createElementVNode("span",{style:{"border-bottom-left-radius":"0.4rem"},class:"bg-base-300 rounded-bl-lg rounded-t-none flex justify-center items-center w-8"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"size-4 text-gray-500 ml-1.5",viewBox:"0 0 17 17"},[e.createElementVNode("path",{d:"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"})])],-1)),e.createVNode(y,{class:"z-40 w-full",onCountryChanged:f[9]||(f[9]=v=>i.country=v.iso2),mode:"national",validCharactersOnly:!0,defaultCountry:i.country,inputOptions:{placeholder:"Coloque seu telefone",showDialCode:!1,required:!0,searchBoxPlaceholder:"Brazil"},dropdownOptions:{showSearchBox:!0,showFlags:!0,searchBoxPlaceholder:"Brazil"},modelValue:i.telephone,"onUpdate:modelValue":f[10]||(f[10]=v=>i.telephone=v)},null,8,["defaultCountry","modelValue"]),h.value&&!i.telephone?(e.openBlock(),e.createElementBlock("span",Zk," Campo obrigatorio ")):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",Yk,[e.createVNode(wk,{modelValue:i.segmentation_fields,"onUpdate:modelValue":f[11]||(f[11]=v=>i.segmentation_fields=v)},null,8,["modelValue"])])],2),[[e.vShow,o.value==="data"]]),e.withDirectives(e.createElementVNode("div",Xk,[e.createVNode(ck,{allProducts:t.allProducts,modelValue:i.products,"onUpdate:modelValue":f[12]||(f[12]=v=>i.products=v)},null,8,["allProducts","modelValue"])],512),[[e.vShow,o.value==="products"]])])]),e.createElementVNode("div",Kk,[e.createElementVNode("button",{disabled:s.value,class:"bg-green-500 py-2 px-4 rounded-lg text-sm font-medium hover:bg-green-500/80 transition-colors flex gap-2 items-center justify-center min-w-32",onClick:f[13]||(f[13]=v=>m())},[s.value?(e.openBlock(),e.createElementBlock("div",Jk)):(e.openBlock(),e.createElementBlock("p",ex,"Salvar"))],8,Qk)])],2)])])])])}}},[["__scopeId","data-v-13179853"]]),tx={class:"flex justify-center items-center"},nx={class:"text-[8px] font-bold"},ax={class:"tag-view-popper-content-text"},ox={class:"flex"},rx={class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 25 100",style:{color:"#d1d5db"}},ix={style:{backgroundColor:"#d1d5db"},class:"w-full ml-[-0.5rem] rounded-r-md inline-flex items-center justify-center p-0.5 border-b-2 border-gray-900"},sx={class:"text-[8px] text-black font-bold"},lx={class:"max-h-64 overflow-y-auto hide-scrollbar"},cx={class:"flex flex-col gap-2"},dx={class:"tag-view-popper-content-text"},ux={key:1},gi=Ce({__name:"tagView",props:{clients:{type:Object,required:!0}},setup(t){const n=t;return e.computed(()=>{var a,o;return((o=(a=n.clients)==null?void 0:a.tags)==null?void 0:o.slice(0,4))||[]}),(a,o)=>{const r=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("section",tx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags.slice(0,4),(i,s)=>(e.openBlock(),e.createBlock(r,{class:"tag-view-theme",arrow:"",hover:"",key:s},{content:e.withCtx(()=>[e.createElementVNode("p",ax,e.toDisplayString(i.name),1)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex",e.unref(vn)(i.color)])},[(e.openBlock(),e.createElementBlock("svg",{class:"svg-list-tag","aria-hidden":"true",viewBox:"0 0 30 100",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{style:e.normalizeStyle({backgroundColor:i.color||"#fff"}),class:"w-full ml-[-0.10rem] rounded-r-md inline-flex items-center justify-center px-1 py-0.5 border-b-2 border-gray-900"},[e.createElementVNode("p",nx,e.toDisplayString(i.name.charAt(0).toUpperCase()),1)],4)],2)]),_:2},1024))),128)),t.clients.tags.length>4?(e.openBlock(),e.createBlock(r,{key:0,arrow:"",hover:"",class:"tag-view-theme"},{content:e.withCtx(()=>[e.createElementVNode("section",lx,[e.createElementVNode("div",cx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.clients.tags,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id||i.name,class:"relative inline-flex items-center rounded-md overflow-hidden"},[(e.openBlock(),e.createElementBlock("svg",{class:"size-6","aria-hidden":"true",viewBox:"0 0 75 100",style:e.normalizeStyle({color:i.color||"#fff"})},[...o[2]||(o[2]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])],4)),e.createElementVNode("span",{class:e.normalizeClass(["p-0.5 w-full text-sm font-semibold truncate text-start -ml-2",e.unref(vn)(i.color)]),style:e.normalizeStyle(["max-width: 12rem",{background:i.color||"#fff"}])},[e.createElementVNode("p",dx,e.toDisplayString(i.name),1)],6)]))),128))])])]),default:e.withCtx(()=>[e.createElementVNode("div",ox,[(e.openBlock(),e.createElementBlock("svg",rx,[...o[1]||(o[1]=[e.createElementVNode("path",{d:"M49.9,0a17.1,17.1,0,0,0-12,5L5,37.9A17,17,0,0,0,5,62L37.9,94.9a17.1,17.1,0,0,0,12,5ZM25.4,59.4a9.5,9.5,0,1,1,9.5-9.5A9.5,9.5,0,0,1,25.4,59.4Z",fill:"currentColor"},null,-1)])])),e.createElementVNode("span",ix,[e.createElementVNode("p",sx," +"+e.toDisplayString(t.clients.tags.length-4),1)])])]),_:1})):e.createCommentVNode("",!0),!t.clients.tags||t.clients.tags.length===0?(e.openBlock(),e.createElementBlock("span",ux,"-")):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-e2356f0a"]]),yi=Ce({__name:"floating-dev",setup(t){const n=e.ref(!1),a=e.ref({x:30,y:30}),o=e.ref({x:0,y:0}),r=e.ref(!1),i=e.ref(null),s=e.ref(null),l=e.ref({vertical:"bottom",horizontal:"right"}),d=e.computed(()=>({position:"fixed",left:`${a.value.x}px`,top:`${a.value.y}px`,zIndex:1e3,cursor:r.value?"grabbing":"grab"})),u=e.computed(()=>{const g={position:"absolute",background:"#fff",borderRadius:"10px",boxShadow:"0 4px 15px rgba(0, 0, 0, 0.2)",width:"280px",maxWidth:"90vw",zIndex:1001};return l.value.vertical==="top"?g.bottom="60px":g.top="60px",l.value.horizontal==="left"?g.right="0":g.left="0",g});async function c(){if(n.value){n.value=!1;return}n.value=!0,await e.nextTick(),h()}function h(){if(!i.value||!s.value)return;const g=i.value.getBoundingClientRect(),y=s.value.offsetWidth,k=s.value.offsetHeight,w={top:g.top,bottom:window.innerHeight-(g.top+g.height),left:g.left,right:window.innerWidth-(g.left+g.width)};l.value.vertical=w.bottom<k&&w.top>k?"top":"bottom",l.value.horizontal=w.right<y&&w.left>y?"left":"right"}function m(g){r.value=!0;const y=g.type.includes("touch")?g.touches[0]:g;o.value={x:y.clientX-a.value.x,y:y.clientY-a.value.y},document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p),document.addEventListener("touchend",f)}function p(g){if(!r.value)return;const y=g.type.includes("touch")?g.touches[0]:g,k=y.clientX-o.value.x,w=y.clientY-o.value.y,E=window.innerWidth-i.value.offsetWidth,v=window.innerHeight-i.value.offsetHeight;a.value.x=Math.min(Math.max(0,k),E),a.value.y=Math.min(Math.max(0,w),v)}function f(){r.value=!1,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",f)}return e.onBeforeUnmount(f),(g,y)=>(e.openBlock(),e.createElementBlock("div",{class:"floating-widget",style:e.normalizeStyle(d.value),ref_key:"widgetRef",ref:i,onMousedown:m,onTouchstart:m},[e.createElementVNode("button",{class:"floating-button",onClick:e.withModifiers(c,["stop"]),"aria-label":"Abrir painel flutuante"},[...y[0]||(y[0]=[e.createElementVNode("svg",{class:"floating-button-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[e.createElementVNode("path",{d:"M370 378c28.89 23.52 46 46.07 46 86M142 378c-28.89 23.52-46 46.06-46 86M384 208c28.89-23.52 32-56.07 32-96M128 206c-28.89-23.52-32-54.06-32-94M464 288.13h-80M128 288.13H48M256 192v256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M256 448h0c-70.4 0-128-57.6-128-128v-96.07c0-65.07 57.6-96 128-96h0c70.4 0 128 25.6 128 96V320c0 70.4-57.6 128-128 128z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),e.createElementVNode("path",{d:"M179.43 143.52a49.08 49.08 0 01-3.43-15.73A80 80 0 01255.79 48h.42A80 80 0 01336 127.79a41.91 41.91 0 01-3.12 14.3",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1)])]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"floating-panel",ref_key:"panelRef",ref:s,style:e.normalizeStyle(u.value)},[e.renderSlot(g.$slots,"default",{},()=>[y[1]||(y[1]=e.createElementVNode("p",{style:{"text-align":"center","font-size":"0.9rem"}}," Adicione seu conteúdo aqui 👇 ",-1))],!0)],4)):e.createCommentVNode("",!0)]),_:3})],36))}},[["__scopeId","data-v-7767be25"]]);Dt.defineStore("debug",{state:()=>({message:"Debug store initialized"}),actions:{logMessage(){console.log(this.message)}}});function fx(t){t.component("primarySelect",yo),t.component("departSelect",ei),t.component("attendantSelect",ti),t.component("SimpleModal",ko),t.component("simpleCard",xo),t.component("instanceSelect",ir),t.component("calendarEvents",kr),t.component("MFA",xr),t.component("MfaQrCode",Td),t.component("chatWindow",Q1),t.component("FilterSelectLib",ni),t.component("MobileInternalChat",J1),t.component("RandomAvatar",ii),t.component("MinModal",si),t.component("LibPatchNotes",di),t.component("BtnNewUpdates",ui),t.component("LibPhotoPicker",fi),t.component("SelectMultipleDepartments",mi),t.component("PrimaryInput",no),t.component("SimpleSelect",hi),t.component("FloatingDev",yi),t.component("RatingInput",oo),t.component("TagView",gi),t.component("ClientsForm",pi),t.component("SelectMultipleTags",to),t.component("SimpleLoader",ro),t.component("OutcomeButton",ao)}function ki(t,n="add"){const a=eo();n==="add"?a.addDepartments(t):n==="delete"?a.removeDepartments(t):n==="update"?(a.departments=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibDeparts.`)}function xi(t,n="add"){const a=Yt();n==="add"?a.addAttendants(t):n==="delete"?a.removeAttendants(t):n==="update"?(a.attendants=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibAttendants.`)}function bi(t,n="add"){const a=va();n==="add"?a.addInstance(t):n==="delete"?a.removeInstance(t):n==="update"?(a.instances=t,a.loaded=!0):console.error(`Ação "${n}" não suportada em attLibInstances.`)}async function wi(t,n,a,o=[],r=[],i=[]){try{const s=await rr(t);n&&await s.setToken(n),a&&(at.defaults.baseURL=a);const l=eo(t);r.length>0&&(l.departments=r,l.count=r.length);const d=Yt(t);o.length>0&&(d.attendants=o,d.count=o.length),await va(t).fetchInstances()}catch(s){console.error("Erro no setupLibrary:",s)}}function Ei(t){return vn(t)}const mx={install:fx,setupLibrary:wi,attLibDeparts:ki,attLibAttendants:xi,attLibInstances:bi,primarySelect:yo,simpleModal:ko,simpleCard:xo,instanceSelect:ir,SimpleSelect:hi,FloatingDev:yi,calendar:kr,SimpleLoader:ro,MFA:xr,chatWindow:Q1,departSelect:ei,attendantSelect:ti,FilterSelectLib:ni,MobileInternalChat:J1,RandomAvatar:ii,MinModal:si,libPatchNotes:di,btnNewUpdates:ui,LibPhotoPicker:fi,SelectMultipleDepartments:mi,SelectMultipleTags:to,PrimaryInput:no,getWithContrastColor:Ei,RatingInput:oo,TagView:gi,ClientsForm:pi,OutcomeButton:ao};function hx(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return new Proxy({},{get(o,r){return(i,s,l)=>{const d=t.Capacitor.Plugins[a];if(d===void 0){l(new Error(`Capacitor plugin ${a} not found`));return}if(typeof d[r]!="function"){l(new Error(`Method ${r} not found in Capacitor plugin ${a}`));return}(async()=>{try{const u=await d[r](i);s(u)}catch(u){l(u)}})()}}})}})}function px(t){t.CapacitorUtils.Synapse=new Proxy({},{get(n,a){return t.cordova.plugins[a]}})}function gx(t=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!t?hx(window):window.cordova!==void 0&&px(window))}var vi;(function(t){t.Documents="DOCUMENTS",t.Data="DATA",t.Library="LIBRARY",t.Cache="CACHE",t.External="EXTERNAL",t.ExternalStorage="EXTERNAL_STORAGE",t.ExternalCache="EXTERNAL_CACHE",t.LibraryNoCloud="LIBRARY_NO_CLOUD",t.Temporary="TEMPORARY"})(vi||(vi={}));var io;(function(t){t.UTF8="utf8",t.ASCII="ascii",t.UTF16="utf16"})(io||(io={}));const sa=wn("Filesystem",{web:()=>Promise.resolve().then(()=>Px).then(t=>new t.FilesystemWeb)});gx();const yx=wn("BlobWriter");function kx(t){return window.btoa(Array.from(new Uint8Array(t)).map(function(n){return String.fromCharCode(n)}).join(""))}function xx({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function(){return new Promise(function(r,i){function s(d){i(d.target.error)}const l=window.indexedDB.open("Disc");l.onerror=s,l.onsuccess=function(){const u=l.result.transaction("FileStorage","readwrite");u.onerror=s;const c=u.objectStore("FileStorage"),h=`/${n}/${t.replace(/^\//,"")}`,m=c.get(h);m.onsuccess=function(){m.result.size=a.size,m.result.content=a;const p=c.put(m.result);p.onsuccess=function(){r(void 0)}}}})})}function Ci({path:t,directory:n,blob:a,recursive:o}){return sa.writeFile({directory:n,path:t,recursive:o,data:""}).then(function r(){if(a.size===0)return Promise.resolve();const i=3*128*1024,s=a.slice(0,i);return a=a.slice(i),new Response(s).arrayBuffer().then(function(d){return sa.appendFile({directory:n,path:t,data:kx(d)})}).then(r)})}function bx(t){const{path:n,directory:a,blob:o,fast_mode:r=!1,recursive:i,on_fallback:s}=t;return!o||!Number.isSafeInteger(o.size)||typeof o.type!="string"?Promise.reject(new Error("Not a Blob.")):ea.getPlatform()==="web"?r?xx(t):Ci(t):Promise.all([yx.get_config(),sa.getUri({path:n,directory:a})]).then(function([l,d]){const u=d.uri.replace("file://","");return(window.CapacitorWebFetch||window.fetch)(l.base_url+u+(i?"?recursive=true":""),{headers:{authorization:l.auth_token},method:"put",body:o}).then(function(h){if(h.status!==204)throw new Error("Bad HTTP status: "+h.status);return d.uri})}).catch(function(d){return s!==void 0&&s(d),Ci(t)})}const wx=Object.freeze(bx);function Ex(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Si={};function vx(t){return t&&t.__esModule?t:{default:t}}var Cx=vx,so={exports:{}},Bi;function Sx(){return Bi||(Bi=1,function(t){var n=function(a){var o=Object.prototype,r=o.hasOwnProperty,i=Object.defineProperty||function(P,H,_){P[H]=_.value},s,l=typeof Symbol=="function"?Symbol:{},d=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function h(P,H,_){return Object.defineProperty(P,H,{value:_,enumerable:!0,configurable:!0,writable:!0}),P[H]}try{h({},"")}catch{h=function(H,_,oe){return H[_]=oe}}function m(P,H,_,oe){var de=H&&H.prototype instanceof E?H:E,pe=Object.create(de.prototype),ye=new Z(oe||[]);return i(pe,"_invoke",{value:F(P,_,ye)}),pe}a.wrap=m;function p(P,H,_){try{return{type:"normal",arg:P.call(H,_)}}catch(oe){return{type:"throw",arg:oe}}}var f="suspendedStart",g="suspendedYield",y="executing",k="completed",w={};function E(){}function v(){}function M(){}var A={};h(A,d,function(){return this});var R=Object.getPrototypeOf,S=R&&R(R(Q([])));S&&S!==o&&r.call(S,d)&&(A=S);var x=M.prototype=E.prototype=Object.create(A);v.prototype=M,i(x,"constructor",{value:M,configurable:!0}),i(M,"constructor",{value:v,configurable:!0}),v.displayName=h(M,c,"GeneratorFunction");function N(P){["next","throw","return"].forEach(function(H){h(P,H,function(_){return this._invoke(H,_)})})}a.isGeneratorFunction=function(P){var H=typeof P=="function"&&P.constructor;return H?H===v||(H.displayName||H.name)==="GeneratorFunction":!1},a.mark=function(P){return Object.setPrototypeOf?Object.setPrototypeOf(P,M):(P.__proto__=M,h(P,c,"GeneratorFunction")),P.prototype=Object.create(x),P},a.awrap=function(P){return{__await:P}};function L(P,H){function _(pe,ye,Ve,Le){var Ae=p(P[pe],P,ye);if(Ae.type==="throw")Le(Ae.arg);else{var qe=Ae.arg,_e=qe.value;return _e&&typeof _e=="object"&&r.call(_e,"__await")?H.resolve(_e.__await).then(function($e){_("next",$e,Ve,Le)},function($e){_("throw",$e,Ve,Le)}):H.resolve(_e).then(function($e){qe.value=$e,Ve(qe)},function($e){return _("throw",$e,Ve,Le)})}}var oe;function de(pe,ye){function Ve(){return new H(function(Le,Ae){_(pe,ye,Le,Ae)})}return oe=oe?oe.then(Ve,Ve):Ve()}i(this,"_invoke",{value:de})}N(L.prototype),h(L.prototype,u,function(){return this}),a.AsyncIterator=L,a.async=function(P,H,_,oe,de){de===void 0&&(de=Promise);var pe=new L(m(P,H,_,oe),de);return a.isGeneratorFunction(H)?pe:pe.next().then(function(ye){return ye.done?ye.value:pe.next()})};function F(P,H,_){var oe=f;return function(pe,ye){if(oe===y)throw new Error("Generator is already running");if(oe===k){if(pe==="throw")throw ye;return ee()}for(_.method=pe,_.arg=ye;;){var Ve=_.delegate;if(Ve){var Le=B(Ve,_);if(Le){if(Le===w)continue;return Le}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(oe===f)throw oe=k,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);oe=y;var Ae=p(P,H,_);if(Ae.type==="normal"){if(oe=_.done?k:g,Ae.arg===w)continue;return{value:Ae.arg,done:_.done}}else Ae.type==="throw"&&(oe=k,_.method="throw",_.arg=Ae.arg)}}}function B(P,H){var _=H.method,oe=P.iterator[_];if(oe===s)return H.delegate=null,_==="throw"&&P.iterator.return&&(H.method="return",H.arg=s,B(P,H),H.method==="throw")||_!=="return"&&(H.method="throw",H.arg=new TypeError("The iterator does not provide a '"+_+"' method")),w;var de=p(oe,P.iterator,H.arg);if(de.type==="throw")return H.method="throw",H.arg=de.arg,H.delegate=null,w;var pe=de.arg;if(!pe)return H.method="throw",H.arg=new TypeError("iterator result is not an object"),H.delegate=null,w;if(pe.done)H[P.resultName]=pe.value,H.next=P.nextLoc,H.method!=="return"&&(H.method="next",H.arg=s);else return pe;return H.delegate=null,w}N(x),h(x,c,"Generator"),h(x,d,function(){return this}),h(x,"toString",function(){return"[object Generator]"});function C(P){var H={tryLoc:P[0]};1 in P&&(H.catchLoc=P[1]),2 in P&&(H.finallyLoc=P[2],H.afterLoc=P[3]),this.tryEntries.push(H)}function O(P){var H=P.completion||{};H.type="normal",delete H.arg,P.completion=H}function Z(P){this.tryEntries=[{tryLoc:"root"}],P.forEach(C,this),this.reset(!0)}a.keys=function(P){var H=Object(P),_=[];for(var oe in H)_.push(oe);return _.reverse(),function de(){for(;_.length;){var pe=_.pop();if(pe in H)return de.value=pe,de.done=!1,de}return de.done=!0,de}};function Q(P){if(P){var H=P[d];if(H)return H.call(P);if(typeof P.next=="function")return P;if(!isNaN(P.length)){var _=-1,oe=function de(){for(;++_<P.length;)if(r.call(P,_))return de.value=P[_],de.done=!1,de;return de.value=s,de.done=!0,de};return oe.next=oe}}return{next:ee}}a.values=Q;function ee(){return{value:s,done:!0}}return Z.prototype={constructor:Z,reset:function(P){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(O),!P)for(var H in this)H.charAt(0)==="t"&&r.call(this,H)&&!isNaN(+H.slice(1))&&(this[H]=s)},stop:function(){this.done=!0;var P=this.tryEntries[0],H=P.completion;if(H.type==="throw")throw H.arg;return this.rval},dispatchException:function(P){if(this.done)throw P;var H=this;function _(Le,Ae){return pe.type="throw",pe.arg=P,H.next=Le,Ae&&(H.method="next",H.arg=s),!!Ae}for(var oe=this.tryEntries.length-1;oe>=0;--oe){var de=this.tryEntries[oe],pe=de.completion;if(de.tryLoc==="root")return _("end");if(de.tryLoc<=this.prev){var ye=r.call(de,"catchLoc"),Ve=r.call(de,"finallyLoc");if(ye&&Ve){if(this.prev<de.catchLoc)return _(de.catchLoc,!0);if(this.prev<de.finallyLoc)return _(de.finallyLoc)}else if(ye){if(this.prev<de.catchLoc)return _(de.catchLoc,!0)}else if(Ve){if(this.prev<de.finallyLoc)return _(de.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(P,H){for(var _=this.tryEntries.length-1;_>=0;--_){var oe=this.tryEntries[_];if(oe.tryLoc<=this.prev&&r.call(oe,"finallyLoc")&&this.prev<oe.finallyLoc){var de=oe;break}}de&&(P==="break"||P==="continue")&&de.tryLoc<=H&&H<=de.finallyLoc&&(de=null);var pe=de?de.completion:{};return pe.type=P,pe.arg=H,de?(this.method="next",this.next=de.finallyLoc,w):this.complete(pe)},complete:function(P,H){if(P.type==="throw")throw P.arg;return P.type==="break"||P.type==="continue"?this.next=P.arg:P.type==="return"?(this.rval=this.arg=P.arg,this.method="return",this.next="end"):P.type==="normal"&&H&&(this.next=H),w},finish:function(P){for(var H=this.tryEntries.length-1;H>=0;--H){var _=this.tryEntries[H];if(_.finallyLoc===P)return this.complete(_.completion,_.afterLoc),O(_),w}},catch:function(P){for(var H=this.tryEntries.length-1;H>=0;--H){var _=this.tryEntries[H];if(_.tryLoc===P){var oe=_.completion;if(oe.type==="throw"){var de=oe.arg;O(_)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(P,H,_){return this.delegate={iterator:Q(P),resultName:H,nextLoc:_},this.method==="next"&&(this.arg=s),w}},a}(t.exports);try{regeneratorRuntime=n}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}(so)),so.exports}var lo,Vi;function Bx(){return Vi||(Vi=1,lo=Sx()),lo}var co,Mi;function Vx(){if(Mi)return co;Mi=1;function t(a,o,r,i,s,l,d){try{var u=a[l](d),c=u.value}catch(h){r(h);return}u.done?o(c):Promise.resolve(c).then(i,s)}function n(a){return function(){var o=this,r=arguments;return new Promise(function(i,s){var l=a.apply(o,r);function d(c){t(l,i,s,d,u,"next",c)}function u(c){t(l,i,s,d,u,"throw",c)}d(void 0)})}}return co=n,co}(function(t){var n=Cx;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var a=n(Bx()),o=n(Vx());function r(s){return i.apply(this,arguments)}function i(){return(i=(0,o.default)(a.default.mark(function s(l){var d,u;return a.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return d=document.createElement("video"),u=new Promise(function(h,m){d.addEventListener("loadedmetadata",function(){d.duration===1/0?(d.currentTime=Number.MAX_SAFE_INTEGER,d.ontimeupdate=function(){d.ontimeupdate=null,h(d.duration),d.currentTime=0}):h(d.duration)}),d.onerror=function(p){return m(p.target.error)}}),d.src=typeof l=="string"||l instanceof String?l:window.URL.createObjectURL(l),c.abrupt("return",u);case 4:case"end":return c.stop()}},s)}))).apply(this,arguments)}})(Si);const Mx=Ex(Si),Tt=()=>({value:!0}),Cn=()=>({value:!1}),Nx=()=>new Error("MISSING_PERMISSION"),Ax=()=>new Error("ALREADY_RECORDING"),Tx=()=>new Error("DEVICE_CANNOT_VOICE_RECORD"),Ni=()=>new Error("FAILED_TO_RECORD"),Dx=()=>new Error("EMPTY_RECORDING"),uo=()=>new Error("RECORDING_HAS_NOT_STARTED"),Ai=()=>new Error("FAILED_TO_FETCH_RECORDING"),fo=()=>new Error("COULD_NOT_QUERY_PERMISSION_STATUS"),Ti={"audio/aac":".aac","audio/mp4":".mp3","audio/webm;codecs=opus":".ogg","audio/webm":".ogg","audio/ogg;codecs=opus":".ogg"},Di=()=>new Promise(()=>{});class ht{constructor(){this.mediaRecorder=null,this.chunks=[],this.pendingResult=Di()}static async canDeviceVoiceRecord(){var n;return((n=navigator==null?void 0:navigator.mediaDevices)===null||n===void 0?void 0:n.getUserMedia)==null||ht.getSupportedMimeType()==null?Cn():Tt()}async startRecording(n){if(this.mediaRecorder!=null)throw Ax();if(!(await ht.canDeviceVoiceRecord()).value)throw Tx();if(!(await ht.hasAudioRecordingPermission().catch(()=>Tt())).value)throw Nx();return navigator.mediaDevices.getUserMedia({audio:!0}).then(r=>this.onSuccessfullyStartedRecording(r,n)).catch(this.onFailedToStartRecording.bind(this))}async stopRecording(){if(this.mediaRecorder==null)throw uo();try{return this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(n=>n.stop()),this.pendingResult}catch{throw Ai()}finally{this.prepareInstanceForNextOperation()}}static async hasAudioRecordingPermission(){return navigator.permissions.query==null?navigator.mediaDevices==null?Promise.reject(fo()):navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>{throw fo()}):navigator.permissions.query({name:"microphone"}).then(n=>({value:n.state==="granted"})).catch(()=>{throw fo()})}static async requestAudioRecordingPermission(){return(await ht.hasAudioRecordingPermission().catch(()=>Cn())).value?Tt():navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Tt()).catch(()=>Cn())}pauseRecording(){if(this.mediaRecorder==null)throw uo();return this.mediaRecorder.state==="recording"?(this.mediaRecorder.pause(),Promise.resolve(Tt())):Promise.resolve(Cn())}resumeRecording(){if(this.mediaRecorder==null)throw uo();return this.mediaRecorder.state==="paused"?(this.mediaRecorder.resume(),Promise.resolve(Tt())):Promise.resolve(Cn())}getCurrentStatus(){return this.mediaRecorder==null?Promise.resolve({status:na.NONE}):this.mediaRecorder.state==="recording"?Promise.resolve({status:na.RECORDING}):this.mediaRecorder.state==="paused"?Promise.resolve({status:na.PAUSED}):Promise.resolve({status:na.NONE})}static getSupportedMimeType(){if((MediaRecorder==null?void 0:MediaRecorder.isTypeSupported)==null)return null;const n=Object.keys(Ti).find(a=>MediaRecorder.isTypeSupported(a));return n??null}onSuccessfullyStartedRecording(n,a){return this.pendingResult=new Promise((o,r)=>{this.mediaRecorder=new MediaRecorder(n),this.mediaRecorder.onerror=()=>{this.prepareInstanceForNextOperation(),r(Ni())},this.mediaRecorder.onstop=async()=>{var i,s,l;const d=ht.getSupportedMimeType();if(d==null){this.prepareInstanceForNextOperation(),r(Ai());return}const u=new Blob(this.chunks,{type:d});if(u.size<=0){this.prepareInstanceForNextOperation(),r(Dx());return}let c,h;a!=null?(c=`${(l=(s=(i=a.subDirectory)===null||i===void 0?void 0:i.match(/^\/?(.+[^/])\/?$/))===null||s===void 0?void 0:s[1])!==null&&l!==void 0?l:""}/recording-${new Date().getTime()}${Ti[d]}`,await wx({blob:u,directory:a.directory,fast_mode:!0,path:c,recursive:!0})):h=await ht.blobToBase64(u);const m=await Mx(u);this.prepareInstanceForNextOperation(),o({value:{recordDataBase64:h,mimeType:d,msDuration:m*1e3,path:c}})},this.mediaRecorder.ondataavailable=i=>this.chunks.push(i.data),this.mediaRecorder.start()}),Tt()}onFailedToStartRecording(){throw this.prepareInstanceForNextOperation(),Ni()}static blobToBase64(n){return new Promise(a=>{const o=new FileReader;o.onloadend=()=>{const r=String(o.result),i=r.split("base64,"),s=i.length>1?i[1]:r;a(s.trim())},o.readAsDataURL(n)})}prepareInstanceForNextOperation(){if(this.mediaRecorder!=null&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.stop()}catch(n){console.warn("While trying to stop a media recorder, an error was thrown",n)}this.pendingResult=Di(),this.mediaRecorder=null,this.chunks=[]}}class Fx extends ta{constructor(){super(...arguments),this.voiceRecorderInstance=new ht}canDeviceVoiceRecord(){return ht.canDeviceVoiceRecord()}hasAudioRecordingPermission(){return ht.hasAudioRecordingPermission()}requestAudioRecordingPermission(){return ht.requestAudioRecordingPermission()}startRecording(n){return this.voiceRecorderInstance.startRecording(n)}stopRecording(){return this.voiceRecorderInstance.stopRecording()}pauseRecording(){return this.voiceRecorderInstance.pauseRecording()}resumeRecording(){return this.voiceRecorderInstance.resumeRecording()}getCurrentStatus(){return this.voiceRecorderInstance.getCurrentStatus()}}const Lx=Object.freeze(Object.defineProperty({__proto__:null,VoiceRecorderWeb:Fx},Symbol.toStringTag,{value:"Module"}));function Fi(t){const n=t.split("/").filter(o=>o!=="."),a=[];return n.forEach(o=>{o===".."&&a.length>0&&a[a.length-1]!==".."?a.pop():a.push(o)}),a.join("/")}function $x(t,n){t=Fi(t),n=Fi(n);const a=t.split("/"),o=n.split("/");return t!==n&&a.every((r,i)=>r===o[i])}class la extends ta{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME="Disc",this._writeCmds=["add","put","delete"],this.downloadFile=async n=>{var a,o;const r=L1(n,n.webFetchExtra),i=await fetch(n.url,r);let s;if(!n.progress)s=await i.blob();else if(!(i!=null&&i.body))s=new Blob;else{const d=i.body.getReader();let u=0;const c=[],h=i.headers.get("content-type"),m=parseInt(i.headers.get("content-length")||"0",10);for(;;){const{done:g,value:y}=await d.read();if(g)break;c.push(y),u+=(y==null?void 0:y.length)||0;const k={url:n.url,bytes:u,contentLength:m};this.notifyListeners("progress",k)}const p=new Uint8Array(u);let f=0;for(const g of c)typeof g>"u"||(p.set(g,f),f+=g.length);s=new Blob([p.buffer],{type:h||void 0})}return{path:(await this.writeFile({path:n.path,directory:(a=n.directory)!==null&&a!==void 0?a:void 0,recursive:(o=n.recursive)!==null&&o!==void 0?o:!1,data:s})).uri,blob:s}}}readFileInChunks(n,a){throw this.unavailable("Method not implemented.")}async initDb(){if(this._db!==void 0)return this._db;if(!("indexedDB"in window))throw this.unavailable("This browser doesn't support IndexedDB");return new Promise((n,a)=>{const o=indexedDB.open(this.DB_NAME,this.DB_VERSION);o.onupgradeneeded=la.doUpgrade,o.onsuccess=()=>{this._db=o.result,n(o.result)},o.onerror=()=>a(o.error),o.onblocked=()=>{console.warn("db blocked")}})}static doUpgrade(n){const o=n.target.result;switch(n.oldVersion){case 0:case 1:default:o.objectStoreNames.contains("FileStorage")&&o.deleteObjectStore("FileStorage"),o.createObjectStore("FileStorage",{keyPath:"path"}).createIndex("by_folder","folder")}}async dbRequest(n,a){const o=this._writeCmds.indexOf(n)!==-1?"readwrite":"readonly";return this.initDb().then(r=>new Promise((i,s)=>{const u=r.transaction(["FileStorage"],o).objectStore("FileStorage")[n](...a);u.onsuccess=()=>i(u.result),u.onerror=()=>s(u.error)}))}async dbIndexRequest(n,a,o){const r=this._writeCmds.indexOf(a)!==-1?"readwrite":"readonly";return this.initDb().then(i=>new Promise((s,l)=>{const h=i.transaction(["FileStorage"],r).objectStore("FileStorage").index(n)[a](...o);h.onsuccess=()=>s(h.result),h.onerror=()=>l(h.error)}))}getPath(n,a){const o=a!==void 0?a.replace(/^[/]+|[/]+$/g,""):"";let r="";return n!==void 0&&(r+="/"+n),a!==""&&(r+="/"+o),r}async clear(){(await this.initDb()).transaction(["FileStorage"],"readwrite").objectStore("FileStorage").clear()}async readFile(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(o===void 0)throw Error("File does not exist.");return{data:o.content?o.content:""}}async writeFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=n.recursive,s=await this.dbRequest("get",[a]);if(s&&s.type==="directory")throw Error("The supplied path is a directory.");const l=a.substr(0,a.lastIndexOf("/"));if(await this.dbRequest("get",[l])===void 0){const h=l.indexOf("/",1);if(h!==-1){const m=l.substr(h);await this.mkdir({path:m,directory:n.directory,recursive:i})}}if(!r&&!(o instanceof Blob)&&(o=o.indexOf(",")>=0?o.split(",")[1]:o,!this.isBase64String(o)))throw Error("The supplied data is not valid base64 content.");const u=Date.now(),c={path:a,folder:l,type:"file",size:o instanceof Blob?o.size:o.length,ctime:u,mtime:u,content:o};return await this.dbRequest("put",[c]),{uri:c.path}}async appendFile(n){const a=this.getPath(n.directory,n.path);let o=n.data;const r=n.encoding,i=a.substr(0,a.lastIndexOf("/")),s=Date.now();let l=s;const d=await this.dbRequest("get",[a]);if(d&&d.type==="directory")throw Error("The supplied path is a directory.");if(await this.dbRequest("get",[i])===void 0){const h=i.indexOf("/",1);if(h!==-1){const m=i.substr(h);await this.mkdir({path:m,directory:n.directory,recursive:!0})}}if(!r&&!this.isBase64String(o))throw Error("The supplied data is not valid base64 content.");if(d!==void 0){if(d.content instanceof Blob)throw Error("The occupied entry contains a Blob object which cannot be appended to.");d.content!==void 0&&!r?o=btoa(atob(d.content)+atob(o)):o=d.content+o,l=d.ctime}const c={path:a,folder:i,type:"file",size:o.length,ctime:l,mtime:s,content:o};await this.dbRequest("put",[c])}async deleteFile(n){const a=this.getPath(n.directory,n.path);if(await this.dbRequest("get",[a])===void 0)throw Error("File does not exist.");if((await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)])).length!==0)throw Error("Folder is not empty.");await this.dbRequest("delete",[a])}async mkdir(n){const a=this.getPath(n.directory,n.path),o=n.recursive,r=a.substr(0,a.lastIndexOf("/")),i=(a.match(/\//g)||[]).length,s=await this.dbRequest("get",[r]),l=await this.dbRequest("get",[a]);if(i===1)throw Error("Cannot create Root directory");if(l!==void 0)throw Error("Current directory does already exist.");if(!o&&i!==2&&s===void 0)throw Error("Parent directory must exist");if(o&&i!==2&&s===void 0){const c=r.substr(r.indexOf("/",1));await this.mkdir({path:c,directory:n.directory,recursive:o})}const d=Date.now(),u={path:a,folder:r,type:"directory",size:0,ctime:d,mtime:d};await this.dbRequest("put",[u])}async rmdir(n){const{path:a,directory:o,recursive:r}=n,i=this.getPath(o,a),s=await this.dbRequest("get",[i]);if(s===void 0)throw Error("Folder does not exist.");if(s.type!=="directory")throw Error("Requested path is not a directory");const l=await this.readdir({path:a,directory:o});if(l.files.length!==0&&!r)throw Error("Folder is not empty");for(const d of l.files){const u=`${a}/${d.name}`;(await this.stat({path:u,directory:o})).type==="file"?await this.deleteFile({path:u,directory:o}):await this.rmdir({path:u,directory:o,recursive:r})}await this.dbRequest("delete",[i])}async readdir(n){const a=this.getPath(n.directory,n.path),o=await this.dbRequest("get",[a]);if(n.path!==""&&o===void 0)throw Error("Folder does not exist.");const r=await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(a)]);return{files:await Promise.all(r.map(async s=>{let l=await this.dbRequest("get",[s]);return l===void 0&&(l=await this.dbRequest("get",[s+"/"])),{name:s.substring(a.length+1),type:l.type,size:l.size,ctime:l.ctime,mtime:l.mtime,uri:l.path}}))}}async getUri(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);return o===void 0&&(o=await this.dbRequest("get",[a+"/"])),{uri:(o==null?void 0:o.path)||a}}async stat(n){const a=this.getPath(n.directory,n.path);let o=await this.dbRequest("get",[a]);if(o===void 0&&(o=await this.dbRequest("get",[a+"/"])),o===void 0)throw Error("Entry does not exist.");return{name:o.path.substring(a.length+1),type:o.type,size:o.size,ctime:o.ctime,mtime:o.mtime,uri:o.path}}async rename(n){await this._copy(n,!0)}async copy(n){return this._copy(n,!1)}async requestPermissions(){return{publicStorage:"granted"}}async checkPermissions(){return{publicStorage:"granted"}}async _copy(n,a=!1){let{toDirectory:o}=n;const{to:r,from:i,directory:s}=n;if(!r||!i)throw Error("Both to and from must be provided");o||(o=s);const l=this.getPath(s,i),d=this.getPath(o,r);if(l===d)return{uri:d};if($x(l,d))throw Error("To path cannot contain the from path");let u;try{u=await this.stat({path:r,directory:o})}catch{const f=r.split("/");f.pop();const g=f.join("/");if(f.length>0&&(await this.stat({path:g,directory:o})).type!=="directory")throw new Error("Parent directory of the to path is a file")}if(u&&u.type==="directory")throw new Error("Cannot overwrite a directory with a file");const c=await this.stat({path:i,directory:s}),h=async(p,f,g)=>{const y=this.getPath(o,p),k=await this.dbRequest("get",[y]);k.ctime=f,k.mtime=g,await this.dbRequest("put",[k])},m=c.ctime?c.ctime:Date.now();switch(c.type){case"file":{const p=await this.readFile({path:i,directory:s});a&&await this.deleteFile({path:i,directory:s});let f;!(p.data instanceof Blob)&&!this.isBase64String(p.data)&&(f=io.UTF8);const g=await this.writeFile({path:r,directory:o,data:p.data,encoding:f});return a&&await h(r,m,c.mtime),g}case"directory":{if(u)throw Error("Cannot move a directory over an existing object");try{await this.mkdir({path:r,directory:o,recursive:!1}),a&&await h(r,m,c.mtime)}catch{}const p=(await this.readdir({path:i,directory:s})).files;for(const f of p)await this._copy({from:`${i}/${f.name}`,to:`${r}/${f.name}`,directory:s,toDirectory:o},a);a&&await this.rmdir({path:i,directory:s})}}return{uri:d}}isBase64String(n){try{return btoa(atob(n))==n}catch{return!1}}}la._debug=!0;const Px=Object.freeze(Object.defineProperty({__proto__:null,FilesystemWeb:la},Symbol.toStringTag,{value:"Module"}));et.attLibAttendants=xi,et.attLibDeparts=ki,et.attLibInstances=bi,et.default=mx,et.getWithContrastColor=Ei,et.setupLibrary=wi,et.useScheduledStore=hr,Object.defineProperties(et,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});