sm-click-library-ui 0.0.455 → 0.0.456
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[Fo]=this[Fo]={accessors:{}}).accessors,r=this.prototype;function i(s){const l=Jt(s);o[l]||(Js(r,s),o[l]=!0)}return U.isArray(n)?n.forEach(i):i(n),this}};tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(tt.prototype,({value:t},n)=>{let a=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(o){this[a]=o}}}),U.freezeMethods(tt);function sa(t,n){const a=this||Qt,o=n||a,r=tt.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 $o(t){return!!(t&&t.__CANCEL__)}function Pt(t,n,a){Ce.call(this,t??"canceled",Ce.ERR_CANCELED,n,a),this.name="CanceledError"}U.inherits(Pt,Ce,{__CANCEL__:!0});function Po(t,n,a){const o=a.config.validateStatus;!a.status||!o||o(a.status)?t(a):n(new Ce("Request failed with status code "+a.status,[Ce.ERR_BAD_REQUEST,Ce.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function e0(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function t0(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(c){const m=Date.now(),d=o[i];s||(s=m),a[r]=c,o[r]=m;let h=i,f=0;for(;h!==r;)f+=a[h++],h=h%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),m-s<n)return;const p=d&&m-d;return p?Math.round(f*1e3/p):void 0}}function n0(t,n){let a=0,o=1e3/n,r,i;const s=(m,d=Date.now())=>{a=d,r=null,i&&(clearTimeout(i),i=null),t.apply(null,m)};return[(...m)=>{const d=Date.now(),h=d-a;h>=o?s(m,d):(r=m,i||(i=setTimeout(()=>{i=null,s(r)},o-h)))},()=>r&&s(r)]}const bn=(t,n,a=3)=>{let o=0;const r=t0(50,250);return n0(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-o,m=r(c),d=s<=l;o=s;const h={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:m||void 0,estimated:m&&l&&d?(l-s)/m:void 0,event:i,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(h)},a)},Oo=(t,n)=>{const a=t!=null;return[o=>n[0]({lengthComputable:a,total:t,loaded:o}),n[1]]},_o=t=>(...n)=>U.asap(()=>t(...n)),a0=Ze.hasStandardBrowserEnv?((t,n)=>a=>(a=new URL(a,Ze.origin),t.protocol===a.protocol&&t.host===a.host&&(n||t.port===a.port)))(new URL(Ze.origin),Ze.navigator&&/(msie|trident)/i.test(Ze.navigator.userAgent)):()=>!0,o0=Ze.hasStandardBrowserEnv?{write(t,n,a,o,r,i){const s=[t+"="+encodeURIComponent(n)];U.isNumber(a)&&s.push("expires="+new Date(a).toGMTString()),U.isString(o)&&s.push("path="+o),U.isString(r)&&s.push("domain="+r),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function r0(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function i0(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function Ro(t,n,a){let o=!r0(n);return t&&(o||a==!1)?i0(t,n):n}const Ho=t=>t instanceof tt?{...t}:t;function Nt(t,n){n=n||{};const a={};function o(m,d,h,f){return U.isPlainObject(m)&&U.isPlainObject(d)?U.merge.call({caseless:f},m,d):U.isPlainObject(d)?U.merge({},d):U.isArray(d)?d.slice():d}function r(m,d,h,f){if(U.isUndefined(d)){if(!U.isUndefined(m))return o(void 0,m,h,f)}else return o(m,d,h,f)}function i(m,d){if(!U.isUndefined(d))return o(void 0,d)}function s(m,d){if(U.isUndefined(d)){if(!U.isUndefined(m))return o(void 0,m)}else return o(void 0,d)}function l(m,d,h){if(h in n)return o(m,d);if(h in t)return o(void 0,m)}const c={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:(m,d,h)=>r(Ho(m),Ho(d),h,!0)};return U.forEach(Object.keys(Object.assign({},t,n)),function(d){const h=c[d]||r,f=h(t[d],n[d],d);U.isUndefined(f)&&h!==l||(a[d]=f)}),a}const zo=t=>{const n=Nt({},t);let{data:a,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:i,headers:s,auth:l}=n;n.headers=s=tt.from(s),n.url=Ao(Ro(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(U.isFormData(a)){if(Ze.hasStandardBrowserEnv||Ze.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[m,...d]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];s.setContentType([m||"multipart/form-data",...d].join("; "))}}if(Ze.hasStandardBrowserEnv&&(o&&U.isFunction(o)&&(o=o(n)),o||o!==!1&&a0(n.url))){const m=r&&i&&o0.read(i);m&&s.set(r,m)}return n},s0=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(a,o){const r=zo(t);let i=r.data;const s=tt.from(r.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:m}=r,d,h,f,p,u;function g(){p&&p(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let k=new XMLHttpRequest;k.open(r.method.toUpperCase(),r.url,!0),k.timeout=r.timeout;function w(){if(!k)return;const y=tt.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:y,config:t,request:k};Po(function(R){a(R),g()},function(R){o(R),g()},C),k=null}"onloadend"in k?k.onloadend=w:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(w)},k.onabort=function(){k&&(o(new Ce("Request aborted",Ce.ECONNABORTED,t,k)),k=null)},k.onerror=function(){o(new Ce("Network Error",Ce.ERR_NETWORK,t,k)),k=null},k.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||Do;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),o(new Ce(E,C.clarifyTimeoutError?Ce.ETIMEDOUT:Ce.ECONNABORTED,t,k)),k=null},i===void 0&&s.setContentType(null),"setRequestHeader"in k&&U.forEach(s.toJSON(),function(E,C){k.setRequestHeader(C,E)}),U.isUndefined(r.withCredentials)||(k.withCredentials=!!r.withCredentials),l&&l!=="json"&&(k.responseType=r.responseType),m&&([f,u]=bn(m,!0),k.addEventListener("progress",f)),c&&k.upload&&([h,p]=bn(c),k.upload.addEventListener("progress",h),k.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(d=y=>{k&&(o(!y||y.type?new Pt(null,t,k):y),k.abort(),k=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const x=e0(r.url);if(x&&Ze.protocols.indexOf(x)===-1){o(new Ce("Unsupported protocol "+x+":",Ce.ERR_BAD_REQUEST,t));return}k.send(i||null)})},l0=(t,n)=>{const{length:a}=t=t?t.filter(Boolean):[];if(n||a){let o=new AbortController,r;const i=function(m){if(!r){r=!0,l();const d=m instanceof Error?m:this.reason;o.abort(d instanceof Ce?d:new Pt(d instanceof Error?d.message:d))}};let s=n&&setTimeout(()=>{s=null,i(new Ce(`timeout ${n} of ms exceeded`,Ce.ETIMEDOUT))},n);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(m=>{m.unsubscribe?m.unsubscribe(i):m.removeEventListener("abort",i)}),t=null)};t.forEach(m=>m.addEventListener("abort",i));const{signal:c}=o;return c.unsubscribe=()=>U.asap(l),c}},c0=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},d0=async function*(t,n){for await(const a of u0(t))yield*c0(a,n)},u0=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()}},jo=(t,n,a,o)=>{const r=d0(t,n);let i=0,s,l=c=>{s||(s=!0,o&&o(c))};return new ReadableStream({async pull(c){try{const{done:m,value:d}=await r.next();if(m){l(),c.close();return}let h=d.byteLength;if(a){let f=i+=h;a(f)}c.enqueue(new Uint8Array(d))}catch(m){throw l(m),m}},cancel(c){return l(c),r.return()}},{highWaterMark:2})},wn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Go=wn&&typeof ReadableStream=="function",m0=wn&&(typeof TextEncoder=="function"?(t=>n=>t.encode(n))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Io=(t,...n)=>{try{return!!t(...n)}catch{return!1}},f0=Go&&Io(()=>{let t=!1;const n=new Request(Ze.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!n}),qo=64*1024,la=Go&&Io(()=>U.isReadableStream(new Response("").body)),En={stream:la&&(t=>t.body)};wn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!En[n]&&(En[n]=U.isFunction(t[n])?a=>a[n]():(a,o)=>{throw new Ce(`Response type '${n}' is not supported`,Ce.ERR_NOT_SUPPORT,o)})})})(new Response);const h0=async t=>{if(t==null)return 0;if(U.isBlob(t))return t.size;if(U.isSpecCompliantForm(t))return(await new Request(Ze.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(U.isArrayBufferView(t)||U.isArrayBuffer(t))return t.byteLength;if(U.isURLSearchParams(t)&&(t=t+""),U.isString(t))return(await m0(t)).byteLength},p0=async(t,n)=>{const a=U.toFiniteNumber(t.getContentLength());return a??h0(n)},ca={http:Ps,xhr:s0,fetch:wn&&(async t=>{let{url:n,method:a,data:o,signal:r,cancelToken:i,timeout:s,onDownloadProgress:l,onUploadProgress:c,responseType:m,headers:d,withCredentials:h="same-origin",fetchOptions:f}=zo(t);m=m?(m+"").toLowerCase():"text";let p=l0([r,i&&i.toAbortSignal()],s),u;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let k;try{if(c&&f0&&a!=="get"&&a!=="head"&&(k=await p0(d,o))!==0){let C=new Request(n,{method:"POST",body:o,duplex:"half"}),$;if(U.isFormData(o)&&($=C.headers.get("content-type"))&&d.setContentType($),C.body){const[R,v]=Oo(k,bn(_o(c)));o=jo(C.body,qo,R,v)}}U.isString(h)||(h=h?"include":"omit");const w="credentials"in Request.prototype;u=new Request(n,{...f,signal:p,method:a.toUpperCase(),headers:d.normalize().toJSON(),body:o,duplex:"half",credentials:w?h:void 0});let x=await fetch(u,f);const y=la&&(m==="stream"||m==="response");if(la&&(l||y&&g)){const C={};["status","statusText","headers"].forEach(b=>{C[b]=x[b]});const $=U.toFiniteNumber(x.headers.get("content-length")),[R,v]=l&&Oo($,bn(_o(l),!0))||[];x=new Response(jo(x.body,qo,R,()=>{v&&v(),g&&g()}),C)}m=m||"text";let E=await En[U.findKey(En,m)||"text"](x,t);return!y&&g&&g(),await new Promise((C,$)=>{Po(C,$,{data:E,headers:tt.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:u})})}catch(w){throw g&&g(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new Ce("Network Error",Ce.ERR_NETWORK,t,u),{cause:w.cause||w}):Ce.from(w,w&&w.code,t,u)}})};U.forEach(ca,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const Wo=t=>`- ${t}`,g0=t=>U.isFunction(t)||t===null||t===!1,Uo={getAdapter:t=>{t=U.isArray(t)?t:[t];const{length:n}=t;let a,o;const r={};for(let i=0;i<n;i++){a=t[i];let s;if(o=a,!g0(a)&&(o=ca[(s=String(a)).toLowerCase()],o===void 0))throw new Ce(`Unknown adapter '${s}'`);if(o)break;r[s||"#"+i]=o}if(!o){const i=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=n?i.length>1?`since :
|
|
4
4
|
`+i.map(Wo).join(`
|
|
5
5
|
`):" "+Wo(i[0]):"as no adapter specified";throw new Ce("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:ca};function da(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Pt(null,t)}function Zo(t){return da(t),t.headers=tt.from(t.headers),t.data=sa.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Uo.getAdapter(t.adapter||Qt.adapter)(t).then(function(o){return da(t),o.data=sa.call(t,t.transformResponse,o),o.headers=tt.from(o.headers),o},function(o){return $o(o)||(da(t),o&&o.response&&(o.response.data=sa.call(t,t.transformResponse,o.response),o.response.headers=tt.from(o.response.headers))),Promise.reject(o)})}const Yo="1.10.0",vn={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{vn[t]=function(o){return typeof o===t||"a"+(n<1?"n ":" ")+t}});const Xo={};vn.transitional=function(n,a,o){function r(i,s){return"[Axios v"+Yo+"] Transitional option '"+i+"'"+s+(o?". "+o:"")}return(i,s,l)=>{if(n===!1)throw new Ce(r(s," has been removed"+(a?" in "+a:"")),Ce.ERR_DEPRECATED);return a&&!Xo[s]&&(Xo[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}},vn.spelling=function(n){return(a,o)=>(console.warn(`${o} is likely a misspelling of ${n}`),!0)};function y0(t,n,a){if(typeof t!="object")throw new Ce("options must be an object",Ce.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],c=l===void 0||s(l,i,t);if(c!==!0)throw new Ce("option "+i+" must be "+c,Ce.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Ce("Unknown option "+i,Ce.ERR_BAD_OPTION)}}const Cn={assertOptions:y0,validators:vn},ct=Cn.validators;let At=class{constructor(n){this.defaults=n||{},this.interceptors={request:new To,response:new To}}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=Nt(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&Cn.assertOptions(o,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),r!=null&&(U.isFunction(r)?a.paramsSerializer={serialize:r}:Cn.assertOptions(r,{encode:ct.function,serialize:ct.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),Cn.assertOptions(a,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.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"],u=>{delete i[u]}),a.headers=tt.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const m=[];this.interceptors.response.forEach(function(g){m.push(g.fulfilled,g.rejected)});let d,h=0,f;if(!c){const u=[Zo.bind(this),void 0];for(u.unshift.apply(u,l),u.push.apply(u,m),f=u.length,d=Promise.resolve(a);h<f;)d=d.then(u[h++],u[h++]);return d}f=l.length;let p=a;for(h=0;h<f;){const u=l[h++],g=l[h++];try{p=u(p)}catch(k){g.call(this,k);break}}try{d=Zo.call(this,p)}catch(u){return Promise.reject(u)}for(h=0,f=m.length;h<f;)d=d.then(m[h++],m[h++]);return d}getUri(n){n=Nt(this.defaults,n);const a=Ro(n.baseURL,n.url,n.allowAbsoluteUrls);return Ao(a,n.params,n.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(n){At.prototype[n]=function(a,o){return this.request(Nt(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(Nt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}At.prototype[n]=a(),At.prototype[n+"Form"]=a(!0)});let k0=class Bi{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 Pt(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 Bi(function(r){n=r}),cancel:n}}};function x0(t){return function(a){return t.apply(null,a)}}function b0(t){return U.isObject(t)&&t.isAxiosError===!0}const ua={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};Object.entries(ua).forEach(([t,n])=>{ua[n]=t});function Ko(t){const n=new At(t),a=po(At.prototype.request,n);return U.extend(a,At.prototype,n,{allOwnKeys:!0}),U.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return Ko(Nt(t,r))},a}const Re=Ko(Qt);Re.Axios=At,Re.CanceledError=Pt,Re.CancelToken=k0,Re.isCancel=$o,Re.VERSION=Yo,Re.toFormData=kn,Re.AxiosError=Ce,Re.Cancel=Re.CanceledError,Re.all=function(n){return Promise.all(n)},Re.spread=x0,Re.isAxiosError=b0,Re.mergeConfig=Nt,Re.AxiosHeaders=tt,Re.formToJSON=t=>Lo(U.isHTMLForm(t)?new FormData(t):t),Re.getAdapter=Uo.getAdapter,Re.HttpStatusCode=ua,Re.default=Re;const{Axios:hb,AxiosError:pb,CanceledError:gb,isCancel:yb,CancelToken:kb,VERSION:xb,all:bb,Cancel:wb,isAxiosError:Eb,spread:vb,toFormData:Cb,AxiosHeaders:Sb,HttpStatusCode:Bb,formToJSON:Vb,getAdapter:Mb,mergeConfig:Nb}=Re,ma=Vt.defineStore("auth",{state:()=>({jwtToken:null,refreshToken:null}),actions:{setToken(t,n=null){this.jwtToken=t,n&&(this.refreshToken=n),this._syncToLocalStorage()},setRefreshToken(t){this.refreshToken=t,this._syncToLocalStorage()},clearToken(){this.jwtToken=null,this.refreshToken=null},_syncToLocalStorage(){if(typeof window<"u"&&window.localStorage)try{if(!this.jwtToken&&!this.refreshToken)return;const t=localStorage.getItem("userData");if(t){const a=JSON.parse(t);this.jwtToken&&(a.access_token=this.jwtToken),this.refreshToken&&(a.refresh_token=this.refreshToken),localStorage.setItem("userData",JSON.stringify(a));return}localStorage.getItem("access_token")!==null&&(this.jwtToken&&localStorage.setItem("access_token",this.jwtToken),this.refreshToken&&localStorage.setItem("refresh_token",this.refreshToken))}catch(t){console.warn("Erro ao sincronizar token com localStorage:",t)}}},getters:{getToken:t=>t.jwtToken,getRefreshToken:t=>t.refreshToken}}),je=Re.create({baseURL:"https://back.dev-smclick.com.br/"}),Sn=Re.create();Sn.defaults.baseURL=je.defaults.baseURL;let fa=null,Qo=null,Jo=null;const er=()=>(fa||(fa=ma(Jo)),fa);function w0(t){Jo=t}function tr(t){Qo=t}je.interceptors.request.use(t=>{try{const a=er().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)),je.interceptors.response.use(t=>t,async t=>{if(!t.response)return Promise.reject(t);const n=t.response.status;if(n.toString()[0]==="5")return console.error("Erro inesperado no servidor:",t),Promise.reject(t);if(n===401){const a=er(),o=a.refreshToken;if(o)try{const r=Qo||`${Sn.defaults.baseURL}v1/api/attendances/token/refresh/`,s=(await Sn.post(r,{refresh:o})).data.access;return a.setToken(s,o),t.config.headers.Authorization=`Bearer ${s}`,je.request(t.config)}catch(r){return console.error("Erro ao fazer refresh do token:",r),a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500),Promise.reject(r)}else a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500)}return Promise.reject(t)});function E0(t){t&&(je.defaults.baseURL=t,Sn.defaults.baseURL=t)}const v0="v1/api/attendances/attendant/",C0="v1/api/attendances/department/",ha="v1/api/attendances/internal_chat/",S0="v1/api/instances/instance/",B0="v1/api/crm/event/scheduled_message/",V0="v1/api/crm/event/calendar",M0="v1/api/crm/products/",N0="v1/api/contacts/tag/",A0="/v1/api/contacts/segmentation_field/",T0="v1/api/attendances/calls/",pa=Vt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${S0}`;const a=await je.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}}}),D0={class:"w-full relative text-current"},L0={class:"flex cursor-pointer justify-between items-center"},F0={key:0},$0={key:0},P0={key:1,class:"flex items-center gap-2"},O0={class:"flex gap-3 items-center flex-shrink-0"},_0={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},R0={key:1,class:"relative"},H0={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"},z0={class:"my-auto text-center mx-auto group-hover:inline-block"},j0={key:1,class:"flex justify-center"},G0={class:"w-full"},I0={key:1,class:"flex items-center gap-2 justify-center"},q0={class:"flex px-4 items-center gap-2"},W0={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},U0={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"},Z0={class:"select-none cursor-pointer w-full"},Y0=["onClick","disabled"],X0={class:"flex w-full items-center pl-2 gap-3"},K0={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"},Q0={key:1,class:"relative"},J0={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},el={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"},tl={class:"w-full text-center"},nl={class:"my-auto text-center mx-auto group-hover:inline-block"},al={key:1,class:"flex justify-center"},ol={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},rl={key:1,class:"p-4"},nr={__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=pa(),o=e.ref(!1),r=e.ref(null),i=t,s=n;function l(c){r.value=c,s("function",c)}return e.watch(()=>i.modelValue,c=>{r.value=c},{immediate:!0}),e.watch(r,c=>{s("update:modelValue",c)}),e.onMounted(async()=>{if(r.value){const c=a.instances.find(m=>m.id===r.value.id);c&&(r.value.status=c.status)}s("component-mounted")}),(c,m)=>{const d=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",D0,[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",L0,[e.createElementVNode("p",{onClick:m[0]||(m[0]=h=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",F0,[r.value?(e.openBlock(),e.createElementBlock("span",P0,[e.createElementVNode("header",O0,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",_0,m[3]||(m[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",R0,[m[5]||(m[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",H0,m[4]||(m[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(d,{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",z0,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",j0,m[6]||(m[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",G0,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",$0,e.toDisplayString(e.unref(a).instances?e.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",I0,m[7]||(m[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...")])))]),e.createElementVNode("footer",q0,[e.createElementVNode("button",{onClick:m[1]||(m[1]=h=>(r.value=null,o.value=!1))},m[8]||(m[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:m[2]||(m[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"},m[9]||(m[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",W0,[e.createElementVNode("ul",U0,[e.unref(a).instances.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).instances,(h,f)=>{var p;return e.openBlock(),e.createElementBlock("li",Z0,[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:u=>(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",X0,[h.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",K0,m[10]||(m[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",Q0,[m[12]||(m[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",J0,m[11]||(m[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(d,{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 u;return[t.type&&h.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((u=h.config)==null?void 0:u.webhooks)?(e.openBlock(),e.createElementBlock("svg",el,m[13]||(m[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",tl,e.toDisplayString(h.name),1),e.createVNode(d,{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",nl,e.toDisplayString(h.status===!0?"Conectada":h.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[h.isLoading?(e.openBlock(),e.createElementBlock("div",al,m[14]||(m[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",ol,[h.telephone?(e.openBlock(),e.createBlock(d,{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(()=>[m[15]||(m[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,__:[15]},1024)):e.createCommentVNode("",!0)])],10,Y0)])}),256)):(e.openBlock(),e.createElementBlock("div",rl," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},il=["aria-labelledby","aria-describedby"],sl={class:"cpk-popover__header border-base-100"},ll=["id"],cl=["disabled"],dl=["id"],ul={class:"cpk-popover__details bg-base-200 border border-base-100"},ml={class:"cpk-popover__footer"},fl=["disabled"],hl=["disabled"],pl={key:0,class:"loading-spinner"},gl=ke({__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:E=>o("update:modelValue",E)}),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 c(){o("cancel",a.context),r.value=!1}function m(){a.loading||o("confirm",a.context)}let d,h,f=[];function p(){if(a.anchorRect)return a.anchorRect;const E=a.anchorEl instanceof Element?a.anchorEl:null;if(E)return E.getBoundingClientRect();const C=document.activeElement instanceof Element?document.activeElement:null;return C?C.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 u(){if(!r.value)return;const E=window.innerWidth,C=window.innerHeight,$=a.viewportPadding,R=p(),v=i.value?i.value.getBoundingClientRect():{width:320,height:200},b=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let T=b[0],S=0,B=0;const A=R.left+R.width/2-v.width/2,N=R.top+R.height/2-v.height/2,z=R.left,ae=R.left+R.width-v.width,J=R.top,ce=R.top+R.height-v.height;for(const O of b){if(O==="bottom"&&(B=R.bottom+a.offset,S=a.align==="start"?z:a.align==="end"?ae:A,B+v.height+$<=C)){T="bottom";break}if(O==="top"&&(B=R.top-v.height-a.offset,S=a.align==="start"?z:a.align==="end"?ae:A,B>=$)){T="top";break}if(O==="right"&&(S=R.right+a.offset,B=a.align==="start"?J:a.align==="end"?ce:N,S+v.width+$<=E)){T="right";break}if(O==="left"&&(S=R.left-v.width-a.offset,B=a.align==="start"?J:a.align==="end"?ce:N,S>=$)){T="left";break}}S=Math.min(Math.max($,S),E-v.width-$),B=Math.min(Math.max($,B),C-v.height-$),s.value={left:S,top:B,p:T}}function g(){k();let C=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;C&&C!==document.body;)f.push(C),C=C.parentElement;f.push(window),f.forEach($=>$.addEventListener("scroll",u,{passive:!0}))}function k(){f.forEach(E=>{var C;return(C=E.removeEventListener)==null?void 0:C.call(E,"scroll",u)}),f=[]}e.watch(()=>r.value,async E=>{var C;if(E){await e.nextTick(),u(),g(),d=new ResizeObserver(u),d.observe(document.body);const $=a.anchorEl instanceof Element?a.anchorEl:null;$&&((C=h==null?void 0:h.disconnect)==null||C.call(h),h=new ResizeObserver(u),h.observe($)),window.addEventListener("resize",u),window.addEventListener("keydown",w)}else x()}),e.watch(()=>a.anchorEl,async E=>{var $;if(!r.value)return;await e.nextTick(),k(),g(),($=h==null?void 0:h.disconnect)==null||$.call(h);const C=E instanceof Element?E:null;C&&(h=new ResizeObserver(u),h.observe(C)),u()}),e.watch(()=>a.anchorRect,()=>{r.value&&u()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&u()});function w(E){E.key==="Escape"&&c(),E.key==="Enter"&&m()}e.onMounted(()=>{window.addEventListener("mousemove",E=>{window.__lastMouseX=E.clientX,window.__lastMouseY=E.clientY},{passive:!0})}),e.onBeforeUnmount(x);function x(){k(),window.removeEventListener("resize",u),window.removeEventListener("keydown",w),d&&d.disconnect(),h&&h.disconnect()}const y=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(E,C)=>(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(c,["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(y.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[e.createElementVNode("div",sl,[C[0]||(C[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,ll),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:c,disabled:t.loading,"aria-label":"Fechar"}," × ",8,cl)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},e.toDisplayString(t.description),9,dl)):e.createCommentVNode("",!0),e.createElementVNode("div",ul,[e.renderSlot(E.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",ml,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:c,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,fl),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button","cyber-button--md",t.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:m,disabled:t.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",pl)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,hl)])],14,il)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-b23001fc"]]);function Ot(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function dt(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 ut(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],c=Array.isArray(l)?kl(l,h=>h.test(s)):yl(l,h=>h.test(s));let m;m=t.valueCallback?t.valueCallback(c):c,m=a.valueCallback?a.valueCallback(m):m;const d=n.slice(s.length);return{value:m,rest:d}}}function yl(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function kl(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function ar(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 or=6048e5,xl=864e5,rr=Symbol.for("constructDateFrom");function nt(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&rr in t?t[rr](n):t instanceof Date?new t.constructor(n):new Date(n)}function ga(t,...n){const a=nt.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let bl={};function Bn(){return bl}function ot(t,n){return nt(n||t,t)}function Tt(t,n){var l,c,m,d;const a=Bn(),o=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??a.weekStartsOn??((d=(m=a.locale)==null?void 0:m.options)==null?void 0:d.weekStartsOn)??0,r=ot(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 wl(t,n,a){const[o,r]=ga(a==null?void 0:a.in,t,n);return+Tt(o,a)==+Tt(r,a)}const El={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"}},vl=(t,n,a)=>{let o;const r=El[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},Cl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sl=(t,n,a,o)=>Cl[t],Bl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ml={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"]},Nl={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"]},Al={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"}},Tl={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"}},Dl={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:dt({values:Bl,defaultWidth:"wide"}),quarter:dt({values:Vl,defaultWidth:"wide",argumentCallback:t=>t-1}),month:dt({values:Ml,defaultWidth:"wide"}),day:dt({values:Nl,defaultWidth:"wide"}),dayPeriod:dt({values:Al,defaultWidth:"wide",formattingValues:Tl,defaultFormattingWidth:"wide"})},Ll=/^(\d+)(th|st|nd|rd)?/i,Fl=/\d+/i,$l={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},Pl={any:[/^b/i,/^(a|c)/i]},Ol={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_l={any:[/1/i,/2/i,/3/i,/4/i]},Rl={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},Hl={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]},zl={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},jl={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]},Gl={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},Il={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}},ql={ordinalNumber:ar({matchPattern:Ll,parsePattern:Fl,valueCallback:t=>parseInt(t,10)}),era:ut({matchPatterns:$l,defaultMatchWidth:"wide",parsePatterns:Pl,defaultParseWidth:"any"}),quarter:ut({matchPatterns:Ol,defaultMatchWidth:"wide",parsePatterns:_l,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ut({matchPatterns:Rl,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),day:ut({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:jl,defaultParseWidth:"any"}),dayPeriod:ut({matchPatterns:Gl,defaultMatchWidth:"any",parsePatterns:Il,defaultParseWidth:"any"})},Wl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ul={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Zl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yl={date:Ot({formats:Wl,defaultWidth:"full"}),time:Ot({formats:Ul,defaultWidth:"full"}),dateTime:Ot({formats:Zl,defaultWidth:"full"})},Xl={code:"en-US",formatDistance:vl,formatLong:Yl,formatRelative:Sl,localize:Dl,match:ql,options:{weekStartsOn:0,firstWeekContainsDate:1}},Kl={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"}},Ql=(t,n,a)=>{let o;const r=Kl[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},Jl={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},e2={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},t2={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},n2={date:Ot({formats:Jl,defaultWidth:"full"}),time:Ot({formats:e2,defaultWidth:"full"}),dateTime:Ot({formats:t2,defaultWidth:"full"})},a2={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"},o2=(t,n,a,o)=>{const r=a2[t];return typeof r=="function"?r(n):r},r2={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},i2={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},s2={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"]},l2={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"]},c2={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"}},d2={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"}},u2={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:dt({values:r2,defaultWidth:"wide"}),quarter:dt({values:i2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:dt({values:s2,defaultWidth:"wide"}),day:dt({values:l2,defaultWidth:"wide"}),dayPeriod:dt({values:c2,defaultWidth:"wide",formattingValues:d2,defaultFormattingWidth:"wide"})},m2=/^(\d+)[ºªo]?/i,f2=/\d+/i,h2={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},p2={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},g2={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},y2={any:[/1/i,/2/i,/3/i,/4/i]},k2={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},x2={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},w2={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]},E2={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},v2={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}},C2={ordinalNumber:ar({matchPattern:m2,parsePattern:f2,valueCallback:t=>parseInt(t,10)}),era:ut({matchPatterns:h2,defaultMatchWidth:"wide",parsePatterns:p2,defaultParseWidth:"any"}),quarter:ut({matchPatterns:g2,defaultMatchWidth:"wide",parsePatterns:y2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ut({matchPatterns:k2,defaultMatchWidth:"wide",parsePatterns:x2,defaultParseWidth:"any"}),day:ut({matchPatterns:b2,defaultMatchWidth:"wide",parsePatterns:w2,defaultParseWidth:"any"}),dayPeriod:ut({matchPatterns:E2,defaultMatchWidth:"any",parsePatterns:v2,defaultParseWidth:"any"})},ir={code:"pt-BR",formatDistance:Ql,formatLong:n2,formatRelative:o2,localize:u2,match:C2,options:{weekStartsOn:0,firstWeekContainsDate:1}},S2={scheduled_messages:"Mensagem programada"};function B2(t){return S2[t]||t||"Evento"}function ya(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function _t(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 en(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(m=>parseInt(m,10));let s=0,l=0;if(a){const[m,d]=a.split(":");s=parseInt(m||"0",10),l=parseInt(d||"0",10)}const c=new Date(o,(r||1)-1,i||1,s,l);return isNaN(c.getTime())?null:c}function V2(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 Vn(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 M2(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function ka(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=en(a.time)),!l&&(t!=null&&t.next_execution_at)&&(l=V2(t.next_execution_at)),!l)return null;const c=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,m=c&&(c.content||c.text)||"",d=(t==null?void 0:t.function)||(n==null?void 0:n.function)||"",h=B2(d),f=(m||"").trim();return{id:(t==null?void 0:t.id)||M2(),date:l,time:Vn(l),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:h,content:f,functionName:d||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 sr(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=ka(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function N2(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 je.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 lr={scheduled_messages:"#3b82f6"},cr=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function A2(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 T2(t={}){var s,l,c,m,d,h,f,p,u,g,k;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)||((c=(l=t==null?void 0:t.info)==null?void 0:l.department)==null?void 0:c.name)||((d=(m=t==null?void 0:t.info)==null?void 0:m.department)==null?void 0:d.id);if(a)return`dept:${a}`;const o=(t==null?void 0:t.instanceName)||((f=(h=t==null?void 0:t.info)==null?void 0:h.instance)==null?void 0:f.name)||((u=(p=t==null?void 0:t.info)==null?void 0:p.instance)==null?void 0:u.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)||((k=t==null?void 0:t.params)==null?void 0:k.chat_id);return i?`chat:${i}`:"misc"}function Mn(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(lr,n))return lr[n];const a=T2(t),o=A2(String(a))%cr.length;return cr[o]}const Rt=Vt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let t=`${v0}`;const n=await je.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)}}}),D2={class:"itemc-head"},L2={class:"minw0"},F2={class:"itemc-title"},$2={class:"itemc-sub"},P2={class:"flex items-center gap-1"},O2={class:"itemc-actions"},_2={class:"flex flex-col items-center"},R2={class:"time-badge"},H2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},z2={class:"sched-pop__card bg-base-300",role:"dialog"},j2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},G2={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"},I2=["disabled"],q2={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"},W2={key:1,class:"loading-spinner"},U2={class:"itemsb-head"},Z2=["src"],Y2={key:1,class:"avatar avatar--placeholder bg-base-100"},X2={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},K2={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},Q2={class:"itemsb-main"},J2={class:"itemsb-row"},ec={class:"itemsb-title truncate"},tc={class:"itemsb-time"},nc={class:"itemsb-sub"},ac={class:"items-attendant"},oc={class:"itemsb-content"},rc={key:0,class:"itemsb-actions"},ic=["disabled"],sc={key:0,class:"loading-spinner"},lc={class:"event-left"},cc={class:"event-line"},dc={class:"event-actions"},uc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},mc={class:"sched-pop__card bg-base-300",role:"dialog"},fc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},hc={class:"sched-pop__card bg-base-300",role:"dialog"},pc={class:"event-time"},gc={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},yc={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"},kc=["disabled"],xc={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"},xa=ke({__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=Rt(),o=t,r=e.computed(()=>(o.getEventColor||Mn)(o.ev)),i=e.computed(()=>{var m;return((m=o.ev)==null?void 0:m.type)==="scheduled_messages"}),s=e.computed(()=>a.attendants.find(m=>m.is_me)||{}),l=m=>{const d=a.attendants.find(h=>h.id===m);return d?d.id===s.value.id?"Você":d.name||"Desconhecido":"Desconhecido"},c=e.computed(()=>{var d,h;const m=[];return(d=o.ev)!=null&&d.contactName&&m.push(o.ev.contactName),m.push(((h=o.ev)==null?void 0:h.departmentName)||"sem depto"),m.join(" • ")});return(m,d)=>{var h,f,p,u,g,k;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",D2,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",L2,[e.createElementVNode("div",F2,e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("div",$2,[e.createElementVNode("span",P2,[d[9]||(d[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",O2,[e.createElementVNode("div",_2,[e.createElementVNode("div",R2,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",H2,[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",z2,[d[10]||(d[10]=e.createElementVNode("strong",null,"Status",-1)),d[11]||(d[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:d[0]||(d[0]=w=>m.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((f=t.ev)==null?void 0:f.status)===!0?(e.openBlock(),e.createElementBlock("svg",j2,d[12]||(d[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",G2,d[13]||(d[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:d[1]||(d[1]=w=>m.$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",q2,d[14]||(d[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",W2)):e.createCommentVNode("",!0)],8,I2)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:d[2]||(d[2]=w=>m.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},d[15]||(d[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",U2,[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,Z2)):(e.openBlock(),e.createElementBlock("div",Y2,d[16]||(d[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",X2,[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",K2,[d[17]||(d[17]=e.createElementVNode("strong",null,"Status",-1)),d[18]||(d[18]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])],4),e.createElementVNode("div",Q2,[e.createElementVNode("div",J2,[e.createElementVNode("span",ec,e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("span",tc,e.toDisplayString(t.ev.time),1)]),e.createElementVNode("div",nc,[e.createElementVNode("span",ac,[d[19]||(d[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",oc,e.toDisplayString(t.ev.content||t.ev.title),1),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rc,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:d[3]||(d[3]=w=>m.$emit("open-message",t.ev))},e.toDisplayString(((u=t.ev)==null?void 0:u.status)===!0?"Editar":"Visualizar"),1)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:d[4]||(d[4]=w=>m.$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",sc)):e.createCommentVNode("",!0),d[20]||(d[20]=e.createTextVNode(" Apagar "))],8,ic)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:d[5]||(d[5]=w=>m.$emit("open-chat",t.ev))}," Abrir conversa ")):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",lc,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",cc,e.toDisplayString(c.value),1)]),e.createElementVNode("footer",dc,[e.createElementVNode("div",uc,[d[23]||(d[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",mc,[d[21]||(d[21]=e.createElementVNode("strong",null,"Agendado por",-1)),d[22]||(d[22]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",fc,[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",hc,[d[24]||(d[24]=e.createElementVNode("strong",null,"Status",-1)),d[25]||(d[25]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",pc,e.toDisplayString(t.ev.time),1),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d[6]||(d[6]=w=>m.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((k=t.ev)==null?void 0:k.status)===!0?(e.openBlock(),e.createElementBlock("svg",gc,d[26]||(d[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",yc,d[27]||(d[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:d[7]||(d[7]=w=>m.$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",xc,d[28]||(d[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,kc)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:d[8]||(d[8]=w=>m.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},d[29]||(d[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-fb30306a"]]),yt=new Map,dr=Vt.defineStore("scheduled",{state:()=>({baseUrl:V0,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=_t(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if(yt.has(n))return yt.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 je.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)||[],c=sr(l||[]);this._setMonth(t,c),this.loadedYM.add(t);let m=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);m&&(async()=>{var d,h;try{let f=m;for(;f;){const p=await je.get(f),u=Array.isArray(p==null?void 0:p.data)?p.data:((d=p==null?void 0:p.data)==null?void 0:d.results)||[],g=sr(u||[]);this._appendMonth(t,g),f=this.coerceHttps(((h=p==null?void 0:p.data)==null?void 0:h.next)||null)}}catch(f){console.warn("[scheduled] background paging error:",(f==null?void 0:f.message)||f)}})()}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{yt.delete(n),this.loadingYM.delete(t)}})();return yt.set(n,a),a},async forceReload(t){t||(t=_t(new Date));const n=`${this.baseUrl}|${t}`;yt.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 c;const s=((c=i==null?void 0:i.raw)==null?void 0:c.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 f,p,u,g,k,w,x,y,E,C,$,R,v;let a=null;if((f=n==null?void 0:n.schedule)!=null&&f.time){const b=n.schedule.time,T=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(b);if(T){const[,S,B,A,N="00",z="00"]=T;a=new Date(Number(S),Number(B)-1,Number(A),Number(N),Number(z),0,0)}else{const S=typeof b=="string"&&!b.includes("T")?b.replace(" ","T"):b;a=new Date(S)}}console.log(n);const o=b=>{var T,S,B,A;return a instanceof Date&&!isNaN(a)&&(b.date=a,b.time=Vn(a)),((S=(T=n==null?void 0:n.message)==null?void 0:T[0])==null?void 0:S.content)!=null&&(b.content=n.message[0].content),b.raw=b.raw||{id:t},b.raw.params=b.raw.params||{},n!=null&&n.schedule&&(b.raw.params.schedule={...b.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(b.raw.params.scheduled_by=n.scheduled_by),n.department&&(b.raw.params.department=n.department),n!=null&&n.message&&(b.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(b.chatId=n.chat_id??b.chatId??""),n!=null&&n.entity&&(b.raw.params.entity={...b.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(b.contactName=n.entity.name??b.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(b.contactPhoto=n.entity.photo??b.contactPhoto??null,n.entity.photo&&(b.photo=n.entity.photo))),n!=null&&n.info&&(b.raw.params.info={...b.raw.params.info||{},...n.info},(B=n.info)!=null&&B.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(b.departmentName=n.info.department.name??b.departmentName),(A=n.info)!=null&&A.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(b.instanceName=n.info.instance.name??b.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(b.instanceStatus=n.info.instance.last_instance_status??b.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?b.title=n.title??b.title??"Mensagem programada":b.title=b.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(b.function=n.function??b.function??"scheduled_messages",b.type=n.function??b.type??"scheduled_messages"):(b.function=b.function||"scheduled_messages",b.type=b.type||"scheduled_messages"),b},r=this.findEventById(t);if(!r){const b=a instanceof Date&&!isNaN(a)?a:(()=>{var z;const A=(z=n==null?void 0:n.schedule)==null?void 0:z.time,N=typeof A=="string"&&!A.includes("T")?A.replace(" ","T"):A;return(en==null?void 0:en(N))||(N?new Date(N):new Date)})(),T=o({id:t,date:b,time:Vn(b),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:((u=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:u.content)??"",raw:{id:t,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((k=n==null?void 0:n.entity)==null?void 0:k.photo)??null,departmentName:((x=(w=n==null?void 0:n.info)==null?void 0:w.department)==null?void 0:x.name)??null,departmentId:((E=(y=n==null?void 0:n.info)==null?void 0:y.department)==null?void 0:E.id)??null,instanceName:(($=(C=n==null?void 0:n.info)==null?void 0:C.instance)==null?void 0:$.name)??null,instanceStatus:((v=(R=n==null?void 0:n.info)==null?void 0:R.instance)==null?void 0:v.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),S=_t(T.date),B=this.monthCache[S]?[...this.monthCache[S],T]:[T];B.sort((A,N)=>A.date-N.date),this._setMonth(S,B);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],c={...l[s]},m=o({...c}),d=m.date instanceof Date?m.date:c.date,h=_t(d);if(h===i){const b=[...l];b.splice(s,1,m),b.sort((T,S)=>T.date-S.date),this._setMonth(i,b)}else{const b=l.slice(0,s).concat(l.slice(s+1)),T=this.monthCache[h]?[...this.monthCache[h],m]:[m];T.sort((S,B)=>S.date-B.date),this.monthCache={...this.monthCache,[i]:b,[h]:T}}},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:en(t.date)||new Date,o=_t(a),r={...t,id:n,date:a,time:t.time??Vn(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var c;return String(((c=l==null?void 0:l.raw)==null?void 0:c.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,c)=>l.date-c.date),this._setMonth(o,i)},insertFromApiItem(t){const n=ka(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=ka(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=yt.clear)==null||t.call(yt)}}}),wc={class:"cpk-header bg-base-200"},Ec={class:"left"},vc=["title"],Cc={class:"right"},Sc=["title"],Bc={class:"toggle"},Vc=["aria-pressed","title"],Mc={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Nc={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Ac=ke({__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",wc,[e.createElementVNode("div",Ec,[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,vc),e.createElementVNode("div",Cc,[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,Sc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bc,[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",Nc,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",Mc,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,Vc)])]))}},[["__scopeId","data-v-e367c35d"]]),Tc=["title"],Dc={class:"week-header"},Lc=ke({__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,Tc),e.createElementVNode("div",Dc,[(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-a59e7945"]]),Fc=["onClick"],$c={key:0,class:"cell-today-indicator show-lg"},Pc={class:"cell-top"},Oc={class:"day-number"},_c={key:1,class:"more"},Rc={class:"bars-wrap"},Hc=4,zc=8,ur=4,mr=2,jc=1,Gc=ke({__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(u){const g=(u==null?void 0:u.clientWidth)||0,k=(u==null?void 0:u.clientHeight)||0;if(!g||!k)return{cols:0,rows:0,widths:[],sum:0};const w=Math.max(0,Math.floor((g+ur)/(Hc+ur))),x=Math.max(0,Math.floor((k+mr)/(zc+mr))),y=l(w,x),E=y.reduce((C,$)=>C+$,0);return{cols:w,rows:x,widths:y,sum:E}}function i(u,g){const k=r(g),w=a.value[u];(!w||w.cols!==k.cols||w.rows!==k.rows||w.sum!==k.sum)&&(a.value={...a.value,[u]:k})}function s(u,g){if(!g){const w=o.get(u);if(w&&(w.disconnect(),o.delete(u)),a.value[u]!=null){const x={...a.value};delete x[u],a.value=x}return}i(u,g);const k=new ResizeObserver(()=>i(u,g));k.observe(g),o.set(u,k)}e.onBeforeUnmount(()=>{o.forEach(u=>u.disconnect()),o.clear()});function l(u,g){if(u<=0||g<=0)return[];const k=[],w=.25;for(let x=0;x<g;x++){const y=x/Math.max(1,g-1),E=w+(1-w)*y,C=Math.max(1,Math.round(u*E));k.push(Math.min(C,u))}return k}function c(u,g){var E;const k=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,w=((E=a.value[u])==null?void 0:E.sum)??0;if(k<=w)return{bars:k,overflow:0};const x=Math.max(0,w-jc),y=Math.max(0,k-x);return{bars:x,overflow:y}}function m(u,g){const k=a.value[u];if(!k||k.rows===0||k.cols===0)return[];const{widths:w}=k,y=c(u,g).bars,E=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,y):[])||[],C=w.map(()=>[]);let $=0;for(let R=w.length-1;R>=0&&$<E.length;R--){const v=Math.min(w[R],E.length-$);C[R]=E.slice($,$+v),$+=v}return C}const d=e.ref(null);function h(u){return u&&u.nodeType===1&&typeof u.getBoundingClientRect=="function"}function f(u){if(!h(u))return;const g=d.value,k=g&&h(g)?g:u.offsetParent;if(!h(k))return;let w,x;try{w=u.getBoundingClientRect(),x=k.getBoundingClientRect()}catch{return}const y=k.scrollLeft||0,E=k.scrollTop||0;u.style.position="absolute",u.style.zIndex="0",u.style.top=`${w.top-x.top+E}px`,u.style.left=`${w.left-x.left+y}px`,u.style.width=`${w.width}px`,u.style.height=`${w.height}px`,u.style.pointerEvents="none"}function p(u){!u||!u.style||requestAnimationFrame(()=>{!u||!u.style||(u.style.position="",u.style.zIndex="",u.style.top="",u.style.left="",u.style.width="",u.style.height="",u.style.pointerEvents="")})}return(u,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:d,onBeforeLeave:f,onAfterLeave:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.startOffset,k=>(e.openBlock(),e.createElementBlock("div",{key:"x"+k,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,(k,w)=>(e.openBlock(),e.createElementBlock("div",{key:k.key,style:e.normalizeStyle({"--i":w}),class:e.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[t.isSameMonthFn(k.date,t.viewDate)?"":"opacity-60",t.isSelectedDayFn(k.date)?"neon-selected":"",t.isTodayFn(k.date)?"is-today":"",t.dayEventCountFn(k.date)>0?"has-events":""]]),onClick:x=>t.selectDayFn(k.date)},[t.isTodayFn(k.date)?(e.openBlock(),e.createElementBlock("div",$c," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",Pc,[e.createElementVNode("span",Oc,e.toDisplayString(k.date.getDate()),1)]),c(k.key,k.date).overflow>0?(e.openBlock(),e.createElementBlock("span",_c," +"+e.toDisplayString(c(k.key,k.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:x=>s(k.key,x)},[c(k.key,k.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m(k.key,k.date),(x,y)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+y,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x,(E,C)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+y+"-"+C,class:"vbar",style:e.normalizeStyle({background:e.unref(Mn)(E),boxShadow:`0 0 8px ${e.unref(Mn)(E)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,Fc))),128))]),_:1},512))}},[["__scopeId","data-v-82c146bb"]]),Ic={class:"agenda-section"},qc={key:0,class:"empty-state"},Wc={key:1,class:"day-list"},Uc={class:"date-trail"},Zc={class:"weekday-short"},Yc={class:"date-pill bg-base-200 border border-base-300"},Xc={class:"date-pill-month"},Kc={class:"date-pill-day"},Qc={class:"content-col"},Jc={class:"day-header"},ed={class:"agenda-title"},td={class:"month-header-text"},nd={class:"events-list"},ad=ke({__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",Ic,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",qc," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",Wc,[(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",Uc,[e.createElementVNode("div",Zc,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",Yc,[e.createElementVNode("div",Xc,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",Kc,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(Mn)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",Qc,[e.createElementVNode("div",Jc,[e.createElementVNode("h3",ed,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",td,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",nd,[(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(xa,{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-d901943e"]]),od=["data-mode","data-empty"],rd=["disabled"],fr=ke({__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,rd)],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,__:[4]})):(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(xa,{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,od))}},[["__scopeId","data-v-0c2dc086"]]),id={class:"cpk-popover__header border-base-100"},sd={class:"filter-body"},ld={class:"row"},cd=["checked"],dd={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},ud={class:"status-wrap"},md={class:"seg"},fd=ke({__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=Rt(),i=e.computed(()=>r.attendants.find(v=>v.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async v=>{var S,B,A;if(!v)return;await e.nextTick();const b=(S=i.value)!=null&&S.id?String(i.value.id):null;s.onlyMine=!!b&&String(((B=a.filters)==null?void 0:B.scheduled_by)??"")===b;const T=(A=a.filters)==null?void 0:A.status;s.status=T===!0||T===!1?T:null,k()},{immediate:!1});function l(v,b){if(!v)return{};const{[b]:T,...S}=v;return S}function c(v){var T;s.onlyMine=!!v.target.checked;const b=(T=i.value)!=null&&T.id?String(i.value.id):null;s.onlyMine&&b?o("update:filters",{...a.filters,scheduled_by:b}):o("update:filters",l(a.filters,"scheduled_by"))}function m(v){if(s.status===v){s.status=null;const b=l(a.filters,"status");o("update:filters",b)}else s.status=v,o("update:filters",{...a.filters,status:v})}const d=e.ref(null),h=e.ref({left:0,top:0,placed:"bottom"}),f=e.computed(()=>({position:"fixed",left:`${h.value.left}px`,top:`${h.value.top}px`}));function p(){const v=a.anchorEl instanceof Element?a.anchorEl:null;if(v!=null&&v.getBoundingClientRect)return v.getBoundingClientRect();const b=window.innerWidth/2,T=window.innerHeight/3;return{left:b,right:b,top:T,bottom:T,width:0,height:0}}function u(v,b,T,S){return{left:Math.max(8,Math.min(v,window.innerWidth-T-8)),top:Math.max(8,Math.min(b,window.innerHeight-S-8))}}function g(){const v=p(),b=d.value,T=(b==null?void 0:b.offsetWidth)??300,S=(b==null?void 0:b.offsetHeight)??220;let B=v.bottom+a.offset,A;if(a.align==="center"?A=v.left+v.width/2-T/2:a.align==="end"?A=v.right-T:A=v.left,B+S>window.innerHeight-4){const z=v.top-S-a.offset;z>=4?(B=z,h.value.placed="top"):h.value.placed="bottom"}else h.value.placed="bottom";const N=u(A,B,T,S);h.value={left:N.left,top:N.top,placed:h.value.placed}}function k(){g(),requestAnimationFrame(g)}let w,x,y=[];function E(){C(),y=[window];const v=a.anchorEl instanceof Element?a.anchorEl:null;let b=v==null?void 0:v.parentElement;for(;b&&b!==document.body;){const T=getComputedStyle(b);/(auto|scroll)/.test(T.overflow+T.overflowY+T.overflowX)&&y.push(b),b=b.parentElement}y.forEach(T=>T.addEventListener("scroll",k,{passive:!0}))}function C(){y.forEach(v=>{var b;return(b=v.removeEventListener)==null?void 0:b.call(v,"scroll",k)}),y=[]}e.watch(()=>a.open,async v=>{var T,S,B,A;if(!v){C(),(T=w==null?void 0:w.disconnect)==null||T.call(w),(S=x==null?void 0:x.disconnect)==null||S.call(x);return}await e.nextTick(),k(),E(),(B=w==null?void 0:w.disconnect)==null||B.call(w),w=new ResizeObserver(k),w.observe(document.body),(A=x==null?void 0:x.disconnect)==null||A.call(x);const b=a.anchorEl instanceof Element?a.anchorEl:null;b&&(x=new ResizeObserver(k),x.observe(b)),window.addEventListener("resize",k)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),E(),k())});function $(v){v.key==="Escape"&&o("close")}function R(v){if(!a.open)return;const b=v.target,T=d.value;if(T&&T.contains(b))return;const S=a.anchorEl instanceof Element?a.anchorEl:null;S&&S.contains&&S.contains(b)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",R,!0),window.addEventListener("keydown",$)}),e.onBeforeUnmount(()=>{var v,b;document.removeEventListener("pointerdown",R,!0),window.removeEventListener("keydown",$),C(),(v=w==null?void 0:w.disconnect)==null||v.call(w),(b=x==null?void 0:x.disconnect)==null||b.call(x)}),(v,b)=>(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:b[4]||(b[4]=e.withModifiers(T=>v.$emit("close"),["self"]))},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:d,class:"cpk-popover bg-base-300",style:e.normalizeStyle(f.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",id,[b[5]||(b[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),b[6]||(b[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:b[0]||(b[0]=T=>v.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",sd,[e.createElementVNode("label",ld,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:b[1]||(b[1]=T=>c(T)),"aria-label":"Exibir somente meus eventos"},null,40,cd),b[7]||(b[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",dd,[b[9]||(b[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",ud,[b[8]||(b[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",md,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:b[2]||(b[2]=T=>m(!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:b[3]||(b[3]=T=>m(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-cc8bb01a"]]),hd={class:"calendar-content"},pd={key:0},Nn=80,hr=ke({__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=dr();r.setBaseUrl(o.sourceUrl);const i=new Date,s=e.ref($(o.initialDate)),l=e.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),c=e.ref("calendar"),m=e.ref(!1),d=e.ref(0),h=e.ref(0),f=e.computed(()=>m.value?{transform:`translateX(${h.value}px)`}:{});function p(){m.value=!1,d.value=0,h.value=0}function u(D){var V,H;if(!(D.pointerType==="mouse"&&D.button!==0)){m.value=!0,d.value=D.clientX;try{(H=(V=D.target).setPointerCapture)==null||H.call(V,D.pointerId)}catch{}}}function g(D){m.value&&(h.value=D.clientX-d.value)}function k(D){var H,K;if(!m.value)return;const V=h.value;try{(K=(H=D.target).releasePointerCapture)==null||K.call(H,D.pointerId)}catch{}p(),V<-Nn?N():V>Nn&&A()}function w(D){var V,H;try{(H=(V=D.target).releasePointerCapture)==null||H.call(V,D.pointerId)}catch{}p()}function x(D){const V=D.touches&&D.touches[0];V&&(m.value=!0,d.value=V.clientX,h.value=0)}function y(D){if(!m.value)return;const V=D.touches&&D.touches[0];V&&(h.value=V.clientX-d.value)}function E(D){if(!m.value)return;const V=h.value;p(),V<-Nn?N():V>Nn&&A()}function C(D){p()}function $(D){if(D instanceof Date)return new Date(D.getFullYear(),D.getMonth(),1);if(typeof D=="string"){const[V,H]=D.split("-").map(K=>parseInt(K,10));return new Date(V||i.getFullYear(),(H||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function R(D){return new Date(D.getFullYear(),D.getMonth()+1,0).getDate()}function v(D){return new Date(D.getFullYear(),D.getMonth(),1).getDay()}function b(D,V){return D.getFullYear()===V.getFullYear()&&D.getMonth()===V.getMonth()}function T(D){return ya(D,i)}function S(D){return ya(D,l.value)}function B(D){l.value=new Date(D.getFullYear(),D.getMonth(),D.getDate()),b(D,s.value)||(s.value=new Date(D.getFullYear(),D.getMonth(),1))}function A(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function N(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function z(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const ae=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],J=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],ce=e.computed(()=>$e(ae[s.value.getMonth()])),O=e.computed(()=>s.value.getFullYear()),P=e.computed(()=>oe(l.value)),G=e.computed(()=>`${se(l.value)} ${l.value.getDate()}`);function oe(D){return`${String(D.getDate()).padStart(2,"0")}/${String(D.getMonth()+1).padStart(2,"0")}/${D.getFullYear()}`}function se(D){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][D.getDay()]}function ye(D){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][D.getDay()]}function Se(D){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][D.getMonth()]}function Fe(D){return ae[D.getMonth()]}function $e(D){return D.charAt(0).toUpperCase()+D.slice(1)}const Ne=e.computed(()=>v(s.value)),I=e.computed(()=>{const D=R(s.value);return Array.from({length:D},(V,H)=>{const K=H+1,ie=new Date(s.value.getFullYear(),s.value.getMonth(),K);return{key:`d${K}`,date:ie}})}),ee=e.ref({open:!1,anchorEl:null});function Q(D){ee.value.open=!0,ee.value.anchorEl=(D==null?void 0:D.currentTarget)||null}const{filters:M}=Vt.storeToRefs(r),F=e.computed(()=>_t(s.value)),Z=e.computed(()=>r.eventsOf(F.value)),j={scheduled_by:D=>{var K,ie,le;const V=(D==null?void 0:D.scheduled_by)??((ie=(K=D==null?void 0:D.raw)==null?void 0:K.params)==null?void 0:ie.scheduled_by)??((le=D==null?void 0:D.raw)==null?void 0:le.scheduled_by)??(D==null?void 0:D.created_by)??(D==null?void 0:D.attendant_id),H=typeof V=="object"&&V?V.id??V.attendant_id:V;return H!=null?String(H):""}};function X(D,V){const H=(V==null?void 0:V.value)??V;return!H||typeof H!="object"?!0:Object.entries(H).every(([K,ie])=>{var Me,_e,Ye;if(ie==null||ie===""||Array.isArray(ie)&&ie.length===0)return!0;const le=j[K],we=(le==null?void 0:le(D))??(D==null?void 0:D[K])??((Me=D==null?void 0:D.raw)==null?void 0:Me[K])??((Ye=(_e=D==null?void 0:D.raw)==null?void 0:_e.params)==null?void 0:Ye[K])??null,Ee=typeof we=="string"?we:we??"";if(typeof ie=="function")return!!ie(Ee,D);if(Array.isArray(ie))return ie.map(String).includes(String(Ee));if(typeof ie=="object"){const{in:Je,notIn:ze,range:Oe,contains:at}=ie;if(Je&&!Je.map(String).includes(String(Ee))||ze&&ze.map(String).includes(String(Ee)))return!1;if(Oe&&typeof Ee=="number"){const[Qn,ro]=Oe;if(Qn!=null&&Ee<Qn||ro!=null&&Ee>ro)return!1}if(at!=null){const Qn=Array.isArray(Ee)?Ee:String(Ee).split(",");if(!(Array.isArray(at)?at:[at]).some(ob=>Qn.map(String).includes(String(ob))))return!1}return!0}return String(Ee)===String(ie)})}const W=e.computed(()=>(Z.value||[]).filter(V=>X(V,M)));function re(D){return W.value.filter(V=>ya(V.date,D))}const de=e.computed(()=>re(l.value)),ge=e.computed(()=>[...de.value].sort((D,V)=>D.date-V.date));function fe(D){return re(D).length}function he(D){return Math.min(3,fe(D))}function pe(D){const V=fe(D);return V>3?V-3:0}const ve=e.computed(()=>{const D=s.value.getFullYear(),V=s.value.getMonth(),H=new Map;for(const ie of W.value){const le=ie==null?void 0:ie.date;if(!(le instanceof Date)||le.getFullYear()!==D||le.getMonth()!==V)continue;const we=`${D}-${V+1}-${le.getDate()}`;H.has(we)||H.set(we,{key:`ag-${we}`,date:new Date(D,V,le.getDate()),events:[]}),H.get(we).events.push(ie)}const K=Array.from(H.values());for(const ie of K)ie.events.sort((le,we)=>le.date-we.date);return K.sort((ie,le)=>ie.date-le.date),K}),Ve=e.ref(!1),Be=e.ref(!1),xe=e.computed(()=>Be.value||Ve.value),Te=e.computed(()=>xe?"calendar-stage--compact":"calendar-stage--single");function be(){var H;const D=window.matchMedia("(max-width: 1280px)"),V=()=>Be.value=D.matches;V(),(H=D.addEventListener)==null||H.call(D,"change",V)}const L=e.computed(()=>r.isLoading(F.value));e.computed(()=>r.errorOf(F.value));const _=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 q(D,V){_.value.open=!0,_.value.context={action:"delete-message",event:D},_.value.title="Confirmar exclusão",_.value.description="Tem certeza que deseja apagar este evento?",_.value.anchorEl=V&&V.currentTarget||typeof document<"u"&&document.activeElement||null,_.value.destructive=!0,_.value.confirmLabel="Apagar",_.value.loadingLabel="Apagando…"}async function Y(D){if(D)try{_.value.loading=!0,D.action==="delete-message"&&await ne(D.event)}finally{_.value.loading=!1,_.value.open=!1,_.value.context=null}}function me(){_.value.open=!1,_.value.context=null}async function te(){await r.forceReload(F.value)}async function ne(D){var V;try{D.deleteLoading=!0;const H=((V=D==null?void 0:D.raw)==null?void 0:V.id)??(D==null?void 0:D.id)??D;if(H==null)throw new Error("Evento inválido para exclusão");const K=await N2(B0,D);return K!=null&&K.ok&&(r.removeFromCache(String(H))||await r.forceReload(F.value)),K}catch(H){return console.error(H),null}finally{D.deleteLoading=!1}}return e.onMounted(async()=>{if(be(),await r.ensureMonthLoaded(F.value),!re(l.value).length&&W.value.length){const D=W.value[0];l.value=new Date(D.date.getFullYear(),D.date.getMonth(),D.date.getDate())}}),e.watch(()=>o.sourceUrl,async D=>{if(r.setBaseUrl(D),r.resetAll(),await r.ensureMonthLoaded(F.value),!re(l.value).length&&W.value.length){const V=W.value[0];l.value=new Date(V.date.getFullYear(),V.date.getMonth(),V.date.getDate())}}),e.watch(F,async()=>{const D=s.value.getFullYear(),V=s.value.getMonth(),H=Math.min(l.value.getDate(),R(s.value));if(l.value=new Date(D,V,H),await r.ensureMonthLoaded(F.value),!re(l.value).length&&W.value.length){const K=W.value[0];l.value=new Date(K.date.getFullYear(),K.date.getMonth(),K.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(D,V)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":xe.value}])},[e.createElementVNode("div",hd,[V[15]||(V[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(Ac,{month:ce.value,year:O.value,"is-compact":xe.value,"view-mode":c.value,"filter-count":Object.keys(e.unref(M)).length,onPrev:A,onNext:N,onToday:z,onToggleCompact:V[0]||(V[0]=H=>Ve.value=!Ve.value),onSetViewMode:V[1]||(V[1]=H=>c.value=H),onClosePage:V[2]||(V[2]=H=>D.$emit("close-page")),onOpenFilter:Q},null,8,["month","year","is-compact","view-mode","filter-count"]),c.value==="calendar"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["calendar-stage",Te.value])},[e.createElementVNode("div",{class:"calendar-stage-main",onPointerdown:u,onPointermove:g,onPointerup:k,onPointercancel:w,onTouchstart:x,onTouchmove:y,onTouchend:E,onTouchcancel:C,style:e.normalizeStyle(f.value)},[e.createVNode(Lc,{"week-days":J,month:ce.value,year:O.value},null,8,["month","year"]),e.createVNode(Gc,{"start-offset":Ne.value,"month-days":I.value,"view-date":s.value,"is-compact":xe.value,"is-same-month-fn":b,"is-selected-day-fn":S,"is-today-fn":T,"select-day-fn":B,"events-by-day-fn":re,"day-event-count-fn":fe,"event-bars-to-show-fn":he,"day-event-overflow-fn":pe},null,8,["start-offset","month-days","view-date","is-compact"])],36),xe.value?(e.openBlock(),e.createBlock(fr,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:L.value,"selected-label-long":G.value,events:ge.value,mode:"compact",onReload:te,onOpenChat:V[3]||(V[3]=H=>D.$emit("open-chat",H)),onOpenMessage:V[4]||(V[4]=H=>D.$emit("open-message",H)),onDeleteMessage:V[5]||(V[5]=(H,K)=>q(H,K))},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(ad,{key:1,days:ve.value,"weekday-long":se,"weekday-short":ye,"month-short":Se,"month-label-of":Fe,year:O.value,onOpenChat:V[6]||(V[6]=H=>D.$emit("open-chat",H)),onOpenMessage:V[7]||(V[7]=H=>D.$emit("open-message",H)),onDeleteMessage:V[8]||(V[8]=(H,K)=>q(H,K))},null,8,["days","year"]))]),e.createVNode(fr,{class:"calendar-daylist calendar-daylist--desktop",loading:L.value,"selected-label":P.value,"selected-label-long":G.value,events:ge.value,mode:xe.value?"compact":"sidebar",onReload:te,onOpenChat:V[9]||(V[9]=H=>D.$emit("open-chat",H)),onOpenMessage:V[10]||(V[10]=H=>D.$emit("open-message",H)),onDeleteMessage:V[11]||(V[11]=(H,K)=>q(H,K))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(gl,{modelValue:_.value.open,"onUpdate:modelValue":V[12]||(V[12]=H=>_.value.open=H),title:_.value.title,description:_.value.description,destructive:_.value.destructive,"confirm-label":_.value.confirmLabel,"cancel-label":_.value.cancelLabel,loading:_.value.loading,"loading-label":_.value.loadingLabel,context:_.value.context,"anchor-el":_.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:Y,onCancel:me},{details:e.withCtx(()=>{var H;return[(H=_.value.context)!=null&&H.event?(e.openBlock(),e.createElementBlock("div",pd,[e.createVNode(xa,{"view-only":!0,mode:"sidebar",ev:_.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(fd,{open:ee.value.open,"anchor-el":ee.value.anchorEl,filters:e.unref(M),"onUpdate:filters":V[13]||(V[13]=H=>e.isRef(M)?M.value=H:null),onClose:V[14]||(V[14]=H=>ee.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-38d56cd8"]]),gd={class:"flex flex-col text-center"},yd={class:"flex flex-col space-y-3 justify-center"},kd={class:"space-x-4 flex-col text-black justify-center"},xd=["onUpdate:modelValue","onInput","onKeydown"],pr={__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=m=>{const d=o.value[m];o.value[0]<1&&a("reset"),/^\d$/.test(d)?s(m):o.value[m]="",m===o.value.length-1&&o.value.every(h=>h!=="")&&c()},s=m=>{m<o.value.length-1&&o.value[m]&&r.value[m+1].focus()},l=(m,d)=>{d.key==="Backspace"&&!o.value[m]&&m>0&&r.value[m-1].focus()},c=()=>{const m=o.value.join("");a("filled",m)};return(m,d)=>(e.openBlock(),e.createElementBlock("section",gd,[e.createElementVNode("div",yd,[e.createElementVNode("div",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(h,f)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:f,"onUpdate:modelValue":p=>o.value[f]=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(f),onKeydown:e.withKeys(p=>l(f,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,xd)),[[e.vModelText,o.value[f]]])),128))])])]))}},bd={class:"text-center flex gap-3"},wd={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},Ed={key:0,class:"items-center justify-center inline-flex"},vd=["src"],Cd={__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(c,m)=>(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("section",wd,[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",Ed,m[0]||(m[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,vd)])]))}};for(var We=[],ba=0;ba<256;++ba)We.push((ba+256).toString(16).slice(1));function Sd(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 An,Bd=new Uint8Array(16);function Vd(){if(!An&&(An=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!An))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return An(Bd)}var Md=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const gr={randomUUID:Md};function Nd(t,n,a){if(gr.randomUUID&&!t)return gr.randomUUID();t=t||{};var o=t.random||(t.rng||Vd)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Sd(o)}function yr(){const t=Rt(),n=async l=>{const c=t.attendants.find(m=>m.id===l);if(c)try{const m=await je.get(`${ha}?attendant=${l}&page=1`);c.messages=m.data.results.reverse(),c.hasNextPage=m.data.next!==null,c.currentPage=2,c.internal_chat={channel_id:m.data.channel_id,unread:0}}catch(m){console.error("Erro ao buscar mensagens:",m)}},a=async l=>{const c=t.attendants.find(m=>m.id===l);if(!(!c||!c.hasNextPage))try{const m=await je.get(`${ha}?attendant=${l}&page=${c.currentPage}`);c.messages=[...m.data.results.reverse(),...c.messages],c.hasNextPage=m.data.next!==null,c.currentPage++}catch(m){console.error("Erro ao carregar mais mensagens:",m)}},o=(l,c,m)=>{const d=l==null?void 0:l.message;if(!d)return;const h=t.attendants.find(f=>{var p;return((p=f.internal_chat)==null?void 0:p.channel_id)===d.channel_id});h?(h.messages=h.messages||[],h.messages.find(p=>p.id===d.id)||(h.messages.push(d),(!c||h.id!==m)&&(h.internal_chat.unread=(h.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const c=t.attendants.find(m=>m.id===l);c&&(c.internal_chat.unread=0)},i=async(l,c,m,d=!1)=>{var u;const h=t.attendants.find(g=>g.id===l);if(!h||!((u=h.internal_chat)!=null&&u.channel_id))return;let f;d?f=c:f={type:"text",content:c};const p={id:Nd(),content:f,created_at:new Date().toISOString(),sender:m};h.messages.push(p);try{await je.post(`${ha}${h.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const c=t.attendants.find(m=>m.id===l);return c?c.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 Ad={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},Td={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"},Dd=["src"],wa=ke({__name:"Avatar",props:{url:{type:String}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",Ad,[t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,Dd)):(e.openBlock(),e.createElementBlock("svg",Td,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-1d00f344"]]),Ld={class:"attendants-container"},Fd={class:"atendentes-list bg-base-300"},$d={key:0,class:"empty-message bg-base-200"},Pd=["onClick"],Od={class:"atendente-main"},_d={class:"atendente-name"},Rd={class:"flex items-center gap-4"},Hd={key:0,class:"message-indicator"},zd={key:0,class:"chat-footer bg-base-200"},kr=ke({__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=c=>{o("atendenteSelecionado",c)},s=c=>{switch(c){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(c=>c.name.toLowerCase().includes(r.value.toLowerCase())&&c.id!==a.attendant.id):a.atendentes.filter(c=>c.id!==a.attendant.id));return(c,m)=>(e.openBlock(),e.createElementBlock("div",Ld,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=d=>r.value=d),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",Fd,[l.value.length===0?(e.openBlock(),e.createElementBlock("li",$d,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,d=>(e.openBlock(),e.createElementBlock("li",{key:d.id,onClick:h=>i(d),class:e.normalizeClass([["atendente-item",d.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[e.createElementVNode("main",Od,[e.createVNode(wa,{url:d.photo},null,8,["url"]),e.createElementVNode("span",_d,e.toDisplayString(d.name),1)]),e.createElementVNode("footer",Rd,[d.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",Hd,e.toDisplayString(d.internal_chat.unread),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["status-indicator",s(d.login_status)])},null,2)]),m[1]||(m[1]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,Pd))),128))]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",zd))]))}},[["__scopeId","data-v-9be33af9"]]);function jd(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 Gd(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function Id(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 xr(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const br=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},qd={},Wd=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),Ud={class:"container"},Zd=Wd(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),Yd=[Zd];function Xd(t,n){return e.openBlock(),e.createElementBlock("div",Ud,Yd)}const Kd=br(qd,[["render",Xd],["__scopeId","data-v-d3e37633"]]),Qd={class:"state-error"},Ht=br(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:c,distance:m}=a,{identifier:d,target:h}=e.toRefs(a),f={infiniteLoading:i,top:l,firstload:c,distance:m,parentEl:null,emit(){r=(f.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await xr(f,r),jd(i.value,f.parentEl)&&f.emit()},async complete(){s.value="complete",await xr(f,r),o==null||o.disconnect()},error(){s.value="error"}};function u(){o==null||o.disconnect(),o=Id(f)}return e.watch(d,u),e.onMounted(async()=>{f.parentEl=await Gd(h),u()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,k)=>(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(Kd)],!0)],512),[[e.vShow,s.value=="loading"]]),s.value=="complete"?e.renderSlot(g.$slots,"complete",{key:0},()=>{var w;return[e.createElementVNode("span",null,e.toDisplayString(((w=g.slots)==null?void 0:w.complete)||"No more results!"),1)]},!0):e.createCommentVNode("",!0),s.value=="error"?e.renderSlot(g.$slots,"error",{key:1,retry:f.emit},()=>{var w;return[e.createElementVNode("span",Qd,[e.createElementVNode("span",null,e.toDisplayString(((w=g.slots)==null?void 0:w.error)||"Oops something went wrong!"),1),e.createElementVNode("button",{class:"retry",onClick:k[0]||(k[0]=(...x)=>f.emit&&f.emit(...x))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function Jd(t,n,a){const o=ot(t,a==null?void 0:a.in);return isNaN(n)?nt(t,NaN):(o.setDate(o.getDate()+n),o)}function Tn(t,n){return Tt(t,{...n,weekStartsOn:1})}function wr(t,n){const a=ot(t,n==null?void 0:n.in),o=a.getFullYear(),r=nt(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=Tn(r),s=nt(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=Tn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function Er(t){const n=ot(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 Dn(t,n){const a=ot(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function e3(t,n,a){const[o,r]=ga(a==null?void 0:a.in,t,n),i=Dn(o),s=Dn(r),l=+i-Er(i),c=+s-Er(s);return Math.round((l-c)/xl)}function t3(t,n){const a=wr(t,n),o=nt(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),Tn(o)}function Ea(t){return nt(t,Date.now())}function vr(t,n,a){const[o,r]=ga(a==null?void 0:a.in,t,n);return+Dn(o)==+Dn(r)}function n3(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function a3(t){return!(!n3(t)&&typeof t!="number"||isNaN(+ot(t)))}function o3(t,n){const a=ot(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function r3(t,n){const a=ot(t,n==null?void 0:n.in);return e3(a,o3(a))+1}function i3(t,n){const a=ot(t,n==null?void 0:n.in),o=+Tn(a)-+t3(a);return Math.round(o/or)+1}function Cr(t,n){var d,h,f,p;const a=ot(t,n==null?void 0:n.in),o=a.getFullYear(),r=Bn(),i=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=nt((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Tt(s,n),c=nt((n==null?void 0:n.in)||t,0);c.setFullYear(o,0,i),c.setHours(0,0,0,0);const m=Tt(c,n);return+a>=+l?o+1:+a>=+m?o:o-1}function s3(t,n){var l,c,m,d;const a=Bn(),o=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??a.firstWeekContainsDate??((d=(m=a.locale)==null?void 0:m.options)==null?void 0:d.firstWeekContainsDate)??1,r=Cr(t,n),i=nt((n==null?void 0:n.in)||t,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Tt(i,n)}function l3(t,n){const a=ot(t,n==null?void 0:n.in),o=+Tt(a,n)-+s3(a,n);return Math.round(o/or)+1}function Le(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const kt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return Le(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):Le(a+1,2)},d(t,n){return Le(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 Le(t.getHours()%12||12,n.length)},H(t,n){return Le(t.getHours(),n.length)},m(t,n){return Le(t.getMinutes(),n.length)},s(t,n){return Le(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return Le(r,n.length)}},zt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sr={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 kt.y(t,n)},Y:function(t,n,a,o){const r=Cr(t,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return Le(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):Le(i,n.length)},R:function(t,n){const a=wr(t);return Le(a,n.length)},u:function(t,n){const a=t.getFullYear();return Le(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 Le(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 Le(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 kt.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 Le(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=l3(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):Le(r,n.length)},I:function(t,n,a){const o=i3(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):Le(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):kt.d(t,n)},D:function(t,n,a){const o=r3(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):Le(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 Le(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 Le(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 Le(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=zt.noon:o===0?r=zt.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=zt.evening:o>=12?r=zt.afternoon:o>=4?r=zt.morning:r=zt.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 kt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):kt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):kt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):kt.s(t,n)},S:function(t,n){return kt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Vr(o);case"XXXX":case"XX":return Dt(o);case"XXXXX":case"XXX":default:return Dt(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return Vr(o);case"xxxx":case"xx":return Dt(o);case"xxxxx":case"xxx":default:return Dt(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Br(o,":");case"OOOO":default:return"GMT"+Dt(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Br(o,":");case"zzzz":default:return"GMT"+Dt(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return Le(o,n.length)},T:function(t,n,a){return Le(+t,n.length)}};function Br(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+Le(i,2)}function Vr(t,n){return t%60===0?(t>0?"-":"+")+Le(Math.abs(t)/60,2):Dt(t,n)}function Dt(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Le(Math.trunc(o/60),2),i=Le(o%60,2);return a+r+n+i}const Mr=(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"})}},Nr=(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"})}},c3={p:Nr,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return Mr(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}}",Mr(o,n)).replace("{{time}}",Nr(r,n))}},d3=/^D+$/,u3=/^Y+$/,m3=["D","DD","YY","YYYY"];function f3(t){return d3.test(t)}function h3(t){return u3.test(t)}function p3(t,n,a){const o=g3(t,n,a);if(console.warn(o),m3.includes(t))throw new RangeError(o)}function g3(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 y3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,k3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x3=/^'([^]*?)'?$/,b3=/''/g,w3=/[a-zA-Z]/;function Ar(t,n,a){var d,h,f,p,u,g,k,w;const o=Bn(),r=(a==null?void 0:a.locale)??o.locale??Xl,i=(a==null?void 0:a.firstWeekContainsDate)??((h=(d=a==null?void 0:a.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(f=o.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(u=a==null?void 0:a.locale)==null?void 0:u.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((w=(k=o.locale)==null?void 0:k.options)==null?void 0:w.weekStartsOn)??0,l=ot(t,a==null?void 0:a.in);if(!a3(l))throw new RangeError("Invalid time value");let c=n.match(k3).map(x=>{const y=x[0];if(y==="p"||y==="P"){const E=c3[y];return E(x,r.formatLong)}return x}).join("").match(y3).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const y=x[0];if(y==="'")return{isToken:!1,value:E3(x)};if(Sr[y])return{isToken:!0,value:x};if(y.match(w3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const m={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return c.map(x=>{if(!x.isToken)return x.value;const y=x.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&h3(y)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&f3(y))&&p3(y,n,String(t));const E=Sr[y[0]];return E(l,y,r.localize,m)}).join("")}function E3(t){const n=t.match(x3);return n?n[1].replace(b3,"'"):t}function v3(t,n){return wl(nt(t,t),Ea(t),n)}function C3(t,n){return vr(nt(t,t),Ea(t))}function S3(t,n,a){return Jd(t,-1,a)}function B3(t,n){return vr(nt(t,t),S3(Ea(t)))}/*! License details at fancyapps.com/license */const Ie=t=>typeof t=="string";/*! License details at fancyapps.com/license */const jt=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const V3=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},tn=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:V3(t)?t:tn(t.parentElement,n)};/*! License details at fancyapps.com/license */const xt=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 Ae=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Xe=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function Tr(t){return Xe(t)||Array.isArray(t)}function va(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}`:Tr(i)&&Tr(s)?va(i,s):i===s})}/*! License details at fancyapps.com/license */const Dr=function(t){for(const n of Ln)n.getState()===Ke.Running&&n.tick(Ca?t-Ca:0);Ca=t,It=window.requestAnimationFrame(Dr)};var Ke,bt,Gt;(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"})(Ke||(Ke={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(bt||(bt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(Gt||(Gt={}));const Ln=new Set;let It=null,Ca=0;function wt(){let t=Ke.Initializing,n=bt.Ease,a=0,o=0,r=wt.Easings.Linear,i=500,s=0,l=0,c=0,m=0,d=1/0,h=.01,f=.01,p=!1,u={},g=null,k={},w={},x={},y=0,E=0,C=Gt.Loop,$=wt.Easings.Linear;const R=new Map;function v(A,...N){for(const z of R.get(A)||[])z(...N)}function b(A){return o=0,A?g=setTimeout(()=>{T()},A):T(),B}function T(){t=Ke.Running,v("start",k,w)}function S(){if(t=Ke.Completed,x={},v("end",k),t===Ke.Completed)if(a<y){if(a++,C===Gt.Reverse){const A=Object.assign({},u);u=Object.assign({},w),w=A}b(E)}else a=0;return B}const B={getState:function(){return t},easing:function(A){return r=A,n=bt.Ease,x={},B},duration:function(A){return i=A,B},spring:function(A={}){n=bt.Spring;const N={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:z,mass:ae,tension:J,friction:ce,restDelta:O,restSpeed:P,maxSpeed:G,clamp:oe}=Object.assign(Object.assign({},N),A);return s=z,l=ae,c=J,m=ce,f=O,h=P,d=G,p=oe,x={},B},isRunning:function(){return t===Ke.Running},isSpring:function(){return n===bt.Spring},from:function(A){return k=Object.assign({},A),B},to:function(A){return w=A,B},repeat:function(A,N=0,z=Gt.Loop,ae){return y=A,E=N,C=z,$=ae||r,B},on:function(A,N){var z,ae;return z=A,ae=N,R.set(z,[...R.get(z)||[],ae]),B},off:function(A,N){var z,ae;return z=A,ae=N,R.has(z)&&R.set(z,R.get(z).filter(J=>J!==ae)),B},start:function(A){return t=Ke.Initializing,u=Object.assign({},k),va(u,w)||(Ln.add(this),It||(It=window.requestAnimationFrame(Dr)),b(A)),B},pause:function(){return g&&(clearTimeout(g),g=null),t===Ke.Running&&(t=Ke.Paused,v("pause",k)),B},end:S,tick:function(A){A>50&&(A=50),o+=A;let N=0,z=!1;if(t!==Ke.Running)return B;if(n===bt.Ease){N=Ae(0,o/i,1),z=N===1;const J=C===Gt.Reverse?$:r;for(const ce in k)k[ce]=u[ce]+(w[ce]-u[ce])*J(N)}if(n===bt.Spring){const J=.001*A;let ce=0;for(const O in k){const P=w[O];let G=k[O];if(typeof P!="number"||isNaN(P)||typeof G!="number"||isNaN(G))continue;if(Math.abs(P-G)<=f){k[O]=P,x[O]=0;continue}x[O]||(typeof s=="object"&&typeof s[O]=="number"?x[O]=s[O]:x[O]=typeof s=="number"?s:0);let oe=x[O];oe=Ae(-1*Math.abs(d),oe,Math.abs(d));const se=oe*l*m;oe+=((G>P?-1:1)*(Math.abs(P-G)*c)-se)/l*J,G+=oe*J;const ye=k[O]>P?G<P:G>P;let Se=Math.abs(oe)<h&&Math.abs(P-G)<=f;p&&ye&&(Se=!0),Se?(G=P,oe=0):ce++,k[O]=G,x[O]=oe}z=!ce}const ae=Object.assign({},w);return v("step",k,u,w,N),z&&t===Ke.Running&&va(w,ae)&&(t=Ke.Completed,S()),B},getStartValues:function(){return u},getCurrentValues:function(){return k},getCurrentVelocities:function(){return x},getEndValues:function(){return w},destroy:function(){t=Ke.Destroyed,g&&(clearTimeout(g),g=null),u=k=w={},Ln.delete(this)}};return B}wt.destroy=()=>{for(const t of Ln)t.destroy();It&&(cancelAnimationFrame(It),It=null)},wt.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 Sa(t){const n=[],a=typeof TouchEvent<"u"&&t instanceof TouchEvent?t.touches:t instanceof MouseEvent&&t.type!=="mouseup"?[t]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function Lr(t){const n=[],a=typeof TouchEvent<"u"&&t instanceof TouchEvent?t.changedTouches:t instanceof MouseEvent?[t]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function Et(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 Fn(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 Fr=t=>{t.cancelable&&t.preventDefault()},vt={passive:!1},M3={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let Ba=!1,nn=!0;const an=(t,n)=>{let a,o,r,i=Object.assign(Object.assign({},M3),n),s=[],l=[],c=[],m=!1,d=!1,h=!1,f=0,p=0,u=0,g=0,k=0,w=0,x=0,y=0,E=0,C=[],$=0,R=0;const v=new Map;function b(O){const P=Fn(l),G=Fn(c),oe=P&&G?P/G:0,se=Math.abs(x)>Math.abs(y)?x:y,ye={srcEvent:a,isPanRecognized:m,isSwipeRecognized:d,firstTouch:s,previousTouch:c,currentTouch:l,deltaX:u,deltaY:g,offsetX:k,offsetY:w,velocityX:x,velocityY:y,velocity:se,angle:E,axis:r,scale:oe,center:o};for(const Se of v.get(O)||[])Se(ye)}function T(O){const P=Date.now();C=C.filter(G=>!G.ts||G.ts>P-100),O&&C.push(O)}function S(){if(x=0,y=0,C.length>3){const O=C[0],P=C[C.length-1];if(O&&P){const G=P.x-O.x,oe=P.y-O.y,se=O.ts&&P.ts?P.ts-O.ts:0;se>0&&(x=Math.abs(G)>3?G/(se/30):0,y=Math.abs(oe)>3?oe/(se/30):0)}}}function B(O){if(O instanceof MouseEvent){if(Ba)return}else Ba=!0;const P=O.composedPath()[0],G=i.ignore.join(",");if(P.matches(G)||P.closest(G)||typeof MouseEvent<"u"&&O instanceof MouseEvent&&(!O.buttons||O.button!==0))return;O instanceof MouseEvent&&Fr(O);const oe=Date.now(),se=oe-(f||oe);h=se>0&&se<=250,f=oe,clearTimeout($),a=O,O instanceof MouseEvent&&(window.addEventListener("mousemove",A),window.addEventListener("mouseup",N)),window.addEventListener("blur",z),l=Sa(O),s=[...l],c=[],p=l.length,o=Et(l),p===1&&(m=!1,d=!1),p&&T(Et(l)),b("start")}function A(O){var P;if(!s.length||O.defaultPrevented)return;a=O,c=[...l],l=Sa(O),p=l.length,o=Et(l);const G=o,oe=Et(c);if(u=G.x-oe.x,g=G.y-oe.y,T(G),S(),b("move"),l.length>1){const se=Fn(l),ye=Fn(c);Math.abs(se-ye)>=.1&&b("pinch")}if(!m&&s.length){const se=Et(s);k=G.x-se.x,w=G.y-se.y,m=Math.abs(k)>i.panThreshold||Math.abs(w)>i.panThreshold,m&&(nn=!1,clearTimeout(R),R=0,E=Math.abs(180*Math.atan2(w,k)/Math.PI),r=E>45&&E<135?"y":"x",s=[...l],c=[...l],(P=window.getSelection())===null||P===void 0||P.removeAllRanges(),b("panstart"))}m&&(u||g)&&b("pan")}function N(O){if(a=O,!s.length)return;const P=Sa(O),G=Lr(O);if(p=P.length,o=Et(G),G.length&&T(Et(G)),S(),c=[...l],l=[...P],s=[...P],P.length>0)b("end"),m=!1,d=!1,C=[];else{const oe=i.swipeThreshold;(Math.abs(x)>oe||Math.abs(y)>oe)&&(d=!0),m&&b("panend"),d&&b("swipe"),m||d||(b("tap"),h?b("doubleTap"):$=setTimeout(function(){b("singleTap")},250)),b("end"),ae()}}function z(){clearTimeout($),ae(),m&&b("panend"),b("end")}function ae(){m=!1,d=!1,h=!1,p=0,C=[],l=[],c=[],s=[],u=0,g=0,k=0,w=0,x=0,y=0,E=0,r=void 0,window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",N),window.removeEventListener("blur",z),nn||R||(R=setTimeout(()=>{nn=!0,R=0},100))}function J(O){const P=O.target;Ba=!1,P&&!O.defaultPrevented&&(nn||(Fr(O),O.stopPropagation()))}const ce={init:function(){if(t)return t.addEventListener("click",J,vt),t.addEventListener("mousedown",B,vt),t.addEventListener("touchstart",B,vt),t.addEventListener("touchmove",A,vt),t.addEventListener("touchend",N),t.addEventListener("touchcancel",N),ce},on:function(O,P){return function(G,oe){v.set(G,[...v.get(G)||[],oe])}(O,P),ce},off:function(O,P){return v.has(O)&&v.set(O,v.get(O).filter(G=>G!==P)),ce},isPointerDown:()=>p>0,destroy:function(){clearTimeout($),clearTimeout(R),R=0,t&&(t.removeEventListener("click",J,vt),t.removeEventListener("mousedown",B,vt),t.removeEventListener("touchstart",B,vt),t.removeEventListener("touchmove",A,vt),t.removeEventListener("touchend",N),t.removeEventListener("touchcancel",N)),t=null,ae()}};return ce};an.isClickAllowed=()=>nn;/*! License details at fancyapps.com/license */const Va={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"};/*! License details at fancyapps.com/license */const De=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const $n=t=>{t.cancelable&&t.preventDefault()},Qe=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n);var ue,$r;(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"})(ue||(ue={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}($r||($r={}));const rt={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},Ma={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:ue.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:Va,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:ue.Zoom,width:"auto"};let Pn,Pr=0,Or=0,On=0;const Na=(t,n={},a={})=>{let o,r,i,s,l,c,m,d=0,h=Object.assign(Object.assign({},Ma),n),f={},p=Object.assign({},rt),u=Object.assign({},rt);const g=[];function k(M){let F=h[M];return F&&typeof F=="function"?F(Q):F}const w=new Map;function x(M,...F){const Z=w.get(M)||[];h.on&&Z.push(h.on[M]);for(const j of Z)j&&j instanceof Function&&j(Q,...F);M!=="*"&&x("*",M,...F)}function y(M){if(d!==3)return;const F=M.target;if(tn(F))return;const Z=Date.now(),j=[-M.deltaX||0,-M.deltaY||0,-M.detail||0].reduce(function(ge,fe){return Math.abs(fe)>Math.abs(ge)?fe:ge}),X=Ae(-1,j,1);x("wheel",M,X);const W=k("wheelAction");if(!W||M.defaultPrevented)return;const re=u.scale;let de=re*(X>0?1.5:.5);if(W===ue.Zoom){const ge=Math.abs(M.deltaY)<100&&Math.abs(M.deltaX)<100;if(Z-Or<(ge?200:45))return void $n(M);Or=Z;const fe=B(),he=ae();if(Qe(de)<Qe(fe)&&Qe(re)<=Qe(fe)?(On+=Math.abs(X),de=fe):Qe(de)>Qe(he)&&Qe(re)>=Qe(he)?(On+=Math.abs(X),de=he):(On=0,de=Ae(fe,de,he)),On>7)return}switch($n(M),W){case ue.Pan:P(W,{srcEvent:M,deltaX:2*-M.deltaX,deltaY:2*-M.deltaY});break;case ue.Zoom:P(ue.ZoomTo,{srcEvent:M,scale:de,center:{x:M.clientX,y:M.clientY}});break;default:P(W,{srcEvent:M})}}function E(M){var F,Z;const j=M.composedPath()[0];if(!an.isClickAllowed()||!jt(j)||M.defaultPrevented||!(t!=null&&t.contains(j))||j.hasAttribute("disabled")||j.hasAttribute("aria-disabled"))return;const X=j.closest("[data-panzoom-action]"),W=(F=X==null?void 0:X.dataset)===null||F===void 0?void 0:F.panzoomAction,re=((Z=X==null?void 0:X.dataset)===null||Z===void 0?void 0:Z.panzoomValue)||"";if(W){switch(W){case ue.ZoomTo:case ue.ZoomIn:case ue.ZoomOut:P(W,{scale:parseFloat(re||"")||void 0});break;case ue.MoveLeft:case ue.MoveRight:P(W,{deltaX:parseFloat(re||"")||void 0});break;case ue.MoveUp:case ue.MoveDown:P(W,{deltaY:parseFloat(re||"")||void 0});break;default:P(W)}return}if(!(o!=null&&o.contains(j)))return;const de={srcEvent:M};if(P(k("clickAction"),de),k("dblClickAction")){const ge=Date.now(),fe=ge-(Pr||ge);Pr=ge,fe>0&&fe<=250?(Pn&&(clearTimeout(Pn),Pn=void 0),P(k("dblClickAction"),de)):Pn=setTimeout(()=>{P(k("singleClickAction"),de)},250)}}function C(M){if(m=M,!b()||d!==3||p.scale<=1||u.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const F=T(u.scale);if(!F)return;const{x:Z,y:j}=F;P(ue.Pan,{deltaX:Z-u.x,deltaY:j-u.y})}function $(){var M;if(t&&((M=t.querySelector(".f-spinner"))===null||M===void 0||M.remove(),t.classList.remove("is-loading")),!t||!o)return;if(r instanceof HTMLImageElement&&(!r.complete||!r.naturalWidth))return d=2,o==null||o.classList.add("has-error"),void x("error");x("loaded");const{width:F,height:Z}=v();r&&(r.setAttribute("width",F+""),r.setAttribute("height",Z+"")),o&&(o.classList.remove("has-error"),o.setAttribute("width",F+""),o.setAttribute("height",Z+""),o.style.aspectRatio=`${F/Z||""}`),l=wt().on("start",(X,W)=>{u=Object.assign(Object.assign({},rt),W),W.angle!==void 0&&(W.angle=90*Math.round(W.angle/90)),W.flipX!==void 0&&(W.flipX=W.flipX>0?1:-1),W.flipY!==void 0&&(W.flipY=W.flipY>0?1:-1),O(),x("animationStart")}).on("pause",X=>{u=Object.assign(Object.assign({},rt),X)}).on("step",X=>{if(d!==3||!l)return;if(!t||!t.parentElement)return void l.end();if(p=Object.assign(Object.assign({},rt),X),b()||!k("bounds")||(s==null?void 0:s.isPointerDown())||u.scale>p.scale||u.scale<A())return void G();const W=J(u.scale);let re=!1,de=!1,ge=!1,fe=!1;p.x<W.x[0]&&(re=!0),p.x>W.x[1]&&(de=!0),p.y<W.y[0]&&(fe=!0),p.y>W.y[1]&&(ge=!0);let he=!1,pe=!1,ve=!1,Ve=!1;u.x<W.x[0]&&(he=!0),u.x>W.x[1]&&(pe=!0),u.y<W.y[0]&&(Ve=!0),u.y>W.y[1]&&(ve=!0);let Be=!1;(de&&pe||re&&he)&&(u.x=Ae(W.x[0],u.x,W.x[1]),Be=!0),(ge&&ve||fe&&Ve)&&(u.y=Ae(W.y[0],u.y,W.y[1]),Be=!0),Be&&l.spring({tension:94,friction:17,maxSpeed:555*u.scale,restDelta:.1,restSpeed:.1,velocity:l.getCurrentVelocities()}).from(p).to(u).start(),G()}).on("end",()=>{ce(),l!=null&&l.isRunning()||(O(),x("animationEnd"))}),function(){const X=k("gestures");X&&i&&r&&(s=an(i,X).on("start",W=>{if(!l)return;const re=W.srcEvent;b()||((p.scale>1||W.currentTouch.length>1)&&(re==null||re.stopPropagation(),l.pause()),W.currentTouch.length===1&&x("touchStart"))}).on("move",W=>{b()||(u.scale!==1||W.currentTouch.length>1)&&(W.srcEvent.preventDefault(),W.srcEvent.stopPropagation())}).on("pan",W=>{if(b())return;const re=W.srcEvent;(u.scale!==1||W.currentTouch.length>1)&&($n(re),P(ue.Pan,W))}).on("swipe",W=>{b()||u.scale>1&&P(ue.Swipe,W)}).on("tap",W=>{x("click",W)}).on("singleTap",W=>{x("singleClick",W)}).on("doubleTap",W=>{x("dblClick",W)}).on("pinch",W=>{b()||(W.scale>A()?P(ue.ZoomIn,W):W.scale<A()?P(ue.ZoomOut,W):P(ue.Pan,W))}).on("end",W=>{b()||(W.currentTouch.length?(W.srcEvent.stopPropagation(),$n(W.srcEvent),l==null||l.end()):(O(),ce(),x("touchEnd")))}).init())}(),i&&(i.addEventListener("wheel",y,{passive:!1}),g.push(()=>{i==null||i.removeEventListener("wheel",y,{passive:!1})})),t==null||t.addEventListener("click",E),document==null||document.addEventListener("mousemove",C),g.push(()=>{t==null||t.removeEventListener("click",E),document==null||document.removeEventListener("mousemove",C)});const j=Object.assign(Object.assign({},k("startPos")||{}),{scale:A()});if(p=Object.assign(Object.assign({},rt),j),u=Object.assign(Object.assign({},rt),j),b()){const X=T(u.scale);if(X){const{x:W,y:re}=X;p.x=W,p.y=re,u.x=W,u.y=re}}d=3,G(),O(),x("ready"),requestAnimationFrame(()=>{i&&(i.style.visibility="")})}function R(){const M={top:0,left:0,width:0,height:0};if(o){const F=o.getBoundingClientRect();u.angle%180==90?(M.top=F.top+.5*F.height-.5*F.width,M.left=F.left+.5*F.width-.5*F.height,M.width=F.height,M.height=F.width):(M.top=F.top,M.left=F.left,M.width=F.width,M.height=F.height)}return M}function v(){let M=k("width"),F=k("height");if(r&&M==="auto"){const Z=r.getAttribute("width");M=Z?parseFloat(Z+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):i instanceof HTMLImageElement?i.naturalWidth:r instanceof HTMLImageElement?r.naturalWidth:r.getBoundingClientRect().width}else M=Ie(M)?parseFloat(M):M;if(r&&F==="auto"){const Z=r.getAttribute("height");F=Z?parseFloat(Z+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):i instanceof HTMLImageElement?i.naturalHeight:r instanceof HTMLImageElement?r.naturalHeight:r.getBoundingClientRect().height}else F=Ie(F)?parseFloat(F):F;return{width:M,height:F}}function b(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function T(M){const F=m||k("event"),Z=o==null?void 0:o.getBoundingClientRect();if(!F||!Z||M<=1)return{x:0,y:0};const j=(F.clientX||0)-Z.left,X=(F.clientY||0)-Z.top,W=Z.width,re=Z.height,de=J(M);if(M>1){const ve=k("mouseMoveFactor");ve>1&&(M*=ve)}let ge=W*M,fe=re*M,he=.5*(ge-W)-j/W*100/100*(ge-W),pe=.5*(fe-re)-X/re*100/100*(fe-re);return he=Ae(de.x[0],he,de.x[1]),pe=Ae(de.y[0],pe,de.y[1]),{x:he,y:pe}}function S(M="base"){if(!t)return 1;const F=t.getBoundingClientRect(),Z=R(),{width:j,height:X}=v(),W=he=>{if(typeof he=="number")return he;switch(he){case"min":case"base":return 1;case"cover":return Math.max(F.height/Z.height,F.width/Z.width)||1;case"full":case"max":{const pe=u.angle%180==90?X:j;return pe&&Z.width?pe/Z.width:1}}},re=k("minScale"),de=k("maxScale"),ge=Math.min(W("full"),W(re)),fe=typeof de=="number"?W("full")*de:Math.min(W("full"),W(de));switch(M){case"min":return ge;case"base":return Ae(ge,1,fe);case"cover":return W("cover");case"full":return Math.min(fe,W("full"));case"max":return fe}}function B(){return S("min")}function A(){return S("base")}function N(){return S("cover")}function z(){return S("full")}function ae(){return S("max")}function J(M){const F={x:[0,0],y:[0,0]},Z=t==null?void 0:t.getBoundingClientRect();if(!Z)return F;const j=R(),X=Z.width,W=Z.height;let re=j.width,de=j.height,ge=M=M===void 0?u.scale:M,fe=M;if(b()&&M>1){const he=k("mouseMoveFactor");he>1&&(re*M>X+.01&&(ge*=he),de*M>W+.01&&(fe*=he))}return re*=ge,de*=fe,M>1&&(re>X&&(F.x[0]=.5*(X-re),F.x[1]=.5*(re-X)),F.x[0]-=.5*(j.left-Z.left),F.x[1]-=.5*(j.left-Z.left),F.x[0]-=.5*(j.left+j.width-Z.right),F.x[1]-=.5*(j.left+j.width-Z.right),de>W&&(F.y[0]=.5*(W-de),F.y[1]=.5*(de-W)),F.y[0]-=.5*(j.top-Z.top),F.y[1]-=.5*(j.top-Z.top),F.y[0]-=.5*(j.top+j.height-Z.bottom),F.y[1]-=.5*(j.top+j.height-Z.bottom)),F}function ce(){if(!k("bounds")||d!==3||!(t!=null&&t.parentElement)||!l)return;const M=B(),F=ae(),Z=Ae(M,u.scale,F);if(u.scale<M-.01||u.scale>F+.01)return void P(ue.ZoomTo,{scale:Z});if(l.isRunning()||s!=null&&s.isPointerDown())return;const j=J(Z);u.x<j.x[0]||u.x>j.x[1]||u.y<j.y[0]||u.y>j.y[1]?(u.x=Ae(j.x[0],u.x,j.x[1]),u.y=Ae(j.y[0],u.y,j.y[1]),l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:l.getCurrentVelocities()}),l.from(p).to(u).start()):G()}function O(){if(!t||!t.parentElement||!o)return;const M=$e(),F=Ne(),Z=I(),j=ee(),X=se(),W=ye();o.classList.toggle("is-fullsize",j),o.classList.toggle("is-expanded",Z),o.classList.toggle("is-dragging",F),o.classList.toggle("can-drag",M),o.classList.toggle("will-zoom-in",X),o.classList.toggle("will-zoom-out",W);const re=Se(),de=Fe(),ge=d!==3;for(const fe of(t==null?void 0:t.querySelectorAll("[data-panzoom-action]"))||[]){const he=fe.dataset.panzoomAction;let pe=!1;if(ge)pe=!0;else switch(he){case ue.ZoomIn:re||(pe=!0);break;case ue.ZoomOut:de||(pe=!0);break;case ue.ToggleFull:re||de||(pe=!0);const ve=fe.querySelector("g");ve&&(ve.style.display=j?"none":"");break;case ue.ToggleCover:case ue.ToggleMax:re||de||(pe=!0)}pe?(fe.setAttribute("aria-disabled",""),fe.setAttribute("tabindex","-1")):(fe.removeAttribute("aria-disabled"),fe.removeAttribute("tabindex"))}}function P(M,F){var Z;if(!t||!r||!l||M===ue.Swipe&&Math.abs(l.getCurrentVelocities().scale)>.01)return;let j=Object.assign({},u),X=J(b()?u.scale:p.scale);const W=l.getCurrentVelocities(),re=R(),de=(((Z=(F=F||{}).currentTouch)===null||Z===void 0?void 0:Z.length)||0)>1,ge=F.velocityX||0,fe=F.velocityY||0;let he=F.center;!he&&F.srcEvent&&(he=Et(Lr(F.srcEvent)));let pe=F.deltaX||0,ve=F.deltaY||0;switch(M){case ue.MoveRight:pe=F.deltaX||100;break;case ue.MoveLeft:pe=F.deltaX||-100;break;case ue.MoveUp:ve=F.deltaY||-100;break;case ue.MoveDown:ve=F.deltaY||100}let Ve=[];switch(M){case ue.Reset:u=Object.assign({},rt),u.scale=A();break;case ue.Pan:case ue.Move:case ue.MoveLeft:case ue.MoveRight:case ue.MoveUp:case ue.MoveDown:if(s!=null&&s.isPointerDown()){let Te=1,be=1;u.x<=X.x[0]&&ge<=0&&(Te=Math.max(.01,1-Math.abs(1/re.width*Math.abs(u.x-X.x[0]))),Te*=.2),u.x>=X.x[1]&&ge>=0&&(Te=Math.max(.01,1-Math.abs(1/re.width*Math.abs(u.x-X.x[1]))),Te*=.2),u.y<=X.y[0]&&fe<=0&&(be=Math.max(.01,1-Math.abs(1/re.height*Math.abs(u.y-X.y[0]))),be*=.2),u.y>=X.y[1]&&fe>=0&&(be=Math.max(.01,1-Math.abs(1/re.height*Math.abs(u.y-X.y[1]))),be*=.2),u.x+=pe*Te,u.y+=ve*be}else u.x=Ae(X.x[0],u.x+pe,X.x[1]),u.y=Ae(X.y[0],u.y+ve,X.y[1]);break;case ue.Swipe:const Be=(Te=0)=>Math.sign(Te)*Math.pow(Math.abs(Te),1.5);u.x+=Ae(-1e3,Be(ge),1e3),u.y+=Ae(-1e3,Be(fe),1e3),fe&&!ge&&(u.x=Ae(X.x[0],u.x,X.x[1])),!fe&&ge&&(u.y=Ae(X.y[0],u.y,X.y[1])),W.x=ge,W.y=fe;break;case ue.ZoomTo:u.scale=F.scale||1;break;case ue.ZoomIn:u.scale=u.scale*(F.scale||2),de||(u.scale=Math.min(u.scale,ae()));break;case ue.ZoomOut:u.scale=u.scale*(F.scale||.5),de||(u.scale=Math.max(u.scale,B()));break;case ue.ToggleCover:Ve=[A(),N()];break;case ue.ToggleFull:Ve=[A(),z()];break;case ue.ToggleMax:Ve=[A(),ae()];break;case ue.IterateZoom:Ve=[A(),z(),ae()];break;case ue.Zoom:const xe=z();u.scale>=xe-.05?u.scale=A():u.scale=Math.min(xe,u.scale*(F.scale||2));break;case ue.RotateCW:u.angle+=90;break;case ue.RotateCCW:u.angle-=90;break;case ue.FlipX:u.flipX*=-1;break;case ue.FlipY:u.flipY*=-1}if(p.angle!==void 0&&Math.abs(p.angle)>=360&&(u.angle-=360*Math.floor(p.angle/360),p.angle-=360*Math.floor(p.angle/360)),Ve.length){const Be=Ve.findIndex(xe=>xe>u.scale+1e-4);u.scale=Ve[Be]||Ve[0]}if(de&&(u.scale=Ae(B()*(de?.8:1),u.scale,ae()*(de?1.6:1))),b()){const Be=T(u.scale);if(Be){const{x:xe,y:Te}=Be;u.x=xe,u.y=Te}}else if(u.scale!==j.scale){let Be=0,xe=0;if(he)Be=he.x,xe=he.y;else{const q=t.getBoundingClientRect();Be=q.x+.5*q.width,xe=q.y+.5*q.height}let Te=Be-re.left,be=xe-re.top;Te-=.5*re.width,be-=.5*re.height;const L=(Te-j.x)/j.scale,_=(be-j.y)/j.scale;u.x=Te-L*u.scale,u.y=be-_*u.scale,!de&&k("bounds")&&(X=J(u.scale),u.x=Ae(X.x[0],u.x,X.x[1]),u.y=Ae(X.y[0],u.y,X.y[1]))}if(M===ue.Swipe){let Be=94,xe=17,Te=500*u.scale,be=W;l.spring({tension:Be,friction:xe,maxSpeed:Te,restDelta:.1,restSpeed:.1,velocity:be})}else M===ue.Pan||de?l.spring({tension:750,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:W});M===ue.Reset&&F.velocity===0?p=Object.assign({},u):l.from(p).to(u).start(),x("action",M)}function G(){if(!o||!r)return;if(r instanceof HTMLImageElement){const{width:de,height:ge}=v();o.style.maxWidth=`min(${de}px, 100%)`,o.style.maxHeight=`min(${ge}px, 100%)`}let{x:M,y:F,scale:Z,angle:j,flipX:X,flipY:W}=p;const re=function(){const de=R(),ge=de.width,fe=de.height,{width:he,height:pe}=v();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:ge,fitHeight:fe,fullWidth:he,fullHeight:pe};let{x:ve,y:Ve,scale:Be,angle:xe,flipX:Te,flipY:be}=p,L=1/z(),_=he,q=pe,Y=p.scale*L,me=u.scale*L;const te=Math.max(ge,fe),ne=Math.min(ge,fe);he>pe?(_=te,q=ne):(_=ne,q=te),Y=he>pe?te*Be/he||1:te*Be/pe||1;let D=_?he*me:0,V=q?pe*me:0;return ve=ve+.5*_-.5*D,Ve=Ve+.5*q-.5*V,{x:ve,y:Ve,width:D,height:V,scale:_&&q?he*Y/D:0,flipX:Te,flipY:be,angle:xe,fitWidth:ge,fitHeight:fe,fullWidth:he,fullHeight:pe}}();if(o&&re){const{x:de,y:ge,width:fe,height:he,scale:pe,flipX:ve,flipY:Ve}=re;let Be=`translate(${Qe(de)}px, ${Qe(ge)}px)`;Be+=ve!==1||Ve!==1?` scaleX(${Qe(pe*ve)}) scaleY(${Qe(pe*Ve)})`:` scale(${Qe(pe)})`,j!==0&&(Be+=` rotate(${j}deg)`),i&&(i.style.width=`${Qe(fe)}px`,i.style.height=`${Qe(he)}px`,i.style.transform=`${Be}`)}x("render")}function oe(){let M=u.scale;const F=k("clickAction");let Z=A();if(F){let j=[];switch(F){case ue.ZoomIn:Z=2*M;break;case ue.ZoomOut:Z=.5*M;break;case ue.ToggleCover:j=[A(),N()];break;case ue.ToggleFull:j=[A(),z()];break;case ue.ToggleMax:j=[A(),ae()];break;case ue.IterateZoom:j=[A(),z(),ae()];break;case ue.Zoom:const X=z();Z=M>=X-.05?A():Math.min(X,2*M)}if(j.length){const X=j.findIndex(W=>W>M+1e-4);Z=j[X]||A()}}return Z=Ae(B(),Z,ae()),Z}function se(){return d===3&&oe()>u.scale}function ye(){return d===3&&oe()<u.scale}function Se(){return d===3&&u.scale<ae()}function Fe(){return d===3&&u.scale>B()}function $e(){return d===3&&I()&&!!s&&!b()}function Ne(){return d===3&&(s==null?void 0:s.isPointerDown())&&!b()}function I(){return d===3&&u.scale>A()}function ee(){return d===3&&u.scale>=z()}const Q={canDrag:$e,canZoomIn:Se,canZoomOut:Fe,destroy:function(){x("destroy");for(const M of Object.values(f))M==null||M.destroy(Q);for(const M of g)M();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),i&&(i.style.width="",i.style.height="",i.style.transform=""),o=void 0,r=void 0,i=void 0,p=Object.assign({},rt),u=Object.assign({},rt),l==null||l.destroy(),l=void 0,s==null||s.destroy(),s=void 0,d=4,Q},emit:x,execute:P,getBoundaries:J,getContainer:function(){return t},getFullDim:v,getGestures:function(){return s},getMousemovePos:T,getOptions:function(){return h},getScale:S,getState:function(){return d},getTransform:function(M){return M===!0?u:p},getTween:function(){return l},getViewport:function(){return i},getWrapper:function(){return o},init:function(){return d=0,x("init"),function(){for(const[M,F]of Object.entries(Object.assign(Object.assign({},a),h.plugins||{})))if(M&&!f[M]&&F instanceof Function){const Z=F();Z.init(Q),f[M]=Z}x("initPlugins")}(),function(){if(!t)return;const M=Object.assign(Object.assign({},Ma.classes),k("classes"));if(De(t,M.container),r=t.querySelector("."+M.content),!!r&&(r.setAttribute("draggable","false"),o=t.querySelector("."+M.wrapper),o||(o=document.createElement("div"),De(o,M.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),r instanceof HTMLImageElement||r instanceof HTMLPictureElement)){if(i=t.querySelector("."+M.viewport),!i){i=document.createElement("div"),De(i,M.viewport);const F=r.cloneNode(!0);F.classList.remove("is-lazyloading"),F.classList.remove("is-lazyloaded"),i.insertAdjacentElement("afterbegin",F),o.insertAdjacentElement("beforeend",i)}if(r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),i.style.visibility="hidden",k("protected")){i.addEventListener("contextmenu",Z=>{Z.preventDefault()});const F=document.createElement("div");De(F,"f-panzoom__protected"),i.appendChild(F)}x("initLayout")}}(),function(){if(!(r&&r instanceof HTMLImageElement))return;d=1,x("loading");const M=()=>{r&&r instanceof HTMLImageElement&&r.decode().then(()=>{requestAnimationFrame(()=>{$()})}).catch(()=>{$()})};if(r.src&&r.complete)return void M();(function(){const F=t==null?void 0:t.querySelector(".f-spinner");if(!t||F)return;const Z=k("spinnerTpl"),j=xt(Z);j&&(j.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",j))})(),r.addEventListener("load",M,!1),r.addEventListener("error",M,!1),g.push(()=>{r==null||r.removeEventListener("load",M,!1),r==null||r.removeEventListener("error",M,!1)})}(),function(){if(t&&o&&!c){let M=null;c=new ResizeObserver(()=>{M||(M=requestAnimationFrame(()=>{t&&t.parentElement&&d===3&&(O(),ce(),x("refresh")),M=null}))}),c.observe(o),g.push(()=>{c==null||c.disconnect(),c=void 0,M&&(cancelAnimationFrame(M),M=null)})}}(),Q},isDragging:Ne,isExpanded:I,isFullsize:ee,localize:function(M,F=[]){const Z=k("l10n")||{};M=String(M).replace(/\{\{(\w+)\}\}/g,(j,X)=>Z[X]||j);for(let j=0;j<F.length;j++)M=M.split(F[j][0]).join(F[j][1]);return M=M.replace(/\{\{(.*?)\}\}/g,(j,X)=>X)},off:function(M,F){for(const Z of M instanceof Array?M:[M])w.has(Z)&&w.set(Z,w.get(Z).filter(j=>j!==F));return Q},on:function(M,F){for(const Z of M instanceof Array?M:[M])w.set(Z,[...w.get(Z)||[],F]);return Q},version:"6.0.16",willZoomIn:se,willZoomOut:ye};return Q};Na.l10n={en_EN:Va},Na.getDefaults=()=>Ma;/*! License details at fancyapps.com/license */const Aa=(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 it=(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}),Xe(s)?Object.assign(t[i],it(l,s)):Array.isArray(s)?Object.assign(t,{[i]:[...s]}):Object.assign(t,{[i]:s})})}return t};/*! License details at fancyapps.com/license */const Ta=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?Ae(o,s,r):Ae(r,s,o):s};/*! License details at fancyapps.com/license */const ft=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ct=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Da=Object.assign(Object.assign({},Va),{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 qt=t=>{t.cancelable&&t.preventDefault()},Wt={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:Da,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:200,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let _r,Rr=0;const _n=(t,n={},a={})=>{Rr++;let o,r,i,s,l,c=0,m=Object.assign({},Wt),d=Object.assign({},Wt),h={},f=null,p=null,u=!1,g=!1,k=!1,w=!1,x="height",y=0,E=!0,C=0,$=0,R=0,v=0,b="*",T=[],S=[];const B=new Set;let A=[],N=[],z=0,ae=0;function J(L,..._){let q=d[L];return q&&q instanceof Function?q(be,..._):q}function ce(L,_=[]){const q=J("l10n")||{};L=String(L).replace(/\{\{(\w+)\}\}/g,(Y,me)=>q[me]||Y);for(let Y=0;Y<_.length;Y++)L=L.split(_[Y][0]).join(_[Y][1]);return L=L.replace(/\{\{(.*?)\}\}/g,(Y,me)=>me)}const O=new Map;function P(L,..._){const q=O.get(L)||[];d.on&&q.push(d.on[L]);for(const Y of q)Y&&Y instanceof Function&&Y(be,..._);L!=="*"&&P("*",L,..._)}function G(){var L,_;const q=it({},Wt,m);it(q,Wt,m);let Y="";const me=m.breakpoints||{};if(me)for(const[te,ne]of Object.entries(me))window.matchMedia(te).matches&&(Y+=te,it(q,ne));if(l===void 0||Y!==l){if(l=Y,c!==0){let te=(_=(L=N[C])===null||L===void 0?void 0:L.slides[0])===null||_===void 0?void 0:_.index;te===void 0&&(te=d.initialSlide),q.initialSlide=te,q.slides=[];for(const ne of T)ne.isVirtual&&q.slides.push(ne)}Te(),d=q,d.enabled!==!1&&(c=0,P("init"),function(){for(const[te,ne]of Object.entries(Object.assign(Object.assign({},a),d.plugins||{})))if(te&&!h[te]&&ne instanceof Function){const D=ne();D.init(be,_n),h[te]=D}P("initPlugins")}(),function(){if(!f)return;const te=J("classes")||{};De(f,te.container),De(f,te.isEnabled);const ne=J("style");if(ne&&Xe(ne))for(const[D,V]of Object.entries(ne))f.style.setProperty(D,V);p=f.querySelector(`.${te.viewport}`),p||(p=document.createElement("div"),De(p,te.viewport),p.append(...Aa(f,`.${te.slide}`)),f.insertAdjacentElement("afterbegin",p)),u=window.getComputedStyle(p).getPropertyValue("overflow")==="visible",f.carousel=be,P("initLayout")}(),function(){if(!p)return;const te=J("classes")||{};T=[],[...Aa(p,`.${te.slide}`)].forEach(ne=>{ne.parentElement&&(T.push(F(Object.assign({el:ne,isVirtual:!1},ne.dataset||{}))),ne.parentElement.removeChild(ne))}),M(J("slides"));for(const ne of T)P("addSlide",ne);P("initSlides")}(),r=wt().on("start",()=>{E=!1,o&&o.isPointerDown()||(ye(),xe())}).on("step",te=>{y=te.pos,xe()}).on("end",te=>{o!=null&&o.isPointerDown()||(y=te.pos,r&&!g&&(y<R||y>v)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:Ae(R,y,v)}).start():E||(E=!0,P("settle")))}),function(){const te=J("gestures");p&&te!==!1&&(o=an(p,te).on("start",ne=>{var D,V;if(!r)return;const{srcEvent:H}=ne;function K(le){const we=window.getComputedStyle(le),Ee=new DOMMatrixReadOnly(we.transform);return{width:Ee.m41||0,height:Ee.m42||0}}w&&qt(H),r.pause(),r.getCurrentVelocities().pos=0;const ie=(D=N[C])===null||D===void 0?void 0:D.slides[0];ie&&B.has(ie.index)&&ie.el&&(y=ie.offset||0,y+=(K(ie.el)[x]||0)*(k&&!w?1:-1)),ge(),g||(y<R||y>v)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((V=r.getCurrentVelocities())===null||V===void 0?void 0:V.pos)||0,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:Ae(R,y,v)}).start()}).on("move",ne=>{const{srcEvent:D,axis:V}=ne,H=ne.srcEvent.target;H&&tn(H)||(V||(D.stopPropagation(),D.stopImmediatePropagation()),(V==="y"&&w||V==="x"&&!w)&&(qt(D),D.stopPropagation()))}).on("panstart",ne=>{(ne==null?void 0:ne.axis)===(w?"y":"x")&&De(p,"is-dragging")}).on("panend",()=>{ft(p,"is-dragging")}).on("pan",ne=>{var D;const{deltaX:V,deltaY:H,currentTouch:K,axis:ie}=ne;if(!r||K.length>1||ie==="y"&&!w||ie==="x"&&w)return;const le=k&&!w?1:-1;let we=w?H:V,Ee=r!=null&&r.isRunning()?r.getEndValues().pos:y,Me=1;g||(Ee<=R&&we*le<0?(Me=Math.max(.01,1-Math.abs(1/I()*Math.abs(Ee-R))),Me*=.2):Ee>=v&&we*le>0&&(Me=Math.max(.01,1-Math.abs(1/I()*Math.abs(Ee-v))),Me*=.2)),Ee+=we*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:y}).to({pos:Ee}).start()}).on("end",ne=>{var D,V;const{axis:H,velocityX:K,velocityY:ie,currentTouch:le}=ne,we=N.length,Ee=J("dragFree");if(le.length>0||!r||!we)return;const Me=J("vertical")?ie:K;let _e=r!=null&&r.isRunning()?r.getEndValues().pos:y;const Ye=k&&!w?1:-1;if(_e+=Me*(Ee?5:1)*Ye,!g&&(Me*Ye<=0&&_e<R||Me*Ye>=0&&_e>v)){let ze=0;return Math.abs(Me)>0&&(ze=2*Math.abs(Me),ze=Math.min(.3*I(),ze)),_e=Ae(R+-1*ze,_e,v+ze),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Me,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:_e}).start()}if(Ee||!((D=h.Autoscroll)===null||D===void 0)&&D.isEnabled())return void(Math.abs(Me)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Me,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:_e}).start():r.isRunning()||E||(E=!0,P("settle")));if(!Ee&&!(!((V=h.Autoscroll)===null||V===void 0)&&V.isEnabled())&&(!ne.offsetX&&!ne.offsetY||H==="y"&&!w||H==="x"&&w))return void Be(C,{transition:"tween"});let Je=$e(_e);Math.abs(Me)>10&&Je===C&&(Je+=Me>0?k&&!w?1:-1:k&&!w?-1:1),Be(Je,{transition:"tween",tween:{tension:160,friction:25,velocity:-1*Me}})}).init())}(),re(),function(){if(f&&(f.addEventListener("click",he,{passive:!1}),document.addEventListener("mousemove",oe),!i)){let te=null;i=new ResizeObserver(ne=>{te||(te=requestAnimationFrame(()=>{(function(D){if(!f)return;let V=D[0].contentBoxSize[0].blockSize,H=D[0].contentBoxSize[0].inlineSize;if(c===0)return z=V,ae=H,c=1,xe(),Se(),void P("ready");if(c!==1)return;const K=N.length;re();const ie=f.getBoundingClientRect();V=ie.height,H=ie.width,K>1&&(w&&Math.abs(V-z)<.5||!w&&Math.abs(H-ae)<.5)||(z=V,ae=H,w&&!V||!w&&!H||f&&p&&(K===N.length&&(o!=null&&o.isPointerDown())||(J("dragFree")&&(g||y>R&&y<v)?(ye(),xe()):Be(C,{transition:!1}))))})(ne),te=null}))}),i.observe(f)}}())}}function oe(L){_r=L}function se(L="*"){var _;const q=[];for(const Y of T)(L==="*"||Y.class&&Y.class.includes(L)||Y.el&&(!((_=Y.el)===null||_===void 0)&&_.classList.contains(L)))&&q.push(Y);s=void 0,b=L,S=[...q]}function ye(){if(!r)return;const L=$e(r!=null&&r.isRunning()?r.getEndValues().pos:y);L!==C&&(s=C,C=L,Ve(),Se(),Fe(),P("change",C,s))}function Se(){var L;if(!f)return;Ct(p,"is-draggable",!!o&&N.length>0);for(const Y of f.querySelectorAll("[data-carousel-index]"))Y.innerHTML=C+"";for(const Y of f.querySelectorAll("[data-carousel-page]"))Y.innerHTML=C+1+"";for(const Y of f.querySelectorAll("[data-carousel-pages]"))Y.innerHTML=N.length+"";let _=!1;const q=(L=N[C])===null||L===void 0?void 0:L.slides[0];q&&(q.downloadSrc||q.type==="image"&&q.src)&&(_=!0);for(const Y of f.querySelectorAll("[data-carousel-download]"))Y.toggleAttribute("aria-disabled",!_)}function Fe(L){var _;if(!f)return;L||(L=(_=N[C])===null||_===void 0?void 0:_.slides[0]);const q=L.el;if(q)for(const Y of q.querySelectorAll("[data-slide-index]"))Y.innerHTML=L.index+1+""}function $e(L){if(!N.length||!r)return 0;const _=ee();let q=L;g?q-=Math.floor((L-N[0].pos)/_)*_:q=Ae(N[0].pos,L,N[N.length-1].pos);const Y=new Map;let me=0;for(const ne of N){const D=Math.abs(ne.pos-q),V=Math.abs(ne.pos-q-_),H=Math.abs(ne.pos-q+_),K=Math.min(D,V,H);Y.set(me,K),me++}const te=Y.size>0?[...Y.entries()].reduce((ne,D)=>D[1]<ne[1]?D:ne):[C,0];return parseInt(te[0])}function Ne(){return p&&parseFloat(getComputedStyle(p).getPropertyValue("--f-carousel-gap"))||0}function I(){return p&&p.getBoundingClientRect()[x]||0}function ee(L=!0){const _=Ne();return S.reduce((q,Y)=>q+Y.dim,0)+(S.length-(g&&L?0:1))*_}function Q(L){const _=Ne(),q=ee();let Y=I();if(!p)return[];const me=[];if(!q||!Y)return[];L=L===void 0?y:L,g&&(L-=Math.floor(L/q)*q);let te=0,ne=0;if(u){const V=p.getBoundingClientRect();te=V.left,ne=V.right-V.width}let D=0;for(let V of S){const H=(K=0)=>{me.indexOf(V)>-1||(V.pos=D-L+K||0,V.offset+K>L-V.dim-te+.51&&V.offset+K<L+Y+ne-.51&&me.push(V))};if(V.offset=D,g)for(let K=-1;K<=1;K++)H(q*K);else H();D+=V.dim+_}return me}function M(L,_){const q=[];for(const Y of Array.isArray(L)?L:[L]){const me=F(Object.assign(Object.assign({},Y),{isVirtual:!0}));q.push(me)}T.splice(_===void 0?T.length:_,0,...q),W();for(const Y of q)Z(Y);return se(b),q}function F(L){return(Ie(L)||L instanceof HTMLElement)&&(L={html:L}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},L)}function Z(L){if(!L)return;let _=L.el;_||(_=document.createElement("div"),L.el=_);const q=L.html?L.html instanceof HTMLElement?L.html:xt(L.html):void 0;q&&(De(q,"f-html"),L.htmlEl=q,De(_,"has-html"),_.append(q),P("contentReady",L))}function j(L){if(!p||!L)return;let _=L.el;if(_){if(_.setAttribute("index",L.index+""),_.parentElement!==p){let q;De(_,d.classes.slide),De(_,L.class),Ve(L);for(const Y of T)if(Y.index>L.index){q=Y.el;break}p.insertBefore(_,q&&p.contains(q)?q:null),P("attachSlideEl",L)}return _}}function X(L){const _=L==null?void 0:L.el;_&&(_.remove(),de(_),P("detachSlideEl",L))}function W(){for(let L=0;L<T.length;L++){const _=T[L],q=_.el;q&&(_.index!==L&&de(q),q.setAttribute("index",`${L}`)),_.index=L}}function re(){var L,_,q,Y;if(!f||!p)return;k=J("rtl"),w=J("vertical"),x=w?"height":"width";const me=J("classes");Ct(f,me.isLTR,!k),Ct(f,me.isRTL,k),Ct(f,me.isHorizontal,!w),Ct(f,me.isVertical,w),Ct(f,me.hasAdaptiveHeight,J("adaptiveHeight"));const te=p.getBoundingClientRect();if(!te.width&&!te.height)return;const ne=function(){let V=0;if(p){let H=document.createElement("div");De(H,d.classes.slide),p.appendChild(H),V=H.getBoundingClientRect()[x],H.remove(),H=void 0}return V}();for(const V of S){const H=V.el;let K=0;if(!V.isVirtual&&H&&jt(H)){let ie=!1;H.parentElement&&H.parentElement===p||(p.appendChild(H),ie=!0),K=H.getBoundingClientRect()[x],ie&&((L=H.parentElement)===null||L===void 0||L.removeChild(H))}else K=ne;V.dim=K}(function(){if(!f)return;W();const V=I(),H=Ne(),K=ee(!1);let ie=J("slidesPerPage");ie=ie==="auto"?1/0:parseFloat(ie+""),N=[];let le=0,we=0;for(const Oe of S)(!N.length||le+Oe.dim-V>.05||we>=ie)&&(N.push({index:N.length,slides:[],dim:0,offset:0,pos:0}),le=0,we=0),N[N.length-1].slides.push(Oe),le+=Oe.dim+H,we++;const Ee=J("center"),Me=J("fill"),_e=J("infinite");let Ye=0;for(const Oe of N){Oe.dim=(Oe.slides.length-1)*H;for(const at of Oe.slides)Oe.dim+=at.dim;Oe.offset=Ye,Oe.pos=Ye,Ee!==!1&&(Oe.pos-=.5*(V-Oe.dim)),Me&&!_e&&K>V&&(Oe.pos=Ae(0,Oe.pos,K-V)),Ye+=Oe.dim+H}const Je=[];let ze;for(const Oe of N){const at=Object.assign({},Oe);ze&&at.pos===ze.pos?(ze.dim+=at.dim,ze.slides=[...ze.slides,...at.slides]):(ze=at,at.index=Je.length,Je.push(at))}N=Je,Se()})();let D=I();if(u){const V=p.getBoundingClientRect();D+=V.left,D+=V.right-V.width}if(g=J("infinite")&&N.length>1&&ee()-(D+(((_=S[0])===null||_===void 0?void 0:_.dim)||0))>-.5,R=((q=N[0])===null||q===void 0?void 0:q.pos)||0,v=((Y=N[N.length-1])===null||Y===void 0?void 0:Y.pos)||0,c===0)(function(){var V;s=void 0,C=J("initialPage");const H=J("initialSlide")||void 0;H!==void 0&&(C=be.getPageIndex(H)||0),C=Ae(0,C,N.length-1),y=((V=N[C])===null||V===void 0?void 0:V.pos)||0,$=y})();else{const V=r!=null&&r.isRunning()?r.getEndValues().pos:y;(V<R||V>v)&&(C=Ae(0,C,N.length-1),$=N[C||0].pos||0)}P("refresh")}function de(L){if(!L||!jt(L))return;const _=parseInt(L.getAttribute("index")||"-1");let q="";for(const me of Array.from(L.classList)){const te=me.match(/^f-(\w+)(Out|In)$/);te&&te[1]&&(q=te[1]+"")}if(!L||!q)return;const Y=[`f-${q}Out`,`f-${q}In`,"to-prev","to-next","from-prev","from-next"];L.removeEventListener("animationend",fe),ft(L,Y.join(" ")),B.delete(_)}function ge(){if(!p)return;const L=B.size;for(const _ of S)de(_.el);B.clear(),L&&xe()}function fe(L){L.animationName.substring(0,2)==="f-"&&(de(L.target),B.size||(ft(f,"in-transition"),!E&&Math.abs(be.getPosition(!0)-$)<.5&&(E=!0,P("settle"))),xe())}function he(L){if(L.defaultPrevented)return;const _=L.composedPath()[0];if(_.closest("[data-carousel-go-prev]"))return qt(L),void be.prev();if(_.closest("[data-carousel-go-next]"))return qt(L),void be.next();const q=_.closest("[data-carousel-go-to]");if(q)return qt(L),void be.goTo(parseFloat(q.dataset.carouselGoTo||"")||0);if(_.closest("[data-carousel-download]")){qt(L);const Y=N[C].slides[0];if(Y.downloadSrc||Y.type==="image"&&Y.src){const me=Y.downloadFilename,te=document.createElement("a"),ne=Y.downloadSrc||Y.src||"";te.href=ne,te.target="_blank",te.download=me||ne,te.click()}}else P("click",L)}function pe(L){var _;const q=L.el;q&&((_=q.querySelector(".f-spinner"))===null||_===void 0||_.remove(),ft(q,"is-loading"))}function ve(L){var _;const q=L.el;q&&((_=q.querySelector(".f-html.is-error"))===null||_===void 0||_.remove(),ft(q,"has-error"))}function Ve(L){var _;L||(L=(_=N[C])===null||_===void 0?void 0:_.slides[0]);const q=L==null?void 0:L.el;if(!q)return;let Y=J("formatCaption",L);Y===void 0&&(Y=L.caption),Y=Y||"";const me=J("captionEl");if(me&&me instanceof HTMLElement){if(L.index!==C)return;if(Ie(Y)&&(me.innerHTML=ce(Y+"")),Y instanceof HTMLElement){if(Y.parentElement===me)return;me.innerHTML="",Y.parentElement&&(Y=Y.cloneNode(!0)),me.append(Y)}return}if(!Y)return;let te=L.captionEl||q.querySelector(".f-caption");!te&&Y instanceof HTMLElement&&Y.classList.contains("f-caption")&&(te=Y),te||(te=document.createElement("div"),De(te,"f-caption"),Ie(Y)?te.innerHTML=ce(Y+""):Y instanceof HTMLElement&&(Y.parentElement&&(Y=Y.cloneNode(!0)),te.append(Y)));const ne=`f-caption-${Rr}_${L.index}`;te.setAttribute("id",ne),te.dataset.selectable="true",De(q,"has-caption"),q.setAttribute("aria-labelledby",ne),L.captionEl=te,q.insertAdjacentElement("beforeend",te)}function Be(L,_){let{transition:q,tween:Y}=Object.assign({transition:d.transition,tween:d.tween},_||{});if(!f||!r)return;const me=N.length;if(!me||function(ne,D){var V,H,K,ie;if(!(f&&r&&D&&Ie(D)&&D!=="tween")||((V=N[C])===null||V===void 0?void 0:V.slides.length)>1)return!1;const le=N.length;let we=ne>C?1:-1;ne=g?(ne%le+le)%le:Ae(0,ne,le-1),k&&(we*=-1);const Ee=(H=N[C])===null||H===void 0?void 0:H.slides[0],Me=Ee==null?void 0:Ee.index,_e=(K=N[ne])===null||K===void 0?void 0:K.slides[0],Ye=_e==null?void 0:_e.index,Je=(ie=N[ne])===null||ie===void 0?void 0:ie.pos;if(Ye===void 0||Me===void 0||Me===Ye||y===Je||Math.abs(I()-((_e==null?void 0:_e.dim)||0))>1)return!1;E=!1,r.pause(),ge(),De(f,"in-transition"),y=$=Je;const ze=j(Ee),Oe=j(_e);return ye(),ze&&(B.add(Me),ze.style.transform="",ze.addEventListener("animationend",fe),ft(ze,d.classes.isSelected),De(ze,`f-${D}Out to-${we>0?"next":"prev"}`)),Oe&&(B.add(Ye),Oe.style.transform="",Oe.addEventListener("animationend",fe),De(Oe,d.classes.isSelected),De(Oe,`f-${D}In from-${we>0?"prev":"next"}`)),xe(),!0}(L,q))return;L=g?(L%me+me)%me:Ae(0,L,me-1),$=N[L||0].pos||0;const te=r.isRunning()?r.getEndValues().pos:y;if(Math.abs($-te)<1)return y=$,C!==L&&(Ve(),Se(),Fe(),s=C,C=L,P("change",C,s)),xe(),void(E||(E=!0,P("settle")));if(r.pause(),ge(),g){const ne=ee(),D=Math.floor((te-N[0].pos)/ne),V=$+D*ne;$=[V+ne,V,V-ne].reduce(function(H,K){return Math.abs(K-te)<Math.abs(H-te)?K:H})}q!==!1&&Xe(Y)?r.spring(Y).from({pos:y}).to({pos:$}).start():(y=$,ye(),xe(),E||(E=!0,P("settle")))}function xe(){var L;if(!f||!p)return;const _=N[C];A=Q();const q=new Set;let Y;const me=[];for(const te of S){if(te.isVirtual&&!B.has(te.index)&&A.indexOf(te)<0)continue;let ne=j(te);if(!ne)continue;me.push(te);const D=((L=_==null?void 0:_.slides)===null||L===void 0?void 0:L.indexOf(te))>-1;if(D&&q.add(ne),!B.has(te.index)){const V=te.pos?Math.round(1e4*te.pos)/1e4:0,H=w?0:k?-1*V:V,K=w?V:0,ie=Ta(H,0,te.dim,0,100),le=Ta(K,0,te.dim,0,100),we=d.setTransform||void 0;we instanceof Function?we(be,te,{x:H,y:K,xPercent:ie,yPercent:le}):ne.style.transform=H||K?`translate3d(${ie}%, ${le}%,0)`:""}if(J("adaptiveHeight")&&D){const V=(ne.firstElementChild||ne).getBoundingClientRect().height;Y=Y==null?V:Math.max(Y,V)}}[...Aa(p,`.${d.classes.slide}`)].forEach(te=>{const ne=parseInt(te.getAttribute("index")||"-1"),D=T[ne];D||te.remove(),Ct(te,d.classes.isSelected,q.has(te)),D.isVirtual&&!B.has(D.index)&&A.indexOf(D)<0&&X(D)}),p&&Y&&(p.style.height=`${Y}px`),P("render",me)}function Te(){var L;f==null||f.removeEventListener("click",he),ge(),document.removeEventListener("mousemove",oe),i==null||i.disconnect(),i=void 0;for(const _ of T)_.el&&jt(_.el)&&(_.state=void 0,pe(_),ve(_),X(_),_.isVirtual?((L=_.el)===null||L===void 0||L.remove(),_.el=void 0):(_.el.style.transform="",p==null||p.appendChild(_.el)));for(const _ of Object.values(h))_==null||_.destroy();h={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const _ of Object.values(d.classes||{}))ft(f,_);ft(p,"is-draggable")}const be={add:function(L,_){const q=y,Y=$,me=M(L,_);for(const te of me)P("addSlide",te);return se(b),re(),r&&Y!==$&&r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:q}).to({pos:$}).start(),xe(),be},canGoPrev:function(){return g||C>0},canGoNext:function(){return g||C<N.length-1},destroy:function(){return P("destroy"),window.removeEventListener("resize",G),Te(),O.clear(),f=null,N=[],T=[],d=Object.assign({},Wt),h={},S=[],l="",b="*",c=2,be},emit:P,filter:function(L="*"){return se(L),re(),xe(),P("filter",L),be},getContainer:function(){return f},getGapDim:Ne,getGestures:function(){return o},getLastMouseMove:function(){return _r},getOptions:function(){return d},getPage:function(){return N[C]},getPageIndex:function(L){if(L!==void 0){for(const _ of N||[])for(const q of _.slides)if(q.index===L)return _.index;return-1}return C},getPageProgress:function(L,_){L===void 0&&(L=C);const q=N[L];if(!q)return L>C?-1:1;const Y=ee(),me=Ne();let te=q.pos,ne=be.getPosition();if(g&&_!==!0){const D=Math.floor((ne-N[0].pos)/Y);ne-=D*Y,te=[te+Y,te,te-Y].reduce(function(V,H){return Math.abs(H-ne)<Math.abs(V-ne)?H:V})}return(ne-te)/(q.dim+me)},getPageVisibility:function(L){L===void 0&&(L=C);const _=N[L];if(!_)return L>C?-1:1;const q=be.getPosition(),Y=I();let me=_.pos;if(g){const te=be.getPosition(),ne=ee(),D=me+Math.floor((te-N[0].pos)/ne)*ne;me=[D+ne,D,D-ne].reduce(function(V,H){return Math.abs(H-te)<Math.abs(V-te)?H:V})}return me>q&&me+_.dim<q+Y?1:me<q?(me+_.dim-q)/_.dim:me+_.dim>q+Y?(q+Y-me)/_.dim:0},getPages:function(){return N},getPlugins:function(){return h},getPosition:function(L){var _;let q=y;if(g&&L!==!0){const Y=ee();q-=Math.floor((y-((_=N[0])===null||_===void 0?void 0:_.pos)||0)/Y)*Y}return q},getSlides:function(){return T},getState:function(){return c},getTotalSlideDim:ee,getTween:function(){return r},getViewport:function(){return p},getViewportDim:I,getVisibleSlides:function(L){return L===void 0?A:Q(L)},goTo:Be,hasNavigated:function(){return s!==void 0},hideError:ve,hideLoading:pe,init:function(){if(!t||!jt(t))throw new Error("No Element found");return c!==0&&(Te(),c=0),f=t,m=n,window.removeEventListener("resize",G),m.breakpoints&&window.addEventListener("resize",G),G(),be},isInfinite:function(){return g},isInTransition:function(){return B.size>0},isRTL:function(){return k},isSettled:function(){return E},localize:function(L,_=[]){return ce(L,_)},next:function(L={}){return Be(C+1,L),be},off:function(L,_){for(const q of L instanceof Array?L:[L])O.has(q)&&O.set(q,O.get(q).filter(Y=>Y!==_));return be},on:function(L,_){for(const q of L instanceof Array?L:[L])O.set(q,[...O.get(q)||[],_]);return be},prev:function(L={}){return Be(C-1,L),be},remove:function(L){L===void 0&&(L=T.length-1);const _=T[L];return _&&(P("removeSlide",_),_.el&&(de(_.el),_.el.remove(),_.el=void 0),T.splice(L,1),se(b),re(),xe()),be},setPosition:function(L){y=L,ye(),xe()},showError:function(L,_){pe(L),ve(L);const q=L.el;if(q){const Y=document.createElement("div");De(Y,"f-html"),De(Y,"is-error"),Y.innerHTML=ce(_||"<p>{{ERROR}}</p>"),L.htmlEl=Y,De(q,"has-html"),De(q,"has-error"),q.insertAdjacentElement("afterbegin",Y),P("contentReady",L)}return be},showLoading:function(L){const _=L.el,q=_==null?void 0:_.querySelector(".f-spinner");if(!_||q)return be;const Y=J("spinnerTpl"),me=xt(Y);return me&&(De(me,"f-spinner"),De(_,"is-loading"),_.insertAdjacentElement("beforeend",me)),be},version:"6.0.16"};return be};_n.l10n={en_EN:Da},_n.getDefaults=()=>Wt;/*! License details at fancyapps.com/license */const Hr=(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 c=parseFloat(window.getComputedStyle(i).marginRight);c&&i.style.setProperty(a,`${c}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 zr(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const St=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const jr={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=Nt(this.defaults,a);const{transitional:o,paramsSerializer:r,headers:i}=a;o!==void 0&&Cn.assertOptions(o,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),r!=null&&(U.isFunction(r)?a.paramsSerializer={serialize:r}:Cn.assertOptions(r,{encode:ct.function,serialize:ct.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),Cn.assertOptions(a,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.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"],u=>{delete i[u]}),a.headers=tt.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(a)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const m=[];this.interceptors.response.forEach(function(g){m.push(g.fulfilled,g.rejected)});let d,h=0,f;if(!c){const u=[Zo.bind(this),void 0];for(u.unshift.apply(u,l),u.push.apply(u,m),f=u.length,d=Promise.resolve(a);h<f;)d=d.then(u[h++],u[h++]);return d}f=l.length;let p=a;for(h=0;h<f;){const u=l[h++],g=l[h++];try{p=u(p)}catch(k){g.call(this,k);break}}try{d=Zo.call(this,p)}catch(u){return Promise.reject(u)}for(h=0,f=m.length;h<f;)d=d.then(m[h++],m[h++]);return d}getUri(n){n=Nt(this.defaults,n);const a=Ro(n.baseURL,n.url,n.allowAbsoluteUrls);return Ao(a,n.params,n.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(n){At.prototype[n]=function(a,o){return this.request(Nt(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(Nt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}At.prototype[n]=a(),At.prototype[n+"Form"]=a(!0)});let k0=class Bi{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 Pt(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 Bi(function(r){n=r}),cancel:n}}};function x0(t){return function(a){return t.apply(null,a)}}function b0(t){return U.isObject(t)&&t.isAxiosError===!0}const ua={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};Object.entries(ua).forEach(([t,n])=>{ua[n]=t});function Ko(t){const n=new At(t),a=po(At.prototype.request,n);return U.extend(a,At.prototype,n,{allOwnKeys:!0}),U.extend(a,n,null,{allOwnKeys:!0}),a.create=function(r){return Ko(Nt(t,r))},a}const Re=Ko(Qt);Re.Axios=At,Re.CanceledError=Pt,Re.CancelToken=k0,Re.isCancel=$o,Re.VERSION=Yo,Re.toFormData=kn,Re.AxiosError=Ce,Re.Cancel=Re.CanceledError,Re.all=function(n){return Promise.all(n)},Re.spread=x0,Re.isAxiosError=b0,Re.mergeConfig=Nt,Re.AxiosHeaders=tt,Re.formToJSON=t=>Lo(U.isHTMLForm(t)?new FormData(t):t),Re.getAdapter=Uo.getAdapter,Re.HttpStatusCode=ua,Re.default=Re;const{Axios:hb,AxiosError:pb,CanceledError:gb,isCancel:yb,CancelToken:kb,VERSION:xb,all:bb,Cancel:wb,isAxiosError:Eb,spread:vb,toFormData:Cb,AxiosHeaders:Sb,HttpStatusCode:Bb,formToJSON:Vb,getAdapter:Mb,mergeConfig:Nb}=Re,ma=Vt.defineStore("auth",{state:()=>({jwtToken:null,refreshToken:null}),actions:{setToken(t,n=null){this.jwtToken=t,n&&(this.refreshToken=n),this._syncToLocalStorage()},setRefreshToken(t){this.refreshToken=t,this._syncToLocalStorage()},clearToken(){this.jwtToken=null,this.refreshToken=null,localStorage.clear()},_syncToLocalStorage(){if(typeof window<"u"&&window.localStorage)try{if(!this.jwtToken&&!this.refreshToken)return;const t=localStorage.getItem("userData");if(t){const a=JSON.parse(t);this.jwtToken&&(a.access_token=this.jwtToken),this.refreshToken&&(a.refresh_token=this.refreshToken),localStorage.setItem("userData",JSON.stringify(a));return}localStorage.getItem("access_token")!==null&&(this.jwtToken&&localStorage.setItem("access_token",this.jwtToken),this.refreshToken&&localStorage.setItem("refresh_token",this.refreshToken))}catch(t){console.warn("Erro ao sincronizar token com localStorage:",t)}}},getters:{getToken:t=>t.jwtToken,getRefreshToken:t=>t.refreshToken}}),je=Re.create({baseURL:"https://back.dev-smclick.com.br/"}),Sn=Re.create();Sn.defaults.baseURL=je.defaults.baseURL;let fa=null,Qo=null,Jo=null;const er=()=>(fa||(fa=ma(Jo)),fa);function w0(t){Jo=t}function tr(t){Qo=t}je.interceptors.request.use(t=>{try{const a=er().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)),je.interceptors.response.use(t=>t,async t=>{if(!t.response)return Promise.reject(t);const n=t.response.status;if(n.toString()[0]==="5")return console.error("Erro inesperado no servidor:",t),Promise.reject(t);if(n===401){const a=er(),o=a.refreshToken;if(o)try{const r=Qo||`${Sn.defaults.baseURL}v1/api/attendances/token/refresh/`,s=(await Sn.post(r,{refresh:o})).data.access;return a.setToken(s,o),t.config.headers.Authorization=`Bearer ${s}`,je.request(t.config)}catch(r){return console.error("Erro ao fazer refresh do token:",r),a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500),Promise.reject(r)}else a.clearToken(),typeof window<"u"&&window.location&&setTimeout(()=>{window.location.href="/login"},500)}return Promise.reject(t)});function E0(t){t&&(je.defaults.baseURL=t,Sn.defaults.baseURL=t)}const v0="v1/api/attendances/attendant/",C0="v1/api/attendances/department/",ha="v1/api/attendances/internal_chat/",S0="v1/api/instances/instance/",B0="v1/api/crm/event/scheduled_message/",V0="v1/api/crm/event/calendar",M0="v1/api/crm/products/",N0="v1/api/contacts/tag/",A0="/v1/api/contacts/segmentation_field/",T0="v1/api/attendances/calls/",pa=Vt.defineStore("instance",{state:()=>({instances:[],count:null,loaded:!1}),actions:{async fetchInstances(t=""){try{let n=`${S0}`;const a=await je.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}}}),D0={class:"w-full relative text-current"},L0={class:"flex cursor-pointer justify-between items-center"},F0={key:0},$0={key:0},P0={key:1,class:"flex items-center gap-2"},O0={class:"flex gap-3 items-center flex-shrink-0"},_0={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"w-5 h-5 text-green-400",viewBox:"0 0 16 16"},R0={key:1,class:"relative"},H0={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"},z0={class:"my-auto text-center mx-auto group-hover:inline-block"},j0={key:1,class:"flex justify-center"},G0={class:"w-full"},I0={key:1,class:"flex items-center gap-2 justify-center"},q0={class:"flex px-4 items-center gap-2"},W0={key:0,class:"absolute top-[48px] w-full z-20 text-sm"},U0={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"},Z0={class:"select-none cursor-pointer w-full"},Y0=["onClick","disabled"],X0={class:"flex w-full items-center pl-2 gap-3"},K0={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"},Q0={key:1,class:"relative"},J0={style:{color:"#0081FB"},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"icon-meta",viewBox:"0 0 16 16"},el={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"},tl={class:"w-full text-center"},nl={class:"my-auto text-center mx-auto group-hover:inline-block"},al={key:1,class:"flex justify-center"},ol={class:"flex min-w-[50px] text-sm text-center items-center my-auto flex-shrink-0 px-1 justify-center"},rl={key:1,class:"p-4"},nr={__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=pa(),o=e.ref(!1),r=e.ref(null),i=t,s=n;function l(c){r.value=c,s("function",c)}return e.watch(()=>i.modelValue,c=>{r.value=c},{immediate:!0}),e.watch(r,c=>{s("update:modelValue",c)}),e.onMounted(async()=>{if(r.value){const c=a.instances.find(m=>m.id===r.value.id);c&&(r.value.status=c.status)}s("component-mounted")}),(c,m)=>{const d=e.resolveComponent("Popper");return e.openBlock(),e.createElementBlock("main",D0,[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",L0,[e.createElementVNode("p",{onClick:m[0]||(m[0]=h=>o.value=!o.value),class:"w-full p-3 px-4 select-none"},[e.unref(a).loaded?(e.openBlock(),e.createElementBlock("div",F0,[r.value?(e.openBlock(),e.createElementBlock("span",P0,[e.createElementVNode("header",O0,[r.value.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",_0,m[3]||(m[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",R0,[m[5]||(m[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",H0,m[4]||(m[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(d,{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",z0,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",j0,m[6]||(m[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",G0,e.toDisplayString(r.value.name),1)])):(e.openBlock(),e.createElementBlock("span",$0,e.toDisplayString(e.unref(a).instances?e.unref(a).instances.length:"Sem")+" Instâncias disponíveis",1))])):(e.openBlock(),e.createElementBlock("div",I0,m[7]||(m[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...")])))]),e.createElementVNode("footer",q0,[e.createElementVNode("button",{onClick:m[1]||(m[1]=h=>(r.value=null,o.value=!1))},m[8]||(m[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:m[2]||(m[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"},m[9]||(m[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",W0,[e.createElementVNode("ul",U0,[e.unref(a).instances.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).instances,(h,f)=>{var p;return e.openBlock(),e.createElementBlock("li",Z0,[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:u=>(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",X0,[h.type==="whatsapp-qrcode"?(e.openBlock(),e.createElementBlock("svg",K0,m[10]||(m[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",Q0,[m[12]||(m[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",J0,m[11]||(m[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(d,{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 u;return[t.type&&h.type!==t.type||t.webhooks!==void 0&&t.webhooks!==((u=h.config)==null?void 0:u.webhooks)?(e.openBlock(),e.createElementBlock("svg",el,m[13]||(m[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",tl,e.toDisplayString(h.name),1),e.createVNode(d,{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",nl,e.toDisplayString(h.status===!0?"Conectada":h.status===!1?"Desconectada":"Indefinida"),1)],2)]),default:e.withCtx(()=>[h.isLoading?(e.openBlock(),e.createElementBlock("div",al,m[14]||(m[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",ol,[h.telephone?(e.openBlock(),e.createBlock(d,{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(()=>[m[15]||(m[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,__:[15]},1024)):e.createCommentVNode("",!0)])],10,Y0)])}),256)):(e.openBlock(),e.createElementBlock("div",rl," Sem instâncias disponíveis"))])])):e.createCommentVNode("",!0)])}}},il=["aria-labelledby","aria-describedby"],sl={class:"cpk-popover__header border-base-100"},ll=["id"],cl=["disabled"],dl=["id"],ul={class:"cpk-popover__details bg-base-200 border border-base-100"},ml={class:"cpk-popover__footer"},fl=["disabled"],hl=["disabled"],pl={key:0,class:"loading-spinner"},gl=ke({__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:E=>o("update:modelValue",E)}),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 c(){o("cancel",a.context),r.value=!1}function m(){a.loading||o("confirm",a.context)}let d,h,f=[];function p(){if(a.anchorRect)return a.anchorRect;const E=a.anchorEl instanceof Element?a.anchorEl:null;if(E)return E.getBoundingClientRect();const C=document.activeElement instanceof Element?document.activeElement:null;return C?C.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 u(){if(!r.value)return;const E=window.innerWidth,C=window.innerHeight,$=a.viewportPadding,R=p(),v=i.value?i.value.getBoundingClientRect():{width:320,height:200},b=a.placement==="auto"?["bottom","top","right","left"]:[a.placement];let T=b[0],S=0,B=0;const A=R.left+R.width/2-v.width/2,N=R.top+R.height/2-v.height/2,z=R.left,ae=R.left+R.width-v.width,J=R.top,ce=R.top+R.height-v.height;for(const O of b){if(O==="bottom"&&(B=R.bottom+a.offset,S=a.align==="start"?z:a.align==="end"?ae:A,B+v.height+$<=C)){T="bottom";break}if(O==="top"&&(B=R.top-v.height-a.offset,S=a.align==="start"?z:a.align==="end"?ae:A,B>=$)){T="top";break}if(O==="right"&&(S=R.right+a.offset,B=a.align==="start"?J:a.align==="end"?ce:N,S+v.width+$<=E)){T="right";break}if(O==="left"&&(S=R.left-v.width-a.offset,B=a.align==="start"?J:a.align==="end"?ce:N,S>=$)){T="left";break}}S=Math.min(Math.max($,S),E-v.width-$),B=Math.min(Math.max($,B),C-v.height-$),s.value={left:S,top:B,p:T}}function g(){k();let C=a.anchorEl instanceof Element?a.anchorEl:document.body;for(;C&&C!==document.body;)f.push(C),C=C.parentElement;f.push(window),f.forEach($=>$.addEventListener("scroll",u,{passive:!0}))}function k(){f.forEach(E=>{var C;return(C=E.removeEventListener)==null?void 0:C.call(E,"scroll",u)}),f=[]}e.watch(()=>r.value,async E=>{var C;if(E){await e.nextTick(),u(),g(),d=new ResizeObserver(u),d.observe(document.body);const $=a.anchorEl instanceof Element?a.anchorEl:null;$&&((C=h==null?void 0:h.disconnect)==null||C.call(h),h=new ResizeObserver(u),h.observe($)),window.addEventListener("resize",u),window.addEventListener("keydown",w)}else x()}),e.watch(()=>a.anchorEl,async E=>{var $;if(!r.value)return;await e.nextTick(),k(),g(),($=h==null?void 0:h.disconnect)==null||$.call(h);const C=E instanceof Element?E:null;C&&(h=new ResizeObserver(u),h.observe(C)),u()}),e.watch(()=>a.anchorRect,()=>{r.value&&u()}),e.watch(()=>[a.placement,a.align,a.offset,a.viewportPadding],()=>{r.value&&u()});function w(E){E.key==="Escape"&&c(),E.key==="Enter"&&m()}e.onMounted(()=>{window.addEventListener("mousemove",E=>{window.__lastMouseX=E.clientX,window.__lastMouseY=E.clientY},{passive:!0})}),e.onBeforeUnmount(x);function x(){k(),window.removeEventListener("resize",u),window.removeEventListener("keydown",w),d&&d.disconnect(),h&&h.disconnect()}const y=e.computed(()=>({left:`${s.value.left}px`,top:`${s.value.top}px`}));return(E,C)=>(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(c,["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(y.value),role:"dialog","aria-modal":"false","aria-labelledby":l.title,"aria-describedby":l.desc},[e.createElementVNode("div",sl,[C[0]||(C[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,ll),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:c,disabled:t.loading,"aria-label":"Fechar"}," × ",8,cl)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"cpk-popover__desc",id:l.desc},e.toDisplayString(t.description),9,dl)):e.createCommentVNode("",!0),e.createElementVNode("div",ul,[e.renderSlot(E.$slots,"details",{},void 0,!0)]),e.createElementVNode("div",ml,[e.createElementVNode("button",{type:"button",class:"cyber-button cyber-button--md",onClick:c,disabled:t.loading},e.toDisplayString(t.cancelLabel),9,fl),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button","cyber-button--md",t.destructive?"cyber-button--danger":"cyber-button--accent"]),onClick:m,disabled:t.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",pl)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loading?t.loadingLabel:t.confirmLabel),1)],10,hl)])],14,il)]),_:3})],32)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-b23001fc"]]);function Ot(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}function dt(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 ut(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],c=Array.isArray(l)?kl(l,h=>h.test(s)):yl(l,h=>h.test(s));let m;m=t.valueCallback?t.valueCallback(c):c,m=a.valueCallback?a.valueCallback(m):m;const d=n.slice(s.length);return{value:m,rest:d}}}function yl(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function kl(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function ar(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 or=6048e5,xl=864e5,rr=Symbol.for("constructDateFrom");function nt(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&rr in t?t[rr](n):t instanceof Date?new t.constructor(n):new Date(n)}function ga(t,...n){const a=nt.bind(null,n.find(o=>typeof o=="object"));return n.map(a)}let bl={};function Bn(){return bl}function ot(t,n){return nt(n||t,t)}function Tt(t,n){var l,c,m,d;const a=Bn(),o=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??a.weekStartsOn??((d=(m=a.locale)==null?void 0:m.options)==null?void 0:d.weekStartsOn)??0,r=ot(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 wl(t,n,a){const[o,r]=ga(a==null?void 0:a.in,t,n);return+Tt(o,a)==+Tt(r,a)}const El={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"}},vl=(t,n,a)=>{let o;const r=El[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},Cl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sl=(t,n,a,o)=>Cl[t],Bl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ml={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"]},Nl={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"]},Al={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"}},Tl={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"}},Dl={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:dt({values:Bl,defaultWidth:"wide"}),quarter:dt({values:Vl,defaultWidth:"wide",argumentCallback:t=>t-1}),month:dt({values:Ml,defaultWidth:"wide"}),day:dt({values:Nl,defaultWidth:"wide"}),dayPeriod:dt({values:Al,defaultWidth:"wide",formattingValues:Tl,defaultFormattingWidth:"wide"})},Ll=/^(\d+)(th|st|nd|rd)?/i,Fl=/\d+/i,$l={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},Pl={any:[/^b/i,/^(a|c)/i]},Ol={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_l={any:[/1/i,/2/i,/3/i,/4/i]},Rl={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},Hl={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]},zl={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},jl={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]},Gl={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},Il={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}},ql={ordinalNumber:ar({matchPattern:Ll,parsePattern:Fl,valueCallback:t=>parseInt(t,10)}),era:ut({matchPatterns:$l,defaultMatchWidth:"wide",parsePatterns:Pl,defaultParseWidth:"any"}),quarter:ut({matchPatterns:Ol,defaultMatchWidth:"wide",parsePatterns:_l,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ut({matchPatterns:Rl,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),day:ut({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:jl,defaultParseWidth:"any"}),dayPeriod:ut({matchPatterns:Gl,defaultMatchWidth:"any",parsePatterns:Il,defaultParseWidth:"any"})},Wl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ul={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Zl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yl={date:Ot({formats:Wl,defaultWidth:"full"}),time:Ot({formats:Ul,defaultWidth:"full"}),dateTime:Ot({formats:Zl,defaultWidth:"full"})},Xl={code:"en-US",formatDistance:vl,formatLong:Yl,formatRelative:Sl,localize:Dl,match:ql,options:{weekStartsOn:0,firstWeekContainsDate:1}},Kl={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"}},Ql=(t,n,a)=>{let o;const r=Kl[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},Jl={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},e2={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},t2={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},n2={date:Ot({formats:Jl,defaultWidth:"full"}),time:Ot({formats:e2,defaultWidth:"full"}),dateTime:Ot({formats:t2,defaultWidth:"full"})},a2={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"},o2=(t,n,a,o)=>{const r=a2[t];return typeof r=="function"?r(n):r},r2={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},i2={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},s2={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"]},l2={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"]},c2={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"}},d2={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"}},u2={ordinalNumber:(t,n)=>{const a=Number(t);return(n==null?void 0:n.unit)==="week"?a+"ª":a+"º"},era:dt({values:r2,defaultWidth:"wide"}),quarter:dt({values:i2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:dt({values:s2,defaultWidth:"wide"}),day:dt({values:l2,defaultWidth:"wide"}),dayPeriod:dt({values:c2,defaultWidth:"wide",formattingValues:d2,defaultFormattingWidth:"wide"})},m2=/^(\d+)[ºªo]?/i,f2=/\d+/i,h2={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},p2={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},g2={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},y2={any:[/1/i,/2/i,/3/i,/4/i]},k2={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},x2={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},w2={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]},E2={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},v2={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}},C2={ordinalNumber:ar({matchPattern:m2,parsePattern:f2,valueCallback:t=>parseInt(t,10)}),era:ut({matchPatterns:h2,defaultMatchWidth:"wide",parsePatterns:p2,defaultParseWidth:"any"}),quarter:ut({matchPatterns:g2,defaultMatchWidth:"wide",parsePatterns:y2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ut({matchPatterns:k2,defaultMatchWidth:"wide",parsePatterns:x2,defaultParseWidth:"any"}),day:ut({matchPatterns:b2,defaultMatchWidth:"wide",parsePatterns:w2,defaultParseWidth:"any"}),dayPeriod:ut({matchPatterns:E2,defaultMatchWidth:"any",parsePatterns:v2,defaultParseWidth:"any"})},ir={code:"pt-BR",formatDistance:Ql,formatLong:n2,formatRelative:o2,localize:u2,match:C2,options:{weekStartsOn:0,firstWeekContainsDate:1}},S2={scheduled_messages:"Mensagem programada"};function B2(t){return S2[t]||t||"Evento"}function ya(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function _t(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 en(t){const[n,a]=String(t||"").trim().split(" ");if(!n)return null;const[o,r,i]=n.split("-").map(m=>parseInt(m,10));let s=0,l=0;if(a){const[m,d]=a.split(":");s=parseInt(m||"0",10),l=parseInt(d||"0",10)}const c=new Date(o,(r||1)-1,i||1,s,l);return isNaN(c.getTime())?null:c}function V2(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 Vn(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 M2(){return"id-"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function ka(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=en(a.time)),!l&&(t!=null&&t.next_execution_at)&&(l=V2(t.next_execution_at)),!l)return null;const c=Array.isArray(n==null?void 0:n.message)?n.message[0]:null,m=c&&(c.content||c.text)||"",d=(t==null?void 0:t.function)||(n==null?void 0:n.function)||"",h=B2(d),f=(m||"").trim();return{id:(t==null?void 0:t.id)||M2(),date:l,time:Vn(l),type:t.function,status:t.status||null,scheduled_by:n.scheduled_by,title:h,content:f,functionName:d||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 sr(t=[]){const n=Array.isArray(t)?t:Array.isArray(t.results)?t.results:[],a=[];for(const o of n){const r=ka(o);r&&a.push(r)}return a.sort((o,r)=>o.date-r.date),a}async function N2(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 je.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 lr={scheduled_messages:"#3b82f6"},cr=["#10b981","#06b6d4","#22c55e","#eab308","#ef4444","#84cc16","#f472b6","#0ea5e9","#8b5cf6","#64748b"];function A2(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 T2(t={}){var s,l,c,m,d,h,f,p,u,g,k;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)||((c=(l=t==null?void 0:t.info)==null?void 0:l.department)==null?void 0:c.name)||((d=(m=t==null?void 0:t.info)==null?void 0:m.department)==null?void 0:d.id);if(a)return`dept:${a}`;const o=(t==null?void 0:t.instanceName)||((f=(h=t==null?void 0:t.info)==null?void 0:h.instance)==null?void 0:f.name)||((u=(p=t==null?void 0:t.info)==null?void 0:p.instance)==null?void 0:u.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)||((k=t==null?void 0:t.params)==null?void 0:k.chat_id);return i?`chat:${i}`:"misc"}function Mn(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(lr,n))return lr[n];const a=T2(t),o=A2(String(a))%cr.length;return cr[o]}const Rt=Vt.defineStore("attendant",{state:()=>({attendants:[],count:null,loaded:!1}),actions:{async fetchAttendants(){try{this.attendants=[];let t=`${v0}`;const n=await je.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)}}}),D2={class:"itemc-head"},L2={class:"minw0"},F2={class:"itemc-title"},$2={class:"itemc-sub"},P2={class:"flex items-center gap-1"},O2={class:"itemc-actions"},_2={class:"flex flex-col items-center"},R2={class:"time-badge"},H2={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},z2={class:"sched-pop__card bg-base-300",role:"dialog"},j2={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},G2={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"},I2=["disabled"],q2={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"},W2={key:1,class:"loading-spinner"},U2={class:"itemsb-head"},Z2=["src"],Y2={key:1,class:"avatar avatar--placeholder bg-base-100"},X2={class:"sched-pop",style:{position:"absolute",bottom:"-2px",right:"-2px"},tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},K2={class:"sched-pop__card bg-base-300",style:{left:"-100%",right:"auto",transform:"translate(10%, -50%) scale(0.98)"},role:"dialog"},Q2={class:"itemsb-main"},J2={class:"itemsb-row"},ec={class:"itemsb-title truncate"},tc={class:"itemsb-time"},nc={class:"itemsb-sub"},ac={class:"items-attendant"},oc={class:"itemsb-content"},rc={key:0,class:"itemsb-actions"},ic=["disabled"],sc={key:0,class:"loading-spinner"},lc={class:"event-left"},cc={class:"event-line"},dc={class:"event-actions"},uc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},mc={class:"sched-pop__card bg-base-300",role:"dialog"},fc={class:"sched-pop",tabindex:"0","aria-haspopup":"true","aria-label":"Agendado por"},hc={class:"sched-pop__card bg-base-300",role:"dialog"},pc={class:"event-time"},gc={key:0,class:"icon-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},yc={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"},kc=["disabled"],xc={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"},xa=ke({__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=Rt(),o=t,r=e.computed(()=>(o.getEventColor||Mn)(o.ev)),i=e.computed(()=>{var m;return((m=o.ev)==null?void 0:m.type)==="scheduled_messages"}),s=e.computed(()=>a.attendants.find(m=>m.is_me)||{}),l=m=>{const d=a.attendants.find(h=>h.id===m);return d?d.id===s.value.id?"Você":d.name||"Desconhecido":"Desconhecido"},c=e.computed(()=>{var d,h;const m=[];return(d=o.ev)!=null&&d.contactName&&m.push(o.ev.contactName),m.push(((h=o.ev)==null?void 0:h.departmentName)||"sem depto"),m.join(" • ")});return(m,d)=>{var h,f,p,u,g,k;return t.mode==="compact"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("header",D2,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"color-bar"},null,4),e.createElementVNode("div",L2,[e.createElementVNode("div",F2,e.toDisplayString(t.ev.contactName?t.ev.contactName+" • ":"")+" "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("div",$2,[e.createElementVNode("span",P2,[d[9]||(d[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",O2,[e.createElementVNode("div",_2,[e.createElementVNode("div",R2,e.toDisplayString(t.ev.time),1),e.createElementVNode("div",H2,[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",z2,[d[10]||(d[10]=e.createElementVNode("strong",null,"Status",-1)),d[11]||(d[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:d[0]||(d[0]=w=>m.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((f=t.ev)==null?void 0:f.status)===!0?(e.openBlock(),e.createElementBlock("svg",j2,d[12]||(d[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",G2,d[13]||(d[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:d[1]||(d[1]=w=>m.$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",q2,d[14]||(d[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",W2)):e.createCommentVNode("",!0)],8,I2)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:d[2]||(d[2]=w=>m.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},d[15]||(d[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",U2,[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,Z2)):(e.openBlock(),e.createElementBlock("div",Y2,d[16]||(d[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",X2,[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",K2,[d[17]||(d[17]=e.createElementVNode("strong",null,"Status",-1)),d[18]||(d[18]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])])],4),e.createElementVNode("div",Q2,[e.createElementVNode("div",J2,[e.createElementVNode("span",ec,e.toDisplayString(t.ev.contactName)+" • "+e.toDisplayString(t.ev.departmentName||"sem depto"),1),e.createElementVNode("span",tc,e.toDisplayString(t.ev.time),1)]),e.createElementVNode("div",nc,[e.createElementVNode("span",ac,[d[19]||(d[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",oc,e.toDisplayString(t.ev.content||t.ev.title),1),t.viewOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rc,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cyber-button cyber-button--sm cyber-button--primary",onClick:d[3]||(d[3]=w=>m.$emit("open-message",t.ev))},e.toDisplayString(((u=t.ev)==null?void 0:u.status)===!0?"Editar":"Visualizar"),1)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:d[4]||(d[4]=w=>m.$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",sc)):e.createCommentVNode("",!0),d[20]||(d[20]=e.createTextVNode(" Apagar "))],8,ic)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"cyber-button cyber-button--sm cyber-button--accent",onClick:d[5]||(d[5]=w=>m.$emit("open-chat",t.ev))}," Abrir conversa ")):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",lc,[e.createElementVNode("span",{style:e.normalizeStyle({background:r.value}),class:"event-color-bar"},null,4),e.createElementVNode("div",cc,e.toDisplayString(c.value),1)]),e.createElementVNode("footer",dc,[e.createElementVNode("div",uc,[d[23]||(d[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",mc,[d[21]||(d[21]=e.createElementVNode("strong",null,"Agendado por",-1)),d[22]||(d[22]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(l(t.ev.scheduled_by)),1)])]),e.createElementVNode("div",fc,[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",hc,[d[24]||(d[24]=e.createElementVNode("strong",null,"Status",-1)),d[25]||(d[25]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(t.ev.status===!0?"Ativo":"Executado"),1)])]),e.createElementVNode("div",pc,e.toDisplayString(t.ev.time),1),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d[6]||(d[6]=w=>m.$emit("open-message",t.ev)),class:"cyber-button cyber-button--xs cyber-button--primary","aria-label":"Editar mensagem programada"},[((k=t.ev)==null?void 0:k.status)===!0?(e.openBlock(),e.createElementBlock("svg",gc,d[26]||(d[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",yc,d[27]||(d[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:d[7]||(d[7]=w=>m.$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",xc,d[28]||(d[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,kc)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"cyber-button cyber-button--xs cyber-button--accent",onClick:d[8]||(d[8]=w=>m.$emit("open-chat",t.ev)),"aria-label":"Abrir conversa"},d[29]||(d[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-fb30306a"]]),yt=new Map,dr=Vt.defineStore("scheduled",{state:()=>({baseUrl:V0,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=_t(new Date)),this.loadedYM.has(t))return;const n=`${this.baseUrl}|${t}`;if(yt.has(n))return yt.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 je.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)||[],c=sr(l||[]);this._setMonth(t,c),this.loadedYM.add(t);let m=this.coerceHttps(((r=s==null?void 0:s.data)==null?void 0:r.next)||null);m&&(async()=>{var d,h;try{let f=m;for(;f;){const p=await je.get(f),u=Array.isArray(p==null?void 0:p.data)?p.data:((d=p==null?void 0:p.data)==null?void 0:d.results)||[],g=sr(u||[]);this._appendMonth(t,g),f=this.coerceHttps(((h=p==null?void 0:p.data)==null?void 0:h.next)||null)}}catch(f){console.warn("[scheduled] background paging error:",(f==null?void 0:f.message)||f)}})()}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{yt.delete(n),this.loadingYM.delete(t)}})();return yt.set(n,a),a},async forceReload(t){t||(t=_t(new Date));const n=`${this.baseUrl}|${t}`;yt.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 c;const s=((c=i==null?void 0:i.raw)==null?void 0:c.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 f,p,u,g,k,w,x,y,E,C,$,R,v;let a=null;if((f=n==null?void 0:n.schedule)!=null&&f.time){const b=n.schedule.time,T=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?$/.exec(b);if(T){const[,S,B,A,N="00",z="00"]=T;a=new Date(Number(S),Number(B)-1,Number(A),Number(N),Number(z),0,0)}else{const S=typeof b=="string"&&!b.includes("T")?b.replace(" ","T"):b;a=new Date(S)}}console.log(n);const o=b=>{var T,S,B,A;return a instanceof Date&&!isNaN(a)&&(b.date=a,b.time=Vn(a)),((S=(T=n==null?void 0:n.message)==null?void 0:T[0])==null?void 0:S.content)!=null&&(b.content=n.message[0].content),b.raw=b.raw||{id:t},b.raw.params=b.raw.params||{},n!=null&&n.schedule&&(b.raw.params.schedule={...b.raw.params.schedule||{},...n.schedule}),n!=null&&n.scheduled_by&&(b.raw.params.scheduled_by=n.scheduled_by),n.department&&(b.raw.params.department=n.department),n!=null&&n.message&&(b.raw.params.message=n.message),Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&(b.chatId=n.chat_id??b.chatId??""),n!=null&&n.entity&&(b.raw.params.entity={...b.raw.params.entity||{},...n.entity},Object.prototype.hasOwnProperty.call(n.entity,"name")&&(b.contactName=n.entity.name??b.contactName??"Cliente"),Object.prototype.hasOwnProperty.call(n.entity,"photo")&&(b.contactPhoto=n.entity.photo??b.contactPhoto??null,n.entity.photo&&(b.photo=n.entity.photo))),n!=null&&n.info&&(b.raw.params.info={...b.raw.params.info||{},...n.info},(B=n.info)!=null&&B.department&&Object.prototype.hasOwnProperty.call(n.info.department,"name")&&(b.departmentName=n.info.department.name??b.departmentName),(A=n.info)!=null&&A.instance&&(Object.prototype.hasOwnProperty.call(n.info.instance,"name")&&(b.instanceName=n.info.instance.name??b.instanceName),Object.prototype.hasOwnProperty.call(n.info.instance,"last_instance_status")&&(b.instanceStatus=n.info.instance.last_instance_status??b.instanceStatus))),Object.prototype.hasOwnProperty.call(n||{},"title")?b.title=n.title??b.title??"Mensagem programada":b.title=b.title||"Mensagem programada",Object.prototype.hasOwnProperty.call(n||{},"function")?(b.function=n.function??b.function??"scheduled_messages",b.type=n.function??b.type??"scheduled_messages"):(b.function=b.function||"scheduled_messages",b.type=b.type||"scheduled_messages"),b},r=this.findEventById(t);if(!r){const b=a instanceof Date&&!isNaN(a)?a:(()=>{var z;const A=(z=n==null?void 0:n.schedule)==null?void 0:z.time,N=typeof A=="string"&&!A.includes("T")?A.replace(" ","T"):A;return(en==null?void 0:en(N))||(N?new Date(N):new Date)})(),T=o({id:t,date:b,time:Vn(b),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:((u=(p=n==null?void 0:n.message)==null?void 0:p[0])==null?void 0:u.content)??"",raw:{id:t,params:n},contactName:((g=n==null?void 0:n.entity)==null?void 0:g.name)??"Cliente",contactPhoto:((k=n==null?void 0:n.entity)==null?void 0:k.photo)??null,departmentName:((x=(w=n==null?void 0:n.info)==null?void 0:w.department)==null?void 0:x.name)??null,departmentId:((E=(y=n==null?void 0:n.info)==null?void 0:y.department)==null?void 0:E.id)??null,instanceName:(($=(C=n==null?void 0:n.info)==null?void 0:C.instance)==null?void 0:$.name)??null,instanceStatus:((v=(R=n==null?void 0:n.info)==null?void 0:R.instance)==null?void 0:v.last_instance_status)??null,...Object.prototype.hasOwnProperty.call(n||{},"chat_id")&&{chatId:n.chat_id??""}}),S=_t(T.date),B=this.monthCache[S]?[...this.monthCache[S],T]:[T];B.sort((A,N)=>A.date-N.date),this._setMonth(S,B);return}const{ym:i,idx:s}=r,l=this.monthCache[i]||[],c={...l[s]},m=o({...c}),d=m.date instanceof Date?m.date:c.date,h=_t(d);if(h===i){const b=[...l];b.splice(s,1,m),b.sort((T,S)=>T.date-S.date),this._setMonth(i,b)}else{const b=l.slice(0,s).concat(l.slice(s+1)),T=this.monthCache[h]?[...this.monthCache[h],m]:[m];T.sort((S,B)=>S.date-B.date),this.monthCache={...this.monthCache,[i]:b,[h]:T}}},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:en(t.date)||new Date,o=_t(a),r={...t,id:n,date:a,time:t.time??Vn(a)},i=this.monthCache[o]?[...this.monthCache[o]]:[],s=i.findIndex(l=>{var c;return String(((c=l==null?void 0:l.raw)==null?void 0:c.id)??(l==null?void 0:l.id))===n});s!==-1?i.splice(s,1,r):i.push(r),i.sort((l,c)=>l.date-c.date),this._setMonth(o,i)},insertFromApiItem(t){const n=ka(t);n&&this.insertNormalizedEvent(n)},insertManyFromApi(t=[]){for(const n of t){const a=ka(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=yt.clear)==null||t.call(yt)}}}),wc={class:"cpk-header bg-base-200"},Ec={class:"left"},vc=["title"],Cc={class:"right"},Sc=["title"],Bc={class:"toggle"},Vc=["aria-pressed","title"],Mc={key:0,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Nc={key:1,class:"icon-5",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Ac=ke({__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",wc,[e.createElementVNode("div",Ec,[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,vc),e.createElementVNode("div",Cc,[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,Sc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bc,[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",Nc,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",Mc,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,Vc)])]))}},[["__scopeId","data-v-e367c35d"]]),Tc=["title"],Dc={class:"week-header"},Lc=ke({__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,Tc),e.createElementVNode("div",Dc,[(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-a59e7945"]]),Fc=["onClick"],$c={key:0,class:"cell-today-indicator show-lg"},Pc={class:"cell-top"},Oc={class:"day-number"},_c={key:1,class:"more"},Rc={class:"bars-wrap"},Hc=4,zc=8,ur=4,mr=2,jc=1,Gc=ke({__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(u){const g=(u==null?void 0:u.clientWidth)||0,k=(u==null?void 0:u.clientHeight)||0;if(!g||!k)return{cols:0,rows:0,widths:[],sum:0};const w=Math.max(0,Math.floor((g+ur)/(Hc+ur))),x=Math.max(0,Math.floor((k+mr)/(zc+mr))),y=l(w,x),E=y.reduce((C,$)=>C+$,0);return{cols:w,rows:x,widths:y,sum:E}}function i(u,g){const k=r(g),w=a.value[u];(!w||w.cols!==k.cols||w.rows!==k.rows||w.sum!==k.sum)&&(a.value={...a.value,[u]:k})}function s(u,g){if(!g){const w=o.get(u);if(w&&(w.disconnect(),o.delete(u)),a.value[u]!=null){const x={...a.value};delete x[u],a.value=x}return}i(u,g);const k=new ResizeObserver(()=>i(u,g));k.observe(g),o.set(u,k)}e.onBeforeUnmount(()=>{o.forEach(u=>u.disconnect()),o.clear()});function l(u,g){if(u<=0||g<=0)return[];const k=[],w=.25;for(let x=0;x<g;x++){const y=x/Math.max(1,g-1),E=w+(1-w)*y,C=Math.max(1,Math.round(u*E));k.push(Math.min(C,u))}return k}function c(u,g){var E;const k=(typeof n.dayEventCountFn=="function"?n.dayEventCountFn(g):0)||0,w=((E=a.value[u])==null?void 0:E.sum)??0;if(k<=w)return{bars:k,overflow:0};const x=Math.max(0,w-jc),y=Math.max(0,k-x);return{bars:x,overflow:y}}function m(u,g){const k=a.value[u];if(!k||k.rows===0||k.cols===0)return[];const{widths:w}=k,y=c(u,g).bars,E=(typeof n.eventsByDayFn=="function"?n.eventsByDayFn(g).slice(0,y):[])||[],C=w.map(()=>[]);let $=0;for(let R=w.length-1;R>=0&&$<E.length;R--){const v=Math.min(w[R],E.length-$);C[R]=E.slice($,$+v),$+=v}return C}const d=e.ref(null);function h(u){return u&&u.nodeType===1&&typeof u.getBoundingClientRect=="function"}function f(u){if(!h(u))return;const g=d.value,k=g&&h(g)?g:u.offsetParent;if(!h(k))return;let w,x;try{w=u.getBoundingClientRect(),x=k.getBoundingClientRect()}catch{return}const y=k.scrollLeft||0,E=k.scrollTop||0;u.style.position="absolute",u.style.zIndex="0",u.style.top=`${w.top-x.top+E}px`,u.style.left=`${w.left-x.left+y}px`,u.style.width=`${w.width}px`,u.style.height=`${w.height}px`,u.style.pointerEvents="none"}function p(u){!u||!u.style||requestAnimationFrame(()=>{!u||!u.style||(u.style.position="",u.style.zIndex="",u.style.top="",u.style.left="",u.style.width="",u.style.height="",u.style.pointerEvents="")})}return(u,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:d,onBeforeLeave:f,onAfterLeave:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.startOffset,k=>(e.openBlock(),e.createElementBlock("div",{key:"x"+k,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,(k,w)=>(e.openBlock(),e.createElementBlock("div",{key:k.key,style:e.normalizeStyle({"--i":w}),class:e.normalizeClass(["cal-cell day-cell border border-base-100 bg-base-200 hover:bg-base-100",[t.isSameMonthFn(k.date,t.viewDate)?"":"opacity-60",t.isSelectedDayFn(k.date)?"neon-selected":"",t.isTodayFn(k.date)?"is-today":"",t.dayEventCountFn(k.date)>0?"has-events":""]]),onClick:x=>t.selectDayFn(k.date)},[t.isTodayFn(k.date)?(e.openBlock(),e.createElementBlock("div",$c," Hoje ")):e.createCommentVNode("",!0),e.createElementVNode("div",Pc,[e.createElementVNode("span",Oc,e.toDisplayString(k.date.getDate()),1)]),c(k.key,k.date).overflow>0?(e.openBlock(),e.createElementBlock("span",_c," +"+e.toDisplayString(c(k.key,k.date).overflow),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("div",{class:"bars-vert",ref_for:!0,ref:x=>s(k.key,x)},[c(k.key,k.date).bars>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m(k.key,k.date),(x,y)=>(e.openBlock(),e.createElementBlock("div",{key:"vrow"+y,class:"vrow"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x,(E,C)=>(e.openBlock(),e.createElementBlock("span",{key:"vbar"+y+"-"+C,class:"vbar",style:e.normalizeStyle({background:e.unref(Mn)(E),boxShadow:`0 0 8px ${e.unref(Mn)(E)}70`})},null,4))),128))]))),128)):e.createCommentVNode("",!0)],512)])],14,Fc))),128))]),_:1},512))}},[["__scopeId","data-v-82c146bb"]]),Ic={class:"agenda-section"},qc={key:0,class:"empty-state"},Wc={key:1,class:"day-list"},Uc={class:"date-trail"},Zc={class:"weekday-short"},Yc={class:"date-pill bg-base-200 border border-base-300"},Xc={class:"date-pill-month"},Kc={class:"date-pill-day"},Qc={class:"content-col"},Jc={class:"day-header"},ed={class:"agenda-title"},td={class:"month-header-text"},nd={class:"events-list"},ad=ke({__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",Ic,[t.days.length===0?(e.openBlock(),e.createElementBlock("div",qc," Sem eventos neste mês. ")):(e.openBlock(),e.createElementBlock("ul",Wc,[(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",Uc,[e.createElementVNode("div",Zc,e.toDisplayString(t.weekdayShort(r.date)),1),e.createElementVNode("div",Yc,[e.createElementVNode("div",Xc,e.toDisplayString(t.monthShort(r.date)),1),e.createElementVNode("div",Kc,e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",{style:e.normalizeStyle({background:e.unref(Mn)(((i=r.events)==null?void 0:i[0])||{})}),class:"date-pill-dot"},null,4)])]),e.createElementVNode("div",Qc,[e.createElementVNode("div",Jc,[e.createElementVNode("h3",ed,e.toDisplayString(t.weekdayLong(r.date).toUpperCase())+" "+e.toDisplayString(r.date.getDate()),1),e.createElementVNode("div",td,e.toDisplayString(t.monthLabelOf(r.date).toUpperCase())+" "+e.toDisplayString(t.year),1)]),e.createElementVNode("ul",nd,[(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(xa,{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-d901943e"]]),od=["data-mode","data-empty"],rd=["disabled"],fr=ke({__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,rd)],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,__:[4]})):(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(xa,{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,od))}},[["__scopeId","data-v-0c2dc086"]]),id={class:"cpk-popover__header border-base-100"},sd={class:"filter-body"},ld={class:"row"},cd=["checked"],dd={class:"row row--status",role:"group","aria-label":"Filtrar por status de execução"},ud={class:"status-wrap"},md={class:"seg"},fd=ke({__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=Rt(),i=e.computed(()=>r.attendants.find(v=>v.is_me)||null),s=e.reactive({onlyMine:!1,status:null});e.watch(()=>a.open,async v=>{var S,B,A;if(!v)return;await e.nextTick();const b=(S=i.value)!=null&&S.id?String(i.value.id):null;s.onlyMine=!!b&&String(((B=a.filters)==null?void 0:B.scheduled_by)??"")===b;const T=(A=a.filters)==null?void 0:A.status;s.status=T===!0||T===!1?T:null,k()},{immediate:!1});function l(v,b){if(!v)return{};const{[b]:T,...S}=v;return S}function c(v){var T;s.onlyMine=!!v.target.checked;const b=(T=i.value)!=null&&T.id?String(i.value.id):null;s.onlyMine&&b?o("update:filters",{...a.filters,scheduled_by:b}):o("update:filters",l(a.filters,"scheduled_by"))}function m(v){if(s.status===v){s.status=null;const b=l(a.filters,"status");o("update:filters",b)}else s.status=v,o("update:filters",{...a.filters,status:v})}const d=e.ref(null),h=e.ref({left:0,top:0,placed:"bottom"}),f=e.computed(()=>({position:"fixed",left:`${h.value.left}px`,top:`${h.value.top}px`}));function p(){const v=a.anchorEl instanceof Element?a.anchorEl:null;if(v!=null&&v.getBoundingClientRect)return v.getBoundingClientRect();const b=window.innerWidth/2,T=window.innerHeight/3;return{left:b,right:b,top:T,bottom:T,width:0,height:0}}function u(v,b,T,S){return{left:Math.max(8,Math.min(v,window.innerWidth-T-8)),top:Math.max(8,Math.min(b,window.innerHeight-S-8))}}function g(){const v=p(),b=d.value,T=(b==null?void 0:b.offsetWidth)??300,S=(b==null?void 0:b.offsetHeight)??220;let B=v.bottom+a.offset,A;if(a.align==="center"?A=v.left+v.width/2-T/2:a.align==="end"?A=v.right-T:A=v.left,B+S>window.innerHeight-4){const z=v.top-S-a.offset;z>=4?(B=z,h.value.placed="top"):h.value.placed="bottom"}else h.value.placed="bottom";const N=u(A,B,T,S);h.value={left:N.left,top:N.top,placed:h.value.placed}}function k(){g(),requestAnimationFrame(g)}let w,x,y=[];function E(){C(),y=[window];const v=a.anchorEl instanceof Element?a.anchorEl:null;let b=v==null?void 0:v.parentElement;for(;b&&b!==document.body;){const T=getComputedStyle(b);/(auto|scroll)/.test(T.overflow+T.overflowY+T.overflowX)&&y.push(b),b=b.parentElement}y.forEach(T=>T.addEventListener("scroll",k,{passive:!0}))}function C(){y.forEach(v=>{var b;return(b=v.removeEventListener)==null?void 0:b.call(v,"scroll",k)}),y=[]}e.watch(()=>a.open,async v=>{var T,S,B,A;if(!v){C(),(T=w==null?void 0:w.disconnect)==null||T.call(w),(S=x==null?void 0:x.disconnect)==null||S.call(x);return}await e.nextTick(),k(),E(),(B=w==null?void 0:w.disconnect)==null||B.call(w),w=new ResizeObserver(k),w.observe(document.body),(A=x==null?void 0:x.disconnect)==null||A.call(x);const b=a.anchorEl instanceof Element?a.anchorEl:null;b&&(x=new ResizeObserver(k),x.observe(b)),window.addEventListener("resize",k)}),e.watch(()=>a.anchorEl,async()=>{a.open&&(await e.nextTick(),E(),k())});function $(v){v.key==="Escape"&&o("close")}function R(v){if(!a.open)return;const b=v.target,T=d.value;if(T&&T.contains(b))return;const S=a.anchorEl instanceof Element?a.anchorEl:null;S&&S.contains&&S.contains(b)||o("close")}return e.onMounted(()=>{document.addEventListener("pointerdown",R,!0),window.addEventListener("keydown",$)}),e.onBeforeUnmount(()=>{var v,b;document.removeEventListener("pointerdown",R,!0),window.removeEventListener("keydown",$),C(),(v=w==null?void 0:w.disconnect)==null||v.call(w),(b=x==null?void 0:x.disconnect)==null||b.call(x)}),(v,b)=>(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:b[4]||(b[4]=e.withModifiers(T=>v.$emit("close"),["self"]))},[e.createVNode(e.Transition,{name:"cpk-card",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"card",ref:d,class:"cpk-popover bg-base-300",style:e.normalizeStyle(f.value),role:"dialog","aria-modal":"true","aria-label":"Filtro de eventos"},[e.createElementVNode("div",id,[b[5]||(b[5]=e.createElementVNode("div",{class:"cpk-popover__icon","aria-hidden":"true"},"⚙",-1)),b[6]||(b[6]=e.createElementVNode("h3",{class:"cpk-popover__title"},"Filtros",-1)),e.createElementVNode("button",{class:"cpk-popover__close",type:"button",onClick:b[0]||(b[0]=T=>v.$emit("close")),"aria-label":"Fechar"}," × ")]),e.createElementVNode("div",sd,[e.createElementVNode("label",ld,[e.createElementVNode("input",{class:"switch",type:"checkbox",checked:s.onlyMine,onChange:b[1]||(b[1]=T=>c(T)),"aria-label":"Exibir somente meus eventos"},null,40,cd),b[7]||(b[7]=e.createElementVNode("span",{class:"label-cpk"},"Exibir somente meus eventos",-1))]),e.createElementVNode("div",dd,[b[9]||(b[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",ud,[b[8]||(b[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",md,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["cyber-button cyber-button--xs btn-ghost",s.status===!0?"is-active":""]),onClick:b[2]||(b[2]=T=>m(!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:b[3]||(b[3]=T=>m(!1)),"aria-pressed":"state.status === false"}," Executados ",2)])])])])],4)]),_:1})],32)):e.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-cc8bb01a"]]),hd={class:"calendar-content"},pd={key:0},Nn=80,hr=ke({__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=dr();r.setBaseUrl(o.sourceUrl);const i=new Date,s=e.ref($(o.initialDate)),l=e.ref(new Date(i.getFullYear(),i.getMonth(),i.getDate())),c=e.ref("calendar"),m=e.ref(!1),d=e.ref(0),h=e.ref(0),f=e.computed(()=>m.value?{transform:`translateX(${h.value}px)`}:{});function p(){m.value=!1,d.value=0,h.value=0}function u(D){var V,H;if(!(D.pointerType==="mouse"&&D.button!==0)){m.value=!0,d.value=D.clientX;try{(H=(V=D.target).setPointerCapture)==null||H.call(V,D.pointerId)}catch{}}}function g(D){m.value&&(h.value=D.clientX-d.value)}function k(D){var H,K;if(!m.value)return;const V=h.value;try{(K=(H=D.target).releasePointerCapture)==null||K.call(H,D.pointerId)}catch{}p(),V<-Nn?N():V>Nn&&A()}function w(D){var V,H;try{(H=(V=D.target).releasePointerCapture)==null||H.call(V,D.pointerId)}catch{}p()}function x(D){const V=D.touches&&D.touches[0];V&&(m.value=!0,d.value=V.clientX,h.value=0)}function y(D){if(!m.value)return;const V=D.touches&&D.touches[0];V&&(h.value=V.clientX-d.value)}function E(D){if(!m.value)return;const V=h.value;p(),V<-Nn?N():V>Nn&&A()}function C(D){p()}function $(D){if(D instanceof Date)return new Date(D.getFullYear(),D.getMonth(),1);if(typeof D=="string"){const[V,H]=D.split("-").map(K=>parseInt(K,10));return new Date(V||i.getFullYear(),(H||i.getMonth()+1)-1,1)}return new Date(i.getFullYear(),i.getMonth(),1)}function R(D){return new Date(D.getFullYear(),D.getMonth()+1,0).getDate()}function v(D){return new Date(D.getFullYear(),D.getMonth(),1).getDay()}function b(D,V){return D.getFullYear()===V.getFullYear()&&D.getMonth()===V.getMonth()}function T(D){return ya(D,i)}function S(D){return ya(D,l.value)}function B(D){l.value=new Date(D.getFullYear(),D.getMonth(),D.getDate()),b(D,s.value)||(s.value=new Date(D.getFullYear(),D.getMonth(),1))}function A(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()-1,1)}function N(){s.value=new Date(s.value.getFullYear(),s.value.getMonth()+1,1)}function z(){s.value=new Date(i.getFullYear(),i.getMonth(),1),l.value=new Date(i.getFullYear(),i.getMonth(),i.getDate())}const ae=["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],J=["DOM","SEG","TER","QUA","QUI","SEX","SÁB"],ce=e.computed(()=>$e(ae[s.value.getMonth()])),O=e.computed(()=>s.value.getFullYear()),P=e.computed(()=>oe(l.value)),G=e.computed(()=>`${se(l.value)} ${l.value.getDate()}`);function oe(D){return`${String(D.getDate()).padStart(2,"0")}/${String(D.getMonth()+1).padStart(2,"0")}/${D.getFullYear()}`}function se(D){return["DOMINGO","SEGUNDA","TERÇA","QUARTA","QUINTA","SEXTA","SÁBADO"][D.getDay()]}function ye(D){return["DOM","SEG","TER","QUA","QUI","SEX","SÁB"][D.getDay()]}function Se(D){return["JAN","FEV","MAR","ABR","MAI","JUN","JUL","AGO","SET","OUT","NOV","DEZ"][D.getMonth()]}function Fe(D){return ae[D.getMonth()]}function $e(D){return D.charAt(0).toUpperCase()+D.slice(1)}const Ne=e.computed(()=>v(s.value)),I=e.computed(()=>{const D=R(s.value);return Array.from({length:D},(V,H)=>{const K=H+1,ie=new Date(s.value.getFullYear(),s.value.getMonth(),K);return{key:`d${K}`,date:ie}})}),ee=e.ref({open:!1,anchorEl:null});function Q(D){ee.value.open=!0,ee.value.anchorEl=(D==null?void 0:D.currentTarget)||null}const{filters:M}=Vt.storeToRefs(r),F=e.computed(()=>_t(s.value)),Z=e.computed(()=>r.eventsOf(F.value)),j={scheduled_by:D=>{var K,ie,le;const V=(D==null?void 0:D.scheduled_by)??((ie=(K=D==null?void 0:D.raw)==null?void 0:K.params)==null?void 0:ie.scheduled_by)??((le=D==null?void 0:D.raw)==null?void 0:le.scheduled_by)??(D==null?void 0:D.created_by)??(D==null?void 0:D.attendant_id),H=typeof V=="object"&&V?V.id??V.attendant_id:V;return H!=null?String(H):""}};function X(D,V){const H=(V==null?void 0:V.value)??V;return!H||typeof H!="object"?!0:Object.entries(H).every(([K,ie])=>{var Me,_e,Ye;if(ie==null||ie===""||Array.isArray(ie)&&ie.length===0)return!0;const le=j[K],we=(le==null?void 0:le(D))??(D==null?void 0:D[K])??((Me=D==null?void 0:D.raw)==null?void 0:Me[K])??((Ye=(_e=D==null?void 0:D.raw)==null?void 0:_e.params)==null?void 0:Ye[K])??null,Ee=typeof we=="string"?we:we??"";if(typeof ie=="function")return!!ie(Ee,D);if(Array.isArray(ie))return ie.map(String).includes(String(Ee));if(typeof ie=="object"){const{in:Je,notIn:ze,range:Oe,contains:at}=ie;if(Je&&!Je.map(String).includes(String(Ee))||ze&&ze.map(String).includes(String(Ee)))return!1;if(Oe&&typeof Ee=="number"){const[Qn,ro]=Oe;if(Qn!=null&&Ee<Qn||ro!=null&&Ee>ro)return!1}if(at!=null){const Qn=Array.isArray(Ee)?Ee:String(Ee).split(",");if(!(Array.isArray(at)?at:[at]).some(ob=>Qn.map(String).includes(String(ob))))return!1}return!0}return String(Ee)===String(ie)})}const W=e.computed(()=>(Z.value||[]).filter(V=>X(V,M)));function re(D){return W.value.filter(V=>ya(V.date,D))}const de=e.computed(()=>re(l.value)),ge=e.computed(()=>[...de.value].sort((D,V)=>D.date-V.date));function fe(D){return re(D).length}function he(D){return Math.min(3,fe(D))}function pe(D){const V=fe(D);return V>3?V-3:0}const ve=e.computed(()=>{const D=s.value.getFullYear(),V=s.value.getMonth(),H=new Map;for(const ie of W.value){const le=ie==null?void 0:ie.date;if(!(le instanceof Date)||le.getFullYear()!==D||le.getMonth()!==V)continue;const we=`${D}-${V+1}-${le.getDate()}`;H.has(we)||H.set(we,{key:`ag-${we}`,date:new Date(D,V,le.getDate()),events:[]}),H.get(we).events.push(ie)}const K=Array.from(H.values());for(const ie of K)ie.events.sort((le,we)=>le.date-we.date);return K.sort((ie,le)=>ie.date-le.date),K}),Ve=e.ref(!1),Be=e.ref(!1),xe=e.computed(()=>Be.value||Ve.value),Te=e.computed(()=>xe?"calendar-stage--compact":"calendar-stage--single");function be(){var H;const D=window.matchMedia("(max-width: 1280px)"),V=()=>Be.value=D.matches;V(),(H=D.addEventListener)==null||H.call(D,"change",V)}const L=e.computed(()=>r.isLoading(F.value));e.computed(()=>r.errorOf(F.value));const _=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 q(D,V){_.value.open=!0,_.value.context={action:"delete-message",event:D},_.value.title="Confirmar exclusão",_.value.description="Tem certeza que deseja apagar este evento?",_.value.anchorEl=V&&V.currentTarget||typeof document<"u"&&document.activeElement||null,_.value.destructive=!0,_.value.confirmLabel="Apagar",_.value.loadingLabel="Apagando…"}async function Y(D){if(D)try{_.value.loading=!0,D.action==="delete-message"&&await ne(D.event)}finally{_.value.loading=!1,_.value.open=!1,_.value.context=null}}function me(){_.value.open=!1,_.value.context=null}async function te(){await r.forceReload(F.value)}async function ne(D){var V;try{D.deleteLoading=!0;const H=((V=D==null?void 0:D.raw)==null?void 0:V.id)??(D==null?void 0:D.id)??D;if(H==null)throw new Error("Evento inválido para exclusão");const K=await N2(B0,D);return K!=null&&K.ok&&(r.removeFromCache(String(H))||await r.forceReload(F.value)),K}catch(H){return console.error(H),null}finally{D.deleteLoading=!1}}return e.onMounted(async()=>{if(be(),await r.ensureMonthLoaded(F.value),!re(l.value).length&&W.value.length){const D=W.value[0];l.value=new Date(D.date.getFullYear(),D.date.getMonth(),D.date.getDate())}}),e.watch(()=>o.sourceUrl,async D=>{if(r.setBaseUrl(D),r.resetAll(),await r.ensureMonthLoaded(F.value),!re(l.value).length&&W.value.length){const V=W.value[0];l.value=new Date(V.date.getFullYear(),V.date.getMonth(),V.date.getDate())}}),e.watch(F,async()=>{const D=s.value.getFullYear(),V=s.value.getMonth(),H=Math.min(l.value.getDate(),R(s.value));if(l.value=new Date(D,V,H),await r.ensureMonthLoaded(F.value),!re(l.value).length&&W.value.length){const K=W.value[0];l.value=new Date(K.date.getFullYear(),K.date.getMonth(),K.date.getDate())}}),n({updateEvent:r.applyUpdateToCache}),(D,V)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["calendar-main bg-base-300",{"calendar-main--compact":xe.value}])},[e.createElementVNode("div",hd,[V[15]||(V[15]=e.createElementVNode("div",{class:"cyber-glow-overlay"},null,-1)),e.createVNode(Ac,{month:ce.value,year:O.value,"is-compact":xe.value,"view-mode":c.value,"filter-count":Object.keys(e.unref(M)).length,onPrev:A,onNext:N,onToday:z,onToggleCompact:V[0]||(V[0]=H=>Ve.value=!Ve.value),onSetViewMode:V[1]||(V[1]=H=>c.value=H),onClosePage:V[2]||(V[2]=H=>D.$emit("close-page")),onOpenFilter:Q},null,8,["month","year","is-compact","view-mode","filter-count"]),c.value==="calendar"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["calendar-stage",Te.value])},[e.createElementVNode("div",{class:"calendar-stage-main",onPointerdown:u,onPointermove:g,onPointerup:k,onPointercancel:w,onTouchstart:x,onTouchmove:y,onTouchend:E,onTouchcancel:C,style:e.normalizeStyle(f.value)},[e.createVNode(Lc,{"week-days":J,month:ce.value,year:O.value},null,8,["month","year"]),e.createVNode(Gc,{"start-offset":Ne.value,"month-days":I.value,"view-date":s.value,"is-compact":xe.value,"is-same-month-fn":b,"is-selected-day-fn":S,"is-today-fn":T,"select-day-fn":B,"events-by-day-fn":re,"day-event-count-fn":fe,"event-bars-to-show-fn":he,"day-event-overflow-fn":pe},null,8,["start-offset","month-days","view-date","is-compact"])],36),xe.value?(e.openBlock(),e.createBlock(fr,{key:0,class:"calendar-daylist calendar-daylist--mobile",loading:L.value,"selected-label-long":G.value,events:ge.value,mode:"compact",onReload:te,onOpenChat:V[3]||(V[3]=H=>D.$emit("open-chat",H)),onOpenMessage:V[4]||(V[4]=H=>D.$emit("open-message",H)),onDeleteMessage:V[5]||(V[5]=(H,K)=>q(H,K))},null,8,["loading","selected-label-long","events"])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(ad,{key:1,days:ve.value,"weekday-long":se,"weekday-short":ye,"month-short":Se,"month-label-of":Fe,year:O.value,onOpenChat:V[6]||(V[6]=H=>D.$emit("open-chat",H)),onOpenMessage:V[7]||(V[7]=H=>D.$emit("open-message",H)),onDeleteMessage:V[8]||(V[8]=(H,K)=>q(H,K))},null,8,["days","year"]))]),e.createVNode(fr,{class:"calendar-daylist calendar-daylist--desktop",loading:L.value,"selected-label":P.value,"selected-label-long":G.value,events:ge.value,mode:xe.value?"compact":"sidebar",onReload:te,onOpenChat:V[9]||(V[9]=H=>D.$emit("open-chat",H)),onOpenMessage:V[10]||(V[10]=H=>D.$emit("open-message",H)),onDeleteMessage:V[11]||(V[11]=(H,K)=>q(H,K))},null,8,["loading","selected-label","selected-label-long","events","mode"])],2),e.createVNode(gl,{modelValue:_.value.open,"onUpdate:modelValue":V[12]||(V[12]=H=>_.value.open=H),title:_.value.title,description:_.value.description,destructive:_.value.destructive,"confirm-label":_.value.confirmLabel,"cancel-label":_.value.cancelLabel,loading:_.value.loading,"loading-label":_.value.loadingLabel,context:_.value.context,"anchor-el":_.value.anchorEl,placement:"auto",align:"center",offset:12,onConfirm:Y,onCancel:me},{details:e.withCtx(()=>{var H;return[(H=_.value.context)!=null&&H.event?(e.openBlock(),e.createElementBlock("div",pd,[e.createVNode(xa,{"view-only":!0,mode:"sidebar",ev:_.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(fd,{open:ee.value.open,"anchor-el":ee.value.anchorEl,filters:e.unref(M),"onUpdate:filters":V[13]||(V[13]=H=>e.isRef(M)?M.value=H:null),onClose:V[14]||(V[14]=H=>ee.value.open=!1)},null,8,["open","anchor-el","filters"])],64))}},[["__scopeId","data-v-38d56cd8"]]),gd={class:"flex flex-col text-center"},yd={class:"flex flex-col space-y-3 justify-center"},kd={class:"space-x-4 flex-col text-black justify-center"},xd=["onUpdate:modelValue","onInput","onKeydown"],pr={__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=m=>{const d=o.value[m];o.value[0]<1&&a("reset"),/^\d$/.test(d)?s(m):o.value[m]="",m===o.value.length-1&&o.value.every(h=>h!=="")&&c()},s=m=>{m<o.value.length-1&&o.value[m]&&r.value[m+1].focus()},l=(m,d)=>{d.key==="Backspace"&&!o.value[m]&&m>0&&r.value[m-1].focus()},c=()=>{const m=o.value.join("");a("filled",m)};return(m,d)=>(e.openBlock(),e.createElementBlock("section",gd,[e.createElementVNode("div",yd,[e.createElementVNode("div",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(h,f)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:f,"onUpdate:modelValue":p=>o.value[f]=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(f),onKeydown:e.withKeys(p=>l(f,p),["backspace"]),ref_for:!0,ref_key:"inputs",ref:r},null,42,xd)),[[e.vModelText,o.value[f]]])),128))])])]))}},bd={class:"text-center flex gap-3"},wd={class:"flex justify-center gap-2 relative bg-base-200 p-2 rounded-lg shadow-md shadow-black"},Ed={key:0,class:"items-center justify-center inline-flex"},vd=["src"],Cd={__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(c,m)=>(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("section",wd,[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",Ed,m[0]||(m[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,vd)])]))}};for(var We=[],ba=0;ba<256;++ba)We.push((ba+256).toString(16).slice(1));function Sd(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 An,Bd=new Uint8Array(16);function Vd(){if(!An&&(An=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!An))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return An(Bd)}var Md=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const gr={randomUUID:Md};function Nd(t,n,a){if(gr.randomUUID&&!t)return gr.randomUUID();t=t||{};var o=t.random||(t.rng||Vd)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Sd(o)}function yr(){const t=Rt(),n=async l=>{const c=t.attendants.find(m=>m.id===l);if(c)try{const m=await je.get(`${ha}?attendant=${l}&page=1`);c.messages=m.data.results.reverse(),c.hasNextPage=m.data.next!==null,c.currentPage=2,c.internal_chat={channel_id:m.data.channel_id,unread:0}}catch(m){console.error("Erro ao buscar mensagens:",m)}},a=async l=>{const c=t.attendants.find(m=>m.id===l);if(!(!c||!c.hasNextPage))try{const m=await je.get(`${ha}?attendant=${l}&page=${c.currentPage}`);c.messages=[...m.data.results.reverse(),...c.messages],c.hasNextPage=m.data.next!==null,c.currentPage++}catch(m){console.error("Erro ao carregar mais mensagens:",m)}},o=(l,c,m)=>{const d=l==null?void 0:l.message;if(!d)return;const h=t.attendants.find(f=>{var p;return((p=f.internal_chat)==null?void 0:p.channel_id)===d.channel_id});h?(h.messages=h.messages||[],h.messages.find(p=>p.id===d.id)||(h.messages.push(d),(!c||h.id!==m)&&(h.internal_chat.unread=(h.internal_chat.unread||0)+1))):console.error("Atendente não encontrado para o canal especificado.")},r=l=>{const c=t.attendants.find(m=>m.id===l);c&&(c.internal_chat.unread=0)},i=async(l,c,m,d=!1)=>{var u;const h=t.attendants.find(g=>g.id===l);if(!h||!((u=h.internal_chat)!=null&&u.channel_id))return;let f;d?f=c:f={type:"text",content:c};const p={id:Nd(),content:f,created_at:new Date().toISOString(),sender:m};h.messages.push(p);try{await je.post(`${ha}${h.internal_chat.channel_id}/message/`,{id:p.id,content:p.content})}catch(g){console.error("Erro ao enviar mensagem:",g)}},s=l=>{const c=t.attendants.find(m=>m.id===l);return c?c.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 Ad={class:"avatar bg-[#404857] shadow shadow-gray-900 dark:shadow-gray-700 dark:bg-gray-300 text-gray-100 dark:text-gray-500"},Td={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"},Dd=["src"],wa=ke({__name:"Avatar",props:{url:{type:String}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",Ad,[t.url?(e.openBlock(),e.createElementBlock("img",{key:1,style:{"object-fit":"scale-down"},src:t.url},null,8,Dd)):(e.openBlock(),e.createElementBlock("svg",Td,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-1d00f344"]]),Ld={class:"attendants-container"},Fd={class:"atendentes-list bg-base-300"},$d={key:0,class:"empty-message bg-base-200"},Pd=["onClick"],Od={class:"atendente-main"},_d={class:"atendente-name"},Rd={class:"flex items-center gap-4"},Hd={key:0,class:"message-indicator"},zd={key:0,class:"chat-footer bg-base-200"},kr=ke({__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=c=>{o("atendenteSelecionado",c)},s=c=>{switch(c){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(c=>c.name.toLowerCase().includes(r.value.toLowerCase())&&c.id!==a.attendant.id):a.atendentes.filter(c=>c.id!==a.attendant.id));return(c,m)=>(e.openBlock(),e.createElementBlock("div",Ld,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=d=>r.value=d),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",Fd,[l.value.length===0?(e.openBlock(),e.createElementBlock("li",$d,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,d=>(e.openBlock(),e.createElementBlock("li",{key:d.id,onClick:h=>i(d),class:e.normalizeClass([["atendente-item",d.isMoved?"moved":""],"border-b even:bg-base-300 bg-blue-400/10 border-base-200 hover:bg-base-200 relative"])},[e.createElementVNode("main",Od,[e.createVNode(wa,{url:d.photo},null,8,["url"]),e.createElementVNode("span",_d,e.toDisplayString(d.name),1)]),e.createElementVNode("footer",Rd,[d.internal_chat.unread>0?(e.openBlock(),e.createElementBlock("span",Hd,e.toDisplayString(d.internal_chat.unread),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["status-indicator",s(d.login_status)])},null,2)]),m[1]||(m[1]=e.createElementVNode("div",{class:"hover-action"},"Conversar",-1))],10,Pd))),128))]),t.mobile?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",zd))]))}},[["__scopeId","data-v-9be33af9"]]);function jd(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 Gd(t){return t?(await e.nextTick(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null):null}function Id(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 xr(t,n){if(await e.nextTick(),!t.top)return;const a=t.parentEl||document.documentElement;a.scrollTop=a.scrollHeight-n}const br=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},qd={},Wd=t=>(e.pushScopeId("data-v-d3e37633"),t=t(),e.popScopeId(),t),Ud={class:"container"},Zd=Wd(()=>e.createElementVNode("div",{class:"spinner"},null,-1)),Yd=[Zd];function Xd(t,n){return e.openBlock(),e.createElementBlock("div",Ud,Yd)}const Kd=br(qd,[["render",Xd],["__scopeId","data-v-d3e37633"]]),Qd={class:"state-error"},Ht=br(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:c,distance:m}=a,{identifier:d,target:h}=e.toRefs(a),f={infiniteLoading:i,top:l,firstload:c,distance:m,parentEl:null,emit(){r=(f.parentEl||document.documentElement).scrollHeight,p.loading(),n("infinite",p)}},p={loading(){s.value="loading"},async loaded(){s.value="loaded",await xr(f,r),jd(i.value,f.parentEl)&&f.emit()},async complete(){s.value="complete",await xr(f,r),o==null||o.disconnect()},error(){s.value="error"}};function u(){o==null||o.disconnect(),o=Id(f)}return e.watch(d,u),e.onMounted(async()=>{f.parentEl=await Gd(h),u()}),e.onUnmounted(()=>o==null?void 0:o.disconnect()),(g,k)=>(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(Kd)],!0)],512),[[e.vShow,s.value=="loading"]]),s.value=="complete"?e.renderSlot(g.$slots,"complete",{key:0},()=>{var w;return[e.createElementVNode("span",null,e.toDisplayString(((w=g.slots)==null?void 0:w.complete)||"No more results!"),1)]},!0):e.createCommentVNode("",!0),s.value=="error"?e.renderSlot(g.$slots,"error",{key:1,retry:f.emit},()=>{var w;return[e.createElementVNode("span",Qd,[e.createElementVNode("span",null,e.toDisplayString(((w=g.slots)==null?void 0:w.error)||"Oops something went wrong!"),1),e.createElementVNode("button",{class:"retry",onClick:k[0]||(k[0]=(...x)=>f.emit&&f.emit(...x))},"retry")])]},!0):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-4bdee133"]]);function Jd(t,n,a){const o=ot(t,a==null?void 0:a.in);return isNaN(n)?nt(t,NaN):(o.setDate(o.getDate()+n),o)}function Tn(t,n){return Tt(t,{...n,weekStartsOn:1})}function wr(t,n){const a=ot(t,n==null?void 0:n.in),o=a.getFullYear(),r=nt(a,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=Tn(r),s=nt(a,0);s.setFullYear(o,0,4),s.setHours(0,0,0,0);const l=Tn(s);return a.getTime()>=i.getTime()?o+1:a.getTime()>=l.getTime()?o:o-1}function Er(t){const n=ot(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 Dn(t,n){const a=ot(t,n==null?void 0:n.in);return a.setHours(0,0,0,0),a}function e3(t,n,a){const[o,r]=ga(a==null?void 0:a.in,t,n),i=Dn(o),s=Dn(r),l=+i-Er(i),c=+s-Er(s);return Math.round((l-c)/xl)}function t3(t,n){const a=wr(t,n),o=nt(t,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),Tn(o)}function Ea(t){return nt(t,Date.now())}function vr(t,n,a){const[o,r]=ga(a==null?void 0:a.in,t,n);return+Dn(o)==+Dn(r)}function n3(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function a3(t){return!(!n3(t)&&typeof t!="number"||isNaN(+ot(t)))}function o3(t,n){const a=ot(t,n==null?void 0:n.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function r3(t,n){const a=ot(t,n==null?void 0:n.in);return e3(a,o3(a))+1}function i3(t,n){const a=ot(t,n==null?void 0:n.in),o=+Tn(a)-+t3(a);return Math.round(o/or)+1}function Cr(t,n){var d,h,f,p;const a=ot(t,n==null?void 0:n.in),o=a.getFullYear(),r=Bn(),i=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=nt((n==null?void 0:n.in)||t,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=Tt(s,n),c=nt((n==null?void 0:n.in)||t,0);c.setFullYear(o,0,i),c.setHours(0,0,0,0);const m=Tt(c,n);return+a>=+l?o+1:+a>=+m?o:o-1}function s3(t,n){var l,c,m,d;const a=Bn(),o=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??a.firstWeekContainsDate??((d=(m=a.locale)==null?void 0:m.options)==null?void 0:d.firstWeekContainsDate)??1,r=Cr(t,n),i=nt((n==null?void 0:n.in)||t,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),Tt(i,n)}function l3(t,n){const a=ot(t,n==null?void 0:n.in),o=+Tt(a,n)-+s3(a,n);return Math.round(o/or)+1}function Le(t,n){const a=t<0?"-":"",o=Math.abs(t).toString().padStart(n,"0");return a+o}const kt={y(t,n){const a=t.getFullYear(),o=a>0?a:1-a;return Le(n==="yy"?o%100:o,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):Le(a+1,2)},d(t,n){return Le(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 Le(t.getHours()%12||12,n.length)},H(t,n){return Le(t.getHours(),n.length)},m(t,n){return Le(t.getMinutes(),n.length)},s(t,n){return Le(t.getSeconds(),n.length)},S(t,n){const a=n.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,a-3));return Le(r,n.length)}},zt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sr={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 kt.y(t,n)},Y:function(t,n,a,o){const r=Cr(t,o),i=r>0?r:1-r;if(n==="YY"){const s=i%100;return Le(s,2)}return n==="Yo"?a.ordinalNumber(i,{unit:"year"}):Le(i,n.length)},R:function(t,n){const a=wr(t);return Le(a,n.length)},u:function(t,n){const a=t.getFullYear();return Le(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 Le(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 Le(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 kt.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 Le(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=l3(t,o);return n==="wo"?a.ordinalNumber(r,{unit:"week"}):Le(r,n.length)},I:function(t,n,a){const o=i3(t);return n==="Io"?a.ordinalNumber(o,{unit:"week"}):Le(o,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):kt.d(t,n)},D:function(t,n,a){const o=r3(t);return n==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):Le(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 Le(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 Le(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 Le(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=zt.noon:o===0?r=zt.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=zt.evening:o>=12?r=zt.afternoon:o>=4?r=zt.morning:r=zt.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 kt.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):kt.H(t,n)},K:function(t,n,a){const o=t.getHours()%12;return n==="Ko"?a.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},k:function(t,n,a){let o=t.getHours();return o===0&&(o=24),n==="ko"?a.ordinalNumber(o,{unit:"hour"}):Le(o,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):kt.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):kt.s(t,n)},S:function(t,n){return kt.S(t,n)},X:function(t,n,a){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Vr(o);case"XXXX":case"XX":return Dt(o);case"XXXXX":case"XXX":default:return Dt(o,":")}},x:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"x":return Vr(o);case"xxxx":case"xx":return Dt(o);case"xxxxx":case"xxx":default:return Dt(o,":")}},O:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Br(o,":");case"OOOO":default:return"GMT"+Dt(o,":")}},z:function(t,n,a){const o=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Br(o,":");case"zzzz":default:return"GMT"+Dt(o,":")}},t:function(t,n,a){const o=Math.trunc(+t/1e3);return Le(o,n.length)},T:function(t,n,a){return Le(+t,n.length)}};function Br(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+Le(i,2)}function Vr(t,n){return t%60===0?(t>0?"-":"+")+Le(Math.abs(t)/60,2):Dt(t,n)}function Dt(t,n=""){const a=t>0?"-":"+",o=Math.abs(t),r=Le(Math.trunc(o/60),2),i=Le(o%60,2);return a+r+n+i}const Mr=(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"})}},Nr=(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"})}},c3={p:Nr,P:(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],o=a[1],r=a[2];if(!r)return Mr(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}}",Mr(o,n)).replace("{{time}}",Nr(r,n))}},d3=/^D+$/,u3=/^Y+$/,m3=["D","DD","YY","YYYY"];function f3(t){return d3.test(t)}function h3(t){return u3.test(t)}function p3(t,n,a){const o=g3(t,n,a);if(console.warn(o),m3.includes(t))throw new RangeError(o)}function g3(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 y3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,k3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x3=/^'([^]*?)'?$/,b3=/''/g,w3=/[a-zA-Z]/;function Ar(t,n,a){var d,h,f,p,u,g,k,w;const o=Bn(),r=(a==null?void 0:a.locale)??o.locale??Xl,i=(a==null?void 0:a.firstWeekContainsDate)??((h=(d=a==null?void 0:a.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(f=o.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=(a==null?void 0:a.weekStartsOn)??((g=(u=a==null?void 0:a.locale)==null?void 0:u.options)==null?void 0:g.weekStartsOn)??o.weekStartsOn??((w=(k=o.locale)==null?void 0:k.options)==null?void 0:w.weekStartsOn)??0,l=ot(t,a==null?void 0:a.in);if(!a3(l))throw new RangeError("Invalid time value");let c=n.match(k3).map(x=>{const y=x[0];if(y==="p"||y==="P"){const E=c3[y];return E(x,r.formatLong)}return x}).join("").match(y3).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const y=x[0];if(y==="'")return{isToken:!1,value:E3(x)};if(Sr[y])return{isToken:!0,value:x};if(y.match(w3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const m={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return c.map(x=>{if(!x.isToken)return x.value;const y=x.value;(!(a!=null&&a.useAdditionalWeekYearTokens)&&h3(y)||!(a!=null&&a.useAdditionalDayOfYearTokens)&&f3(y))&&p3(y,n,String(t));const E=Sr[y[0]];return E(l,y,r.localize,m)}).join("")}function E3(t){const n=t.match(x3);return n?n[1].replace(b3,"'"):t}function v3(t,n){return wl(nt(t,t),Ea(t),n)}function C3(t,n){return vr(nt(t,t),Ea(t))}function S3(t,n,a){return Jd(t,-1,a)}function B3(t,n){return vr(nt(t,t),S3(Ea(t)))}/*! License details at fancyapps.com/license */const Ie=t=>typeof t=="string";/*! License details at fancyapps.com/license */const jt=t=>t&&t!==null&&t instanceof Element&&"nodeType"in t;/*! License details at fancyapps.com/license */const V3=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},tn=function(t,n=void 0){return!t||t===document.body||n&&t===n?null:V3(t)?t:tn(t.parentElement,n)};/*! License details at fancyapps.com/license */const xt=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 Ae=function(t=0,n=0,a=0){return Math.max(Math.min(n,a),t)};/*! License details at fancyapps.com/license */const Xe=t=>typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]";/*! License details at fancyapps.com/license */function Tr(t){return Xe(t)||Array.isArray(t)}function va(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}`:Tr(i)&&Tr(s)?va(i,s):i===s})}/*! License details at fancyapps.com/license */const Dr=function(t){for(const n of Ln)n.getState()===Ke.Running&&n.tick(Ca?t-Ca:0);Ca=t,It=window.requestAnimationFrame(Dr)};var Ke,bt,Gt;(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"})(Ke||(Ke={})),function(t){t[t.Spring=0]="Spring",t[t.Ease=1]="Ease"}(bt||(bt={})),function(t){t[t.Loop=0]="Loop",t[t.Reverse=1]="Reverse"}(Gt||(Gt={}));const Ln=new Set;let It=null,Ca=0;function wt(){let t=Ke.Initializing,n=bt.Ease,a=0,o=0,r=wt.Easings.Linear,i=500,s=0,l=0,c=0,m=0,d=1/0,h=.01,f=.01,p=!1,u={},g=null,k={},w={},x={},y=0,E=0,C=Gt.Loop,$=wt.Easings.Linear;const R=new Map;function v(A,...N){for(const z of R.get(A)||[])z(...N)}function b(A){return o=0,A?g=setTimeout(()=>{T()},A):T(),B}function T(){t=Ke.Running,v("start",k,w)}function S(){if(t=Ke.Completed,x={},v("end",k),t===Ke.Completed)if(a<y){if(a++,C===Gt.Reverse){const A=Object.assign({},u);u=Object.assign({},w),w=A}b(E)}else a=0;return B}const B={getState:function(){return t},easing:function(A){return r=A,n=bt.Ease,x={},B},duration:function(A){return i=A,B},spring:function(A={}){n=bt.Spring;const N={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:z,mass:ae,tension:J,friction:ce,restDelta:O,restSpeed:P,maxSpeed:G,clamp:oe}=Object.assign(Object.assign({},N),A);return s=z,l=ae,c=J,m=ce,f=O,h=P,d=G,p=oe,x={},B},isRunning:function(){return t===Ke.Running},isSpring:function(){return n===bt.Spring},from:function(A){return k=Object.assign({},A),B},to:function(A){return w=A,B},repeat:function(A,N=0,z=Gt.Loop,ae){return y=A,E=N,C=z,$=ae||r,B},on:function(A,N){var z,ae;return z=A,ae=N,R.set(z,[...R.get(z)||[],ae]),B},off:function(A,N){var z,ae;return z=A,ae=N,R.has(z)&&R.set(z,R.get(z).filter(J=>J!==ae)),B},start:function(A){return t=Ke.Initializing,u=Object.assign({},k),va(u,w)||(Ln.add(this),It||(It=window.requestAnimationFrame(Dr)),b(A)),B},pause:function(){return g&&(clearTimeout(g),g=null),t===Ke.Running&&(t=Ke.Paused,v("pause",k)),B},end:S,tick:function(A){A>50&&(A=50),o+=A;let N=0,z=!1;if(t!==Ke.Running)return B;if(n===bt.Ease){N=Ae(0,o/i,1),z=N===1;const J=C===Gt.Reverse?$:r;for(const ce in k)k[ce]=u[ce]+(w[ce]-u[ce])*J(N)}if(n===bt.Spring){const J=.001*A;let ce=0;for(const O in k){const P=w[O];let G=k[O];if(typeof P!="number"||isNaN(P)||typeof G!="number"||isNaN(G))continue;if(Math.abs(P-G)<=f){k[O]=P,x[O]=0;continue}x[O]||(typeof s=="object"&&typeof s[O]=="number"?x[O]=s[O]:x[O]=typeof s=="number"?s:0);let oe=x[O];oe=Ae(-1*Math.abs(d),oe,Math.abs(d));const se=oe*l*m;oe+=((G>P?-1:1)*(Math.abs(P-G)*c)-se)/l*J,G+=oe*J;const ye=k[O]>P?G<P:G>P;let Se=Math.abs(oe)<h&&Math.abs(P-G)<=f;p&&ye&&(Se=!0),Se?(G=P,oe=0):ce++,k[O]=G,x[O]=oe}z=!ce}const ae=Object.assign({},w);return v("step",k,u,w,N),z&&t===Ke.Running&&va(w,ae)&&(t=Ke.Completed,S()),B},getStartValues:function(){return u},getCurrentValues:function(){return k},getCurrentVelocities:function(){return x},getEndValues:function(){return w},destroy:function(){t=Ke.Destroyed,g&&(clearTimeout(g),g=null),u=k=w={},Ln.delete(this)}};return B}wt.destroy=()=>{for(const t of Ln)t.destroy();It&&(cancelAnimationFrame(It),It=null)},wt.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 Sa(t){const n=[],a=typeof TouchEvent<"u"&&t instanceof TouchEvent?t.touches:t instanceof MouseEvent&&t.type!=="mouseup"?[t]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function Lr(t){const n=[],a=typeof TouchEvent<"u"&&t instanceof TouchEvent?t.changedTouches:t instanceof MouseEvent?[t]:[];for(const o of a)n.push({x:o.clientX,y:o.clientY,ts:Date.now()});return n}function Et(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 Fn(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 Fr=t=>{t.cancelable&&t.preventDefault()},vt={passive:!1},M3={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let Ba=!1,nn=!0;const an=(t,n)=>{let a,o,r,i=Object.assign(Object.assign({},M3),n),s=[],l=[],c=[],m=!1,d=!1,h=!1,f=0,p=0,u=0,g=0,k=0,w=0,x=0,y=0,E=0,C=[],$=0,R=0;const v=new Map;function b(O){const P=Fn(l),G=Fn(c),oe=P&&G?P/G:0,se=Math.abs(x)>Math.abs(y)?x:y,ye={srcEvent:a,isPanRecognized:m,isSwipeRecognized:d,firstTouch:s,previousTouch:c,currentTouch:l,deltaX:u,deltaY:g,offsetX:k,offsetY:w,velocityX:x,velocityY:y,velocity:se,angle:E,axis:r,scale:oe,center:o};for(const Se of v.get(O)||[])Se(ye)}function T(O){const P=Date.now();C=C.filter(G=>!G.ts||G.ts>P-100),O&&C.push(O)}function S(){if(x=0,y=0,C.length>3){const O=C[0],P=C[C.length-1];if(O&&P){const G=P.x-O.x,oe=P.y-O.y,se=O.ts&&P.ts?P.ts-O.ts:0;se>0&&(x=Math.abs(G)>3?G/(se/30):0,y=Math.abs(oe)>3?oe/(se/30):0)}}}function B(O){if(O instanceof MouseEvent){if(Ba)return}else Ba=!0;const P=O.composedPath()[0],G=i.ignore.join(",");if(P.matches(G)||P.closest(G)||typeof MouseEvent<"u"&&O instanceof MouseEvent&&(!O.buttons||O.button!==0))return;O instanceof MouseEvent&&Fr(O);const oe=Date.now(),se=oe-(f||oe);h=se>0&&se<=250,f=oe,clearTimeout($),a=O,O instanceof MouseEvent&&(window.addEventListener("mousemove",A),window.addEventListener("mouseup",N)),window.addEventListener("blur",z),l=Sa(O),s=[...l],c=[],p=l.length,o=Et(l),p===1&&(m=!1,d=!1),p&&T(Et(l)),b("start")}function A(O){var P;if(!s.length||O.defaultPrevented)return;a=O,c=[...l],l=Sa(O),p=l.length,o=Et(l);const G=o,oe=Et(c);if(u=G.x-oe.x,g=G.y-oe.y,T(G),S(),b("move"),l.length>1){const se=Fn(l),ye=Fn(c);Math.abs(se-ye)>=.1&&b("pinch")}if(!m&&s.length){const se=Et(s);k=G.x-se.x,w=G.y-se.y,m=Math.abs(k)>i.panThreshold||Math.abs(w)>i.panThreshold,m&&(nn=!1,clearTimeout(R),R=0,E=Math.abs(180*Math.atan2(w,k)/Math.PI),r=E>45&&E<135?"y":"x",s=[...l],c=[...l],(P=window.getSelection())===null||P===void 0||P.removeAllRanges(),b("panstart"))}m&&(u||g)&&b("pan")}function N(O){if(a=O,!s.length)return;const P=Sa(O),G=Lr(O);if(p=P.length,o=Et(G),G.length&&T(Et(G)),S(),c=[...l],l=[...P],s=[...P],P.length>0)b("end"),m=!1,d=!1,C=[];else{const oe=i.swipeThreshold;(Math.abs(x)>oe||Math.abs(y)>oe)&&(d=!0),m&&b("panend"),d&&b("swipe"),m||d||(b("tap"),h?b("doubleTap"):$=setTimeout(function(){b("singleTap")},250)),b("end"),ae()}}function z(){clearTimeout($),ae(),m&&b("panend"),b("end")}function ae(){m=!1,d=!1,h=!1,p=0,C=[],l=[],c=[],s=[],u=0,g=0,k=0,w=0,x=0,y=0,E=0,r=void 0,window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",N),window.removeEventListener("blur",z),nn||R||(R=setTimeout(()=>{nn=!0,R=0},100))}function J(O){const P=O.target;Ba=!1,P&&!O.defaultPrevented&&(nn||(Fr(O),O.stopPropagation()))}const ce={init:function(){if(t)return t.addEventListener("click",J,vt),t.addEventListener("mousedown",B,vt),t.addEventListener("touchstart",B,vt),t.addEventListener("touchmove",A,vt),t.addEventListener("touchend",N),t.addEventListener("touchcancel",N),ce},on:function(O,P){return function(G,oe){v.set(G,[...v.get(G)||[],oe])}(O,P),ce},off:function(O,P){return v.has(O)&&v.set(O,v.get(O).filter(G=>G!==P)),ce},isPointerDown:()=>p>0,destroy:function(){clearTimeout($),clearTimeout(R),R=0,t&&(t.removeEventListener("click",J,vt),t.removeEventListener("mousedown",B,vt),t.removeEventListener("touchstart",B,vt),t.removeEventListener("touchmove",A,vt),t.removeEventListener("touchend",N),t.removeEventListener("touchcancel",N)),t=null,ae()}};return ce};an.isClickAllowed=()=>nn;/*! License details at fancyapps.com/license */const Va={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"};/*! License details at fancyapps.com/license */const De=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.add(a)})};/*! License details at fancyapps.com/license */const $n=t=>{t.cancelable&&t.preventDefault()},Qe=(t,n=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*n)/n);var ue,$r;(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"})(ue||(ue={})),function(t){t.Cover="cover",t.Full="full",t.Max="max"}($r||($r={}));const rt={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},Ma={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:ue.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:Va,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:ue.Zoom,width:"auto"};let Pn,Pr=0,Or=0,On=0;const Na=(t,n={},a={})=>{let o,r,i,s,l,c,m,d=0,h=Object.assign(Object.assign({},Ma),n),f={},p=Object.assign({},rt),u=Object.assign({},rt);const g=[];function k(M){let F=h[M];return F&&typeof F=="function"?F(Q):F}const w=new Map;function x(M,...F){const Z=w.get(M)||[];h.on&&Z.push(h.on[M]);for(const j of Z)j&&j instanceof Function&&j(Q,...F);M!=="*"&&x("*",M,...F)}function y(M){if(d!==3)return;const F=M.target;if(tn(F))return;const Z=Date.now(),j=[-M.deltaX||0,-M.deltaY||0,-M.detail||0].reduce(function(ge,fe){return Math.abs(fe)>Math.abs(ge)?fe:ge}),X=Ae(-1,j,1);x("wheel",M,X);const W=k("wheelAction");if(!W||M.defaultPrevented)return;const re=u.scale;let de=re*(X>0?1.5:.5);if(W===ue.Zoom){const ge=Math.abs(M.deltaY)<100&&Math.abs(M.deltaX)<100;if(Z-Or<(ge?200:45))return void $n(M);Or=Z;const fe=B(),he=ae();if(Qe(de)<Qe(fe)&&Qe(re)<=Qe(fe)?(On+=Math.abs(X),de=fe):Qe(de)>Qe(he)&&Qe(re)>=Qe(he)?(On+=Math.abs(X),de=he):(On=0,de=Ae(fe,de,he)),On>7)return}switch($n(M),W){case ue.Pan:P(W,{srcEvent:M,deltaX:2*-M.deltaX,deltaY:2*-M.deltaY});break;case ue.Zoom:P(ue.ZoomTo,{srcEvent:M,scale:de,center:{x:M.clientX,y:M.clientY}});break;default:P(W,{srcEvent:M})}}function E(M){var F,Z;const j=M.composedPath()[0];if(!an.isClickAllowed()||!jt(j)||M.defaultPrevented||!(t!=null&&t.contains(j))||j.hasAttribute("disabled")||j.hasAttribute("aria-disabled"))return;const X=j.closest("[data-panzoom-action]"),W=(F=X==null?void 0:X.dataset)===null||F===void 0?void 0:F.panzoomAction,re=((Z=X==null?void 0:X.dataset)===null||Z===void 0?void 0:Z.panzoomValue)||"";if(W){switch(W){case ue.ZoomTo:case ue.ZoomIn:case ue.ZoomOut:P(W,{scale:parseFloat(re||"")||void 0});break;case ue.MoveLeft:case ue.MoveRight:P(W,{deltaX:parseFloat(re||"")||void 0});break;case ue.MoveUp:case ue.MoveDown:P(W,{deltaY:parseFloat(re||"")||void 0});break;default:P(W)}return}if(!(o!=null&&o.contains(j)))return;const de={srcEvent:M};if(P(k("clickAction"),de),k("dblClickAction")){const ge=Date.now(),fe=ge-(Pr||ge);Pr=ge,fe>0&&fe<=250?(Pn&&(clearTimeout(Pn),Pn=void 0),P(k("dblClickAction"),de)):Pn=setTimeout(()=>{P(k("singleClickAction"),de)},250)}}function C(M){if(m=M,!b()||d!==3||p.scale<=1||u.scale<=1||((o==null?void 0:o.dataset.animationName)||"").indexOf("zoom")>-1)return;const F=T(u.scale);if(!F)return;const{x:Z,y:j}=F;P(ue.Pan,{deltaX:Z-u.x,deltaY:j-u.y})}function $(){var M;if(t&&((M=t.querySelector(".f-spinner"))===null||M===void 0||M.remove(),t.classList.remove("is-loading")),!t||!o)return;if(r instanceof HTMLImageElement&&(!r.complete||!r.naturalWidth))return d=2,o==null||o.classList.add("has-error"),void x("error");x("loaded");const{width:F,height:Z}=v();r&&(r.setAttribute("width",F+""),r.setAttribute("height",Z+"")),o&&(o.classList.remove("has-error"),o.setAttribute("width",F+""),o.setAttribute("height",Z+""),o.style.aspectRatio=`${F/Z||""}`),l=wt().on("start",(X,W)=>{u=Object.assign(Object.assign({},rt),W),W.angle!==void 0&&(W.angle=90*Math.round(W.angle/90)),W.flipX!==void 0&&(W.flipX=W.flipX>0?1:-1),W.flipY!==void 0&&(W.flipY=W.flipY>0?1:-1),O(),x("animationStart")}).on("pause",X=>{u=Object.assign(Object.assign({},rt),X)}).on("step",X=>{if(d!==3||!l)return;if(!t||!t.parentElement)return void l.end();if(p=Object.assign(Object.assign({},rt),X),b()||!k("bounds")||(s==null?void 0:s.isPointerDown())||u.scale>p.scale||u.scale<A())return void G();const W=J(u.scale);let re=!1,de=!1,ge=!1,fe=!1;p.x<W.x[0]&&(re=!0),p.x>W.x[1]&&(de=!0),p.y<W.y[0]&&(fe=!0),p.y>W.y[1]&&(ge=!0);let he=!1,pe=!1,ve=!1,Ve=!1;u.x<W.x[0]&&(he=!0),u.x>W.x[1]&&(pe=!0),u.y<W.y[0]&&(Ve=!0),u.y>W.y[1]&&(ve=!0);let Be=!1;(de&&pe||re&&he)&&(u.x=Ae(W.x[0],u.x,W.x[1]),Be=!0),(ge&&ve||fe&&Ve)&&(u.y=Ae(W.y[0],u.y,W.y[1]),Be=!0),Be&&l.spring({tension:94,friction:17,maxSpeed:555*u.scale,restDelta:.1,restSpeed:.1,velocity:l.getCurrentVelocities()}).from(p).to(u).start(),G()}).on("end",()=>{ce(),l!=null&&l.isRunning()||(O(),x("animationEnd"))}),function(){const X=k("gestures");X&&i&&r&&(s=an(i,X).on("start",W=>{if(!l)return;const re=W.srcEvent;b()||((p.scale>1||W.currentTouch.length>1)&&(re==null||re.stopPropagation(),l.pause()),W.currentTouch.length===1&&x("touchStart"))}).on("move",W=>{b()||(u.scale!==1||W.currentTouch.length>1)&&(W.srcEvent.preventDefault(),W.srcEvent.stopPropagation())}).on("pan",W=>{if(b())return;const re=W.srcEvent;(u.scale!==1||W.currentTouch.length>1)&&($n(re),P(ue.Pan,W))}).on("swipe",W=>{b()||u.scale>1&&P(ue.Swipe,W)}).on("tap",W=>{x("click",W)}).on("singleTap",W=>{x("singleClick",W)}).on("doubleTap",W=>{x("dblClick",W)}).on("pinch",W=>{b()||(W.scale>A()?P(ue.ZoomIn,W):W.scale<A()?P(ue.ZoomOut,W):P(ue.Pan,W))}).on("end",W=>{b()||(W.currentTouch.length?(W.srcEvent.stopPropagation(),$n(W.srcEvent),l==null||l.end()):(O(),ce(),x("touchEnd")))}).init())}(),i&&(i.addEventListener("wheel",y,{passive:!1}),g.push(()=>{i==null||i.removeEventListener("wheel",y,{passive:!1})})),t==null||t.addEventListener("click",E),document==null||document.addEventListener("mousemove",C),g.push(()=>{t==null||t.removeEventListener("click",E),document==null||document.removeEventListener("mousemove",C)});const j=Object.assign(Object.assign({},k("startPos")||{}),{scale:A()});if(p=Object.assign(Object.assign({},rt),j),u=Object.assign(Object.assign({},rt),j),b()){const X=T(u.scale);if(X){const{x:W,y:re}=X;p.x=W,p.y=re,u.x=W,u.y=re}}d=3,G(),O(),x("ready"),requestAnimationFrame(()=>{i&&(i.style.visibility="")})}function R(){const M={top:0,left:0,width:0,height:0};if(o){const F=o.getBoundingClientRect();u.angle%180==90?(M.top=F.top+.5*F.height-.5*F.width,M.left=F.left+.5*F.width-.5*F.height,M.width=F.height,M.height=F.width):(M.top=F.top,M.left=F.left,M.width=F.width,M.height=F.height)}return M}function v(){let M=k("width"),F=k("height");if(r&&M==="auto"){const Z=r.getAttribute("width");M=Z?parseFloat(Z+""):r.dataset.width!==void 0?parseFloat(r.dataset.width+""):i instanceof HTMLImageElement?i.naturalWidth:r instanceof HTMLImageElement?r.naturalWidth:r.getBoundingClientRect().width}else M=Ie(M)?parseFloat(M):M;if(r&&F==="auto"){const Z=r.getAttribute("height");F=Z?parseFloat(Z+""):r.dataset.height!==void 0?parseFloat(r.dataset.height+""):i instanceof HTMLImageElement?i.naturalHeight:r instanceof HTMLImageElement?r.naturalHeight:r.getBoundingClientRect().height}else F=Ie(F)?parseFloat(F):F;return{width:M,height:F}}function b(){return k("panMode")==="mousemove"&&matchMedia("(hover: hover)").matches}function T(M){const F=m||k("event"),Z=o==null?void 0:o.getBoundingClientRect();if(!F||!Z||M<=1)return{x:0,y:0};const j=(F.clientX||0)-Z.left,X=(F.clientY||0)-Z.top,W=Z.width,re=Z.height,de=J(M);if(M>1){const ve=k("mouseMoveFactor");ve>1&&(M*=ve)}let ge=W*M,fe=re*M,he=.5*(ge-W)-j/W*100/100*(ge-W),pe=.5*(fe-re)-X/re*100/100*(fe-re);return he=Ae(de.x[0],he,de.x[1]),pe=Ae(de.y[0],pe,de.y[1]),{x:he,y:pe}}function S(M="base"){if(!t)return 1;const F=t.getBoundingClientRect(),Z=R(),{width:j,height:X}=v(),W=he=>{if(typeof he=="number")return he;switch(he){case"min":case"base":return 1;case"cover":return Math.max(F.height/Z.height,F.width/Z.width)||1;case"full":case"max":{const pe=u.angle%180==90?X:j;return pe&&Z.width?pe/Z.width:1}}},re=k("minScale"),de=k("maxScale"),ge=Math.min(W("full"),W(re)),fe=typeof de=="number"?W("full")*de:Math.min(W("full"),W(de));switch(M){case"min":return ge;case"base":return Ae(ge,1,fe);case"cover":return W("cover");case"full":return Math.min(fe,W("full"));case"max":return fe}}function B(){return S("min")}function A(){return S("base")}function N(){return S("cover")}function z(){return S("full")}function ae(){return S("max")}function J(M){const F={x:[0,0],y:[0,0]},Z=t==null?void 0:t.getBoundingClientRect();if(!Z)return F;const j=R(),X=Z.width,W=Z.height;let re=j.width,de=j.height,ge=M=M===void 0?u.scale:M,fe=M;if(b()&&M>1){const he=k("mouseMoveFactor");he>1&&(re*M>X+.01&&(ge*=he),de*M>W+.01&&(fe*=he))}return re*=ge,de*=fe,M>1&&(re>X&&(F.x[0]=.5*(X-re),F.x[1]=.5*(re-X)),F.x[0]-=.5*(j.left-Z.left),F.x[1]-=.5*(j.left-Z.left),F.x[0]-=.5*(j.left+j.width-Z.right),F.x[1]-=.5*(j.left+j.width-Z.right),de>W&&(F.y[0]=.5*(W-de),F.y[1]=.5*(de-W)),F.y[0]-=.5*(j.top-Z.top),F.y[1]-=.5*(j.top-Z.top),F.y[0]-=.5*(j.top+j.height-Z.bottom),F.y[1]-=.5*(j.top+j.height-Z.bottom)),F}function ce(){if(!k("bounds")||d!==3||!(t!=null&&t.parentElement)||!l)return;const M=B(),F=ae(),Z=Ae(M,u.scale,F);if(u.scale<M-.01||u.scale>F+.01)return void P(ue.ZoomTo,{scale:Z});if(l.isRunning()||s!=null&&s.isPointerDown())return;const j=J(Z);u.x<j.x[0]||u.x>j.x[1]||u.y<j.y[0]||u.y>j.y[1]?(u.x=Ae(j.x[0],u.x,j.x[1]),u.y=Ae(j.y[0],u.y,j.y[1]),l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:l.getCurrentVelocities()}),l.from(p).to(u).start()):G()}function O(){if(!t||!t.parentElement||!o)return;const M=$e(),F=Ne(),Z=I(),j=ee(),X=se(),W=ye();o.classList.toggle("is-fullsize",j),o.classList.toggle("is-expanded",Z),o.classList.toggle("is-dragging",F),o.classList.toggle("can-drag",M),o.classList.toggle("will-zoom-in",X),o.classList.toggle("will-zoom-out",W);const re=Se(),de=Fe(),ge=d!==3;for(const fe of(t==null?void 0:t.querySelectorAll("[data-panzoom-action]"))||[]){const he=fe.dataset.panzoomAction;let pe=!1;if(ge)pe=!0;else switch(he){case ue.ZoomIn:re||(pe=!0);break;case ue.ZoomOut:de||(pe=!0);break;case ue.ToggleFull:re||de||(pe=!0);const ve=fe.querySelector("g");ve&&(ve.style.display=j?"none":"");break;case ue.ToggleCover:case ue.ToggleMax:re||de||(pe=!0)}pe?(fe.setAttribute("aria-disabled",""),fe.setAttribute("tabindex","-1")):(fe.removeAttribute("aria-disabled"),fe.removeAttribute("tabindex"))}}function P(M,F){var Z;if(!t||!r||!l||M===ue.Swipe&&Math.abs(l.getCurrentVelocities().scale)>.01)return;let j=Object.assign({},u),X=J(b()?u.scale:p.scale);const W=l.getCurrentVelocities(),re=R(),de=(((Z=(F=F||{}).currentTouch)===null||Z===void 0?void 0:Z.length)||0)>1,ge=F.velocityX||0,fe=F.velocityY||0;let he=F.center;!he&&F.srcEvent&&(he=Et(Lr(F.srcEvent)));let pe=F.deltaX||0,ve=F.deltaY||0;switch(M){case ue.MoveRight:pe=F.deltaX||100;break;case ue.MoveLeft:pe=F.deltaX||-100;break;case ue.MoveUp:ve=F.deltaY||-100;break;case ue.MoveDown:ve=F.deltaY||100}let Ve=[];switch(M){case ue.Reset:u=Object.assign({},rt),u.scale=A();break;case ue.Pan:case ue.Move:case ue.MoveLeft:case ue.MoveRight:case ue.MoveUp:case ue.MoveDown:if(s!=null&&s.isPointerDown()){let Te=1,be=1;u.x<=X.x[0]&&ge<=0&&(Te=Math.max(.01,1-Math.abs(1/re.width*Math.abs(u.x-X.x[0]))),Te*=.2),u.x>=X.x[1]&&ge>=0&&(Te=Math.max(.01,1-Math.abs(1/re.width*Math.abs(u.x-X.x[1]))),Te*=.2),u.y<=X.y[0]&&fe<=0&&(be=Math.max(.01,1-Math.abs(1/re.height*Math.abs(u.y-X.y[0]))),be*=.2),u.y>=X.y[1]&&fe>=0&&(be=Math.max(.01,1-Math.abs(1/re.height*Math.abs(u.y-X.y[1]))),be*=.2),u.x+=pe*Te,u.y+=ve*be}else u.x=Ae(X.x[0],u.x+pe,X.x[1]),u.y=Ae(X.y[0],u.y+ve,X.y[1]);break;case ue.Swipe:const Be=(Te=0)=>Math.sign(Te)*Math.pow(Math.abs(Te),1.5);u.x+=Ae(-1e3,Be(ge),1e3),u.y+=Ae(-1e3,Be(fe),1e3),fe&&!ge&&(u.x=Ae(X.x[0],u.x,X.x[1])),!fe&&ge&&(u.y=Ae(X.y[0],u.y,X.y[1])),W.x=ge,W.y=fe;break;case ue.ZoomTo:u.scale=F.scale||1;break;case ue.ZoomIn:u.scale=u.scale*(F.scale||2),de||(u.scale=Math.min(u.scale,ae()));break;case ue.ZoomOut:u.scale=u.scale*(F.scale||.5),de||(u.scale=Math.max(u.scale,B()));break;case ue.ToggleCover:Ve=[A(),N()];break;case ue.ToggleFull:Ve=[A(),z()];break;case ue.ToggleMax:Ve=[A(),ae()];break;case ue.IterateZoom:Ve=[A(),z(),ae()];break;case ue.Zoom:const xe=z();u.scale>=xe-.05?u.scale=A():u.scale=Math.min(xe,u.scale*(F.scale||2));break;case ue.RotateCW:u.angle+=90;break;case ue.RotateCCW:u.angle-=90;break;case ue.FlipX:u.flipX*=-1;break;case ue.FlipY:u.flipY*=-1}if(p.angle!==void 0&&Math.abs(p.angle)>=360&&(u.angle-=360*Math.floor(p.angle/360),p.angle-=360*Math.floor(p.angle/360)),Ve.length){const Be=Ve.findIndex(xe=>xe>u.scale+1e-4);u.scale=Ve[Be]||Ve[0]}if(de&&(u.scale=Ae(B()*(de?.8:1),u.scale,ae()*(de?1.6:1))),b()){const Be=T(u.scale);if(Be){const{x:xe,y:Te}=Be;u.x=xe,u.y=Te}}else if(u.scale!==j.scale){let Be=0,xe=0;if(he)Be=he.x,xe=he.y;else{const q=t.getBoundingClientRect();Be=q.x+.5*q.width,xe=q.y+.5*q.height}let Te=Be-re.left,be=xe-re.top;Te-=.5*re.width,be-=.5*re.height;const L=(Te-j.x)/j.scale,_=(be-j.y)/j.scale;u.x=Te-L*u.scale,u.y=be-_*u.scale,!de&&k("bounds")&&(X=J(u.scale),u.x=Ae(X.x[0],u.x,X.x[1]),u.y=Ae(X.y[0],u.y,X.y[1]))}if(M===ue.Swipe){let Be=94,xe=17,Te=500*u.scale,be=W;l.spring({tension:Be,friction:xe,maxSpeed:Te,restDelta:.1,restSpeed:.1,velocity:be})}else M===ue.Pan||de?l.spring({tension:750,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):l.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:W});M===ue.Reset&&F.velocity===0?p=Object.assign({},u):l.from(p).to(u).start(),x("action",M)}function G(){if(!o||!r)return;if(r instanceof HTMLImageElement){const{width:de,height:ge}=v();o.style.maxWidth=`min(${de}px, 100%)`,o.style.maxHeight=`min(${ge}px, 100%)`}let{x:M,y:F,scale:Z,angle:j,flipX:X,flipY:W}=p;const re=function(){const de=R(),ge=de.width,fe=de.height,{width:he,height:pe}=v();if(!t)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:ge,fitHeight:fe,fullWidth:he,fullHeight:pe};let{x:ve,y:Ve,scale:Be,angle:xe,flipX:Te,flipY:be}=p,L=1/z(),_=he,q=pe,Y=p.scale*L,me=u.scale*L;const te=Math.max(ge,fe),ne=Math.min(ge,fe);he>pe?(_=te,q=ne):(_=ne,q=te),Y=he>pe?te*Be/he||1:te*Be/pe||1;let D=_?he*me:0,V=q?pe*me:0;return ve=ve+.5*_-.5*D,Ve=Ve+.5*q-.5*V,{x:ve,y:Ve,width:D,height:V,scale:_&&q?he*Y/D:0,flipX:Te,flipY:be,angle:xe,fitWidth:ge,fitHeight:fe,fullWidth:he,fullHeight:pe}}();if(o&&re){const{x:de,y:ge,width:fe,height:he,scale:pe,flipX:ve,flipY:Ve}=re;let Be=`translate(${Qe(de)}px, ${Qe(ge)}px)`;Be+=ve!==1||Ve!==1?` scaleX(${Qe(pe*ve)}) scaleY(${Qe(pe*Ve)})`:` scale(${Qe(pe)})`,j!==0&&(Be+=` rotate(${j}deg)`),i&&(i.style.width=`${Qe(fe)}px`,i.style.height=`${Qe(he)}px`,i.style.transform=`${Be}`)}x("render")}function oe(){let M=u.scale;const F=k("clickAction");let Z=A();if(F){let j=[];switch(F){case ue.ZoomIn:Z=2*M;break;case ue.ZoomOut:Z=.5*M;break;case ue.ToggleCover:j=[A(),N()];break;case ue.ToggleFull:j=[A(),z()];break;case ue.ToggleMax:j=[A(),ae()];break;case ue.IterateZoom:j=[A(),z(),ae()];break;case ue.Zoom:const X=z();Z=M>=X-.05?A():Math.min(X,2*M)}if(j.length){const X=j.findIndex(W=>W>M+1e-4);Z=j[X]||A()}}return Z=Ae(B(),Z,ae()),Z}function se(){return d===3&&oe()>u.scale}function ye(){return d===3&&oe()<u.scale}function Se(){return d===3&&u.scale<ae()}function Fe(){return d===3&&u.scale>B()}function $e(){return d===3&&I()&&!!s&&!b()}function Ne(){return d===3&&(s==null?void 0:s.isPointerDown())&&!b()}function I(){return d===3&&u.scale>A()}function ee(){return d===3&&u.scale>=z()}const Q={canDrag:$e,canZoomIn:Se,canZoomOut:Fe,destroy:function(){x("destroy");for(const M of Object.values(f))M==null||M.destroy(Q);for(const M of g)M();return o&&(o.style.aspectRatio="",o.style.maxWidth="",o.style.maxHeight=""),i&&(i.style.width="",i.style.height="",i.style.transform=""),o=void 0,r=void 0,i=void 0,p=Object.assign({},rt),u=Object.assign({},rt),l==null||l.destroy(),l=void 0,s==null||s.destroy(),s=void 0,d=4,Q},emit:x,execute:P,getBoundaries:J,getContainer:function(){return t},getFullDim:v,getGestures:function(){return s},getMousemovePos:T,getOptions:function(){return h},getScale:S,getState:function(){return d},getTransform:function(M){return M===!0?u:p},getTween:function(){return l},getViewport:function(){return i},getWrapper:function(){return o},init:function(){return d=0,x("init"),function(){for(const[M,F]of Object.entries(Object.assign(Object.assign({},a),h.plugins||{})))if(M&&!f[M]&&F instanceof Function){const Z=F();Z.init(Q),f[M]=Z}x("initPlugins")}(),function(){if(!t)return;const M=Object.assign(Object.assign({},Ma.classes),k("classes"));if(De(t,M.container),r=t.querySelector("."+M.content),!!r&&(r.setAttribute("draggable","false"),o=t.querySelector("."+M.wrapper),o||(o=document.createElement("div"),De(o,M.wrapper),r.insertAdjacentElement("beforebegin",o),o.insertAdjacentElement("afterbegin",r)),r instanceof HTMLImageElement||r instanceof HTMLPictureElement)){if(i=t.querySelector("."+M.viewport),!i){i=document.createElement("div"),De(i,M.viewport);const F=r.cloneNode(!0);F.classList.remove("is-lazyloading"),F.classList.remove("is-lazyloaded"),i.insertAdjacentElement("afterbegin",F),o.insertAdjacentElement("beforeend",i)}if(r instanceof HTMLPictureElement&&(r=r.querySelector("img")),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),i.style.visibility="hidden",k("protected")){i.addEventListener("contextmenu",Z=>{Z.preventDefault()});const F=document.createElement("div");De(F,"f-panzoom__protected"),i.appendChild(F)}x("initLayout")}}(),function(){if(!(r&&r instanceof HTMLImageElement))return;d=1,x("loading");const M=()=>{r&&r instanceof HTMLImageElement&&r.decode().then(()=>{requestAnimationFrame(()=>{$()})}).catch(()=>{$()})};if(r.src&&r.complete)return void M();(function(){const F=t==null?void 0:t.querySelector(".f-spinner");if(!t||F)return;const Z=k("spinnerTpl"),j=xt(Z);j&&(j.classList.add("f-spinner"),t.classList.add("is-loading"),o==null||o.insertAdjacentElement("afterbegin",j))})(),r.addEventListener("load",M,!1),r.addEventListener("error",M,!1),g.push(()=>{r==null||r.removeEventListener("load",M,!1),r==null||r.removeEventListener("error",M,!1)})}(),function(){if(t&&o&&!c){let M=null;c=new ResizeObserver(()=>{M||(M=requestAnimationFrame(()=>{t&&t.parentElement&&d===3&&(O(),ce(),x("refresh")),M=null}))}),c.observe(o),g.push(()=>{c==null||c.disconnect(),c=void 0,M&&(cancelAnimationFrame(M),M=null)})}}(),Q},isDragging:Ne,isExpanded:I,isFullsize:ee,localize:function(M,F=[]){const Z=k("l10n")||{};M=String(M).replace(/\{\{(\w+)\}\}/g,(j,X)=>Z[X]||j);for(let j=0;j<F.length;j++)M=M.split(F[j][0]).join(F[j][1]);return M=M.replace(/\{\{(.*?)\}\}/g,(j,X)=>X)},off:function(M,F){for(const Z of M instanceof Array?M:[M])w.has(Z)&&w.set(Z,w.get(Z).filter(j=>j!==F));return Q},on:function(M,F){for(const Z of M instanceof Array?M:[M])w.set(Z,[...w.get(Z)||[],F]);return Q},version:"6.0.16",willZoomIn:se,willZoomOut:ye};return Q};Na.l10n={en_EN:Va},Na.getDefaults=()=>Ma;/*! License details at fancyapps.com/license */const Aa=(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 it=(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}),Xe(s)?Object.assign(t[i],it(l,s)):Array.isArray(s)?Object.assign(t,{[i]:[...s]}):Object.assign(t,{[i]:s})})}return t};/*! License details at fancyapps.com/license */const Ta=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?Ae(o,s,r):Ae(r,s,o):s};/*! License details at fancyapps.com/license */const ft=(t,n="")=>{t&&t.classList&&n.split(" ").forEach(a=>{a&&t.classList.remove(a)})};/*! License details at fancyapps.com/license */const Ct=(t,n="",a)=>{t&&t.classList&&n.split(" ").forEach(o=>{o&&t.classList.toggle(o,a||!1)})};/*! License details at fancyapps.com/license */const Da=Object.assign(Object.assign({},Va),{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 qt=t=>{t.cancelable&&t.preventDefault()},Wt={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:Da,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:200,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let _r,Rr=0;const _n=(t,n={},a={})=>{Rr++;let o,r,i,s,l,c=0,m=Object.assign({},Wt),d=Object.assign({},Wt),h={},f=null,p=null,u=!1,g=!1,k=!1,w=!1,x="height",y=0,E=!0,C=0,$=0,R=0,v=0,b="*",T=[],S=[];const B=new Set;let A=[],N=[],z=0,ae=0;function J(L,..._){let q=d[L];return q&&q instanceof Function?q(be,..._):q}function ce(L,_=[]){const q=J("l10n")||{};L=String(L).replace(/\{\{(\w+)\}\}/g,(Y,me)=>q[me]||Y);for(let Y=0;Y<_.length;Y++)L=L.split(_[Y][0]).join(_[Y][1]);return L=L.replace(/\{\{(.*?)\}\}/g,(Y,me)=>me)}const O=new Map;function P(L,..._){const q=O.get(L)||[];d.on&&q.push(d.on[L]);for(const Y of q)Y&&Y instanceof Function&&Y(be,..._);L!=="*"&&P("*",L,..._)}function G(){var L,_;const q=it({},Wt,m);it(q,Wt,m);let Y="";const me=m.breakpoints||{};if(me)for(const[te,ne]of Object.entries(me))window.matchMedia(te).matches&&(Y+=te,it(q,ne));if(l===void 0||Y!==l){if(l=Y,c!==0){let te=(_=(L=N[C])===null||L===void 0?void 0:L.slides[0])===null||_===void 0?void 0:_.index;te===void 0&&(te=d.initialSlide),q.initialSlide=te,q.slides=[];for(const ne of T)ne.isVirtual&&q.slides.push(ne)}Te(),d=q,d.enabled!==!1&&(c=0,P("init"),function(){for(const[te,ne]of Object.entries(Object.assign(Object.assign({},a),d.plugins||{})))if(te&&!h[te]&&ne instanceof Function){const D=ne();D.init(be,_n),h[te]=D}P("initPlugins")}(),function(){if(!f)return;const te=J("classes")||{};De(f,te.container),De(f,te.isEnabled);const ne=J("style");if(ne&&Xe(ne))for(const[D,V]of Object.entries(ne))f.style.setProperty(D,V);p=f.querySelector(`.${te.viewport}`),p||(p=document.createElement("div"),De(p,te.viewport),p.append(...Aa(f,`.${te.slide}`)),f.insertAdjacentElement("afterbegin",p)),u=window.getComputedStyle(p).getPropertyValue("overflow")==="visible",f.carousel=be,P("initLayout")}(),function(){if(!p)return;const te=J("classes")||{};T=[],[...Aa(p,`.${te.slide}`)].forEach(ne=>{ne.parentElement&&(T.push(F(Object.assign({el:ne,isVirtual:!1},ne.dataset||{}))),ne.parentElement.removeChild(ne))}),M(J("slides"));for(const ne of T)P("addSlide",ne);P("initSlides")}(),r=wt().on("start",()=>{E=!1,o&&o.isPointerDown()||(ye(),xe())}).on("step",te=>{y=te.pos,xe()}).on("end",te=>{o!=null&&o.isPointerDown()||(y=te.pos,r&&!g&&(y<R||y>v)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:Ae(R,y,v)}).start():E||(E=!0,P("settle")))}),function(){const te=J("gestures");p&&te!==!1&&(o=an(p,te).on("start",ne=>{var D,V;if(!r)return;const{srcEvent:H}=ne;function K(le){const we=window.getComputedStyle(le),Ee=new DOMMatrixReadOnly(we.transform);return{width:Ee.m41||0,height:Ee.m42||0}}w&&qt(H),r.pause(),r.getCurrentVelocities().pos=0;const ie=(D=N[C])===null||D===void 0?void 0:D.slides[0];ie&&B.has(ie.index)&&ie.el&&(y=ie.offset||0,y+=(K(ie.el)[x]||0)*(k&&!w?1:-1)),ge(),g||(y<R||y>v)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((V=r.getCurrentVelocities())===null||V===void 0?void 0:V.pos)||0,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:Ae(R,y,v)}).start()}).on("move",ne=>{const{srcEvent:D,axis:V}=ne,H=ne.srcEvent.target;H&&tn(H)||(V||(D.stopPropagation(),D.stopImmediatePropagation()),(V==="y"&&w||V==="x"&&!w)&&(qt(D),D.stopPropagation()))}).on("panstart",ne=>{(ne==null?void 0:ne.axis)===(w?"y":"x")&&De(p,"is-dragging")}).on("panend",()=>{ft(p,"is-dragging")}).on("pan",ne=>{var D;const{deltaX:V,deltaY:H,currentTouch:K,axis:ie}=ne;if(!r||K.length>1||ie==="y"&&!w||ie==="x"&&w)return;const le=k&&!w?1:-1;let we=w?H:V,Ee=r!=null&&r.isRunning()?r.getEndValues().pos:y,Me=1;g||(Ee<=R&&we*le<0?(Me=Math.max(.01,1-Math.abs(1/I()*Math.abs(Ee-R))),Me*=.2):Ee>=v&&we*le>0&&(Me=Math.max(.01,1-Math.abs(1/I()*Math.abs(Ee-v))),Me*=.2)),Ee+=we*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:y}).to({pos:Ee}).start()}).on("end",ne=>{var D,V;const{axis:H,velocityX:K,velocityY:ie,currentTouch:le}=ne,we=N.length,Ee=J("dragFree");if(le.length>0||!r||!we)return;const Me=J("vertical")?ie:K;let _e=r!=null&&r.isRunning()?r.getEndValues().pos:y;const Ye=k&&!w?1:-1;if(_e+=Me*(Ee?5:1)*Ye,!g&&(Me*Ye<=0&&_e<R||Me*Ye>=0&&_e>v)){let ze=0;return Math.abs(Me)>0&&(ze=2*Math.abs(Me),ze=Math.min(.3*I(),ze)),_e=Ae(R+-1*ze,_e,v+ze),void r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*Me,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:_e}).start()}if(Ee||!((D=h.Autoscroll)===null||D===void 0)&&D.isEnabled())return void(Math.abs(Me)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*Me,restDelta:1,restSpeed:1}).from({pos:y}).to({pos:_e}).start():r.isRunning()||E||(E=!0,P("settle")));if(!Ee&&!(!((V=h.Autoscroll)===null||V===void 0)&&V.isEnabled())&&(!ne.offsetX&&!ne.offsetY||H==="y"&&!w||H==="x"&&w))return void Be(C,{transition:"tween"});let Je=$e(_e);Math.abs(Me)>10&&Je===C&&(Je+=Me>0?k&&!w?1:-1:k&&!w?-1:1),Be(Je,{transition:"tween",tween:{tension:160,friction:25,velocity:-1*Me}})}).init())}(),re(),function(){if(f&&(f.addEventListener("click",he,{passive:!1}),document.addEventListener("mousemove",oe),!i)){let te=null;i=new ResizeObserver(ne=>{te||(te=requestAnimationFrame(()=>{(function(D){if(!f)return;let V=D[0].contentBoxSize[0].blockSize,H=D[0].contentBoxSize[0].inlineSize;if(c===0)return z=V,ae=H,c=1,xe(),Se(),void P("ready");if(c!==1)return;const K=N.length;re();const ie=f.getBoundingClientRect();V=ie.height,H=ie.width,K>1&&(w&&Math.abs(V-z)<.5||!w&&Math.abs(H-ae)<.5)||(z=V,ae=H,w&&!V||!w&&!H||f&&p&&(K===N.length&&(o!=null&&o.isPointerDown())||(J("dragFree")&&(g||y>R&&y<v)?(ye(),xe()):Be(C,{transition:!1}))))})(ne),te=null}))}),i.observe(f)}}())}}function oe(L){_r=L}function se(L="*"){var _;const q=[];for(const Y of T)(L==="*"||Y.class&&Y.class.includes(L)||Y.el&&(!((_=Y.el)===null||_===void 0)&&_.classList.contains(L)))&&q.push(Y);s=void 0,b=L,S=[...q]}function ye(){if(!r)return;const L=$e(r!=null&&r.isRunning()?r.getEndValues().pos:y);L!==C&&(s=C,C=L,Ve(),Se(),Fe(),P("change",C,s))}function Se(){var L;if(!f)return;Ct(p,"is-draggable",!!o&&N.length>0);for(const Y of f.querySelectorAll("[data-carousel-index]"))Y.innerHTML=C+"";for(const Y of f.querySelectorAll("[data-carousel-page]"))Y.innerHTML=C+1+"";for(const Y of f.querySelectorAll("[data-carousel-pages]"))Y.innerHTML=N.length+"";let _=!1;const q=(L=N[C])===null||L===void 0?void 0:L.slides[0];q&&(q.downloadSrc||q.type==="image"&&q.src)&&(_=!0);for(const Y of f.querySelectorAll("[data-carousel-download]"))Y.toggleAttribute("aria-disabled",!_)}function Fe(L){var _;if(!f)return;L||(L=(_=N[C])===null||_===void 0?void 0:_.slides[0]);const q=L.el;if(q)for(const Y of q.querySelectorAll("[data-slide-index]"))Y.innerHTML=L.index+1+""}function $e(L){if(!N.length||!r)return 0;const _=ee();let q=L;g?q-=Math.floor((L-N[0].pos)/_)*_:q=Ae(N[0].pos,L,N[N.length-1].pos);const Y=new Map;let me=0;for(const ne of N){const D=Math.abs(ne.pos-q),V=Math.abs(ne.pos-q-_),H=Math.abs(ne.pos-q+_),K=Math.min(D,V,H);Y.set(me,K),me++}const te=Y.size>0?[...Y.entries()].reduce((ne,D)=>D[1]<ne[1]?D:ne):[C,0];return parseInt(te[0])}function Ne(){return p&&parseFloat(getComputedStyle(p).getPropertyValue("--f-carousel-gap"))||0}function I(){return p&&p.getBoundingClientRect()[x]||0}function ee(L=!0){const _=Ne();return S.reduce((q,Y)=>q+Y.dim,0)+(S.length-(g&&L?0:1))*_}function Q(L){const _=Ne(),q=ee();let Y=I();if(!p)return[];const me=[];if(!q||!Y)return[];L=L===void 0?y:L,g&&(L-=Math.floor(L/q)*q);let te=0,ne=0;if(u){const V=p.getBoundingClientRect();te=V.left,ne=V.right-V.width}let D=0;for(let V of S){const H=(K=0)=>{me.indexOf(V)>-1||(V.pos=D-L+K||0,V.offset+K>L-V.dim-te+.51&&V.offset+K<L+Y+ne-.51&&me.push(V))};if(V.offset=D,g)for(let K=-1;K<=1;K++)H(q*K);else H();D+=V.dim+_}return me}function M(L,_){const q=[];for(const Y of Array.isArray(L)?L:[L]){const me=F(Object.assign(Object.assign({},Y),{isVirtual:!0}));q.push(me)}T.splice(_===void 0?T.length:_,0,...q),W();for(const Y of q)Z(Y);return se(b),q}function F(L){return(Ie(L)||L instanceof HTMLElement)&&(L={html:L}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},L)}function Z(L){if(!L)return;let _=L.el;_||(_=document.createElement("div"),L.el=_);const q=L.html?L.html instanceof HTMLElement?L.html:xt(L.html):void 0;q&&(De(q,"f-html"),L.htmlEl=q,De(_,"has-html"),_.append(q),P("contentReady",L))}function j(L){if(!p||!L)return;let _=L.el;if(_){if(_.setAttribute("index",L.index+""),_.parentElement!==p){let q;De(_,d.classes.slide),De(_,L.class),Ve(L);for(const Y of T)if(Y.index>L.index){q=Y.el;break}p.insertBefore(_,q&&p.contains(q)?q:null),P("attachSlideEl",L)}return _}}function X(L){const _=L==null?void 0:L.el;_&&(_.remove(),de(_),P("detachSlideEl",L))}function W(){for(let L=0;L<T.length;L++){const _=T[L],q=_.el;q&&(_.index!==L&&de(q),q.setAttribute("index",`${L}`)),_.index=L}}function re(){var L,_,q,Y;if(!f||!p)return;k=J("rtl"),w=J("vertical"),x=w?"height":"width";const me=J("classes");Ct(f,me.isLTR,!k),Ct(f,me.isRTL,k),Ct(f,me.isHorizontal,!w),Ct(f,me.isVertical,w),Ct(f,me.hasAdaptiveHeight,J("adaptiveHeight"));const te=p.getBoundingClientRect();if(!te.width&&!te.height)return;const ne=function(){let V=0;if(p){let H=document.createElement("div");De(H,d.classes.slide),p.appendChild(H),V=H.getBoundingClientRect()[x],H.remove(),H=void 0}return V}();for(const V of S){const H=V.el;let K=0;if(!V.isVirtual&&H&&jt(H)){let ie=!1;H.parentElement&&H.parentElement===p||(p.appendChild(H),ie=!0),K=H.getBoundingClientRect()[x],ie&&((L=H.parentElement)===null||L===void 0||L.removeChild(H))}else K=ne;V.dim=K}(function(){if(!f)return;W();const V=I(),H=Ne(),K=ee(!1);let ie=J("slidesPerPage");ie=ie==="auto"?1/0:parseFloat(ie+""),N=[];let le=0,we=0;for(const Oe of S)(!N.length||le+Oe.dim-V>.05||we>=ie)&&(N.push({index:N.length,slides:[],dim:0,offset:0,pos:0}),le=0,we=0),N[N.length-1].slides.push(Oe),le+=Oe.dim+H,we++;const Ee=J("center"),Me=J("fill"),_e=J("infinite");let Ye=0;for(const Oe of N){Oe.dim=(Oe.slides.length-1)*H;for(const at of Oe.slides)Oe.dim+=at.dim;Oe.offset=Ye,Oe.pos=Ye,Ee!==!1&&(Oe.pos-=.5*(V-Oe.dim)),Me&&!_e&&K>V&&(Oe.pos=Ae(0,Oe.pos,K-V)),Ye+=Oe.dim+H}const Je=[];let ze;for(const Oe of N){const at=Object.assign({},Oe);ze&&at.pos===ze.pos?(ze.dim+=at.dim,ze.slides=[...ze.slides,...at.slides]):(ze=at,at.index=Je.length,Je.push(at))}N=Je,Se()})();let D=I();if(u){const V=p.getBoundingClientRect();D+=V.left,D+=V.right-V.width}if(g=J("infinite")&&N.length>1&&ee()-(D+(((_=S[0])===null||_===void 0?void 0:_.dim)||0))>-.5,R=((q=N[0])===null||q===void 0?void 0:q.pos)||0,v=((Y=N[N.length-1])===null||Y===void 0?void 0:Y.pos)||0,c===0)(function(){var V;s=void 0,C=J("initialPage");const H=J("initialSlide")||void 0;H!==void 0&&(C=be.getPageIndex(H)||0),C=Ae(0,C,N.length-1),y=((V=N[C])===null||V===void 0?void 0:V.pos)||0,$=y})();else{const V=r!=null&&r.isRunning()?r.getEndValues().pos:y;(V<R||V>v)&&(C=Ae(0,C,N.length-1),$=N[C||0].pos||0)}P("refresh")}function de(L){if(!L||!jt(L))return;const _=parseInt(L.getAttribute("index")||"-1");let q="";for(const me of Array.from(L.classList)){const te=me.match(/^f-(\w+)(Out|In)$/);te&&te[1]&&(q=te[1]+"")}if(!L||!q)return;const Y=[`f-${q}Out`,`f-${q}In`,"to-prev","to-next","from-prev","from-next"];L.removeEventListener("animationend",fe),ft(L,Y.join(" ")),B.delete(_)}function ge(){if(!p)return;const L=B.size;for(const _ of S)de(_.el);B.clear(),L&&xe()}function fe(L){L.animationName.substring(0,2)==="f-"&&(de(L.target),B.size||(ft(f,"in-transition"),!E&&Math.abs(be.getPosition(!0)-$)<.5&&(E=!0,P("settle"))),xe())}function he(L){if(L.defaultPrevented)return;const _=L.composedPath()[0];if(_.closest("[data-carousel-go-prev]"))return qt(L),void be.prev();if(_.closest("[data-carousel-go-next]"))return qt(L),void be.next();const q=_.closest("[data-carousel-go-to]");if(q)return qt(L),void be.goTo(parseFloat(q.dataset.carouselGoTo||"")||0);if(_.closest("[data-carousel-download]")){qt(L);const Y=N[C].slides[0];if(Y.downloadSrc||Y.type==="image"&&Y.src){const me=Y.downloadFilename,te=document.createElement("a"),ne=Y.downloadSrc||Y.src||"";te.href=ne,te.target="_blank",te.download=me||ne,te.click()}}else P("click",L)}function pe(L){var _;const q=L.el;q&&((_=q.querySelector(".f-spinner"))===null||_===void 0||_.remove(),ft(q,"is-loading"))}function ve(L){var _;const q=L.el;q&&((_=q.querySelector(".f-html.is-error"))===null||_===void 0||_.remove(),ft(q,"has-error"))}function Ve(L){var _;L||(L=(_=N[C])===null||_===void 0?void 0:_.slides[0]);const q=L==null?void 0:L.el;if(!q)return;let Y=J("formatCaption",L);Y===void 0&&(Y=L.caption),Y=Y||"";const me=J("captionEl");if(me&&me instanceof HTMLElement){if(L.index!==C)return;if(Ie(Y)&&(me.innerHTML=ce(Y+"")),Y instanceof HTMLElement){if(Y.parentElement===me)return;me.innerHTML="",Y.parentElement&&(Y=Y.cloneNode(!0)),me.append(Y)}return}if(!Y)return;let te=L.captionEl||q.querySelector(".f-caption");!te&&Y instanceof HTMLElement&&Y.classList.contains("f-caption")&&(te=Y),te||(te=document.createElement("div"),De(te,"f-caption"),Ie(Y)?te.innerHTML=ce(Y+""):Y instanceof HTMLElement&&(Y.parentElement&&(Y=Y.cloneNode(!0)),te.append(Y)));const ne=`f-caption-${Rr}_${L.index}`;te.setAttribute("id",ne),te.dataset.selectable="true",De(q,"has-caption"),q.setAttribute("aria-labelledby",ne),L.captionEl=te,q.insertAdjacentElement("beforeend",te)}function Be(L,_){let{transition:q,tween:Y}=Object.assign({transition:d.transition,tween:d.tween},_||{});if(!f||!r)return;const me=N.length;if(!me||function(ne,D){var V,H,K,ie;if(!(f&&r&&D&&Ie(D)&&D!=="tween")||((V=N[C])===null||V===void 0?void 0:V.slides.length)>1)return!1;const le=N.length;let we=ne>C?1:-1;ne=g?(ne%le+le)%le:Ae(0,ne,le-1),k&&(we*=-1);const Ee=(H=N[C])===null||H===void 0?void 0:H.slides[0],Me=Ee==null?void 0:Ee.index,_e=(K=N[ne])===null||K===void 0?void 0:K.slides[0],Ye=_e==null?void 0:_e.index,Je=(ie=N[ne])===null||ie===void 0?void 0:ie.pos;if(Ye===void 0||Me===void 0||Me===Ye||y===Je||Math.abs(I()-((_e==null?void 0:_e.dim)||0))>1)return!1;E=!1,r.pause(),ge(),De(f,"in-transition"),y=$=Je;const ze=j(Ee),Oe=j(_e);return ye(),ze&&(B.add(Me),ze.style.transform="",ze.addEventListener("animationend",fe),ft(ze,d.classes.isSelected),De(ze,`f-${D}Out to-${we>0?"next":"prev"}`)),Oe&&(B.add(Ye),Oe.style.transform="",Oe.addEventListener("animationend",fe),De(Oe,d.classes.isSelected),De(Oe,`f-${D}In from-${we>0?"prev":"next"}`)),xe(),!0}(L,q))return;L=g?(L%me+me)%me:Ae(0,L,me-1),$=N[L||0].pos||0;const te=r.isRunning()?r.getEndValues().pos:y;if(Math.abs($-te)<1)return y=$,C!==L&&(Ve(),Se(),Fe(),s=C,C=L,P("change",C,s)),xe(),void(E||(E=!0,P("settle")));if(r.pause(),ge(),g){const ne=ee(),D=Math.floor((te-N[0].pos)/ne),V=$+D*ne;$=[V+ne,V,V-ne].reduce(function(H,K){return Math.abs(K-te)<Math.abs(H-te)?K:H})}q!==!1&&Xe(Y)?r.spring(Y).from({pos:y}).to({pos:$}).start():(y=$,ye(),xe(),E||(E=!0,P("settle")))}function xe(){var L;if(!f||!p)return;const _=N[C];A=Q();const q=new Set;let Y;const me=[];for(const te of S){if(te.isVirtual&&!B.has(te.index)&&A.indexOf(te)<0)continue;let ne=j(te);if(!ne)continue;me.push(te);const D=((L=_==null?void 0:_.slides)===null||L===void 0?void 0:L.indexOf(te))>-1;if(D&&q.add(ne),!B.has(te.index)){const V=te.pos?Math.round(1e4*te.pos)/1e4:0,H=w?0:k?-1*V:V,K=w?V:0,ie=Ta(H,0,te.dim,0,100),le=Ta(K,0,te.dim,0,100),we=d.setTransform||void 0;we instanceof Function?we(be,te,{x:H,y:K,xPercent:ie,yPercent:le}):ne.style.transform=H||K?`translate3d(${ie}%, ${le}%,0)`:""}if(J("adaptiveHeight")&&D){const V=(ne.firstElementChild||ne).getBoundingClientRect().height;Y=Y==null?V:Math.max(Y,V)}}[...Aa(p,`.${d.classes.slide}`)].forEach(te=>{const ne=parseInt(te.getAttribute("index")||"-1"),D=T[ne];D||te.remove(),Ct(te,d.classes.isSelected,q.has(te)),D.isVirtual&&!B.has(D.index)&&A.indexOf(D)<0&&X(D)}),p&&Y&&(p.style.height=`${Y}px`),P("render",me)}function Te(){var L;f==null||f.removeEventListener("click",he),ge(),document.removeEventListener("mousemove",oe),i==null||i.disconnect(),i=void 0;for(const _ of T)_.el&&jt(_.el)&&(_.state=void 0,pe(_),ve(_),X(_),_.isVirtual?((L=_.el)===null||L===void 0||L.remove(),_.el=void 0):(_.el.style.transform="",p==null||p.appendChild(_.el)));for(const _ of Object.values(h))_==null||_.destroy();h={},o==null||o.destroy(),o=void 0,r==null||r.destroy(),r=void 0;for(const _ of Object.values(d.classes||{}))ft(f,_);ft(p,"is-draggable")}const be={add:function(L,_){const q=y,Y=$,me=M(L,_);for(const te of me)P("addSlide",te);return se(b),re(),r&&Y!==$&&r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:q}).to({pos:$}).start(),xe(),be},canGoPrev:function(){return g||C>0},canGoNext:function(){return g||C<N.length-1},destroy:function(){return P("destroy"),window.removeEventListener("resize",G),Te(),O.clear(),f=null,N=[],T=[],d=Object.assign({},Wt),h={},S=[],l="",b="*",c=2,be},emit:P,filter:function(L="*"){return se(L),re(),xe(),P("filter",L),be},getContainer:function(){return f},getGapDim:Ne,getGestures:function(){return o},getLastMouseMove:function(){return _r},getOptions:function(){return d},getPage:function(){return N[C]},getPageIndex:function(L){if(L!==void 0){for(const _ of N||[])for(const q of _.slides)if(q.index===L)return _.index;return-1}return C},getPageProgress:function(L,_){L===void 0&&(L=C);const q=N[L];if(!q)return L>C?-1:1;const Y=ee(),me=Ne();let te=q.pos,ne=be.getPosition();if(g&&_!==!0){const D=Math.floor((ne-N[0].pos)/Y);ne-=D*Y,te=[te+Y,te,te-Y].reduce(function(V,H){return Math.abs(H-ne)<Math.abs(V-ne)?H:V})}return(ne-te)/(q.dim+me)},getPageVisibility:function(L){L===void 0&&(L=C);const _=N[L];if(!_)return L>C?-1:1;const q=be.getPosition(),Y=I();let me=_.pos;if(g){const te=be.getPosition(),ne=ee(),D=me+Math.floor((te-N[0].pos)/ne)*ne;me=[D+ne,D,D-ne].reduce(function(V,H){return Math.abs(H-te)<Math.abs(V-te)?H:V})}return me>q&&me+_.dim<q+Y?1:me<q?(me+_.dim-q)/_.dim:me+_.dim>q+Y?(q+Y-me)/_.dim:0},getPages:function(){return N},getPlugins:function(){return h},getPosition:function(L){var _;let q=y;if(g&&L!==!0){const Y=ee();q-=Math.floor((y-((_=N[0])===null||_===void 0?void 0:_.pos)||0)/Y)*Y}return q},getSlides:function(){return T},getState:function(){return c},getTotalSlideDim:ee,getTween:function(){return r},getViewport:function(){return p},getViewportDim:I,getVisibleSlides:function(L){return L===void 0?A:Q(L)},goTo:Be,hasNavigated:function(){return s!==void 0},hideError:ve,hideLoading:pe,init:function(){if(!t||!jt(t))throw new Error("No Element found");return c!==0&&(Te(),c=0),f=t,m=n,window.removeEventListener("resize",G),m.breakpoints&&window.addEventListener("resize",G),G(),be},isInfinite:function(){return g},isInTransition:function(){return B.size>0},isRTL:function(){return k},isSettled:function(){return E},localize:function(L,_=[]){return ce(L,_)},next:function(L={}){return Be(C+1,L),be},off:function(L,_){for(const q of L instanceof Array?L:[L])O.has(q)&&O.set(q,O.get(q).filter(Y=>Y!==_));return be},on:function(L,_){for(const q of L instanceof Array?L:[L])O.set(q,[...O.get(q)||[],_]);return be},prev:function(L={}){return Be(C-1,L),be},remove:function(L){L===void 0&&(L=T.length-1);const _=T[L];return _&&(P("removeSlide",_),_.el&&(de(_.el),_.el.remove(),_.el=void 0),T.splice(L,1),se(b),re(),xe()),be},setPosition:function(L){y=L,ye(),xe()},showError:function(L,_){pe(L),ve(L);const q=L.el;if(q){const Y=document.createElement("div");De(Y,"f-html"),De(Y,"is-error"),Y.innerHTML=ce(_||"<p>{{ERROR}}</p>"),L.htmlEl=Y,De(q,"has-html"),De(q,"has-error"),q.insertAdjacentElement("afterbegin",Y),P("contentReady",L)}return be},showLoading:function(L){const _=L.el,q=_==null?void 0:_.querySelector(".f-spinner");if(!_||q)return be;const Y=J("spinnerTpl"),me=xt(Y);return me&&(De(me,"f-spinner"),De(_,"is-loading"),_.insertAdjacentElement("beforeend",me)),be},version:"6.0.16"};return be};_n.l10n={en_EN:Da},_n.getDefaults=()=>Wt;/*! License details at fancyapps.com/license */const Hr=(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 c=parseFloat(window.getComputedStyle(i).marginRight);c&&i.style.setProperty(a,`${c}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 zr(){return!(typeof window>"u"||!window.document||!window.document.createElement)}/*! License details at fancyapps.com/license */const St=function(t="",n="",a=""){return t.split(n).join(a)};/*! License details at fancyapps.com/license */const jr={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}}" />`},N3=()=>{let t;function n(d,h){const f=t==null?void 0:t.getOptions().Zoomable;let p=(Xe(f)?Object.assign(Object.assign({},jr),f):jr)[d];return p&&typeof p=="function"&&h?p(h):p}function a(){t&&(t.on("addSlide",i),t.on("removeSlide",s),t.on("attachSlideEl",l),t.on("click",r),t.on("change",o))}function o(){c()}function r(d,h){const f=h.target;f&&!h.defaultPrevented&&f.dataset.panzoomAction&&m(f.dataset.panzoomAction)}function i(d,h){if(!t)return;const f=h.el;if(!f)return;const p=h.src||h.lazySrc||"",u=h.alt||h.caption||`Image #${h.index}`,g=h.srcset||h.lazySrcset||"",k=h.sizes||h.lazySizes||"";if(p&&Ie(p)&&!h.html&&(!h.type||h.type==="image")){h.type="image";let E=n("tpl",h);E=St(E,"{{src}}",p+""),E=St(E,"{{alt}}",u+""),E=St(E,"{{srcset}}",g+""),E=St(E,"{{sizes}}",k+""),f.insertAdjacentHTML("afterbegin",E)}if(!f.querySelector(".f-panzoom__content"))return;const w=h.width&&h.width!=="auto"?parseFloat(h.width+""):"auto",x=h.height&&h.height!=="auto"?parseFloat(h.height+""):"auto",y=Na(f,Object.assign({width:w,height:x,event:()=>t==null?void 0:t.getLastMouseMove(),classes:{container:"f-zoomable"}},n("Panzoom")));y.on("*",(E,C,...$)=>{t&&(C==="loading"&&(h.state=0),C==="loaded"&&(h.state=1),C==="error"&&(h.state=2,t==null||t.showError(h,"{{IMAGE_ERROR}}")),t.emit(`panzoom:${C}`,h,...$),C==="ready"&&t.emit("contentReady",h),h.index===t.getPageIndex()&&c())}),h.panzoomRef=y}function s(d,h){h.panzoomRef&&(h.panzoomRef.destroy(),h.panzoomRef=void 0)}function l(d,h){const f=h.panzoomRef;if(f)switch(f.getState()){case 0:f.init();break;case 3:f.execute(ue.Reset,{velocity:0})}}function c(){var d;const h=t==null?void 0:t.getContainer();if(!h)return;const f=(d=t==null?void 0:t.getPage())===null||d===void 0?void 0:d.slides[0].panzoomRef,p=(f==null?void 0:f.canZoomIn())||!1,u=(f==null?void 0:f.canZoomOut())||!1,g=(f==null?void 0:f.isFullsize())||!1,k=!f||(f==null?void 0:f.getState())!==3;for(const w of(h==null?void 0:h.querySelectorAll("[data-panzoom-action]"))||[]){const x=w.dataset.panzoomAction;let y=!1;if(k)y=!0;else switch(x){case ue.ZoomIn:p||(y=!0);break;case ue.ZoomOut:u||(y=!0);break;case ue.ToggleFull:p||u||(y=!0);const E=w.querySelector("g");E&&(E.style.display=g?"none":"");break;case ue.ToggleCover:case ue.ToggleMax:p||u||(y=!0)}y?(w.setAttribute("aria-disabled",""),w.setAttribute("tabindex","-1")):(w.removeAttribute("aria-disabled"),w.removeAttribute("tabindex"))}}function m(d,...h){var f;(f=t==null?void 0:t.getPage().slides[0].panzoomRef)===null||f===void 0||f.execute(d,...h)}return{init:function(d){t=d,t.getOptions().Zoomable!==!1&&t.on("initPlugins",a)},destroy:function(){if(t){t.off("addSlide",i),t.off("removeSlide",s),t.off("attachSlideEl",l),t.off("change",o);for(const d of t.getSlides())s(0,d)}t=void 0},execute:m}};/*! License details at fancyapps.com/license */const Gr={syncOnChange:!1,syncOnClick:!0,syncOnHover:!1},Ir=()=>{let t,n;function a(){const p=t==null?void 0:t.getOptions().Sync;return Xe(p)?Object.assign(Object.assign({},Gr),p):Gr}function o(p){var u,g,k;t&&p&&(n=p,t.getOptions().classes=Object.assign(Object.assign({},t.getOptions().classes),{isSelected:""}),t.getOptions().initialSlide=((g=(u=n.getPage())===null||u===void 0?void 0:u.slides[0])===null||g===void 0?void 0:g.index)||0,a().syncOnChange&&t.on("change",s),a().syncOnClick&&t.on("click",c),a().syncOnHover&&((k=t.getViewport())===null||k===void 0||k.addEventListener("mouseover",m)),function(){!t||!n||(t.on("ready",i),t.on("refresh",d),n.on("change",l),n.on("filter",h))}())}function r(){const p=a().target;t&&p&&o(p)}function i(){f()}function s(){var p;if(t&&n){const u=((p=t.getPage())===null||p===void 0?void 0:p.slides)||[],g=n.getPageIndex(u[0].index||0);g>-1&&n.goTo(g,t.hasNavigated()?void 0:{tween:!1,transition:!1}),f()}}function l(){var p;if(t&&n){const u=t.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);u>-1&&t.goTo(u,n.hasNavigated()?void 0:{tween:!1,transition:!1}),f()}}function c(p,u){var g;if(!t||!n||!((g=t.getTween())===null||g===void 0)&&g.isRunning())return;const k=t==null?void 0:t.getOptions().classes.slide;if(!k)return;const w=k?u.target.closest(`.${k}`):null;if(w){const x=parseInt(w.getAttribute("index")||"")||0,y=n.getPageIndex(x);n.goTo(y)}}function m(p){t&&c(0,p)}function d(){var p;if(t&&n){const u=t.getPageIndex(((p=n.getPage())===null||p===void 0?void 0:p.slides[0].index)||0);u>-1&&t.goTo(u,{tween:!1,transition:!1}),f()}}function h(p,u){t&&n&&(t.filter(u),l())}function f(){var p,u,g;if(!n)return;const k=((u=(p=n.getPage())===null||p===void 0?void 0:p.slides[0])===null||u===void 0?void 0:u.index)||0;for(const w of(t==null?void 0:t.getSlides())||[])(g=w.el)===null||g===void 0||g.classList.toggle("is-selected",w.index===k)}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",d),t==null||t.off("change",s),t==null||t.off("click",c),(p=t==null?void 0:t.getViewport())===null||p===void 0||p.removeEventListener("mouseover",m),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 qr={showLoading:!0,preload:1},Rn="is-lazyloading",Wr="is-lazyloaded",Ur=()=>{let t;function n(){const r=t==null?void 0:t.getOptions().Lazyload;return Xe(r)?Object.assign(Object.assign({},qr),r):qr}function a(r){const i=r.el;if(!i)return;const s="[data-lazy-src],[data-lazy-srcset],[data-lazy-bg]",l=Array.from(i.querySelectorAll(s));i.matches(s)&&l.push(i);for(const c of l){const m=c.dataset.lazySrc,d=c.dataset.lazySrcset,h=c.dataset.lazySizes,f=c.dataset.lazyBg,p=(c instanceof HTMLImageElement||c instanceof HTMLSourceElement)&&(m||d),u=c instanceof HTMLElement&&f;if(!p&&!u)continue;const g=m||d||f;g&&(p&&g?(n().showLoading&&(t==null||t.showLoading(r)),c.addEventListener("load",()=>{t==null||t.hideLoading(r),c instanceof HTMLImageElement?c.decode().then(()=>{c.classList.remove(Rn),c.classList.add(Wr)}):(c.classList.remove(Rn),c.classList.add(Wr)),t==null||t.emit("lazyLoad:loaded",r,c,g)}),c.addEventListener("error",()=>{t==null||t.hideLoading(r),c.classList.remove(Rn),c.classList.add("has-lazyerror"),t==null||t.emit("lazyLoad:error",r,c,g)}),c.classList.add("f-lazyload"),c.classList.add(Rn),t==null||t.emit("lazyLoad:load",r,c,g),m&&(c.src=m),d&&(c.srcset=d),h&&(c.sizes=h)):u&&(document.body.contains(c)||(document.createElement("img").src=f),c.style.backgroundImage=`url('${f}')`),delete c.dataset.lazySrc,delete c.dataset.lazySrcset,delete c.dataset.lazySizes)}}function o(){if(!t)return;const r=n().preload,i=[...t.getVisibleSlides()],s=t.getPosition(),l=t.getViewportDim();i.push(...t.getVisibleSlides(s+l*r),...t.getVisibleSlides(s-l*r));for(const c of i||[])a(c)}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 Zr={prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"></path></svg>',nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"></path></svg>'},A3=()=>{let t,n,a;function o(s){if(!t)return;const l=`<button data-carousel-go-${s} tabindex="0" class="f-button is-arrow is-${s}" title="{{${s.toUpperCase()}}}">`+function(){const c=t==null?void 0:t.getOptions().Arrows;return Xe(c)?Object.assign(Object.assign({},Zr),c):Zr}()[`${s}Tpl`]+"</button";return xt(t.localize(l))||void 0}function r(){var s;n==null||n.remove(),n=void 0,a==null||a.remove(),a=void 0,(s=t==null?void 0:t.getContainer())===null||s===void 0||s.classList.remove("has-arrows")}function i(){t&&t.getOptions().Arrows!==!1&&t.getPages().length>1?(function(){if(!t)return;const s=t.getViewport();s&&(n||(n=o("prev"),n&&s.insertAdjacentElement("beforebegin",n)),a||(a=o("next"),a&&s.insertAdjacentElement("afterend",a)),Ct(t.getContainer(),"has-arrows",!(!n&&!a)))}(),t&&(n==null||n.toggleAttribute("aria-disabled",!t.canGoPrev()),a==null||a.toggleAttribute("aria-disabled",!t.canGoNext()))):r()}return{init:function(s){t=s.on(["change","refresh"],i)},destroy:function(){r(),t==null||t.off(["change","refresh"],i),t=void 0}}};/*! License details at fancyapps.com/license */const Yr={moveLeft:{tpl:'<button data-panzoom-action="moveLeft" class="f-button" title="{{MOVE_LEFT}}"><svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg></button>'},moveRight:{tpl:'<button data-panzoom-action="moveRight" class="f-button" title="{{MOVE_RIGHT}}"><svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg></button>'},moveUp:{tpl:'<button data-panzoom-action="moveUp" class="f-button" title="{{MOVE_UP}}"><svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg></button>'},moveDown:{tpl:'<button data-panzoom-action="moveDown" class="f-button" title="{{MOVE_DOWN}}"><svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg></button>'},zoomIn:{tpl:'<button data-panzoom-action="zoomIn" class="f-button" title="{{ZOOM_IN}}"><svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg></button>'},zoomOut:{tpl:'<button data-panzoom-action="zoomOut" class="f-button" title="{{ZOOM_OUT}}"><svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg></button>'},toggle1to1:{tpl:'<button data-panzoom-action="toggleFull" class="f-button" title="{{TOGGLE_FULL}}"><svg><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"/></svg></button>'},toggleFull:{tpl:'<button data-panzoom-action="toggleFull" class="f-button" title="{{TOGGLE_FULL}}"><svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg></button>'},rotateCCW:{tpl:'<button data-panzoom-action="rotateCCW" class="f-button" title="{{ROTATE_CCW}}"><svg><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"/></svg></button>'},rotateCW:{tpl:'<button data-panzoom-action="rotateCW" class="f-button" title="{{ROTATE_CW}}"><svg><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"/></svg></button>'},flipX:{tpl:'<button data-panzoom-action="flipX" class="f-button" title="{{FLIP_X}}"><svg><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg></button>'},flipY:{tpl:'<button data-panzoom-action="flipY" class="f-button" title="{{FLIP_Y}}"><svg><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg></button>'},reset:{tpl:'<button data-panzoom-action="reset" class="f-button" title="{{RESET}}"><svg><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"/></svg></button>'}};/*! License details at fancyapps.com/license */var Xr;(function(t){t.Left="left",t.middle="middle",t.right="right"})(Xr||(Xr={}));const Kr=Object.assign({counter:{tpl:'<div class="f-carousel__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>'}},Yr),Qr={absolute:!1,display:{left:[],middle:["zoomIn","zoomOut","toggle1to1","rotateCCW","rotateCW","flipX","flipY","reset"],right:[]},enabled:"auto",items:{}},Jr=()=>{let t,n;function a(){const r=t==null?void 0:t.getOptions().Toolbar;return Xe(r)?Object.assign(Object.assign({},Qr),r):Qr}function o(){var r,i,s;if(!(t!=null&&t.getOptions().Toolbar)||!t||n)return;let l=a().enabled;if(!l)return;let c=a().absolute;const m=t.getSlides().length>1;let d=!1,h=!1;for(const w of t.getSlides())w.panzoomRef&&(d=!0),(w.downloadSrc||w.type==="image"&&w.src)&&(h=!0);let f=((r=t.getPlugins().Thumbs)===null||r===void 0?void 0:r.isEnabled())||!1,p=m&&t.getPlugins().Autoplay||!1,u=t.getPlugins().Fullscreen&&(document.fullscreenEnabled||document.webkitFullscreenEnabled);if(l==="auto"&&(l=d),!l)return;n=document.createElement("div"),n.classList.add("f-carousel__toolbar");const g=a().display,k=it({},Kr,a().items);for(const w of["left","middle","right"]){const x=g[w]||[],y=document.createElement("div");y.classList.add("f-carousel__toolbar__column"),y.classList.add(`is-${w}`);for(const E of x){let C;if(Ie(E)){if(E==="counter"&&!m||E==="autoplay"&&!p||Yr[E]&&!d||E==="fullscreen"&&!u||E==="thumbs"&&!f||E==="download"&&!h)continue;C=k[E]}if(typeof E=="object"&&(C=E),C&&C.tpl){let $=t.localize(C.tpl);$=$.split("<svg>").join('<svg tabindex="-1" width="24" height="24" viewBox="0 0 24 24">');const R=xt($);R&&(typeof C.click=="function"&&t&&R.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),typeof C.click=="function"&&t&&C.click(t,v)}),y.append(R))}}n.append(y)}n.childElementCount&&(c===!0&&n.classList.add("is-absolute"),(i=t.getContainer())===null||i===void 0||i.classList.add("has-toolbar"),(s=t.getViewport())===null||s===void 0||s.insertAdjacentElement("beforebegin",n))}return{init:function(r){t=r,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){Kr[r]=i},isEnabled:function(){return!!n}}};/*! License details at fancyapps.com/license */const e1={autoStart:!0,pauseOnHover:!0,showProgressbar:!0,timeout:2e3},T3=()=>{let t,n,a=!1,o=!1,r=!1,i=null;function s($){const R=t==null?void 0:t.getOptions().Autoplay;let v=(Xe(R)?Object.assign(Object.assign({},e1),R):e1)[$];return v&&typeof v=="function"&&t?v(t):v}function l(){var $;const R=(($=t==null?void 0:t.getPage())===null||$===void 0?void 0:$.slides)||[];for(const v of R)if(v.state===0)return!0;return!1}function c(){clearTimeout(n),n=void 0}function m(){if(n||r||l()||!(t!=null&&t.isSettled()))return;(function(){var R,v,b,T;if(!t||(f(),!s("showProgressbar")))return;let S=s("progressbarParentEl");if(!S&&(!((R=t.getPlugins().Toolbar)===null||R===void 0)&&R.isEnabled())&&(S=t.getContainer()),!S&&((v=t.getPlugins().Toolbar)===null||v===void 0?void 0:v.isEnabled())!==!0){const A=((b=t.getPages()[0])===null||b===void 0?void 0:b.slides)||[],N=((T=t.getPage())===null||T===void 0?void 0:T.slides)||[];A.length===1&&N.length===1&&(S=N[0].el)}if(S||(S=t.getViewport()),!S)return;i=document.createElement("div"),i.classList.add("f-progressbar"),S.prepend(i);const B=s("timeout")||1e3;i.style.animationDuration=`${B}ms`})();const $=s("timeout");n=setTimeout(()=>{t&&a&&!o&&(t.isInfinite()||t.getPageIndex()!==t.getPages().length-1?t.next():t.goTo(0))},$)}function d(){var $,R;if(!t||t.getPages().length<2||t.getOptions().Autoplay===!1||a)return;a=!0,t.emit("autoplay:start",s("timeout")),($=t.getContainer())===null||$===void 0||$.classList.add("has-autoplay"),(R=t.getTween())===null||R===void 0||R.on("start",x);const v=t==null?void 0:t.getContainer();v&&s("pauseOnHover")&&matchMedia("(hover: hover)").matches&&(v.addEventListener("mouseenter",y,!1),v.addEventListener("mouseleave",E,!1)),t.on("change",k),t.on("settle",w),t.on("contentReady",u),t.on("panzoom:animationStart",h),t.isSettled()&&m()}function h(){var $,R;if(c(),f(),a&&t){t.emit("autoplay:end"),($=t.getContainer())===null||$===void 0||$.classList.remove("has-autoplay"),(R=t.getTween())===null||R===void 0||R.off("start",x);const v=t==null?void 0:t.getContainer();v&&(v.removeEventListener("mouseenter",y,!1),v.removeEventListener("mouseleave",E,!1))}t&&(t.off("change",k),t.off("settle",w),t.off("contentReady",u),t.off("panzoom:animationStart",h)),a=!1,o=!1}function f(){i&&(i.remove(),i=null)}function p(){t&&t.getPages().length>1&&s("autoStart")&&d()}function u($){t&&t.getPageIndex($.index)===t.getPageIndex()&&(!a||r||l()||m())}function g($,R){const v=R.target;v&&!R.defaultPrevented&&v.dataset.autoplayAction==="toggle"&&C.toggle()}function k(){!t||!(t!=null&&t.isInfinite())&&t.getPageIndex()===t.getPages().length-1?h():(f(),c())}function w(){!a||r||o||m()}function x(){c(),f()}function y(){r=!0,a&&(f(),c())}function E(){r=!1,a&&!o&&(t!=null&&t.isSettled())&&m()}const C={init:function($){t=$,t.on("ready",p),t.on("click",g)},destroy:function(){h(),t==null||t.off("ready",p),t==null||t.off("click",g),t=void 0},isEnabled:()=>a,pause:function(){o=!0,c()},resume:function(){o=!1,a&&!r&&m()},start(){d()},stop(){h()},toggle(){a?h():d()}};return C};/*! License details at fancyapps.com/license */const La={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 Fa;const D3=()=>{let t,n,a,o=0,r=0,i=!0;function s(y){const E=t==null?void 0:t.getOptions().Thumbs;let C=(Xe(E)?Object.assign(Object.assign({},La),E):La)[y];return C&&typeof C=="function"?C():C}function l(){if(!t||(t==null?void 0:t.getOptions().Thumbs)===!1)return!1;let y=0;for(const E of t.getSlides())E.thumbSrc&&y++;return y>=s("minCount")}function c(){return s("type")==="modern"}function m(y=!1){const E=t==null?void 0:t.getContainer();if(t&&E&&!a&&l()){if(!a){const C=E.nextElementSibling;C!=null&&C.classList.contains("f-thumbs")&&(a=C)}if(!a){a=document.createElement("div"),a.classList.add("f-thumbs");const C=s("parentEl");C?C.insertAdjacentElement("beforeend",a):E.insertAdjacentElement("afterend",a)}a.classList.add(`is-${s("type")}`),a.classList.add("is-syncing"),y&&(a.style.maxHeight="0px")}}function d(y){let E=y.thumb?y.thumb instanceof HTMLImageElement?y.thumb.src:y.thumb:y.thumbSrc||void 0,C=s("thumbTpl");return C=St(C,"{{alt}}",`Thumbnail #${y.index}`),C=St(C,"{{src}}",E+""),C=St(C,"{{index}}",`${y.index}`),C=St(C,"{{page}}",`${y.index||1}`),{html:C,class:y.thumbClass}}function h(){var y,E;if(!Fa||!t||!a||n)return;const C=[];for(const $ of t.getSlides())C.push(d($));C.length&&(n=Fa(a,it({},{Sync:{target:t},Lazyload:{preload:1},slides:C,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",slide:"f-thumbs__slide"},initialSlide:t.getOptions().initialPage,center:!0,fill:!c(),infinite:!1,dragFree:!0,rtl:t.getOptions().rtl||!1,slidesPerPage:$=>{let R=0;return c()&&(function(){if(!c()||!a)return;const v=b=>a&&parseFloat(getComputedStyle(a).getPropertyValue("--f-thumb-"+b))||0;o=v("width"),r=v("clip-width")}(),R=4*(o-r)),$&&$.getTotalSlideDim()<=$.getViewportDim()-R?1/0:1}},La.Carousel||{},s("Carousel")||{}),{Sync:Ir,Lazyload:Ur}).init(),(y=n.getGestures())===null||y===void 0||y.on("start",()=>{i=!1}),n.on("click",($,R)=>{const v=R.target;if(v){const b=v.matches("button")?v:v.firstElementChild;b&&b.matches("button")&&b.focus({})}}),(E=t.getContainer())===null||E===void 0||E.classList.add("has-thumbs"),x())}function f(){var y;l()&&(s("showOnStart")&&(m(),h()),(y=t==null?void 0:t.getGestures())===null||y===void 0||y.on("start",p),t==null||t.on("addSlide",k),t==null||t.on("click",w))}function p(){var y,E;i=!0,!((y=document.activeElement)===null||y===void 0)&&y.closest(".f-thumbs")&&((E=document.activeElement)===null||E===void 0||E.blur())}function u(){var y,E;a==null||a.classList.toggle("is-syncing",(t==null?void 0:t.hasNavigated())===!1||((y=t==null?void 0:t.getTween())===null||y===void 0?void 0:y.isRunning())),x(),!((E=t==null?void 0:t.getGestures())===null||E===void 0)&&E.isPointerDown()&&function(){if(!c()||!t||!n||!i)return;const C=n.getTween(),$=n.getPages(),R=t.getPageIndex()||0,v=t.getPageProgress()||0;if(!(t&&$&&$[R]&&C))return;const b=C.isRunning()?C.getCurrentValues().pos:n.getPosition();if(b===void 0)return;let T=$[R].pos+v*(o-r);T=Ae($[0].pos,T,$[$.length-1].pos),C.from({pos:b}).to({pos:T}).start()}()}function g(){i=!0}function k(y,E){n==null||n.add(d(E),E.index)}function w(y,E){const C=E.target;C&&!E.defaultPrevented&&C.dataset.thumbsAction==="toggle"&&function(){if(a||(m(!0),h()),!a)return;const $=a.style.maxHeight;a.style.maxHeight=$?"":"0px"}()}function x(){if(!c()||!t||!n)return;const y=(n==null?void 0:n.getSlides())||[];let E=-.5*o;for(const C of y){const $=C.el;if(!$)continue;let R=t.getPageProgress(C.index)||0;R=Math.max(-1,Math.min(1,R)),R>-1&&R<1&&(E+=.5*o*(1-Math.abs(R))),R=Math.round(1e4*R)/1e4,E=Math.round(1e4*E)/1e4,$.style.setProperty("--progress",`${Math.abs(R)}`),$.style.setProperty("--shift",`${t!=null&&t.isRTL()?-1*E:E}px`),R>-1&&R<1&&(E+=.5*o*(1-Math.abs(R)))}}return{init:function(y,E){Fa=E,t=y,t.on("ready",f),t.on("render",u),t.on("change",g)},destroy:function(){var y,E;t==null||t.off("ready",f),t==null||t.off("render",u),t==null||t.off("change",g),t==null||t.off("addSlide",k),t==null||t.off("click",w),(y=t==null?void 0:t.getGestures())===null||y===void 0||y.off("start",p),(E=t==null?void 0:t.getContainer())===null||E===void 0||E.classList.remove("has-thumbs"),t=void 0,n==null||n.destroy(),n=void 0,a==null||a.remove(),a=void 0},getContainer:function(){return a},isEnabled:function(){return l()}}};/*! License details at fancyapps.com/license */const t1={iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"}},L3=()=>{let t;function n(r,i){let s=i.src;if(!Ie(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 c=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i);c&&(s=`https://maps.google.${c[1]}/?ll=${(c[2]?c[2]+"&z="+Math.floor(parseFloat(c[3]))+(c[4]?c[4].replace(/^\//,"&"):""):c[4]+"").replace(/\?/,"&")}&output=${c[4]&&c[4].indexOf("layer=c")>0?"svembed":"embed"}`,l="gmap")}if(!l){const c=s.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i);c&&(s=`https://maps.google.${c[1]}/maps?q=${c[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[m,d]of Object.entries(function(){const h=t==null?void 0:t.getOptions().Html;return Xe(h)?Object.assign(Object.assign({},t1),h):t1}().iframeAttr||{}))l.setAttribute(m,d);l.onerror=()=>{t&&t.getState()===1&&t.showError(s,"{{IFRAME_ERROR}}")},l.src=s.src;const c=document.createElement("div");if(c.classList.add("f-html"),c.append(l),s.width){let m=`${s.width}`;m.match(/^\d+$/)&&(m+="px"),c.style.maxWidth=`${m}`}if(s.height){let m=`${s.height}`;m.match(/^\d+$/)&&(m+="px"),c.style.maxHeight=`${m}`}if(s.aspectRatio){const m=s.el.getBoundingClientRect();c.style.aspectRatio=`${s.aspectRatio}`,c.style[m.width>m.height?"width":"height"]="auto",c.style[m.width>m.height?"maxWidth":"maxHeight"]="none"}s.contentEl=l,s.htmlEl=c,s.el.classList.add("has-html"),s.el.classList.add("has-iframe"),s.el.classList.add(`has-${s.type}`),s.el.prepend(c),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 n1=(t,n={})=>{const a=new URL(t),o=new URLSearchParams(a.search),r=new URLSearchParams;for(const[l,c]of[...o,...Object.entries(n)]){let m=c+"";if(l==="t"){let d=m.match(/((\d*)m)?(\d*)s?/);d&&r.set("start",60*parseInt(d[2]||"0")+parseInt(d[3]||"0")+"")}else r.set(l,m)}let i=r+"",s=t.match(/#t=((.*)?\d+s)/);return s&&(i+=`#t=${s[1]}`),i},a1={autoplay:!1,html5videoTpl:`<video class="f-html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
|