@smarttalks.ai/widget 0.6.1 → 0.8.5
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 +4833 -4729
- package/lib/index.umd.cjs +27 -27
- package/package.json +4 -1
package/lib/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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}/*!
|
|
1
|
+
(function(Tt){typeof define=="function"&&define.amd?define(Tt):Tt()})(function(){"use strict";function Tt(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=Tt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function go(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tt(e))&&(r&&(r+=" "),r+=t);return r}const jn="-",sa=e=>{const t=la(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(jn);return a[0]===""&&a.length!==1&&a.shift(),po(a,t)||aa(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},po=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?po(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(jn);return t.validators.find(({validator:s})=>s(i))?.classGroupId},mo=/^\[(.+)\]$/,aa=e=>{if(mo.test(e)){const t=mo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},la=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ua(Object.entries(e.classGroups),n).forEach(([i,s])=>{Hn(s,r,i,t)}),r},Hn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:yo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(ca(o)){Hn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Hn(s,yo(t,i),n,r)})})},yo=(e,t)=>{let n=e;return t.split(jn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ca=e=>e.isThemeGetter,ua=(e,t)=>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,da=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const 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)}}},bo="!",fa=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,d=0,u;for(let p=0;p<a.length;p++){let b=a[p];if(c===0){if(b===o&&(r||a.slice(p,p+i)===t)){l.push(a.slice(d,p)),d=p+i;continue}if(b==="/"){u=p;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?a:a.substring(d),m=h.startsWith(bo),f=m?h.substring(1):h,g=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:s}):s},ha=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},ga=e=>({cache:da(e.cacheSize),parseClassName:fa(e),...sa(e)}),pa=/\s+/,ma=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(pa);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=n(c);let f=!!m,g=r(f?h.substring(0,m):h);if(!g){if(!f){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}f=!1}const p=ha(d).join(":"),b=u?p+bo:p,v=b+g;if(i.includes(v))continue;i.push(v);const w=o(g,f);for(let x=0;x<w.length;++x){const O=w[x];i.push(b+O)}a=c+(a.length>0?" "+a:a)}return a};function ya(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vo(t))&&(r&&(r+=" "),r+=n);return r}const vo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vo(e[r]))&&(n&&(n+=" "),n+=t);return n};function ba(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,u)=>u(d),e());return n=ga(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 d=ma(l,n);return o(l,d),d}return function(){return i(ya.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wo=/^\[(?:([a-z-]+):)?(.+)\]$/i,va=/^\d+\/\d+$/,wa=new Set(["px","full","screen"]),xa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sa=/\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$/,Ea=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ca=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ka=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fe=e=>lt(e)||wa.has(e)||va.test(e),qe=e=>ct(e,"length",Ma),lt=e=>!!e&&!Number.isNaN(Number(e)),qn=e=>ct(e,"number",lt),Dt=e=>!!e&&Number.isInteger(Number(e)),Oa=e=>e.endsWith("%")&<(e.slice(0,-1)),F=e=>wo.test(e),We=e=>xa.test(e),_a=new Set(["length","size","percentage"]),Pa=e=>ct(e,_a,xo),Aa=e=>ct(e,"position",xo),Ta=new Set(["image","url"]),Da=e=>ct(e,Ta,Ra),La=e=>ct(e,"",Ia),Lt=()=>!0,ct=(e,t,n)=>{const r=wo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ma=e=>Sa.test(e)&&!Ea.test(e),xo=()=>!1,Ia=e=>Ca.test(e),Ra=e=>ka.test(e),$a=ba(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),i=X("borderRadius"),s=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),h=X("gap"),m=X("gradientColorStops"),f=X("gradientColorStopPositions"),g=X("inset"),p=X("margin"),b=X("opacity"),v=X("padding"),w=X("saturate"),x=X("scale"),O=X("sepia"),C=X("skew"),E=X("space"),$=X("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",F,t],I=()=>[F,t],te=()=>["",Fe,qe],Y=()=>["auto",lt,F],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["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"],Q=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",F],At=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Pe=()=>[lt,F];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[Fe,qe],blur:["none","",We,F],brightness:Pe(),borderColor:[e],borderRadius:["none","","full",We,F],borderSpacing:I(),borderWidth:te(),contrast:Pe(),grayscale:ie(),hueRotate:Pe(),invert:ie(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Oa,qe],inset:L(),margin:L(),opacity:Pe(),padding:I(),saturate:Pe(),scale:Pe(),sepia:ie(),skew:Pe(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",F]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":At()}],"break-before":[{"break-before":At()}],"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:[...fe(),F]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],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",Dt,F]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",F]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",Dt,F]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Dt,F]},F]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Dt,F]},F]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",F]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",F]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",F,t]}],"min-w":[{"min-w":[F,t,"min","max","fit"]}],"max-w":[{"max-w":[F,t,"none","full","min","max","fit","prose",{screen:[We]},We]}],h:[{h:[F,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[F,t,"auto","min","max","fit"]}],"font-size":[{text:["base",We,qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qn]}],"font-family":[{font:[Lt]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",F]}],"line-clamp":[{"line-clamp":["none",lt,qn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fe,F]}],"list-image":[{"list-image":["none",F]}],"list-style-type":[{list:["none","disc","decimal",F]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fe,qe]}],"underline-offset":[{"underline-offset":["auto",Fe,F]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F]}],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",F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),Aa]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Pa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Da]}],"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":[b]}],"border-style":[{border:[...N(),"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":[b]}],"divide-style":[{divide:N()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...N()]}],"outline-offset":[{"outline-offset":[Fe,F]}],"outline-w":[{outline:[Fe,qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Fe,qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,La]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",We,F]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[O]}],"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":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"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",F]}],duration:[{duration:Pe()}],ease:[{ease:["linear","in","out","in-out",F]}],delay:[{delay:Pe()}],animate:[{animate:["none","spin","ping","pulse","bounce",F]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Dt,F]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",F]}],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",F]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",F]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fe,qe,qn]}],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-s","border-color-e","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"]}}});function Ge(...e){return $a(go(e))}function Na(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",Xt(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Xt(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Xt(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Xt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Xt(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 Fa(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 Ka(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 Wn(){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 Ba={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 ut(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"),Ba[n][e]}const Jt="https://heimdall.smarttalks.ai/api",za="wss://heimdall.smarttalks.ai",So="smarttalkswidget";function ne(e,...t){window.postMessage({from:So,command:e,args:t})}function le(e,t){window.addEventListener("message",n=>{n.data?.from===So&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function Va(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ne("registerContactData",e)},open:e=>{ne("open"),e&&ne("setInput",e)},close:()=>{ne("close")},toggle:()=>{ne("toggle")},reset:()=>{ne("reset")},onOpen:e=>{le("onOpen",e)},onClose:e=>{le("onClose",e)},onToggle:e=>{le("onToggle",e)},onReset:e=>{le("onReset",e)},onInput:e=>{le("onInput",e)},onAnswer:e=>{le("onAnswer",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Co(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 Ua(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),_o(o.value)&&!Ga(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 ja(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=_o(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Wa(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Ha(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function qa(e,t){const n=Ua(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?ko(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 d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function ko(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 Wa(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function _o(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Ga(e){return Object.prototype.toString.call(e)==="[object Function]"}function Ya(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Gn;function Xa(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=qa(this,t);const o=Ha(this.props),i=this.Component,s=Gn;try{Gn=this,this.__initialized=!0,Ya(i)?new i(o,{element:this}):i(o,{element:this})}finally{Gn=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?ko(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 Ja(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Xa(r,ja(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const B={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Po(this.context.count)},getNextContextId(){return Po(this.context.count++)}};function Po(e){const t=String(e),n=t.length-1;return B.context.id+(n?String.fromCharCode(96+n):"")+t}function Za(e){B.context=e}const Qa=!1,el=(e,t)=>e===t,be=Symbol("solid-proxy"),Ao=typeof Proxy=="function",Yn=Symbol("solid-track"),Zt={equals:el};let To=$o;const Ke=1,Qt=2,Do={owned:null,cleanups:null,context:null,owner:null},Xn={};var H=null;let Jn=null,tl=null,W=null,se=null,Be=null,en=0;function ze(e,t){const n=W,r=H,o=e.length===0,i=t===void 0?r:t,s=o?Do:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>q(()=>Mt(s)));H=s,W=null;try{return Ve(a,!0)}finally{W=n,H=r}}function P(e,t){t=t?Object.assign({},Zt,t):Zt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ro(n,o));return[Io.bind(n),r]}function Lo(e,t,n){const r=nn(e,t,!0,Ke);dt(r)}function re(e,t,n){const r=nn(e,t,!1,Ke);dt(r)}function D(e,t,n){To=ll;const r=nn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),Be?Be.push(r):dt(r)}function k(e,t,n){n=n?Object.assign({},Zt,n):Zt;const r=nn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,dt(r),Io.bind(r)}function nl(e){return e&&typeof e=="object"&&"then"in e}function rl(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Xn,l=null,c=!1,d="initialValue"in i,u=typeof r=="function"&&k(r);const h=new Set,[m,f]=(i.storage||P)(i.initialValue),[g,p]=P(void 0),[b,v]=P(void 0,{equals:!1}),[w,x]=P(d?"ready":"unresolved");B.context&&(l=B.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:B.load&&B.has(l)&&(a=B.load(l)));function O(_,R,L,I){return s===_&&(s=null,I!==void 0&&(d=!0),(_===a||R===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(I,{value:R})),a=Xn,C(R,L)),R}function C(_,R){Ve(()=>{R===void 0&&f(()=>_),x(R!==void 0?"errored":d?"ready":"unresolved"),p(R);for(const L of h.keys())L.decrement();h.clear()},!1)}function E(){const _=il,R=m(),L=g();if(L!==void 0&&!s)throw L;return W&&W.user,R}function $(_=!0){if(_!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){O(s,q(m));return}const L=a!==Xn?a:q(()=>o(R,{value:m(),refetching:_}));return nl(L)?(s=L,"value"in L?(L.status==="success"?O(s,L.value,void 0,R):O(s,void 0,er(L.value),R),L):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),v()},!1),L.then(I=>O(L,I,void 0,R),I=>O(L,void 0,er(I),R)))):(O(s,L,void 0,R),L)}return Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const _=w();return _==="pending"||_==="refreshing"}},latest:{get(){if(!d)return E();const _=g();if(_&&!s)throw _;return m()}}}),u?Lo(()=>$(!1)):$(!1),[E,{refetch:$,mutate:f}]}function Ee(e){return Ve(e,!1)}function q(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function et(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)return i=!1,s;const l=q(()=>t(a,o,s));return o=a,l}}function tn(e){D(()=>q(e))}function K(e){return H===null||(H.cleanups===null?H.cleanups=[e]:H.cleanups.push(e)),e}function Zn(){return W}function Mo(){return H}function ol(e,t){const n=H,r=W;H=e,W=null;try{return Ve(t,!0)}catch(o){tr(o)}finally{H=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:cl(n),defaultValue:e}}function he(e){let t;return H&&H.context&&(t=H.context[e.id])!==void 0?t:e.defaultValue}function Qn(e){const t=k(e),n=k(()=>nr(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let il;function Io(){if(this.sources&&this.state)if(this.state===Ke)dt(this);else{const e=se;se=null,Ve(()=>on(this),!1),se=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 Ro(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{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?se.push(i):Be.push(i),i.observers&&No(i)),s||(i.state=Ke)}if(se.length>1e6)throw se=[],new Error},!1)),t}function dt(e){if(!e.fn)return;Mt(e);const t=en;sl(e,e.value,t)}function sl(e,t,n){let r;const o=H,i=W;W=H=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Mt),e.owned=null),e.updatedAt=n+1,tr(s)}finally{W=i,H=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ro(e,r):e.value=r,e.updatedAt=n)}function nn(e,t,n,r=Ke,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:H,context:H?H.context:null,pure:n};return H===null||H!==Do&&(H.owned?H.owned.push(i):H.owned=[i]),i}function rn(e){if(e.state===0)return;if(e.state===Qt)return on(e);if(e.suspense&&q(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<en);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)dt(e);else if(e.state===Qt){const r=se;se=null,Ve(()=>on(e,t[0]),!1),se=r}}function Ve(e,t){if(se)return e();let n=!1;t||(se=[]),Be?n=!0:Be=[],en++;try{const r=e();return al(n),r}catch(r){n||(Be=null),se=null,tr(r)}}function al(e){if(se&&($o(se),se=null),e)return;const t=Be;Be=null,t.length&&Ve(()=>To(t),!1)}function $o(e){for(let t=0;t<e.length;t++)rn(e[t])}function ll(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rn(r)}if(B.context){if(B.count){B.effects||(B.effects=[]),B.effects.push(...e.slice(0,n));return}Za()}for(B.effects&&(B.done||!B.count)&&(e=[...B.effects,...e],n+=B.effects.length,delete B.effects),t=0;t<n;t++)rn(e[t])}function on(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===Ke?r!==t&&(!r.updatedAt||r.updatedAt<en)&&rn(r):o===Qt&&on(r,t)}}}function No(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Qt,n.pure?se.push(n):Be.push(n),n.observers&&No(n))}}function Mt(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.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Mt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Mt(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 er(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function tr(e,t=H){throw er(e)}function nr(e){if(typeof e=="function"&&!e.length)return nr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=nr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function cl(e,t){return function(r){let o;return re(()=>o=q(()=>(H.context={...H.context,[e]:r.value},Qn(()=>r.children))),void 0),o}}const ul=Symbol("fallback");function Fo(e){for(let t=0;t<e.length;t++)e[t]()}function dl(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return K(()=>Fo(i)),()=>{let l=e()||[],c=l.length,d,u;return l[Yn],q(()=>{let m,f,g,p,b,v,w,x,O;if(c===0)s!==0&&(Fo(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ul],o[0]=ze(C=>(i[0]=C,n.fallback())),s=1);else if(s===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=ze(h);s=c}else{for(g=new Array(c),p=new Array(c),a&&(b=new Array(c)),v=0,w=Math.min(s,c);v<w&&r[v]===l[v];v++);for(w=s-1,x=c-1;w>=v&&x>=v&&r[w]===l[x];w--,x--)g[x]=o[w],p[x]=i[w],a&&(b[x]=a[w]);for(m=new Map,f=new Array(x+1),u=x;u>=v;u--)O=l[u],d=m.get(O),f[u]=d===void 0?-1:d,m.set(O,u);for(d=v;d<=w;d++)O=r[d],u=m.get(O),u!==void 0&&u!==-1?(g[u]=o[d],p[u]=i[d],a&&(b[u]=a[d]),u=f[u],m.set(O,u)):i[d]();for(u=v;u<c;u++)u in g?(o[u]=g[u],i[u]=p[u],a&&(a[u]=b[u],a[u](u))):o[u]=ze(h);o=o.slice(0,s=c),r=l.slice(0)}return o});function h(m){if(i[u]=m,a){const[f,g]=P(u);return a[u]=g,t(l[u],f)}return t(l[u])}}}function y(e,t){return q(()=>e(t||{}))}function sn(){return!0}const rr={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return t===be?!0:e.has(t)},set:sn,deleteProperty:sn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:sn,deleteProperty:sn}},ownKeys(e){return e.keys()}};function or(e){return(e=typeof e=="function"?e():e)?e:{}}function fl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function T(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&be in a,e[s]=typeof a=="function"?(t=!0,k(a)):a}if(Ao&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=or(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in or(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(or(e[a])));return[...new Set(s)]}},rr);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 d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:fl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const h=n[d];h&&(u.get?h.push(u.get.bind(a)):u.value!==void 0&&h.push(()=>u.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(Ao&&be 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)}},rr));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))}},rr)),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 hl=0;function Ae(){return B.context?B.getNextContextId():`cl-${hl++}`}const Ko=e=>`Stale read from <${e}>.`;function ft(e){const t="fallback"in e&&{fallback:()=>e.fallback};return k(dl(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=k(()=>e.when,void 0,void 0),r=t?n:k(n,void 0,{equals:(o,i)=>!o==!i});return k(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?q(()=>i(t?o:()=>{if(!q(r))throw Ko("Show");return n()})):i}return e.fallback},void 0,void 0)}function Bo(e){const t=Qn(()=>e.children),n=k(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,l=o[s],c=i,d=k(()=>c()?void 0:l.when,void 0,void 0),u=l.keyed?d:k(d,void 0,{equals:(h,m)=>!h==!m});i=()=>c()||(u()?[a,d,l]:void 0)}return i});return k(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?q(()=>a(s.keyed?i():()=>{if(q(n)()?.[0]!==o)throw Ko("Match");return i()})):a},void 0,void 0)}function It(e){return e}const gl=["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"],pl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...gl]),ml=new Set(["innerHTML","textContent","innerText","children"]),yl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),bl=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 vl(e,t){const n=bl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const wl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xl=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","feDropShadow","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"]),Sl={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function El(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 d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}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 d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!c){c=new Map;let u=a;for(;u<i;)c.set(n[u],u++)}const d=c.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,h=1,m;for(;++u<o&&u<i&&!((m=c.get(t[u]))==null||m!==d+h);)h++;if(h>d-a){const f=t[s];for(;a<d;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const zo="_$DX_DELEGATE";function M(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function Cl(e,t=window.document){const n=t[zo]||(t[zo]=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,Ll))}}function ue(e,t,n){nt(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function kl(e,t,n,r){nt(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ol(e,t,n){nt(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ht(e,t){nt(e)||(t==null?e.removeAttribute("class"):e.className=t)}function _l(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,typeof n!="function"&&n)}function Pl(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 an(e,t,n){if(!t)return n?ue(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 tt(e,t={},n,r){const o={};return r||re(()=>o.children=Rt(e,t.children,o.children)),re(()=>typeof t.ref=="function"&&ir(t.ref,e)),re(()=>Al(e,t,n,!0,o,!0)),o}function ir(e,t,n){return q(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Rt(e,t,r,n);re(o=>Rt(e,t(),o,n),r)}function Al(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Uo(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Uo(e,s,a,o[s],n,i,t)}}function Tl(e){let t,n;return!nt()||!(t=B.registry.get(n=Ml()))?e():(B.completed&&B.completed.add(t),B.registry.delete(n),t)}function nt(e){return!!B.context&&!B.done&&(!e||e.isConnected)}function Dl(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 Uo(e,t,n,r,o,i,s){let a,l,c,d,u;if(t==="style")return an(e,n,r);if(t==="classList")return Pl(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),m=wl.has(h);if(!m&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(m||n)&&(_l(e,h,n,m),m&&Cl([h]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Ol(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=ml.has(t))||!o&&((d=vl(t,e.tagName))||(l=pl.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(u)t=t.slice(5),l=!0;else if(nt(e))return n;t==="class"||t==="className"?ht(e,n):a&&!l&&!c?e[Dl(t)]=n:e[d||t]=n}else{const h=o&&t.indexOf(":")>-1&&Sl[t.split(":")[0]];h?kl(e,h,t,n):ue(e,yl[t]||t,n)}return n}function Ll(e){if(B.registry&&B.events&&B.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),B.registry&&!B.done&&(B.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Rt(e,t,n,r,o){const i=nt(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=gt(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=gt(e,n,r)}else{if(s==="function")return re(()=>{let l=t();for(;typeof l=="function";)l=l();n=Rt(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(sr(l,t,n,o))return re(()=>n=Rt(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const u=[d];for(;(d=d.nextSibling)!==r;)u.push(d);return n=u}if(l.length===0){if(n=gt(e,n,r),a)return n}else c?n.length===0?jo(e,l,r):El(e,n,l):(n&>(e),jo(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=gt(e,n,r,t);gt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function sr(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=sr(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=sr(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function jo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function gt(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]}function Ml(){return B.getNextContextId()}const Il=!1,Rl="http://www.w3.org/2000/svg";function Ho(e,t=!1){return t?document.createElementNS(Rl,e):document.createElement(e)}function qo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Mo();let i,s=!!B.context;return D(()=>{s&&(Mo().user=s=!1),i||(i=ol(o,()=>k(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),d=()=>c(!0);ze(u=>A(a,()=>l()?u():i(),null)),K(d)}else{const l=Ho(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}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!s}),n}function $l(e,t){const n=k(e);return k(()=>{const r=n();switch(typeof r){case"function":return q(()=>r(t));case"string":const o=xl.has(r),i=B.context?Tl():Ho(r,o);return tt(i,t,o),i}})}function ln(e){const[,t]=j(e,["component"]);return $l(()=>e.component,t)}function Nl(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 Fl(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 Kl(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const i=Nl(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},Fl(r))}}function Bl(e,t,n){return arguments.length===2&&(n=t,t={}),Ja(e,t)(Kl(n))}const zl='*,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,: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;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([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]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.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-1{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\\.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-80{max-width:20rem}.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}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.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\\.5{gap:.125rem}.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-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, 1))}.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, 1))}.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, 1))}.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, 1))}.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, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.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, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.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, 1))}.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))}',[Wo,ar]=P(!1),Go=[],Vl=e=>Go.push(e),Yo=()=>{Go.forEach(e=>e())},Ul=()=>{const e=!Wo();ar(e),ne("onToggle"),ne(e?"onOpen":"onClose"),Yo()},jl=()=>{ar(!1),ne("onClose")},Hl=()=>{ar(!0),ne("onOpen"),Yo()},Xo=()=>({bubble:Wo,show:Hl,hide:jl,toggle:Ul,onOpen:Vl}),lr=Symbol("store-raw"),pt=Symbol("store-node"),Ue=Symbol("store-has"),Jo=Symbol("store-self");function Zo(e){let t=e[be];if(!t&&(Object.defineProperty(e,be,{value:t=new Proxy(e,Gl)}),!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 cn(e){let t;return e!=null&&typeof e=="object"&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function $t(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[lr])return n;if(!cn(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=$t(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=$t(o,t))!==o&&(e[i]=r))}return e}function un(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Nt(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 ql(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===be||t===pt||(delete n.value,delete n.writable,n.get=()=>e[be][t]),n}function Qo(e){Zn()&&Nt(un(e,pt),Jo)()}function Wl(e){return Qo(e),Reflect.ownKeys(e)}const Gl={get(e,t,n){if(t===lr)return e;if(t===be)return n;if(t===Yn)return Qo(e),n;const r=un(e,pt),o=r[t];let i=o?o():e[t];if(t===pt||t===Ue||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Zn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Nt(r,t,i)())}return cn(i)?Zo(i):i},has(e,t){return t===lr||t===be||t===Yn||t===pt||t===Ue||t==="__proto__"?!0:(Zn()&&Nt(un(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Wl,getOwnPropertyDescriptor:ql};function dn(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[Ue]&&e[Ue][t]&&o!==void 0&&e[Ue][t].$()):(e[t]=n,e[Ue]&&e[Ue][t]&&o===void 0&&e[Ue][t].$());let s=un(e,pt),a;if((a=Nt(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Nt(s,"length",i))&&a.$(e.length)}(a=s[Jo])&&a.$()}function ei(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];dn(e,o,t[o])}}function Yl(e,t){if(typeof t=="function"&&(t=t(e)),t=$t(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&&dn(e,n,o)}dn(e,"length",r)}else ei(e,t)}function Ft(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++)Ft(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Ft(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:d=1}=r;for(let u=l;u<=c;u+=d)Ft(e,[u].concat(t),n);return}else if(t.length>1){Ft(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=$t(i),r===void 0||cn(o)&&cn(i)&&!Array.isArray(i)?ei(o,i):dn(e,r,i))}function Xl(...[e,t]){const n=$t(e||{}),r=Array.isArray(n),o=Zo(n);function i(...s){Ee(()=>{r&&s.length===1?Yl(n,s[0]):Ft(n,s)})}return[o,i]}function ti(e,t,n){return ze(()=>{const r=Co(e),[o,i]=Xl(r?JSON.parse(r):t);return D(()=>Eo(e,JSON.stringify(o),n)),[o,i]})}function Jl(e,t,n){return ze(()=>{const r=Co(e),[o,i]=P(r?JSON.parse(r):t);return D(()=>Eo(e,JSON.stringify(o()),n)),[o,i]})}const[gm,pm]=Jl("lang","en");function Zl(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 Ql(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 ec=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Jt}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Zl(i);if(i.type==="entity")return Ql(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 le("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Jt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),i._id=n,i},[ni,tc]=P(""),[mt]=ze(()=>rl(ni,ec)),nc=()=>{if(mt()?.type==="chat")return mt()},rc=()=>{if(mt()?.type==="form")return mt()};ze(()=>D(()=>Na(mt())));const oe=()=>({widgetId:ni,setWidgetId:tc,widget:mt,chatWidget:nc,formWidget:rc}),ri=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,oi=go,oc=(e,t)=>n=>{var r;if(t?.variants==null)return oi(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=n?.[c],u=i?.[c];if(d===null)return null;const h=ri(d)||ri(u);return o[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,h]=d;return h===void 0||(c[u]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:h,...m}=d;return Object.entries(m).every(f=>{let[g,p]=f;return Array.isArray(p)?p.includes({...i,...a}[g]):{...i,...a}[g]===p})?[...c,u,h]:c},[]);return oi(e,s,l,n?.class,n?.className)};var ic=M("<button>");const sc=oc("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"}}),Te=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=ic();return tt(n,T({get class(){return Ge(sc({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var ac=M('<img alt="widget logo">');const ii=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=ac();return tt(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var lc=M('<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 cc=()=>{const{chatWidget:e}=oe(),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=lc(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return A(r,y(ii,{get src(){return e()?.avatar}}),o),A(i,t),A(s,n),r})()};var uc=M("<svg stroke-width=0>");function ve(e,t){const n=T(e.a,t),[r,o]=j(n,["src"]),[i,s]=P(""),a=k(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return D(()=>s(a())),K(()=>{s("")}),(()=>{var l=uc();return tt(l,T({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),A(l,()=>Il),l})()}function dc(e){return ve({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 fc(e){return ve({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 hc(e){return ve({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 gc(e){return ve({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)}const cr={equals:!1};function si(e){return(...t)=>{for(const n of e)n&&n(...t)}}function pc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,ai=e=>Array.isArray(e)?e:e?[e]:[];function mc(e,...t){return typeof e=="function"?e(...t):e}const yc=K;function bc(e,t,n,r){return e.addEventListener(t,n,r),yc(e.removeEventListener.bind(e,t,n,r))}function vc(e,t,n,r){const o=()=>{ai(S(e)).forEach(i=>{i&&ai(S(t)).forEach(s=>bc(i,s,n,r))})};typeof e=="function"?D(o):re(o)}function fn(){return!0}const wc={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return e.has(t)},set:fn,deleteProperty:fn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:fn,deleteProperty:fn}},ownKeys(e){return e.keys()}},xc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function li(e){const t={};let n;for(;n=xc.exec(e);)t[n[1]]=n[2];return t}function Sc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=li(e)}else typeof t=="string"&&(t=li(t));return{...e,...t}}const ur=(e,t,n)=>{let r;for(const o of e){const i=S(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Ec(...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?pc:si,o={};for(const s of n){const a=S(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const i=T(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ur(n,"style",Sc);if(s==="ref"){const a=[];for(const l of n){const c=S(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"?ur(n,s,(a,l)=>`${a} ${l}`):s==="classList"?ur(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},wc)}function rt(...e){return si(e)}function Cc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function dr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kc(e){return typeof e=="number"}function Oc(e){return Array.isArray(e)}function yt(e){return Object.prototype.toString.call(e)==="[object String]"}function _c(e){return typeof e=="function"}function ci(e){return t=>`${e()}-${t}`}function De(e,t){return e?e===t||e.contains(t):!1}function Kt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(ui(n)&&n.contentDocument)return Kt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function ui(e){return e.tagName==="IFRAME"}var di=(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))(di||{});function fr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function hn(){return fr(/^Mac/i)}function Pc(){return fr(/^iPhone/i)}function Ac(){return fr(/^iPad/i)||hn()&&navigator.maxTouchPoints>1}function Tc(){return Pc()||Ac()}function Dc(){return hn()||Tc()}function ge(e,t){return t&&(_c(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function we(e){return t=>{for(const n of e)ge(t,n)}}function Lc(e){return hn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Mc())e.focus({preventScroll:!0});else{const t=Ic(e);e.focus(),Rc(t)}}var gn=null;function Mc(){if(gn==null){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch{}}return gn}function Ic(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 Rc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fi=["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'])"],$c=[...fi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],hr=`${fi.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Nc=$c.join(':not([hidden]):not([tabindex="-1"]),');function hi(e,t){const r=Array.from(e.querySelectorAll(hr)).filter(gi);return t&&gi(e)&&r.unshift(e),r.forEach((o,i)=>{if(ui(o)&&o.contentDocument){const s=o.contentDocument.body,a=hi(s,!1);r.splice(i,1,...a)}}),r}function gi(e){return pi(e)&&!Fc(e)}function pi(e){return e.matches(hr)&&gr(e)}function Fc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function gr(e,t){return e.nodeName!=="#comment"&&Kc(e)&&Bc(e,t)&&(!e.parentElement||gr(e.parentElement,e))}function Kc(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 Bc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function zc(e,t,n){const r=t?.tabbable?Nc:hr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&gr(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function mi(e){let t=e;for(;t&&!Vc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Vc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Uc(){}function jc(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,d]=t[a],[u,h]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],f=(d-h)*(n-c)-(c-u)*(r-d);if(h<d){if(r>=h&&r<d){if(f===0)return!0;f>0&&(r===h?r>m&&(o=!o):o=!o)}}else if(d<h){if(r>d&&r<=h){if(f===0)return!0;f<0&&(r===h?r<m&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function Le(e,t){return T(e,t)}var Bt=new Map,yi=new Set;function bi(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Bt.get(n.target);r||(r=new Set,Bt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Bt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Bt.delete(n.target)),Bt.size===0)){for(const o of yi)o();yi.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?bi():document.addEventListener("DOMContentLoaded",bi));function pr(e,t){const n=vi(e,t,"left"),r=vi(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 vi(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 Hc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=mi(e);for(;e&&o&&e!==n&&o!==n;)pr(o,e),e=o,o=mi(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)&&e.scrollIntoView?.({block:"nearest"})}}}var qc={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 mr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(yt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return yt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(yt(l)||kc(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 d=mr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...d),t+=d.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
|
*
|
|
5
5
|
* Credits to the React Spectrum team:
|
|
6
6
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/collections/src/useCollection.ts
|
|
7
|
-
*/function
|
|
7
|
+
*/function Wc(e,t=[]){const n=mr({dataSource:S(e.dataSource),getKey:S(e.getKey),getTextValue:S(e.getTextValue),getDisabled:S(e.getDisabled),getSectionChildren:S(e.getSectionChildren)}),[r,o]=P(e.factory(n));return D(et([()=>S(e.dataSource),()=>S(e.getKey),()=>S(e.getTextValue),()=>S(e.getDisabled),()=>S(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,d])=>{const u=mr({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>d(u))},{defer:!0})),r}function yr(e){const[t,n]=P(e.defaultValue?.()),r=k(()=>e.value?.()!==void 0),o=k(()=>r()?e.value?.():t());return[o,s=>{q(()=>{const a=mc(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Gc(e){const[t,n]=yr(e);return[()=>t()??!1,n]}function Yc(e){const[t,n]=yr(e);return[()=>t()??[],n]}function wi(e={}){const[t,n]=Gc({value:()=>S(e.open),defaultValue:()=>!!S(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function Xc(e){const t=n=>{n.key===di.Escape&&e.onEscapeKeyDown?.(n)};D(()=>{if(S(e.isDisabled))return;const n=e.ownerDocument?.()??je();n.addEventListener("keydown",t),K(()=>{n.removeEventListener("keydown",t)})})}/*!
|
|
8
8
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
9
9
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
10
10
|
*
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Credits to the Chakra UI team:
|
|
18
18
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/dismissable/src/layer-stack.ts
|
|
19
|
-
*/const
|
|
19
|
+
*/const pn="data-kb-top-layer";let xi,br=!1;const He=[];function zt(e){return He.findIndex(t=>t.node===e)}function Jc(e){return He[zt(e)]}function Zc(e){return He[He.length-1].node===e}function Si(){return He.filter(e=>e.isPointerBlocking)}function Qc(){return[...Si()].slice(-1)[0]}function vr(){return Si().length>0}function Ei(e){const t=zt(Qc()?.node);return zt(e)<t}function eu(e){He.push(e)}function tu(e){const t=zt(e);t<0||He.splice(t,1)}function nu(){for(const{node:e}of He)e.style.pointerEvents=Ei(e)?"none":"auto"}function ru(e){if(vr()&&!br){const t=je(e);xi=document.body.style.pointerEvents,t.body.style.pointerEvents="none",br=!0}}function ou(e){if(vr())return;const t=je(e);t.body.style.pointerEvents=xi,t.body.style.length===0&&t.body.removeAttribute("style"),br=!1}const pe={layers:He,isTopMostLayer:Zc,hasPointerBlockingLayer:vr,isBelowPointerBlockingLayer:Ei,addLayer:eu,removeLayer:tu,indexOf:zt,find:Jc,assignPointerEventToLayers:nu,disableBodyPointerEvents:ru,restoreBodyPointerEvents:ou};/*!
|
|
20
20
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
21
21
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
22
22
|
*
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
* Credits to the Chakra UI team:
|
|
30
30
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-on-child-unmount.ts
|
|
31
31
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-containment.ts
|
|
32
|
-
*/const
|
|
32
|
+
*/const wr="focusScope.autoFocusOnMount",xr="focusScope.autoFocusOnUnmount",Ci={bubbles:!1,cancelable:!0},ki={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=dr(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=dr(this.stack,e),this.active()?.resume()}};function iu(e,t){const[n,r]=P(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=f=>e.onMountAutoFocus?.(f),a=f=>e.onUnmountAutoFocus?.(f),l=()=>je(t()),c=()=>{const f=l().createElement("span");return f.setAttribute("data-focus-trap",""),f.tabIndex=0,Object.assign(f.style,qc),f},d=()=>{const f=t();return f?hi(f,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},u=()=>{const f=d();return f.length>0?f[0]:null},h=()=>{const f=d();return f.length>0?f[f.length-1]:null},m=()=>{const f=t();if(!f)return!1;const g=Kt(f);return!g||De(f,g)?!1:pi(g)};D(()=>{const f=t();if(!f)return;ki.add(o);const g=Kt(f);if(!De(f,g)){const b=new CustomEvent(wr,Ci);f.addEventListener(wr,s),f.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{de(u()),Kt(f)===g&&de(f)},0)}K(()=>{f.removeEventListener(wr,s),setTimeout(()=>{const b=new CustomEvent(xr,Ci);m()&&b.preventDefault(),f.addEventListener(xr,a),f.dispatchEvent(b),b.defaultPrevented||de(g??l().body),f.removeEventListener(xr,a),ki.remove(o)},0)})}),D(()=>{const f=t();if(!f||!S(e.trapFocus)||n())return;const g=b=>{const v=b.target;v?.closest(`[${pn}]`)||(De(f,v)?i=v:de(i))},p=b=>{const w=b.relatedTarget??Kt(f);w?.closest(`[${pn}]`)||De(f,w)||de(i)};l().addEventListener("focusin",g),l().addEventListener("focusout",p),K(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",p)})}),D(()=>{const f=t();if(!f||!S(e.trapFocus)||n())return;const g=c();f.insertAdjacentElement("afterbegin",g);const p=c();f.insertAdjacentElement("beforeend",p);function b(w){const x=u(),O=h();w.relatedTarget===x?de(O):de(x)}g.addEventListener("focusin",b),p.addEventListener("focusin",b);const v=new MutationObserver(w=>{for(const x of w)x.previousSibling===p&&(p.remove(),f.insertAdjacentElement("beforeend",p)),x.nextSibling===g&&(g.remove(),f.insertAdjacentElement("afterbegin",g))});v.observe(f,{childList:!0,subtree:!1}),K(()=>{g.removeEventListener("focusin",b),p.removeEventListener("focusin",b),g.remove(),p.remove(),v.disconnect()})})}/*!
|
|
33
33
|
* Portions of this file are based on code from react-spectrum.
|
|
34
34
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
35
35
|
*
|
|
36
36
|
* Credits to the React Spectrum team:
|
|
37
37
|
* https://github.com/adobe/react-spectrum/blob/15e101b74966bd5eb719c6529ce71ce57eaed430/packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx
|
|
38
|
-
*/const
|
|
38
|
+
*/const su="data-live-announcer";/*!
|
|
39
39
|
* This file is based on code from react-spectrum.
|
|
40
40
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
41
41
|
*
|
|
42
42
|
* Credits to the React Spectrum team:
|
|
43
43
|
* https://github.com/adobe/react-spectrum/blob/810579b671791f1593108f62cdc1893de3a220e3/packages/@react-aria/overlays/src/ariaHideOutside.ts
|
|
44
|
-
*/function
|
|
44
|
+
*/function au(e){D(()=>{S(e.isDisabled)||K(lu(S(e.targets),S(e.root)))})}const Vt=new WeakMap,xe=[];function lu(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const h of l.querySelectorAll(`[${su}], [${pn}]`))n.add(h);const c=h=>{if(n.has(h)||h.parentElement&&r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const m of n)if(h.contains(m))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},d=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),u=c(l);if(u===NodeFilter.FILTER_ACCEPT&&i(l),u!==NodeFilter.FILTER_REJECT){let h=d.nextNode();for(;h!=null;)i(h),h=d.nextNode()}},i=l=>{const c=Vt.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Vt.set(l,c+1))};xe.length&&xe[xe.length-1].disconnect(),o(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(d=>d.contains(c.target))){for(const d of c.removedNodes)d instanceof Element&&(n.delete(d),r.delete(d));for(const d of c.addedNodes)(d instanceof HTMLElement||d instanceof SVGElement)&&(d.dataset.liveAnnouncer==="true"||d.dataset.reactAriaTopLayer==="true")?n.add(d):d instanceof Element&&o(d)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return xe.push(a),()=>{s.disconnect();for(const l of r){const c=Vt.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Vt.delete(l)):Vt.set(l,c-1)}a===xe[xe.length-1]?(xe.pop(),xe.length&&xe[xe.length-1].observe()):xe.splice(xe.indexOf(a),1)}}/*!
|
|
45
45
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
46
46
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
47
47
|
*
|
|
@@ -53,38 +53,38 @@
|
|
|
53
53
|
*
|
|
54
54
|
* Credits to the Chakra UI team:
|
|
55
55
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/interact-outside/src/index.ts
|
|
56
|
-
*/const
|
|
56
|
+
*/const Oi="interactOutside.pointerDownOutside",_i="interactOutside.focusOutside";function cu(e,t){let n,r=Uc;const o=()=>je(t()),i=u=>e.onPointerDownOutside?.(u),s=u=>e.onFocusOutside?.(u),a=u=>e.onInteractOutside?.(u),l=u=>{const h=u.target;return!(h instanceof HTMLElement)||h.closest(`[${pn}]`)||!De(o(),h)||De(t(),h)?!1:!e.shouldExcludeElement?.(h)},c=u=>{function h(){const m=t(),f=u.target;if(!m||!f||!l(u))return;const g=we([i,a]);f.addEventListener(Oi,g,{once:!0});const p=new CustomEvent(Oi,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:u.button===2||Lc(u)&&u.button===0}});f.dispatchEvent(p)}u.pointerType==="touch"?(o().removeEventListener("click",h),r=h,o().addEventListener("click",h,{once:!0})):h()},d=u=>{const h=t(),m=u.target;if(!h||!m||!l(u))return;const f=we([s,a]);m.addEventListener(_i,f,{once:!0});const g=new CustomEvent(_i,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:!1}});m.dispatchEvent(g)};D(()=>{S(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",d,!0),K(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",d,!0)}))})}/*!
|
|
57
57
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
58
58
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
59
59
|
*
|
|
60
60
|
* Credits to the Radix UI team:
|
|
61
61
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
|
|
62
62
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
|
|
63
|
-
*/function
|
|
63
|
+
*/function uu(e){const[t,n]=P();let r={},o=e(),i="none";const[s,a]=du(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D(et(s,l=>{const c=mn(r);i=l==="mounted"?c:"none"})),D(et(e,l=>{if(o===l)return;const c=mn(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),D(et(t,l=>{if(l){const c=u=>{const m=mn(r).includes(u.animationName);u.target===l&&m&&a("ANIMATION_END")},d=u=>{u.target===l&&(i=mn(r))};l.addEventListener("animationstart",d),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),K(()=>{l.removeEventListener("animationstart",d),l.removeEventListener("animationcancel",c),l.removeEventListener("animationend",c)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:l=>{l&&(r=getComputedStyle(l)),n(l)}}}function mn(e){return e?.animationName||"none"}function du(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=P(e);return[r,s=>{o(a=>n(a,s))}]}function yn(e){return t=>(e(t),()=>e(void 0))}/*!
|
|
64
64
|
* Portions of this file are based on code from ariakit.
|
|
65
65
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
66
66
|
*
|
|
67
67
|
* Credits to the ariakit team:
|
|
68
68
|
* https://github.com/ariakit/ariakit/blob/8a13899ff807bbf39f3d89d2d5964042ba4d5287/packages/ariakit-react-utils/src/hooks.ts
|
|
69
|
-
*/function
|
|
69
|
+
*/function fu(e,t){const[n,r]=P(Pi(t?.()));return D(()=>{r(e()?.tagName.toLowerCase()||Pi(t?.()))}),n}function Pi(e){return yt(e)?e:void 0}function bn(e){const[t,n]=j(e,["asChild","as","children"]);if(!t.asChild)return y(ln,T({get component(){return t.as}},n,{get children(){return t.children}}));const r=Qn(()=>t.children);if(Ai(r())){const o=Ti(n,r()?.props??{});return y(ln,o)}if(Oc(r())){const o=r().find(Ai);if(o){const i=()=>y(ft,{get each(){return r()},children:a=>y(Z,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Ti(n,o?.props??{});return y(ln,T(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const hu=Symbol("$$KobalteAsComponent");function Ai(e){return e?.[hu]===!0}function Ti(e,t){return Ec([e,t],{reverseEventHandlers:!0})}/*!
|
|
70
70
|
* Portions of this file are based on code from react-spectrum.
|
|
71
71
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
72
72
|
*
|
|
73
73
|
* Credits to the React Spectrum team:
|
|
74
74
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
|
|
75
|
-
*/const
|
|
75
|
+
*/const gu=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),pu=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function mu(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return gu.has(n)}const t=e.split("-")[0];return pu.has(t)}function yu(e){return mu(e)?"rtl":"ltr"}/*!
|
|
76
76
|
* Portions of this file are based on code from react-spectrum.
|
|
77
77
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
78
78
|
*
|
|
79
79
|
* Credits to the React Spectrum team:
|
|
80
80
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
|
|
81
|
-
*/function
|
|
81
|
+
*/function Di(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yu(e)}}let Sr=Di();const Ut=new Set;function Li(){Sr=Di();for(const e of Ut)e(Sr)}function bu(){const[e,t]=P(Sr),n=k(()=>e());return tn(()=>{Ut.size===0&&window.addEventListener("languagechange",Li),Ut.add(t),K(()=>{Ut.delete(t),Ut.size===0&&window.removeEventListener("languagechange",Li)})}),{locale:()=>n().locale,direction:()=>n().direction}}const vu=ce();function Er(){const e=bu();return he(vu)||e}/*!
|
|
82
82
|
* Portions of this file are based on code from react-spectrum.
|
|
83
83
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
84
84
|
*
|
|
85
85
|
* Credits to the React Spectrum team:
|
|
86
86
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
|
|
87
|
-
*/const
|
|
87
|
+
*/const Cr=new Map;function wu(e){const{locale:t}=Er(),n=k(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return k(()=>{const r=n();let o;return Cr.has(r)&&(o=Cr.get(r)),o||(o=new Intl.Collator(t(),e),Cr.set(r,o)),o})}/*!
|
|
88
88
|
* Portions of this file are based on code from react-spectrum.
|
|
89
89
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
90
90
|
*
|
|
@@ -92,79 +92,79 @@
|
|
|
92
92
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
|
|
93
93
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
|
|
94
94
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
|
|
95
|
-
*/class
|
|
95
|
+
*/class Ce extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Ce?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function xu(e){const[t,n]=yr(e);return[()=>t()??new Ce,n]}/*!
|
|
96
96
|
* Portions of this file are based on code from react-spectrum.
|
|
97
97
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
98
98
|
*
|
|
99
99
|
* Credits to the React Spectrum team:
|
|
100
100
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
|
|
101
|
-
*/function
|
|
101
|
+
*/function Mi(e){return Dc()?e.altKey:e.ctrlKey}function bt(e){return hn()?e.metaKey:e.ctrlKey}function Ii(e){return new Ce(e)}function Su(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
|
|
102
102
|
* Portions of this file are based on code from react-spectrum.
|
|
103
103
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
104
104
|
*
|
|
105
105
|
* Credits to the React Spectrum team:
|
|
106
106
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
|
|
107
|
-
*/function
|
|
107
|
+
*/function Eu(e){const t=Le({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=P(!1),[o,i]=P(),s=k(()=>{const g=S(t.selectedKeys);return g!=null?Ii(g):g}),a=k(()=>{const g=S(t.defaultSelectedKeys);return g!=null?Ii(g):new Ce}),[l,c]=xu({value:s,defaultValue:a,onChange:g=>t.onSelectionChange?.(g)}),[d,u]=P(S(t.selectionBehavior)),h=()=>S(t.selectionMode),m=()=>S(t.disallowEmptySelection)??!1,f=g=>{(S(t.allowDuplicateSelectionEvents)||!Su(g,l()))&&c(g)};return D(()=>{const g=l();S(t.selectionBehavior)==="replace"&&d()==="toggle"&&typeof g=="object"&&g.size===0&&u("replace")}),D(()=>{u(S(t.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:m,selectionBehavior:d,setSelectionBehavior:u,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:f}}/*!
|
|
108
108
|
* Portions of this file are based on code from react-spectrum.
|
|
109
109
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
110
110
|
*
|
|
111
111
|
* Credits to the React Spectrum team:
|
|
112
112
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
|
|
113
|
-
*/function
|
|
113
|
+
*/function Cu(e){const[t,n]=P(""),[r,o]=P(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(S(e.isDisabled))return;const a=S(e.keyboardDelegate),l=S(e.selectionManager);if(!a.getKeyForSearch)return;const c=ku(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let d=n(h=>h+c),u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d);u==null&&Ou(d)&&(d=d[0],u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d)),u!=null&&(l.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function ku(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Ou(e){return e.split("").every(t=>t===e[0])}/*!
|
|
114
114
|
* Portions of this file are based on code from react-spectrum.
|
|
115
115
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
116
116
|
*
|
|
117
117
|
* Credits to the React Spectrum team:
|
|
118
118
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
|
|
119
|
-
*/function
|
|
119
|
+
*/function _u(e,t,n){const o=T({selectOnFocus:()=>S(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=Er();let a={top:0,left:0};vc(()=>S(o.isVirtualized)?void 0:i(),"scroll",()=>{const g=i();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=Cu({isDisabled:()=>S(o.disallowTypeAhead),keyboardDelegate:()=>S(o.keyboardDelegate),selectionManager:()=>S(o.selectionManager)}),c=g=>{ge(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const p=t();if(!p?.contains(g.target))return;const b=S(o.selectionManager),v=S(o.selectOnFocus),w=E=>{E!=null&&(b.setFocusedKey(E),g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&!Mi(g)&&b.replaceSelection(E))},x=S(o.keyboardDelegate),O=S(o.shouldFocusWrap),C=b.focusedKey();switch(g.key){case"ArrowDown":{if(x.getKeyBelow){g.preventDefault();let E;C!=null?E=x.getKeyBelow(C):E=x.getFirstKey?.(),E==null&&O&&(E=x.getFirstKey?.(C)),w(E)}break}case"ArrowUp":{if(x.getKeyAbove){g.preventDefault();let E;C!=null?E=x.getKeyAbove(C):E=x.getLastKey?.(),E==null&&O&&(E=x.getLastKey?.(C)),w(E)}break}case"ArrowLeft":{if(x.getKeyLeftOf){g.preventDefault();const E=s()==="rtl";let $;C!=null?$=x.getKeyLeftOf(C):$=E?x.getFirstKey?.():x.getLastKey?.(),w($)}break}case"ArrowRight":{if(x.getKeyRightOf){g.preventDefault();const E=s()==="rtl";let $;C!=null?$=x.getKeyRightOf(C):$=E?x.getLastKey?.():x.getFirstKey?.(),w($)}break}case"Home":if(x.getFirstKey){g.preventDefault();const E=x.getFirstKey(C,bt(g));E!=null&&(b.setFocusedKey(E),bt(g)&&g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&b.replaceSelection(E))}break;case"End":if(x.getLastKey){g.preventDefault();const E=x.getLastKey(C,bt(g));E!=null&&(b.setFocusedKey(E),bt(g)&&g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&b.replaceSelection(E))}break;case"PageDown":if(x.getKeyPageBelow&&C!=null){g.preventDefault();const E=x.getKeyPageBelow(C);w(E)}break;case"PageUp":if(x.getKeyPageAbove&&C!=null){g.preventDefault();const E=x.getKeyPageAbove(C);w(E)}break;case"a":bt(g)&&b.selectionMode()==="multiple"&&S(o.disallowSelectAll)!==!0&&(g.preventDefault(),b.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),S(o.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!S(o.allowsTabNavigation)){if(g.shiftKey)p.focus();else{const E=zc(p,{tabbable:!0});let $,_;do _=E.lastChild(),_&&($=_);while(_);$&&!$.contains(document.activeElement)&&de($)}break}}},d=g=>{const p=S(o.selectionManager),b=S(o.keyboardDelegate),v=S(o.selectOnFocus);if(p.isFocused()){g.currentTarget.contains(g.target)||p.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(p.setFocused(!0),p.focusedKey()==null){const w=O=>{O!=null&&(p.setFocusedKey(O),v&&p.replaceSelection(O))},x=g.relatedTarget;x&&g.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?w(p.lastSelectedKey()??b.getLastKey?.()):w(p.firstSelectedKey()??b.getFirstKey?.())}else if(!S(o.isVirtualized)){const w=i();if(w){w.scrollTop=a.top,w.scrollLeft=a.left;const x=w.querySelector(`[data-key="${p.focusedKey()}"]`);x&&(de(x),pr(w,x))}}}},u=g=>{const p=S(o.selectionManager);g.currentTarget.contains(g.relatedTarget)||p.setFocused(!1)},h=g=>{i()===g.target&&g.preventDefault()},m=()=>{const g=S(o.autoFocus);if(!g)return;const p=S(o.selectionManager),b=S(o.keyboardDelegate);let v;g==="first"&&(v=b.getFirstKey?.()),g==="last"&&(v=b.getLastKey?.());const w=p.selectedKeys();w.size&&(v=w.values().next().value),p.setFocused(!0),p.setFocusedKey(v);const x=t();x&&v==null&&!S(o.shouldUseVirtualFocus)&&de(x)};return tn(()=>{o.deferAutoFocus?setTimeout(m,0):m()}),D(et([i,()=>S(o.isVirtualized),()=>S(o.selectionManager).focusedKey()],g=>{const[p,b,v]=g;if(b)v&&o.scrollToKey?.(v);else if(v&&p){const w=p.querySelector(`[data-key="${v}"]`);w&&pr(p,w)}})),{tabIndex:k(()=>{if(!S(o.shouldUseVirtualFocus))return S(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:u}}/*!
|
|
120
120
|
* Portions of this file are based on code from react-spectrum.
|
|
121
121
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
122
122
|
*
|
|
123
123
|
* Credits to the React Spectrum team:
|
|
124
124
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
|
|
125
|
-
*/function
|
|
125
|
+
*/function Pu(e,t){const n=()=>S(e.selectionManager),r=()=>S(e.key),o=()=>S(e.shouldUseVirtualFocus),i=v=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):v?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||bt(v)||"pointerType"in v&&v.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>S(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const d=v=>{l()&&(c=v.pointerType,v.pointerType==="mouse"&&v.button===0&&!S(e.shouldSelectOnPressUp)&&i(v))},u=v=>{l()&&v.pointerType==="mouse"&&v.button===0&&S(e.shouldSelectOnPressUp)&&S(e.allowsDifferentPressOrigin)&&i(v)},h=v=>{l()&&(S(e.shouldSelectOnPressUp)&&!S(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(v)},m=v=>{!l()||!["Enter"," "].includes(v.key)||(Mi(v)?n().toggleSelection(r()):i(v))},f=v=>{a()&&v.preventDefault()},g=v=>{const w=t();o()||a()||!w||v.target===w&&n().setFocusedKey(r())},p=k(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),b=k(()=>S(e.virtualized)?void 0:r());return D(et([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([v,w,x,O,C])=>{v&&w===O&&C&&!x&&document.activeElement!==v&&(e.focus?e.focus():de(v))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:b,onPointerDown:d,onPointerUp:u,onClick:h,onKeyDown:m,onMouseDown:f,onFocus:g}}/*!
|
|
126
126
|
* Portions of this file are based on code from react-spectrum.
|
|
127
127
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
128
128
|
*
|
|
129
129
|
* Credits to the React Spectrum team:
|
|
130
130
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
|
|
131
|
-
*/class
|
|
131
|
+
*/class Au{collection;state;constructor(t,n){this.collection=t,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}isFocused(){return this.state.isFocused()}setFocused(t){this.state.setFocused(t)}focusedKey(){return this.state.focusedKey()}setFocusedKey(t){(t==null||this.collection().getItem(t))&&this.state.setFocusedKey(t)}selectedKeys(){return this.state.selectedKeys()}isSelected(t){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(t);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const t=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>t.has(n))}firstSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index<t.index;(!t||o)&&(t=r)}return t?.key}lastSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index>t.index;(!t||o)&&(t=r)}return t?.key}extendSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=this.state.selectedKeys(),o=r.anchorKey||n,i=new Ce(r,o,n);for(const s of this.getKeyRange(o,r.currentKey||n))i.delete(s);for(const s of this.getKeyRange(n,o))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(t,n){const r=this.collection().getItem(t),o=this.collection().getItem(n);return r&&o?r.index!=null&&o.index!=null&&r.index<=o.index?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){const r=[];let o=t;for(;o!=null;){const i=this.collection().getItem(o);if(i&&i.type==="item"&&r.push(o),o===n)return r;o=this.collection().getKeyAfter(o)}return[]}getKey(t){const n=this.collection().getItem(t);return n?!n||n.type!=="item"?null:n.key:t}toggleSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=new Ce(this.state.selectedKeys());r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection()&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode()==="none")return;const n=this.getKey(t);if(n==null)return;const r=this.canSelectItem(n)?new Ce([n],n,n):new Ce;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new Ce;for(const r of t){const o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const t=this.state.selectedKeys();!this.disallowEmptySelection()&&t.size>0&&this.state.setSelectedKeys(new Ce)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
|
|
132
132
|
* Portions of this file are based on code from react-spectrum.
|
|
133
133
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
134
134
|
*
|
|
135
135
|
* Credits to the React Spectrum team:
|
|
136
136
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
|
|
137
|
-
*/class
|
|
137
|
+
*/class Ri{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
|
|
138
138
|
* Portions of this file are based on code from react-spectrum.
|
|
139
139
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
140
140
|
*
|
|
141
141
|
* Credits to the React Spectrum team:
|
|
142
142
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
|
|
143
|
-
*/function
|
|
143
|
+
*/function Tu(e){const t=Eu(e),r=Wc({dataSource:()=>S(e.dataSource),getKey:()=>S(e.getKey),getTextValue:()=>S(e.getTextValue),getDisabled:()=>S(e.getDisabled),getSectionChildren:()=>S(e.getSectionChildren),factory:i=>e.filter?new Ri(e.filter(i)):new Ri(i)},[()=>e.filter]),o=new Au(r,t);return Lo(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
|
|
144
144
|
* Portions of this file are based on code from react-spectrum.
|
|
145
145
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
146
146
|
*
|
|
147
147
|
* Credits to the React Spectrum team:
|
|
148
148
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
|
|
149
|
-
*/class
|
|
149
|
+
*/class Du{collection;ref;collator;constructor(t,n,r){this.collection=t,this.ref=n,this.collator=r}getKeyBelow(t){let n=this.collection().getKeyAfter(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(t){let n=this.collection().getKeyBefore(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let t=this.collection().getFirstKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getLastKey(){let t=this.collection().getLastKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getItem(t){return this.ref?.()?.querySelector(`[data-key="${t}"]`)??null}getKeyPageAbove(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=i!=null?this.getItem(i):null;return i}getKeyPageBelow(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=i!=null?this.getItem(i):null;return i}getKeyForSearch(t,n){const r=this.collator?.();if(!r)return;let o=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;o!=null;){const i=this.collection().getItem(o);if(i){const s=i.textValue.slice(0,t.length);if(i.textValue&&r.compare(s,t)===0)return o}o=this.getKeyBelow(o)}}}/*!
|
|
150
150
|
* Portions of this file are based on code from react-spectrum.
|
|
151
151
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
152
152
|
*
|
|
153
153
|
* Credits to the React Spectrum team:
|
|
154
154
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
|
|
155
|
-
*/function
|
|
155
|
+
*/function Lu(e,t,n){const r=wu({usage:"search",sensitivity:"base"}),o=k(()=>{const i=S(e.keyboardDelegate);return i||new Du(e.collection,t,r)});return _u({selectionManager:()=>S(e.selectionManager),keyboardDelegate:o,autoFocus:()=>S(e.autoFocus),deferAutoFocus:()=>S(e.deferAutoFocus),shouldFocusWrap:()=>S(e.shouldFocusWrap),disallowEmptySelection:()=>S(e.disallowEmptySelection),selectOnFocus:()=>S(e.selectOnFocus),disallowTypeAhead:()=>S(e.disallowTypeAhead),shouldUseVirtualFocus:()=>S(e.shouldUseVirtualFocus),allowsTabNavigation:()=>S(e.allowsTabNavigation),isVirtualized:()=>S(e.isVirtualized),scrollToKey:i=>S(e.scrollToKey)?.(i)},t)}/*!
|
|
156
156
|
* Portions of this file are based on code from ariakit
|
|
157
157
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
158
158
|
*
|
|
159
159
|
* Credits to the ariakit team:
|
|
160
160
|
* https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
|
|
161
|
-
*/const
|
|
161
|
+
*/const Mu=["button","color","file","image","reset","submit"];function Iu(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?Mu.indexOf(e.type)!==-1:!1}function Ru(e){let t;const n=Le({type:"button"},e),[r,o]=j(n,["ref","type","disabled"]),i=fu(()=>t,()=>"button"),s=k(()=>{const c=i();return c==null?!1:Iu({tagName:c,type:r.type})}),a=k(()=>i()==="input"),l=k(()=>i()==="a"&&t?.getAttribute("href")!=null);return y(bn,T({as:"button",ref(c){var d=rt(u=>t=u,r.ref);typeof d=="function"&&d(c)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const $i=ce();function Ni(){return he($i)}function $u(){const e=Ni();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
|
|
162
162
|
* Portions of this file are based on code from ariakit.
|
|
163
163
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
164
164
|
*
|
|
165
165
|
* Credits to the Ariakit team:
|
|
166
166
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
167
|
-
*/function
|
|
167
|
+
*/function Fi(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Nu(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&Fi(o,n))return r+1}return 0}function Fu(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),l=s.ref();return a===l||!a||!l?0:Fi(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Ki(e,t){const n=Fu(e);e!==n&&t(n)}function Ku(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return je(r).body}function Bu(e,t){D(()=>{const n=setTimeout(()=>{Ki(e(),t)});K(()=>clearTimeout(n))})}function zu(e,t){if(typeof IntersectionObserver!="function"){Bu(e,t);return}let n=[];D(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Ki(e(),t)},o=Ku(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}K(()=>i.disconnect())})}/*!
|
|
168
168
|
* Portions of this file are based on code from ariakit.
|
|
169
169
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
170
170
|
*
|
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
|
|
173
173
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
174
174
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
|
|
175
|
-
*/function Au(e={}){const[t,n]=$c({value:()=>E(e.items),onChange:i=>e.onItemsChange?.(i)});_u(t,n);const r=i=>(n(s=>{const a=ku(s,i);return uc(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>p(Ci.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Tu(e){const t=Eu(),n=Oe({shouldRegisterItem:!0},e);D(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());N(r)})}var K=e=>typeof e=="function"?e():e,Ai=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),mn=new Map,Mu=e=>{D(()=>{const t=K(e.style)??{},n=K(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=mn.get(e.key);o?o.activeCount++:mn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);N(()=>{const i=mn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}mn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},wr=Mu,Du=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Lu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Ti=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,u]=Du(o,t),d=u-l-r*c;(c!==0||d!==0)&&Lu(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o.parentElement}while(o&&!a);return[i,s]},[Mi,Di]=P([]),Iu=e=>Mi().indexOf(e)===Mi().length-1,Ru=e=>{const t=M({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!1},e),n=ke();let r=[0,0],o=null,i=null;D(()=>{K(t.enabled)&&(Di(c=>[...c,n]),N(()=>{Di(c=>c.filter(u=>u!==n))}))}),D(()=>{if(!K(t.enabled)||!K(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(wr({key:"prevent-scroll-overflow",element:c,style:{overflow:"hidden"}}),K(t.preventScrollbarShift)){const d={},h=[];u>0&&(K(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,h.push({key:"--scrollbar-width",value:`${u}px`}));const m=window.scrollY,f=window.scrollX;wr({key:"prevent-scroll-scrollbar",element:c,style:d,properties:h,cleanup:()=>{u>0&&window.scrollTo(f,m)}})}}),D(()=>{!Iu(n)||!K(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),N(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Li(c),o=null,i=null},a=c=>{const u=c.target,d=K(t.element),h=$u(c),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=m==="x"?h[0]:h[1],g=Ii(u,m,f,d);let y;d&&d.contains(u)?y=!g:y=g,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=K(t.element),d=c.target;let h;if(c.touches.length===2)h=!K(t.allowPinchZoom);else{if(o==null||i===null){const m=Li(c).map((g,y)=>r[y]-g),f=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=f,i=f==="x"?m[0]:m[1]}if(d.type==="range")h=!1;else{const m=Ii(d,o,i,u);u&&u.contains(d)?h=!m:h=m}}h&&c.cancelable&&c.preventDefault()}},$u=e=>[e.deltaX,e.deltaY],Li=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Ii=(e,t,n,r)=>{const o=r&&r.contains(e),[i,s]=Ti(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Fu=Ru,Ri=Fu;const $i=ie();function Nu(){return ce($i)}function Ku(e){let t;const n=Nu(),[r,o]=j(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const h=n?.registerNestedLayer(d);return()=>{i.delete(d),h?.()}};Xc({shouldExcludeElement:d=>t?r.excludedElements?.some(h=>Ce(h(),d))||[...i].some(h=>Ce(h,d)):!1,onPointerDownOutside:d=>{!t||de.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!de.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),Fc({ownerDocument:()=>$e(t),onEscapeKeyDown:d=>{!t||!de.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Wt(()=>{if(!t)return;de.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);de.assignPointerEventToLayers(),de.disableBodyPointerEvents(t),N(()=>{t&&(de.removeLayer(t),d?.(),de.assignPointerEventToLayers(),de.restoreBodyPointerEvents(t))})}),D(Xe([()=>t,()=>r.disableOutsidePointerEvents],([d,h])=>{if(!d)return;const m=de.find(d);m&&m.isPointerBlocking!==h&&(m.isPointerBlocking=h,de.assignPointerEventToLayers()),h&&de.disableBodyPointerEvents(d),N(()=>{de.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return p($i.Provider,{value:u,get children(){return p(pn,M({as:"div",ref(d){var h=Qe(m=>t=m,r.ref);typeof h=="function"&&h(d)}},o))}})}const Fi=ie();function Bu(){const e=ce(Fi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function zu(e){const t=Bu(),[n,r]=j(e,["ref","style"]);return p(pn,M({as:"div",ref(o){var i=Qe(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const Vu=["top","right","bottom","left"],je=Math.min,fe=Math.max,yn=Math.round,bn=Math.floor,qe=e=>({x:e,y:e}),Uu={left:"right",right:"left",bottom:"top",top:"bottom"},ju={start:"end",end:"start"};function vr(e,t,n){return fe(e,je(t,n))}function et(e,t){return typeof e=="function"?e(t):e}function He(e){return e.split("-")[0]}function pt(e){return e.split("-")[1]}function Ni(e){return e==="x"?"y":"x"}function xr(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(He(e))?"y":"x"}function Sr(e){return Ni($t(e))}function qu(e,t,n){n===void 0&&(n=!1);const r=pt(e),o=Sr(e),i=xr(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wn(s)),[s,wn(s)]}function Hu(e){const t=wn(e);return[Er(e),t,Er(t)]}function Er(e){return e.replace(/start|end/g,t=>ju[t])}function Wu(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Gu(e,t,n,r){const o=pt(e);let i=Wu(He(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Er)))),i}function wn(e){return e.replace(/left|right|bottom|top/g,t=>Uu[t])}function Yu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ki(e){return typeof e!="number"?Yu(e):{top:e,right:e,bottom:e,left:e}}function vn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Bi(e,t,n){let{reference:r,floating:o}=e;const i=$t(t),s=Sr(t),a=xr(s),l=He(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-o.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(pt(t)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const Xu=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Bi(c,r,l),h=r,m={},f=0;for(let g=0;g<a.length;g++){const{name:y,fn:w}=a[g],{x:b,y:v,data:x,reset:A}=await w({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=b??u,d=v??d,m={...m,[y]:{...m[y],...x}},A&&f<=50&&(f++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(c=A.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:u,y:d}=Bi(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:m}};async function Ft(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=et(t,e),f=Ki(m),y=a[h?d==="floating"?"reference":"floating":d],w=vn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...s.floating,x:r,y:o}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},A=vn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:v,strategy:l}):b);return{top:(w.top-A.top+f.top)/x.y,bottom:(A.bottom-w.bottom+f.bottom)/x.y,left:(w.left-A.left+f.left)/x.x,right:(A.right-w.right+f.right)/x.x}}const Ju=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=et(e,t)||{};if(c==null)return{};const d=Ki(u),h={x:n,y:r},m=Sr(o),f=xr(m),g=await s.getDimensions(c),y=m==="y",w=y?"top":"left",b=y?"bottom":"right",v=y?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[m]-h[m]-i.floating[f],A=h[m]-i.reference[m],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=S?S[v]:0;(!k||!await(s.isElement==null?void 0:s.isElement(S)))&&(k=a.floating[v]||i.floating[f]);const T=x/2-A/2,C=k/2-g[f]/2-1,F=je(d[w],C),z=je(d[b],C),R=F,re=k-g[f]-z,X=k/2-g[f]/2+T,ee=vr(R,X,re),I=!l.arrow&&pt(o)!=null&&X!==ee&&i.reference[f]/2-(X<R?F:z)-g[f]/2<0,V=I?X<R?X-R:X-re:0;return{[m]:h[m]+V,data:{[m]:ee,centerOffset:X-ee-V,...I&&{alignmentOffset:V}},reset:I}}}),Zu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...y}=et(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=He(o),b=He(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=h||(b||!g?[wn(a)]:Hu(a));!h&&f!=="none"&&x.push(...Gu(a,g,f,v));const A=[a,...x],S=await Ft(t,y),k=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(S[w]),d){const R=qu(o,s,v);k.push(S[R[0]],S[R[1]])}if(T=[...T,{placement:o,overflows:k}],!k.every(R=>R<=0)){var C,F;const R=(((C=i.flip)==null?void 0:C.index)||0)+1,re=A[R];if(re)return{data:{index:R,overflows:T},reset:{placement:re}};let X=(F=T.filter(ee=>ee.overflows[0]<=0).sort((ee,I)=>ee.overflows[1]-I.overflows[1])[0])==null?void 0:F.placement;if(!X)switch(m){case"bestFit":{var z;const ee=(z=T.map(I=>[I.placement,I.overflows.filter(V=>V>0).reduce((V,oe)=>V+oe,0)]).sort((I,V)=>I[1]-V[1])[0])==null?void 0:z[0];ee&&(X=ee);break}case"initialPlacement":X=a;break}if(o!==X)return{reset:{placement:X}}}return{}}}};function zi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vi(e){return Vu.some(t=>e[t]>=0)}const Qu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=et(e,t);switch(r){case"referenceHidden":{const i=await Ft(t,{...o,elementContext:"reference"}),s=zi(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Vi(s)}}}case"escaped":{const i=await Ft(t,{...o,altBoundary:!0}),s=zi(i,n.floating);return{data:{escapedOffsets:s,escaped:Vi(s)}}}default:return{}}}}};async function ed(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=He(n),a=pt(n),l=$t(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=et(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const td=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await ed(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},nd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:w,y:b}=y;return{x:w,y:b}}},...l}=et(e,t),c={x:n,y:r},u=await Ft(t,l),d=$t(He(o)),h=Ni(d);let m=c[h],f=c[d];if(i){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=m+u[y],v=m-u[w];m=vr(b,m,v)}if(s){const y=d==="y"?"top":"left",w=d==="y"?"bottom":"right",b=f+u[y],v=f-u[w];f=vr(b,f,v)}const g=a.fn({...t,[h]:m,[d]:f});return{...g,data:{x:g.x-n,y:g.y-r}}}}},rd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=et(e,t),l=await Ft(t,a),c=He(n),u=pt(n),d=$t(n)==="y",{width:h,height:m}=r.floating;let f,g;c==="top"||c==="bottom"?(f=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,f=u==="end"?"top":"bottom");const y=m-l[f],w=h-l[g],b=!t.middlewareData.shift;let v=y,x=w;if(d){const S=h-l.left-l.right;x=u||b?je(w,S):S}else{const S=m-l.top-l.bottom;v=u||b?je(y,S):S}if(b&&!u){const S=fe(l.left,0),k=fe(l.right,0),T=fe(l.top,0),C=fe(l.bottom,0);d?x=h-2*(S!==0||k!==0?S+k:fe(l.left,l.right)):v=m-2*(T!==0||C!==0?T+C:fe(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:v});const A=await o.getDimensions(i.floating);return h!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function We(e){return Ui(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ne(e){var t;return(t=(Ui(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ui(e){return e instanceof Node||e instanceof he(e).Node}function Ke(e){return e instanceof Element||e instanceof he(e).Element}function Pe(e){return e instanceof HTMLElement||e instanceof he(e).HTMLElement}function ji(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}function Nt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=we(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function od(e){return["table","td","th"].includes(We(e))}function kr(e){const t=Cr(),n=we(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function id(e){let t=mt(e);for(;Pe(t)&&!xn(t);){if(kr(t))return t;t=mt(t)}return null}function Cr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xn(e){return["html","body","#document"].includes(We(e))}function we(e){return he(e).getComputedStyle(e)}function Sn(e){return Ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function mt(e){if(We(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ji(e)&&e.host||Ne(e);return ji(t)?t.host:t}function qi(e){const t=mt(e);return xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&Nt(t)?t:qi(t)}function Kt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=qi(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=he(o);return i?t.concat(s,s.visualViewport||[],Nt(o)?o:[],s.frameElement&&n?Kt(s.frameElement):[]):t.concat(o,Kt(o,[],n))}function Hi(e){const t=we(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pe(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=yn(n)!==i||yn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Or(e){return Ke(e)?e:e.contextElement}function yt(e){const t=Or(e);if(!Pe(t))return qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Hi(t);let s=(i?yn(n.width):n.width)/r,a=(i?yn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const sd=qe(0);function Wi(e){const t=he(e);return!Cr()||!t.visualViewport?sd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ad(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==he(e)?!1:t}function tt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Or(e);let s=qe(1);t&&(r?Ke(r)&&(s=yt(r)):s=yt(e));const a=ad(i,n,r)?Wi(i):qe(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=he(i),m=r&&Ke(r)?he(r):r;let f=h,g=f.frameElement;for(;g&&r&&m!==f;){const y=yt(g),w=g.getBoundingClientRect(),b=we(g),v=w.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,x=w.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=v,c+=x,f=he(g),g=f.frameElement}}return vn({width:u,height:d,x:l,y:c})}const ld=[":popover-open",":modal"];function Gi(e){return ld.some(t=>{try{return e.matches(t)}catch{return!1}})}function cd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ne(r),a=t?Gi(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=qe(1);const u=qe(0),d=Pe(r);if((d||!d&&!i)&&((We(r)!=="body"||Nt(s))&&(l=Sn(r)),Pe(r))){const h=tt(r);c=yt(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function ud(e){return Array.from(e.getClientRects())}function Yi(e){return tt(Ne(e)).left+Sn(e).scrollLeft}function dd(e){const t=Ne(e),n=Sn(e),r=e.ownerDocument.body,o=fe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=fe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Yi(e);const a=-n.scrollTop;return we(r).direction==="rtl"&&(s+=fe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function fd(e,t){const n=he(e),r=Ne(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Cr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function hd(e,t){const n=tt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pe(e)?yt(e):qe(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Xi(e,t,n){let r;if(t==="viewport")r=fd(e,n);else if(t==="document")r=dd(Ne(e));else if(Ke(t))r=hd(t,n);else{const o=Wi(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return vn(r)}function Ji(e,t){const n=mt(e);return n===t||!Ke(n)||xn(n)?!1:we(n).position==="fixed"||Ji(n,t)}function gd(e,t){const n=t.get(e);if(n)return n;let r=Kt(e,[],!1).filter(a=>Ke(a)&&We(a)!=="body"),o=null;const i=we(e).position==="fixed";let s=i?mt(e):e;for(;Ke(s)&&!xn(s);){const a=we(s),l=kr(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Nt(s)&&!l&&Ji(e,s))?r=r.filter(u=>u!==s):o=a,s=mt(s)}return t.set(e,r),r}function pd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?gd(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Xi(t,u,o);return c.top=fe(d.top,c.top),c.right=je(d.right,c.right),c.bottom=je(d.bottom,c.bottom),c.left=fe(d.left,c.left),c},Xi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function md(e){const{width:t,height:n}=Hi(e);return{width:t,height:n}}function yd(e,t,n){const r=Pe(t),o=Ne(t),i=n==="fixed",s=tt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=qe(0);if(r||!r&&!i)if((We(t)!=="body"||Nt(o))&&(a=Sn(t)),r){const d=tt(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Yi(o));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function Zi(e,t){return!Pe(e)||we(e).position==="fixed"?null:t?t(e):e.offsetParent}function Qi(e,t){const n=he(e);if(!Pe(e)||Gi(e))return n;let r=Zi(e,t);for(;r&&od(r)&&we(r).position==="static";)r=Zi(r,t);return r&&(We(r)==="html"||We(r)==="body"&&we(r).position==="static"&&!kr(r))?n:r||id(e)||n}const bd=async function(e){const t=this.getOffsetParent||Qi,n=this.getDimensions;return{reference:yd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function wd(e){return we(e).direction==="rtl"}const es={convertOffsetParentRelativeRectToViewportRelativeRect:cd,getDocumentElement:Ne,getClippingRect:pd,getOffsetParent:Qi,getElementRects:bd,getClientRects:ud,getDimensions:md,getScale:yt,isElement:Ke,isRTL:wd};function vd(e,t){let n=null,r;const o=Ne(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const m=bn(u),f=bn(o.clientWidth-(c+d)),g=bn(o.clientHeight-(u+h)),y=bn(c),b={rootMargin:-m+"px "+-f+"px "+-g+"px "+-y+"px",threshold:fe(0,je(1,l))||1};let v=!0;function x(A){const S=A[0].intersectionRatio;if(S!==l){if(!v)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function xd(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Or(e),u=o||i?[...c?Kt(c):[],...Kt(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&a?vd(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?tt(e):null;l&&y();function y(){const w=tt(e);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&n(),g=w,f=requestAnimationFrame(y)}return n(),()=>{var w;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(w=m)==null||w.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const Sd=nd,Ed=Zu,kd=rd,Cd=Qu,Od=Ju,Pd=(e,t,n)=>{const r=new Map,o={platform:es,...n},i={...o.platform,_c:r};return Xu(e,t,{...o,platform:i})};function ts(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function _d(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?ts(r):e?e.getBoundingClientRect():ts()}}}function Ad(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const Td={top:"bottom",right:"left",bottom:"top",left:"right"};function Md(e,t){const[n,r]=e.split("-"),o=Td[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function Dd(e){const t=Oe({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=P(),[o,i]=P(),[s,a]=P(t.placement),l=()=>_d(t.anchorRef(),t.getAnchorRect),{direction:c}=yr();async function u(){const h=l(),m=n(),f=o();if(!h||!m)return;const g=(f?.clientHeight||0)/2,y=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const w=[td(({placement:S})=>{const k=!!S.split("-")[1];return{mainAxis:y,crossAxis:k?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const S=typeof t.flip=="string"?t.flip.split(" "):void 0;if(S!==void 0&&!S.every(Ad))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(Ed({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&w.push(Sd({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(kd({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:k,rects:T}){const C=Math.round(T.reference.width);S=Math.floor(S),k=Math.floor(k),m.style.setProperty("--kb-popper-anchor-width",`${C}px`),m.style.setProperty("--kb-popper-content-available-width",`${S}px`),m.style.setProperty("--kb-popper-content-available-height",`${k}px`),t.sameWidth&&(m.style.width=`${C}px`),t.fitViewport&&(m.style.maxWidth=`${S}px`,m.style.maxHeight=`${k}px`)}})),t.hideWhenDetached&&w.push(Cd({padding:t.detachedPadding})),f&&w.push(Od({element:f,padding:t.arrowPadding}));const b=await Pd(h,m,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...es,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",Md(b.placement,c()));const v=Math.round(b.x),x=Math.round(b.y);let A;if(t.hideWhenDetached&&(A=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${v}px, ${x}px, 0)`,visibility:A}),f&&b.middlewareData.arrow){const{x:S,y:k}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:k!=null?`${k}px`:"",[T]:"100%"})}}D(()=>{const h=l(),m=n();if(!h||!m)return;const f=xd(h,m,u,{elementResize:typeof ResizeObserver=="function"});N(f)}),D(()=>{const h=n(),m=t.contentRef();!h||!m||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(m).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return p(Fi.Provider,{value:d,get children(){return t.children}})}const ns=ie();function rs(){return ce(ns)}function bt(){const e=rs();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const os=ie();function wt(){const e=ce(os);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
175
|
+
*/function Vu(e={}){const[t,n]=Yc({value:()=>S(e.items),onChange:i=>e.onItemsChange?.(i)});zu(t,n);const r=i=>(n(s=>{const a=Nu(s,i);return Cc(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>y($i.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Uu(e){const t=$u(),n=Le({shouldRegisterItem:!0},e);D(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());K(r)})}var J=e=>typeof e=="function"?e():e,kr=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Or=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},vn=new Map,ju=e=>{D(()=>{const t=J(e.style)??{},n=J(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=vn.get(e.key);o?o.activeCount++:vn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=vn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}vn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Bi=ju,Hu=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},qu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Wu=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=Hu(o,t),u=d-l-r*c;(c!==0||u!==0)&&qu(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[zi,Vi]=P([]),Gu=e=>zi().indexOf(e)===zi().length-1,Yu=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ae();let r=[0,0],o=null,i=null;D(()=>{J(t.enabled)&&(Vi(c=>[...c,n]),K(()=>{Vi(c=>c.filter(d=>d!==n))}))}),D(()=>{if(!J(t.enabled)||!J(t.hideScrollbar))return;const{body:c}=document,d=window.innerWidth-c.offsetWidth;if(J(t.preventScrollbarShift)){const u={overflow:"hidden"},h=[];d>0&&(J(t.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${d}px)`,h.push({key:"--scrollbar-width",value:`${d}px`}));const m=window.scrollY,f=window.scrollX;Bi({key:"prevent-scroll",element:c,style:u,properties:h,cleanup:()=>{J(t.restoreScrollPosition)&&d>0&&window.scrollTo(f,m)}})}else Bi({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),D(()=>{!Gu(n)||!J(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),K(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Ui(c),o=null,i=null},a=c=>{const d=c.target,u=J(t.element),h=Xu(c),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=m==="x"?h[0]:h[1],g=ji(d,m,f,u);let p;u&&Or(u,d)?p=!g:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const d=J(t.element),u=c.target;let h;if(c.touches.length===2)h=!J(t.allowPinchZoom);else{if(o==null||i===null){const m=Ui(c).map((g,p)=>r[p]-g),f=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=f,i=f==="x"?m[0]:m[1]}if(u.type==="range")h=!1;else{const m=ji(u,o,i,d);d&&Or(d,u)?h=!m:h=!0}}h&&c.cancelable&&c.preventDefault()}},Xu=e=>[e.deltaX,e.deltaY],Ui=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ji=(e,t,n,r)=>{const o=r!==null&&Or(r,e),[i,s]=Wu(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Ju=Yu,Hi=Ju;const qi=ce();function Zu(){return he(qi)}function Qu(e){let t;const n=Zu(),[r,o]=j(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=u=>{i.add(u);const h=n?.registerNestedLayer(u);return()=>{i.delete(u),h?.()}};cu({shouldExcludeElement:u=>t?r.excludedElements?.some(h=>De(h(),u))||[...i].some(h=>De(h,u)):!1,onPointerDownOutside:u=>{!t||pe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!pe.isTopMostLayer(t)||(r.onPointerDownOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.())},onFocusOutside:u=>{r.onFocusOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.()}},()=>t),Xc({ownerDocument:()=>je(t),onEscapeKeyDown:u=>{!t||!pe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(u),!u.defaultPrevented&&r.onDismiss&&(u.preventDefault(),r.onDismiss()))}}),tn(()=>{if(!t)return;pe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const u=n?.registerNestedLayer(t);pe.assignPointerEventToLayers(),pe.disableBodyPointerEvents(t),K(()=>{t&&(pe.removeLayer(t),u?.(),pe.assignPointerEventToLayers(),pe.restoreBodyPointerEvents(t))})}),D(et([()=>t,()=>r.disableOutsidePointerEvents],([u,h])=>{if(!u)return;const m=pe.find(u);m&&m.isPointerBlocking!==h&&(m.isPointerBlocking=h,pe.assignPointerEventToLayers()),h&&pe.disableBodyPointerEvents(u),K(()=>{pe.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:s};return y(qi.Provider,{value:d,get children(){return y(bn,T({as:"div",ref(u){var h=rt(m=>t=m,r.ref);typeof h=="function"&&h(u)}},o))}})}const Wi=ce();function ed(){const e=he(Wi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function td(e){const t=ed(),[n,r]=j(e,["ref","style"]);return y(bn,T({as:"div",ref(o){var i=rt(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const nd=["top","right","bottom","left"],Ye=Math.min,me=Math.max,wn=Math.round,xn=Math.floor,Me=e=>({x:e,y:e}),rd={left:"right",right:"left",bottom:"top",top:"bottom"},od={start:"end",end:"start"};function _r(e,t,n){return me(e,Ye(t,n))}function ot(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function Gi(e){return e==="x"?"y":"x"}function Pr(e){return e==="y"?"height":"width"}function it(e){return["top","bottom"].includes(Xe(e))?"y":"x"}function Ar(e){return Gi(it(e))}function id(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=Ar(e),i=Pr(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Sn(s)),[s,Sn(s)]}function sd(e){const t=Sn(e);return[Tr(e),t,Tr(t)]}function Tr(e){return e.replace(/start|end/g,t=>od[t])}function ad(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function ld(e,t,n,r){const o=vt(e);let i=ad(Xe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Tr)))),i}function Sn(e){return e.replace(/left|right|bottom|top/g,t=>rd[t])}function cd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yi(e){return typeof e!="number"?cd(e):{top:e,right:e,bottom:e,left:e}}function En(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xi(e,t,n){let{reference:r,floating:o}=e;const i=it(t),s=Ar(t),a=Pr(s),l=Xe(t),c=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-o.width,y:u};break;default:m={x:r.x,y:r.y}}switch(vt(t)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const ud=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Xi(c,r,l),h=r,m={},f=0;for(let g=0;g<a.length;g++){const{name:p,fn:b}=a[g],{x:v,y:w,data:x,reset:O}=await b({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});d=v??d,u=w??u,m={...m,[p]:{...m[p],...x}},O&&f<=50&&(f++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:u}=Xi(c,h,l)),g=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:m}};async function jt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=ot(t,e),f=Yi(m),p=a[h?u==="floating"?"reference":"floating":u],b=En(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(p)))==null||n?p:p.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},O=En(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(b.top-O.top+f.top)/x.y,bottom:(O.bottom-b.bottom+f.bottom)/x.y,left:(b.left-O.left+f.left)/x.x,right:(O.right-b.right+f.right)/x.x}}const dd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ot(e,t)||{};if(c==null)return{};const u=Yi(d),h={x:n,y:r},m=Ar(o),f=Pr(m),g=await s.getDimensions(c),p=m==="y",b=p?"top":"left",v=p?"bottom":"right",w=p?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[m]-h[m]-i.floating[f],O=h[m]-i.reference[m],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=C?C[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(C)))&&(E=a.floating[w]||i.floating[f]);const $=x/2-O/2,_=E/2-g[f]/2-1,R=Ye(u[b],_),L=Ye(u[v],_),I=R,te=E-g[f]-L,Y=E/2-g[f]/2+$,fe=_r(I,Y,te),N=!l.arrow&&vt(o)!=null&&Y!==fe&&i.reference[f]/2-(Y<I?R:L)-g[f]/2<0,V=N?Y<I?Y-I:Y-te:0;return{[m]:h[m]+V,data:{[m]:fe,centerOffset:Y-fe-V,...N&&{alignmentOffset:V}},reset:N}}}),fd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...p}=ot(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Xe(o),v=it(a),w=Xe(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=h||(w||!g?[Sn(a)]:sd(a)),C=f!=="none";!h&&C&&O.push(...ld(a,g,f,x));const E=[a,...O],$=await jt(t,p),_=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push($[b]),u){const Y=id(o,s,x);_.push($[Y[0]],$[Y[1]])}if(R=[...R,{placement:o,overflows:_}],!_.every(Y=>Y<=0)){var L,I;const Y=(((L=i.flip)==null?void 0:L.index)||0)+1,fe=E[Y];if(fe)return{data:{index:Y,overflows:R},reset:{placement:fe}};let N=(I=R.filter(V=>V.overflows[0]<=0).sort((V,Q)=>V.overflows[1]-Q.overflows[1])[0])==null?void 0:I.placement;if(!N)switch(m){case"bestFit":{var te;const V=(te=R.filter(Q=>{if(C){const ie=it(Q.placement);return ie===v||ie==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(ie=>ie>0).reduce((ie,At)=>ie+At,0)]).sort((Q,ie)=>Q[1]-ie[1])[0])==null?void 0:te[0];V&&(N=V);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function Ji(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zi(e){return nd.some(t=>e[t]>=0)}const hd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ot(e,t);switch(r){case"referenceHidden":{const i=await jt(t,{...o,elementContext:"reference"}),s=Ji(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Zi(s)}}}case"escaped":{const i=await jt(t,{...o,altBoundary:!0}),s=Ji(i,n.floating);return{data:{escapedOffsets:s,escaped:Zi(s)}}}default:return{}}}}};async function gd(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xe(n),a=vt(n),l=it(n)==="y",c=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,u=ot(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*d,y:h*c}:{x:h*c,y:m*d}}const pd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await gd(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},md=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:p=>{let{x:b,y:v}=p;return{x:b,y:v}}},...l}=ot(e,t),c={x:n,y:r},d=await jt(t,l),u=it(Xe(o)),h=Gi(u);let m=c[h],f=c[u];if(i){const p=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=m+d[p],w=m-d[b];m=_r(v,m,w)}if(s){const p=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=f+d[p],w=f-d[b];f=_r(v,f,w)}const g=a.fn({...t,[h]:m,[u]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[u]:s}}}}}},yd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ot(e,t),d=await jt(t,c),u=Xe(o),h=vt(o),m=it(o)==="y",{width:f,height:g}=i.floating;let p,b;u==="top"||u==="bottom"?(p=u,b=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,p=h==="end"?"top":"bottom");const v=g-d.top-d.bottom,w=f-d.left-d.right,x=Ye(g-d[p],v),O=Ye(f-d[b],w),C=!t.middlewareData.shift;let E=x,$=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=v),C&&!h){const R=me(d.left,0),L=me(d.right,0),I=me(d.top,0),te=me(d.bottom,0);m?$=f-2*(R!==0||L!==0?R+L:me(d.left,d.right)):E=g-2*(I!==0||te!==0?I+te:me(d.top,d.bottom))}await l({...t,availableWidth:$,availableHeight:E});const _=await s.getDimensions(a.floating);return f!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function Cn(){return typeof window<"u"}function wt(e){return Qi(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Qi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qi(e){return Cn()?e instanceof Node||e instanceof ye(e).Node:!1}function ke(e){return Cn()?e instanceof Element||e instanceof ye(e).Element:!1}function Re(e){return Cn()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function es(e){return!Cn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function Ht(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function bd(e){return["table","td","th"].includes(wt(e))}function kn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Dr(e){const t=Lr(),n=ke(e)?Oe(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vd(e){let t=Je(e);for(;Re(t)&&!xt(t);){if(Dr(t))return t;if(kn(t))return null;t=Je(t)}return null}function Lr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xt(e){return["html","body","#document"].includes(wt(e))}function Oe(e){return ye(e).getComputedStyle(e)}function On(e){return ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||es(e)&&e.host||Ie(e);return es(t)?t.host:t}function ts(e){const t=Je(e);return xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&Ht(t)?t:ts(t)}function qt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ts(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ye(o);if(i){const a=Mr(s);return t.concat(s,s.visualViewport||[],Ht(o)?o:[],a&&n?qt(a):[])}return t.concat(o,qt(o,[],n))}function Mr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ns(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=wn(n)!==i||wn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ir(e){return ke(e)?e:e.contextElement}function St(e){const t=Ir(e);if(!Re(t))return Me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ns(t);let s=(i?wn(n.width):n.width)/r,a=(i?wn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const wd=Me(0);function rs(e){const t=ye(e);return!Lr()||!t.visualViewport?wd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ye(e)?!1:t}function st(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ir(e);let s=Me(1);t&&(r?ke(r)&&(s=St(r)):s=St(e));const a=xd(i,n,r)?rs(i):Me(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const h=ye(i),m=r&&ke(r)?ye(r):r;let f=h,g=Mr(f);for(;g&&r&&m!==f;){const p=St(g),b=g.getBoundingClientRect(),v=Oe(g),w=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*p.x,x=b.top+(g.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,c*=p.y,d*=p.x,u*=p.y,l+=w,c+=x,f=ye(g),g=Mr(f)}}return En({width:d,height:u,x:l,y:c})}function Rr(e,t){const n=On(e).scrollLeft;return t?t.left+n:st(Ie(e)).left+n}function os(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Rr(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Sd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ie(r),a=t?kn(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Me(1);const d=Me(0),u=Re(r);if((u||!u&&!i)&&((wt(r)!=="body"||Ht(s))&&(l=On(r)),Re(r))){const m=st(r);c=St(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=s&&!u&&!i?os(s,l,!0):Me(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Ed(e){return Array.from(e.getClientRects())}function Cd(e){const t=Ie(e),n=On(e),r=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Rr(e);const a=-n.scrollTop;return Oe(r).direction==="rtl"&&(s+=me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function kd(e,t){const n=ye(e),r=Ie(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Lr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Od(e,t){const n=st(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Re(e)?St(e):Me(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function is(e,t,n){let r;if(t==="viewport")r=kd(e,n);else if(t==="document")r=Cd(Ie(e));else if(ke(t))r=Od(t,n);else{const o=rs(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return En(r)}function ss(e,t){const n=Je(e);return n===t||!ke(n)||xt(n)?!1:Oe(n).position==="fixed"||ss(n,t)}function _d(e,t){const n=t.get(e);if(n)return n;let r=qt(e,[],!1).filter(a=>ke(a)&&wt(a)!=="body"),o=null;const i=Oe(e).position==="fixed";let s=i?Je(e):e;for(;ke(s)&&!xt(s);){const a=Oe(s),l=Dr(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ht(s)&&!l&&ss(e,s))?r=r.filter(d=>d!==s):o=a,s=Je(s)}return t.set(e,r),r}function Pd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?kn(t)?[]:_d(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const u=is(t,d,o);return c.top=me(u.top,c.top),c.right=Ye(u.right,c.right),c.bottom=Ye(u.bottom,c.bottom),c.left=me(u.left,c.left),c},is(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ad(e){const{width:t,height:n}=ns(e);return{width:t,height:n}}function Td(e,t,n){const r=Re(t),o=Ie(t),i=n==="fixed",s=st(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Me(0);if(r||!r&&!i)if((wt(t)!=="body"||Ht(o))&&(a=On(t)),r){const h=st(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=Rr(o));const c=o&&!r&&!i?os(o,a):Me(0),d=s.left+a.scrollLeft-l.x-c.x,u=s.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:s.width,height:s.height}}function $r(e){return Oe(e).position==="static"}function as(e,t){if(!Re(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function ls(e,t){const n=ye(e);if(kn(e))return n;if(!Re(e)){let o=Je(e);for(;o&&!xt(o);){if(ke(o)&&!$r(o))return o;o=Je(o)}return n}let r=as(e,t);for(;r&&bd(r)&&$r(r);)r=as(r,t);return r&&xt(r)&&$r(r)&&!Dr(r)?n:r||vd(e)||n}const Dd=async function(e){const t=this.getOffsetParent||ls,n=this.getDimensions,r=await n(e.floating);return{reference:Td(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ld(e){return Oe(e).direction==="rtl"}const cs={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:Ie,getClippingRect:Pd,getOffsetParent:ls,getElementRects:Dd,getClientRects:Ed,getDimensions:Ad,getScale:St,isElement:ke,isRTL:Ld};function us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Md(e,t){let n=null,r;const o=Ie(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:m}=c;if(a||t(),!h||!m)return;const f=xn(u),g=xn(o.clientWidth-(d+h)),p=xn(o.clientHeight-(u+m)),b=xn(d),w={rootMargin:-f+"px "+-g+"px "+-p+"px "+-b+"px",threshold:me(0,Ye(1,l))||1};let x=!0;function O(C){const E=C[0].intersectionRatio;if(E!==l){if(!x)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!us(c,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(O,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(e)}return s(!0),i}function Id(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ir(e),d=o||i?[...c?qt(c):[],...qt(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const u=c&&a?Md(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?st(e):null;l&&p();function p(){const b=st(e);g&&!us(g,b)&&n(),g=b,f=requestAnimationFrame(p)}return n(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),u?.(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const Rd=pd,$d=md,Nd=fd,Fd=yd,Kd=hd,Bd=dd,zd=(e,t,n)=>{const r=new Map,o={platform:cs,...n},i={...o.platform,_c:r};return ud(e,t,{...o,platform:i})};function ds(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function Vd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?ds(r):e?e.getBoundingClientRect():ds()}}}function Ud(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const jd={top:"bottom",right:"left",bottom:"top",left:"right"};function Hd(e,t){const[n,r]=e.split("-"),o=jd[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function qd(e){const t=Le({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=P(),[o,i]=P(),[s,a]=P(t.placement),l=()=>Vd(t.anchorRef(),t.getAnchorRect),{direction:c}=Er();async function d(){const h=l(),m=n(),f=o();if(!h||!m)return;const g=(f?.clientHeight||0)/2,p=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const b=[Rd(({placement:C})=>{const E=!!C.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const C=typeof t.flip=="string"?t.flip.split(" "):void 0;if(C!==void 0&&!C.every(Ud))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(Nd({padding:t.overflowPadding,fallbackPlacements:C}))}(t.slide||t.overlap)&&b.push($d({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Fd({padding:t.overflowPadding,apply({availableWidth:C,availableHeight:E,rects:$}){const _=Math.round($.reference.width);C=Math.floor(C),E=Math.floor(E),m.style.setProperty("--kb-popper-anchor-width",`${_}px`),m.style.setProperty("--kb-popper-content-available-width",`${C}px`),m.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(m.style.width=`${_}px`),t.fitViewport&&(m.style.maxWidth=`${C}px`,m.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&b.push(Kd({padding:t.detachedPadding})),f&&b.push(Bd({element:f,padding:t.arrowPadding}));const v=await zd(h,m,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...cs,isRTL:()=>c()==="rtl"}});if(a(v.placement),t.onCurrentPlacementChange?.(v.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",Hd(v.placement,c()));const w=Math.round(v.x),x=Math.round(v.y);let O;if(t.hideWhenDetached&&(O=v.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:O}),f&&v.middlewareData.arrow){const{x:C,y:E}=v.middlewareData.arrow,$=v.placement.split("-")[0];Object.assign(f.style,{left:C!=null?`${C}px`:"",top:E!=null?`${E}px`:"",[$]:"100%"})}}D(()=>{const h=l(),m=n();if(!h||!m)return;const f=Id(h,m,d,{elementResize:typeof ResizeObserver=="function"});K(f)}),D(()=>{const h=n(),m=t.contentRef();!h||!m||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(m).zIndex})});const u={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return y(Wi.Provider,{value:u,get children(){return t.children}})}const fs=ce();function hs(){return he(fs)}function Et(){const e=hs();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const gs=ce();function Ct(){const e=he(gs);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
176
176
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
177
177
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
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="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"})}})});
|
|
181
|
+
*/function Wd(e,t){return t?jc([e.clientX,e.clientY],t):!1}function Gd(e){const t=Ct(),n=Ni(),r=hs(),o=Le({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=P(),[h,m]=P(),[f,g]=P(),[p,b]=P(),[v,w]=P(!0),[x,O]=P(s.placement),[C,E]=P([]),[$,_]=P([]),{DomCollectionProvider:R}=Vu({items:$,onItemsChange:_}),L=wi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),I=uu(()=>t.forceMount()||L.isOpen()),te=Tu({selectionMode:"none",dataSource:$}),Y=U=>{w(U),L.open()},fe=(U=!1)=>{L.close(),U&&r&&r.close(!0)},N=U=>{w(U),L.toggle()},V=()=>{const U=p();U&&(de(U),te.selectionManager().setFocused(!0),te.selectionManager().setFocusedKey(void 0))},Q=U=>{E(ho=>[...ho,U]);const Un=r?.registerNestedMenu(U);return()=>{E(ho=>dr(ho,U)),Un?.()}},ie=U=>c===l?.side&&Wd(U,l?.area),At=U=>{ie(U)&&U.preventDefault()},Pe=U=>{ie(U)||V()},dm=U=>{ie(U)&&U.preventDefault()};au({isDisabled:()=>!(r==null&&L.isOpen()&&t.isModal()),targets:()=>[p(),...C()].filter(Boolean)}),D(()=>{const U=p();if(!U||!r)return;const Un=r.registerNestedMenu(U);K(()=>{Un()})});const fm={dataset:k(()=>({"data-expanded":L.isOpen()?"":void 0,"data-closed":L.isOpen()?void 0:""})),isOpen:L.isOpen,contentPresence:I,nestedMenus:C,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:v,listState:()=>te,parentMenuContext:()=>r,triggerRef:f,contentRef:p,triggerId:d,contentId:h,setTriggerRef:g,setContentRef:b,open:Y,close:fe,toggle:N,focusContent:V,onItemEnter:At,onItemLeave:Pe,onTriggerLeave:dm,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Q,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:yn(u),registerContentId:yn(m)};return y(R,{get children(){return y(fs.Provider,{value:fm,get children(){return y(qd,T({anchorRef:f,contentRef:p,onCurrentPlacementChange:O},s))}})}})}const Yd=ce();function Xd(e){let t;const n=Ct(),r=Et(),o=Le({id:n.generateId(`item-${Ae()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,d]=P(),[u,h]=P(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),p=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Uu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??u()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const b=Pu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),v=_=>{ge(_,i.onPointerMove),_.pointerType==="mouse"&&(i.disabled?r.onItemLeave(_):(r.onItemEnter(_),_.defaultPrevented||(de(_.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},w=_=>{ge(_,i.onPointerLeave),_.pointerType==="mouse"&&r.onItemLeave(_)},x=_=>{ge(_,i.onPointerUp),!i.disabled&&_.button===0&&p()},O=_=>{if(ge(_,i.onKeyDown),!_.repeat&&!i.disabled)switch(_.key){case"Enter":case" ":p();break}},C=k(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),E=k(()=>({"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})),$={isChecked:()=>i.checked,dataset:E,setLabelRef:h,generateId:ci(()=>s.id),registerLabel:yn(l),registerDescription:yn(d)};return y(Yd.Provider,{value:$,get children(){return y(bn,T({as:"div",ref(_){var R=rt(L=>t=L,i.ref);typeof R=="function"&&R(_)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return C()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return we([i.onPointerDown,b.onPointerDown])},get onPointerUp(){return we([x,b.onPointerUp])},get onClick(){return we([i.onClick,b.onClick])},get onKeyDown(){return we([O,b.onKeyDown])},get onMouseDown(){return we([i.onMouseDown,b.onMouseDown])},get onFocus(){return we([i.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:w},E,s))}})}const Jd=ce();function ps(){return he(Jd)}function Zd(e){let t;const n=Ct(),r=Et(),o=ps(),i=Le({id:n.generateId(`content-${Ae()}`)},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(),d=Lu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);iu({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:p=>{o===void 0&&s.onOpenAutoFocus?.(p)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const u=p=>{if(De(p.currentTarget,p.target)&&(p.key==="Tab"&&r.isOpen()&&p.preventDefault(),o!==void 0&&p.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(p.key){case"ArrowRight":p.stopPropagation(),p.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(p.currentTarget.hasAttribute("data-closed"))break;p.stopPropagation(),p.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=p=>{s.onEscapeKeyDown?.(p),o?.setAutoFocusMenu(!1),r.close(!0)},m=p=>{s.onFocusOutside?.(p),n.isModal()&&p.preventDefault()},f=p=>{ge(p,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=p=>{if(ge(p,s.onPointerMove),p.pointerType!=="mouse")return;const b=p.target,v=l!==p.clientX;De(p.currentTarget,b)&&v&&(r.setPointerDir(p.clientX>l?"right":"left"),l=p.clientX)};return D(()=>K(r.registerContentId(s.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y(td,{get children(){return y(Qu,T({ref(p){var b=rt(v=>{r.setContentRef(v),r.contentPresence.setRef(v),t=v},s.ref);typeof b=="function"&&b(p)},role:"menu",get id(){return s.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return k(()=>!!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 we([s.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return we([s.onMouseDown,d.onMouseDown])},get onFocusIn(){return we([s.onFocusIn,d.onFocusIn])},get onFocusOut(){return we([s.onFocusOut,d.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Qd(e){let t;const n=Ct(),r=Et(),[o,i]=j(e,["ref"]);return Hi({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Zd,T({ref(s){var a=rt(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function ef(e){return y(Xd,T({role:"menuitem",closeOnSelect:!0},e))}function tf(e){const t=Et();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(qo,e)}})}function nf(e){const t=`menu-${Ae()}`,n=Le({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=wi({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:ci(()=>r.id),value:()=>r.value};return y(gs.Provider,{value:s,get children(){return y(Gd,T({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function rf(e){const t=Ct(),n=Et(),r=ps(),o=Le({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)}),K(()=>{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=>{ge(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},d=f=>{ge(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},u=f=>{if(ge(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),Hc(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=>{ge(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{ge(f,i.onFocus),r!==void 0&&r.setValue(a)};return D(()=>K(n.registerTriggerId(i.id))),y(Ru,T({ref(f){var g=rt(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 k(()=>!!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:d,onKeyDown:u,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function of(e){const t=Ct(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(Qd,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||de(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function sf(e){const t=`dropdownmenu-${Ae()}`,n=Le({id:t},e);return y(nf,n)}function af(e){return ve({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 lf(e){return ve({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 cf(e){return ve({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 uf=e=>y(sf,T({gutter:4},e)),df=rf,ff=e=>{const[,t]=j(e,["class"]);return y(tf,{get mount(){return Wn()},get children(){return y(of,T({get class(){return Ge("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))}})},hf=e=>{const[,t]=j(e,["class"]);return y(ef,T({get class(){return Ge("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 gf(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function pf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function mf(e,t,n){const r=`${Jt}/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 yf(e,t,n){if(!e||!t||!n)return;const r=`${Jt}/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 _n=Object.create(null);Object.keys($e).forEach(e=>{_n[$e[e]]=e});const Nr={type:"error",data:"parser error"},ms=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ys=typeof ArrayBuffer=="function",bs=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Fr=({type:e,data:t},n,r)=>ms&&t instanceof Blob?n?r(t):vs(t,r):ys&&(t instanceof ArrayBuffer||bs(t))?n?r(t):vs(new Blob([t]),r):r($e[e]+(t||"")),vs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function ws(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kr;function bf(e,t){if(ms&&e.data instanceof Blob)return e.data.arrayBuffer().then(ws).then(t);if(ys&&(e.data instanceof ArrayBuffer||bs(e.data)))return t(ws(e.data));Fr(e,!1,n=>{Kr||(Kr=new TextEncoder),t(Kr.encode(n))})}const xs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<xs.length;e++)Wt[xs.charCodeAt(e)]=e;const vf=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),d=new Uint8Array(c);for(r=0;r<n;r+=4)i=Wt[e.charCodeAt(r)],s=Wt[e.charCodeAt(r+1)],a=Wt[e.charCodeAt(r+2)],l=Wt[e.charCodeAt(r+3)],d[o++]=i<<2|s>>4,d[o++]=(s&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},wf=typeof ArrayBuffer=="function",Br=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ss(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xf(e.substring(1),t)}:_n[n]?e.length>1?{type:_n[n],data:e.substring(1)}:{type:_n[n]}:Nr},xf=(e,t)=>{if(wf){const n=vf(e);return Ss(n,t)}else return{base64:!0,data:e}},Ss=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Es="",Sf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Fr(i,!1,a=>{r[s]=a,++o===n&&t(r.join(Es))})})},Ef=(e,t)=>{const n=e.split(Es),r=[];for(let o=0;o<n.length;o++){const i=Br(n[o],t);if(r.push(i),i.type==="error")break}return r};function Cf(){return new TransformStream({transform(e,t){bf(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 zr;function Pn(e){return e.reduce((t,n)=>t+n.length,0)}function An(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 kf(e,t){zr||(zr=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(Pn(n)<1)break;const l=An(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(Pn(n)<2)break;const l=An(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pn(n)<8)break;const l=An(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Nr);break}o=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pn(n)<o)break;const l=An(n,o);a.enqueue(Br(i?l:zr.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Nr);break}}}})}const Cs=4;function ee(e){if(e)return Of(e)}function Of(e){for(var t in ee.prototype)e[t]=ee.prototype[t];return e}ee.prototype.on=ee.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},ee.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},ee.prototype.off=ee.prototype.removeListener=ee.prototype.removeAllListeners=ee.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},ee.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},ee.prototype.emitReserved=ee.prototype.emit,ee.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},ee.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Se=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_f="arraybuffer";function mm(){}function ks(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Pf=Se.setTimeout,Af=Se.clearTimeout;function Dn(e,t){t.useNativeTimers?(e.setTimeoutFn=Pf.bind(Se),e.clearTimeoutFn=Af.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Tf=1.33;function Df(e){return typeof e=="string"?Lf(e):Math.ceil((e.byteLength||e.size)*Tf)}function Lf(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 Os(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Mf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function If(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 Rf extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Vr extends ee{constructor(t){super(),this.writable=!1,Dn(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 Rf(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=Br(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=Mf(t);return n.length?"?"+n:""}}class $f extends Vr{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)};Ef(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,Sf(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]=Os()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _s=!1;try{_s=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Nf=_s;function Ff(){}class Kf extends $f{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 Ne extends ee{constructor(t,n,r){super(),this.createRequest=t,Dn(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=ks(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=Ne.requestsCount++,Ne.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=Ff,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ne.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(Ne.requestsCount=0,Ne.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ps);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,Ps,!1)}}function Ps(){for(let e in Ne.requests)Ne.requests.hasOwnProperty(e)&&Ne.requests[e].abort()}const Bf=function(){const e=As({xdomain:!1});return e&&e.responseType!==null}();class zf extends Kf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Bf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ne(As,this.uri(),t)}}function As(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Nf))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ts=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vf extends Vr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ts?{}:ks(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;Fr(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},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]=Os()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ur=Se.WebSocket||Se.MozWebSocket;class Uf extends Vf{createSocket(t,n,r){return Ts?new Ur(t,n,r):n?new Ur(t,n):new Ur(t)}doWrite(t,n){this.ws.send(n)}}class jf extends Vr{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=kf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Cf();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&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Hf={websocket:Uf,webtransport:jf,polling:zf},qf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function jr(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=qf.exec(e||""),i={},s=14;for(;s--;)i[Wf[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=Gf(i,i.path),i.queryKey=Yf(i,i.query),i}function Gf(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 Yf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Hr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ln=[];Hr&&addEventListener("offline",()=>{Ln.forEach(e=>e())},!1);class Ze extends ee{constructor(t,n){if(super(),this.binaryType=_f,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=jr(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=jr(n.host).host);Dn(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=If(this.opts.query)),Hr&&(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"})},Ln.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Cs,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&&Ze.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",Ze.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+=Df(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,Tn(()=>{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(Ze.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(),Hr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ln.indexOf(this._offlineEventListener);r!==-1&&Ln.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=Cs;class Xf extends Ze{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;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),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,d(),n.close(),n=null)}const s=u=>{const h=new Error("probe error: "+u);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&i()}const d=()=>{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 Jf=class extends Xf{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=>Hf[o]).filter(o=>!!o)),super(t,r)}};function Zf(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=jr(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 Qf=typeof ArrayBuffer=="function",eh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ds=Object.prototype.toString,th=typeof Blob=="function"||typeof Blob<"u"&&Ds.call(Blob)==="[object BlobConstructor]",nh=typeof File=="function"||typeof File<"u"&&Ds.call(File)==="[object FileConstructor]";function qr(e){return Qf&&(e instanceof ArrayBuffer||eh(e))||th&&e instanceof Blob||nh&&e instanceof File}function Mn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Mn(e[n]))return!0;return!1}if(qr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mn(e[n]))return!0;return!1}function rh(e){const t=[],n=e.data,r=e;return r.data=Wr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Wr(e,t){if(!e)return e;if(qr(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]=Wr(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]=Wr(e[r],t));return n}return e}function oh(e,t){return e.data=Gr(e.data,t),delete e.attachments,e}function Gr(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]=Gr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Gr(e[n],t));return e}const ih=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],sh=5;var z;(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"})(z||(z={}));class ah{constructor(t){this.replacer=t}encode(t){return(t.type===z.EVENT||t.type===z.ACK)&&Mn(t)?this.encodeAsBinary({type:t.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===z.BINARY_EVENT||t.type===z.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=rh(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ls(e){return Object.prototype.toString.call(e)==="[object Object]"}class Yr extends ee{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===z.BINARY_EVENT;r||n.type===z.BINARY_ACK?(n.type=r?z.EVENT:z.ACK,this.reconstructor=new lh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(qr(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(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.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(Yr.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 z.CONNECT:return Ls(n);case z.DISCONNECT:return n===void 0;case z.CONNECT_ERROR:return typeof n=="string"||Ls(n);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&ih.indexOf(n[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class lh{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=oh(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ch=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Yr,Encoder:ah,get PacketType(){return z},protocol:sh},Symbol.toStringTag,{value:"Module"}));function _e(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const uh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ms extends ee{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=[_e(t,"open",this.onopen.bind(this)),_e(t,"packet",this.onpacket.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(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(uh.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:z.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),s.id=d}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:z.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 z.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 z.EVENT:case z.BINARY_EVENT:this.onevent(t);break;case z.ACK:case z.BINARY_ACK:this.onack(t);break;case z.DISCONNECT:this.ondisconnect();break;case z.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:z.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:z.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 kt(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}kt.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},kt.prototype.reset=function(){this.attempts=0},kt.prototype.setMin=function(e){this.ms=e},kt.prototype.setMax=function(e){this.max=e},kt.prototype.setJitter=function(e){this.jitter=e};class Xr extends ee{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,Dn(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 kt({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||ch;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 Jf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=_e(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=_e(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(_e(t,"ping",this.onping.bind(this)),_e(t,"data",this.ondata.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(t,"close",this.onclose.bind(this)),_e(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){Tn(()=>{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 Ms(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 Gt={};function In(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Zf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Gt[o]&&i in Gt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Xr(r,t):(Gt[o]||(Gt[o]=new Xr(r,t)),l=Gt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(In,{Manager:Xr,Socket:Ms,io:In,connect:In});class at{static instance;constructor(){}static init(){return at.instance||(at.instance=In(za,{path:"/ws",withCredentials:!0}),at.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),at.instance}static on(t,n){at.instance||this.init().on(t,n)}}const Is=1e3*60*60*24,[Rn,Rs]=ti("smarttalks-widget-messages",{},Is),$s=()=>{const{widgetId:e}=oe();return Rn[e()]??[]},dh=e=>{const{widgetId:t}=oe();Rs({...Rn,[t()]:[...Rn[t()]??[],e]})},fh=()=>{const{widgetId:e}=oe();Rs({...Rn,[e()]:[]})},[Ns,hh]=ti("smarttalks-widget-conversationinfo",{},Is),Fs=()=>{const{widgetId:e}=oe();return Ns[e()]??{}},Ks=e=>{const{widgetId:t}=oe();hh({...Ns,[t()]:e})},[gh,Jr]=P(!1),[ph,Bs]=P(!1),zs=[],Vs=()=>{zs.forEach(e=>e())},mh=e=>zs.push(e),Zr=e=>{const t=gf(e);if(dh(t),t.type==="media"){setTimeout(Vs,200);return}Vs()},yh=(e,t)=>{const{chatWidget:n}=oe(),r=Fs();e.trim()&&(Zr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ne("onInput",e),at.on("message",o=>{(o.contactId!==r.contactId||o.interactionId!==r.interactionId)&&Ks({contactId:o.contactId,interactionId:o.interactionId});for(const i of o.messages)Zr(i),ne("onAnswer",i);Jr(!1),pf(o.debug)}),Jr(!0),mf(e,t,n()?._id).catch(o=>{console.error(o),Jr(!1)}))},bh=()=>{const{chatWidget:e}=oe(),t=Fs();Bs(!0),fh(),yf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ks({}),Bs(!1),vh()}),ne("onReset")},vh=()=>{const{chatWidget:e}=oe();if($s().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Zr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qe=()=>({getMessages:$s,pushMessage:yh,clearMessages:bh,onMessage:mh,typing:gh,loading:ph});var wh=M("<span>");const xh=()=>{const{clearMessages:e}=Qe();P(!1);const[t,n]=P(!1);return y(uf,{get open(){return t()},onOpenChange:n,get children(){return[y(df,{get children(){return y(Te,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(fc,{size:20})}})}}),y(ff,{get children(){return y(hf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(dc,{size:14}),(()=>{var r=wh();return A(r,()=>ut("restart")),r})()]}})}})]}})};function Sh(e){return ve({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 Eh(e){return ve({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 Ch(e){return ve({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 kh=M('<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 Qr=()=>{const{chatWidget:e}=oe(),[t,n]=P(!1),r=()=>{const i=Wn();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{e()?.mode==="popup"&&ne("close")};return(()=>{var i=kh(),s=i.firstChild;return A(i,y(cc,{}),s),A(s,y(Te,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return y(Z,{get when(){return t()},get fallback(){return y(Eh,{size:16})},get children(){return y(Sh,{size:16})}})}}),null),A(s,y(Z,{get when(){return e()?.showSettings},get children(){return y(xh,{})}}),null),A(s,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(Te,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return y(Ch,{size:16})}})}}),null),i})()};var Oh=M("<span>");const Us=({createdAt:e,anchor:t="end"})=>(()=>{var n=Oh();return ht(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var _h=M('<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 Ph=({children:e,createdAt:t})=>(()=>{var n=_h(),r=n.firstChild;return A(r,e),A(n,y(Us,{createdAt:t,anchor:"start"}),null),n})();var Ah=M("<span>");const Ot=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Fa(Ka(n))),(()=>{var r=Ah();return r.innerHTML=n,tt(r,T({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Th=M('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Dh=({options:e,text:t})=>{let n;const{pushMessage:r}=Qe(),[o,i]=P(!1),s=(a,l)=>{i(!0),r(a,l)};return(()=>{var a=Th(),l=a.firstChild,c=l.firstChild;A(a,y(Ot,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?ir(d,c):n=c,A(c,y(ft,{each:e,children:u=>y(Te,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(u.label,u.value),get children(){return u.label?.trim()}})})),re(()=>ht(l,`flex items-center justify-center max-w-80 mx-[-1rem] ${o()&&"opacity-50"}`)),a})()};var Lh=M('<div class="flex flex-col"><span>'),Mh=M("<a target=_blank><img><span></span><span>");const Ih=({options:e,text:t})=>(()=>{var n=Lh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(ft,{each:e,children:o=>(()=>{var i=Mh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),re(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(i,"href",c.e=d),u!==c.t&&ue(s,"src",c.t=u),c},{e:void 0,t:void 0}),i})()}),null),n})();var Rh=M("<a target=_blank>");const $h=({url:e,text:t})=>(()=>{var n=Rh();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,js=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Nh=e=>{const t=T({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[k(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Hs=Nh,Yt=e=>typeof e=="function",Fh=["button","color","file","image","reset","submit"],Kh=(e,t)=>e==="button"?!0:e==="input"&&t?Fh.indexOf(t)!==-1:!1;function Bh(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>q(()=>{let a;return Yt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var eo=Bh,$n=new Map,Nn=(e,t)=>{if($n.has(e))return $n.get(e);const n=ce(t);return $n.set(e,n),n},to=e=>{const t=$n.get(e);if(t)return he(t)},Fn=new Map,zh=e=>{D(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Fn.get(e.key);o?o.activeCount++:Fn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=Fn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Fn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Vh=zh,Uh=e=>{const t=T({enabled:!0},e);D(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},jh=Uh,Hh=e=>{const t=T({enabled:!0},e);D(()=>{const{body:n}=document;G(t.enabled)&&Vh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},qh=Hh,Wh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);D(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),i=G(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Gh=Wh,Yh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);jh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Gh({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}),qh({enabled:t.noOutsidePointerEvents})},Xh=Yh,no=ce(),Jh=e=>k(()=>{if(he(no))return y(qs,e);const r=Ae(),[o,i]=P([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(d=>d!==l))};return y(no.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(qs,e)}})}),qs=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(no),i=Ae();D(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Xh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=k(()=>n.children),l=()=>{const c=a();return Yt(c)?c({get isLastLayer(){return s()}}):c};return q(()=>l())},Zh=Jh,Qh=()=>{const[e,t]=P(!1);return D(()=>t(!0)),e},eg=Qh,tg=(e,t)=>(e&&(Yt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ro=(...e)=>e.some(t=>!!t()),ng=e=>(...t)=>{for(const n of e)n&&n(...t)},Kn=(...e)=>ng(e),ae=e=>e?"":void 0,rg="div",og=e=>{const[t,n]=j(e,["as"]),r=k(()=>t.as??rg);return k(()=>{const i=r();switch(typeof i){case"function":return q(()=>i(n));case"string":return y(ln,T({component:i},n))}})},oo=og,ig=e=>{let t,n=!1;return()=>n?t:(n=!0,t=k(e))},Ws=ig,sg=e=>k(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),ag=sg,Gs="button",lg=e=>{const[t,n]=P(null),[r,o]=j(e,["as","ref","type"]),i=ag({element:t,fallback:Gs}),s=k(()=>Kh(i(),r.type));return y(oo,T({get as(){return r.as??Gs},ref(a){var l=Kn(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},cg=lg,ug='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"])',io="focusTrap.initialFocus",so="focusTrap.finalFocus",Ys={bubbles:!1,cancelable:!0},dg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=k(()=>{const f=n();return f?f[0]??null:null}),i=k(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{kr(()=>{l(J(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(J(t.element))})};D(()=>{const f=J(t.element);if(f&&J(t.enabled)){s=document.activeElement,q(()=>{l(f),c(f)});const g=new MutationObserver(a);J(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),D(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),K(()=>{document.removeEventListener("keydown",h)}))}),D(()=>{const f=o();f&&(f.addEventListener("keydown",d),K(()=>{f.removeEventListener("keydown",d)}))}),D(()=>{const f=i();f&&(f.addEventListener("keydown",u),K(()=>{f.removeEventListener("keydown",u)}))});const l=f=>{const g=Array.from(f.querySelectorAll(ug)).map((p,b)=>({element:p,domIndex:b,tabIndex:p.tabIndex})).sort((p,b)=>p.tabIndex===b.tabIndex?p.domIndex-b.domIndex:p.tabIndex-b.tabIndex);r(g.map(({element:p})=>p))},c=f=>{kr(()=>{const g=J(t.initialFocusElement)??o()??f,p=t.onInitialFocus;let b;p&&(b=new CustomEvent(io,Ys),f.addEventListener(io,p),f.dispatchEvent(b),f.removeEventListener(io,p)),b?.defaultPrevented!==!0&&g.focus()})},d=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},u=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},m=f=>{kr(()=>{if(!J(t.restoreFocus))return;const p=J(t.finalFocusElement)??s;if(!p)return;let b;const v=t.onFinalFocus;v&&(b=new CustomEvent(so,Ys),f.addEventListener(so,v),f.dispatchEvent(b),f.removeEventListener(so,v)),b?.defaultPrevented!==!0&&p.focus()})}},fg=dg,hg=fg,gg=e=>{const t=k(()=>{const s=J(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=P(J(e.show)?"present":"hidden");let i="none";return D(s=>{const a=J(e.show);return q(()=>{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=J(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const u=n().includes(c.animationName);c.target===s&&u&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),K(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},pg=gg,Xs=pg,mg=ce(),yg=e=>e?Nn(`dialog-${e}`):mg,Js=ce(),bg=e=>e?Nn(`dialog-internal-${e}`):Js,_t=e=>{if(!e){const n=he(Js);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=to(`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},vg="div",wg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=k(()=>_t(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent),i=k(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return y(Zh,{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=k(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,T({ref(l){var c=Kn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??vg},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 ae(r().open())},get"data-closed"(){return ae(!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()}}))}})}})}})},xg=wg,Sg="div",Eg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=k(()=>_t(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().overlayPresent),i=k(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const s=k(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,T({get as(){return t.as??Sg},ref(a){var l=Kn(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return ae(r().open())},get"data-closed"(){return ae(!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()}}))}})})()}})},Cg=Eg,kg=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=k(()=>_t(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=eg(),s=k(a=>a||o()&&i(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const a=k(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(qo,T(n,{get children(){return a()}}))}})})()}})},Og=kg,ao=!0,_g=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??ao),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??ao),preventScroll:()=>!!(e.modal??ao),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ae()},e),[n,r]=eo({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Hs({value:()=>t.labelId??Ae()}),[a,l,c]=Hs({value:()=>t.descriptionId??Ae()}),[d,u]=P(null),[h,m]=P(null),[f,g]=P(null),{present:p}=Xs({show:n,element:h}),{present:b}=Xs({show:n,element:f});hg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Hi({element:h,enabled:()=>p()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const v={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(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 p()},get contentRef(){return h()},get overlayPresent(){return b()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Ws(()=>t.children),x=()=>{const C=w()();return Yt(C)?C(v):C};return k(()=>{const C=yg(t.contextId),E=bg(t.contextId);return y(C.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:p,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(E.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:p,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:g,triggerRef:d,setTriggerRef:u}},get children(){return q(()=>x())}})}})})},Pg=_g,Ag="button",Tg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=k(()=>_t(t.contextId));return y(cg,T({ref(i){var s=Kn(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Ag},onClick:i=>{!tg(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 ae(r().open())},get"data-closed"(){return ae(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},Dg=Tg,Bn=e=>typeof e=="function"?e():e,Zs=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Lg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,i]=P(null);let s=null;D(()=>{const c=Bn(t.element),d=Bn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],h=Bn(t.dimension);h==="both"?s?s[0]!==u[0]&&s[1]!==u[1]&&(Ee(()=>{i(s),r(!0)}),Zs(()=>{i(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u:s?zn(h,s)!==zn(h,u)&&(Ee(()=>{i(zn(h,s)),r(!0)}),Zs(()=>{i(zn(h,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u},l=()=>{if(!n())return;const c=Bn(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Ee(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var zn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Mg=Lg,Ig=Mg;const Rg=(e,t)=>e.length>0?()=>e(q(t)):e;function $g(e,t){let n=0;const r=e.map((o,i)=>k(()=>(n=i,o()),void 0,cr));return k(()=>r.map(o=>o())[n],void 0,t)}function Qs(e,t,n){let r=()=>t;const[o,i]=P(t,cr),s=k(Rg(e,()=>r()),t,cr);return[r=$g([o,s],n),a=>i(()=>typeof a=="function"?a(q(r)):a)]}var Ng=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Fg=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Kg=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=Ng(o,t),u=d-l-r*c;(c!==0||u!==0)&&Fg(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},Bg=e=>y(Dg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),ea=ce(),zg=e=>e?Nn(`drawer-${e}`):ea,Vg=e=>{if(!e){const n=he(ea);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`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},ta=ce(),Ug=e=>e?Nn(`drawer-internal-${e}`):ta,na=e=>{if(!e){const n=he(ta);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`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},ra=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vn(e,t)};const o=r[n-1]?Vn(r[n-1],t):void 0,i=r[n]?Vn(r[n],t):void 0;return{value:e,offset:Vn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Vn=(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)},jg=(e,t,n,r)=>{const o=oa("upper",e,r?n:t),i=oa("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},oa=(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),Hg=(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},qg=void 0,Wg=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[qg],defaultSnapPoint:1,side:"bottom",dampFunction:N=>6*Math.log(N+1),velocityFunction:(N,V)=>{const Q=N/V;return Q<1&&Q>-1?1:Q},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]=eo({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=eo({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:d,transitionSize:u}=Ig({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]=Qs(()=>d()?"resizing":null),p=k(()=>{const N=l()?.contentRef();if(N)return getComputedStyle(N)}),[b,v]=P(!1);D(()=>{const N=o();q(()=>{b()!==N&&(N?(v(!0),js(()=>{Ee(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(p().transitionDuration)===0&&g(null)})):(Ee(()=>{g("closing"),a(0)}),js(()=>{parseFloat(p().transitionDuration)===0&&w()})))})});const w=()=>{Ee(()=>{v(!1),g(null)})},[x,O]=P(0);D(()=>{const N=l()?.contentRef();if(!N)return;E(N);const V=new ResizeObserver(C);V.observe(N),K(()=>{V.disconnect()})});const C=N=>{for(const V of N)V.target===l()?.contentRef()&&E(V.target)},E=N=>{const V=q(()=>x());switch(n.side){case"top":case"bottom":if(V===N.offsetHeight)return;O(N.offsetHeight);break;case"left":case"right":if(V===N.offsetWidth)return;O(N.offsetWidth);break}},$=k(()=>ra(s(),x())),[_,R]=Qs(()=>$().offset),L=k(()=>x()?(x()-_())/x():0),I={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 L()},get translate(){return _()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},te=Ws(()=>n.children),Y=N=>{c(_t(n.contextId));const V=te()();if(Yt(V)){const Q=T(N,I);return V(Q)}return V};return k(()=>{const N=zg(n.contextId),V=Ug(n.contextId);return q(()=>y(N.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:L,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(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:L,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:$,drawerStyles:p,setTransitionState:g,transitionSize:u,closeDrawer:w}},get children(){return y(Pg,T({get open(){return b()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:Q=>Y(Q)}))}})}}))})},Gg=Wg,Yg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=k(()=>na(t.contextId)),c=k(()=>_t(t.contextId)),d=k(()=>l().snapPoints().map((w,x)=>ra(w,l().drawerSize(),x,l().breakPoints()))),u=k(()=>{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=k(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),m=k(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});D(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",p),document.addEventListener("pointerup",v),document.addEventListener("touchend",v),K(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",p),document.removeEventListener("pointerup",v),document.removeEventListener("touchend",v)}))});const f=w=>{Hg(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[w.clientX,w.clientY]))},g=w=>{b(w.target,w.clientX,w.clientY)},p=w=>{w.touches[0]&&b(w.target,w.touches[0].clientX,w.touches[0].clientY)},b=(w,x,O)=>{if(!r)return;if(!l().isDragging()||o===null){const $=window.getSelection();if($&&$.toString().length>0){v();return}if(l().handleScrollableElements()){const _=[x,O].map((fe,N)=>i[N]-fe),R=Math.abs(_[0])>Math.abs(_[1])?"x":"y",L=R==="x"?_[0]:_[1];if(Math.abs(L)<.3)return;const I=c().contentRef(),[te,Y]=Kg(w,R,I);if(L>0&&Math.abs(te)>1||L<0&&Math.abs(Y)>0){v();return}}switch(l().side()){case"top":case"bottom":o=O;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Ee(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let C;switch(l().side()){case"top":C=-(o-O);break;case"bottom":C=o-O;break;case"right":C=o-x;break;case"left":C=-(o-x);break}C-=l().resolvedActiveSnapPoint().offset,C>0&&(C=l().dampFunction(C));const E=new Date;E.getTime()-s.getTime()>l().velocityCacheReset()&&(s=E,a=l().translate()),l().setTranslate(-C)},v=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-s.getTime()||1),O=l().translate()*x,C=jg(d(),l().translate(),O,l().allowSkippingSnapPoints());Ee(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Ee(()=>{l().setActiveSnapPoint(C.value),C.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(C.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(xg,T({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:m(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ee(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return ae(l().isTransitioning())},get"data-opening"(){return ae(l().transitionState()==="opening")},get"data-closing"(){return ae(l().transitionState()==="closing")},get"data-snapping"(){return ae(l().transitionState()==="snapping")},get"data-resizing"(){return ae(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Xg=Yg,Jg=e=>{const[t,n]=j(e,["contextId"]),r=k(()=>na(t.contextId));return y(Cg,T({get contextId(){return t.contextId},get"data-transitioning"(){return ae(r().isTransitioning())},get"data-opening"(){return ae(r().transitionState()==="opening")},get"data-closing"(){return ae(r().transitionState()==="closing")},get"data-snapping"(){return ae(r().transitionState()==="snapping")},get"data-resizing"(){return ae(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Zg=Jg,Qg=M('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const ep=Gg,tp=Bg,np=Og,rp=e=>{const[,t]=j(e,["class"]),n=Vg();return y(Zg,T({get class(){return Ge("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))},op=e=>{const[,t]=j(e,["class","children"]);return y(np,{get mount(){return Wn()},get children(){return[y(rp,{}),y(Xg,T({id:"smarttalks-list-content",get class(){return Ge("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[Qg(),k(()=>e.children)]}}))]}})};var ip=M('<span class="font-semibold mt-2">'),sp=M('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),ap=M('<div class="flex flex-col space-y-2"><div>'),lp=M('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),cp=M('<div class="flex flex-col items-start"><span class=text-slate-500>');const up=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qe(),[o,i]=P(!1),[s,a]=P(!1),[l,c]=P(),d=(h,m)=>{a(!1),i(!0),r(h,m)},u=h=>{const m=h.composedPath();for(const f of m)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=ap(),m=h.firstChild;return A(h,y(Ot,{get children(){return t?.trim()}}),m),A(m,y(ep,{get open(){return s()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(tp,{as:Te,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??ut("selectOption")}}),y(op,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=ip();return A(f,()=>n?.trim()??ut("selectOption")),f})(),(()=>{var f=sp();return A(f,y(ft,{each:e,children:g=>(()=>{var p=lp(),b=p.firstChild;return A(b,()=>g.label?.trim()??""),A(p,y(ft,{get each(){return g.items},children:v=>y(Te,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===v?"bg-slate-200":""}`},onClick:()=>c(v),get children(){return[(()=>{var w=cp(),x=w.firstChild;return A(w,()=>v.label?.trim(),x),A(x,()=>v.description?.trim()),w})(),y(Z,{get when(){return l()===v},get fallback(){return y(lf,{class:"size-4 text-slate-500"})},get children(){return y(af,{class:"size-4 text-slate-500"})}})]}})}),null),p})()})),f})(),y(Te,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return ut("send")}})]}})]}})),re(()=>ht(m,o()?"opacity-50":"")),h})()};var dp=M("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const fp=e=>(()=>{var t=dp(),n=t.firstChild,r=n.nextSibling;return re(o=>{var i=e.link,s=e.link;return i!==o.e&&ue(n,"src",o.e=i),s!==o.t&&ue(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var hp=M('<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 gp=e=>(()=>{var t=hp(),n=t.firstChild,r=n.firstChild;return A(n,y(cf,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(()=>ue(n,"href",e.link)),t})();var pp=M('<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 mp=e=>(()=>{var t=pp(),n=t.firstChild,r=n.firstChild;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ue(n,"href",o.e=i),s!==o.t&&ue(r,"src",o.t=s),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var yp=M('<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 bp=e=>(()=>{var t=yp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(i=>{var s=e.link,a=e.link;return s!==i.e&&ue(r,"src",i.e=s),a!==i.t&&ue(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var vp=M("<div>Media type not supported");const ia=e=>e.type==="image"?y(mp,e):e.type==="audio"?y(fp,e):e.type==="document"?y(gp,e):e.type==="video"?y(bp,e):vp(),lo=({text:e})=>y(Ot,{get children(){return e?.trim()}});var wp=M("<div>Unknown bot message type");const xp=e=>y(Ph,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="buttons"?y(Dh,T(()=>e.buttons)):e.type==="list"?y(up,T(()=>e.list)):e.type==="media"?y(ia,T(()=>e.media)):e.type==="link"?y($h,T(()=>e.link)):e.type==="cards"?y(Ih,T(()=>e.cards)):e.type==="date"?y(lo,{get text(){return e.text}}):wp()}});var Sp=M('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Ep=e=>(()=>{var t=Sp(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var Cp=M('<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 kp=({children:e,createdAt:t})=>(()=>{var n=Cp(),r=n.firstChild;return A(r,e),A(n,y(Us,{createdAt:t,anchor:"end"}),null),n})();var Op=M("<div>Unknown user message type");const _p=e=>y(kp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="media"?y(ia,T(()=>e.media)):Op()}});var Pp=M("<div>Unknown message origin");const Ap=e=>e.origin==="bot"?y(xp,e):e.origin==="user"?y(_p,e):e.origin==="service"?y(Ep,e):Pp();function Tp(e){return ve({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 Pt(e){return ve({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 Dp=M('<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 Lp=()=>(()=>{var e=Dp(),t=e.firstChild;return A(t,y(Pt,{class:"size-2 animate-bounce"}),null),A(t,y(Pt,{class:"size-2 animate-bounce delay-150"}),null),A(t,y(Pt,{class:"size-2 animate-bounce delay-300"}),null),e})();var Mp=M('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),Ip=M("<div>");const co=()=>{let e;const{getMessages:t,onMessage:n,typing:r,clearMessages:o}=Qe(),{onOpen:i}=Xo(),s=(a=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},a)};return le("reset",()=>{o()}),tn(()=>{s(200)}),n(s),i(()=>s(200)),(()=>{var a=Mp(),l=e;return typeof l=="function"?ir(l,a):e=a,A(a,y(ft,{get each(){return t()},get fallback(){return(()=>{var c=Ip();return A(c,()=>ut("emptyMessages")),c})()},children:c=>y(Ap,c)}),null),A(a,y(Z,{get when(){return r()},get children(){return y(Lp,{})}}),null),a})()};var Rp=M("<textarea>");const $p=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Rp();return tt(n,T({get class(){return Ge("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 Np=M('<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 Fp=e=>(()=>{var t=Np();return tt(t,e,!0,!0),t})();var Kp=M('<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 Bp=()=>(()=>{var e=Kp(),t=e.firstChild;return A(e,y(Fp,{height:15}),t),e})();var zp=M('<footer class="relative flex-none p-4 bg-white min-h-16 flex space-x-1 pb-6">');const uo=()=>{const{pushMessage:e}=Qe(),[t,n]=P(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return le("setInput",i=>{i&&n(i)}),(()=>{var i=zp();return A(i,y($p,{get placeholder(){return ut("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),A(i,y(Te,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return y(gc,{size:24})}}),null),A(i,y(Bp,{}),null),i})()};var Vp=M('<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">'),Up=M("<span class=sr-only>Close"),jp=M("<div>"),Hp=M("<span class=sr-only>Open"),qp=M("<span>"),Wp=M('<div class="animate-pulse flex p-1">');const Gp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Xo(),{chatWidget:s}=oe(),[a,l]=P(!0);setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const c=()=>(s()?.style.margin??5)/4,d=()=>s()?.style.position==="left"?{left:`${c()}rem`}:{right:`${c()}rem`};return le("open",()=>{o()}),le("close",()=>{i()}),le("toggle",()=>{r()}),(()=>{var u=jp();return A(u,y(Z,{get when(){return n()},get children(){var h=Vp();return A(h,e),h}}),null),A(u,y(Z,{get when(){return n()},get fallback(){return y(Te,{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,Hp(),y(Z,{get when(){return s()?.balloonMessage},get children(){var h=qp();return A(h,y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=Wp();return A(m,y(Pt,{class:"size-2 animate-bounce"}),null),A(m,y(Pt,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(Pt,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return s()?.balloonMessage}})),re(()=>ht(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 y(Te,{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[y(Tp,{size:30}),Up()]}})}}),null),re(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=d();return m!==h.e&&ht(u,h.e=m),h.t=an(u,f,h.t),h},{e:void 0,t:void 0}),u})()};var Yp=M('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Xp=({children:e})=>{const{chatWidget:t}=oe(),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=Yp();return an(r,n),A(r,e),r})()};var Jp=M('<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 Zp=({children:e})=>{const{chatWidget:t}=oe(),[n,r]=P(!1),o=()=>(t()?.style.margin??5)/4,i=()=>t()?.style.position==="left"?{left:`${o()}rem`}:{right:`${o()}rem`};return le("open",()=>{r(!0),ne("onOpen")}),le("close",()=>{r(!1),ne("onClose")}),le("toggle",()=>{r(!n()),ne("onToggle")}),setTimeout(()=>{r(!0),ne("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var s=Jp();return A(s,e),re(a=>an(s,i(),a)),s}})};var Qp=M('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const fo=()=>(()=>{var e=Qp();return A(e,y(hc,{size:45,class:"animate-spin"})),e})(),em=()=>{const{chatWidget:e}=oe(),{loading:t}=Qe();return y(Gp,{get openIcon(){return y(ii,{get src(){return e()?.avatar}})},get children(){return[y(Z,{get when(){return t()},get children(){return y(fo,{})}}),y(Qr,{}),y(co,{}),y(uo,{})]}})},tm=()=>{const{loading:e}=Qe();return y(Zp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Qr,{}),y(co,{}),y(uo,{})]}})},nm=()=>{const{loading:e}=Qe();return y(Xp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Qr,{}),y(co,{}),y(uo,{})]}})},rm=()=>{const{chatWidget:e}=oe();return y(Bo,{get children(){return[y(It,{get when(){return e()?.mode==="standard"},get children(){return y(em,{})}}),y(It,{get when(){return e()?.mode==="popup"},get children(){return y(tm,{})}}),y(It,{get when(){return e()?.mode==="static"},get children(){return y(nm,{})}})]}})};var om=M("<div><div>Form");const im=()=>{const{formWidget:e}=oe();return(()=>{var t=om();return t.firstChild,A(t,()=>e()?._id,null),t})()};function sm(){const{widget:e}=oe();return y(Bo,{get children(){return[y(It,{get when(){return e()?.type==="chat"},get children(){return y(rm,{})}}),y(It,{get when(){return e()?.type==="form"},get children(){return y(im,{})}})]}})}var am=M("<style>"),lm=M("<div>");const cm=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:i}=oe(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=am();return A(a,zl),a})(),(()=>{var a=lm();return A(a,y(sm,{})),a})()]},um={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Bl("smarttalks-widget",um,cm)})(),Va()});
|