@smarttalks.ai/widget 0.5.0 → 0.6.1
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.
- package/lib/index.js +8 -8
- package/lib/index.umd.cjs +2 -2
- package/package.json +1 -1
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Ut){typeof define=="function"&&define.amd?define(Ut):Ut()})(function(){"use strict";function Ut(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),io(o.value)&&!Zs(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function Gs(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=io(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Js(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Ys(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Xs(e,t){const n=Ut(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?ro(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&oo(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&oo(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),n}function ro(e){if(e)try{return JSON.parse(e)}catch{return e}}function oo(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Js(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function io(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Zs(e){return Object.prototype.toString.call(e)==="[object Function]"}function Qs(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let zn;function ea(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Xs(this,t);const o=Ys(this.props),i=this.Component,s=zn;try{zn=this,this.__initialized=!0,Qs(i)?new i(o,{element:this}):i(o,{element:this})}finally{zn=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?ro(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function ta(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{if(!e)throw new Error("tag is required to register a Component");let a=i.get(e);return a?(a.prototype.Component=s,a):(a=ea(r,Gs(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const so={context:void 0,registry:void 0},na=(e,t)=>e===t,pe=Symbol("solid-proxy"),Vn=Symbol("solid-track"),jt={equals:na};let ao=fo;const Te=1,qt=2,lo={owned:null,cleanups:null,context:null,owner:null},Un={};var q=null;let jn=null,ra=null,W=null,te=null,Me=null,Ht=0;function De(e,t){const n=W,r=q,o=e.length===0,i=t===void 0?r:t,s=o?lo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>H(()=>Jt(s)));q=s,W=null;try{return Le(a,!0)}finally{W=n,q=r}}function P(e,t){t=t?Object.assign({},jt,t):jt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),uo(n,o));return[co.bind(n),r]}function qn(e,t,n){const r=Gt(e,t,!0,Te);ot(r)}function Z(e,t,n){const r=Gt(e,t,!1,Te);ot(r)}function D(e,t,n){ao=da;const r=Gt(e,t,!1,Te);(!n||!n.render)&&(r.user=!0),Me?Me.push(r):ot(r)}function O(e,t,n){n=n?Object.assign({},jt,n):jt;const r=Gt(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ot(r),co.bind(r)}function oa(e){return e&&typeof e=="object"&&"then"in e}function ia(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=Un,l=!1,c="initialValue"in i,u=typeof r=="function"&&O(r);const d=new Set,[h,m]=(i.storage||P)(i.initialValue),[f,g]=P(void 0),[y,w]=P(void 0,{equals:!1}),[b,v]=P(c?"ready":"unresolved");function x(T,C,F,z){return s===T&&(s=null,z!==void 0&&(c=!0),(T===a||C===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(z,{value:C})),a=Un,A(C,F)),C}function A(T,C){Le(()=>{C===void 0&&m(()=>T),v(C!==void 0?"errored":c?"ready":"unresolved"),g(C);for(const F of d.keys())F.decrement();d.clear()},!1)}function S(){const T=la,C=h(),F=f();if(F!==void 0&&!s)throw F;return W&&!W.user&&T&&qn(()=>{y(),s&&(T.resolved||d.has(T)||(T.increment(),d.add(T)))}),C}function k(T=!0){if(T!==!1&&l)return;l=!1;const C=u?u():r;if(C==null||C===!1){x(s,H(h));return}const F=a!==Un?a:H(()=>o(C,{value:h(),refetching:T}));return oa(F)?(s=F,"value"in F?(F.status==="success"?x(s,F.value,void 0,C):x(s,void 0,void 0,C),F):(l=!0,queueMicrotask(()=>l=!1),Le(()=>{v(c?"refreshing":"pending"),w()},!1),F.then(z=>x(F,z,void 0,C),z=>x(F,void 0,go(z),C)))):(x(s,F,void 0,C),F)}return Object.defineProperties(S,{state:{get:()=>b()},error:{get:()=>f()},loading:{get(){const T=b();return T==="pending"||T==="refreshing"}},latest:{get(){if(!c)return S();const T=f();if(T&&!s)throw T;return h()}}}),u?qn(()=>k(!1)):k(!1),[S,{refetch:k,mutate:m}]}function xe(e){return Le(e,!1)}function H(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function Xe(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=H(()=>t(a,o,s));return o=a,l}}function Wt(e){D(()=>H(e))}function N(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Hn(){return W}function sa(){return q}function aa(e,t){const n=q,r=W;q=e,W=null;try{return Le(t,!0)}catch(o){Gn(o)}finally{q=n,W=r}}function ie(e,t){const n=Symbol("context");return{id:n,Provider:fa(n),defaultValue:e}}function ce(e){return q&&q.context&&q.context[e.id]!==void 0?q.context[e.id]:e.defaultValue}function Wn(e){const t=O(e),n=O(()=>Yn(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let la;function co(){if(this.sources&&this.state)if(this.state===Te)ot(this);else{const e=te;te=null,Le(()=>Xt(this),!1),te=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function uo(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Le(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=jn&&jn.running;s&&jn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?te.push(i):Me.push(i),i.observers&&ho(i)),s||(i.state=Te)}if(te.length>1e6)throw te=[],new Error},!1)),t}function ot(e){if(!e.fn)return;Jt(e);const t=Ht;ca(e,e.value,t)}function ca(e,t,n){let r;const o=q,i=W;W=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Te,e.owned&&e.owned.forEach(Jt),e.owned=null),e.updatedAt=n+1,Gn(s)}finally{W=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?uo(e,r):e.value=r,e.updatedAt=n)}function Gt(e,t,n,r=Te,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==lo&&(q.owned?q.owned.push(i):q.owned=[i]),i}function Yt(e){if(e.state===0)return;if(e.state===qt)return Xt(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ht);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Te)ot(e);else if(e.state===qt){const r=te;te=null,Le(()=>Xt(e,t[0]),!1),te=r}}function Le(e,t){if(te)return e();let n=!1;t||(te=[]),Me?n=!0:Me=[],Ht++;try{const r=e();return ua(n),r}catch(r){n||(Me=null),te=null,Gn(r)}}function ua(e){if(te&&(fo(te),te=null),e)return;const t=Me;Me=null,t.length&&Le(()=>ao(t),!1)}function fo(e){for(let t=0;t<e.length;t++)Yt(e[t])}function da(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Yt(r)}for(t=0;t<n;t++)Yt(e[t])}function Xt(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Te?r!==t&&(!r.updatedAt||r.updatedAt<Ht)&&Yt(r):o===qt&&Xt(r,t)}}}function ho(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=qt,n.pure?te.push(n):Me.push(n),n.observers&&ho(n))}}function Jt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Jt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function go(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Gn(e,t=q){throw go(e)}function Yn(e){if(typeof e=="function"&&!e.length)return Yn(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Yn(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function fa(e,t){return function(r){let o;return Z(()=>o=H(()=>(q.context={...q.context,[e]:r.value},Wn(()=>r.children))),void 0),o}}const ha=Symbol("fallback");function po(e){for(let t=0;t<e.length;t++)e[t]()}function ga(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return N(()=>po(i)),()=>{let l=e()||[],c,u;return l[Vn],H(()=>{let h=l.length,m,f,g,y,w,b,v,x,A;if(h===0)s!==0&&(po(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ha],o[0]=De(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=De(d);s=h}else{for(g=new Array(h),y=new Array(h),a&&(w=new Array(h)),b=0,v=Math.min(s,h);b<v&&r[b]===l[b];b++);for(v=s-1,x=h-1;v>=b&&x>=b&&r[v]===l[x];v--,x--)g[x]=o[v],y[x]=i[v],a&&(w[x]=a[v]);for(m=new Map,f=new Array(x+1),u=x;u>=b;u--)A=l[u],c=m.get(A),f[u]=c===void 0?-1:c,m.set(A,u);for(c=b;c<=v;c++)A=r[c],u=m.get(A),u!==void 0&&u!==-1?(g[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=f[u],m.set(A,u)):i[c]();for(u=b;u<h;u++)u in g?(o[u]=g[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=De(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[m,f]=P(u);return a[u]=f,t(l[u],m)}return t(l[u])}}}function p(e,t){return H(()=>e(t||{}))}function Zt(){return!0}const Xn={get(e,t,n){return t===pe?n:e.get(t)},has(e,t){return t===pe?!0:e.has(t)},set:Zt,deleteProperty:Zt,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Zt,deleteProperty:Zt}},ownKeys(e){return e.keys()}};function Jn(e){return(e=typeof e=="function"?e():e)?e:{}}function pa(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function M(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&pe in a,e[s]=typeof a=="function"?(t=!0,O(a)):a}if(t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Jn(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Jn(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Jn(e[a])));return[...new Set(s)]}},Xn);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:pa.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const h=n[u];h&&(d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(pe in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Xn));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},Xn)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let ma=0;function ke(){const e=so.context;return e?`${e.id}${e.count++}`:`cl-${ma++}`}const mo=e=>`Stale read from <${e}>.`;function it(e){const t="fallback"in e&&{fallback:()=>e.fallback};return O(ga(()=>e.each,e.children,t||void 0))}function Y(e){const t=e.keyed,n=O(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return O(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?H(()=>o(t?r:()=>{if(!H(n))throw mo("Show");return e.when})):o}return e.fallback},void 0,void 0)}function yo(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=Wn(()=>e.children),o=O(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return O(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?H(()=>l(t?s:()=>{if(H(o)[0]!==i)throw mo("Match");return a.when})):l},void 0,void 0)}function Ct(e){return e}const ya=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],ba=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ya]),wa=new Set(["innerHTML","textContent","innerText","children"]),va=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),xa=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Sa(e,t){const n=xa[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Ea=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ka=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Ca={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Oa(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,m;for(;++d<o&&d<i&&!((m=c.get(t[d]))==null||m!==u+h);)h++;if(h>u-a){const f=t[s];for(;a<u;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const bo="_$DX_DELEGATE";function L(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>H(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Pa(e,t=window.document){const n=t[bo]||(t[bo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,La))}}function se(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function _a(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function st(e,t){t==null?e.removeAttribute("class"):e.className=t}function Aa(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function Ta(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(vo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(vo(e,a,!0),n[a]=l)}return n}function Qt(e,t,n){if(!t)return n?se(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Je(e,t={},n,r){const o={};return r||Z(()=>o.children=at(e,t.children,o.children)),Z(()=>t.ref&&t.ref(e)),Z(()=>Ma(e,t,n,!0,o,!0)),o}function wo(e,t,n){return H(()=>e(t,n))}function _(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return at(e,t,r,n);Z(o=>at(e,t(),o,n),r)}function Ma(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=xo(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||at(e,t.children);continue}const a=t[s];o[s]=xo(e,s,a,o[s],n,i)}}function Da(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function vo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function xo(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return Qt(e,n,r);if(t==="classList")return Ta(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=Ea.has(d);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(h||n)&&(Aa(e,d,n,h),h&&Pa([d]))}else if(t.slice(0,5)==="attr:")se(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=wa.has(t))||!o&&((c=Sa(t,e.tagName))||(a=ba.has(t)))||(s=e.nodeName.includes("-")))u&&(t=t.slice(5),a=!0),t==="class"||t==="className"?st(e,n):s&&!a&&!l?e[Da(t)]=n:e[c||t]=n;else{const d=o&&t.indexOf(":")>-1&&Ca[t.split(":")[0]];d?_a(e,d,t,n):se(e,va[t]||t,n)}return n}function La(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function at(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=lt(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||i==="boolean")n=lt(e,n,r);else{if(i==="function")return Z(()=>{let a=t();for(;typeof a=="function";)a=a();n=at(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Zn(a,t,n,o))return Z(()=>n=at(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=lt(e,n,r),s)return n}else l?n.length===0?So(e,a,r):Oa(e,n,a):(n&<(e),So(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=lt(e,n,r,t);lt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Zn(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Zn(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Zn(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function So(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function lt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const Ia=!1,Ra="http://www.w3.org/2000/svg";function Eo(e,t=!1){return t?document.createElementNS(Ra,e):document.createElement(e)}function ko(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=sa();let i,s=!!so.context;return D(()=>{i||(i=aa(o,()=>O(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),u=()=>c(!0);De(d=>_(a,()=>l()?d():i(),null)),N(u)}else{const l=Eo(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),_(c,i),a.appendChild(l),e.ref&&e.ref(l),N(()=>a.removeChild(l))}},void 0,{render:!s}),n}function en(e){const[t,n]=j(e,["component"]),r=O(()=>t.component);return O(()=>{const o=r();switch(typeof o){case"function":return H(()=>o(n));case"string":const i=ka.has(o),s=Eo(o,i);return Je(s,n,i),s}})}function $a(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=P(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function Fa(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Na(e){return(t,n)=>{const{element:r}=n;return De(o=>{const i=$a(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return _(r.renderRoot,s)},Fa(r))}}function Ka(e,t,n){return arguments.length===2&&(n=t,t={}),ta(e,t)(Na(n))}const Ba='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-9{left:2.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[98\\%\\]{width:98%}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Co,Qn]=P(!1),Oo=[],za=e=>Oo.push(e),Po=()=>{Oo.forEach(e=>e())},Va=()=>{Qn(!Co()),Po()},Ua=()=>{Qn(!1)},ja=()=>{Qn(!0),Po()},_o=()=>({bubble:Co,show:ja,hide:Ua,toggle:Va,onOpen:za}),er=Symbol("store-raw"),ct=Symbol("store-node"),Ie=Symbol("store-has"),Ao=Symbol("store-self");function To(e){let t=e[pe];if(!t&&(Object.defineProperty(e,pe,{value:t=new Proxy(e,Wa)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function tn(e){let t;return e!=null&&typeof e=="object"&&(e[pe]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ot(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[er])return n;if(!tn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=Ot(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=Ot(o,t))!==o&&(e[i]=r))}return e}function nn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Pt(e,t,n){if(e[t])return e[t];const[r,o]=P(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function qa(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===pe||t===ct||(delete n.value,delete n.writable,n.get=()=>e[pe][t]),n}function Mo(e){Hn()&&Pt(nn(e,ct),Ao)()}function Ha(e){return Mo(e),Reflect.ownKeys(e)}const Wa={get(e,t,n){if(t===er)return e;if(t===pe)return n;if(t===Vn)return Mo(e),n;const r=nn(e,ct),o=r[t];let i=o?o():e[t];if(t===ct||t===Ie||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Hn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Pt(r,t,i)())}return tn(i)?To(i):i},has(e,t){return t===er||t===pe||t===Vn||t===ct||t===Ie||t==="__proto__"?!0:(Hn()&&Pt(nn(e,Ie),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Ha,getOwnPropertyDescriptor:qa};function rn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Ie]&&e[Ie][t]&&o!==void 0&&e[Ie][t].$()):(e[t]=n,e[Ie]&&e[Ie][t]&&o===void 0&&e[Ie][t].$());let s=nn(e,ct),a;if((a=Pt(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Pt(s,"length",i))&&a.$(e.length)}(a=s[Ao])&&a.$()}function Do(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];rn(e,o,t[o])}}function Ga(e,t){if(typeof t=="function"&&(t=t(e)),t=Ot(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&rn(e,n,o)}rn(e,"length",r)}else Do(e,t)}function _t(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)_t(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&_t(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let d=l;d<=c;d+=u)_t(e,[d].concat(t),n);return}else if(t.length>1){_t(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Ot(i),r===void 0||tn(o)&&tn(i)&&!Array.isArray(i)?Do(o,i):rn(e,r,i))}function Ya(...[e,t]){const n=Ot(e||{}),r=Array.isArray(n),o=To(n);function i(...s){xe(()=>{r&&s.length===1?Ga(n,s[0]):_t(n,s)})}return[o,i]}function Lo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Io(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Ro(e,t,n){return De(()=>{const r=Io(e),[o,i]=Ya(r?JSON.parse(r):t);return D(()=>Lo(e,JSON.stringify(o),n)),[o,i]})}function Xa(e,t,n){return De(()=>{const r=Io(e),[o,i]=P(r?JSON.parse(r):t);return D(()=>Lo(e,JSON.stringify(o()),n)),[o,i]})}Xa("lang","en");function $o(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=$o(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ja(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$o(e))&&(r&&(r+=" "),r+=t);return r}const tr="-";function Za(e){const t=el(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(tr);return a[0]===""&&a.length!==1&&a.shift(),Fo(a,t)||Qa(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Fo(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Fo(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(tr);return t.validators.find(({validator:s})=>s(i))?.classGroupId}const No=/^\[(.+)\]$/;function Qa(e){if(No.test(e)){const t=No.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function el(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nl(Object.entries(e.classGroups),n).forEach(([i,s])=>{nr(s,r,i,t)}),r}function nr(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ko(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(tl(o)){nr(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{nr(s,Ko(t,i),n,r)})})}function Ko(e,t){let n=e;return t.split(tr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function tl(e){return e.isThemeGetter}function nl(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function rl(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const Bo="!";function ol(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===r&&(n||s.slice(g,g+o)===t)){a.push(s.slice(c,g)),c=g+o;continue}if(y==="/"){u=g;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),h=d.startsWith(Bo),m=h?d.substring(1):d,f=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:f}}}function il(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function sl(e){return{cache:rl(e.cacheSize),splitModifiers:ol(e),...Za(e)}}const al=/\s+/;function ll(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(al).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),h=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};h=!1}const m=il(a).join(":");return{isTailwindClass:!0,modifierId:l?m+Bo:m,classGroupId:d,originalClassName:s,hasPostfixModifier:h}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function cl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=zo(t))&&(r&&(r+=" "),r+=n);return r}function zo(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zo(e[r]))&&(n&&(n+=" "),n+=t);return n}function ul(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=sl(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=ll(l,n);return o(l,u),u}return function(){return i(cl.apply(null,arguments))}}function G(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Vo=/^\[(?:([a-z-]+):)?(.+)\]$/i,dl=/^\d+\/\d+$/,fl=new Set(["px","full","screen"]),hl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ml=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Re(e){return Ze(e)||fl.has(e)||dl.test(e)}function ze(e){return ut(e,"length",Cl)}function Ze(e){return!!e&&!Number.isNaN(Number(e))}function on(e){return ut(e,"number",Ze)}function At(e){return!!e&&Number.isInteger(Number(e))}function bl(e){return e.endsWith("%")&&Ze(e.slice(0,-1))}function $(e){return Vo.test(e)}function Ve(e){return hl.test(e)}const wl=new Set(["length","size","percentage"]);function vl(e){return ut(e,wl,Uo)}function xl(e){return ut(e,"position",Uo)}const Sl=new Set(["image","url"]);function El(e){return ut(e,Sl,Pl)}function kl(e){return ut(e,"",Ol)}function Tt(){return!0}function ut(e,t,n){const r=Vo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Cl(e){return gl.test(e)&&!pl.test(e)}function Uo(){return!1}function Ol(e){return ml.test(e)}function Pl(e){return yl.test(e)}function _l(){const e=G("colors"),t=G("spacing"),n=G("blur"),r=G("brightness"),o=G("borderColor"),i=G("borderRadius"),s=G("borderSpacing"),a=G("borderWidth"),l=G("contrast"),c=G("grayscale"),u=G("hueRotate"),d=G("invert"),h=G("gap"),m=G("gradientColorStops"),f=G("gradientColorStopPositions"),g=G("inset"),y=G("margin"),w=G("opacity"),b=G("padding"),v=G("saturate"),x=G("scale"),A=G("sepia"),S=G("skew"),k=G("space"),T=G("translate"),C=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",$,t],R=()=>[$,t],re=()=>["",Re,ze],X=()=>["auto",Ze,$],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],oe=()=>["start","end","center","between","around","evenly","stretch"],Be=()=>["","0",$],Kn=()=>["auto","avoid","all","avoid-page","page","left","right","column"],rt=()=>[Ze,on],kt=()=>[Ze,$];return{cacheSize:500,separator:":",theme:{colors:[Tt],spacing:[Re,ze],blur:["none","",Ve,$],brightness:rt(),borderColor:[e],borderRadius:["none","","full",Ve,$],borderSpacing:R(),borderWidth:re(),contrast:rt(),grayscale:Be(),hueRotate:kt(),invert:Be(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[bl,ze],inset:z(),margin:z(),opacity:rt(),padding:R(),saturate:rt(),scale:rt(),sepia:Be(),skew:kt(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",$]}],container:["container"],columns:[{columns:[Ve]}],"break-after":[{"break-after":Kn()}],"break-before":[{"break-before":Kn()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ee(),$]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",At,$]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$]}],grow:[{grow:Be()}],shrink:[{shrink:Be()}],order:[{order:["first","last","none",At,$]}],"grid-cols":[{"grid-cols":[Tt]}],"col-start-end":[{col:["auto",{span:["full",At,$]},$]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[Tt]}],"row-start-end":[{row:["auto",{span:[At,$]},$]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...oe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...oe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...oe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$,t]}],"min-w":[{"min-w":[$,t,"min","max","fit"]}],"max-w":[{"max-w":[$,t,"none","full","min","max","fit","prose",{screen:[Ve]},Ve]}],h:[{h:[$,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ve,ze]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",on]}],"font-family":[{font:[Tt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$]}],"line-clamp":[{"line-clamp":["none",Ze,on]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Re,$]}],"list-image":[{"list-image":["none",$]}],"list-style-type":[{list:["none","disc","decimal",$]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Re,ze]}],"underline-offset":[{"underline-offset":["auto",Re,$]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),xl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},El]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:I()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Re,$]}],"outline-w":[{outline:[Re,ze]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Re,ze]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ve,kl]}],"shadow-color":[{shadow:[Tt]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":V()}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ve,$]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$]}],duration:[{duration:kt()}],ease:[{ease:["linear","in","out","in-out",$]}],delay:[{delay:kt()}],animate:[{animate:["none","spin","ping","pulse","bounce",$]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[At,$]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Re,ze,on]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Al=ul(_l);function Ue(...e){return Al(Ja(e))}function Tl(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",sn(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",sn(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",sn(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",sn(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function sn(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Ml(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function Dl(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function an(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Ll={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function dt(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Ll[n][e]}const ln="https://heimdall.smarttalks.ai/api",Il="wss://heimdall.smarttalks.ai";function Rl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function $l(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const Fl=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${ln}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Rl(i);if(i.type==="entity")return $l(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return window.addEventListener("message",s=>{const a=s.data;a.from&&a.from==="smarttalkswidget"&&a.command==="registerContactData"&&a.contactData&&Object.keys(a.contactData).length&&fetch(`${ln}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.contactData)}).catch(console.error)}),i._id=n,i},[jo,Nl]=P(""),[ft]=De(()=>ia(jo,Fl)),Kl=()=>{if(ft()?.type==="chat")return ft()},Bl=()=>{if(ft()?.type==="form")return ft()};De(()=>D(()=>Tl(ft())));const Q=()=>({widgetId:jo,setWidgetId:Nl,widget:ft,chatWidget:Kl,formWidget:Bl});function qo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=qo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function zl(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=qo(e))&&(r&&(r+=" "),r+=t);return r}const Ho=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Wo=zl,Vl=(e,t)=>n=>{var r;if(t?.variants==null)return Wo(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],d=i?.[c];if(u===null)return null;const h=Ho(u)||Ho(d);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...m}=u;return Object.entries(m).every(f=>{let[g,y]=f;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,d,h]:c},[]);return Wo(e,s,l,n?.class,n?.className)};var Ul=L("<button>");const jl=Vl("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),me=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=Ul();return Je(n,M({get class(){return Ue(jl({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var ql=L('<img alt="widget logo">');const Go=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=ql();return Je(n,M({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ue("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Hl=L('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const Wl=()=>{const{chatWidget:e}=Q();return(()=>{var t=Hl(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return _(t,p(Go,{get src(){return e()?.avatar}}),n),_(r,()=>e()?.title??"Izi"),_(o,()=>e()?.subtitle??"SmartTalks.ai"),t})()};var Gl=L("<svg stroke-width=0>");function ae(e,t){const n=M(e.a,t),[r,o]=j(n,["src"]),[i,s]=P(""),a=O(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return D(()=>s(a())),N(()=>{s("")}),(()=>{var l=Gl();return Je(l,M({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),_(l,()=>Ia),l})()}function Yl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function Xl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function Jl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function Zl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}function Ql(e){return(...t)=>{for(const n of e)n&&n(...t)}}var E=e=>typeof e=="function"&&!e.length?e():e,Yo=e=>Array.isArray(e)?e:e?[e]:[];function ec(e,...t){return typeof e=="function"?e(...t):e}var tc=N;function nc(e,t,n,r){return e.addEventListener(t,n,r),tc(e.removeEventListener.bind(e,t,n,r))}function rc(e,t,n,r){const o=()=>{Yo(E(e)).forEach(i=>{i&&Yo(E(t)).forEach(s=>nc(i,s,n,r))})};typeof e=="function"?D(o):Z(o)}var Xo={equals:!1};function oc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function ic(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var rr=e=>typeof e=="function"&&!e.length?e():e;function cn(){return!0}var sc={get(e,t,n){return t===pe?n:e.get(t)},has(e,t){return e.has(t)},set:cn,deleteProperty:cn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:cn,deleteProperty:cn}},ownKeys(e){return e.keys()}},ac=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Jo(e){const t={};let n;for(;n=ac.exec(e);)t[n[1]]=n[2];return t}function lc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Jo(e)}else typeof t=="string"&&(t=Jo(t));return{...e,...t}}var or=(e,t,n)=>{let r;for(const o of e){const i=rr(o)[t];r?i&&(r=n(r,i)):r=i}return r};function cc(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?ic:oc,o={};for(const s of n){const a=rr(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],u=l.toLowerCase(),d=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=M(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return or(n,"style",lc);if(s==="ref"){const a=[];for(const l of n){const c=rr(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?or(n,s,(a,l)=>`${a} ${l}`):s==="classList"?or(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},sc)}function Qe(...e){return Ql(e)}function uc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ir(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dc(e){return typeof e=="number"}function fc(e){return Array.isArray(e)}function ht(e){return Object.prototype.toString.call(e)==="[object String]"}function hc(e){return typeof e=="function"}function Zo(e){return t=>`${e()}-${t}`}function Ce(e,t){return e?e===t||e.contains(t):!1}function Mt(e,t=!1){const{activeElement:n}=$e(e);if(!n?.nodeName)return null;if(Qo(n)&&n.contentDocument)return Mt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=$e(n).getElementById(r);if(o)return o}}return n}function $e(e){return e?e.ownerDocument||e:document}function Qo(e){return e.tagName==="IFRAME"}var ei=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ei||{});function sr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function un(){return sr(/^Mac/i)}function gc(){return sr(/^iPhone/i)}function pc(){return sr(/^iPad/i)||un()&&navigator.maxTouchPoints>1}function mc(){return gc()||pc()}function yc(){return un()||mc()}function ue(e,t){return t&&(hc(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ye(e){return t=>{for(const n of e)ue(t,n)}}function bc(e){return un()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function le(e){if(e)if(wc())e.focus({preventScroll:!0});else{const t=vc(e);e.focus(),xc(t)}}var dn=null;function wc(){if(dn==null){dn=!1;try{document.createElement("div").focus({get preventScroll(){return dn=!0,!0}})}catch{}}return dn}function vc(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function xc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ti=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Sc=[...ti,'[tabindex]:not([tabindex="-1"]):not([disabled])'],ar=ti.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",Ec=Sc.join(':not([hidden]):not([tabindex="-1"]),');function ni(e,t){const r=Array.from(e.querySelectorAll(ar)).filter(ri);return t&&ri(e)&&r.unshift(e),r.forEach((o,i)=>{if(Qo(o)&&o.contentDocument){const s=o.contentDocument.body,a=ni(s,!1);r.splice(i,1,...a)}}),r}function ri(e){return oi(e)&&!kc(e)}function oi(e){return e.matches(ar)&&lr(e)}function kc(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function lr(e,t){return e.nodeName!=="#comment"&&Cc(e)&&Oc(e,t)&&(!e.parentElement||lr(e.parentElement,e))}function Cc(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Oc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Pc(e,t){return t.some(n=>n.contains(e))}function _c(e,t,n){const r=t?.tabbable?Ec:ar,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&lr(i)&&(!n||Pc(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function ii(e){for(;e&&!Ac(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function Ac(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Tc(){}function Mc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[d,h]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],f=(u-h)*(n-c)-(c-d)*(r-u);if(h<u){if(r>=h&&r<u){if(f===0)return!0;f>0&&(r===h?r>m&&(o=!o):o=!o)}}else if(u<h){if(r>u&&r<=h){if(f===0)return!0;f<0&&(r===h?r<m&&(o=!o):o=!o)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function Oe(e,t){return M(e,t)}var Dt=new Map,si=new Set;function ai(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Dt.get(n.target);r||(r=new Set,Dt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Dt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Dt.delete(n.target)),Dt.size===0)){for(const o of si)o();si.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?ai():document.addEventListener("DOMContentLoaded",ai));function cr(e,t){const n=li(e,t,"left"),r=li(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function li(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Dc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=ii(e);for(;e&&o&&e!==n&&o!==n;)cr(o,e),e=o,o=ii(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}var Lc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function ur(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=ht(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=ht(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(ht(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return ht(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(ht(l)||dc(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=ur({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
|
|
1
|
+
(function(Ut){typeof define=="function"&&define.amd?define(Ut):Ut()})(function(){"use strict";function Ut(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),io(o.value)&&!Zs(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function Gs(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=io(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Js(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Ys(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Xs(e,t){const n=Ut(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?ro(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&oo(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&oo(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),n}function ro(e){if(e)try{return JSON.parse(e)}catch{return e}}function oo(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Js(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function io(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Zs(e){return Object.prototype.toString.call(e)==="[object Function]"}function Qs(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let zn;function ea(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Xs(this,t);const o=Ys(this.props),i=this.Component,s=zn;try{zn=this,this.__initialized=!0,Qs(i)?new i(o,{element:this}):i(o,{element:this})}finally{zn=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?ro(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function ta(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{if(!e)throw new Error("tag is required to register a Component");let a=i.get(e);return a?(a.prototype.Component=s,a):(a=ea(r,Gs(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const so={context:void 0,registry:void 0},na=(e,t)=>e===t,pe=Symbol("solid-proxy"),Vn=Symbol("solid-track"),jt={equals:na};let ao=fo;const Te=1,qt=2,lo={owned:null,cleanups:null,context:null,owner:null},Un={};var q=null;let jn=null,ra=null,W=null,te=null,Me=null,Ht=0;function De(e,t){const n=W,r=q,o=e.length===0,i=t===void 0?r:t,s=o?lo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>H(()=>Jt(s)));q=s,W=null;try{return Le(a,!0)}finally{W=n,q=r}}function P(e,t){t=t?Object.assign({},jt,t):jt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),uo(n,o));return[co.bind(n),r]}function qn(e,t,n){const r=Gt(e,t,!0,Te);ot(r)}function Z(e,t,n){const r=Gt(e,t,!1,Te);ot(r)}function D(e,t,n){ao=da;const r=Gt(e,t,!1,Te);(!n||!n.render)&&(r.user=!0),Me?Me.push(r):ot(r)}function O(e,t,n){n=n?Object.assign({},jt,n):jt;const r=Gt(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ot(r),co.bind(r)}function oa(e){return e&&typeof e=="object"&&"then"in e}function ia(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=Un,l=!1,c="initialValue"in i,u=typeof r=="function"&&O(r);const d=new Set,[h,m]=(i.storage||P)(i.initialValue),[f,g]=P(void 0),[y,w]=P(void 0,{equals:!1}),[b,v]=P(c?"ready":"unresolved");function x(T,C,F,z){return s===T&&(s=null,z!==void 0&&(c=!0),(T===a||C===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(z,{value:C})),a=Un,A(C,F)),C}function A(T,C){Le(()=>{C===void 0&&m(()=>T),v(C!==void 0?"errored":c?"ready":"unresolved"),g(C);for(const F of d.keys())F.decrement();d.clear()},!1)}function S(){const T=la,C=h(),F=f();if(F!==void 0&&!s)throw F;return W&&!W.user&&T&&qn(()=>{y(),s&&(T.resolved||d.has(T)||(T.increment(),d.add(T)))}),C}function k(T=!0){if(T!==!1&&l)return;l=!1;const C=u?u():r;if(C==null||C===!1){x(s,H(h));return}const F=a!==Un?a:H(()=>o(C,{value:h(),refetching:T}));return oa(F)?(s=F,"value"in F?(F.status==="success"?x(s,F.value,void 0,C):x(s,void 0,void 0,C),F):(l=!0,queueMicrotask(()=>l=!1),Le(()=>{v(c?"refreshing":"pending"),w()},!1),F.then(z=>x(F,z,void 0,C),z=>x(F,void 0,go(z),C)))):(x(s,F,void 0,C),F)}return Object.defineProperties(S,{state:{get:()=>b()},error:{get:()=>f()},loading:{get(){const T=b();return T==="pending"||T==="refreshing"}},latest:{get(){if(!c)return S();const T=f();if(T&&!s)throw T;return h()}}}),u?qn(()=>k(!1)):k(!1),[S,{refetch:k,mutate:m}]}function xe(e){return Le(e,!1)}function H(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function Xe(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=H(()=>t(a,o,s));return o=a,l}}function Wt(e){D(()=>H(e))}function N(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Hn(){return W}function sa(){return q}function aa(e,t){const n=q,r=W;q=e,W=null;try{return Le(t,!0)}catch(o){Gn(o)}finally{q=n,W=r}}function ie(e,t){const n=Symbol("context");return{id:n,Provider:fa(n),defaultValue:e}}function ce(e){return q&&q.context&&q.context[e.id]!==void 0?q.context[e.id]:e.defaultValue}function Wn(e){const t=O(e),n=O(()=>Yn(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let la;function co(){if(this.sources&&this.state)if(this.state===Te)ot(this);else{const e=te;te=null,Le(()=>Xt(this),!1),te=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function uo(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Le(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=jn&&jn.running;s&&jn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?te.push(i):Me.push(i),i.observers&&ho(i)),s||(i.state=Te)}if(te.length>1e6)throw te=[],new Error},!1)),t}function ot(e){if(!e.fn)return;Jt(e);const t=Ht;ca(e,e.value,t)}function ca(e,t,n){let r;const o=q,i=W;W=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Te,e.owned&&e.owned.forEach(Jt),e.owned=null),e.updatedAt=n+1,Gn(s)}finally{W=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?uo(e,r):e.value=r,e.updatedAt=n)}function Gt(e,t,n,r=Te,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==lo&&(q.owned?q.owned.push(i):q.owned=[i]),i}function Yt(e){if(e.state===0)return;if(e.state===qt)return Xt(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ht);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Te)ot(e);else if(e.state===qt){const r=te;te=null,Le(()=>Xt(e,t[0]),!1),te=r}}function Le(e,t){if(te)return e();let n=!1;t||(te=[]),Me?n=!0:Me=[],Ht++;try{const r=e();return ua(n),r}catch(r){n||(Me=null),te=null,Gn(r)}}function ua(e){if(te&&(fo(te),te=null),e)return;const t=Me;Me=null,t.length&&Le(()=>ao(t),!1)}function fo(e){for(let t=0;t<e.length;t++)Yt(e[t])}function da(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Yt(r)}for(t=0;t<n;t++)Yt(e[t])}function Xt(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Te?r!==t&&(!r.updatedAt||r.updatedAt<Ht)&&Yt(r):o===qt&&Xt(r,t)}}}function ho(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=qt,n.pure?te.push(n):Me.push(n),n.observers&&ho(n))}}function Jt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Jt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function go(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Gn(e,t=q){throw go(e)}function Yn(e){if(typeof e=="function"&&!e.length)return Yn(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Yn(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function fa(e,t){return function(r){let o;return Z(()=>o=H(()=>(q.context={...q.context,[e]:r.value},Wn(()=>r.children))),void 0),o}}const ha=Symbol("fallback");function po(e){for(let t=0;t<e.length;t++)e[t]()}function ga(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return N(()=>po(i)),()=>{let l=e()||[],c,u;return l[Vn],H(()=>{let h=l.length,m,f,g,y,w,b,v,x,A;if(h===0)s!==0&&(po(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ha],o[0]=De(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=De(d);s=h}else{for(g=new Array(h),y=new Array(h),a&&(w=new Array(h)),b=0,v=Math.min(s,h);b<v&&r[b]===l[b];b++);for(v=s-1,x=h-1;v>=b&&x>=b&&r[v]===l[x];v--,x--)g[x]=o[v],y[x]=i[v],a&&(w[x]=a[v]);for(m=new Map,f=new Array(x+1),u=x;u>=b;u--)A=l[u],c=m.get(A),f[u]=c===void 0?-1:c,m.set(A,u);for(c=b;c<=v;c++)A=r[c],u=m.get(A),u!==void 0&&u!==-1?(g[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=f[u],m.set(A,u)):i[c]();for(u=b;u<h;u++)u in g?(o[u]=g[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=De(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[m,f]=P(u);return a[u]=f,t(l[u],m)}return t(l[u])}}}function p(e,t){return H(()=>e(t||{}))}function Zt(){return!0}const Xn={get(e,t,n){return t===pe?n:e.get(t)},has(e,t){return t===pe?!0:e.has(t)},set:Zt,deleteProperty:Zt,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Zt,deleteProperty:Zt}},ownKeys(e){return e.keys()}};function Jn(e){return(e=typeof e=="function"?e():e)?e:{}}function pa(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function M(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&pe in a,e[s]=typeof a=="function"?(t=!0,O(a)):a}if(t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Jn(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Jn(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Jn(e[a])));return[...new Set(s)]}},Xn);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:pa.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const h=n[u];h&&(d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(pe in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Xn));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},Xn)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let ma=0;function ke(){const e=so.context;return e?`${e.id}${e.count++}`:`cl-${ma++}`}const mo=e=>`Stale read from <${e}>.`;function it(e){const t="fallback"in e&&{fallback:()=>e.fallback};return O(ga(()=>e.each,e.children,t||void 0))}function Y(e){const t=e.keyed,n=O(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return O(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?H(()=>o(t?r:()=>{if(!H(n))throw mo("Show");return e.when})):o}return e.fallback},void 0,void 0)}function yo(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=Wn(()=>e.children),o=O(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return O(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?H(()=>l(t?s:()=>{if(H(o)[0]!==i)throw mo("Match");return a.when})):l},void 0,void 0)}function Ct(e){return e}const ya=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],ba=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ya]),wa=new Set(["innerHTML","textContent","innerText","children"]),va=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),xa=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Sa(e,t){const n=xa[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Ea=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ka=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Ca={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Oa(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,m;for(;++d<o&&d<i&&!((m=c.get(t[d]))==null||m!==u+h);)h++;if(h>u-a){const f=t[s];for(;a<u;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const bo="_$DX_DELEGATE";function L(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>H(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Pa(e,t=window.document){const n=t[bo]||(t[bo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,La))}}function se(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function _a(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function st(e,t){t==null?e.removeAttribute("class"):e.className=t}function Aa(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function Ta(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(vo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(vo(e,a,!0),n[a]=l)}return n}function Qt(e,t,n){if(!t)return n?se(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Je(e,t={},n,r){const o={};return r||Z(()=>o.children=at(e,t.children,o.children)),Z(()=>t.ref&&t.ref(e)),Z(()=>Ma(e,t,n,!0,o,!0)),o}function wo(e,t,n){return H(()=>e(t,n))}function _(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return at(e,t,r,n);Z(o=>at(e,t(),o,n),r)}function Ma(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=xo(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||at(e,t.children);continue}const a=t[s];o[s]=xo(e,s,a,o[s],n,i)}}function Da(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function vo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function xo(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return Qt(e,n,r);if(t==="classList")return Ta(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=Ea.has(d);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(h||n)&&(Aa(e,d,n,h),h&&Pa([d]))}else if(t.slice(0,5)==="attr:")se(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=wa.has(t))||!o&&((c=Sa(t,e.tagName))||(a=ba.has(t)))||(s=e.nodeName.includes("-")))u&&(t=t.slice(5),a=!0),t==="class"||t==="className"?st(e,n):s&&!a&&!l?e[Da(t)]=n:e[c||t]=n;else{const d=o&&t.indexOf(":")>-1&&Ca[t.split(":")[0]];d?_a(e,d,t,n):se(e,va[t]||t,n)}return n}function La(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function at(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=lt(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||i==="boolean")n=lt(e,n,r);else{if(i==="function")return Z(()=>{let a=t();for(;typeof a=="function";)a=a();n=at(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Zn(a,t,n,o))return Z(()=>n=at(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=lt(e,n,r),s)return n}else l?n.length===0?So(e,a,r):Oa(e,n,a):(n&<(e),So(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=lt(e,n,r,t);lt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Zn(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Zn(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Zn(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function So(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function lt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const Ia=!1,Ra="http://www.w3.org/2000/svg";function Eo(e,t=!1){return t?document.createElementNS(Ra,e):document.createElement(e)}function ko(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=sa();let i,s=!!so.context;return D(()=>{i||(i=aa(o,()=>O(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),u=()=>c(!0);De(d=>_(a,()=>l()?d():i(),null)),N(u)}else{const l=Eo(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),_(c,i),a.appendChild(l),e.ref&&e.ref(l),N(()=>a.removeChild(l))}},void 0,{render:!s}),n}function en(e){const[t,n]=j(e,["component"]),r=O(()=>t.component);return O(()=>{const o=r();switch(typeof o){case"function":return H(()=>o(n));case"string":const i=ka.has(o),s=Eo(o,i);return Je(s,n,i),s}})}function $a(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=P(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function Fa(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Na(e){return(t,n)=>{const{element:r}=n;return De(o=>{const i=$a(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return _(r.renderRoot,s)},Fa(r))}}function Ka(e,t,n){return arguments.length===2&&(n=t,t={}),ta(e,t)(Na(n))}const Ba='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-9{left:2.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-6{padding-bottom:1.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Co,Qn]=P(!1),Oo=[],za=e=>Oo.push(e),Po=()=>{Oo.forEach(e=>e())},Va=()=>{Qn(!Co()),Po()},Ua=()=>{Qn(!1)},ja=()=>{Qn(!0),Po()},_o=()=>({bubble:Co,show:ja,hide:Ua,toggle:Va,onOpen:za}),er=Symbol("store-raw"),ct=Symbol("store-node"),Ie=Symbol("store-has"),Ao=Symbol("store-self");function To(e){let t=e[pe];if(!t&&(Object.defineProperty(e,pe,{value:t=new Proxy(e,Wa)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function tn(e){let t;return e!=null&&typeof e=="object"&&(e[pe]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ot(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[er])return n;if(!tn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=Ot(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=Ot(o,t))!==o&&(e[i]=r))}return e}function nn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Pt(e,t,n){if(e[t])return e[t];const[r,o]=P(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function qa(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===pe||t===ct||(delete n.value,delete n.writable,n.get=()=>e[pe][t]),n}function Mo(e){Hn()&&Pt(nn(e,ct),Ao)()}function Ha(e){return Mo(e),Reflect.ownKeys(e)}const Wa={get(e,t,n){if(t===er)return e;if(t===pe)return n;if(t===Vn)return Mo(e),n;const r=nn(e,ct),o=r[t];let i=o?o():e[t];if(t===ct||t===Ie||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Hn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Pt(r,t,i)())}return tn(i)?To(i):i},has(e,t){return t===er||t===pe||t===Vn||t===ct||t===Ie||t==="__proto__"?!0:(Hn()&&Pt(nn(e,Ie),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Ha,getOwnPropertyDescriptor:qa};function rn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Ie]&&e[Ie][t]&&o!==void 0&&e[Ie][t].$()):(e[t]=n,e[Ie]&&e[Ie][t]&&o===void 0&&e[Ie][t].$());let s=nn(e,ct),a;if((a=Pt(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Pt(s,"length",i))&&a.$(e.length)}(a=s[Ao])&&a.$()}function Do(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];rn(e,o,t[o])}}function Ga(e,t){if(typeof t=="function"&&(t=t(e)),t=Ot(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&rn(e,n,o)}rn(e,"length",r)}else Do(e,t)}function _t(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)_t(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&_t(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let d=l;d<=c;d+=u)_t(e,[d].concat(t),n);return}else if(t.length>1){_t(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Ot(i),r===void 0||tn(o)&&tn(i)&&!Array.isArray(i)?Do(o,i):rn(e,r,i))}function Ya(...[e,t]){const n=Ot(e||{}),r=Array.isArray(n),o=To(n);function i(...s){xe(()=>{r&&s.length===1?Ga(n,s[0]):_t(n,s)})}return[o,i]}function Lo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Io(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Ro(e,t,n){return De(()=>{const r=Io(e),[o,i]=Ya(r?JSON.parse(r):t);return D(()=>Lo(e,JSON.stringify(o),n)),[o,i]})}function Xa(e,t,n){return De(()=>{const r=Io(e),[o,i]=P(r?JSON.parse(r):t);return D(()=>Lo(e,JSON.stringify(o()),n)),[o,i]})}Xa("lang","en");function $o(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=$o(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ja(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$o(e))&&(r&&(r+=" "),r+=t);return r}const tr="-";function Za(e){const t=el(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(tr);return a[0]===""&&a.length!==1&&a.shift(),Fo(a,t)||Qa(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Fo(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Fo(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(tr);return t.validators.find(({validator:s})=>s(i))?.classGroupId}const No=/^\[(.+)\]$/;function Qa(e){if(No.test(e)){const t=No.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function el(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nl(Object.entries(e.classGroups),n).forEach(([i,s])=>{nr(s,r,i,t)}),r}function nr(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ko(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(tl(o)){nr(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{nr(s,Ko(t,i),n,r)})})}function Ko(e,t){let n=e;return t.split(tr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function tl(e){return e.isThemeGetter}function nl(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function rl(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const Bo="!";function ol(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===r&&(n||s.slice(g,g+o)===t)){a.push(s.slice(c,g)),c=g+o;continue}if(y==="/"){u=g;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),h=d.startsWith(Bo),m=h?d.substring(1):d,f=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:f}}}function il(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function sl(e){return{cache:rl(e.cacheSize),splitModifiers:ol(e),...Za(e)}}const al=/\s+/;function ll(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(al).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),h=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};h=!1}const m=il(a).join(":");return{isTailwindClass:!0,modifierId:l?m+Bo:m,classGroupId:d,originalClassName:s,hasPostfixModifier:h}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function cl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=zo(t))&&(r&&(r+=" "),r+=n);return r}function zo(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zo(e[r]))&&(n&&(n+=" "),n+=t);return n}function ul(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=sl(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=ll(l,n);return o(l,u),u}return function(){return i(cl.apply(null,arguments))}}function G(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Vo=/^\[(?:([a-z-]+):)?(.+)\]$/i,dl=/^\d+\/\d+$/,fl=new Set(["px","full","screen"]),hl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ml=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Re(e){return Ze(e)||fl.has(e)||dl.test(e)}function ze(e){return ut(e,"length",Cl)}function Ze(e){return!!e&&!Number.isNaN(Number(e))}function on(e){return ut(e,"number",Ze)}function At(e){return!!e&&Number.isInteger(Number(e))}function bl(e){return e.endsWith("%")&&Ze(e.slice(0,-1))}function $(e){return Vo.test(e)}function Ve(e){return hl.test(e)}const wl=new Set(["length","size","percentage"]);function vl(e){return ut(e,wl,Uo)}function xl(e){return ut(e,"position",Uo)}const Sl=new Set(["image","url"]);function El(e){return ut(e,Sl,Pl)}function kl(e){return ut(e,"",Ol)}function Tt(){return!0}function ut(e,t,n){const r=Vo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Cl(e){return gl.test(e)&&!pl.test(e)}function Uo(){return!1}function Ol(e){return ml.test(e)}function Pl(e){return yl.test(e)}function _l(){const e=G("colors"),t=G("spacing"),n=G("blur"),r=G("brightness"),o=G("borderColor"),i=G("borderRadius"),s=G("borderSpacing"),a=G("borderWidth"),l=G("contrast"),c=G("grayscale"),u=G("hueRotate"),d=G("invert"),h=G("gap"),m=G("gradientColorStops"),f=G("gradientColorStopPositions"),g=G("inset"),y=G("margin"),w=G("opacity"),b=G("padding"),v=G("saturate"),x=G("scale"),A=G("sepia"),S=G("skew"),k=G("space"),T=G("translate"),C=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",$,t],R=()=>[$,t],re=()=>["",Re,ze],X=()=>["auto",Ze,$],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],oe=()=>["start","end","center","between","around","evenly","stretch"],Be=()=>["","0",$],Kn=()=>["auto","avoid","all","avoid-page","page","left","right","column"],rt=()=>[Ze,on],kt=()=>[Ze,$];return{cacheSize:500,separator:":",theme:{colors:[Tt],spacing:[Re,ze],blur:["none","",Ve,$],brightness:rt(),borderColor:[e],borderRadius:["none","","full",Ve,$],borderSpacing:R(),borderWidth:re(),contrast:rt(),grayscale:Be(),hueRotate:kt(),invert:Be(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[bl,ze],inset:z(),margin:z(),opacity:rt(),padding:R(),saturate:rt(),scale:rt(),sepia:Be(),skew:kt(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",$]}],container:["container"],columns:[{columns:[Ve]}],"break-after":[{"break-after":Kn()}],"break-before":[{"break-before":Kn()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ee(),$]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",At,$]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$]}],grow:[{grow:Be()}],shrink:[{shrink:Be()}],order:[{order:["first","last","none",At,$]}],"grid-cols":[{"grid-cols":[Tt]}],"col-start-end":[{col:["auto",{span:["full",At,$]},$]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[Tt]}],"row-start-end":[{row:["auto",{span:[At,$]},$]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...oe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...oe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...oe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$,t]}],"min-w":[{"min-w":[$,t,"min","max","fit"]}],"max-w":[{"max-w":[$,t,"none","full","min","max","fit","prose",{screen:[Ve]},Ve]}],h:[{h:[$,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ve,ze]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",on]}],"font-family":[{font:[Tt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$]}],"line-clamp":[{"line-clamp":["none",Ze,on]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Re,$]}],"list-image":[{"list-image":["none",$]}],"list-style-type":[{list:["none","disc","decimal",$]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Re,ze]}],"underline-offset":[{"underline-offset":["auto",Re,$]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),xl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},El]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:I()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Re,$]}],"outline-w":[{outline:[Re,ze]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Re,ze]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ve,kl]}],"shadow-color":[{shadow:[Tt]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":V()}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ve,$]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$]}],duration:[{duration:kt()}],ease:[{ease:["linear","in","out","in-out",$]}],delay:[{delay:kt()}],animate:[{animate:["none","spin","ping","pulse","bounce",$]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[At,$]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Re,ze,on]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Al=ul(_l);function Ue(...e){return Al(Ja(e))}function Tl(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",sn(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",sn(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",sn(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",sn(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function sn(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Ml(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function Dl(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function an(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Ll={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function dt(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Ll[n][e]}const ln="https://heimdall.smarttalks.ai/api",Il="wss://heimdall.smarttalks.ai";function Rl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function $l(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const Fl=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${ln}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Rl(i);if(i.type==="entity")return $l(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return window.addEventListener("message",s=>{const a=s.data;a.from&&a.from==="smarttalkswidget"&&a.command==="registerContactData"&&a.contactData&&Object.keys(a.contactData).length&&fetch(`${ln}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.contactData)}).catch(console.error)}),i._id=n,i},[jo,Nl]=P(""),[ft]=De(()=>ia(jo,Fl)),Kl=()=>{if(ft()?.type==="chat")return ft()},Bl=()=>{if(ft()?.type==="form")return ft()};De(()=>D(()=>Tl(ft())));const Q=()=>({widgetId:jo,setWidgetId:Nl,widget:ft,chatWidget:Kl,formWidget:Bl});function qo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=qo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function zl(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=qo(e))&&(r&&(r+=" "),r+=t);return r}const Ho=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Wo=zl,Vl=(e,t)=>n=>{var r;if(t?.variants==null)return Wo(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],d=i?.[c];if(u===null)return null;const h=Ho(u)||Ho(d);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...m}=u;return Object.entries(m).every(f=>{let[g,y]=f;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,d,h]:c},[]);return Wo(e,s,l,n?.class,n?.className)};var Ul=L("<button>");const jl=Vl("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),me=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=Ul();return Je(n,M({get class(){return Ue(jl({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var ql=L('<img alt="widget logo">');const Go=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=ql();return Je(n,M({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ue("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Hl=L('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const Wl=()=>{const{chatWidget:e}=Q(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=Hl(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return _(r,p(Go,{get src(){return e()?.avatar}}),o),_(i,t),_(s,n),r})()};var Gl=L("<svg stroke-width=0>");function ae(e,t){const n=M(e.a,t),[r,o]=j(n,["src"]),[i,s]=P(""),a=O(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return D(()=>s(a())),N(()=>{s("")}),(()=>{var l=Gl();return Je(l,M({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),_(l,()=>Ia),l})()}function Yl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function Xl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function Jl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function Zl(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}function Ql(e){return(...t)=>{for(const n of e)n&&n(...t)}}var E=e=>typeof e=="function"&&!e.length?e():e,Yo=e=>Array.isArray(e)?e:e?[e]:[];function ec(e,...t){return typeof e=="function"?e(...t):e}var tc=N;function nc(e,t,n,r){return e.addEventListener(t,n,r),tc(e.removeEventListener.bind(e,t,n,r))}function rc(e,t,n,r){const o=()=>{Yo(E(e)).forEach(i=>{i&&Yo(E(t)).forEach(s=>nc(i,s,n,r))})};typeof e=="function"?D(o):Z(o)}var Xo={equals:!1};function oc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function ic(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var rr=e=>typeof e=="function"&&!e.length?e():e;function cn(){return!0}var sc={get(e,t,n){return t===pe?n:e.get(t)},has(e,t){return e.has(t)},set:cn,deleteProperty:cn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:cn,deleteProperty:cn}},ownKeys(e){return e.keys()}},ac=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Jo(e){const t={};let n;for(;n=ac.exec(e);)t[n[1]]=n[2];return t}function lc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Jo(e)}else typeof t=="string"&&(t=Jo(t));return{...e,...t}}var or=(e,t,n)=>{let r;for(const o of e){const i=rr(o)[t];r?i&&(r=n(r,i)):r=i}return r};function cc(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?ic:oc,o={};for(const s of n){const a=rr(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],u=l.toLowerCase(),d=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=M(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return or(n,"style",lc);if(s==="ref"){const a=[];for(const l of n){const c=rr(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?or(n,s,(a,l)=>`${a} ${l}`):s==="classList"?or(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},sc)}function Qe(...e){return Ql(e)}function uc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ir(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dc(e){return typeof e=="number"}function fc(e){return Array.isArray(e)}function ht(e){return Object.prototype.toString.call(e)==="[object String]"}function hc(e){return typeof e=="function"}function Zo(e){return t=>`${e()}-${t}`}function Ce(e,t){return e?e===t||e.contains(t):!1}function Mt(e,t=!1){const{activeElement:n}=$e(e);if(!n?.nodeName)return null;if(Qo(n)&&n.contentDocument)return Mt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=$e(n).getElementById(r);if(o)return o}}return n}function $e(e){return e?e.ownerDocument||e:document}function Qo(e){return e.tagName==="IFRAME"}var ei=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ei||{});function sr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function un(){return sr(/^Mac/i)}function gc(){return sr(/^iPhone/i)}function pc(){return sr(/^iPad/i)||un()&&navigator.maxTouchPoints>1}function mc(){return gc()||pc()}function yc(){return un()||mc()}function ue(e,t){return t&&(hc(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ye(e){return t=>{for(const n of e)ue(t,n)}}function bc(e){return un()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function le(e){if(e)if(wc())e.focus({preventScroll:!0});else{const t=vc(e);e.focus(),xc(t)}}var dn=null;function wc(){if(dn==null){dn=!1;try{document.createElement("div").focus({get preventScroll(){return dn=!0,!0}})}catch{}}return dn}function vc(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function xc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ti=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Sc=[...ti,'[tabindex]:not([tabindex="-1"]):not([disabled])'],ar=ti.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",Ec=Sc.join(':not([hidden]):not([tabindex="-1"]),');function ni(e,t){const r=Array.from(e.querySelectorAll(ar)).filter(ri);return t&&ri(e)&&r.unshift(e),r.forEach((o,i)=>{if(Qo(o)&&o.contentDocument){const s=o.contentDocument.body,a=ni(s,!1);r.splice(i,1,...a)}}),r}function ri(e){return oi(e)&&!kc(e)}function oi(e){return e.matches(ar)&&lr(e)}function kc(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function lr(e,t){return e.nodeName!=="#comment"&&Cc(e)&&Oc(e,t)&&(!e.parentElement||lr(e.parentElement,e))}function Cc(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Oc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Pc(e,t){return t.some(n=>n.contains(e))}function _c(e,t,n){const r=t?.tabbable?Ec:ar,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&lr(i)&&(!n||Pc(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function ii(e){for(;e&&!Ac(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function Ac(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Tc(){}function Mc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[d,h]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],f=(u-h)*(n-c)-(c-d)*(r-u);if(h<u){if(r>=h&&r<u){if(f===0)return!0;f>0&&(r===h?r>m&&(o=!o):o=!o)}}else if(u<h){if(r>u&&r<=h){if(f===0)return!0;f<0&&(r===h?r<m&&(o=!o):o=!o)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function Oe(e,t){return M(e,t)}var Dt=new Map,si=new Set;function ai(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Dt.get(n.target);r||(r=new Set,Dt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Dt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Dt.delete(n.target)),Dt.size===0)){for(const o of si)o();si.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?ai():document.addEventListener("DOMContentLoaded",ai));function cr(e,t){const n=li(e,t,"left"),r=li(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function li(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Dc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=ii(e);for(;e&&o&&e!==n&&o!==n;)cr(o,e),e=o,o=ii(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}var Lc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function ur(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=ht(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=ht(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(ht(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return ht(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(ht(l)||dc(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=ur({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
|
|
2
2
|
* Portions of this file are based on code from react-spectrum.
|
|
3
3
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
4
4
|
*
|
|
@@ -178,4 +178,4 @@
|
|
|
178
178
|
*
|
|
179
179
|
* Credits to the Radix UI team:
|
|
180
180
|
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
|
|
181
|
-
*/function Ld(e,t){return t?Mc([e.clientX,e.clientY],t):!1}function Id(e){const t=wt(),n=Oi(),r=rs(),o=Oe({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=P(),[h,m]=P(),[f,g]=P(),[y,w]=P(),[b,v]=P(!0),[x,A]=P(s.placement),[S,k]=P([]),[T,C]=P([]),{DomCollectionProvider:F}=Au({items:T,onItemsChange:C}),z=ci({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),R=Jc(()=>t.forceMount()||z.isOpen()),re=yu({selectionMode:"none",dataSource:T}),X=U=>{v(U),z.open()},ee=(U=!1)=>{z.close(),U&&r&&r.close(!0)},I=U=>{v(U),z.toggle()},V=()=>{const U=y();U&&(le(U),re.selectionManager().setFocused(!0),re.selectionManager().setFocusedKey(void 0))},oe=U=>{k(no=>[...no,U]);const Bn=r?.registerNestedMenu(U);return()=>{k(no=>ir(no,U)),Bn?.()}},Be=U=>c===l?.side&&Ld(U,l?.area),Kn=U=>{Be(U)&&U.preventDefault()},rt=U=>{Be(U)||V()},kt=U=>{Be(U)&&U.preventDefault()};Gc({isDisabled:()=>!(r==null&&z.isOpen()&&t.isModal()),targets:()=>[y(),...S()].filter(Boolean)}),D(()=>{const U=y();if(!U||!r)return;const Bn=r.registerNestedMenu(U);N(()=>{Bn()})});const Gp={dataset:O(()=>({"data-expanded":z.isOpen()?"":void 0,"data-closed":z.isOpen()?void 0:""})),isOpen:z.isOpen,contentPresence:R,nestedMenus:S,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>re,parentMenuContext:()=>r,triggerRef:f,contentRef:y,triggerId:u,contentId:h,setTriggerRef:g,setContentRef:w,open:X,close:ee,toggle:I,focusContent:V,onItemEnter:Kn,onItemLeave:rt,onTriggerLeave:kt,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:oe,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:gn(d),registerContentId:gn(m)};return p(F,{get children(){return p(ns.Provider,{value:Gp,get children(){return p(Dd,M({anchorRef:f,contentRef:y,onCurrentPlacementChange:A},s))}})}})}const Rd=ie();function $d(e){let t;const n=wt(),r=bt(),o=Oe({id:n.generateId(`item-${ke()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,u]=P(),[d,h]=P(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Tu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const w=pu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=C=>{ue(C,i.onPointerMove),C.pointerType==="mouse"&&(i.disabled?r.onItemLeave(C):(r.onItemEnter(C),C.defaultPrevented||(le(C.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},v=C=>{ue(C,i.onPointerLeave),C.pointerType==="mouse"&&r.onItemLeave(C)},x=C=>{ue(C,i.onPointerUp),!i.disabled&&C.button===0&&y()},A=C=>{if(ue(C,i.onKeyDown),!C.repeat&&!i.disabled)switch(C.key){case"Enter":case" ":y();break}},S=O(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=O(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),T={isChecked:()=>i.checked,dataset:k,setLabelRef:h,generateId:Zo(()=>s.id),registerLabel:gn(l),registerDescription:gn(u)};return p(Rd.Provider,{value:T,get children(){return p(pn,M({as:"div",ref(C){var F=Qe(z=>t=z,i.ref);typeof F=="function"&&F(C)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return w.dataKey()},get onPointerDown(){return ye([i.onPointerDown,w.onPointerDown])},get onPointerUp(){return ye([x,w.onPointerUp])},get onClick(){return ye([i.onClick,w.onClick])},get onKeyDown(){return ye([A,w.onKeyDown])},get onMouseDown(){return ye([i.onMouseDown,w.onMouseDown])},get onFocus(){return ye([i.onFocus,w.onFocus])},onPointerMove:b,onPointerLeave:v},k,s))}})}const Fd=ie();function is(){return ce(Fd)}function Nd(e){let t;const n=wt(),r=bt(),o=is(),i=Oe({id:n.generateId(`content-${ke()}`)},e),[s,a]=j(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=wu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Hc({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Ce(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case"ArrowRight":y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=y=>{s.onEscapeKeyDown?.(y),o?.setAutoFocusMenu(!1),r.close(!0)},m=y=>{s.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},f=y=>{ue(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=y=>{if(ue(y,s.onPointerMove),y.pointerType!=="mouse")return;const w=y.target,b=l!==y.clientX;Ce(y.currentTarget,w)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return D(()=>N(r.registerContentId(s.id))),p(Y,{get when(){return r.contentPresence.isPresent()},get children(){return p(zu,{get children(){return p(Ku,M({ref(y){var w=Qe(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof w=="function"&&w(y)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return O(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return ye([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return ye([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return ye([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return ye([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Kd(e){let t;const n=wt(),r=bt(),[o,i]=j(e,["ref"]);return Ri({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),p(Nd,M({ref(s){var a=Qe(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function Bd(e){return p($d,M({role:"menuitem",closeOnSelect:!0},e))}function zd(e){const t=bt();return p(Y,{get when(){return t.contentPresence.isPresent()},get children(){return p(ko,e)}})}function Vd(e){const t=`menu-${ke()}`,n=Oe({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=ci({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:Zo(()=>r.id),value:()=>r.value};return p(os.Provider,{value:s,get children(){return p(Id,M({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Ud(e){const t=wt(),n=bt(),r=is(),o=Oe({id:t.generateId("trigger")},e),[i,s]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,D(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),D(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),D(()=>{n.isOpen()&&r.setValue(a)}),N(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{ue(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},u=f=>{ue(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},d=f=>{if(ue(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),Dc(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{ue(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{ue(f,i.onFocus),r!==void 0&&r.setValue(a)};return D(()=>N(n.registerTriggerId(i.id))),p(Su,M({ref(f){var g=Qe(n.setTriggerRef,i.ref);typeof g=="function"&&g(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return O(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:h,onClick:u,onKeyDown:d,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function jd(e){const t=wt(),n=bt(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return p(Kd,M({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||le(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function qd(e){const t=`dropdownmenu-${ke()}`,n=Oe({id:t},e);return p(Vd,n)}function Hd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-left",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6"/>'},e)}function Wd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-right",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6"/>'},e)}function Gd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function Yd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function Xd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const Jd=e=>p(qd,M({gutter:4},e)),Zd=Ud,Qd=e=>{const[,t]=j(e,["class"]);return p(zd,{get mount(){return an()},get children(){return p(jd,M({get class(){return Ue("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},ef=e=>{const[,t]=j(e,["class"]);return p(Bd,M({get class(){return Ue("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function tf(e){return e.type==="buttons"&&e.buttons.options.length>3?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function nf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function rf(e,t,n){const r=`${ln}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function of(e,t,n){if(!e||!t||!n)return;const r=`${ln}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const _e=Object.create(null);_e.open="0",_e.close="1",_e.ping="2",_e.pong="3",_e.message="4",_e.upgrade="5",_e.noop="6";const En=Object.create(null);Object.keys(_e).forEach(e=>{En[_e[e]]=e});const Pr={type:"error",data:"parser error"},ss=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",as=typeof ArrayBuffer=="function",ls=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,_r=({type:e,data:t},n,r)=>ss&&t instanceof Blob?n?r(t):cs(t,r):as&&(t instanceof ArrayBuffer||ls(t))?n?r(t):cs(new Blob([t]),r):r(_e[e]+(t||"")),cs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function us(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ar;function sf(e,t){if(ss&&e.data instanceof Blob)return e.data.arrayBuffer().then(us).then(t);if(as&&(e.data instanceof ArrayBuffer||ls(e.data)))return t(us(e.data));_r(e,!1,n=>{Ar||(Ar=new TextEncoder),t(Ar.encode(n))})}const ds="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ds.length;e++)Bt[ds.charCodeAt(e)]=e;const af=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)i=Bt[e.charCodeAt(r)],s=Bt[e.charCodeAt(r+1)],a=Bt[e.charCodeAt(r+2)],l=Bt[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|l&63;return c},lf=typeof ArrayBuffer=="function",Tr=(e,t)=>{if(typeof e!="string")return{type:"message",data:fs(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:cf(e.substring(1),t)}:En[n]?e.length>1?{type:En[n],data:e.substring(1)}:{type:En[n]}:Pr},cf=(e,t)=>{if(lf){const n=af(e);return fs(n,t)}else return{base64:!0,data:e}},fs=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},hs="",uf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{_r(i,!1,a=>{r[s]=a,++o===n&&t(r.join(hs))})})},df=(e,t)=>{const n=e.split(hs),r=[];for(let o=0;o<n.length;o++){const i=Tr(n[o],t);if(r.push(i),i.type==="error")break}return r};function ff(){return new TransformStream({transform(e,t){sf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Mr;function kn(e){return e.reduce((t,n)=>t+n.length,0)}function Cn(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function hf(e,t){Mr||(Mr=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(kn(n)<1)break;const l=Cn(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(kn(n)<2)break;const l=Cn(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(kn(n)<8)break;const l=Cn(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Pr);break}o=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(kn(n)<o)break;const l=Cn(n,o);a.enqueue(Tr(i?l:Mr.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Pr);break}}}})}const gs=4;function J(e){if(e)return gf(e)}function gf(e){for(var t in J.prototype)e[t]=J.prototype[t];return e}J.prototype.on=J.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},J.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},J.prototype.off=J.prototype.removeListener=J.prototype.removeAllListeners=J.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this},J.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},J.prototype.emitReserved=J.prototype.emit,J.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},J.prototype.hasListeners=function(e){return!!this.listeners(e).length};const On=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ve=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),pf="arraybuffer";function Yp(){}function ps(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const mf=ve.setTimeout,yf=ve.clearTimeout;function Pn(e,t){t.useNativeTimers?(e.setTimeoutFn=mf.bind(ve),e.clearTimeoutFn=yf.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}const bf=1.33;function wf(e){return typeof e=="string"?vf(e):Math.ceil((e.byteLength||e.size)*bf)}function vf(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ms(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function xf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Sf(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Ef extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Dr extends J{constructor(t){super(),this.writable=!1,Pn(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Ef(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Tr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=xf(t);return n.length?"?"+n:""}}class kf extends Dr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};df(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,uf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ms()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let ys=!1;try{ys=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Cf=ys;function Of(){}class Pf extends kf{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ae extends J{constructor(t,n,r){super(),this.createRequest=t,Pn(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=ps(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Ae.requestsCount++,Ae.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Of,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ae.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Ae.requestsCount=0,Ae.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",bs);else if(typeof addEventListener=="function"){const e="onpagehide"in ve?"pagehide":"unload";addEventListener(e,bs,!1)}}function bs(){for(let e in Ae.requests)Ae.requests.hasOwnProperty(e)&&Ae.requests[e].abort()}const _f=function(){const e=ws({xdomain:!1});return e&&e.responseType!==null}();class Af extends Pf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=_f&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ae(ws,this.uri(),t)}}function ws(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Cf))return new XMLHttpRequest}catch{}if(!t)try{return new ve[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const vs=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Tf extends Dr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=vs?{}:ps(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;_r(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&On(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ms()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Lr=ve.WebSocket||ve.MozWebSocket;class Mf extends Tf{createSocket(t,n,r){return vs?new Lr(t,n,r):n?new Lr(t,n):new Lr(t)}doWrite(t,n){this.ws.send(n)}}class Df extends Dr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=hf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=ff();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&On(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Lf={websocket:Mf,webtransport:Df,polling:Af},If=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Rf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ir(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=If.exec(e||""),i={},s=14;for(;s--;)i[Rf[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=$f(i,i.path),i.queryKey=Ff(i,i.query),i}function $f(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Ff(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Rr=typeof addEventListener=="function"&&typeof removeEventListener=="function",_n=[];Rr&&addEventListener("offline",()=>{_n.forEach(e=>e())},!1);class Ge extends J{constructor(t,n){if(super(),this.binaryType=pf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ir(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ir(n.host).host);Pn(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Sf(this.opts.query)),Rr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_n.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=gs,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ge.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ge.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=wf(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,On(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ge.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Rr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=_n.indexOf(this._offlineEventListener);r!==-1&&_n.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ge.protocol=gs;class Nf extends Ge{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ge.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ge.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Kf=class extends Nf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Lf[o]).filter(o=>!!o)),super(t,r)}};function Bf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ir(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const zf=typeof ArrayBuffer=="function",Vf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,xs=Object.prototype.toString,Uf=typeof Blob=="function"||typeof Blob<"u"&&xs.call(Blob)==="[object BlobConstructor]",jf=typeof File=="function"||typeof File<"u"&&xs.call(File)==="[object FileConstructor]";function $r(e){return zf&&(e instanceof ArrayBuffer||Vf(e))||Uf&&e instanceof Blob||jf&&e instanceof File}function An(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(An(e[n]))return!0;return!1}if($r(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return An(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&An(e[n]))return!0;return!1}function qf(e){const t=[],n=e.data,r=e;return r.data=Fr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Fr(e,t){if(!e)return e;if($r(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Fr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Fr(e[r],t));return n}return e}function Hf(e,t){return e.data=Nr(e.data,t),delete e.attachments,e}function Nr(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Nr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Nr(e[n],t));return e}const Wf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Gf=5;var B;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(B||(B={}));class Yf{constructor(t){this.replacer=t}encode(t){return(t.type===B.EVENT||t.type===B.ACK)&&An(t)?this.encodeAsBinary({type:t.type===B.EVENT?B.BINARY_EVENT:B.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===B.BINARY_EVENT||t.type===B.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=qf(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ss(e){return Object.prototype.toString.call(e)==="[object Object]"}class Kr extends J{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===B.BINARY_EVENT;r||n.type===B.BINARY_ACK?(n.type=r?B.EVENT:B.ACK,this.reconstructor=new Xf(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if($r(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(B[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===B.BINARY_EVENT||r.type===B.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Kr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case B.CONNECT:return Ss(n);case B.DISCONNECT:return n===void 0;case B.CONNECT_ERROR:return typeof n=="string"||Ss(n);case B.EVENT:case B.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Wf.indexOf(n[0])===-1);case B.ACK:case B.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Xf{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Hf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Jf=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Kr,Encoder:Yf,get PacketType(){return B},protocol:Gf},Symbol.toStringTag,{value:"Module"}));function Ee(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Zf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Es extends J{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ee(t,"open",this.onopen.bind(this)),Ee(t,"packet",this.onpacket.bind(this)),Ee(t,"error",this.onerror.bind(this)),Ee(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(Zf.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:B.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:B.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case B.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case B.EVENT:case B.BINARY_EVENT:this.onevent(t);break;case B.ACK:case B.BINARY_ACK:this.onack(t);break;case B.DISCONNECT:this.ondisconnect();break;case B.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:B.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:B.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function vt(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vt.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},vt.prototype.reset=function(){this.attempts=0},vt.prototype.setMin=function(e){this.ms=e},vt.prototype.setMax=function(e){this.max=e},vt.prototype.setJitter=function(e){this.jitter=e};class Br extends J{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Pn(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new vt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||Jf;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Kf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Ee(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=Ee(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ee(t,"ping",this.onping.bind(this)),Ee(t,"data",this.ondata.bind(this)),Ee(t,"error",this.onerror.bind(this)),Ee(t,"close",this.onclose.bind(this)),Ee(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){On(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Es(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const zt={};function Tn(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Bf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=zt[o]&&i in zt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Br(r,t):(zt[o]||(zt[o]=new Br(r,t)),l=zt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Tn,{Manager:Br,Socket:Es,io:Tn,connect:Tn});class nt{static instance;constructor(){}static init(){return nt.instance||(nt.instance=Tn(Il,{path:"/ws",withCredentials:!0}),nt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),nt.instance}static on(t,n){nt.instance||this.init().on(t,n)}}const ks=1e3*60*60*24,[Mn,Cs]=Ro("smarttalks-widget-messages",{},ks),Os=()=>{const{widgetId:e}=Q();return Mn[e()]??[]},Qf=e=>{const{widgetId:t}=Q();Cs({...Mn,[t()]:[...Mn[t()]??[],e]})},eh=()=>{const{widgetId:e}=Q();Cs({...Mn,[e()]:[]})},[Ps,th]=Ro("smarttalks-widget-conversationinfo",{},ks),_s=()=>{const{widgetId:e}=Q();return Ps[e()]??{}},As=e=>{const{widgetId:t}=Q();th({...Ps,[t()]:e})},[nh,zr]=P(!1),[rh,Ts]=P(!1),Ms=[],Ds=()=>{Ms.forEach(e=>e())},oh=e=>Ms.push(e),Vr=e=>{const t=tf(e);if(Qf(t),t.type==="media"){setTimeout(Ds,200);return}Ds()},ih=(e,t)=>{const{chatWidget:n}=Q(),r=_s();e.trim()&&(Vr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),nt.on("message",o=>{(o.contactId!==r.contactId||o.interactionId!==r.interactionId)&&As({contactId:o.contactId,interactionId:o.interactionId});for(const i of o.messages)Vr(i);zr(!1),nf(o.debug)}),zr(!0),rf(e,t,n()?._id).catch(o=>{console.error(o),zr(!1)}))},sh=()=>{const{chatWidget:e}=Q(),t=_s();Ts(!0),eh(),of(e()?._id,t.contactId,t.interactionId).finally(()=>{As({}),Ts(!1),ah()})},ah=()=>{const{chatWidget:e}=Q();if(Os().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Vr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Ye=()=>({getMessages:Os,pushMessage:ih,clearMessages:sh,onMessage:oh,typing:nh,loading:rh});var lh=L("<span>");const ch=()=>{const{clearMessages:e}=Ye();P(!1);const[t,n]=P(!1);return p(Jd,{get open(){return t()},onOpenChange:n,get children(){return[p(Zd,{get children(){return p(me,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return p(Xl,{size:20})}})}}),p(Qd,{get children(){return p(ef,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[p(Yl,{size:14}),(()=>{var r=lh();return _(r,()=>dt("restart")),r})()]}})}})]}})};function uh(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function dh(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function fh(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var hh=L('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const Ur=()=>{const{chatWidget:e}=Q(),[t,n]=P(!1),r=()=>{const i=an();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=an();i&&(i.style.display="none")}};return(()=>{var i=hh(),s=i.firstChild;return _(i,p(Wl,{}),s),_(s,p(me,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return p(Y,{get when(){return t()},get fallback(){return p(dh,{size:16})},get children(){return p(uh,{size:16})}})}}),null),_(s,p(Y,{get when(){return e()?.showSettings},get children(){return p(ch,{})}}),null),_(s,p(Y,{get when(){return e()?.mode==="popup"},get children(){return p(me,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return p(fh,{size:16})}})}}),null),i})()};var gh=L("<span>");const Ls=({createdAt:e,anchor:t="end"})=>(()=>{var n=gh();return st(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),_(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var ph=L('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const mh=({children:e,createdAt:t})=>(()=>{var n=ph(),r=n.firstChild;return _(r,e),_(n,p(Ls,{createdAt:t,anchor:"start"}),null),n})();var yh=L("<span>");const xt=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Ml(Dl(n))),(()=>{var r=yh();return r.innerHTML=n,Je(r,M({get class(){return Ue("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var bh=L('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const wh=({options:e,text:t})=>{let n;const{pushMessage:r}=Ye(),[o,i]=P(!1),s=(l=!0)=>{if(n){const c=n.clientWidth/2;n.scrollTo({left:n.scrollLeft+(l?c:-c),behavior:"smooth"})}},a=(l,c)=>{i(!0),r(l,c)};return(()=>{var l=bh(),c=l.firstChild,u=c.firstChild;_(l,p(xt,{get children(){return t?.trim()}}),c),_(c,p(Y,{get when(){return e.length>1},get children(){return p(me,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return p(Hd,{size:20})}})}}),u);var d=n;return typeof d=="function"?wo(d,u):n=u,_(u,p(it,{each:e,children:h=>p(me,{variant:"outline",get disabled(){return o()},class:"px-2 py-0 snap-center text-nowrap",onClick:()=>a(h.label,h.value),get children(){return h.label?.trim()}})})),_(c,p(Y,{get when(){return e.length>1},get children(){return p(me,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return p(Wd,{size:20})}})}}),null),Z(()=>st(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var vh=L('<div class="flex flex-col"><span>'),xh=L("<a target=_blank><img><span></span><span>");const Sh=({options:e,text:t})=>(()=>{var n=vh(),r=n.firstChild;return _(r,()=>t?.trim()),_(n,p(it,{each:e,children:o=>(()=>{var i=xh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return _(a,()=>o.title?.trim()),_(l,()=>o.description?.trim()),Z(c=>{var u=o.url,d=o.image;return u!==c.e&&se(i,"href",c.e=u),d!==c.t&&se(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var Eh=L("<a target=_blank>");const kh=({url:e,text:t})=>(()=>{var n=Eh();return se(n,"href",e),_(n,()=>t?.trim()),n})();var Ch=e=>{const t=M({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[O(()=>{if(n())return K(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Is=Ch,Vt=e=>typeof e=="function",Oh=["button","color","file","image","reset","submit"],Ph=(e,t)=>e==="button"?!0:e==="input"&&t?Oh.indexOf(t)!==-1:!1;function _h(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>H(()=>{let a;return Vt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var jr=_h,Dn=new Map,Ln=(e,t)=>{if(Dn.has(e))return Dn.get(e);const n=ie(t);return Dn.set(e,n),n},qr=e=>{const t=Dn.get(e);if(t)return ce(t)},Ah=e=>{const t=M({enabled:!0},e);D(()=>{K(t.enabled)&&(document.addEventListener("keydown",n),N(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Th=Ah,Mh=e=>{const t=M({enabled:!0},e);D(()=>{const{body:n}=document;K(t.enabled)&&wr({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Dh=Mh,Lh=e=>{const t=M({enabled:!0,strategy:"pointerup"},e);D(()=>{if(!K(t.enabled))return;const r=K(t.strategy);document.addEventListener(r,n),N(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=K(t.element),i=K(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Ih=Lh,Rh=e=>{const t=M({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Th({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Ih({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),Dh({enabled:t.noOutsidePointerEvents})},$h=Rh,Hr=ie(),Fh=e=>O(()=>{if(ce(Hr))return p(Rs,e);const r=ke(),[o,i]=P([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return p(Hr.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return p(Rs,e)}})}),Rs=e=>{const t=M({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ce(Hr),i=ke();D(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;$h({dismissOnEscapeKeyDown:()=>K(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>K(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>K(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=O(()=>n.children),l=()=>{const c=a();return Vt(c)?c({get isLastLayer(){return s()}}):c};return H(()=>l())},Nh=Fh,Kh=()=>{const[e,t]=P(!1);return D(()=>t(!0)),e},Bh=Kh,zh=(e,t)=>(e&&(Vt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),Wr=(...e)=>e.some(t=>!!t()),Vh=e=>(...t)=>{for(const n of e)n&&n(...t)},In=(...e)=>Vh(e),ne=e=>e?"":void 0,Uh="div",jh=e=>{const[t,n]=j(e,["as"]),r=O(()=>t.as??Uh);return O(()=>{const i=r();switch(typeof i){case"function":return H(()=>i(n));case"string":return p(en,M({component:i},n))}})},Gr=jh,qh=e=>{let t,n=!1;return()=>n?t:(n=!0,t=O(e))},$s=qh,Hh=e=>O(()=>K(e.element)?.tagName.toLowerCase()||e.fallback),Wh=Hh,Fs="button",Gh=e=>{const[t,n]=P(null),[r,o]=j(e,["as","ref","type"]),i=Wh({element:t,fallback:Fs}),s=O(()=>Ph(i(),r.type));return p(Gr,M({get as(){return r.as??Fs},ref(a){var l=In(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},Yh=Gh,ge=e=>typeof e=="function"?e():e,Rn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Xh='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',Yr="focusTrap.initialFocus",Xr="focusTrap.finalFocus",Ns={bubbles:!1,cancelable:!0},Jh=e=>{const t=M({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=O(()=>{const f=n();return f?f[0]??null:null}),i=O(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{l(ge(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(ge(t.element))};D(()=>{const f=ge(t.element);if(f&&ge(t.enabled)){s=document.activeElement,H(()=>{l(f),c(f)});const g=new MutationObserver(a);ge(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),N(()=>{ge(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),D(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),N(()=>{document.removeEventListener("keydown",h)}))}),D(()=>{const f=o();f&&(f.addEventListener("keydown",u),N(()=>{f.removeEventListener("keydown",u)}))}),D(()=>{const f=i();f&&(f.addEventListener("keydown",d),N(()=>{f.removeEventListener("keydown",d)}))});const l=f=>{r(Array.from(f.querySelectorAll(Xh)))},c=f=>{const g=ge(t.initialFocusElement)??o()??f,y=t.onInitialFocus;let w;y&&(w=new CustomEvent(Yr,Ns),f.addEventListener(Yr,y),f.dispatchEvent(w),f.removeEventListener(Yr,y)),w?.defaultPrevented!==!0&&Rn(()=>g.focus())},u=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},d=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},m=f=>{if(!ge(t.restoreFocus))return;const y=ge(t.finalFocusElement)??s;if(!y)return;let w;const b=t.onFinalFocus;b&&(w=new CustomEvent(Xr,Ns),f.addEventListener(Xr,b),f.dispatchEvent(w),f.removeEventListener(Xr,b)),w?.defaultPrevented!==!0&&Rn(()=>y.focus())}},Zh=Jh,Qh=Zh,$n=e=>typeof e=="function"?e():e,eg=e=>{const t=O(()=>{const s=$n(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=P($n(e.show)?"present":"hidden");let i="none";return D(s=>{const a=$n(e.show);return H(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),D(()=>{const s=$n(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),N(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},tg=eg,Ks=tg,ng=ie(),rg=e=>e?Ln(`dialog-${e}`):ng,Bs=ie(),og=e=>e?Ln(`dialog-internal-${e}`):Bs,St=e=>{if(!e){const n=ce(Bs);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=qr(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},ig="div",sg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=O(()=>St(t.contextId)),o=()=>Wr(r().open,()=>t.forceMount,r().contentPresent),i=O(s=>s||o(),!1);return p(Y,{get when(){return i()},get children(){return p(Nh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=O(()=>t.children);return p(Y,{get when(){return o()},get children(){return p(Gr,M({ref(l){var c=In(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??ig},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return ne(r().open())},get"data-closed"(){return ne(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},ag=sg,lg="div",cg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=O(()=>St(t.contextId)),o=()=>Wr(r().open,()=>t.forceMount,r().overlayPresent),i=O(s=>s||o(),!1);return p(Y,{get when(){return i()},get children(){return(()=>{const s=O(()=>t.children);return p(Y,{get when(){return o()},get children(){return p(Gr,M({get as(){return t.as??lg},ref(a){var l=In(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return ne(r().open())},get"data-closed"(){return ne(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return s()}}))}})})()}})},ug=cg,dg=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=O(()=>St(t.contextId)),o=()=>Wr(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=Bh(),s=O(a=>a||o()&&i(),!1);return p(Y,{get when(){return s()},get children(){return(()=>{const a=O(()=>t.children);return p(Y,{get when(){return o()},get children(){return p(ko,M(n,{get children(){return a()}}))}})})()}})},fg=dg,Jr=!0,hg=e=>{const t=M({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Jr),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Jr),preventScroll:()=>!!(e.modal??Jr),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:ke()},e),[n,r]=jr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Is({value:()=>t.labelId??ke()}),[a,l,c]=Is({value:()=>t.descriptionId??ke()}),[u,d]=P(null),[h,m]=P(null),[f,g]=P(null),{present:y}=Ks({show:n,element:h}),{present:w}=Ks({show:n,element:f});Qh({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ri({element:h,enabled:()=>y()&&K(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return K(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return K(t.noOutsidePointerEvents)},get preventScroll(){return K(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return K(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return y()},get contentRef(){return h()},get overlayPresent(){return w()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},v=$s(()=>t.children),x=()=>{const S=v()();return Vt(S)?S(b):S};return O(()=>{const S=rg(t.contextId),k=og(t.contextId);return p(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>K(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>K(t.noOutsidePointerEvents),preventScroll:()=>K(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>K(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return p(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>K(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>K(t.noOutsidePointerEvents),preventScroll:()=>K(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>K(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:g,triggerRef:u,setTriggerRef:d}},get children(){return H(()=>x())}})}})})},gg=hg,pg="button",mg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=O(()=>St(t.contextId));return p(Yh,M({ref(i){var s=In(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??pg},onClick:i=>{!zh(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return ne(r().open())},get"data-closed"(){return ne(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},yg=mg;function bg(e){const t=M({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,i]=P(null);let s=null;D(()=>{const c=ge(t.element),u=ge(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),N(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const u=c.target,d=[u.offsetWidth,u.offsetHeight],h=ge(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(xe(()=>{i(s),r(!0)}),Rn(()=>{i(d),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d:s?Fn(h,s)!==Fn(h,d)&&(xe(()=>{i(Fn(h,s)),r(!0)}),Rn(()=>{i(Fn(h,d)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d},l=()=>{if(!n())return;const c=ge(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,xe(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Fn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},wg=bg,vg=wg,xg=(e,t)=>e.length>0?()=>e(H(t)):e;function Sg(e,t){let n=0;const r=e.map((o,i)=>O(()=>(n=i,o()),void 0,Xo));return O(()=>r.map(o=>o())[n],void 0,t)}function zs(e,t,n){let r=()=>t;const[o,i]=P(t,Xo),s=O(xg(e,()=>r()),t);return[r=Sg([o,s],n),a=>i(()=>typeof a=="function"?a(H(r)):a)]}var Eg=e=>p(yg,M({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Vs=ie(),kg=e=>e?Ln(`drawer-${e}`):Vs,Cg=e=>{if(!e){const n=ce(Vs);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=qr(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},Us=ie(),Og=e=>e?Ln(`drawer-internal-${e}`):Us,js=e=>{if(!e){const n=ce(Us);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=qr(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},qs=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Nn(e,t)};const o=r[n-1]?Nn(r[n-1],t):void 0,i=r[n]?Nn(r[n],t):void 0;return{value:e,offset:Nn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Nn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},Pg=(e,t,n,r)=>{const o=Hs("upper",e,r?n:t),i=Hs("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Hs=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),_g=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},Ag=void 0,Tg=e=>{const t=M({initialOpen:!1,snapPoints:[0,1],breakPoints:[Ag],defaultSnapPoint:1,side:"bottom",dampFunction:I=>6*Math.log(I+1),velocityFunction:(I,V)=>{const oe=I/V;return oe<1&&oe>-1?1:oe},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=jr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=jr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:u,transitionSize:d}=vg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,m]=P(!1),[f,g]=zs(()=>u()?"resizing":null),y=O(()=>{const I=l()?.contentRef();if(I)return getComputedStyle(I)}),[w,b]=P(!1);D(()=>{const I=o();H(()=>{w()!==I&&(I?(b(!0),Ai(()=>{xe(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&g(null)})):(xe(()=>{g("closing"),a(0)}),Ai(()=>{parseFloat(y().transitionDuration)===0&&v()})))})});const v=()=>{xe(()=>{b(!1),g(null)})},[x,A]=P(0);D(()=>{const I=l()?.contentRef();if(!I)return;k(I);const V=new ResizeObserver(S);V.observe(I),N(()=>{V.disconnect()})});const S=I=>{for(const V of I)V.target===l()?.contentRef()&&k(V.target)},k=I=>{const V=H(()=>x());switch(n.side){case"top":case"bottom":if(V===I.offsetHeight)return;A(I.offsetHeight);break;case"left":case"right":if(V===I.offsetWidth)return;A(I.offsetWidth);break}},T=O(()=>qs(s(),x())),[C,F]=zs(()=>T().offset),z=O(()=>x()?(x()-C())/x():0),R={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return z()},get translate(){return C()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},re=$s(()=>n.children),X=I=>{c(St(n.contextId));const V=re()();if(Vt(V)){const oe=M(I,R);return V(oe)}return V};return O(()=>{const I=kg(n.contextId),V=Og(n.contextId);return H(()=>p(I.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:z,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return p(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:z,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:F,drawerSize:x,resolvedActiveSnapPoint:T,drawerStyles:y,setTransitionState:g,transitionSize:d,closeDrawer:v}},get children(){return p(gg,M({get open(){return w()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:oe=>X(oe)}))}})}}))})},Mg=Tg,Dg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=O(()=>js(t.contextId)),c=O(()=>St(t.contextId)),u=O(()=>l().snapPoints().map((v,x)=>qs(v,l().drawerSize(),x,l().breakPoints()))),d=O(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),h=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"top":case"bottom":return`${v}px`}}),m=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"left":case"right":return`${v}px`}});D(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),N(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=v=>{_g(v.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[v.clientX,v.clientY]))},g=v=>{w(v.target,v.clientX,v.clientY)},y=v=>{v.touches[0]&&w(v.target,v.touches[0].clientX,v.touches[0].clientY)},w=(v,x,A)=>{if(!r)return;if(!l().isDragging()||o===null){const T=window.getSelection();if(T&&T.toString().length>0){b();return}if(l().handleScrollableElements()){const C=[x,A].map((ee,I)=>i[I]-ee),F=Math.abs(C[0])>Math.abs(C[1])?"x":"y",z=F==="x"?C[0]:C[1];if(Math.abs(z)<.3)return;const R=c().contentRef(),[re,X]=Ti(v,F,R);if(z>0&&Math.abs(re)>1||z<0&&Math.abs(X)>0){b();return}}switch(l().side()){case"top":case"bottom":o=A;break;case"right":case"left":o=x}s=new Date,a=l().translate(),xe(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let S;switch(l().side()){case"top":S=-(o-A);break;case"bottom":S=o-A;break;case"right":S=o-x;break;case"left":S=-(o-x);break}S-=l().resolvedActiveSnapPoint().offset,S>0&&(S=l().dampFunction(S));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-S)},b=()=>{if(r=!1,!l().isDragging())return;const v=new Date,x=l().velocityFunction(-(a-l().translate()),v.getTime()-s.getTime()||1),A=l().translate()*x,S=Pg(u(),l().translate(),A,l().allowSkippingSnapPoints());xe(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),xe(()=>{l().setActiveSnapPoint(S.value),S.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(S.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return p(ag,M({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:m(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{xe(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return ne(l().isTransitioning())},get"data-opening"(){return ne(l().transitionState()==="opening")},get"data-closing"(){return ne(l().transitionState()==="closing")},get"data-snapping"(){return ne(l().transitionState()==="snapping")},get"data-resizing"(){return ne(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Lg=Dg,Ig=e=>{const[t,n]=j(e,["contextId"]),r=O(()=>js(t.contextId));return p(ug,M({get contextId(){return t.contextId},get"data-transitioning"(){return ne(r().isTransitioning())},get"data-opening"(){return ne(r().transitionState()==="opening")},get"data-closing"(){return ne(r().transitionState()==="closing")},get"data-snapping"(){return ne(r().transitionState()==="snapping")},get"data-resizing"(){return ne(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Rg=Ig,$g=L('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const Fg=Mg,Ng=Eg,Kg=fg,Bg=e=>{const[,t]=j(e,["class"]),n=Cg();return p(Rg,M({get class(){return Ue("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},zg=e=>{const[,t]=j(e,["class","children"]);return p(Kg,{get mount(){return an()},get children(){return[p(Bg,{}),p(Lg,M({id:"smarttalks-list-content",get class(){return Ue("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[$g(),O(()=>e.children)]}}))]}})};var Vg=L('<span class="font-semibold mt-2">'),Ug=L('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),jg=L('<div class="flex flex-col space-y-2"><div>'),qg=L('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),Hg=L('<div class="flex flex-col items-start"><span class=text-slate-500>');const Wg=({options:e,text:t,title:n})=>{const{pushMessage:r}=Ye(),[o,i]=P(!1),[s,a]=P(!1),[l,c]=P(),u=(h,m)=>{a(!1),i(!0),r(h,m)},d=h=>{const m=h.composedPath();for(const f of m)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=jg(),m=h.firstChild;return _(h,p(xt,{get children(){return t?.trim()}}),m),_(m,p(Fg,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[p(Ng,{as:me,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??dt("selectOption")}}),p(zg,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=Vg();return _(f,()=>n?.trim()??dt("selectOption")),f})(),(()=>{var f=Ug();return _(f,p(it,{each:e,children:g=>(()=>{var y=qg(),w=y.firstChild;return _(w,()=>g.label?.trim()??""),_(y,p(it,{get each(){return g.items},children:b=>p(me,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===b?"bg-slate-200":""}`},onClick:()=>c(b),get children(){return[(()=>{var v=Hg(),x=v.firstChild;return _(v,()=>b.label?.trim(),x),_(x,()=>b.description?.trim()),v})(),p(Y,{get when(){return l()===b},get fallback(){return p(Yd,{class:"size-4 text-slate-500"})},get children(){return p(Gd,{class:"size-4 text-slate-500"})}})]}})}),null),y})()})),f})(),p(me,{get disabled(){return o()||!l()},onClick:()=>u(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return dt("send")}})]}})]}})),Z(()=>st(m,o()?"opacity-50":"")),h})()};var Gg=L("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const Yg=e=>(()=>{var t=Gg(),n=t.firstChild,r=n.nextSibling;return Z(o=>{var i=e.link,s=e.link;return i!==o.e&&se(n,"src",o.e=i),s!==o.t&&se(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var Xg=L('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const Jg=e=>(()=>{var t=Xg(),n=t.firstChild,r=n.firstChild;return _(n,p(Xd,{class:"size-10"}),r),_(r,()=>e.filename?.trim()),_(t,p(xt,{get children(){return e.text?.trim()}}),null),Z(()=>se(n,"href",e.link)),t})();var Zg=L('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const Qg=e=>(()=>{var t=Zg(),n=t.firstChild,r=n.firstChild;return _(t,p(xt,{get children(){return e.text?.trim()}}),null),Z(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&se(n,"href",o.e=i),s!==o.t&&se(r,"src",o.t=s),a!==o.a&&se(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var ep=L('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const tp=e=>(()=>{var t=ep(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return _(t,p(xt,{get children(){return e.text?.trim()}}),null),Z(i=>{var s=e.link,a=e.link;return s!==i.e&&se(r,"src",i.e=s),a!==i.t&&se(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var np=L("<div>Media type not supported");const Ws=e=>e.type==="image"?p(Qg,e):e.type==="audio"?p(Yg,e):e.type==="document"?p(Jg,e):e.type==="video"?p(tp,e):np(),Zr=({text:e})=>p(xt,{get children(){return e?.trim()}});var rp=L("<div>Unknown bot message type");const op=e=>p(mh,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Zr,{get text(){return e.text}}):e.type==="buttons"?p(wh,M(()=>e.buttons)):e.type==="list"?p(Wg,M(()=>e.list)):e.type==="media"?p(Ws,M(()=>e.media)):e.type==="link"?p(kh,M(()=>e.link)):e.type==="cards"?p(Sh,M(()=>e.cards)):e.type==="date"?p(Zr,{get text(){return e.text}}):rp()}});var ip=L('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const sp=e=>(()=>{var t=ip(),n=t.firstChild;return _(n,()=>e.text?.trim()),t})();var ap=L('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const lp=({children:e,createdAt:t})=>(()=>{var n=ap(),r=n.firstChild;return _(r,e),_(n,p(Ls,{createdAt:t,anchor:"end"}),null),n})();var cp=L("<div>Unknown user message type");const up=e=>p(lp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Zr,{get text(){return e.text}}):e.type==="media"?p(Ws,M(()=>e.media)):cp()}});var dp=L("<div>Unknown message origin");const fp=e=>e.origin==="bot"?p(op,e):e.origin==="user"?p(up,e):e.origin==="service"?p(sp,e):dp();function hp(e){return ae({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function Et(e){return ae({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var gp=L('<div class="place-self-start py-1"><div class="animate-pulse bg-white flex space-x-1 shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl text-slate-400">');const pp=()=>(()=>{var e=gp(),t=e.firstChild;return _(t,p(Et,{class:"size-2 animate-bounce"}),null),_(t,p(Et,{class:"size-2 animate-bounce delay-150"}),null),_(t,p(Et,{class:"size-2 animate-bounce delay-300"}),null),e})();var mp=L('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),yp=L("<div>");const Qr=()=>{let e;const{getMessages:t,onMessage:n,typing:r}=Ye(),{onOpen:o}=_o(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return Wt(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=mp(),a=e;return typeof a=="function"?wo(a,s):e=s,_(s,p(it,{get each(){return t()},get fallback(){return(()=>{var l=yp();return _(l,()=>dt("emptyMessages")),l})()},children:l=>p(fp,l)}),null),_(s,p(Y,{get when(){return r()},get children(){return p(pp,{})}}),null),s})()};var bp=L("<textarea>");const wp=e=>{const[,t]=j(e,["class"]);return(()=>{var n=bp();return Je(n,M({get class(){return Ue("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var vp=L('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const xp=e=>(()=>{var t=vp();return Je(t,e,!0,!0),t})();var Sp=L('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Ep=()=>(()=>{var e=Sp(),t=e.firstChild;return _(e,p(xp,{height:15}),t),e})();var kp=L('<footer class="flex-none p-4 bg-white min-h-16 flex space-x-1 mb-2">');const eo=()=>{const{pushMessage:e}=Ye(),[t,n]=P(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=kp();return _(i,p(wp,{get placeholder(){return dt("inputPlaceholder")},get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),_(i,p(me,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return p(Zl,{size:24})}}),null),_(i,p(Ep,{}),null),i})()};var Cp=L('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[98%] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Op=L("<span class=sr-only>Close"),Pp=L("<div>"),_p=L("<span class=sr-only>Open"),Ap=L("<span>"),Tp=L('<div class="animate-pulse flex p-1">');const Mp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=_o(),{chatWidget:s}=Q(),[a,l]=P(!0);setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const c=()=>(s()?.style.margin??5)/4,u=()=>s()?.style.position==="left"?{left:`${c()}rem`}:{right:`${c()}rem`};return window.addEventListener("message",d=>{d.data?.from==="smarttalkswidget"&&(d.data?.command==="open"&&o(),d.data?.command==="close"&&i(),d.data?.command==="toggle"&&r())}),(()=>{var d=Pp();return _(d,p(Y,{get when(){return n()},get children(){var h=Cp();return _(h,e),h}}),null),_(d,p(Y,{get when(){return n()},get fallback(){return p(me,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,_p(),p(Y,{get when(){return s()?.balloonMessage},get children(){var h=Ap();return _(h,p(Y,{get when(){return!a()},get fallback(){return(()=>{var m=Tp();return _(m,p(Et,{class:"size-2 animate-bounce"}),null),_(m,p(Et,{class:"size-2 animate-bounce delay-150"}),null),_(m,p(Et,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return s()?.balloonMessage}})),Z(()=>st(h,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(s()?.style.position==="left"?" left-9":" right-9"))),h}})]}})},get children(){return p(me,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[p(hp,{size:30}),Op()]}})}}),null),Z(h=>{var m="max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(s()?.style.position==="left"?" items-start":" items-end"),f=u();return m!==h.e&&st(d,h.e=m),h.t=Qt(d,f,h.t),h},{e:void 0,t:void 0}),d})()};var Dp=L('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Lp=({children:e})=>{const{chatWidget:t}=Q(),n={};return t()?.style.width&&(n.width=`min(100%, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Dp();return Qt(r,n),_(r,e),r})()};var Ip=L('<div id=smarttalks-widget class="h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col">');const Rp=({children:e})=>{const{chatWidget:t}=Q(),[n,r]=P(!1),o=()=>(t()?.style.margin??5)/4,i=()=>t()?.style.position==="left"?{left:`${o()}rem`}:{right:`${o()}rem`};return window.addEventListener("message",s=>{s.data?.from==="smarttalkswidget"&&(s.data?.command==="open"&&r(!0),s.data?.command==="close"&&r(!1),s.data?.command==="toggle"&&r(!n()))}),setTimeout(()=>{r(!0)},(t()?.openDelay||0)*1e3),p(Y,{get when(){return n()},get children(){var s=Ip();return _(s,e),Z(a=>Qt(s,i(),a)),s}})};var $p=L('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const to=()=>(()=>{var e=$p();return _(e,p(Jl,{size:45,class:"animate-spin"})),e})(),Fp=()=>{const{chatWidget:e}=Q(),{loading:t}=Ye();return p(Mp,{get openIcon(){return p(Go,{get src(){return e()?.avatar}})},get children(){return[p(Y,{get when(){return t()},get children(){return p(to,{})}}),p(Ur,{}),p(Qr,{}),p(eo,{})]}})},Np=()=>{const{loading:e}=Ye();return p(Rp,{get children(){return[p(Y,{get when(){return e()},get children(){return p(to,{})}}),p(Ur,{}),p(Qr,{}),p(eo,{})]}})},Kp=()=>{const{loading:e}=Ye();return p(Lp,{get children(){return[p(Y,{get when(){return e()},get children(){return p(to,{})}}),p(Ur,{}),p(Qr,{}),p(eo,{})]}})},Bp=()=>{const{chatWidget:e}=Q();return p(yo,{get children(){return[p(Ct,{get when(){return e()?.mode==="standard"},get children(){return p(Fp,{})}}),p(Ct,{get when(){return e()?.mode==="popup"},get children(){return p(Np,{})}}),p(Ct,{get when(){return e()?.mode==="static"},get children(){return p(Kp,{})}})]}})};var zp=L("<div><div>Form");const Vp=()=>{const{formWidget:e}=Q();return(()=>{var t=zp();return t.firstChild,_(t,()=>e()?._id,null),t})()};function Up(){const{widget:e}=Q();return p(yo,{get children(){return[p(Ct,{get when(){return e()?.type==="chat"},get children(){return p(Bp,{})}}),p(Ct,{get when(){return e()?.type==="form"},get children(){return p(Vp,{})}})]}})}var jp=L("<style>"),qp=L("<div>");const Hp=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:i}=Q(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=jp();return _(a,Ba),a})(),(()=>{var a=qp();return _(a,p(Up,{})),a})()]},Wp={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Ka("smarttalks-widget",Wp,Hp)})(),typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{window.postMessage({from:"smarttalkswidget",command:"registerContactData",contactData:e})},open:()=>{window.postMessage({from:"smarttalkswidget",command:"open"})},close:()=>{window.postMessage({from:"smarttalkswidget",command:"close"})},toggle:()=>{window.postMessage({from:"smarttalkswidget",command:"toggle"})}})});
|
|
181
|
+
*/function Ld(e,t){return t?Mc([e.clientX,e.clientY],t):!1}function Id(e){const t=wt(),n=Oi(),r=rs(),o=Oe({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=P(),[h,m]=P(),[f,g]=P(),[y,w]=P(),[b,v]=P(!0),[x,A]=P(s.placement),[S,k]=P([]),[T,C]=P([]),{DomCollectionProvider:F}=Au({items:T,onItemsChange:C}),z=ci({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),R=Jc(()=>t.forceMount()||z.isOpen()),re=yu({selectionMode:"none",dataSource:T}),X=U=>{v(U),z.open()},ee=(U=!1)=>{z.close(),U&&r&&r.close(!0)},I=U=>{v(U),z.toggle()},V=()=>{const U=y();U&&(le(U),re.selectionManager().setFocused(!0),re.selectionManager().setFocusedKey(void 0))},oe=U=>{k(no=>[...no,U]);const Bn=r?.registerNestedMenu(U);return()=>{k(no=>ir(no,U)),Bn?.()}},Be=U=>c===l?.side&&Ld(U,l?.area),Kn=U=>{Be(U)&&U.preventDefault()},rt=U=>{Be(U)||V()},kt=U=>{Be(U)&&U.preventDefault()};Gc({isDisabled:()=>!(r==null&&z.isOpen()&&t.isModal()),targets:()=>[y(),...S()].filter(Boolean)}),D(()=>{const U=y();if(!U||!r)return;const Bn=r.registerNestedMenu(U);N(()=>{Bn()})});const Gp={dataset:O(()=>({"data-expanded":z.isOpen()?"":void 0,"data-closed":z.isOpen()?void 0:""})),isOpen:z.isOpen,contentPresence:R,nestedMenus:S,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>re,parentMenuContext:()=>r,triggerRef:f,contentRef:y,triggerId:u,contentId:h,setTriggerRef:g,setContentRef:w,open:X,close:ee,toggle:I,focusContent:V,onItemEnter:Kn,onItemLeave:rt,onTriggerLeave:kt,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:oe,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:gn(d),registerContentId:gn(m)};return p(F,{get children(){return p(ns.Provider,{value:Gp,get children(){return p(Dd,M({anchorRef:f,contentRef:y,onCurrentPlacementChange:A},s))}})}})}const Rd=ie();function $d(e){let t;const n=wt(),r=bt(),o=Oe({id:n.generateId(`item-${ke()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,u]=P(),[d,h]=P(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Tu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const w=pu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=C=>{ue(C,i.onPointerMove),C.pointerType==="mouse"&&(i.disabled?r.onItemLeave(C):(r.onItemEnter(C),C.defaultPrevented||(le(C.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},v=C=>{ue(C,i.onPointerLeave),C.pointerType==="mouse"&&r.onItemLeave(C)},x=C=>{ue(C,i.onPointerUp),!i.disabled&&C.button===0&&y()},A=C=>{if(ue(C,i.onKeyDown),!C.repeat&&!i.disabled)switch(C.key){case"Enter":case" ":y();break}},S=O(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=O(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),T={isChecked:()=>i.checked,dataset:k,setLabelRef:h,generateId:Zo(()=>s.id),registerLabel:gn(l),registerDescription:gn(u)};return p(Rd.Provider,{value:T,get children(){return p(pn,M({as:"div",ref(C){var F=Qe(z=>t=z,i.ref);typeof F=="function"&&F(C)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return w.dataKey()},get onPointerDown(){return ye([i.onPointerDown,w.onPointerDown])},get onPointerUp(){return ye([x,w.onPointerUp])},get onClick(){return ye([i.onClick,w.onClick])},get onKeyDown(){return ye([A,w.onKeyDown])},get onMouseDown(){return ye([i.onMouseDown,w.onMouseDown])},get onFocus(){return ye([i.onFocus,w.onFocus])},onPointerMove:b,onPointerLeave:v},k,s))}})}const Fd=ie();function is(){return ce(Fd)}function Nd(e){let t;const n=wt(),r=bt(),o=is(),i=Oe({id:n.generateId(`content-${ke()}`)},e),[s,a]=j(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=wu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Hc({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Ce(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case"ArrowRight":y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=y=>{s.onEscapeKeyDown?.(y),o?.setAutoFocusMenu(!1),r.close(!0)},m=y=>{s.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},f=y=>{ue(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=y=>{if(ue(y,s.onPointerMove),y.pointerType!=="mouse")return;const w=y.target,b=l!==y.clientX;Ce(y.currentTarget,w)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return D(()=>N(r.registerContentId(s.id))),p(Y,{get when(){return r.contentPresence.isPresent()},get children(){return p(zu,{get children(){return p(Ku,M({ref(y){var w=Qe(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof w=="function"&&w(y)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return O(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return ye([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return ye([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return ye([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return ye([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Kd(e){let t;const n=wt(),r=bt(),[o,i]=j(e,["ref"]);return Ri({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),p(Nd,M({ref(s){var a=Qe(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function Bd(e){return p($d,M({role:"menuitem",closeOnSelect:!0},e))}function zd(e){const t=bt();return p(Y,{get when(){return t.contentPresence.isPresent()},get children(){return p(ko,e)}})}function Vd(e){const t=`menu-${ke()}`,n=Oe({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=ci({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:Zo(()=>r.id),value:()=>r.value};return p(os.Provider,{value:s,get children(){return p(Id,M({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Ud(e){const t=wt(),n=bt(),r=is(),o=Oe({id:t.generateId("trigger")},e),[i,s]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,D(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),D(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),D(()=>{n.isOpen()&&r.setValue(a)}),N(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{ue(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},u=f=>{ue(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},d=f=>{if(ue(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),Dc(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{ue(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{ue(f,i.onFocus),r!==void 0&&r.setValue(a)};return D(()=>N(n.registerTriggerId(i.id))),p(Su,M({ref(f){var g=Qe(n.setTriggerRef,i.ref);typeof g=="function"&&g(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return O(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:h,onClick:u,onKeyDown:d,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function jd(e){const t=wt(),n=bt(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return p(Kd,M({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||le(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function qd(e){const t=`dropdownmenu-${ke()}`,n=Oe({id:t},e);return p(Vd,n)}function Hd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-left",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6"/>'},e)}function Wd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-right",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6"/>'},e)}function Gd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function Yd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function Xd(e){return ae({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const Jd=e=>p(qd,M({gutter:4},e)),Zd=Ud,Qd=e=>{const[,t]=j(e,["class"]);return p(zd,{get mount(){return an()},get children(){return p(jd,M({get class(){return Ue("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},ef=e=>{const[,t]=j(e,["class"]);return p(Bd,M({get class(){return Ue("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function tf(e){return e.type==="buttons"&&e.buttons.options.length>3?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function nf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function rf(e,t,n){const r=`${ln}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function of(e,t,n){if(!e||!t||!n)return;const r=`${ln}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const _e=Object.create(null);_e.open="0",_e.close="1",_e.ping="2",_e.pong="3",_e.message="4",_e.upgrade="5",_e.noop="6";const En=Object.create(null);Object.keys(_e).forEach(e=>{En[_e[e]]=e});const Pr={type:"error",data:"parser error"},ss=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",as=typeof ArrayBuffer=="function",ls=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,_r=({type:e,data:t},n,r)=>ss&&t instanceof Blob?n?r(t):cs(t,r):as&&(t instanceof ArrayBuffer||ls(t))?n?r(t):cs(new Blob([t]),r):r(_e[e]+(t||"")),cs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function us(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ar;function sf(e,t){if(ss&&e.data instanceof Blob)return e.data.arrayBuffer().then(us).then(t);if(as&&(e.data instanceof ArrayBuffer||ls(e.data)))return t(us(e.data));_r(e,!1,n=>{Ar||(Ar=new TextEncoder),t(Ar.encode(n))})}const ds="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ds.length;e++)Bt[ds.charCodeAt(e)]=e;const af=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)i=Bt[e.charCodeAt(r)],s=Bt[e.charCodeAt(r+1)],a=Bt[e.charCodeAt(r+2)],l=Bt[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|l&63;return c},lf=typeof ArrayBuffer=="function",Tr=(e,t)=>{if(typeof e!="string")return{type:"message",data:fs(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:cf(e.substring(1),t)}:En[n]?e.length>1?{type:En[n],data:e.substring(1)}:{type:En[n]}:Pr},cf=(e,t)=>{if(lf){const n=af(e);return fs(n,t)}else return{base64:!0,data:e}},fs=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},hs="",uf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{_r(i,!1,a=>{r[s]=a,++o===n&&t(r.join(hs))})})},df=(e,t)=>{const n=e.split(hs),r=[];for(let o=0;o<n.length;o++){const i=Tr(n[o],t);if(r.push(i),i.type==="error")break}return r};function ff(){return new TransformStream({transform(e,t){sf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Mr;function kn(e){return e.reduce((t,n)=>t+n.length,0)}function Cn(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function hf(e,t){Mr||(Mr=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(kn(n)<1)break;const l=Cn(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(kn(n)<2)break;const l=Cn(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(kn(n)<8)break;const l=Cn(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Pr);break}o=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(kn(n)<o)break;const l=Cn(n,o);a.enqueue(Tr(i?l:Mr.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Pr);break}}}})}const gs=4;function J(e){if(e)return gf(e)}function gf(e){for(var t in J.prototype)e[t]=J.prototype[t];return e}J.prototype.on=J.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},J.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},J.prototype.off=J.prototype.removeListener=J.prototype.removeAllListeners=J.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this},J.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},J.prototype.emitReserved=J.prototype.emit,J.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},J.prototype.hasListeners=function(e){return!!this.listeners(e).length};const On=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ve=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),pf="arraybuffer";function Yp(){}function ps(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const mf=ve.setTimeout,yf=ve.clearTimeout;function Pn(e,t){t.useNativeTimers?(e.setTimeoutFn=mf.bind(ve),e.clearTimeoutFn=yf.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}const bf=1.33;function wf(e){return typeof e=="string"?vf(e):Math.ceil((e.byteLength||e.size)*bf)}function vf(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ms(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function xf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Sf(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Ef extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Dr extends J{constructor(t){super(),this.writable=!1,Pn(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Ef(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Tr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=xf(t);return n.length?"?"+n:""}}class kf extends Dr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};df(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,uf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ms()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let ys=!1;try{ys=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Cf=ys;function Of(){}class Pf extends kf{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ae extends J{constructor(t,n,r){super(),this.createRequest=t,Pn(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=ps(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Ae.requestsCount++,Ae.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Of,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ae.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Ae.requestsCount=0,Ae.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",bs);else if(typeof addEventListener=="function"){const e="onpagehide"in ve?"pagehide":"unload";addEventListener(e,bs,!1)}}function bs(){for(let e in Ae.requests)Ae.requests.hasOwnProperty(e)&&Ae.requests[e].abort()}const _f=function(){const e=ws({xdomain:!1});return e&&e.responseType!==null}();class Af extends Pf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=_f&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ae(ws,this.uri(),t)}}function ws(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Cf))return new XMLHttpRequest}catch{}if(!t)try{return new ve[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const vs=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Tf extends Dr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=vs?{}:ps(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;_r(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&On(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ms()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Lr=ve.WebSocket||ve.MozWebSocket;class Mf extends Tf{createSocket(t,n,r){return vs?new Lr(t,n,r):n?new Lr(t,n):new Lr(t)}doWrite(t,n){this.ws.send(n)}}class Df extends Dr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=hf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=ff();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&On(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Lf={websocket:Mf,webtransport:Df,polling:Af},If=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Rf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ir(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=If.exec(e||""),i={},s=14;for(;s--;)i[Rf[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=$f(i,i.path),i.queryKey=Ff(i,i.query),i}function $f(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Ff(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Rr=typeof addEventListener=="function"&&typeof removeEventListener=="function",_n=[];Rr&&addEventListener("offline",()=>{_n.forEach(e=>e())},!1);class Ge extends J{constructor(t,n){if(super(),this.binaryType=pf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ir(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ir(n.host).host);Pn(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Sf(this.opts.query)),Rr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_n.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=gs,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ge.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ge.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=wf(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,On(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ge.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Rr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=_n.indexOf(this._offlineEventListener);r!==-1&&_n.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ge.protocol=gs;class Nf extends Ge{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ge.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ge.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Kf=class extends Nf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Lf[o]).filter(o=>!!o)),super(t,r)}};function Bf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ir(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const zf=typeof ArrayBuffer=="function",Vf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,xs=Object.prototype.toString,Uf=typeof Blob=="function"||typeof Blob<"u"&&xs.call(Blob)==="[object BlobConstructor]",jf=typeof File=="function"||typeof File<"u"&&xs.call(File)==="[object FileConstructor]";function $r(e){return zf&&(e instanceof ArrayBuffer||Vf(e))||Uf&&e instanceof Blob||jf&&e instanceof File}function An(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(An(e[n]))return!0;return!1}if($r(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return An(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&An(e[n]))return!0;return!1}function qf(e){const t=[],n=e.data,r=e;return r.data=Fr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Fr(e,t){if(!e)return e;if($r(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Fr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Fr(e[r],t));return n}return e}function Hf(e,t){return e.data=Nr(e.data,t),delete e.attachments,e}function Nr(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Nr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Nr(e[n],t));return e}const Wf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Gf=5;var B;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(B||(B={}));class Yf{constructor(t){this.replacer=t}encode(t){return(t.type===B.EVENT||t.type===B.ACK)&&An(t)?this.encodeAsBinary({type:t.type===B.EVENT?B.BINARY_EVENT:B.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===B.BINARY_EVENT||t.type===B.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=qf(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ss(e){return Object.prototype.toString.call(e)==="[object Object]"}class Kr extends J{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===B.BINARY_EVENT;r||n.type===B.BINARY_ACK?(n.type=r?B.EVENT:B.ACK,this.reconstructor=new Xf(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if($r(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(B[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===B.BINARY_EVENT||r.type===B.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Kr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case B.CONNECT:return Ss(n);case B.DISCONNECT:return n===void 0;case B.CONNECT_ERROR:return typeof n=="string"||Ss(n);case B.EVENT:case B.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Wf.indexOf(n[0])===-1);case B.ACK:case B.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Xf{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Hf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Jf=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Kr,Encoder:Yf,get PacketType(){return B},protocol:Gf},Symbol.toStringTag,{value:"Module"}));function Ee(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Zf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Es extends J{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ee(t,"open",this.onopen.bind(this)),Ee(t,"packet",this.onpacket.bind(this)),Ee(t,"error",this.onerror.bind(this)),Ee(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(Zf.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:B.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:B.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case B.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case B.EVENT:case B.BINARY_EVENT:this.onevent(t);break;case B.ACK:case B.BINARY_ACK:this.onack(t);break;case B.DISCONNECT:this.ondisconnect();break;case B.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:B.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:B.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function vt(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vt.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},vt.prototype.reset=function(){this.attempts=0},vt.prototype.setMin=function(e){this.ms=e},vt.prototype.setMax=function(e){this.max=e},vt.prototype.setJitter=function(e){this.jitter=e};class Br extends J{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Pn(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new vt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||Jf;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Kf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Ee(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=Ee(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ee(t,"ping",this.onping.bind(this)),Ee(t,"data",this.ondata.bind(this)),Ee(t,"error",this.onerror.bind(this)),Ee(t,"close",this.onclose.bind(this)),Ee(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){On(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Es(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const zt={};function Tn(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Bf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=zt[o]&&i in zt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Br(r,t):(zt[o]||(zt[o]=new Br(r,t)),l=zt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Tn,{Manager:Br,Socket:Es,io:Tn,connect:Tn});class nt{static instance;constructor(){}static init(){return nt.instance||(nt.instance=Tn(Il,{path:"/ws",withCredentials:!0}),nt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),nt.instance}static on(t,n){nt.instance||this.init().on(t,n)}}const ks=1e3*60*60*24,[Mn,Cs]=Ro("smarttalks-widget-messages",{},ks),Os=()=>{const{widgetId:e}=Q();return Mn[e()]??[]},Qf=e=>{const{widgetId:t}=Q();Cs({...Mn,[t()]:[...Mn[t()]??[],e]})},eh=()=>{const{widgetId:e}=Q();Cs({...Mn,[e()]:[]})},[Ps,th]=Ro("smarttalks-widget-conversationinfo",{},ks),_s=()=>{const{widgetId:e}=Q();return Ps[e()]??{}},As=e=>{const{widgetId:t}=Q();th({...Ps,[t()]:e})},[nh,zr]=P(!1),[rh,Ts]=P(!1),Ms=[],Ds=()=>{Ms.forEach(e=>e())},oh=e=>Ms.push(e),Vr=e=>{const t=tf(e);if(Qf(t),t.type==="media"){setTimeout(Ds,200);return}Ds()},ih=(e,t)=>{const{chatWidget:n}=Q(),r=_s();e.trim()&&(Vr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),nt.on("message",o=>{(o.contactId!==r.contactId||o.interactionId!==r.interactionId)&&As({contactId:o.contactId,interactionId:o.interactionId});for(const i of o.messages)Vr(i);zr(!1),nf(o.debug)}),zr(!0),rf(e,t,n()?._id).catch(o=>{console.error(o),zr(!1)}))},sh=()=>{const{chatWidget:e}=Q(),t=_s();Ts(!0),eh(),of(e()?._id,t.contactId,t.interactionId).finally(()=>{As({}),Ts(!1),ah()})},ah=()=>{const{chatWidget:e}=Q();if(Os().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Vr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Ye=()=>({getMessages:Os,pushMessage:ih,clearMessages:sh,onMessage:oh,typing:nh,loading:rh});var lh=L("<span>");const ch=()=>{const{clearMessages:e}=Ye();P(!1);const[t,n]=P(!1);return p(Jd,{get open(){return t()},onOpenChange:n,get children(){return[p(Zd,{get children(){return p(me,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return p(Xl,{size:20})}})}}),p(Qd,{get children(){return p(ef,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[p(Yl,{size:14}),(()=>{var r=lh();return _(r,()=>dt("restart")),r})()]}})}})]}})};function uh(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function dh(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function fh(e){return ae({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var hh=L('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const Ur=()=>{const{chatWidget:e}=Q(),[t,n]=P(!1),r=()=>{const i=an();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=an();i&&(i.style.display="none")}};return(()=>{var i=hh(),s=i.firstChild;return _(i,p(Wl,{}),s),_(s,p(me,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return p(Y,{get when(){return t()},get fallback(){return p(dh,{size:16})},get children(){return p(uh,{size:16})}})}}),null),_(s,p(Y,{get when(){return e()?.showSettings},get children(){return p(ch,{})}}),null),_(s,p(Y,{get when(){return e()?.mode==="popup"},get children(){return p(me,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return p(fh,{size:16})}})}}),null),i})()};var gh=L("<span>");const Ls=({createdAt:e,anchor:t="end"})=>(()=>{var n=gh();return st(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),_(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var ph=L('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const mh=({children:e,createdAt:t})=>(()=>{var n=ph(),r=n.firstChild;return _(r,e),_(n,p(Ls,{createdAt:t,anchor:"start"}),null),n})();var yh=L("<span>");const xt=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Ml(Dl(n))),(()=>{var r=yh();return r.innerHTML=n,Je(r,M({get class(){return Ue("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var bh=L('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const wh=({options:e,text:t})=>{let n;const{pushMessage:r}=Ye(),[o,i]=P(!1),s=(l=!0)=>{if(n){const c=n.clientWidth/2;n.scrollTo({left:n.scrollLeft+(l?c:-c),behavior:"smooth"})}},a=(l,c)=>{i(!0),r(l,c)};return(()=>{var l=bh(),c=l.firstChild,u=c.firstChild;_(l,p(xt,{get children(){return t?.trim()}}),c),_(c,p(Y,{get when(){return e.length>1},get children(){return p(me,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return p(Hd,{size:20})}})}}),u);var d=n;return typeof d=="function"?wo(d,u):n=u,_(u,p(it,{each:e,children:h=>p(me,{variant:"outline",get disabled(){return o()},class:"px-2 py-0 snap-center text-nowrap",onClick:()=>a(h.label,h.value),get children(){return h.label?.trim()}})})),_(c,p(Y,{get when(){return e.length>1},get children(){return p(me,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return p(Wd,{size:20})}})}}),null),Z(()=>st(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var vh=L('<div class="flex flex-col"><span>'),xh=L("<a target=_blank><img><span></span><span>");const Sh=({options:e,text:t})=>(()=>{var n=vh(),r=n.firstChild;return _(r,()=>t?.trim()),_(n,p(it,{each:e,children:o=>(()=>{var i=xh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return _(a,()=>o.title?.trim()),_(l,()=>o.description?.trim()),Z(c=>{var u=o.url,d=o.image;return u!==c.e&&se(i,"href",c.e=u),d!==c.t&&se(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var Eh=L("<a target=_blank>");const kh=({url:e,text:t})=>(()=>{var n=Eh();return se(n,"href",e),_(n,()=>t?.trim()),n})();var Ch=e=>{const t=M({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[O(()=>{if(n())return K(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Is=Ch,Vt=e=>typeof e=="function",Oh=["button","color","file","image","reset","submit"],Ph=(e,t)=>e==="button"?!0:e==="input"&&t?Oh.indexOf(t)!==-1:!1;function _h(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>H(()=>{let a;return Vt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var jr=_h,Dn=new Map,Ln=(e,t)=>{if(Dn.has(e))return Dn.get(e);const n=ie(t);return Dn.set(e,n),n},qr=e=>{const t=Dn.get(e);if(t)return ce(t)},Ah=e=>{const t=M({enabled:!0},e);D(()=>{K(t.enabled)&&(document.addEventListener("keydown",n),N(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Th=Ah,Mh=e=>{const t=M({enabled:!0},e);D(()=>{const{body:n}=document;K(t.enabled)&&wr({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Dh=Mh,Lh=e=>{const t=M({enabled:!0,strategy:"pointerup"},e);D(()=>{if(!K(t.enabled))return;const r=K(t.strategy);document.addEventListener(r,n),N(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=K(t.element),i=K(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Ih=Lh,Rh=e=>{const t=M({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Th({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Ih({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),Dh({enabled:t.noOutsidePointerEvents})},$h=Rh,Hr=ie(),Fh=e=>O(()=>{if(ce(Hr))return p(Rs,e);const r=ke(),[o,i]=P([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return p(Hr.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return p(Rs,e)}})}),Rs=e=>{const t=M({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ce(Hr),i=ke();D(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;$h({dismissOnEscapeKeyDown:()=>K(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>K(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>K(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=O(()=>n.children),l=()=>{const c=a();return Vt(c)?c({get isLastLayer(){return s()}}):c};return H(()=>l())},Nh=Fh,Kh=()=>{const[e,t]=P(!1);return D(()=>t(!0)),e},Bh=Kh,zh=(e,t)=>(e&&(Vt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),Wr=(...e)=>e.some(t=>!!t()),Vh=e=>(...t)=>{for(const n of e)n&&n(...t)},In=(...e)=>Vh(e),ne=e=>e?"":void 0,Uh="div",jh=e=>{const[t,n]=j(e,["as"]),r=O(()=>t.as??Uh);return O(()=>{const i=r();switch(typeof i){case"function":return H(()=>i(n));case"string":return p(en,M({component:i},n))}})},Gr=jh,qh=e=>{let t,n=!1;return()=>n?t:(n=!0,t=O(e))},$s=qh,Hh=e=>O(()=>K(e.element)?.tagName.toLowerCase()||e.fallback),Wh=Hh,Fs="button",Gh=e=>{const[t,n]=P(null),[r,o]=j(e,["as","ref","type"]),i=Wh({element:t,fallback:Fs}),s=O(()=>Ph(i(),r.type));return p(Gr,M({get as(){return r.as??Fs},ref(a){var l=In(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},Yh=Gh,ge=e=>typeof e=="function"?e():e,Rn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Xh='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',Yr="focusTrap.initialFocus",Xr="focusTrap.finalFocus",Ns={bubbles:!1,cancelable:!0},Jh=e=>{const t=M({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=O(()=>{const f=n();return f?f[0]??null:null}),i=O(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{l(ge(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(ge(t.element))};D(()=>{const f=ge(t.element);if(f&&ge(t.enabled)){s=document.activeElement,H(()=>{l(f),c(f)});const g=new MutationObserver(a);ge(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),N(()=>{ge(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),D(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),N(()=>{document.removeEventListener("keydown",h)}))}),D(()=>{const f=o();f&&(f.addEventListener("keydown",u),N(()=>{f.removeEventListener("keydown",u)}))}),D(()=>{const f=i();f&&(f.addEventListener("keydown",d),N(()=>{f.removeEventListener("keydown",d)}))});const l=f=>{r(Array.from(f.querySelectorAll(Xh)))},c=f=>{const g=ge(t.initialFocusElement)??o()??f,y=t.onInitialFocus;let w;y&&(w=new CustomEvent(Yr,Ns),f.addEventListener(Yr,y),f.dispatchEvent(w),f.removeEventListener(Yr,y)),w?.defaultPrevented!==!0&&Rn(()=>g.focus())},u=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},d=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},m=f=>{if(!ge(t.restoreFocus))return;const y=ge(t.finalFocusElement)??s;if(!y)return;let w;const b=t.onFinalFocus;b&&(w=new CustomEvent(Xr,Ns),f.addEventListener(Xr,b),f.dispatchEvent(w),f.removeEventListener(Xr,b)),w?.defaultPrevented!==!0&&Rn(()=>y.focus())}},Zh=Jh,Qh=Zh,$n=e=>typeof e=="function"?e():e,eg=e=>{const t=O(()=>{const s=$n(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=P($n(e.show)?"present":"hidden");let i="none";return D(s=>{const a=$n(e.show);return H(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),D(()=>{const s=$n(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),N(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},tg=eg,Ks=tg,ng=ie(),rg=e=>e?Ln(`dialog-${e}`):ng,Bs=ie(),og=e=>e?Ln(`dialog-internal-${e}`):Bs,St=e=>{if(!e){const n=ce(Bs);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=qr(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},ig="div",sg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=O(()=>St(t.contextId)),o=()=>Wr(r().open,()=>t.forceMount,r().contentPresent),i=O(s=>s||o(),!1);return p(Y,{get when(){return i()},get children(){return p(Nh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=O(()=>t.children);return p(Y,{get when(){return o()},get children(){return p(Gr,M({ref(l){var c=In(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??ig},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return ne(r().open())},get"data-closed"(){return ne(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},ag=sg,lg="div",cg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=O(()=>St(t.contextId)),o=()=>Wr(r().open,()=>t.forceMount,r().overlayPresent),i=O(s=>s||o(),!1);return p(Y,{get when(){return i()},get children(){return(()=>{const s=O(()=>t.children);return p(Y,{get when(){return o()},get children(){return p(Gr,M({get as(){return t.as??lg},ref(a){var l=In(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return ne(r().open())},get"data-closed"(){return ne(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return s()}}))}})})()}})},ug=cg,dg=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=O(()=>St(t.contextId)),o=()=>Wr(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=Bh(),s=O(a=>a||o()&&i(),!1);return p(Y,{get when(){return s()},get children(){return(()=>{const a=O(()=>t.children);return p(Y,{get when(){return o()},get children(){return p(ko,M(n,{get children(){return a()}}))}})})()}})},fg=dg,Jr=!0,hg=e=>{const t=M({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Jr),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Jr),preventScroll:()=>!!(e.modal??Jr),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:ke()},e),[n,r]=jr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Is({value:()=>t.labelId??ke()}),[a,l,c]=Is({value:()=>t.descriptionId??ke()}),[u,d]=P(null),[h,m]=P(null),[f,g]=P(null),{present:y}=Ks({show:n,element:h}),{present:w}=Ks({show:n,element:f});Qh({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ri({element:h,enabled:()=>y()&&K(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return K(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return K(t.noOutsidePointerEvents)},get preventScroll(){return K(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return K(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return y()},get contentRef(){return h()},get overlayPresent(){return w()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},v=$s(()=>t.children),x=()=>{const S=v()();return Vt(S)?S(b):S};return O(()=>{const S=rg(t.contextId),k=og(t.contextId);return p(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>K(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>K(t.noOutsidePointerEvents),preventScroll:()=>K(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>K(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return p(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>K(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>K(t.noOutsidePointerEvents),preventScroll:()=>K(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>K(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:g,triggerRef:u,setTriggerRef:d}},get children(){return H(()=>x())}})}})})},gg=hg,pg="button",mg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=O(()=>St(t.contextId));return p(Yh,M({ref(i){var s=In(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??pg},onClick:i=>{!zh(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return ne(r().open())},get"data-closed"(){return ne(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},yg=mg;function bg(e){const t=M({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,i]=P(null);let s=null;D(()=>{const c=ge(t.element),u=ge(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),N(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const u=c.target,d=[u.offsetWidth,u.offsetHeight],h=ge(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(xe(()=>{i(s),r(!0)}),Rn(()=>{i(d),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d:s?Fn(h,s)!==Fn(h,d)&&(xe(()=>{i(Fn(h,s)),r(!0)}),Rn(()=>{i(Fn(h,d)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d},l=()=>{if(!n())return;const c=ge(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,xe(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Fn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},wg=bg,vg=wg,xg=(e,t)=>e.length>0?()=>e(H(t)):e;function Sg(e,t){let n=0;const r=e.map((o,i)=>O(()=>(n=i,o()),void 0,Xo));return O(()=>r.map(o=>o())[n],void 0,t)}function zs(e,t,n){let r=()=>t;const[o,i]=P(t,Xo),s=O(xg(e,()=>r()),t);return[r=Sg([o,s],n),a=>i(()=>typeof a=="function"?a(H(r)):a)]}var Eg=e=>p(yg,M({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Vs=ie(),kg=e=>e?Ln(`drawer-${e}`):Vs,Cg=e=>{if(!e){const n=ce(Vs);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=qr(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},Us=ie(),Og=e=>e?Ln(`drawer-internal-${e}`):Us,js=e=>{if(!e){const n=ce(Us);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=qr(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},qs=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Nn(e,t)};const o=r[n-1]?Nn(r[n-1],t):void 0,i=r[n]?Nn(r[n],t):void 0;return{value:e,offset:Nn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Nn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},Pg=(e,t,n,r)=>{const o=Hs("upper",e,r?n:t),i=Hs("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Hs=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),_g=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},Ag=void 0,Tg=e=>{const t=M({initialOpen:!1,snapPoints:[0,1],breakPoints:[Ag],defaultSnapPoint:1,side:"bottom",dampFunction:I=>6*Math.log(I+1),velocityFunction:(I,V)=>{const oe=I/V;return oe<1&&oe>-1?1:oe},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=jr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=jr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:u,transitionSize:d}=vg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,m]=P(!1),[f,g]=zs(()=>u()?"resizing":null),y=O(()=>{const I=l()?.contentRef();if(I)return getComputedStyle(I)}),[w,b]=P(!1);D(()=>{const I=o();H(()=>{w()!==I&&(I?(b(!0),Ai(()=>{xe(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&g(null)})):(xe(()=>{g("closing"),a(0)}),Ai(()=>{parseFloat(y().transitionDuration)===0&&v()})))})});const v=()=>{xe(()=>{b(!1),g(null)})},[x,A]=P(0);D(()=>{const I=l()?.contentRef();if(!I)return;k(I);const V=new ResizeObserver(S);V.observe(I),N(()=>{V.disconnect()})});const S=I=>{for(const V of I)V.target===l()?.contentRef()&&k(V.target)},k=I=>{const V=H(()=>x());switch(n.side){case"top":case"bottom":if(V===I.offsetHeight)return;A(I.offsetHeight);break;case"left":case"right":if(V===I.offsetWidth)return;A(I.offsetWidth);break}},T=O(()=>qs(s(),x())),[C,F]=zs(()=>T().offset),z=O(()=>x()?(x()-C())/x():0),R={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return z()},get translate(){return C()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},re=$s(()=>n.children),X=I=>{c(St(n.contextId));const V=re()();if(Vt(V)){const oe=M(I,R);return V(oe)}return V};return O(()=>{const I=kg(n.contextId),V=Og(n.contextId);return H(()=>p(I.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:z,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return p(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:z,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:F,drawerSize:x,resolvedActiveSnapPoint:T,drawerStyles:y,setTransitionState:g,transitionSize:d,closeDrawer:v}},get children(){return p(gg,M({get open(){return w()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:oe=>X(oe)}))}})}}))})},Mg=Tg,Dg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=O(()=>js(t.contextId)),c=O(()=>St(t.contextId)),u=O(()=>l().snapPoints().map((v,x)=>qs(v,l().drawerSize(),x,l().breakPoints()))),d=O(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),h=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"top":case"bottom":return`${v}px`}}),m=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"left":case"right":return`${v}px`}});D(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),N(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=v=>{_g(v.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[v.clientX,v.clientY]))},g=v=>{w(v.target,v.clientX,v.clientY)},y=v=>{v.touches[0]&&w(v.target,v.touches[0].clientX,v.touches[0].clientY)},w=(v,x,A)=>{if(!r)return;if(!l().isDragging()||o===null){const T=window.getSelection();if(T&&T.toString().length>0){b();return}if(l().handleScrollableElements()){const C=[x,A].map((ee,I)=>i[I]-ee),F=Math.abs(C[0])>Math.abs(C[1])?"x":"y",z=F==="x"?C[0]:C[1];if(Math.abs(z)<.3)return;const R=c().contentRef(),[re,X]=Ti(v,F,R);if(z>0&&Math.abs(re)>1||z<0&&Math.abs(X)>0){b();return}}switch(l().side()){case"top":case"bottom":o=A;break;case"right":case"left":o=x}s=new Date,a=l().translate(),xe(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let S;switch(l().side()){case"top":S=-(o-A);break;case"bottom":S=o-A;break;case"right":S=o-x;break;case"left":S=-(o-x);break}S-=l().resolvedActiveSnapPoint().offset,S>0&&(S=l().dampFunction(S));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-S)},b=()=>{if(r=!1,!l().isDragging())return;const v=new Date,x=l().velocityFunction(-(a-l().translate()),v.getTime()-s.getTime()||1),A=l().translate()*x,S=Pg(u(),l().translate(),A,l().allowSkippingSnapPoints());xe(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),xe(()=>{l().setActiveSnapPoint(S.value),S.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(S.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return p(ag,M({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:m(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{xe(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return ne(l().isTransitioning())},get"data-opening"(){return ne(l().transitionState()==="opening")},get"data-closing"(){return ne(l().transitionState()==="closing")},get"data-snapping"(){return ne(l().transitionState()==="snapping")},get"data-resizing"(){return ne(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Lg=Dg,Ig=e=>{const[t,n]=j(e,["contextId"]),r=O(()=>js(t.contextId));return p(ug,M({get contextId(){return t.contextId},get"data-transitioning"(){return ne(r().isTransitioning())},get"data-opening"(){return ne(r().transitionState()==="opening")},get"data-closing"(){return ne(r().transitionState()==="closing")},get"data-snapping"(){return ne(r().transitionState()==="snapping")},get"data-resizing"(){return ne(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Rg=Ig,$g=L('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const Fg=Mg,Ng=Eg,Kg=fg,Bg=e=>{const[,t]=j(e,["class"]),n=Cg();return p(Rg,M({get class(){return Ue("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},zg=e=>{const[,t]=j(e,["class","children"]);return p(Kg,{get mount(){return an()},get children(){return[p(Bg,{}),p(Lg,M({id:"smarttalks-list-content",get class(){return Ue("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[$g(),O(()=>e.children)]}}))]}})};var Vg=L('<span class="font-semibold mt-2">'),Ug=L('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),jg=L('<div class="flex flex-col space-y-2"><div>'),qg=L('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),Hg=L('<div class="flex flex-col items-start"><span class=text-slate-500>');const Wg=({options:e,text:t,title:n})=>{const{pushMessage:r}=Ye(),[o,i]=P(!1),[s,a]=P(!1),[l,c]=P(),u=(h,m)=>{a(!1),i(!0),r(h,m)},d=h=>{const m=h.composedPath();for(const f of m)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=jg(),m=h.firstChild;return _(h,p(xt,{get children(){return t?.trim()}}),m),_(m,p(Fg,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[p(Ng,{as:me,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??dt("selectOption")}}),p(zg,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=Vg();return _(f,()=>n?.trim()??dt("selectOption")),f})(),(()=>{var f=Ug();return _(f,p(it,{each:e,children:g=>(()=>{var y=qg(),w=y.firstChild;return _(w,()=>g.label?.trim()??""),_(y,p(it,{get each(){return g.items},children:b=>p(me,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===b?"bg-slate-200":""}`},onClick:()=>c(b),get children(){return[(()=>{var v=Hg(),x=v.firstChild;return _(v,()=>b.label?.trim(),x),_(x,()=>b.description?.trim()),v})(),p(Y,{get when(){return l()===b},get fallback(){return p(Yd,{class:"size-4 text-slate-500"})},get children(){return p(Gd,{class:"size-4 text-slate-500"})}})]}})}),null),y})()})),f})(),p(me,{get disabled(){return o()||!l()},onClick:()=>u(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return dt("send")}})]}})]}})),Z(()=>st(m,o()?"opacity-50":"")),h})()};var Gg=L("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const Yg=e=>(()=>{var t=Gg(),n=t.firstChild,r=n.nextSibling;return Z(o=>{var i=e.link,s=e.link;return i!==o.e&&se(n,"src",o.e=i),s!==o.t&&se(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var Xg=L('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const Jg=e=>(()=>{var t=Xg(),n=t.firstChild,r=n.firstChild;return _(n,p(Xd,{class:"size-10"}),r),_(r,()=>e.filename?.trim()),_(t,p(xt,{get children(){return e.text?.trim()}}),null),Z(()=>se(n,"href",e.link)),t})();var Zg=L('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const Qg=e=>(()=>{var t=Zg(),n=t.firstChild,r=n.firstChild;return _(t,p(xt,{get children(){return e.text?.trim()}}),null),Z(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&se(n,"href",o.e=i),s!==o.t&&se(r,"src",o.t=s),a!==o.a&&se(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var ep=L('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const tp=e=>(()=>{var t=ep(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return _(t,p(xt,{get children(){return e.text?.trim()}}),null),Z(i=>{var s=e.link,a=e.link;return s!==i.e&&se(r,"src",i.e=s),a!==i.t&&se(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var np=L("<div>Media type not supported");const Ws=e=>e.type==="image"?p(Qg,e):e.type==="audio"?p(Yg,e):e.type==="document"?p(Jg,e):e.type==="video"?p(tp,e):np(),Zr=({text:e})=>p(xt,{get children(){return e?.trim()}});var rp=L("<div>Unknown bot message type");const op=e=>p(mh,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Zr,{get text(){return e.text}}):e.type==="buttons"?p(wh,M(()=>e.buttons)):e.type==="list"?p(Wg,M(()=>e.list)):e.type==="media"?p(Ws,M(()=>e.media)):e.type==="link"?p(kh,M(()=>e.link)):e.type==="cards"?p(Sh,M(()=>e.cards)):e.type==="date"?p(Zr,{get text(){return e.text}}):rp()}});var ip=L('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const sp=e=>(()=>{var t=ip(),n=t.firstChild;return _(n,()=>e.text?.trim()),t})();var ap=L('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const lp=({children:e,createdAt:t})=>(()=>{var n=ap(),r=n.firstChild;return _(r,e),_(n,p(Ls,{createdAt:t,anchor:"end"}),null),n})();var cp=L("<div>Unknown user message type");const up=e=>p(lp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Zr,{get text(){return e.text}}):e.type==="media"?p(Ws,M(()=>e.media)):cp()}});var dp=L("<div>Unknown message origin");const fp=e=>e.origin==="bot"?p(op,e):e.origin==="user"?p(up,e):e.origin==="service"?p(sp,e):dp();function hp(e){return ae({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function Et(e){return ae({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var gp=L('<div class="place-self-start py-1"><div class="animate-pulse bg-white flex space-x-1 shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl text-slate-400">');const pp=()=>(()=>{var e=gp(),t=e.firstChild;return _(t,p(Et,{class:"size-2 animate-bounce"}),null),_(t,p(Et,{class:"size-2 animate-bounce delay-150"}),null),_(t,p(Et,{class:"size-2 animate-bounce delay-300"}),null),e})();var mp=L('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),yp=L("<div>");const Qr=()=>{let e;const{getMessages:t,onMessage:n,typing:r}=Ye(),{onOpen:o}=_o(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return Wt(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=mp(),a=e;return typeof a=="function"?wo(a,s):e=s,_(s,p(it,{get each(){return t()},get fallback(){return(()=>{var l=yp();return _(l,()=>dt("emptyMessages")),l})()},children:l=>p(fp,l)}),null),_(s,p(Y,{get when(){return r()},get children(){return p(pp,{})}}),null),s})()};var bp=L("<textarea>");const wp=e=>{const[,t]=j(e,["class"]);return(()=>{var n=bp();return Je(n,M({get class(){return Ue("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var vp=L('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const xp=e=>(()=>{var t=vp();return Je(t,e,!0,!0),t})();var Sp=L('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Ep=()=>(()=>{var e=Sp(),t=e.firstChild;return _(e,p(xp,{height:15}),t),e})();var kp=L('<footer class="relative flex-none p-4 bg-white min-h-16 flex space-x-1 pb-6">');const eo=()=>{const{pushMessage:e}=Ye(),[t,n]=P(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=kp();return _(i,p(wp,{get placeholder(){return dt("inputPlaceholder")},get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),_(i,p(me,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return p(Zl,{size:24})}}),null),_(i,p(Ep,{}),null),i})()};var Cp=L('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Op=L("<span class=sr-only>Close"),Pp=L("<div>"),_p=L("<span class=sr-only>Open"),Ap=L("<span>"),Tp=L('<div class="animate-pulse flex p-1">');const Mp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=_o(),{chatWidget:s}=Q(),[a,l]=P(!0);setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const c=()=>(s()?.style.margin??5)/4,u=()=>s()?.style.position==="left"?{left:`${c()}rem`}:{right:`${c()}rem`};return window.addEventListener("message",d=>{d.data?.from==="smarttalkswidget"&&(d.data?.command==="open"&&o(),d.data?.command==="close"&&i(),d.data?.command==="toggle"&&r())}),(()=>{var d=Pp();return _(d,p(Y,{get when(){return n()},get children(){var h=Cp();return _(h,e),h}}),null),_(d,p(Y,{get when(){return n()},get fallback(){return p(me,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,_p(),p(Y,{get when(){return s()?.balloonMessage},get children(){var h=Ap();return _(h,p(Y,{get when(){return!a()},get fallback(){return(()=>{var m=Tp();return _(m,p(Et,{class:"size-2 animate-bounce"}),null),_(m,p(Et,{class:"size-2 animate-bounce delay-150"}),null),_(m,p(Et,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return s()?.balloonMessage}})),Z(()=>st(h,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(s()?.style.position==="left"?" left-9":" right-9"))),h}})]}})},get children(){return p(me,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[p(hp,{size:30}),Op()]}})}}),null),Z(h=>{var m="max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(s()?.style.position==="left"?" items-start":" items-end"),f=u();return m!==h.e&&st(d,h.e=m),h.t=Qt(d,f,h.t),h},{e:void 0,t:void 0}),d})()};var Dp=L('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Lp=({children:e})=>{const{chatWidget:t}=Q(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Dp();return Qt(r,n),_(r,e),r})()};var Ip=L('<div id=smarttalks-widget class="h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col">');const Rp=({children:e})=>{const{chatWidget:t}=Q(),[n,r]=P(!1),o=()=>(t()?.style.margin??5)/4,i=()=>t()?.style.position==="left"?{left:`${o()}rem`}:{right:`${o()}rem`};return window.addEventListener("message",s=>{s.data?.from==="smarttalkswidget"&&(s.data?.command==="open"&&r(!0),s.data?.command==="close"&&r(!1),s.data?.command==="toggle"&&r(!n()))}),setTimeout(()=>{r(!0)},(t()?.openDelay||0)*1e3),p(Y,{get when(){return n()},get children(){var s=Ip();return _(s,e),Z(a=>Qt(s,i(),a)),s}})};var $p=L('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const to=()=>(()=>{var e=$p();return _(e,p(Jl,{size:45,class:"animate-spin"})),e})(),Fp=()=>{const{chatWidget:e}=Q(),{loading:t}=Ye();return p(Mp,{get openIcon(){return p(Go,{get src(){return e()?.avatar}})},get children(){return[p(Y,{get when(){return t()},get children(){return p(to,{})}}),p(Ur,{}),p(Qr,{}),p(eo,{})]}})},Np=()=>{const{loading:e}=Ye();return p(Rp,{get children(){return[p(Y,{get when(){return e()},get children(){return p(to,{})}}),p(Ur,{}),p(Qr,{}),p(eo,{})]}})},Kp=()=>{const{loading:e}=Ye();return p(Lp,{get children(){return[p(Y,{get when(){return e()},get children(){return p(to,{})}}),p(Ur,{}),p(Qr,{}),p(eo,{})]}})},Bp=()=>{const{chatWidget:e}=Q();return p(yo,{get children(){return[p(Ct,{get when(){return e()?.mode==="standard"},get children(){return p(Fp,{})}}),p(Ct,{get when(){return e()?.mode==="popup"},get children(){return p(Np,{})}}),p(Ct,{get when(){return e()?.mode==="static"},get children(){return p(Kp,{})}})]}})};var zp=L("<div><div>Form");const Vp=()=>{const{formWidget:e}=Q();return(()=>{var t=zp();return t.firstChild,_(t,()=>e()?._id,null),t})()};function Up(){const{widget:e}=Q();return p(yo,{get children(){return[p(Ct,{get when(){return e()?.type==="chat"},get children(){return p(Bp,{})}}),p(Ct,{get when(){return e()?.type==="form"},get children(){return p(Vp,{})}})]}})}var jp=L("<style>"),qp=L("<div>");const Hp=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:i}=Q(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=jp();return _(a,Ba),a})(),(()=>{var a=qp();return _(a,p(Up,{})),a})()]},Wp={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Ka("smarttalks-widget",Wp,Hp)})(),typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{window.postMessage({from:"smarttalkswidget",command:"registerContactData",contactData:e})},open:()=>{window.postMessage({from:"smarttalkswidget",command:"open"})},close:()=>{window.postMessage({from:"smarttalkswidget",command:"close"})},toggle:()=>{window.postMessage({from:"smarttalkswidget",command:"toggle"})}})});
|