@smarttalks.ai/widget 0.0.1 → 0.2.0
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 +6255 -9974
- package/lib/index.umd.cjs +27 -33
- package/package.json +3 -2
package/lib/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(fr){typeof define=="function"&&define.amd?define(fr):fr()})(function(){"use strict";function fr(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Es(o.value)&&!Iu(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 Tu(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Es(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Mu(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function $u(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Au(e,t){const n=fr(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?xs(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&Ss(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&&Ss(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 xs(e){if(e)try{return JSON.parse(e)}catch{return e}}function Ss(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 Mu(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Es(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Iu(e){return Object.prototype.toString.call(e)==="[object Function]"}function Lu(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let xo;function Ru(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=Au(this,t);const o=$u(this.props),i=this.Component,s=xo;try{xo=this,this.__initialized=!0,Lu(i)?new i(o,{element:this}):i(o,{element:this})}finally{xo=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?xs(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 Nu(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=Ru(r,Tu(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const Y={context:void 0,registry:void 0};function Rn(e){Y.context=e}const Fu=(e,t)=>e===t,Ie=Symbol("solid-proxy"),gr=Symbol("solid-track"),hr={equals:Fu};let Ps=$s;const et=1,pr=2,Cs={owned:null,cleanups:null,context:null,owner:null},So={};var ee=null;let Eo=null,_u=null,oe=null,he=null,tt=null,mr=0;function ze(e,t){const n=oe,r=ee,o=e.length===0,i=t===void 0?r:t,s=o?Cs:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Q(()=>wr(s)));ee=s,oe=null;try{return nt(a,!0)}finally{oe=n,ee=r}}function L(e,t){t=t?Object.assign({},hr,t):hr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ts(n,o));return[ks.bind(n),r]}function Po(e,t,n){const r=yr(e,t,!0,et);qt(r)}function ue(e,t,n){const r=yr(e,t,!1,et);qt(r)}function V(e,t,n){Ps=Uu;const r=yr(e,t,!1,et);(!n||!n.render)&&(r.user=!0),tt?tt.push(r):qt(r)}function A(e,t,n){n=n?Object.assign({},hr,n):hr;const r=yr(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,qt(r),ks.bind(r)}function Vu(e){return e&&typeof e=="object"&&"then"in e}function Os(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=So,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&A(r);const f=new Set,[m,g]=(i.storage||L)(i.initialValue),[p,y]=L(void 0),[v,b]=L(void 0,{equals:!1}),[w,x]=L(u?"ready":"unresolved");if(Y.context){l=`${Y.context.id}${Y.context.count++}`;let P;i.ssrLoadFrom==="initial"?a=i.initialValue:Y.load&&(P=Y.load(l))&&(a=P)}function T(P,M,$,R){return s===P&&(s=null,R!==void 0&&(u=!0),(P===a||M===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(R,{value:M})),a=So,O(M,$)),M}function O(P,M){nt(()=>{M===void 0&&g(()=>P),x(M!==void 0?"errored":u?"ready":"unresolved"),y(M);for(const $ of f.keys())$.decrement();f.clear()},!1)}function k(){const P=zu,M=m(),$=p();if($!==void 0&&!s)throw $;return oe&&!oe.user&&P&&Po(()=>{v(),s&&(P.resolved||f.has(P)||(P.increment(),f.add(P)))}),M}function j(P=!0){if(P!==!1&&c)return;c=!1;const M=d?d():r;if(M==null||M===!1){T(s,Q(m));return}const $=a!==So?a:Q(()=>o(M,{value:m(),refetching:P}));return Vu($)?(s=$,"value"in $?($.status==="success"?T(s,$.value,void 0,M):T(s,void 0,void 0,M),$):(c=!0,queueMicrotask(()=>c=!1),nt(()=>{x(u?"refreshing":"pending"),b()},!1),$.then(R=>T($,R,void 0,M),R=>T($,void 0,Ms(R),M)))):(T(s,$,void 0,M),$)}return Object.defineProperties(k,{state:{get:()=>w()},error:{get:()=>p()},loading:{get(){const P=w();return P==="pending"||P==="refreshing"}},latest:{get(){if(!u)return k();const P=p();if(P&&!s)throw P;return m()}}}),d?Po(()=>j(!1)):j(!1),[k,{refetch:j,mutate:g}]}function Be(e){return nt(e,!1)}function Q(e){if(oe===null)return e();const t=oe;oe=null;try{return e()}finally{oe=t}}function Nt(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=Q(()=>t(a,o,s));return o=a,l}}function Ft(e){V(()=>Q(e))}function Z(e){return ee===null||(ee.cleanups===null?ee.cleanups=[e]:ee.cleanups.push(e)),e}function Co(){return oe}function Ds(){return ee}function Ku(e,t){const n=ee,r=oe;ee=e,oe=null;try{return nt(t,!0)}catch(o){Do(o)}finally{ee=n,oe=r}}function ye(e,t){const n=Symbol("context");return{id:n,Provider:Wu(n),defaultValue:e}}function ve(e){return ee&&ee.context&&ee.context[e.id]!==void 0?ee.context[e.id]:e.defaultValue}function Oo(e){const t=A(e),n=A(()=>ko(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let zu;function ks(){if(this.sources&&this.state)if(this.state===et)qt(this);else{const e=he;he=null,nt(()=>br(this),!1),he=e}if(oe){const e=this.observers?this.observers.length:0;oe.sources?(oe.sources.push(this),oe.sourceSlots.push(e)):(oe.sources=[this],oe.sourceSlots=[e]),this.observers?(this.observers.push(oe),this.observerSlots.push(oe.sources.length-1)):(this.observers=[oe],this.observerSlots=[oe.sources.length-1])}return this.value}function Ts(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&nt(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Eo&&Eo.running;s&&Eo.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?he.push(i):tt.push(i),i.observers&&As(i)),s||(i.state=et)}if(he.length>1e6)throw he=[],new Error},!1)),t}function qt(e){if(!e.fn)return;wr(e);const t=mr;Bu(e,e.value,t)}function Bu(e,t,n){let r;const o=ee,i=oe;oe=ee=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=et,e.owned&&e.owned.forEach(wr),e.owned=null),e.updatedAt=n+1,Do(s)}finally{oe=i,ee=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ts(e,r):e.value=r,e.updatedAt=n)}function yr(e,t,n,r=et,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ee,context:ee?ee.context:null,pure:n};return ee===null||ee!==Cs&&(ee.owned?ee.owned.push(i):ee.owned=[i]),i}function vr(e){if(e.state===0)return;if(e.state===pr)return br(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<mr);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===et)qt(e);else if(e.state===pr){const r=he;he=null,nt(()=>br(e,t[0]),!1),he=r}}function nt(e,t){if(he)return e();let n=!1;t||(he=[]),tt?n=!0:tt=[],mr++;try{const r=e();return ju(n),r}catch(r){n||(tt=null),he=null,Do(r)}}function ju(e){if(he&&($s(he),he=null),e)return;const t=tt;tt=null,t.length&&nt(()=>Ps(t),!1)}function $s(e){for(let t=0;t<e.length;t++)vr(e[t])}function Uu(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:vr(r)}if(Y.context){if(Y.count){Y.effects||(Y.effects=[]),Y.effects.push(...e.slice(0,n));return}else Y.effects&&(e=[...Y.effects,...e],n+=Y.effects.length,delete Y.effects);Rn()}for(t=0;t<n;t++)vr(e[t])}function br(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===et?r!==t&&(!r.updatedAt||r.updatedAt<mr)&&vr(r):o===pr&&br(r,t)}}}function As(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=pr,n.pure?he.push(n):tt.push(n),n.observers&&As(n))}}function wr(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--)wr(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 Ms(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Do(e,t=ee){throw Ms(e)}function ko(e){if(typeof e=="function"&&!e.length)return ko(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=ko(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Wu(e,t){return function(r){let o;return ue(()=>o=Q(()=>(ee.context={...ee.context,[e]:r.value},Oo(()=>r.children))),void 0),o}}const To=Symbol("fallback");function xr(e){for(let t=0;t<e.length;t++)e[t]()}function Hu(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Z(()=>xr(i)),()=>{let l=e()||[],c,u;return l[gr],Q(()=>{let f=l.length,m,g,p,y,v,b,w,x,T;if(f===0)s!==0&&(xr(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[To],o[0]=ze(O=>(i[0]=O,n.fallback())),s=1);else if(s===0){for(o=new Array(f),u=0;u<f;u++)r[u]=l[u],o[u]=ze(d);s=f}else{for(p=new Array(f),y=new Array(f),a&&(v=new Array(f)),b=0,w=Math.min(s,f);b<w&&r[b]===l[b];b++);for(w=s-1,x=f-1;w>=b&&x>=b&&r[w]===l[x];w--,x--)p[x]=o[w],y[x]=i[w],a&&(v[x]=a[w]);for(m=new Map,g=new Array(x+1),u=x;u>=b;u--)T=l[u],c=m.get(T),g[u]=c===void 0?-1:c,m.set(T,u);for(c=b;c<=w;c++)T=r[c],u=m.get(T),u!==void 0&&u!==-1?(p[u]=o[c],y[u]=i[c],a&&(v[u]=a[c]),u=g[u],m.set(T,u)):i[c]();for(u=b;u<f;u++)u in p?(o[u]=p[u],i[u]=y[u],a&&(a[u]=v[u],a[u](u))):o[u]=ze(d);o=o.slice(0,s=f),r=l.slice(0)}return o});function d(f){if(i[u]=f,a){const[m,g]=L(u);return a[u]=g,t(l[u],m)}return t(l[u])}}}function Yu(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return Z(()=>xr(i)),()=>{const c=e()||[];return c[gr],Q(()=>{if(c.length===0)return a!==0&&(xr(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[To],o[0]=ze(d=>(i[0]=d,n.fallback())),a=1),o;for(r[0]===To&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<c.length;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=ze(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=c.length,r=c.slice(0),o=o.slice(0,a)});function u(d){i[l]=d;const[f,m]=L(c[l]);return s[l]=m,t(f,l)}}}function h(e,t){return Q(()=>e(t||{}))}function Sr(){return!0}const $o={get(e,t,n){return t===Ie?n:e.get(t)},has(e,t){return t===Ie?!0:e.has(t)},set:Sr,deleteProperty:Sr,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Sr,deleteProperty:Sr}},ownKeys(e){return e.keys()}};function Ao(e){return(e=typeof e=="function"?e():e)?e:{}}function Gu(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function I(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ie in a,e[s]=typeof a=="function"?(t=!0,A(a)):a}if(t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Ao(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Ao(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Ao(e[a])));return[...new Set(s)]}},$o);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:Gu.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.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 U(e,...t){if(Ie 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)}},$o));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))}},$o)),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]}function qu(e){let t,n;const r=o=>{const i=Y.context;if(i){const[a,l]=L();Y.count||(Y.count=0),Y.count++,(n||(n=e())).then(c=>{Rn(i),Y.count--,l(()=>c.default),Rn()}),t=a}else if(!t){const[a]=Os(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return A(()=>(s=t())&&Q(()=>{if(!i)return s(o);const a=Y.context;Rn(i);const l=s(o);return Rn(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}let Zu=0;function Le(){const e=Y.context;return e?`${e.id}${e.count++}`:`cl-${Zu++}`}const Is=e=>`Stale read from <${e}>.`;function Zt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(Hu(()=>e.each,e.children,t||void 0))}function _t(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(Yu(()=>e.each,e.children,t||void 0))}function ie(e){const t=e.keyed,n=A(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return A(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Q(()=>o(t?r:()=>{if(!Q(n))throw Is("Show");return e.when})):o}return e.fallback},void 0,void 0)}function Ls(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=Oo(()=>e.children),o=A(()=>{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 A(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Q(()=>l(t?s:()=>{if(Q(o)[0]!==i)throw Is("Match");return a.when})):l},void 0,void 0)}function Nn(e){return e}const Xu=["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"],Ju=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Xu]),Qu=new Set(["innerHTML","textContent","innerText","children"]),ed=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),td=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 nd(e,t){const n=td[e];return typeof n=="object"?n[t]?n.$:void 0:n}const rd=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),od=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"]),id={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function sd(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,f=1,m;for(;++d<o&&d<i&&!((m=c.get(t[d]))==null||m!==u+f);)f++;if(f>u-a){const g=t[s];for(;a<u;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Rs="_$DX_DELEGATE";function B(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?()=>Q(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function ad(e,t=window.document){const n=t[Rs]||(t[Rs]=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,hd))}}function we(e,t,n){Y.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ld(e,t,n,r){Y.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function xt(e,t){Y.context||(t==null?e.removeAttribute("class"):e.className=t)}function cd(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 ud(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]||(_s(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||(_s(e,a,!0),n[a]=l)}return n}function Ns(e,t,n){if(!t)return n?we(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 Xt(e,t={},n,r){const o={};return r||ue(()=>o.children=Jt(e,t.children,o.children)),ue(()=>t.ref&&t.ref(e)),ue(()=>dd(e,t,n,!0,o,!0)),o}function Fs(e,t,n){return Q(()=>e(t,n))}function F(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jt(e,t,r,n);ue(o=>Jt(e,t(),o,n),r)}function dd(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Vs(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jt(e,t.children);continue}const a=t[s];o[s]=Vs(e,s,a,o[s],n,i)}}function fd(e){let t,n;return!Y.context||!(t=Y.registry.get(n=pd()))?e():(Y.completed&&Y.completed.add(t),Y.registry.delete(n),t)}function gd(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _s(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 Vs(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return Ns(e,n,r);if(t==="classList")return ud(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(),f=rd.has(d);if(!f&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(f||n)&&(cd(e,d,n,f),f&&ad([d]))}else if(t.slice(0,5)==="attr:")we(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=Qu.has(t))||!o&&((c=nd(t,e.tagName))||(a=Ju.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(Y.context)return n;t==="class"||t==="className"?xt(e,n):s&&!a&&!l?e[gd(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&id[t.split(":")[0]];d?ld(e,d,t,n):we(e,ed[t]||t,n)}return n}function hd(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}}),Y.registry&&!Y.done&&(Y.done=_$HY.done=!0);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 Jt(e,t,n,r,o){if(Y.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}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(Y.context)return n;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=Qt(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Y.context)return n;n=Qt(e,n,r)}else{if(i==="function")return ue(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jt(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Mo(a,t,n,o))return ue(()=>n=Jt(e,a,n,r,!0)),()=>n;if(Y.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=Qt(e,n,r),s)return n}else l?n.length===0?Ks(e,a,r):sd(e,n,a):(n&&Qt(e),Ks(e,a));n=a}else if(t.nodeType){if(Y.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Qt(e,n,r,t);Qt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Mo(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=Mo(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Mo(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 Ks(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Qt(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 pd(){const e=Y.context;return`${e.id}${e.count++}`}const md=!1,yd="http://www.w3.org/2000/svg";function zs(e,t=!1){return t?document.createElementNS(yd,e):document.createElement(e)}function Io(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Ds();let i,s=!!Y.context;return V(()=>{s&&(Ds().user=s=!1),i||(i=Ku(o,()=>A(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=L(!1),u=()=>c(!0);ze(d=>F(a,()=>l()?d():i(),null)),Z(u)}else{const l=zs(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}),F(c,i),a.appendChild(l),e.ref&&e.ref(l),Z(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Fn(e){const[t,n]=U(e,["component"]),r=A(()=>t.component);return A(()=>{const o=r();switch(typeof o){case"function":return Q(()=>o(n));case"string":const i=od.has(o),s=Y.context?fd():zs(o,i);return Xt(s,n,i),s}})}function vd(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function bd(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 wd(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const i=vd(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return F(r.renderRoot,s)},bd(r))}}function xd(e,t,n){return arguments.length===2&&(n=t,t={}),Nu(e,t)(wd(n))}const Sd='*,: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-2{left:.5rem}.left-5{left:1.25rem}.left-9{left:2.25rem}.right-5{right:1.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-\\[98\\%\\]{width:98%}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}@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-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-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))}',[Bs,Lo]=L(!1),js=[],Ed=e=>js.push(e),Us=()=>{js.forEach(e=>e())},Pd=()=>{Lo(!Bs()),Us()},Cd=()=>{Lo(!1)},Od=()=>{Lo(!0),Us()},Ws=()=>({bubble:Bs,show:Od,hide:Cd,toggle:Pd,onOpen:Ed}),Ro=Symbol("store-raw"),en=Symbol("store-node"),rt=Symbol("store-has"),Hs=Symbol("store-self");function Ys(e){let t=e[Ie];if(!t&&(Object.defineProperty(e,Ie,{value:t=new Proxy(e,Td)}),!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 St(e){let t;return e!=null&&typeof e=="object"&&(e[Ie]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function tn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Ro])return n;if(!St(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=tn(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=tn(o,t))!==o&&(e[i]=r))}return e}function Er(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function _n(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Dd(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Ie||t===en||(delete n.value,delete n.writable,n.get=()=>e[Ie][t]),n}function Gs(e){Co()&&_n(Er(e,en),Hs)()}function kd(e){return Gs(e),Reflect.ownKeys(e)}const Td={get(e,t,n){if(t===Ro)return e;if(t===Ie)return n;if(t===gr)return Gs(e),n;const r=Er(e,en),o=r[t];let i=o?o():e[t];if(t===en||t===rt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Co()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=_n(r,t,i)())}return St(i)?Ys(i):i},has(e,t){return t===Ro||t===Ie||t===gr||t===en||t===rt||t==="__proto__"?!0:(Co()&&_n(Er(e,rt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:kd,getOwnPropertyDescriptor:Dd};function Re(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[rt]&&e[rt][t]&&o!==void 0&&e[rt][t].$()):(e[t]=n,e[rt]&&e[rt][t]&&o===void 0&&e[rt][t].$());let s=Er(e,en),a;if((a=_n(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=_n(s,"length",i))&&a.$(e.length)}(a=s[Hs])&&a.$()}function qs(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Re(e,o,t[o])}}function $d(e,t){if(typeof t=="function"&&(t=t(e)),t=tn(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&&Re(e,n,o)}Re(e,"length",r)}else qs(e,t)}function Vn(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++)Vn(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Vn(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)Vn(e,[d].concat(t),n);return}else if(t.length>1){Vn(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=tn(i),r===void 0||St(o)&&St(i)&&!Array.isArray(i)?qs(o,i):Re(e,r,i))}function Zs(...[e,t]){const n=tn(e||{}),r=Array.isArray(n),o=Ys(n);function i(...s){Be(()=>{r&&s.length===1?$d(n,s[0]):Vn(n,s)})}return[o,i]}const No=Symbol("store-root");function nn(e,t,n,r,o){const i=t[n];if(e===i)return;const s=Array.isArray(e);if(n!==No&&(!St(e)||!St(i)||s!==Array.isArray(i)||o&&e[o]!==i[o])){Re(t,n,e);return}if(s){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let c,u,d,f,m,g,p,y;for(d=0,f=Math.min(i.length,e.length);d<f&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]===e[d][o]);d++)nn(e[d],i,d,r,o);const v=new Array(e.length),b=new Map;for(f=i.length-1,m=e.length-1;f>=d&&m>=d&&(i[f]===e[m]||o&&i[d]&&e[d]&&i[f][o]===e[m][o]);f--,m--)v[m]=i[f];if(d>m||d>f){for(u=d;u<=m;u++)Re(i,u,e[u]);for(;u<e.length;u++)Re(i,u,v[u]),nn(e[u],i,u,r,o);i.length>e.length&&Re(i,"length",e.length);return}for(p=new Array(m+1),u=m;u>=d;u--)g=e[u],y=o&&g?g[o]:g,c=b.get(y),p[u]=c===void 0?-1:c,b.set(y,u);for(c=d;c<=f;c++)g=i[c],y=o&&g?g[o]:g,u=b.get(y),u!==void 0&&u!==-1&&(v[u]=i[c],u=p[u],b.set(y,u));for(u=d;u<e.length;u++)u in v?(Re(i,u,v[u]),nn(e[u],i,u,r,o)):Re(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)nn(e[c],i,c,r,o);i.length>e.length&&Re(i,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c<u;c++)nn(e[a[c]],i,a[c],r,o);const l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&Re(i,l[c],void 0)}function Ad(e,t={}){const{merge:n,key:r="id"}=t,o=tn(e);return i=>{if(!St(i)||!St(o))return o;const s=nn(o,{[No]:i},No,n,r);return s===void 0?i:s}}function Xs(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Js(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 Qs(e,t,n){return ze(()=>{const r=Js(e),[o,i]=Zs(r?JSON.parse(r):t);return V(()=>Xs(e,JSON.stringify(o),n)),[o,i]})}function Md(e,t,n){return ze(()=>{const r=Js(e),[o,i]=L(r?JSON.parse(r):t);return V(()=>Xs(e,JSON.stringify(o()),n)),[o,i]})}Md("lang","en");function ea(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=ea(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Id(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ea(e))&&(r&&(r+=" "),r+=t);return r}const Fo="-";function Ld(e){const t=Nd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(Fo);return a[0]===""&&a.length!==1&&a.shift(),ta(a,t)||Rd(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function ta(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ta(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Fo);return t.validators.find(({validator:s})=>s(i))?.classGroupId}const na=/^\[(.+)\]$/;function Rd(e){if(na.test(e)){const t=na.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Nd(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return _d(Object.entries(e.classGroups),n).forEach(([i,s])=>{_o(s,r,i,t)}),r}function _o(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ra(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Fd(o)){_o(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{_o(s,ra(t,i),n,r)})})}function ra(e,t){let n=e;return t.split(Fo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Fd(e){return e.isThemeGetter}function _d(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 Vd(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 oa="!";function Kd(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 p=0;p<s.length;p++){let y=s[p];if(l===0){if(y===r&&(n||s.slice(p,p+o)===t)){a.push(s.slice(c,p)),c=p+o;continue}if(y==="/"){u=p;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(oa),m=f?d.substring(1):d,g=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:g}}}function zd(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 Bd(e){return{cache:Vd(e.cacheSize),splitModifiers:Kd(e),...Ld(e)}}const jd=/\s+/;function Ud(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(jd).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const m=zd(a).join(":");return{isTailwindClass:!0,modifierId:l?m+oa:m,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).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 Wd(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ia(t))&&(r&&(r+=" "),r+=n);return r}function ia(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ia(e[r]))&&(n&&(n+=" "),n+=t);return n}function Hd(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Bd(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=Ud(l,n);return o(l,u),u}return function(){return i(Wd.apply(null,arguments))}}function ae(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const sa=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yd=/^\d+\/\d+$/,Gd=new Set(["px","full","screen"]),qd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zd=/\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$/,Xd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jd=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ot(e){return Vt(e)||Gd.has(e)||Yd.test(e)}function Et(e){return rn(e,"length",lf)}function Vt(e){return!!e&&!Number.isNaN(Number(e))}function Pr(e){return rn(e,"number",Vt)}function Kn(e){return!!e&&Number.isInteger(Number(e))}function ef(e){return e.endsWith("%")&&Vt(e.slice(0,-1))}function q(e){return sa.test(e)}function Pt(e){return qd.test(e)}const tf=new Set(["length","size","percentage"]);function nf(e){return rn(e,tf,aa)}function rf(e){return rn(e,"position",aa)}const of=new Set(["image","url"]);function sf(e){return rn(e,of,uf)}function af(e){return rn(e,"",cf)}function zn(){return!0}function rn(e,t,n){const r=sa.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function lf(e){return Zd.test(e)&&!Xd.test(e)}function aa(){return!1}function cf(e){return Jd.test(e)}function uf(e){return Qd.test(e)}function df(){const e=ae("colors"),t=ae("spacing"),n=ae("blur"),r=ae("brightness"),o=ae("borderColor"),i=ae("borderRadius"),s=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),c=ae("grayscale"),u=ae("hueRotate"),d=ae("invert"),f=ae("gap"),m=ae("gradientColorStops"),g=ae("gradientColorStopPositions"),p=ae("inset"),y=ae("margin"),v=ae("opacity"),b=ae("padding"),w=ae("saturate"),x=ae("scale"),T=ae("sepia"),O=ae("skew"),k=ae("space"),j=ae("translate"),P=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",q,t],R=()=>[q,t],se=()=>["",ot,Et],J=()=>["auto",Vt,q],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],ge=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",q],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>[Vt,Pr],W=()=>[Vt,q];return{cacheSize:500,separator:":",theme:{colors:[zn],spacing:[ot,Et],blur:["none","",Pt,q],brightness:C(),borderColor:[e],borderRadius:["none","","full",Pt,q],borderSpacing:R(),borderWidth:se(),contrast:C(),grayscale:E(),hueRotate:W(),invert:E(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[ef,Et],inset:$(),margin:$(),opacity:C(),padding:R(),saturate:C(),scale:C(),sepia:E(),skew:W(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[Pt]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:[...re(),q]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kn,q]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",Kn,q]}],"grid-cols":[{"grid-cols":[zn]}],"col-start-end":[{col:["auto",{span:["full",Kn,q]},q]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[zn]}],"row-start-end":[{row:["auto",{span:[Kn,q]},q]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ge()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ge(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ge(),"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",q,t]}],"min-w":[{"min-w":[q,t,"min","max","fit"]}],"max-w":[{"max-w":[q,t,"none","full","min","max","fit","prose",{screen:[Pt]},Pt]}],h:[{h:[q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Pt,Et]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pr]}],"font-family":[{font:[zn]}],"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",q]}],"line-clamp":[{"line-clamp":["none",Vt,Pr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ot,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ot,Et]}],"underline-offset":[{"underline-offset":["auto",ot,q]}],"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",q]}],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",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),rf]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nf]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sf]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"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":[v]}],"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":[v]}],"divide-style":[{divide:N()}],"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:["",...N()]}],"outline-offset":[{"outline-offset":[ot,q]}],"outline-w":[{outline:[ot,Et]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ot,Et]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Pt,af]}],"shadow-color":[{shadow:[zn]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":X()}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Pt,q]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[T]}],"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":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"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",q]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Kn,q]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",q]}],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",q]}],"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",q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ot,Et,Pr]}],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 ff=Hd(df);function le(...e){return ff(Id(e))}function gf(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",Cr(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Cr(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Cr(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Cr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Cr(e){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 hf(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 pf(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 Bn(){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 Vo="https://voyager.guide121.dev";function mf(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 yf(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 vf=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.log("fetching widget:",n);const o=`${Vo}/v1/webhooks/widget/${n}`,i=await(await fetch(o)).json();return i.type==="flow"?mf(i):i.type==="entity"?yf(i):(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),i)},[bf,wf]=L(""),[on]=ze(()=>Os(bf,vf)),xf=()=>{if(on()?.type==="chat")return on()},Sf=()=>{if(on()?.type==="form")return on()};ze(()=>V(()=>gf(on())));const Pe=()=>({setWidgetId:wf,widget:on,chatWidget:xf,formWidget:Sf});function la(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=la(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ef(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=la(e))&&(r&&(r+=" "),r+=t);return r}const ca=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,ua=Ef,Pf=(e,t)=>n=>{var r;if(t?.variants==null)return ua(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 f=ca(u)||ca(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...m}=u;return Object.entries(m).every(g=>{let[p,y]=g;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...c,d,f]:c},[]);return ua(e,s,l,n?.class,n?.className)};var Cf=B("<button>");const jn=Pf("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"}}),Ce=e=>{const[,t]=U(e,["variant","size","class"]);return(()=>{var n=Cf();return Xt(n,I({get class(){return le(jn({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Of=B('<img alt="widget logo">');const da=e=>{const[,t]=U(e,["class","src"]);return(()=>{var n=Of();return Xt(n,I({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return le("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Df=B('<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 kf=()=>{const{chatWidget:e}=Pe();return(()=>{var t=Df(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return F(t,h(da,{get src(){return e()?.avatar}}),n),F(r,()=>e()?.title??"Izi"),F(o,()=>e()?.subtitle??"SmartTalks.ai"),t})()};var Tf=B("<svg stroke-width=0>");function pe(e,t){const n=I(e.a,t),[r,o]=U(n,["src"]),[i,s]=L(""),a=A(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return V(()=>s(a())),Z(()=>{s("")}),(()=>{var l=Tf();return Xt(l,I({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),F(l,()=>md),l})()}function $f(e){return pe({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 Af(e){return pe({a:{fill:"currentColor",viewBox:"0 0 24 24"},c:'<path d="m3.463 12.86-.005-.07.005.07zm7.264.69-3.034-3.049 1.014-1.014 3.209 3.225 3.163-3.163 1.014 1.014-3.034 3.034 3.034 3.05-1.014 1.014-3.209-3.225L8.707 17.6l-1.014-1.014 3.034-3.034z"/><path fill-rule="evenodd" d="M16.933 5.003V6h1.345l2.843-2.842 1.014 1.014-2.692 2.691.033.085a13.75 13.75 0 0 1 .885 4.912c0 .335-.011.667-.034.995l-.005.075h3.54v1.434h-3.72l-.01.058c-.303 1.653-.891 3.16-1.692 4.429l-.06.094 3.423 3.44-1.017 1.012-3.274-3.29-.099.11c-1.479 1.654-3.395 2.646-5.483 2.646-2.12 0-4.063-1.023-5.552-2.723l-.098-.113-3.209 3.208-1.014-1.014 3.366-3.365-.059-.095c-.772-1.25-1.34-2.725-1.636-4.34l-.01-.057H0V12.93h3.538l-.005-.075a14.23 14.23 0 0 1-.034-.995c0-1.743.31-3.39.863-4.854l.032-.084-2.762-2.776L2.65 3.135 5.5 6h1.427v-.997a5.003 5.003 0 0 1 10.006 0zm-8.572 0V6H15.5v-.997a3.569 3.569 0 0 0-7.138 0zm9.8 2.522-.034-.09H5.733l-.034.09a12.328 12.328 0 0 0-.766 4.335c0 2.76.862 5.201 2.184 6.92 1.32 1.716 3.036 2.649 4.813 2.649 1.777 0 3.492-.933 4.813-2.65 1.322-1.718 2.184-4.16 2.184-6.919 0-1.574-.28-3.044-.766-4.335z" clip-rule="evenodd"/>'},e)}function Mf(e){return pe({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 If(e){return pe({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 Lf(e){return pe({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 Rf(e){return(...t)=>{for(const n of e)n&&n(...t)}}var D=e=>typeof e=="function"&&!e.length?e():e,fa=e=>Array.isArray(e)?e:e?[e]:[];function Nf(e,...t){return typeof e=="function"?e(...t):e}var Ff=Z;function _f(e,t,n,r){return e.addEventListener(t,n,r),Ff(e.removeEventListener.bind(e,t,n,r))}function Vf(e,t,n,r){const o=()=>{fa(D(e)).forEach(i=>{i&&fa(D(t)).forEach(s=>_f(i,s,n,r))})};typeof e=="function"?V(o):ue(o)}var Kf={equals:!1};function zf(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Bf(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var Ko=e=>typeof e=="function"&&!e.length?e():e;function Or(){return!0}var jf={get(e,t,n){return t===Ie?n:e.get(t)},has(e,t){return e.has(t)},set:Or,deleteProperty:Or,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Or,deleteProperty:Or}},ownKeys(e){return e.keys()}},Uf=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ga(e){const t={};let n;for(;n=Uf.exec(e);)t[n[1]]=n[2];return t}function Wf(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ga(e)}else typeof t=="string"&&(t=ga(t));return{...e,...t}}var zo=(e,t,n)=>{let r;for(const o of e){const i=Ko(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Hf(...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?Bf:zf,o={};for(const s of n){const a=Ko(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=I(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return zo(n,"style",Wf);if(s==="ref"){const a=[];for(const l of n){const c=Ko(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"?zo(n,s,(a,l)=>`${a} ${l}`):s==="classList"?zo(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},jf)}function Ct(...e){return Rf(e)}function Yf(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Bo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Gf(e){return typeof e=="number"}function qf(e){return Array.isArray(e)}function sn(e){return Object.prototype.toString.call(e)==="[object String]"}function Zf(e){return typeof e=="function"}function ha(e){return t=>`${e()}-${t}`}function Ze(e,t){return e?e===t||e.contains(t):!1}function Un(e,t=!1){const{activeElement:n}=it(e);if(!n?.nodeName)return null;if(pa(n)&&n.contentDocument)return Un(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=it(n).getElementById(r);if(o)return o}}return n}function it(e){return e?e.ownerDocument||e:document}function pa(e){return e.tagName==="IFRAME"}var ma=(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))(ma||{});function jo(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Dr(){return jo(/^Mac/i)}function Xf(){return jo(/^iPhone/i)}function Jf(){return jo(/^iPad/i)||Dr()&&navigator.maxTouchPoints>1}function Qf(){return Xf()||Jf()}function eg(){return Dr()||Qf()}function Oe(e,t){return t&&(Zf(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function Ne(e){return t=>{for(const n of e)Oe(t,n)}}function tg(e){return Dr()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function xe(e){if(e)if(ng())e.focus({preventScroll:!0});else{const t=rg(e);e.focus(),og(t)}}var kr=null;function ng(){if(kr==null){kr=!1;try{document.createElement("div").focus({get preventScroll(){return kr=!0,!0}})}catch{}}return kr}function rg(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 og(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ya=["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'])"],ig=[...ya,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Uo=ya.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",sg=ig.join(':not([hidden]):not([tabindex="-1"]),');function va(e,t){const r=Array.from(e.querySelectorAll(Uo)).filter(ba);return t&&ba(e)&&r.unshift(e),r.forEach((o,i)=>{if(pa(o)&&o.contentDocument){const s=o.contentDocument.body,a=va(s,!1);r.splice(i,1,...a)}}),r}function ba(e){return wa(e)&&!ag(e)}function wa(e){return e.matches(Uo)&&Wo(e)}function ag(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Wo(e,t){return e.nodeName!=="#comment"&&lg(e)&&cg(e,t)&&(!e.parentElement||Wo(e.parentElement,e))}function lg(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 cg(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function ug(e,t){return t.some(n=>n.contains(e))}function dg(e,t,n){const r=t?.tabbable?sg:Uo,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Wo(i)&&(!n||ug(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function xa(e){for(;e&&!fg(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function fg(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function gg(){}function hg(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,f]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>m&&(o=!o):o=!o)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<m&&(o=!o):o=!o)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function De(e,t){return I(e,t)}var Wn=new Map,Sa=new Set;function Ea(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Wn.get(n.target);r||(r=new Set,Wn.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Wn.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Wn.delete(n.target)),Wn.size===0)){for(const o of Sa)o();Sa.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Ea():document.addEventListener("DOMContentLoaded",Ea));function Ho(e,t){const n=Pa(e,t,"left"),r=Pa(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 Pa(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 pg(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=xa(e);for(;e&&o&&e!==n&&o!==n;)Ho(o,e),e=o,o=xa(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 mg={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 Yo(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=sn(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=sn(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(sn(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return sn(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(sn(l)||Gf(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=Yo({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(qt){typeof define=="function"&&define.amd?define(qt):qt()})(function(){"use strict";function qt(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),so(o.value)&&!ta(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 Js(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=so(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=ea(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Zs(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Qs(e,t){const n=qt(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?oo(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&io(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&&io(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 oo(e){if(e)try{return JSON.parse(e)}catch{return e}}function io(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 ea(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function so(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function ta(e){return Object.prototype.toString.call(e)==="[object Function]"}function na(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let zn;function ra(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=Qs(this,t);const o=Zs(this.props),i=this.Component,s=zn;try{zn=this,this.__initialized=!0,na(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?oo(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 oa(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=ra(r,Js(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const F={context:void 0,registry:void 0};function Ot(e){F.context=e}const ia=(e,t)=>e===t,me=Symbol("solid-proxy"),Vn=Symbol("solid-track"),Wt={equals:ia};let ao=go;const Me=1,Gt=2,lo={owned:null,cleanups:null,context:null,owner:null},Un={};var q=null;let jn=null,sa=null,G=null,ne=null,De=null,Yt=0;function Le(e,t){const n=G,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(()=>W(()=>Qt(s)));q=s,G=null;try{return Ie(a,!0)}finally{G=n,q=r}}function _(e,t){t=t?Object.assign({},Wt,t):Wt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),ho(n,o));return[fo.bind(n),r]}function Hn(e,t,n){const r=Xt(e,t,!0,Me);st(r)}function Q(e,t,n){const r=Xt(e,t,!1,Me);st(r)}function M(e,t,n){ao=fa;const r=Xt(e,t,!1,Me);(!n||!n.render)&&(r.user=!0),De?De.push(r):st(r)}function O(e,t,n){n=n?Object.assign({},Wt,n):Wt;const r=Xt(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,st(r),fo.bind(r)}function aa(e){return e&&typeof e=="object"&&"then"in e}function co(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=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&O(r);const h=new Set,[m,f]=(i.storage||_)(i.initialValue),[g,y]=_(void 0),[w,b]=_(void 0,{equals:!1}),[v,x]=_(u?"ready":"unresolved");if(F.context){l=`${F.context.id}${F.context.count++}`;let C;i.ssrLoadFrom==="initial"?a=i.initialValue:F.load&&(C=F.load(l))&&(a=C)}function P(C,K,I,D){return s===C&&(s=null,D!==void 0&&(u=!0),(C===a||K===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(D,{value:K})),a=Un,S(K,I)),K}function S(C,K){Ie(()=>{K===void 0&&f(()=>C),x(K!==void 0?"errored":u?"ready":"unresolved"),y(K);for(const I of h.keys())I.decrement();h.clear()},!1)}function k(){const C=ca,K=m(),I=g();if(I!==void 0&&!s)throw I;return G&&!G.user&&C&&Hn(()=>{w(),s&&(C.resolved||h.has(C)||(C.increment(),h.add(C)))}),K}function R(C=!0){if(C!==!1&&c)return;c=!1;const K=d?d():r;if(K==null||K===!1){P(s,W(m));return}const I=a!==Un?a:W(()=>o(K,{value:m(),refetching:C}));return aa(I)?(s=I,"value"in I?(I.status==="success"?P(s,I.value,void 0,K):P(s,void 0,void 0,K),I):(c=!0,queueMicrotask(()=>c=!1),Ie(()=>{x(u?"refreshing":"pending"),b()},!1),I.then(D=>P(I,D,void 0,K),D=>P(I,void 0,mo(D),K)))):(P(s,I,void 0,K),I)}return Object.defineProperties(k,{state:{get:()=>v()},error:{get:()=>g()},loading:{get(){const C=v();return C==="pending"||C==="refreshing"}},latest:{get(){if(!u)return k();const C=g();if(C&&!s)throw C;return m()}}}),d?Hn(()=>R(!1)):R(!1),[k,{refetch:R,mutate:f}]}function Se(e){return Ie(e,!1)}function W(e){if(G===null)return e();const t=G;G=null;try{return e()}finally{G=t}}function Je(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=W(()=>t(a,o,s));return o=a,l}}function _t(e){M(()=>W(e))}function B(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function qn(){return G}function uo(){return q}function la(e,t){const n=q,r=G;q=e,G=null;try{return Ie(t,!0)}catch(o){Gn(o)}finally{q=n,G=r}}function se(e,t){const n=Symbol("context");return{id:n,Provider:ha(n),defaultValue:e}}function ue(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 ca;function fo(){if(this.sources&&this.state)if(this.state===Me)st(this);else{const e=ne;ne=null,Ie(()=>Zt(this),!1),ne=e}if(G){const e=this.observers?this.observers.length:0;G.sources?(G.sources.push(this),G.sourceSlots.push(e)):(G.sources=[this],G.sourceSlots=[e]),this.observers?(this.observers.push(G),this.observerSlots.push(G.sources.length-1)):(this.observers=[G],this.observerSlots=[G.sources.length-1])}return this.value}function ho(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ie(()=>{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?ne.push(i):De.push(i),i.observers&&po(i)),s||(i.state=Me)}if(ne.length>1e6)throw ne=[],new Error},!1)),t}function st(e){if(!e.fn)return;Qt(e);const t=Yt;ua(e,e.value,t)}function ua(e,t,n){let r;const o=q,i=G;G=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Me,e.owned&&e.owned.forEach(Qt),e.owned=null),e.updatedAt=n+1,Gn(s)}finally{G=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ho(e,r):e.value=r,e.updatedAt=n)}function Xt(e,t,n,r=Me,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 Jt(e){if(e.state===0)return;if(e.state===Gt)return Zt(e);if(e.suspense&&W(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Yt);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Me)st(e);else if(e.state===Gt){const r=ne;ne=null,Ie(()=>Zt(e,t[0]),!1),ne=r}}function Ie(e,t){if(ne)return e();let n=!1;t||(ne=[]),De?n=!0:De=[],Yt++;try{const r=e();return da(n),r}catch(r){n||(De=null),ne=null,Gn(r)}}function da(e){if(ne&&(go(ne),ne=null),e)return;const t=De;De=null,t.length&&Ie(()=>ao(t),!1)}function go(e){for(let t=0;t<e.length;t++)Jt(e[t])}function fa(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jt(r)}if(F.context){if(F.count){F.effects||(F.effects=[]),F.effects.push(...e.slice(0,n));return}else F.effects&&(e=[...F.effects,...e],n+=F.effects.length,delete F.effects);Ot()}for(t=0;t<n;t++)Jt(e[t])}function Zt(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===Me?r!==t&&(!r.updatedAt||r.updatedAt<Yt)&&Jt(r):o===Gt&&Zt(r,t)}}}function po(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Gt,n.pure?ne.push(n):De.push(n),n.observers&&po(n))}}function Qt(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--)Qt(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 mo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Gn(e,t=q){throw mo(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 ha(e,t){return function(r){let o;return Q(()=>o=W(()=>(q.context={...q.context,[e]:r.value},Wn(()=>r.children))),void 0),o}}const ga=Symbol("fallback");function yo(e){for(let t=0;t<e.length;t++)e[t]()}function pa(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return B(()=>yo(i)),()=>{let l=e()||[],c,u;return l[Vn],W(()=>{let h=l.length,m,f,g,y,w,b,v,x,P;if(h===0)s!==0&&(yo(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ga],o[0]=Le(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]=Le(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--)P=l[u],c=m.get(P),f[u]=c===void 0?-1:c,m.set(P,u);for(c=b;c<=v;c++)P=r[c],u=m.get(P),u!==void 0&&u!==-1?(g[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=f[u],m.set(P,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]=Le(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[m,f]=_(u);return a[u]=f,t(l[u],m)}return t(l[u])}}}function p(e,t){return W(()=>e(t||{}))}function en(){return!0}const Xn={get(e,t,n){return t===me?n:e.get(t)},has(e,t){return t===me?!0:e.has(t)},set:en,deleteProperty:en,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:en,deleteProperty:en}},ownKeys(e){return e.keys()}};function Jn(e){return(e=typeof e=="function"?e():e)?e:{}}function ma(){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&&me 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:ma.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 H(e,...t){if(me 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]}function ya(e){let t,n;const r=o=>{const i=F.context;if(i){const[a,l]=_();F.count||(F.count=0),F.count++,(n||(n=e())).then(c=>{Ot(i),F.count--,l(()=>c.default),Ot()}),t=a}else if(!t){const[a]=co(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return O(()=>(s=t())&&W(()=>{if(!i)return s(o);const a=F.context;Ot(i);const l=s(o);return Ot(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}let ba=0;function Ce(){const e=F.context;return e?`${e.id}${e.count++}`:`cl-${ba++}`}const bo=e=>`Stale read from <${e}>.`;function at(e){const t="fallback"in e&&{fallback:()=>e.fallback};return O(pa(()=>e.each,e.children,t||void 0))}function J(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?W(()=>o(t?r:()=>{if(!W(n))throw bo("Show");return e.when})):o}return e.fallback},void 0,void 0)}function wo(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?W(()=>l(t?s:()=>{if(W(o)[0]!==i)throw bo("Match");return a.when})):l},void 0,void 0)}function Pt(e){return e}const wa=["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"],va=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...wa]),xa=new Set(["innerHTML","textContent","innerText","children"]),Sa=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Ea=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 ka(e,t){const n=Ea[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Ca=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Oa=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"]),_a={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Pa(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 vo="_$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?()=>W(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Aa(e,t=window.document){const n=t[vo]||(t[vo]=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,$a))}}function ae(e,t,n){F.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Ta(e,t,n,r){F.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ze(e,t){F.context||(t==null?e.removeAttribute("class"):e.className=t)}function Ma(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 Da(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]||(Eo(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||(Eo(e,a,!0),n[a]=l)}return n}function xo(e,t,n){if(!t)return n?ae(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 Qe(e,t={},n,r){const o={};return r||Q(()=>o.children=lt(e,t.children,o.children)),Q(()=>t.ref&&t.ref(e)),Q(()=>La(e,t,n,!0,o,!0)),o}function So(e,t,n){return W(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return lt(e,t,r,n);Q(o=>lt(e,t(),o,n),r)}function La(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=ko(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||lt(e,t.children);continue}const a=t[s];o[s]=ko(e,s,a,o[s],n,i)}}function Ia(e){let t,n;return!F.context||!(t=F.registry.get(n=Fa()))?e():(F.completed&&F.completed.add(t),F.registry.delete(n),t)}function Ra(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Eo(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 ko(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return xo(e,n,r);if(t==="classList")return Da(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=Ca.has(d);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(h||n)&&(Ma(e,d,n,h),h&&Aa([d]))}else if(t.slice(0,5)==="attr:")ae(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=xa.has(t))||!o&&((c=ka(t,e.tagName))||(a=va.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(F.context)return n;t==="class"||t==="className"?Ze(e,n):s&&!a&&!l?e[Ra(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&_a[t.split(":")[0]];d?Ta(e,d,t,n):ae(e,Sa[t]||t,n)}return n}function $a(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}}),F.registry&&!F.done&&(F.done=_$HY.done=!0);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 lt(e,t,n,r,o){if(F.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}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(F.context)return n;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=ct(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(F.context)return n;n=ct(e,n,r)}else{if(i==="function")return Q(()=>{let a=t();for(;typeof a=="function";)a=a();n=lt(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Zn(a,t,n,o))return Q(()=>n=lt(e,a,n,r,!0)),()=>n;if(F.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=ct(e,n,r),s)return n}else l?n.length===0?Co(e,a,r):Pa(e,n,a):(n&&ct(e),Co(e,a));n=a}else if(t.nodeType){if(F.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=ct(e,n,r,t);ct(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 Co(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ct(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 Fa(){const e=F.context;return`${e.id}${e.count++}`}const Na=!1,Ka="http://www.w3.org/2000/svg";function Oo(e,t=!1){return t?document.createElementNS(Ka,e):document.createElement(e)}function _o(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=uo();let i,s=!!F.context;return M(()=>{s&&(uo().user=s=!1),i||(i=la(o,()=>O(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=_(!1),u=()=>c(!0);Le(d=>A(a,()=>l()?d():i(),null)),B(u)}else{const l=Oo(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),B(()=>a.removeChild(l))}},void 0,{render:!s}),n}function tn(e){const[t,n]=H(e,["component"]),r=O(()=>t.component);return O(()=>{const o=r();switch(typeof o){case"function":return W(()=>o(n));case"string":const i=Oa.has(o),s=F.context?Ia():Oo(o,i);return Qe(s,n,i),s}})}function Ba(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=_(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function za(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 Va(e){return(t,n)=>{const{element:r}=n;return Le(o=>{const i=Ba(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},za(r))}}function Ua(e,t,n){return arguments.length===2&&(n=t,t={}),oa(e,t)(Va(n))}const ja='*,: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-5{left:1.25rem}.left-9{left:2.25rem}.right-5{right:1.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[98\\%\\]{width:98%}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Po,Qn]=_(!1),Ao=[],Ha=e=>Ao.push(e),To=()=>{Ao.forEach(e=>e())},qa=()=>{Qn(!Po()),To()},Wa=()=>{Qn(!1)},Ga=()=>{Qn(!0),To()},Mo=()=>({bubble:Po,show:Ga,hide:Wa,toggle:qa,onOpen:Ha}),er=Symbol("store-raw"),ut=Symbol("store-node"),Re=Symbol("store-has"),Do=Symbol("store-self");function Lo(e){let t=e[me];if(!t&&(Object.defineProperty(e,me,{value:t=new Proxy(e,Ja)}),!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 nn(e){let t;return e!=null&&typeof e=="object"&&(e[me]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function At(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[er])return n;if(!nn(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=At(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=At(o,t))!==o&&(e[i]=r))}return e}function rn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Tt(e,t,n){if(e[t])return e[t];const[r,o]=_(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ya(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===me||t===ut||(delete n.value,delete n.writable,n.get=()=>e[me][t]),n}function Io(e){qn()&&Tt(rn(e,ut),Do)()}function Xa(e){return Io(e),Reflect.ownKeys(e)}const Ja={get(e,t,n){if(t===er)return e;if(t===me)return n;if(t===Vn)return Io(e),n;const r=rn(e,ut),o=r[t];let i=o?o():e[t];if(t===ut||t===Re||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);qn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Tt(r,t,i)())}return nn(i)?Lo(i):i},has(e,t){return t===er||t===me||t===Vn||t===ut||t===Re||t==="__proto__"?!0:(qn()&&Tt(rn(e,Re),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Xa,getOwnPropertyDescriptor:Ya};function on(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[Re]&&e[Re][t]&&o!==void 0&&e[Re][t].$()):(e[t]=n,e[Re]&&e[Re][t]&&o===void 0&&e[Re][t].$());let s=rn(e,ut),a;if((a=Tt(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Tt(s,"length",i))&&a.$(e.length)}(a=s[Do])&&a.$()}function Ro(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];on(e,o,t[o])}}function Za(e,t){if(typeof t=="function"&&(t=t(e)),t=At(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&&on(e,n,o)}on(e,"length",r)}else Ro(e,t)}function Mt(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++)Mt(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Mt(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)Mt(e,[d].concat(t),n);return}else if(t.length>1){Mt(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=At(i),r===void 0||nn(o)&&nn(i)&&!Array.isArray(i)?Ro(o,i):on(e,r,i))}function Qa(...[e,t]){const n=At(e||{}),r=Array.isArray(n),o=Lo(n);function i(...s){Se(()=>{r&&s.length===1?Za(n,s[0]):Mt(n,s)})}return[o,i]}function $o(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Fo(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 No(e,t,n){return Le(()=>{const r=Fo(e),[o,i]=Qa(r?JSON.parse(r):t);return M(()=>$o(e,JSON.stringify(o),n)),[o,i]})}function el(e,t,n){return Le(()=>{const r=Fo(e),[o,i]=_(r?JSON.parse(r):t);return M(()=>$o(e,JSON.stringify(o()),n)),[o,i]})}el("lang","en");function Ko(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=Ko(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ko(e))&&(r&&(r+=" "),r+=t);return r}const tr="-";function nl(e){const t=ol(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(tr);return a[0]===""&&a.length!==1&&a.shift(),Bo(a,t)||rl(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Bo(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Bo(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 zo=/^\[(.+)\]$/;function rl(e){if(zo.test(e)){const t=zo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function ol(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sl(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:Vo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(il(o)){nr(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{nr(s,Vo(t,i),n,r)})})}function Vo(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 il(e){return e.isThemeGetter}function sl(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 al(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 Uo="!";function ll(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(Uo),m=h?d.substring(1):d,f=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:f}}}function cl(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 ul(e){return{cache:al(e.cacheSize),splitModifiers:ll(e),...nl(e)}}const dl=/\s+/;function fl(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(dl).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=cl(a).join(":");return{isTailwindClass:!0,modifierId:l?m+Uo: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 hl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=jo(t))&&(r&&(r+=" "),r+=n);return r}function jo(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=jo(e[r]))&&(n&&(n+=" "),n+=t);return n}function gl(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=ul(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=fl(l,n);return o(l,u),u}return function(){return i(hl.apply(null,arguments))}}function Y(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Ho=/^\[(?:([a-z-]+):)?(.+)\]$/i,pl=/^\d+\/\d+$/,ml=new Set(["px","full","screen"]),yl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bl=/\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$/,wl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vl=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function $e(e){return et(e)||ml.has(e)||pl.test(e)}function Ve(e){return dt(e,"length",Al)}function et(e){return!!e&&!Number.isNaN(Number(e))}function sn(e){return dt(e,"number",et)}function Dt(e){return!!e&&Number.isInteger(Number(e))}function Sl(e){return e.endsWith("%")&&et(e.slice(0,-1))}function N(e){return Ho.test(e)}function Ue(e){return yl.test(e)}const El=new Set(["length","size","percentage"]);function kl(e){return dt(e,El,qo)}function Cl(e){return dt(e,"position",qo)}const Ol=new Set(["image","url"]);function _l(e){return dt(e,Ol,Ml)}function Pl(e){return dt(e,"",Tl)}function Lt(){return!0}function dt(e,t,n){const r=Ho.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Al(e){return bl.test(e)&&!wl.test(e)}function qo(){return!1}function Tl(e){return vl.test(e)}function Ml(e){return xl.test(e)}function Dl(){const e=Y("colors"),t=Y("spacing"),n=Y("blur"),r=Y("brightness"),o=Y("borderColor"),i=Y("borderRadius"),s=Y("borderSpacing"),a=Y("borderWidth"),l=Y("contrast"),c=Y("grayscale"),u=Y("hueRotate"),d=Y("invert"),h=Y("gap"),m=Y("gradientColorStops"),f=Y("gradientColorStopPositions"),g=Y("inset"),y=Y("margin"),w=Y("opacity"),b=Y("padding"),v=Y("saturate"),x=Y("scale"),P=Y("sepia"),S=Y("skew"),k=Y("space"),R=Y("translate"),C=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",N,t],D=()=>[N,t],oe=()=>["",$e,Ve],X=()=>["auto",et,N],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],ie=()=>["start","end","center","between","around","evenly","stretch"],ze=()=>["","0",N],Kn=()=>["auto","avoid","all","avoid-page","page","left","right","column"],it=()=>[et,sn],Ct=()=>[et,N];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[$e,Ve],blur:["none","",Ue,N],brightness:it(),borderColor:[e],borderRadius:["none","","full",Ue,N],borderSpacing:D(),borderWidth:oe(),contrast:it(),grayscale:ze(),hueRotate:Ct(),invert:ze(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Sl,Ve],inset:I(),margin:I(),opacity:it(),padding:D(),saturate:it(),scale:it(),sepia:ze(),skew:Ct(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[Ue]}],"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:[...te(),N]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],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",Dt,N]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ze()}],shrink:[{shrink:ze()}],order:[{order:["first","last","none",Dt,N]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Dt,N]},N]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Dt,N]},N]}],"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",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"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",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[Ue]},Ue]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ue,Ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sn]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",et,sn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$e,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"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:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$e,Ve]}],"underline-offset":[{"underline-offset":["auto",$e,N]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],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",N]}],"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:[...te(),Cl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_l]}],"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:[...$(),"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:$()}],"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:["",...$()]}],"outline-offset":[{"outline-offset":[$e,N]}],"outline-w":[{outline:[$e,Ve]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[$e,Ve]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ue,Pl]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":U()}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ue,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[P]}],"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":[P]}],"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",N]}],duration:[{duration:Ct()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ct()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Dt,N]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"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",N]}],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",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$e,Ve,sn]}],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 Ll=gl(Dl);function je(...e){return Ll(tl(e))}function Il(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",an(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",an(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",an(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",an(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function an(e){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 Rl(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 $l(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 ln(){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 Fl={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 ft(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"),Fl[n][e]}const rr="https://heimdall.smarttalks.ai/api",Nl="wss://heimdall.smarttalks.ai";function Kl(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 Bl(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 zl=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${rr}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();return i.type==="flow"?Kl(i):i.type==="entity"?Bl(i):(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),i._id=n,i)},[Wo,Vl]=_(""),[ht]=Le(()=>co(Wo,zl)),Ul=()=>{if(ht()?.type==="chat")return ht()},jl=()=>{if(ht()?.type==="form")return ht()};Le(()=>M(()=>Il(ht())));const ee=()=>({widgetId:Wo,setWidgetId:Vl,widget:ht,chatWidget:Ul,formWidget:jl});function Go(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=Go(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Hl(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Go(e))&&(r&&(r+=" "),r+=t);return r}const Yo=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Xo=Hl,ql=(e,t)=>n=>{var r;if(t?.variants==null)return Xo(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=Yo(u)||Yo(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 Xo(e,s,l,n?.class,n?.className)};var Wl=L("<button>");const Gl=ql("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"}}),ye=e=>{const[,t]=H(e,["variant","size","class"]);return(()=>{var n=Wl();return Qe(n,T({get class(){return je(Gl({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Yl=L('<img alt="widget logo">');const Jo=e=>{const[,t]=H(e,["class","src"]);return(()=>{var n=Yl();return Qe(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return je("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Xl=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 Jl=()=>{const{chatWidget:e}=ee();return(()=>{var t=Xl(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,p(Jo,{get src(){return e()?.avatar}}),n),A(r,()=>e()?.title??"Izi"),A(o,()=>e()?.subtitle??"SmartTalks.ai"),t})()};var Zl=L("<svg stroke-width=0>");function le(e,t){const n=T(e.a,t),[r,o]=H(n,["src"]),[i,s]=_(""),a=O(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return M(()=>s(a())),B(()=>{s("")}),(()=>{var l=Zl();return Qe(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,()=>Na),l})()}function Ql(e){return le({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 ec(e){return le({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 tc(e){return le({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 nc(e){return le({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 rc(e){return(...t)=>{for(const n of e)n&&n(...t)}}var E=e=>typeof e=="function"&&!e.length?e():e,Zo=e=>Array.isArray(e)?e:e?[e]:[];function oc(e,...t){return typeof e=="function"?e(...t):e}var ic=B;function sc(e,t,n,r){return e.addEventListener(t,n,r),ic(e.removeEventListener.bind(e,t,n,r))}function ac(e,t,n,r){const o=()=>{Zo(E(e)).forEach(i=>{i&&Zo(E(t)).forEach(s=>sc(i,s,n,r))})};typeof e=="function"?M(o):Q(o)}var Qo={equals:!1};function lc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function cc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var or=e=>typeof e=="function"&&!e.length?e():e;function cn(){return!0}var uc={get(e,t,n){return t===me?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()}},dc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ei(e){const t={};let n;for(;n=dc.exec(e);)t[n[1]]=n[2];return t}function fc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ei(e)}else typeof t=="string"&&(t=ei(t));return{...e,...t}}var ir=(e,t,n)=>{let r;for(const o of e){const i=or(o)[t];r?i&&(r=n(r,i)):r=i}return r};function hc(...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?cc:lc,o={};for(const s of n){const a=or(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=T(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ir(n,"style",fc);if(s==="ref"){const a=[];for(const l of n){const c=or(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"?ir(n,s,(a,l)=>`${a} ${l}`):s==="classList"?ir(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},uc)}function tt(...e){return rc(e)}function gc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function sr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pc(e){return typeof e=="number"}function mc(e){return Array.isArray(e)}function gt(e){return Object.prototype.toString.call(e)==="[object String]"}function yc(e){return typeof e=="function"}function ti(e){return t=>`${e()}-${t}`}function Oe(e,t){return e?e===t||e.contains(t):!1}function It(e,t=!1){const{activeElement:n}=Fe(e);if(!n?.nodeName)return null;if(ni(n)&&n.contentDocument)return It(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Fe(n).getElementById(r);if(o)return o}}return n}function Fe(e){return e?e.ownerDocument||e:document}function ni(e){return e.tagName==="IFRAME"}var ri=(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))(ri||{});function ar(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function un(){return ar(/^Mac/i)}function bc(){return ar(/^iPhone/i)}function wc(){return ar(/^iPad/i)||un()&&navigator.maxTouchPoints>1}function vc(){return bc()||wc()}function xc(){return un()||vc()}function de(e,t){return t&&(yc(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function be(e){return t=>{for(const n of e)de(t,n)}}function Sc(e){return un()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function ce(e){if(e)if(Ec())e.focus({preventScroll:!0});else{const t=kc(e);e.focus(),Cc(t)}}var dn=null;function Ec(){if(dn==null){dn=!1;try{document.createElement("div").focus({get preventScroll(){return dn=!0,!0}})}catch{}}return dn}function kc(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 Cc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var oi=["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'])"],Oc=[...oi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],lr=oi.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",_c=Oc.join(':not([hidden]):not([tabindex="-1"]),');function ii(e,t){const r=Array.from(e.querySelectorAll(lr)).filter(si);return t&&si(e)&&r.unshift(e),r.forEach((o,i)=>{if(ni(o)&&o.contentDocument){const s=o.contentDocument.body,a=ii(s,!1);r.splice(i,1,...a)}}),r}function si(e){return ai(e)&&!Pc(e)}function ai(e){return e.matches(lr)&&cr(e)}function Pc(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function cr(e,t){return e.nodeName!=="#comment"&&Ac(e)&&Tc(e,t)&&(!e.parentElement||cr(e.parentElement,e))}function Ac(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 Tc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Mc(e,t){return t.some(n=>n.contains(e))}function Dc(e,t,n){const r=t?.tabbable?_c:lr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&cr(i)&&(!n||Mc(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function li(e){for(;e&&!Lc(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function Lc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Ic(){}function Rc(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 _e(e,t){return T(e,t)}var Rt=new Map,ci=new Set;function ui(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Rt.get(n.target);r||(r=new Set,Rt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Rt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Rt.delete(n.target)),Rt.size===0)){for(const o of ci)o();ci.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?ui():document.addEventListener("DOMContentLoaded",ui));function ur(e,t){const n=di(e,t,"left"),r=di(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 di(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 $c(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=li(e);for(;e&&o&&e!==n&&o!==n;)ur(o,e),e=o,o=li(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 Fc={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 dr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=gt(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=gt(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(gt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return gt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(gt(l)||pc(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=dr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
|
|
2
2
|
* Portions of this file are based on code from react-spectrum.
|
|
3
3
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
4
4
|
*
|
|
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 Nc(e,t=[]){const n=dr({dataSource:E(e.dataSource),getKey:E(e.getKey),getTextValue:E(e.getTextValue),getDisabled:E(e.getDisabled),getSectionChildren:E(e.getSectionChildren)}),[r,o]=_(e.factory(n));return M(Je([()=>E(e.dataSource),()=>E(e.getKey),()=>E(e.getTextValue),()=>E(e.getDisabled),()=>E(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,u])=>{const d=dr({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>u(d))},{defer:!0})),r}function fr(e){const[t,n]=_(e.defaultValue?.()),r=O(()=>e.value?.()!==void 0),o=O(()=>r()?e.value?.():t());return[o,s=>{W(()=>{const a=oc(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Kc(e){const[t,n]=fr(e);return[()=>t()??!1,n]}function Bc(e){const[t,n]=fr(e);return[()=>t()??[],n]}function fi(e={}){const[t,n]=Kc({value:()=>E(e.open),defaultValue:()=>!!E(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 zc(e){const t=n=>{n.key===ri.Escape&&e.onEscapeKeyDown?.(n)};M(()=>{if(E(e.isDisabled))return;const n=e.ownerDocument?.()??Fe();n.addEventListener("keydown",t),B(()=>{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 fn="data-kb-top-layer";let hi,hr=!1;const Ne=[];function $t(e){return Ne.findIndex(t=>t.node===e)}function Vc(e){return Ne[$t(e)]}function Uc(e){return Ne[Ne.length-1].node===e}function gi(){return Ne.filter(e=>e.isPointerBlocking)}function jc(){return[...gi()].slice(-1)[0]}function gr(){return gi().length>0}function pi(e){const t=$t(jc()?.node);return $t(e)<t}function Hc(e){Ne.push(e)}function qc(e){const t=$t(e);t<0||Ne.splice(t,1)}function Wc(){for(const{node:e}of Ne)e.style.pointerEvents=pi(e)?"none":"auto"}function Gc(e){if(gr()&&!hr){const t=Fe(e);hi=document.body.style.pointerEvents,t.body.style.pointerEvents="none",hr=!0}}function Yc(e){if(gr())return;const t=Fe(e);t.body.style.pointerEvents=hi,t.body.style.length===0&&t.body.removeAttribute("style"),hr=!1}const fe={layers:Ne,isTopMostLayer:Uc,hasPointerBlockingLayer:gr,isBelowPointerBlockingLayer:pi,addLayer:Hc,removeLayer:qc,indexOf:$t,find:Vc,assignPointerEventToLayers:Wc,disableBodyPointerEvents:Gc,restoreBodyPointerEvents:Yc};/*!
|
|
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 pr="focusScope.autoFocusOnMount",mr="focusScope.autoFocusOnUnmount",mi={bubbles:!1,cancelable:!0},yi={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=sr(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=sr(this.stack,e),this.active()?.resume()}};function Xc(e,t){const[n,r]=_(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=f=>e.onMountAutoFocus?.(f),a=f=>e.onUnmountAutoFocus?.(f),l=()=>Fe(t()),c=()=>{const f=l().createElement("span");return f.setAttribute("data-focus-trap",""),f.tabIndex=0,Object.assign(f.style,Fc),f},u=()=>{const f=t();return f?ii(f,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},d=()=>{const f=u();return f.length>0?f[0]:null},h=()=>{const f=u();return f.length>0?f[f.length-1]:null},m=()=>{const f=t();if(!f)return!1;const g=It(f);return!g||Oe(f,g)?!1:ai(g)};M(()=>{const f=t();if(!f)return;yi.add(o);const g=It(f);if(!Oe(f,g)){const w=new CustomEvent(pr,mi);f.addEventListener(pr,s),f.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{ce(d()),It(f)===g&&ce(f)},0)}B(()=>{f.removeEventListener(pr,s),setTimeout(()=>{const w=new CustomEvent(mr,mi);m()&&w.preventDefault(),f.addEventListener(mr,a),f.dispatchEvent(w),w.defaultPrevented||ce(g??l().body),f.removeEventListener(mr,a),yi.remove(o)},0)})}),M(()=>{const f=t();if(!f||!E(e.trapFocus)||n())return;const g=w=>{const b=w.target;b?.closest(`[${fn}]`)||(Oe(f,b)?i=b:ce(i))},y=w=>{const v=w.relatedTarget??It(f);v?.closest(`[${fn}]`)||Oe(f,v)||ce(i)};l().addEventListener("focusin",g),l().addEventListener("focusout",y),B(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",y)})}),M(()=>{const f=t();if(!f||!E(e.trapFocus)||n())return;const g=c();f.insertAdjacentElement("afterbegin",g);const y=c();f.insertAdjacentElement("beforeend",y);function w(v){const x=d(),P=h();v.relatedTarget===x?ce(P):ce(x)}g.addEventListener("focusin",w),y.addEventListener("focusin",w);const b=new MutationObserver(v=>{for(const x of v)x.previousSibling===y&&(y.remove(),f.insertAdjacentElement("beforeend",y)),x.nextSibling===g&&(g.remove(),f.insertAdjacentElement("afterbegin",g))});b.observe(f,{childList:!0,subtree:!1}),B(()=>{g.removeEventListener("focusin",w),y.removeEventListener("focusin",w),g.remove(),y.remove(),b.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 Jc="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 Zc(e){M(()=>{E(e.isDisabled)||B(Qc(E(e.targets),E(e.root)))})}const Ft=new WeakMap,we=[];function Qc(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const h of l.querySelectorAll(`[${Jc}], [${fn}]`))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},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&i(l),d!==NodeFilter.FILTER_REJECT){let h=u.nextNode();for(;h!=null;)i(h),h=u.nextNode()}},i=l=>{const c=Ft.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Ft.set(l,c+1))};we.length&&we[we.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(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return we.push(a),()=>{s.disconnect();for(const l of r){const c=Ft.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Ft.delete(l)):Ft.set(l,c-1)}a===we[we.length-1]?(we.pop(),we.length&&we[we.length-1].observe()):we.splice(we.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,44 +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 bi="interactOutside.pointerDownOutside",wi="interactOutside.focusOutside";function eu(e,t){let n,r=Ic;const o=()=>Fe(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const h=d.target;return!(h instanceof HTMLElement)||h.closest(`[${fn}]`)||!Oe(o(),h)||Oe(t(),h)?!1:!e.shouldExcludeElement?.(h)},c=d=>{function h(){const m=t(),f=d.target;if(!m||!f||!l(d))return;const g=be([i,a]);f.addEventListener(bi,g,{once:!0});const y=new CustomEvent(bi,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||Sc(d)&&d.button===0}});f.dispatchEvent(y)}d.pointerType==="touch"?(o().removeEventListener("click",h),r=h,o().addEventListener("click",h,{once:!0})):h()},u=d=>{const h=t(),m=d.target;if(!h||!m||!l(d))return;const f=be([s,a]);m.addEventListener(wi,f,{once:!0});const g=new CustomEvent(wi,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});m.dispatchEvent(g)};M(()=>{E(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),B(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!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 tu(e){const[t,n]=_();let r={},o=e(),i="none";const[s,a]=nu(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M(Je(s,l=>{const c=hn(r);i=l==="mounted"?c:"none"})),M(Je(e,l=>{if(o===l)return;const c=hn(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),M(Je(t,l=>{if(l){const c=d=>{const m=hn(r).includes(d.animationName);d.target===l&&m&&a("ANIMATION_END")},u=d=>{d.target===l&&(i=hn(r))};l.addEventListener("animationstart",u),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),B(()=>{l.removeEventListener("animationstart",u),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 hn(e){return e?.animationName||"none"}function nu(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=_(e);return[r,s=>{o(a=>n(a,s))}]}function gn(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
|
|
70
|
-
* Portions of this file are based on code from react-spectrum.
|
|
71
|
-
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
72
|
-
*
|
|
73
|
-
* Credits to the React Spectrum team:
|
|
74
|
-
* https://github.com/adobe/react-spectrum/blob/a13802d8be6f83af1450e56f7a88527b10d9cadf/packages/@react-stately/toggle/src/useToggleState.ts
|
|
75
|
-
*/function Rg(e={}){const[t,n]=Ca({value:()=>D(e.isSelected),defaultValue:()=>!!D(e.defaultIsSelected),onChange:i=>e.onSelectedChange?.(i)});return{isSelected:t,setIsSelected:i=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(i)},toggle:()=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(!t())}}}function an(e){const[t,n]=U(e,["asChild","as","children"]);if(!t.asChild)return h(Fn,I({get component(){return t.as}},n,{get children(){return t.children}}));const r=Oo(()=>t.children);if(Na(r())){const o=Fa(n,r()?.props??{});return h(Fn,o)}if(qf(r())){const o=r().find(Na);if(o){const i=()=>h(Zt,{get each(){return r()},children:a=>h(ie,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Fa(n,o?.props??{});return h(Fn,I(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const Ng=Symbol("$$KobalteAsComponent");function Na(e){return e?.[Ng]===!0}function Fa(e,t){return Hf([e,t],{reverseEventHandlers:!0})}/*!
|
|
69
|
+
*/function ru(e,t){const[n,r]=_(vi(t?.()));return M(()=>{r(e()?.tagName.toLowerCase()||vi(t?.()))}),n}function vi(e){return gt(e)?e:void 0}function pn(e){const[t,n]=H(e,["asChild","as","children"]);if(!t.asChild)return p(tn,T({get component(){return t.as}},n,{get children(){return t.children}}));const r=Wn(()=>t.children);if(xi(r())){const o=Si(n,r()?.props??{});return p(tn,o)}if(mc(r())){const o=r().find(xi);if(o){const i=()=>p(at,{get each(){return r()},children:a=>p(J,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Si(n,o?.props??{});return p(tn,T(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const ou=Symbol("$$KobalteAsComponent");function xi(e){return e?.[ou]===!0}function Si(e,t){return hc([e,t],{reverseEventHandlers:!0})}/*!
|
|
76
70
|
* Portions of this file are based on code from react-spectrum.
|
|
77
71
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
78
72
|
*
|
|
79
73
|
* Credits to the React Spectrum team:
|
|
80
74
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
|
|
81
|
-
*/const
|
|
75
|
+
*/const iu=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),su=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function au(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return iu.has(n)}const t=e.split("-")[0];return su.has(t)}function lu(e){return au(e)?"rtl":"ltr"}/*!
|
|
82
76
|
* Portions of this file are based on code from react-spectrum.
|
|
83
77
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
84
78
|
*
|
|
85
79
|
* Credits to the React Spectrum team:
|
|
86
80
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
|
|
87
|
-
*/function
|
|
81
|
+
*/function Ei(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:lu(e)}}let yr=Ei();const Nt=new Set;function ki(){yr=Ei();for(const e of Nt)e(yr)}function cu(){const[e,t]=_(yr),n=O(()=>e());return _t(()=>{Nt.size===0&&window.addEventListener("languagechange",ki),Nt.add(t),B(()=>{Nt.delete(t),Nt.size===0&&window.removeEventListener("languagechange",ki)})}),{locale:()=>n().locale,direction:()=>n().direction}}const uu=se();function br(){const e=cu();return ue(uu)||e}/*!
|
|
88
82
|
* Portions of this file are based on code from react-spectrum.
|
|
89
83
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
90
84
|
*
|
|
91
85
|
* Credits to the React Spectrum team:
|
|
92
86
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
|
|
93
|
-
*/const
|
|
87
|
+
*/const wr=new Map;function du(e){const{locale:t}=br(),n=O(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return O(()=>{const r=n();let o;return wr.has(r)&&(o=wr.get(r)),o||(o=new Intl.Collator(t(),e),wr.set(r,o)),o})}/*!
|
|
94
88
|
* Portions of this file are based on code from react-spectrum.
|
|
95
89
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
96
90
|
*
|
|
@@ -98,79 +92,79 @@
|
|
|
98
92
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
|
|
99
93
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
|
|
100
94
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
|
|
101
|
-
*/class
|
|
95
|
+
*/class Ee extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Ee?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function fu(e){const[t,n]=fr(e);return[()=>t()??new Ee,n]}/*!
|
|
102
96
|
* Portions of this file are based on code from react-spectrum.
|
|
103
97
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
104
98
|
*
|
|
105
99
|
* Credits to the React Spectrum team:
|
|
106
100
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
|
|
107
|
-
*/function
|
|
101
|
+
*/function Ci(e){return xc()?e.altKey:e.ctrlKey}function pt(e){return un()?e.metaKey:e.ctrlKey}function Oi(e){return new Ee(e)}function hu(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
|
|
108
102
|
* Portions of this file are based on code from react-spectrum.
|
|
109
103
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
110
104
|
*
|
|
111
105
|
* Credits to the React Spectrum team:
|
|
112
106
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
|
|
113
|
-
*/function
|
|
107
|
+
*/function gu(e){const t=_e({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=_(!1),[o,i]=_(),s=O(()=>{const g=E(t.selectedKeys);return g!=null?Oi(g):g}),a=O(()=>{const g=E(t.defaultSelectedKeys);return g!=null?Oi(g):new Ee}),[l,c]=fu({value:s,defaultValue:a,onChange:g=>t.onSelectionChange?.(g)}),[u,d]=_(E(t.selectionBehavior)),h=()=>E(t.selectionMode),m=()=>E(t.disallowEmptySelection)??!1,f=g=>{(E(t.allowDuplicateSelectionEvents)||!hu(g,l()))&&c(g)};return M(()=>{const g=l();E(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof g=="object"&&g.size===0&&d("replace")}),M(()=>{d(E(t.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:m,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:f}}/*!
|
|
114
108
|
* Portions of this file are based on code from react-spectrum.
|
|
115
109
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
116
110
|
*
|
|
117
111
|
* Credits to the React Spectrum team:
|
|
118
112
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
|
|
119
|
-
*/function
|
|
113
|
+
*/function pu(e){const[t,n]=_(""),[r,o]=_(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(E(e.isDisabled))return;const a=E(e.keyboardDelegate),l=E(e.selectionManager);if(!a.getKeyForSearch)return;const c=mu(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(h=>h+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&yu(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function mu(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function yu(e){return e.split("").every(t=>t===e[0])}/*!
|
|
120
114
|
* Portions of this file are based on code from react-spectrum.
|
|
121
115
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
122
116
|
*
|
|
123
117
|
* Credits to the React Spectrum team:
|
|
124
118
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
|
|
125
|
-
*/function
|
|
119
|
+
*/function bu(e,t,n){const o=T({selectOnFocus:()=>E(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>n?.()??t(),{direction:s}=br();let a={top:0,left:0};ac(()=>E(o.isVirtualized)?void 0:i(),"scroll",()=>{const g=i();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=pu({isDisabled:()=>E(o.disallowTypeAhead),keyboardDelegate:()=>E(o.keyboardDelegate),selectionManager:()=>E(o.selectionManager)}),c=g=>{de(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const y=t();if(!y?.contains(g.target))return;const w=E(o.selectionManager),b=E(o.selectOnFocus),v=k=>{k!=null&&(w.setFocusedKey(k),g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&!Ci(g)&&w.replaceSelection(k))},x=E(o.keyboardDelegate),P=E(o.shouldFocusWrap),S=w.focusedKey();switch(g.key){case"ArrowDown":{if(x.getKeyBelow){g.preventDefault();let k;S!=null?k=x.getKeyBelow(S):k=x.getFirstKey?.(),k==null&&P&&(k=x.getFirstKey?.(S)),v(k)}break}case"ArrowUp":{if(x.getKeyAbove){g.preventDefault();let k;S!=null?k=x.getKeyAbove(S):k=x.getLastKey?.(),k==null&&P&&(k=x.getLastKey?.(S)),v(k)}break}case"ArrowLeft":{if(x.getKeyLeftOf){g.preventDefault();const k=s()==="rtl";let R;S!=null?R=x.getKeyLeftOf(S):R=k?x.getFirstKey?.():x.getLastKey?.(),v(R)}break}case"ArrowRight":{if(x.getKeyRightOf){g.preventDefault();const k=s()==="rtl";let R;S!=null?R=x.getKeyRightOf(S):R=k?x.getLastKey?.():x.getFirstKey?.(),v(R)}break}case"Home":if(x.getFirstKey){g.preventDefault();const k=x.getFirstKey(S,pt(g));k!=null&&(w.setFocusedKey(k),pt(g)&&g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&w.replaceSelection(k))}break;case"End":if(x.getLastKey){g.preventDefault();const k=x.getLastKey(S,pt(g));k!=null&&(w.setFocusedKey(k),pt(g)&&g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&w.replaceSelection(k))}break;case"PageDown":if(x.getKeyPageBelow&&S!=null){g.preventDefault();const k=x.getKeyPageBelow(S);v(k)}break;case"PageUp":if(x.getKeyPageAbove&&S!=null){g.preventDefault();const k=x.getKeyPageAbove(S);v(k)}break;case"a":pt(g)&&w.selectionMode()==="multiple"&&E(o.disallowSelectAll)!==!0&&(g.preventDefault(),w.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),E(o.disallowEmptySelection)||w.clearSelection());break;case"Tab":if(!E(o.allowsTabNavigation)){if(g.shiftKey)y.focus();else{const k=Dc(y,{tabbable:!0});let R,C;do C=k.lastChild(),C&&(R=C);while(C);R&&!R.contains(document.activeElement)&&ce(R)}break}}},u=g=>{const y=E(o.selectionManager),w=E(o.keyboardDelegate),b=E(o.selectOnFocus);if(y.isFocused()){g.currentTarget.contains(g.target)||y.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(y.setFocused(!0),y.focusedKey()==null){const v=P=>{P!=null&&(y.setFocusedKey(P),b&&y.replaceSelection(P))},x=g.relatedTarget;x&&g.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?v(y.lastSelectedKey()??w.getLastKey?.()):v(y.firstSelectedKey()??w.getFirstKey?.())}else if(!E(o.isVirtualized)){const v=i();if(v){v.scrollTop=a.top,v.scrollLeft=a.left;const x=v.querySelector(`[data-key="${y.focusedKey()}"]`);x&&(ce(x),ur(v,x))}}}},d=g=>{const y=E(o.selectionManager);g.currentTarget.contains(g.relatedTarget)||y.setFocused(!1)},h=g=>{i()===g.target&&g.preventDefault()},m=()=>{const g=E(o.autoFocus);if(!g)return;const y=E(o.selectionManager),w=E(o.keyboardDelegate);let b;g==="first"&&(b=w.getFirstKey?.()),g==="last"&&(b=w.getLastKey?.());const v=y.selectedKeys();v.size&&(b=v.values().next().value),y.setFocused(!0),y.setFocusedKey(b);const x=t();x&&b==null&&!E(o.shouldUseVirtualFocus)&&ce(x)};return _t(()=>{o.deferAutoFocus?setTimeout(m,0):m()}),M(Je([i,()=>E(o.isVirtualized),()=>E(o.selectionManager).focusedKey()],g=>{const[y,w,b]=g;if(w)b&&o.scrollToKey?.(b);else if(b&&y){const v=y.querySelector(`[data-key="${b}"]`);v&&ur(y,v)}})),{tabIndex:O(()=>{if(!E(o.shouldUseVirtualFocus))return E(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:u,onFocusOut:d}}/*!
|
|
126
120
|
* Portions of this file are based on code from react-spectrum.
|
|
127
121
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
128
122
|
*
|
|
129
123
|
* Credits to the React Spectrum team:
|
|
130
124
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
|
|
131
|
-
*/function
|
|
125
|
+
*/function wu(e,t){const n=()=>E(e.selectionManager),r=()=>E(e.key),o=()=>E(e.shouldUseVirtualFocus),i=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||pt(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>E(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!E(e.shouldSelectOnPressUp)&&i(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&E(e.shouldSelectOnPressUp)&&E(e.allowsDifferentPressOrigin)&&i(b)},h=b=>{l()&&(E(e.shouldSelectOnPressUp)&&!E(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(b)},m=b=>{!l()||!["Enter"," "].includes(b.key)||(Ci(b)?n().toggleSelection(r()):i(b))},f=b=>{a()&&b.preventDefault()},g=b=>{const v=t();o()||a()||!v||b.target===v&&n().setFocusedKey(r())},y=O(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),w=O(()=>E(e.virtualized)?void 0:r());return M(Je([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([b,v,x,P,S])=>{b&&v===P&&S&&!x&&document.activeElement!==b&&(e.focus?e.focus():ce(b))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:y,dataKey:w,onPointerDown:u,onPointerUp:d,onClick:h,onKeyDown:m,onMouseDown:f,onFocus:g}}/*!
|
|
132
126
|
* Portions of this file are based on code from react-spectrum.
|
|
133
127
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
134
128
|
*
|
|
135
129
|
* Credits to the React Spectrum team:
|
|
136
130
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
|
|
137
|
-
*/class
|
|
131
|
+
*/class vu{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 Ee(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 Ee(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 Ee([n],n,n):new Ee;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new Ee;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 Ee)}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}}/*!
|
|
138
132
|
* Portions of this file are based on code from react-spectrum.
|
|
139
133
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
140
134
|
*
|
|
141
135
|
* Credits to the React Spectrum team:
|
|
142
136
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
|
|
143
|
-
*/class
|
|
137
|
+
*/class _i{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])}}/*!
|
|
144
138
|
* Portions of this file are based on code from react-spectrum.
|
|
145
139
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
146
140
|
*
|
|
147
141
|
* Credits to the React Spectrum team:
|
|
148
142
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
|
|
149
|
-
*/function
|
|
143
|
+
*/function xu(e){const t=gu(e),r=Nc({dataSource:()=>E(e.dataSource),getKey:()=>E(e.getKey),getTextValue:()=>E(e.getTextValue),getDisabled:()=>E(e.getDisabled),getSectionChildren:()=>E(e.getSectionChildren),factory:i=>e.filter?new _i(e.filter(i)):new _i(i)},[()=>e.filter]),o=new vu(r,t);return Hn(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
|
|
150
144
|
* Portions of this file are based on code from react-spectrum.
|
|
151
145
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
152
146
|
*
|
|
153
147
|
* Credits to the React Spectrum team:
|
|
154
148
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
|
|
155
|
-
*/class
|
|
149
|
+
*/class Su{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)}}}/*!
|
|
156
150
|
* Portions of this file are based on code from react-spectrum.
|
|
157
151
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
158
152
|
*
|
|
159
153
|
* Credits to the React Spectrum team:
|
|
160
154
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
|
|
161
|
-
*/function
|
|
155
|
+
*/function Eu(e,t,n){const r=du({usage:"search",sensitivity:"base"}),o=O(()=>{const i=E(e.keyboardDelegate);return i||new Su(e.collection,t,r)});return bu({selectionManager:()=>E(e.selectionManager),keyboardDelegate:o,autoFocus:()=>E(e.autoFocus),deferAutoFocus:()=>E(e.deferAutoFocus),shouldFocusWrap:()=>E(e.shouldFocusWrap),disallowEmptySelection:()=>E(e.disallowEmptySelection),selectOnFocus:()=>E(e.selectOnFocus),disallowTypeAhead:()=>E(e.disallowTypeAhead),shouldUseVirtualFocus:()=>E(e.shouldUseVirtualFocus),allowsTabNavigation:()=>E(e.allowsTabNavigation),isVirtualized:()=>E(e.isVirtualized),scrollToKey:i=>E(e.scrollToKey)?.(i)},t,n)}/*!
|
|
162
156
|
* Portions of this file are based on code from ariakit
|
|
163
157
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
164
158
|
*
|
|
165
159
|
* Credits to the ariakit team:
|
|
166
160
|
* https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
|
|
167
|
-
*/const
|
|
161
|
+
*/const ku=["button","color","file","image","reset","submit"];function Cu(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?ku.indexOf(e.type)!==-1:!1}function Ou(e){let t;const n=_e({type:"button"},e),[r,o]=H(n,["ref","type","disabled"]),i=ru(()=>t,()=>"button"),s=O(()=>{const c=i();return c==null?!1:Cu({tagName:c,type:r.type})}),a=O(()=>i()==="input"),l=O(()=>i()==="a"&&t?.getAttribute("href")!=null);return p(pn,T({as:"button",ref(c){var u=tt(d=>t=d,r.ref);typeof u=="function"&&u(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 Pi=se();function Ai(){return ue(Pi)}function _u(){const e=Ai();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
|
|
168
162
|
* Portions of this file are based on code from ariakit.
|
|
169
163
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
170
164
|
*
|
|
171
165
|
* Credits to the Ariakit team:
|
|
172
166
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
173
|
-
*/function
|
|
167
|
+
*/function Ti(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Pu(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&&Ti(o,n))return r+1}return 0}function Au(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:Ti(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Mi(e,t){const n=Au(e);e!==n&&t(n)}function Tu(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 Fe(r).body}function Mu(e,t){M(()=>{const n=setTimeout(()=>{Mi(e(),t)});B(()=>clearTimeout(n))})}function Du(e,t){if(typeof IntersectionObserver!="function"){Mu(e,t);return}let n=[];M(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Mi(e(),t)},o=Tu(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}B(()=>i.disconnect())})}/*!
|
|
174
168
|
* Portions of this file are based on code from ariakit.
|
|
175
169
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
176
170
|
*
|
|
@@ -178,10 +172,10 @@
|
|
|
178
172
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
|
|
179
173
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
180
174
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
|
|
181
|
-
*/function fh(e={}){const[t,n]=vg({value:()=>D(e.items),onChange:i=>e.onItemsChange?.(i)});dh(t,n);const r=i=>(n(s=>{const a=ah(s,i);return Yf(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>h(ja.Provider,{value:{registerItem:r},get children(){return i.children}})}}function gh(e){const t=sh(),n=De({shouldRegisterItem:!0},e);V(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Z(r)})}var z=e=>typeof e=="function"?e():e,cn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Mr=new Map,hh=e=>{V(()=>{const t=z(e.style)??{},n=z(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Mr.get(e.key);o?o.activeCount++:Mr.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);Z(()=>{const i=Mr.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Mr.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?.()}})})},ri=hh,ph=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},mh=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Ya=(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]=ph(o,t),d=u-l-r*c;(c!==0||d!==0)&&mh(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o.parentElement}while(o&&!a);return[i,s]},[Ga,qa]=L([]),yh=e=>Ga().indexOf(e)===Ga().length-1,vh=e=>{const t=I({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!1},e),n=Le();let r=[0,0],o=null,i=null;V(()=>{z(t.enabled)&&(qa(c=>[...c,n]),Z(()=>{qa(c=>c.filter(u=>u!==n))}))}),V(()=>{if(!z(t.enabled)||!z(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(ri({key:"prevent-scroll-overflow",element:c,style:{overflow:"hidden"}}),z(t.preventScrollbarShift)){const d={},f=[];u>0&&(z(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const m=window.scrollY,g=window.scrollX;ri({key:"prevent-scroll-scrollbar",element:c,style:d,properties:f,cleanup:()=>{u>0&&window.scrollTo(g,m)}})}}),V(()=>{!yh(n)||!z(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Z(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Za(c),o=null,i=null},a=c=>{const u=c.target,d=z(t.element),f=bh(c),m=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=m==="x"?f[0]:f[1],p=Xa(u,m,g,d);let y;d&&d.contains(u)?y=!p:y=p,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=z(t.element),d=c.target;let f;if(c.touches.length===2)f=!z(t.allowPinchZoom);else{if(o==null||i===null){const m=Za(c).map((p,y)=>r[y]-p),g=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=g,i=g==="x"?m[0]:m[1]}if(d.type==="range")f=!1;else{const m=Xa(d,o,i,u);u&&u.contains(d)?f=!m:f=m}}f&&c.cancelable&&c.preventDefault()}},bh=e=>[e.deltaX,e.deltaY],Za=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Xa=(e,t,n,r)=>{const o=r&&r.contains(e),[i,s]=Ya(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},wh=vh,Ja=wh;const Qa=ye();function xh(){return ve(Qa)}function Sh(e){let t;const n=xh(),[r,o]=U(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const f=n?.registerNestedLayer(d);return()=>{i.delete(d),f?.()}};Mg({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>Ze(f(),d))||[...i].some(f=>Ze(f,d)):!1,onPointerDownOutside:d=>{!t||ke.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ke.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),bg({ownerDocument:()=>it(t),onEscapeKeyDown:d=>{!t||!ke.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Ft(()=>{if(!t)return;ke.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);ke.assignPointerEventToLayers(),ke.disableBodyPointerEvents(t),Z(()=>{t&&(ke.removeLayer(t),d?.(),ke.assignPointerEventToLayers(),ke.restoreBodyPointerEvents(t))})}),V(Nt([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const m=ke.find(d);m&&m.isPointerBlocking!==f&&(m.isPointerBlocking=f,ke.assignPointerEventToLayers()),f&&ke.disableBodyPointerEvents(d),Z(()=>{ke.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return h(Qa.Provider,{value:u,get children(){return h(an,I({as:"div",ref(d){var f=Ct(m=>t=m,r.ref);typeof f=="function"&&f(d)}},o))}})}const el=ye();function Eh(){const e=ve(el);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function Ph(e){const t=Eh(),[n,r]=U(e,["ref","style"]);return h(an,I({as:"div",ref(o){var i=Ct(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 Ch=["top","right","bottom","left"],Ot=Math.min,Te=Math.max,Ir=Math.round,Lr=Math.floor,Dt=e=>({x:e,y:e}),Oh={left:"right",right:"left",bottom:"top",top:"bottom"},Dh={start:"end",end:"start"};function oi(e,t,n){return Te(e,Ot(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function lt(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function ii(e){return e==="x"?"y":"x"}function si(e){return e==="y"?"height":"width"}function dn(e){return["top","bottom"].includes(lt(e))?"y":"x"}function ai(e){return ii(dn(e))}function kh(e,t,n){n===void 0&&(n=!1);const r=un(e),o=ai(e),i=si(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Rr(s)),[s,Rr(s)]}function Th(e){const t=Rr(e);return[li(e),t,li(t)]}function li(e){return e.replace(/start|end/g,t=>Dh[t])}function $h(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 Ah(e,t,n,r){const o=un(e);let i=$h(lt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(li)))),i}function Rr(e){return e.replace(/left|right|bottom|top/g,t=>Oh[t])}function Mh(e){return{top:0,right:0,bottom:0,left:0,...e}}function tl(e){return typeof e!="number"?Mh(e):{top:e,right:e,bottom:e,left:e}}function fn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function nl(e,t,n){let{reference:r,floating:o}=e;const i=dn(t),s=ai(t),a=si(s),l=lt(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=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(un(t)){case"start":m[s]-=f*(n&&c?-1:1);break;case"end":m[s]+=f*(n&&c?-1:1);break}return m}const rl=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}=nl(c,r,l),f=r,m={},g=0;for(let p=0;p<a.length;p++){const{name:y,fn:v}=a[p],{x:b,y:w,data:x,reset:T}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=b??u,d=w??d,m={...m,[y]:{...m[y],...x}},T&&g<=50&&(g++,typeof T=="object"&&(T.placement&&(f=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:d}=nl(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}};async function qn(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:f=!1,padding:m=0}=at(t,e),g=tl(m),y=a[f?d==="floating"?"reference":"floating":d],v=fn(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,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},T=fn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-T.top+g.top)/x.y,bottom:(T.bottom-v.bottom+g.bottom)/x.y,left:(v.left-T.left+g.left)/x.x,right:(T.right-v.right+g.right)/x.x}}const ol=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}=at(e,t)||{};if(c==null)return{};const d=tl(u),f={x:n,y:r},m=ai(o),g=si(m),p=await s.getDimensions(c),y=m==="y",v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[m]-f[m]-i.floating[g],T=f[m]-i.reference[m],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=O?O[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(O)))&&(k=a.floating[w]||i.floating[g]);const j=x/2-T/2,P=k/2-p[g]/2-1,M=Ot(d[v],P),$=Ot(d[b],P),R=M,se=k-p[g]-$,J=k/2-p[g]/2+j,re=oi(R,J,se),N=!l.arrow&&un(o)!=null&&J!==re&&i.reference[g]/2-(J<R?M:$)-p[g]/2<0,X=N?J<R?J-R:J-se:0;return{[m]:f[m]+X,data:{[m]:re,centerOffset:J-re-X,...N&&{alignmentOffset:X}},reset:N}}}),il=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:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...y}=at(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=lt(o),b=lt(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(b||!p?[Rr(a)]:Th(a));!f&&g!=="none"&&x.push(...Ah(a,p,g,w));const T=[a,...x],O=await qn(t,y),k=[];let j=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(O[v]),d){const R=kh(o,s,w);k.push(O[R[0]],O[R[1]])}if(j=[...j,{placement:o,overflows:k}],!k.every(R=>R<=0)){var P,M;const R=(((P=i.flip)==null?void 0:P.index)||0)+1,se=T[R];if(se)return{data:{index:R,overflows:j},reset:{placement:se}};let J=(M=j.filter(re=>re.overflows[0]<=0).sort((re,N)=>re.overflows[1]-N.overflows[1])[0])==null?void 0:M.placement;if(!J)switch(m){case"bestFit":{var $;const re=($=j.map(N=>[N.placement,N.overflows.filter(X=>X>0).reduce((X,ge)=>X+ge,0)]).sort((N,X)=>N[1]-X[1])[0])==null?void 0:$[0];re&&(J=re);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function sl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function al(e){return Ch.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=at(e,t);switch(r){case"referenceHidden":{const i=await qn(t,{...o,elementContext:"reference"}),s=sl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:al(s)}}}case"escaped":{const i=await qn(t,{...o,altBoundary:!0}),s=sl(i,n.floating);return{data:{escapedOffsets:s,escaped:al(s)}}}default:return{}}}}};async function Lh(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=lt(n),a=un(n),l=dn(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=at(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}const ll=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 Lh(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}}}}},cl=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:v,y:b}=y;return{x:v,y:b}}},...l}=at(e,t),c={x:n,y:r},u=await qn(t,l),d=dn(lt(o)),f=ii(d);let m=c[f],g=c[d];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=m+u[y],w=m-u[v];m=oi(b,m,w)}if(s){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+u[y],w=g-u[v];g=oi(b,g,w)}const p=a.fn({...t,[f]:m,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r}}}}},Rh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=at(e,t),u={x:n,y:r},d=dn(o),f=ii(d);let m=u[f],g=u[d];const p=at(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=f==="y"?"height":"width",x=i.reference[f]-i.floating[w]+y.mainAxis,T=i.reference[f]+i.reference[w]-y.mainAxis;m<x?m=x:m>T&&(m=T)}if(c){var v,b;const w=f==="y"?"width":"height",x=["top","left"].includes(lt(o)),T=i.reference[d]-i.floating[w]+(x&&((v=s.offset)==null?void 0:v[d])||0)+(x?0:y.crossAxis),O=i.reference[d]+i.reference[w]+(x?0:((b=s.offset)==null?void 0:b[d])||0)-(x?y.crossAxis:0);g<T?g=T:g>O&&(g=O)}return{[f]:m,[d]:g}}}},ul=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}=at(e,t),l=await qn(t,a),c=lt(n),u=un(n),d=dn(n)==="y",{width:f,height:m}=r.floating;let g,p;c==="top"||c==="bottom"?(g=c,p=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(p=c,g=u==="end"?"top":"bottom");const y=m-l[g],v=f-l[p],b=!t.middlewareData.shift;let w=y,x=v;if(d){const O=f-l.left-l.right;x=u||b?Ot(v,O):O}else{const O=m-l.top-l.bottom;w=u||b?Ot(y,O):O}if(b&&!u){const O=Te(l.left,0),k=Te(l.right,0),j=Te(l.top,0),P=Te(l.bottom,0);d?x=f-2*(O!==0||k!==0?O+k:Te(l.left,l.right)):w=m-2*(j!==0||P!==0?j+P:Te(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:w});const T=await o.getDimensions(i.floating);return f!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function kt(e){return dl(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ct(e){var t;return(t=(dl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dl(e){return e instanceof Node||e instanceof $e(e).Node}function ut(e){return e instanceof Element||e instanceof $e(e).Element}function Xe(e){return e instanceof HTMLElement||e instanceof $e(e).HTMLElement}function fl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}function Zn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Nh(e){return["table","td","th"].includes(kt(e))}function ci(e){const t=ui(),n=_e(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 Fh(e){let t=gn(e);for(;Xe(t)&&!Nr(t);){if(ci(t))return t;t=gn(t)}return null}function ui(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Nr(e){return["html","body","#document"].includes(kt(e))}function _e(e){return $e(e).getComputedStyle(e)}function Fr(e){return ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function gn(e){if(kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fl(e)&&e.host||ct(e);return fl(t)?t.host:t}function gl(e){const t=gn(e);return Nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xe(t)&&Zn(t)?t:gl(t)}function Xn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=gl(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=$e(o);return i?t.concat(s,s.visualViewport||[],Zn(o)?o:[],s.frameElement&&n?Xn(s.frameElement):[]):t.concat(o,Xn(o,[],n))}function hl(e){const t=_e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xe(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ir(n)!==i||Ir(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function di(e){return ut(e)?e:e.contextElement}function hn(e){const t=di(e);if(!Xe(t))return Dt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=hl(t);let s=(i?Ir(n.width):n.width)/r,a=(i?Ir(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _h=Dt(0);function pl(e){const t=$e(e);return!ui()||!t.visualViewport?_h:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vh(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$e(e)?!1:t}function Kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=di(e);let s=Dt(1);t&&(r?ut(r)&&(s=hn(r)):s=hn(e));const a=Vh(i,n,r)?pl(i):Dt(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 f=$e(i),m=r&&ut(r)?$e(r):r;let g=f,p=g.frameElement;for(;p&&r&&m!==g;){const y=hn(p),v=p.getBoundingClientRect(),b=_e(p),w=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,x=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=x,g=$e(p),p=g.frameElement}}return fn({width:u,height:d,x:l,y:c})}const Kh=[":popover-open",":modal"];function ml(e){return Kh.some(t=>{try{return e.matches(t)}catch{return!1}})}function zh(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ct(r),a=t?ml(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Dt(1);const u=Dt(0),d=Xe(r);if((d||!d&&!i)&&((kt(r)!=="body"||Zn(s))&&(l=Fr(r)),Xe(r))){const f=Kt(r);c=hn(r),u.x=f.x+r.clientLeft,u.y=f.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 Bh(e){return Array.from(e.getClientRects())}function yl(e){return Kt(ct(e)).left+Fr(e).scrollLeft}function jh(e){const t=ct(e),n=Fr(e),r=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+yl(e);const a=-n.scrollTop;return _e(r).direction==="rtl"&&(s+=Te(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Uh(e,t){const n=$e(e),r=ct(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=ui();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Wh(e,t){const n=Kt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Xe(e)?hn(e):Dt(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 vl(e,t,n){let r;if(t==="viewport")r=Uh(e,n);else if(t==="document")r=jh(ct(e));else if(ut(t))r=Wh(t,n);else{const o=pl(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return fn(r)}function bl(e,t){const n=gn(e);return n===t||!ut(n)||Nr(n)?!1:_e(n).position==="fixed"||bl(n,t)}function Hh(e,t){const n=t.get(e);if(n)return n;let r=Xn(e,[],!1).filter(a=>ut(a)&&kt(a)!=="body"),o=null;const i=_e(e).position==="fixed";let s=i?gn(e):e;for(;ut(s)&&!Nr(s);){const a=_e(s),l=ci(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Zn(s)&&!l&&bl(e,s))?r=r.filter(u=>u!==s):o=a,s=gn(s)}return t.set(e,r),r}function Yh(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Hh(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=vl(t,u,o);return c.top=Te(d.top,c.top),c.right=Ot(d.right,c.right),c.bottom=Ot(d.bottom,c.bottom),c.left=Te(d.left,c.left),c},vl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gh(e){const{width:t,height:n}=hl(e);return{width:t,height:n}}function qh(e,t,n){const r=Xe(t),o=ct(t),i=n==="fixed",s=Kt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Dt(0);if(r||!r&&!i)if((kt(t)!=="body"||Zn(o))&&(a=Fr(t)),r){const d=Kt(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=yl(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 wl(e,t){return!Xe(e)||_e(e).position==="fixed"?null:t?t(e):e.offsetParent}function xl(e,t){const n=$e(e);if(!Xe(e)||ml(e))return n;let r=wl(e,t);for(;r&&Nh(r)&&_e(r).position==="static";)r=wl(r,t);return r&&(kt(r)==="html"||kt(r)==="body"&&_e(r).position==="static"&&!ci(r))?n:r||Fh(e)||n}const Zh=async function(e){const t=this.getOffsetParent||xl,n=this.getDimensions;return{reference:qh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Xh(e){return _e(e).direction==="rtl"}const Sl={convertOffsetParentRelativeRectToViewportRelativeRect:zh,getDocumentElement:ct,getClippingRect:Yh,getOffsetParent:xl,getElementRects:Zh,getClientRects:Bh,getDimensions:Gh,getScale:hn,isElement:ut,isRTL:Xh};function Jh(e,t){let n=null,r;const o=ct(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:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const m=Lr(u),g=Lr(o.clientWidth-(c+d)),p=Lr(o.clientHeight-(u+f)),y=Lr(c),b={rootMargin:-m+"px "+-g+"px "+-p+"px "+-y+"px",threshold:Te(0,Ot(1,l))||1};let w=!0;function x(T){const O=T[0].intersectionRatio;if(O!==l){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function Qh(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=di(e),u=o||i?[...c?Xn(c):[],...Xn(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?Jh(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let g,p=l?Kt(e):null;l&&y();function y(){const v=Kt(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,g=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const ep=cl,tp=il,np=ul,rp=Ih,op=ol,ip=(e,t,n)=>{const r=new Map,o={platform:Sl,...n},i={...o.platform,_c:r};return rl(e,t,{...o,platform:i})};function El(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 sp(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?El(r):e?e.getBoundingClientRect():El()}}}function ap(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const lp={top:"bottom",right:"left",bottom:"top",left:"right"};function cp(e,t){const[n,r]=e.split("-"),o=lp[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 up(e){const t=De({getAnchorRect:f=>f?.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]=L(),[o,i]=L(),[s,a]=L(t.placement),l=()=>sp(t.anchorRef(),t.getAnchorRect),{direction:c}=ei();async function u(){const f=l(),m=n(),g=o();if(!f||!m)return;const p=(g?.clientHeight||0)/2,y=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[ll(({placement:O})=>{const k=!!O.split("-")[1];return{mainAxis:y,crossAxis:k?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(ap))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(tp({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(ep({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(np({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:k,rects:j}){const P=Math.round(j.reference.width);O=Math.floor(O),k=Math.floor(k),m.style.setProperty("--kb-popper-anchor-width",`${P}px`),m.style.setProperty("--kb-popper-content-available-width",`${O}px`),m.style.setProperty("--kb-popper-content-available-height",`${k}px`),t.sameWidth&&(m.style.width=`${P}px`),t.fitViewport&&(m.style.maxWidth=`${O}px`,m.style.maxHeight=`${k}px`)}})),t.hideWhenDetached&&v.push(rp({padding:t.detachedPadding})),g&&v.push(op({element:g,padding:t.arrowPadding}));const b=await ip(f,m,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...Sl,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",cp(b.placement,c()));const w=Math.round(b.x),x=Math.round(b.y);let T;if(t.hideWhenDetached&&(T=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:T}),g&&b.middlewareData.arrow){const{x:O,y:k}=b.middlewareData.arrow,j=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:k!=null?`${k}px`:"",[j]:"100%"})}}V(()=>{const f=l(),m=n();if(!f||!m)return;const g=Qh(f,m,u,{elementResize:typeof ResizeObserver=="function"});Z(g)}),V(()=>{const f=n(),m=t.contentRef();!f||!m||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(m).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return h(el.Provider,{value:d,get children(){return t.children}})}const Pl=ye();function Cl(){return ve(Pl)}function pn(){const e=Cl();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const Ol=ye();function mn(){const e=ve(Ol);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
175
|
+
*/function Lu(e={}){const[t,n]=Bc({value:()=>E(e.items),onChange:i=>e.onItemsChange?.(i)});Du(t,n);const r=i=>(n(s=>{const a=Pu(s,i);return gc(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(Pi.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Iu(e){const t=_u(),n=_e({shouldRegisterItem:!0},e);M(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());B(r)})}var z=e=>typeof e=="function"?e():e,Di=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),mn=new Map,Ru=e=>{M(()=>{const t=z(e.style)??{},n=z(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);B(()=>{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?.()}})})},vr=Ru,$u=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Fu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Li=(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]=$u(o,t),d=u-l-r*c;(c!==0||d!==0)&&Fu(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o.parentElement}while(o&&!a);return[i,s]},[Ii,Ri]=_([]),Nu=e=>Ii().indexOf(e)===Ii().length-1,Ku=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!1},e),n=Ce();let r=[0,0],o=null,i=null;M(()=>{z(t.enabled)&&(Ri(c=>[...c,n]),B(()=>{Ri(c=>c.filter(u=>u!==n))}))}),M(()=>{if(!z(t.enabled)||!z(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(vr({key:"prevent-scroll-overflow",element:c,style:{overflow:"hidden"}}),z(t.preventScrollbarShift)){const d={},h=[];u>0&&(z(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;vr({key:"prevent-scroll-scrollbar",element:c,style:d,properties:h,cleanup:()=>{u>0&&window.scrollTo(f,m)}})}}),M(()=>{!Nu(n)||!z(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),B(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=$i(c),o=null,i=null},a=c=>{const u=c.target,d=z(t.element),h=Bu(c),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=m==="x"?h[0]:h[1],g=Fi(u,m,f,d);let y;d&&d.contains(u)?y=!g:y=g,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=z(t.element),d=c.target;let h;if(c.touches.length===2)h=!z(t.allowPinchZoom);else{if(o==null||i===null){const m=$i(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=Fi(d,o,i,u);u&&u.contains(d)?h=!m:h=m}}h&&c.cancelable&&c.preventDefault()}},Bu=e=>[e.deltaX,e.deltaY],$i=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Fi=(e,t,n,r)=>{const o=r&&r.contains(e),[i,s]=Li(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},zu=Ku,Ni=zu;const Ki=se();function Vu(){return ue(Ki)}function Uu(e){let t;const n=Vu(),[r,o]=H(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?.()}};eu({shouldExcludeElement:d=>t?r.excludedElements?.some(h=>Oe(h(),d))||[...i].some(h=>Oe(h,d)):!1,onPointerDownOutside:d=>{!t||fe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!fe.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),zc({ownerDocument:()=>Fe(t),onEscapeKeyDown:d=>{!t||!fe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),_t(()=>{if(!t)return;fe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);fe.assignPointerEventToLayers(),fe.disableBodyPointerEvents(t),B(()=>{t&&(fe.removeLayer(t),d?.(),fe.assignPointerEventToLayers(),fe.restoreBodyPointerEvents(t))})}),M(Je([()=>t,()=>r.disableOutsidePointerEvents],([d,h])=>{if(!d)return;const m=fe.find(d);m&&m.isPointerBlocking!==h&&(m.isPointerBlocking=h,fe.assignPointerEventToLayers()),h&&fe.disableBodyPointerEvents(d),B(()=>{fe.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return p(Ki.Provider,{value:u,get children(){return p(pn,T({as:"div",ref(d){var h=tt(m=>t=m,r.ref);typeof h=="function"&&h(d)}},o))}})}const Bi=se();function ju(){const e=ue(Bi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function Hu(e){const t=ju(),[n,r]=H(e,["ref","style"]);return p(pn,T({as:"div",ref(o){var i=tt(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 qu=["top","right","bottom","left"],He=Math.min,he=Math.max,yn=Math.round,bn=Math.floor,qe=e=>({x:e,y:e}),Wu={left:"right",right:"left",bottom:"top",top:"bottom"},Gu={start:"end",end:"start"};function xr(e,t,n){return he(e,He(t,n))}function nt(e,t){return typeof e=="function"?e(t):e}function We(e){return e.split("-")[0]}function mt(e){return e.split("-")[1]}function zi(e){return e==="x"?"y":"x"}function Sr(e){return e==="y"?"height":"width"}function Kt(e){return["top","bottom"].includes(We(e))?"y":"x"}function Er(e){return zi(Kt(e))}function Yu(e,t,n){n===void 0&&(n=!1);const r=mt(e),o=Er(e),i=Sr(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 Xu(e){const t=wn(e);return[kr(e),t,kr(t)]}function kr(e){return e.replace(/start|end/g,t=>Gu[t])}function Ju(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 Zu(e,t,n,r){const o=mt(e);let i=Ju(We(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(kr)))),i}function wn(e){return e.replace(/left|right|bottom|top/g,t=>Wu[t])}function Qu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vi(e){return typeof e!="number"?Qu(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 Ui(e,t,n){let{reference:r,floating:o}=e;const i=Kt(t),s=Er(t),a=Sr(s),l=We(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(mt(t)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const ed=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}=Ui(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:P}=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}},P&&f<=50&&(f++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(c=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:u,y:d}=Ui(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:m}};async function Bt(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}=nt(t,e),f=Vi(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},P=vn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:v,strategy:l}):b);return{top:(w.top-P.top+f.top)/x.y,bottom:(P.bottom-w.bottom+f.bottom)/x.y,left:(w.left-P.left+f.left)/x.x,right:(P.right-w.right+f.right)/x.x}}const td=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}=nt(e,t)||{};if(c==null)return{};const d=Vi(u),h={x:n,y:r},m=Er(o),f=Sr(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],P=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 R=x/2-P/2,C=k/2-g[f]/2-1,K=He(d[w],C),I=He(d[b],C),D=K,oe=k-g[f]-I,X=k/2-g[f]/2+R,te=xr(D,X,oe),$=!l.arrow&&mt(o)!=null&&X!==te&&i.reference[f]/2-(X<D?K:I)-g[f]/2<0,U=$?X<D?X-D:X-oe:0;return{[m]:h[m]+U,data:{[m]:te,centerOffset:X-te-U,...$&&{alignmentOffset:U}},reset:$}}}),nd=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}=nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=We(o),b=We(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=h||(b||!g?[wn(a)]:Xu(a));!h&&f!=="none"&&x.push(...Zu(a,g,f,v));const P=[a,...x],S=await Bt(t,y),k=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(S[w]),d){const D=Yu(o,s,v);k.push(S[D[0]],S[D[1]])}if(R=[...R,{placement:o,overflows:k}],!k.every(D=>D<=0)){var C,K;const D=(((C=i.flip)==null?void 0:C.index)||0)+1,oe=P[D];if(oe)return{data:{index:D,overflows:R},reset:{placement:oe}};let X=(K=R.filter(te=>te.overflows[0]<=0).sort((te,$)=>te.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!X)switch(m){case"bestFit":{var I;const te=(I=R.map($=>[$.placement,$.overflows.filter(U=>U>0).reduce((U,ie)=>U+ie,0)]).sort(($,U)=>$[1]-U[1])[0])==null?void 0:I[0];te&&(X=te);break}case"initialPlacement":X=a;break}if(o!==X)return{reset:{placement:X}}}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 Hi(e){return qu.some(t=>e[t]>=0)}const rd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=nt(e,t);switch(r){case"referenceHidden":{const i=await Bt(t,{...o,elementContext:"reference"}),s=ji(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Hi(s)}}}case"escaped":{const i=await Bt(t,{...o,altBoundary:!0}),s=ji(i,n.floating);return{data:{escapedOffsets:s,escaped:Hi(s)}}}default:return{}}}}};async function od(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=We(n),a=mt(n),l=Kt(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=nt(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 id=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 od(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}}}}},sd=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}=nt(e,t),c={x:n,y:r},u=await Bt(t,l),d=Kt(We(o)),h=zi(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=xr(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=xr(b,f,v)}const g=a.fn({...t,[h]:m,[d]:f});return{...g,data:{x:g.x-n,y:g.y-r}}}}},ad=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}=nt(e,t),l=await Bt(t,a),c=We(n),u=mt(n),d=Kt(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?He(w,S):S}else{const S=m-l.top-l.bottom;v=u||b?He(y,S):S}if(b&&!u){const S=he(l.left,0),k=he(l.right,0),R=he(l.top,0),C=he(l.bottom,0);d?x=h-2*(S!==0||k!==0?S+k:he(l.left,l.right)):v=m-2*(R!==0||C!==0?R+C:he(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:v});const P=await o.getDimensions(i.floating);return h!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function Ge(e){return qi(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ke(e){var t;return(t=(qi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qi(e){return e instanceof Node||e instanceof ge(e).Node}function Be(e){return e instanceof Element||e instanceof ge(e).Element}function Pe(e){return e instanceof HTMLElement||e instanceof ge(e).HTMLElement}function Wi(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}function zt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ld(e){return["table","td","th"].includes(Ge(e))}function Cr(e){const t=Or(),n=ve(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 cd(e){let t=yt(e);for(;Pe(t)&&!xn(t);){if(Cr(t))return t;t=yt(t)}return null}function Or(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xn(e){return["html","body","#document"].includes(Ge(e))}function ve(e){return ge(e).getComputedStyle(e)}function Sn(e){return Be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function yt(e){if(Ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wi(e)&&e.host||Ke(e);return Wi(t)?t.host:t}function Gi(e){const t=yt(e);return xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&zt(t)?t:Gi(t)}function Vt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Gi(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ge(o);return i?t.concat(s,s.visualViewport||[],zt(o)?o:[],s.frameElement&&n?Vt(s.frameElement):[]):t.concat(o,Vt(o,[],n))}function Yi(e){const t=ve(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 _r(e){return Be(e)?e:e.contextElement}function bt(e){const t=_r(e);if(!Pe(t))return qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Yi(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 ud=qe(0);function Xi(e){const t=ge(e);return!Or()||!t.visualViewport?ud:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=_r(e);let s=qe(1);t&&(r?Be(r)&&(s=bt(r)):s=bt(e));const a=dd(i,n,r)?Xi(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=ge(i),m=r&&Be(r)?ge(r):r;let f=h,g=f.frameElement;for(;g&&r&&m!==f;){const y=bt(g),w=g.getBoundingClientRect(),b=ve(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=ge(g),g=f.frameElement}}return vn({width:u,height:d,x:l,y:c})}const fd=[":popover-open",":modal"];function Ji(e){return fd.some(t=>{try{return e.matches(t)}catch{return!1}})}function hd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ke(r),a=t?Ji(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)&&((Ge(r)!=="body"||zt(s))&&(l=Sn(r)),Pe(r))){const h=rt(r);c=bt(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 gd(e){return Array.from(e.getClientRects())}function Zi(e){return rt(Ke(e)).left+Sn(e).scrollLeft}function pd(e){const t=Ke(e),n=Sn(e),r=e.ownerDocument.body,o=he(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=he(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Zi(e);const a=-n.scrollTop;return ve(r).direction==="rtl"&&(s+=he(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function md(e,t){const n=ge(e),r=Ke(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=Or();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function yd(e,t){const n=rt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pe(e)?bt(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 Qi(e,t,n){let r;if(t==="viewport")r=md(e,n);else if(t==="document")r=pd(Ke(e));else if(Be(t))r=yd(t,n);else{const o=Xi(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return vn(r)}function es(e,t){const n=yt(e);return n===t||!Be(n)||xn(n)?!1:ve(n).position==="fixed"||es(n,t)}function bd(e,t){const n=t.get(e);if(n)return n;let r=Vt(e,[],!1).filter(a=>Be(a)&&Ge(a)!=="body"),o=null;const i=ve(e).position==="fixed";let s=i?yt(e):e;for(;Be(s)&&!xn(s);){const a=ve(s),l=Cr(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zt(s)&&!l&&es(e,s))?r=r.filter(u=>u!==s):o=a,s=yt(s)}return t.set(e,r),r}function wd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?bd(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Qi(t,u,o);return c.top=he(d.top,c.top),c.right=He(d.right,c.right),c.bottom=He(d.bottom,c.bottom),c.left=he(d.left,c.left),c},Qi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vd(e){const{width:t,height:n}=Yi(e);return{width:t,height:n}}function xd(e,t,n){const r=Pe(t),o=Ke(t),i=n==="fixed",s=rt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=qe(0);if(r||!r&&!i)if((Ge(t)!=="body"||zt(o))&&(a=Sn(t)),r){const d=rt(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Zi(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 ts(e,t){return!Pe(e)||ve(e).position==="fixed"?null:t?t(e):e.offsetParent}function ns(e,t){const n=ge(e);if(!Pe(e)||Ji(e))return n;let r=ts(e,t);for(;r&&ld(r)&&ve(r).position==="static";)r=ts(r,t);return r&&(Ge(r)==="html"||Ge(r)==="body"&&ve(r).position==="static"&&!Cr(r))?n:r||cd(e)||n}const Sd=async function(e){const t=this.getOffsetParent||ns,n=this.getDimensions;return{reference:xd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Ed(e){return ve(e).direction==="rtl"}const rs={convertOffsetParentRelativeRectToViewportRelativeRect:hd,getDocumentElement:Ke,getClippingRect:wd,getOffsetParent:ns,getElementRects:Sd,getClientRects:gd,getDimensions:vd,getScale:bt,isElement:Be,isRTL:Ed};function kd(e,t){let n=null,r;const o=Ke(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:he(0,He(1,l))||1};let v=!0;function x(P){const S=P[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 Cd(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=_r(e),u=o||i?[...c?Vt(c):[],...Vt(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&a?kd(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?rt(e):null;l&&y();function y(){const w=rt(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 Od=sd,_d=nd,Pd=ad,Ad=rd,Td=td,Md=(e,t,n)=>{const r=new Map,o={platform:rs,...n},i={...o.platform,_c:r};return ed(e,t,{...o,platform:i})};function os(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 Dd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?os(r):e?e.getBoundingClientRect():os()}}}function Ld(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const Id={top:"bottom",right:"left",bottom:"top",left:"right"};function Rd(e,t){const[n,r]=e.split("-"),o=Id[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 $d(e){const t=_e({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]=_(),[o,i]=_(),[s,a]=_(t.placement),l=()=>Dd(t.anchorRef(),t.getAnchorRect),{direction:c}=br();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=[id(({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(Ld))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(_d({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&w.push(Od({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(Pd({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:k,rects:R}){const C=Math.round(R.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(Ad({padding:t.detachedPadding})),f&&w.push(Td({element:f,padding:t.arrowPadding}));const b=await Md(h,m,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...rs,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",Rd(b.placement,c()));const v=Math.round(b.x),x=Math.round(b.y);let P;if(t.hideWhenDetached&&(P=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${v}px, ${x}px, 0)`,visibility:P}),f&&b.middlewareData.arrow){const{x:S,y:k}=b.middlewareData.arrow,R=b.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:k!=null?`${k}px`:"",[R]:"100%"})}}M(()=>{const h=l(),m=n();if(!h||!m)return;const f=Cd(h,m,u,{elementResize:typeof ResizeObserver=="function"});B(f)}),M(()=>{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(Bi.Provider,{value:d,get children(){return t.children}})}const is=se();function ss(){return ue(is)}function wt(){const e=ss();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const as=se();function vt(){const e=ue(as);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
182
176
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
183
177
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
184
178
|
*
|
|
185
179
|
* Credits to the Radix UI team:
|
|
186
180
|
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
|
|
187
|
-
*/function dp(e,t){return t?hg([e.clientX,e.clientY],t):!1}function fp(e){const t=mn(),n=Ua(),r=Cl(),o=De({placement:"bottom-start"},e),[i,s]=U(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=L(),[f,m]=L(),[g,p]=L(),[y,v]=L(),[b,w]=L(!0),[x,T]=L(s.placement),[O,k]=L([]),[j,P]=L([]),{DomCollectionProvider:M}=fh({items:j,onItemsChange:P}),$=Oa({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:G=>i.onOpenChange?.(G)}),R=Ig(()=>t.forceMount()||$.isOpen()),se=eh({selectionMode:"none",dataSource:j}),J=G=>{w(G),$.open()},re=(G=!1)=>{$.close(),G&&r&&r.close(!0)},N=G=>{w(G),$.toggle()},X=()=>{const G=y();G&&(xe(G),se.selectionManager().setFocused(!0),se.selectionManager().setFocusedKey(void 0))},ge=G=>{k(dr=>[...dr,G]);const Ee=r?.registerNestedMenu(G);return()=>{k(dr=>Bo(dr,G)),Ee?.()}},E=G=>c===l?.side&&dp(G,l?.area),S=G=>{E(G)&&G.preventDefault()},C=G=>{E(G)||X()},W=G=>{E(G)&&G.preventDefault()};$g({isDisabled:()=>!(r==null&&$.isOpen()&&t.isModal()),targets:()=>[y(),...O()].filter(Boolean)}),V(()=>{const G=y();if(!G||!r)return;const Ee=r.registerNestedMenu(G);Z(()=>{Ee()})});const wt={dataset:A(()=>({"data-expanded":$.isOpen()?"":void 0,"data-closed":$.isOpen()?void 0:""})),isOpen:$.isOpen,contentPresence:R,nestedMenus:O,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>se,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:u,contentId:f,setTriggerRef:p,setContentRef:v,open:J,close:re,toggle:N,focusContent:X,onItemEnter:S,onItemLeave:C,onTriggerLeave:W,setPointerDir:G=>c=G,setPointerGraceTimeoutId:G=>a=G,setPointerGraceIntent:G=>l=G,registerNestedMenu:ge,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:Ar(d),registerContentId:Ar(m)};return h(M,{get children(){return h(Pl.Provider,{value:wt,get children(){return h(up,I({anchorRef:g,contentRef:y,onCurrentPlacementChange:T},s))}})}})}const Dl=ye();function gp(){const e=ve(Dl);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}function kl(e){let t;const n=mn(),r=pn(),o=De({id:n.generateId(`item-${Le()}`)},e),[i,s]=U(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=L(),[c,u]=L(),[d,f]=L(),m=()=>r.listState().selectionManager(),g=()=>s.id,p=()=>m().focusedKey()===g(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};gh({getItem:()=>({ref:()=>t,type:"item",key:g(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const v=Jg({key:g,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=P=>{Oe(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(xe(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=P=>{Oe(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},x=P=>{Oe(P,i.onPointerUp),!i.disabled&&P.button===0&&y()},T=P=>{if(Oe(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":y();break}},O=A(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=A(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),j={isChecked:()=>i.checked,dataset:k,setLabelRef:f,generateId:ha(()=>s.id),registerLabel:Ar(l),registerDescription:Ar(u)};return h(Dl.Provider,{value:j,get children(){return h(an,I({as:"div",ref(P){var M=Ct($=>t=$,i.ref);typeof M=="function"&&M(P)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return Ne([i.onPointerDown,v.onPointerDown])},get onPointerUp(){return Ne([x,v.onPointerUp])},get onClick(){return Ne([i.onClick,v.onClick])},get onKeyDown(){return Ne([T,v.onKeyDown])},get onMouseDown(){return Ne([i.onMouseDown,v.onMouseDown])},get onFocus(){return Ne([i.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},k,s))}})}function hp(e){const t=De({closeOnSelect:!1},e),[n,r]=U(t,["checked","defaultChecked","onChange","onSelect"]),o=Rg({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>n.onChange?.(s),isDisabled:()=>r.disabled});return h(kl,I({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}const pp=ye();function Tl(){return ve(pp)}function mp(e){let t;const n=mn(),r=pn(),o=Tl(),i=De({id:n.generateId(`content-${Le()}`)},e),[s,a]=U(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=nh({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);kg({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Ze(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}},f=y=>{s.onEscapeKeyDown?.(y),o?.setAutoFocusMenu(!1),r.close(!0)},m=y=>{s.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},g=y=>{Oe(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=y=>{if(Oe(y,s.onPointerMove),y.pointerType!=="mouse")return;const v=y.target,b=l!==y.clientX;Ze(y.currentTarget,v)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return V(()=>Z(r.registerContentId(s.id))),h(ie,{get when(){return r.contentPresence.isPresent()},get children(){return h(Ph,{get children(){return h(Sh,I({ref(y){var v=Ct(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof v=="function"&&v(y)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return A(()=>!!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:f,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return Ne([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return Ne([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return Ne([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return Ne([s.onFocusOut,u.onFocusOut])},onPointerEnter:g,onPointerMove:p},()=>r.dataset(),a))}})}})}function yp(e){let t;const n=mn(),r=pn(),[o,i]=U(e,["ref"]);return Ja({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),h(mp,I({ref(s){var a=Ct(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function vp(e){return h(kl,I({role:"menuitem",closeOnSelect:!0},e))}function bp(e){const t=gp(),n=De({id:t.generateId("indicator")},e),[r,o]=U(n,["forceMount"]);return h(ie,{get when(){return r.forceMount||t.isChecked()},get children(){return h(an,I({as:"div"},()=>t.dataset(),o))}})}function wp(e){const t=pn();return h(ie,{get when(){return t.contentPresence.isPresent()},get children(){return h(Io,e)}})}function xp(e){const t=`menu-${Le()}`,n=De({id:t,modal:!0},e),[r,o]=U(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=Oa({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:ha(()=>r.id),value:()=>r.value};return h(Ol.Provider,{value:s,get children(){return h(fp,I({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Sp(e){const t=mn(),n=pn(),r=Tl(),o=De({id:t.generateId("trigger")},e),[i,s]=U(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,V(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),V(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),V(()=>{n.isOpen()&&r.setValue(a)}),Z(()=>{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=g=>{Oe(g,i.onPointerDown),g.currentTarget.dataset.pointerType=g.pointerType,!i.disabled&&g.pointerType!=="touch"&&g.button===0&&l()},u=g=>{Oe(g,i.onClick),i.disabled||g.currentTarget.dataset.pointerType==="touch"&&l()},d=g=>{if(Oe(g,i.onKeyDown),!i.disabled)switch(g.key){case"Enter":case" ":case"ArrowDown":g.stopPropagation(),g.preventDefault(),pg(g.currentTarget),n.toggle("first");break;case"ArrowUp":g.stopPropagation(),g.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;g.stopPropagation(),g.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;g.stopPropagation(),g.preventDefault(),r.previousMenu();break}},f=g=>{Oe(g,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=g=>{Oe(g,i.onFocus),r!==void 0&&r.setValue(a)};return V(()=>Z(n.registerTriggerId(i.id))),h(ih,I({ref(g){var p=Ct(n.setTriggerRef,i.ref);typeof p=="function"&&p(g)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return A(()=>!!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:f,onClick:u,onKeyDown:d,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Ep(e){let t;const n=De({orientation:"horizontal"},e),[r,o]=U(n,["ref","orientation"]),i=La(()=>t,()=>"hr");return h(an,I({as:"hr",ref(s){var a=Ct(l=>t=l,r.ref);typeof a=="function"&&a(s)},get role(){return i()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}function Pp(e){const t=mn(),n=pn(),[r,o]=U(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return h(yp,I({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||xe(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function Cp(e){const t=`dropdownmenu-${Le()}`,n=De({id:t},e);return h(xp,n)}function Op(e){return pe({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-check",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="M5 12l5 5l10 -10"/>'},e)}function Dp(e){return pe({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 kp(e){return pe({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 Tp(e){return pe({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 $p(e){return pe({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 Ap(e){return pe({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)}var Mp=B('<span class="absolute left-2 flex size-3.5 items-center justify-center">');const Ip=e=>h(Cp,I({gutter:4},e)),Lp=Sp,Rp=e=>{const[,t]=U(e,["class"]);return h(wp,{get mount(){return Bn()},get children(){return h(Pp,I({get class(){return le("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))}})},Np=e=>{const[,t]=U(e,["class"]);return h(vp,I({get class(){return le("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))},Fp=e=>{const[,t]=U(e,["class"]);return h(Ep,I({get class(){return le("-mx-1 my-1 h-px bg-muted",e.class)}},t))},_p=e=>{const[,t]=U(e,["class","children"]);return h(hp,I({get class(){return le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 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,{get children(){return[(()=>{var n=Mp();return F(n,h(bp,{get children(){return h(Op,{class:"size-4"})}})),n})(),A(()=>e.children)]}}))};function Vp(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}async function Kp(e,t){return await new Promise(n=>setTimeout(n,1e3)),{contactId:"mock",interactionId:"mock",messages:[{media:{type:"image",link:"https://62daaa4fd548ba68369ee934-secured.s3.amazonaws.com/1688647717709-Banner-tem-que-ir-turismo-de-aventura-1920x1077-123-milhas.jpg",text:"Look what a great image!"},type:"media",origin:"bot",createdAt:new Date().toString()}]}}async function zp(e,t,n,r,o){if(!n||!r)return await Kp();const i=`${Vo}/v1/webhooks/widget`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientIdentifier:o,channelId:n,flowId:r,postback:t,type:"text",text:e})};return(await fetch(i,s)).json()}async function Bp(e,t,n){if(!e||!t||!n)return;const r=`${Vo}/v1/webhooks/widget/restart`,o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:e,contactId:t,interactionId:n})};await fetch(r,o)}const $l=1e3*60*60*24,{chatWidget:_r}=Pe(),[fi,Al]=Qs(`messages-${_r()?._id}`,[],$l),[yn,Ml]=Qs(`conversation-${_r()?._id}`,{},$l),[jp,Il]=L(!1),[Up,Ll]=L(!1),Rl=[],Nl=()=>{Rl.forEach(e=>e())},Wp=e=>Rl.push(e),gi=e=>{const t=Vp(e);if(Al(fi.length,t),t.type==="media"){setTimeout(Nl,200);return}Nl()},Hp=(e,t)=>{const{chatWidget:n}=Pe();e.trim()&&(gi({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),t&&console.log("postback:",t),Il(!0),zp(e,t,n()?._id,n()?.chat.flowId,yn.clientIdentifier).then(r=>{(r.contactId!==yn.contactId||r.interactionId!==yn.interactionId||r.clientIdentifier!==yn.clientIdentifier)&&Ml({contactId:r.contactId,interactionId:r.interactionId,clientIdentifier:r.clientIdentifier});for(const o of r.messages)gi(o)}).catch(console.error).finally(()=>Il(!1)))},Yp=()=>{const{chatWidget:e}=Pe();Ll(!0),Al([]),Bp(e()?._id,yn.contactId,yn.interactionId).finally(()=>{Ml({}),Ll(!1),Gp()})},Gp=()=>{if(fi.length===0&&_r()?.balloonMessage){const e=_r()?.balloonMessage;e&&gi({text:e,type:"text",origin:"bot",createdAt:new Date().toString()})}},Tt=()=>({messages:fi,pushMessage:Hp,clearMessages:Yp,onMessage:Wp,typing:jp,loading:Up});var qp=B("<span class=ml-1>Debug"),Zp=B("<span>Restart");const Xp=()=>{const{clearMessages:e}=Tt(),[t,n]=L(!1),[r,o]=L(!1);return h(Ip,{get open(){return r()},onOpenChange:o,get children(){return[h(Lp,{get children(){return h(Ce,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return h(Mf,{size:20})}})}}),h(Rp,{get children(){return[h(_p,{class:"flex items-center justify-start cursor-pointer",get checked(){return t()},onChange:n,get children(){return[h(Af,{size:14}),qp()]}}),h(Fp,{}),h(Np,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[h($f,{size:14}),Zp()]}})]}})]}})};function Jp(e){return pe({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 Qp(e){return pe({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 em(e){return pe({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 tm=B('<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 hi=()=>{const{chatWidget:e}=Pe(),[t,n]=L(!1),r=()=>{const i=Bn();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=Bn();i&&(i.style.display="none")}};return(()=>{var i=tm(),s=i.firstChild;return F(i,h(kf,{}),s),F(s,h(Ce,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return h(ie,{get when(){return t()},get fallback(){return h(Qp,{size:16})},get children(){return h(Jp,{size:16})}})}}),null),F(s,h(ie,{get when(){return e()?.showSettings},get children(){return h(Xp,{})}}),null),F(s,h(ie,{get when(){return e()?.mode==="popup"},get children(){return h(Ce,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return h(em,{size:16})}})}}),null),i})()};var nm=B("<span>");const Fl=({createdAt:e,anchor:t="end"})=>(()=>{var n=nm();return xt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),F(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var rm=B('<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 om=({children:e,createdAt:t})=>(()=>{var n=rm(),r=n.firstChild;return F(r,e),F(n,h(Fl,{createdAt:t,anchor:"start"}),null),n})();var im=B("<span>");const zt=e=>{const[,t]=U(e,["class","children"]);let n=e.children?.toString();return n&&(n=hf(pf(n))),(()=>{var r=im();return r.innerHTML=n,Xt(r,I({get class(){return le("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var sm=B('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const am=({options:e,text:t})=>{let n;const{pushMessage:r}=Tt(),[o,i]=L(!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=sm(),c=l.firstChild,u=c.firstChild;F(l,h(zt,{get children(){return t?.trim()}}),c),F(c,h(ie,{get when(){return e.length>1},get children(){return h(Ce,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return h(Dp,{size:20})}})}}),u);var d=n;return typeof d=="function"?Fs(d,u):n=u,F(u,h(Zt,{each:e,children:f=>h(Ce,{variant:"outline",get disabled(){return o()},class:"px-2 py-0 snap-center text-nowrap",onClick:()=>a(f.label,f.value),get children(){return f.label?.trim()}})})),F(c,h(ie,{get when(){return e.length>1},get children(){return h(Ce,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return h(kp,{size:20})}})}}),null),ue(()=>xt(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var lm=B('<div class="flex flex-col"><span>'),cm=B("<a target=_blank><img><span></span><span>");const um=({options:e,text:t})=>(()=>{var n=lm(),r=n.firstChild;return F(r,()=>t?.trim()),F(n,h(Zt,{each:e,children:o=>(()=>{var i=cm(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return F(a,()=>o.title?.trim()),F(l,()=>o.description?.trim()),ue(c=>{var u=o.url,d=o.image;return u!==c.e&&we(i,"href",c.e=u),d!==c.t&&we(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var dm=B("<a target=_blank>");const fm=({url:e,text:t})=>(()=>{var n=dm();return we(n,"href",e),F(n,()=>t?.trim()),n})();var gm=e=>{const t=I({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[A(()=>{if(n())return z(t.value)}),()=>{r(!0)},()=>{r(!1)}]},_l=gm,Jn=e=>typeof e=="function",hm=["button","color","file","image","reset","submit"],pm=(e,t)=>e==="button"?!0:e==="input"&&t?hm.indexOf(t)!==-1:!1;function mm(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>Q(()=>{let a;return Jn(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var pi=mm,Vr=new Map,Kr=(e,t)=>{if(Vr.has(e))return Vr.get(e);const n=ye(t);return Vr.set(e,n),n},mi=e=>{const t=Vr.get(e);if(t)return ve(t)},ym=e=>{const t=I({enabled:!0},e);V(()=>{z(t.enabled)&&(document.addEventListener("keydown",n),Z(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},vm=ym,bm=e=>{const t=I({enabled:!0},e);V(()=>{const{body:n}=document;z(t.enabled)&&ri({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},wm=bm,xm=e=>{const t=I({enabled:!0,strategy:"pointerup"},e);V(()=>{if(!z(t.enabled))return;const r=z(t.strategy);document.addEventListener(r,n),Z(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=z(t.element),i=z(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Sm=xm,Em=e=>{const t=I({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);vm({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Sm({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}),wm({enabled:t.noOutsidePointerEvents})},Pm=Em,yi=ye(),Cm=e=>A(()=>{if(ve(yi))return h(Vl,e);const r=Le(),[o,i]=L([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return h(yi.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return h(Vl,e)}})}),Vl=e=>{const t=I({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=U(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ve(yi),i=Le();V(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Pm({dismissOnEscapeKeyDown:()=>z(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>z(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>z(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=A(()=>n.children),l=()=>{const c=a();return Jn(c)?c({get isLastLayer(){return s()}}):c};return Q(()=>l())},Om=Cm,Dm=()=>{const[e,t]=L(!1);return V(()=>t(!0)),e},km=Dm,Tm=(e,t)=>(e&&(Jn(e)?e(t):e[0](e[1],t)),t.defaultPrevented),vi=(...e)=>e.some(t=>!!t()),$m=e=>(...t)=>{for(const n of e)n&&n(...t)},zr=(...e)=>$m(e),me=e=>e?"":void 0,Am="div",Mm=e=>{const[t,n]=U(e,["as"]),r=A(()=>t.as??Am);return A(()=>{const i=r();switch(typeof i){case"function":return Q(()=>i(n));case"string":return h(Fn,I({component:i},n))}})},bi=Mm,Im=e=>{let t,n=!1;return()=>n?t:(n=!0,t=A(e))},Kl=Im,Lm=e=>A(()=>z(e.element)?.tagName.toLowerCase()||e.fallback),Rm=Lm,zl="button",Nm=e=>{const[t,n]=L(null),[r,o]=U(e,["as","ref","type"]),i=Rm({element:t,fallback:zl}),s=A(()=>pm(i(),r.type));return h(bi,I({get as(){return r.as??zl},ref(a){var l=zr(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},Fm=Nm,_m='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"])',wi="focusTrap.initialFocus",xi="focusTrap.finalFocus",Bl={bubbles:!1,cancelable:!0},Vm=e=>{const t=I({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=A(()=>{const g=n();return g?g[0]??null:null}),i=A(()=>{const g=n();return g?g[g.length-1]??null:null});let s=null;const a=()=>{l(z(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(z(t.element))};V(()=>{const g=z(t.element);if(g&&z(t.enabled)){s=document.activeElement,Q(()=>{l(g),c(g)});const p=new MutationObserver(a);z(t.observeChanges)&&p.observe(g,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),Z(()=>{z(t.observeChanges)&&p.disconnect(),r(null),m(g)})}}),V(()=>{const g=n();g===null||g.length!==0||(document.addEventListener("keydown",f),Z(()=>{document.removeEventListener("keydown",f)}))}),V(()=>{const g=o();g&&(g.addEventListener("keydown",u),Z(()=>{g.removeEventListener("keydown",u)}))}),V(()=>{const g=i();g&&(g.addEventListener("keydown",d),Z(()=>{g.removeEventListener("keydown",d)}))});const l=g=>{r(Array.from(g.querySelectorAll(_m)))},c=g=>{const p=z(t.initialFocusElement)??o()??g,y=t.onInitialFocus;let v;y&&(v=new CustomEvent(wi,Bl),g.addEventListener(wi,y),g.dispatchEvent(v),g.removeEventListener(wi,y)),!v?.defaultPrevented&&cn(()=>p.focus())},u=g=>{g.key==="Tab"&&g.shiftKey&&(g.preventDefault(),i().focus())},d=g=>{g.key==="Tab"&&!g.shiftKey&&(g.preventDefault(),o().focus())},f=g=>{g.key==="Tab"&&g.preventDefault()},m=g=>{if(!z(t.restoreFocus))return;const y=z(t.finalFocusElement)??s;if(!y)return;let v;const b=t.onFinalFocus;b&&(v=new CustomEvent(xi,Bl),g.addEventListener(xi,b),g.dispatchEvent(v),g.removeEventListener(xi,b)),!v?.defaultPrevented&&cn(()=>y.focus())}},Km=Vm,zm=Km,Bm=e=>{const t=A(()=>{const s=z(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(z(e.show)?"present":"hidden");let i="none";return V(s=>{const a=z(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&&l!==c?"hiding":"hidden")}),a}),V(()=>{const s=z(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),Z(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},jm=Bm,jl=jm,Um=ye(),Wm=e=>e?Kr(`dialog-${e}`):Um,Ul=ye(),Hm=e=>e?Kr(`dialog-internal-${e}`):Ul,vn=e=>{if(!e){const n=ve(Ul);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=mi(`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},Ym="div",Gm=e=>{const[t,n]=U(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=A(()=>vn(t.contextId)),o=()=>vi(r().open,()=>t.forceMount,r().contentPresent),i=A(s=>s||o(),!1);return h(ie,{get when(){return i()},get children(){return h(Om,{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=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(bi,I({ref(l){var c=zr(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??Ym},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 me(r().open())},get"data-closed"(){return me(!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()}}))}})}})}})},qm=Gm,Zm="div",Xm=e=>{const[t,n]=U(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=A(()=>vn(t.contextId)),o=()=>vi(r().open,()=>t.forceMount,r().overlayPresent),i=A(s=>s||o(),!1);return h(ie,{get when(){return i()},get children(){return(()=>{const s=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(bi,I({get as(){return t.as??Zm},ref(a){var l=zr(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return me(r().open())},get"data-closed"(){return me(!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()}}))}})})()}})},Jm=Xm,Qm=e=>{const[t,n]=U(e,["forceMount","contextId","children"]),r=A(()=>vn(t.contextId)),o=()=>vi(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=km(),s=A(a=>a||o()&&i(),!1);return h(ie,{get when(){return s()},get children(){return(()=>{const a=A(()=>t.children);return h(ie,{get when(){return o()},get children(){return h(Io,I(n,{get children(){return a()}}))}})})()}})},ey=Qm,Si=!0,ty=e=>{const t=I({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Si),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Si),preventScroll:()=>!!(e.modal??Si),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Le()},e),[n,r]=pi({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=_l({value:()=>t.labelId??Le()}),[a,l,c]=_l({value:()=>t.descriptionId??Le()}),[u,d]=L(null),[f,m]=L(null),[g,p]=L(null),{present:y}=jl({show:n,element:f}),{present:v}=jl({show:n,element:g});zm({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ja({element:f,enabled:()=>y()&&z(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 z(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return z(t.noOutsidePointerEvents)},get preventScroll(){return z(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return z(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 f()},get overlayPresent(){return v()},get overlayRef(){return g()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Kl(()=>t.children),x=()=>{const O=w()();return Jn(O)?O(b):O};return A(()=>{const O=Wm(t.contextId),k=Hm(t.contextId);return h(O.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:f,overlayPresent:v,overlayRef:g,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return h(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:f,overlayPresent:v,overlayRef:g,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return Q(()=>x())}})}})})},ny=ty,ry="button",oy=e=>{const[t,n]=U(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=A(()=>vn(t.contextId));return h(Fm,I({ref(i){var s=zr(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??ry},onClick:i=>{!Tm(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 me(r().open())},get"data-closed"(){return me(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},iy=oy;function sy(e){const t=I({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;V(()=>{const c=z(t.element),u=z(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),Z(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=c=>{if(!n())for(const u of c){const d=u.target;if(d!==z(t.element))continue;const f=[d.offsetWidth,d.offsetHeight],m=z(t.dimension);m==="both"?s?s[0]!==f[0]&&s[1]!==f[1]&&(Be(()=>{i(s),r(!0)}),cn(()=>{i(f),parseFloat(getComputedStyle(u.target).transitionDuration)===0&&l()})):s=f:s?Br(m,s)!==Br(m,f)&&(Be(()=>{i(Br(m,s)),r(!0)}),cn(()=>{i(Br(m,f)),parseFloat(getComputedStyle(u.target).transitionDuration)===0&&l()})):s=f}},l=()=>{if(!n())return;const c=z(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Be(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Br=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},ay=sy,ly=ay,cy=(e,t)=>e.length>0?()=>e(Q(t)):e;function uy(e,t){let n=0;const r=e.map((o,i)=>A(()=>(n=i,o()),void 0,Kf));return A(()=>r.map(o=>o())[n],void 0,t)}function Wl(e,t,n){let r=()=>t;const[o,i]=L(t),s=A(cy(e,()=>r()),t);return[r=uy([o,s],n),a=>i(()=>typeof a=="function"?a(Q(r)):a)]}var dy=e=>h(iy,I({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Hl=ye(),fy=e=>e?Kr(`drawer-${e}`):Hl,gy=e=>{if(!e){const n=ve(Hl);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=mi(`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},Yl=ye(),hy=e=>e?Kr(`drawer-internal-${e}`):Yl,Gl=e=>{if(!e){const n=ve(Yl);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=mi(`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},ql=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:jr(e,t)};const o=r[n-1]?jr(r[n-1],t):void 0,i=r[n]?jr(r[n],t):void 0;return{value:e,offset:jr(e,t),lowerBreakPoint:i,upperBreakPoint:o}},jr=(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)},py=(e,t,n,r)=>{const o=Zl("upper",e,r?n:t),i=Zl("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},Zl=(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),my=(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},yy=void 0,vy=e=>{const t=I({initialOpen:!1,snapPoints:[0,1],breakPoints:[yy],defaultSnapPoint:1,side:"bottom",dampFunction:N=>6*Math.log(N+1),velocityFunction:(N,X)=>{const ge=N/X;return ge<1&&ge>-1?1:ge},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=U(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=pi({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=pi({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=L(),{transitioning:u,transitionSize:d}=ly({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,m]=L(!1),[g,p]=Wl(()=>u()?"resizing":null),y=A(()=>{const N=l()?.contentRef();if(N)return getComputedStyle(N)}),[v,b]=L(!1);V(()=>{const N=o();Q(()=>{v()!==N&&(N?(b(!0),cn(()=>{Be(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&p(null)})):(Be(()=>{p("closing"),a(0)}),cn(()=>{parseFloat(y().transitionDuration)===0&&w()})))})});const w=()=>{Be(()=>{b(!1),p(null)})},[x,T]=L(0);V(()=>{const N=l()?.contentRef();if(!N)return;k(N);const X=new ResizeObserver(O);X.observe(N),Z(()=>{X.disconnect()})});const O=N=>{for(const X of N)X.target===l()?.contentRef()&&k(X.target)},k=N=>{const X=Q(()=>x());switch(n.side){case"top":case"bottom":if(X===N.offsetHeight)return;T(N.offsetHeight);break;case"left":case"right":if(X===N.offsetWidth)return;T(N.offsetWidth);break}},j=A(()=>ql(s(),x())),[P,M]=Wl(()=>j().offset),$=A(()=>x()?(x()-P())/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 f()},get isTransitioning(){return g()!==null},get transitionState(){return g()},get openPercentage(){return $()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},se=Kl(()=>n.children),J=N=>{c(vn(n.contextId));const X=se()();if(Jn(X)){const ge=I(N,R);return X(ge)}return X};return A(()=>{const N=fy(n.contextId),X=hy(n.contextId);return Q(()=>h(N.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>g()!==null,transitionState:g,openPercentage:$,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return h(X.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>g()!==null,transitionState:g,openPercentage:$,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:M,drawerSize:x,resolvedActiveSnapPoint:j,drawerStyles:y,setTransitionState:p,transitionSize:d,closeDrawer:w}},get children(){return h(ny,I({get open(){return v()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:ge=>J(ge)}))}})}}))})},by=vy,wy=e=>{const[t,n]=U(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=A(()=>Gl(t.contextId)),c=A(()=>vn(t.contextId)),u=A(()=>l().snapPoints().map((w,x)=>ql(w,l().drawerSize(),x,l().breakPoints()))),d=A(()=>{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)`}}),f=A(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),m=A(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});V(()=>{c().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),Z(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const g=w=>{my(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[w.clientX,w.clientY]))},p=w=>{v(w.target,w.clientX,w.clientY)},y=w=>{w.touches[0]&&v(w.target,w.touches[0].clientX,w.touches[0].clientY)},v=(w,x,T)=>{if(!r)return;if(!l().isDragging()||o===null){const j=window.getSelection();if(j&&j.toString().length>0){b();return}if(l().handleScrollableElements()){const P=[x,T].map((re,N)=>i[N]-re),M=Math.abs(P[0])>Math.abs(P[1])?"x":"y",$=M==="x"?P[0]:P[1];if(Math.abs($)<.3)return;const R=c().contentRef(),[se,J]=Ya(w,M,R);if($>0&&Math.abs(se)>1||$<0&&Math.abs(J)>0){b();return}}switch(l().side()){case"top":case"bottom":o=T;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Be(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let O;switch(l().side()){case"top":O=-(o-T);break;case"bottom":O=o-T;break;case"right":O=o-x;break;case"left":O=-(o-x);break}O-=l().resolvedActiveSnapPoint().offset,O>0&&(O=l().dampFunction(O));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-O)},b=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-s.getTime()||1),T=l().translate()*x,O=py(u(),l().translate(),T,l().allowSkippingSnapPoints());Be(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Be(()=>{l().setActiveSnapPoint(O.value),O.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(O.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return h(qm,I({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:f(),width:m(),...t.style}},onPointerDown:g,onTransitionEnd:()=>{Be(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return me(l().isTransitioning())},get"data-opening"(){return me(l().transitionState()==="opening")},get"data-closing"(){return me(l().transitionState()==="closing")},get"data-snapping"(){return me(l().transitionState()==="snapping")},get"data-resizing"(){return me(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},xy=wy,Sy=e=>{const[t,n]=U(e,["contextId"]),r=A(()=>Gl(t.contextId));return h(Jm,I({get contextId(){return t.contextId},get"data-transitioning"(){return me(r().isTransitioning())},get"data-opening"(){return me(r().transitionState()==="opening")},get"data-closing"(){return me(r().transitionState()==="closing")},get"data-snapping"(){return me(r().transitionState()==="snapping")},get"data-resizing"(){return me(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Ey=Sy,Py=B('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const Cy=by,Oy=dy,Dy=ey,ky=e=>{const[,t]=U(e,["class"]),n=gy();return h(Ey,I({get class(){return le("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))},Ty=e=>{const[,t]=U(e,["class","children"]);return h(Dy,{get mount(){return Bn()},get children(){return[h(ky,{}),h(xy,I({get class(){return le("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[Py(),A(()=>e.children)]}}))]}})};var $y=B('<span class="font-semibold mt-2">'),Ay=B('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),My=B('<div class="flex flex-col space-y-2"><div>'),Iy=B('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),Ly=B('<div class="flex flex-col items-start"><span class=text-slate-500>');const Ry=({options:e,text:t,title:n})=>{const{pushMessage:r}=Tt(),[o,i]=L(!1),[s,a]=L(!1),[l,c]=L(),u=(d,f)=>{a(!1),i(!0),r(d,f)};return(()=>{var d=My(),f=d.firstChild;return F(d,h(zt,{get children(){return t?.trim()}}),f),F(f,h(Cy,{get open(){return s()},onOpenChange:a,get children(){return[h(Oy,{as:Ce,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??"Select an option"}}),h(Ty,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var m=$y();return F(m,()=>n?.trim()??"Select an option"),m})(),(()=>{var m=Ay();return F(m,h(Zt,{each:e,children:g=>(()=>{var p=Iy(),y=p.firstChild;return F(y,()=>g.label?.trim()??""),F(p,h(Zt,{get each(){return g.items},children:v=>h(Ce,{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 b=Ly(),w=b.firstChild;return F(b,()=>v.label?.trim(),w),F(w,()=>v.description?.trim()),b})(),h(ie,{get when(){return l()===v},get fallback(){return h($p,{class:"size-4 text-slate-500"})},get children(){return h(Tp,{class:"size-4 text-slate-500"})}})]}})}),null),p})()})),m})(),h(Ce,{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",children:"Send"})]}})]}})),ue(()=>xt(f,o()?"opacity-50":"")),d})()};var Ny=B("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const Fy=e=>(()=>{var t=Ny(),n=t.firstChild,r=n.nextSibling;return ue(o=>{var i=e.link,s=e.link;return i!==o.e&&we(n,"src",o.e=i),s!==o.t&&we(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var _y=B('<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 Vy=e=>(()=>{var t=_y(),n=t.firstChild,r=n.firstChild;return F(n,h(Ap,{class:"size-10"}),r),F(r,()=>e.filename?.trim()),F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(()=>we(n,"href",e.link)),t})();var Ky=B('<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 zy=e=>(()=>{var t=Ky(),n=t.firstChild,r=n.firstChild;return F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&we(n,"href",o.e=i),s!==o.t&&we(r,"src",o.t=s),a!==o.a&&we(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var By=B('<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 jy=e=>(()=>{var t=By(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return F(t,h(zt,{get children(){return e.text?.trim()}}),null),ue(i=>{var s=e.link,a=e.link;return s!==i.e&&we(r,"src",i.e=s),a!==i.t&&we(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var Uy=B("<div>Media type not supported");const Xl=e=>e.type==="image"?h(zy,e):e.type==="audio"?h(Fy,e):e.type==="document"?h(Vy,e):e.type==="video"?h(jy,e):Uy(),Jl=({text:e})=>h(zt,{get children(){return e?.trim()}});function Wy(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function $t(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=ye(i);function a(){const l=ve(s);if(!l&&t){const c=new Error(o??Wy(n,r));throw c.name="ContextError",Error.captureStackTrace?.(c,a),c}return l}return[s.Provider,a,s]}const Hy=Symbol(),Ql=Object.getPrototypeOf,Ei=new WeakMap,Yy=e=>e&&(Ei.has(e)?Ei.get(e):Ql(e)===Object.prototype||Ql(e)===Array.prototype),Gy=e=>Yy(e)&&e[Hy]||null,ec=(e,t=!0)=>{Ei.set(e,t)};function qy(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function tc(e,t){const n=qy();return n?(n[e]||(n[e]=t()),n[e]):t()}var Ur=()=>process.env.NODE_ENV!=="production",Pi=e=>typeof e=="object"&&e!==null,Bt=tc("__zag__proxyStateMap",()=>new WeakMap),Qn=tc("__zag__refSet",()=>new WeakSet),Zy=(e=Object.is,t=(c,u)=>new Proxy(c,u),n=c=>Pi(c)&&!Qn.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},o=new WeakMap,i=(c,u,d=r)=>{const f=o.get(c);if(f?.[0]===u)return f[1];const m=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return ec(m,!0),o.set(c,[u,m]),Reflect.ownKeys(c).forEach(g=>{const p=Reflect.get(c,g);Qn.has(p)?(ec(p,!1),m[g]=p):p instanceof Promise?Object.defineProperty(m,g,{get(){return d(p)}}):Bt.has(p)?m[g]=bn(p,d):m[g]=p}),Object.freeze(m)},s=new WeakMap,a=[1,1],l=c=>{if(!Pi(c))throw new Error("object required");const u=s.get(c);if(u)return u;let d=a[0];const f=new Set,m=(P,M=++a[0])=>{d!==M&&(d=M,f.forEach($=>$(P,M)))};let g=a[1];const p=(P=++a[1])=>(g!==P&&!f.size&&(g=P,v.forEach(([M])=>{const $=M[1](P);$>d&&(d=$)})),d),y=P=>(M,$)=>{const R=[...M];R[1]=[P,...R[1]],m(R,$)},v=new Map,b=(P,M)=>{if(Ur()&&v.has(P))throw new Error("prop listener already exists");if(f.size){const $=M[3](y(P));v.set(P,[M,$])}else v.set(P,[M])},w=P=>{const M=v.get(P);M&&(v.delete(P),M[1]?.())},x=P=>(f.add(P),f.size===1&&v.forEach(([$,R],se)=>{if(Ur()&&R)throw new Error("remove already exists");const J=$[3](y(se));v.set(se,[$,J])}),()=>{f.delete(P),f.size===0&&v.forEach(([$,R],se)=>{R&&(R(),v.set(se,[$]))})}),T=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),k=t(T,{deleteProperty(P,M){const $=Reflect.get(P,M);w(M);const R=Reflect.deleteProperty(P,M);return R&&m(["delete",[M],$]),R},set(P,M,$,R){const se=Reflect.has(P,M),J=Reflect.get(P,M,R);if(se&&(e(J,$)||s.has($)&&e(J,s.get($))))return!0;w(M),Pi($)&&($=Gy($)||$);let re=$;if(!Object.getOwnPropertyDescriptor(P,M)?.set)if($ instanceof Promise)$.then(N=>{Object.assign($,{status:"fulfilled",value:N}),m(["resolve",[M],N])}).catch(N=>{Object.assign($,{status:"rejected",reason:N}),m(["reject",[M],N])});else{!Bt.has($)&&n($)&&(re=Ci($));const N=!Qn.has(re)&&Bt.get(re);N&&b(M,N)}return Reflect.set(P,M,re,R),m(["set",[M],$,J]),!0}});s.set(c,k);const j=[T,p,i,x];return Bt.set(k,j),Reflect.ownKeys(c).forEach(P=>{const M=Object.getOwnPropertyDescriptor(c,P);M.get||M.set?Object.defineProperty(T,P,M):k[P]=c[P]}),k})=>[l,Bt,Qn,e,t,n,r,o,i,s,a],[Xy]=Zy();function Ci(e={}){return Xy(e)}function nc(e,t,n){const r=Bt.get(e);Ur()&&!r&&console.warn("Please use proxy object");let o;const i=[],s=r[3];let a=!1;const c=s(u=>{if(i.push(u),n){t(i.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,a&&t(i.splice(0))}))});return a=!0,()=>{a=!1,c()}}function bn(e,t){const n=Bt.get(e);Ur()&&!n&&console.warn("Please use proxy object");const[r,o,i]=n;return i(r,o(),t)}function Wr(e){return Qn.add(e),e}function Jy(e,t){Object.keys(t).forEach(o=>{if(Object.getOwnPropertyDescriptor(e,o))throw new Error("object property already defined");const i=t[o],{get:s,set:a}=typeof i=="function"?{get:i}:i,l={};l.get=()=>s(bn(r)),a&&(l.set=c=>a(r,c)),Object.defineProperty(e,o,l)});const r=Ci(e);return r}function rc(e,t,n){typeof n.value=="object"&&(n.value=wn(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function wn(e){if(typeof e!="object")return e;var t=0,n,r,o,i=Object.prototype.toString.call(e);if(i==="[object Object]"?o=Object.create(e.__proto__||null):i==="[object Array]"?o=Array(e.length):i==="[object Set]"?(o=new Set,e.forEach(function(s){o.add(wn(s))})):i==="[object Map]"?(o=new Map,e.forEach(function(s,a){o.set(wn(a),wn(s))})):i==="[object Date]"?o=new Date(+e):i==="[object RegExp]"?o=new RegExp(e.source,e.flags):i==="[object DataView]"?o=new e.constructor(wn(e.buffer)):i==="[object ArrayBuffer]"?o=e.slice(0):i.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)rc(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||rc(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}var Qy=Object.defineProperty,ev=(e,t,n)=>t in e?Qy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t,n)=>ev(e,typeof t!="symbol"?t+"":t,n);function tv(e){for(;e.length>0;)e.pop();return e}var oc=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,dt=e=>e,nv=()=>{},rv=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},ic=(()=>{let e=0;return()=>(e++,e.toString(36))})(),ov=()=>process.env.NODE_ENV!=="production",Hr=e=>Array.isArray(e),er=e=>!(e==null||typeof e!="object"||Hr(e)),iv=e=>typeof e=="number"&&!Number.isNaN(e),Ae=e=>typeof e=="string",Yr=e=>typeof e=="function",sv=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function Gr(e){if(!av(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Gr(o))}return n}var av=e=>e&&typeof e=="object"&&e.constructor===Object;function Oi(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function qr(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function sc(e,...t){for(const n of t){const r=Gr(n);for(const o in r)er(n[o])?(e[o]||(e[o]={}),sc(e[o],n[o])):e[o]=n[o]}return e}function ac(e){return wn(e)}function Ue(e){return Ae(e)?{type:e}:e}function At(e){return e?Hr(e)?e.slice():[e]:[]}function lc(e){return er(e)&&e.predicate!=null}var lv=()=>!0;function Di(e,t,n,r){return o=>Ae(o)?!!e[o]?.(t,n,r):Yr(o)?o(t,n,r):o.predicate(e)(t,n,r)}function cv(...e){return{predicate:t=>(n,r,o)=>e.map(Di(t,n,r,o)).some(Boolean)}}function uv(...e){return{predicate:t=>(n,r,o)=>e.map(Di(t,n,r,o)).every(Boolean)}}function dv(e){return{predicate:t=>(n,r,o)=>!Di(t,n,r,o)(e)}}function fv(...e){return(t,n,r)=>r.state.matches(...e)}var gv={or:cv,and:uv,not:dv,stateIn:fv};function cc(e,t){return e=e??lv,(n,r,o)=>{if(Ae(e)){const i=t[e];return Yr(i)?i(n,r,o):i}return lc(e)?e.predicate(t)(n,r,o):e?.(n,r,o)}}function ki(e,t){return(n,r,o)=>lc(e)?e.predicate(t)(n,r,o):e}function hv(e){const t=e.computed??dt({}),n=e.context??dt({}),r=e.initial?e.states?.[e.initial]?.tags:[],o=Ci({value:e.initial??"",previousValue:"",event:dt({}),previousEvent:dt({}),context:Jy(n,t),done:!1,tags:r??[],hasTag(i){return this.tags.includes(i)},matches(...i){return i.includes(this.value)},can(i){return dt(this).nextEvents.includes(i)},get nextEvents(){const i=e.states?.[this.value]?.on??{},s=e?.on??{};return Object.keys({...i,...s})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return dt(o)}function tr(e,t){return(n,r)=>{if(iv(e))return e;if(Yr(e))return e(n,r);if(Ae(e)){const o=Number.parseFloat(e);if(!Number.isNaN(o))return o;if(t){const i=t?.[e];return qr(i==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),Yr(i)?i(n,r):i}}}}function pv(e){return Ae(e)?{target:e}:e}function mv(e,t){return(n,r,o)=>At(e).map(pv).find(i=>cc(i.guard,t)(n,r,o)??i.target??i.actions)}var yv=class{constructor(e,t){_(this,"status","Not Started"),_(this,"state"),_(this,"initialState"),_(this,"initialContext"),_(this,"id"),_(this,"type","machine"),_(this,"activityEvents",new Map),_(this,"delayedEvents",new Map),_(this,"stateListeners",new Set),_(this,"doneListeners",new Set),_(this,"contextWatchers",new Set),_(this,"removeStateListener",nv),_(this,"parent"),_(this,"children",new Map),_(this,"guardMap"),_(this,"actionMap"),_(this,"delayMap"),_(this,"activityMap"),_(this,"sync"),_(this,"options"),_(this,"config"),_(this,"_created",()=>{const n=Ue("machine.created");this.executeActions(this.config?.created,n)}),_(this,"start",n=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=nc(this.state,()=>{this.stateListeners.forEach(l=>{l(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(Ue("machine.start"),At(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Ue("machine.start"));const r=Ue("machine.init"),o=er(n)?n.value:n,i=er(n)?n.context:void 0;i&&this.setContext(i);const s={target:o??this.config.initial},a=this.getNextStateInfo(s,r);return this.initialState=a,this.performStateChangeEffects(this.state.value,a,r),this}),_(this,"setupContextWatchers",()=>{const{watch:n}=this.config;if(!n)return;let r=bn(this.state.context);const o=nc(this.state.context,()=>{const i=bn(this.state.context);for(const[s,a]of Object.entries(n))(this.options.compareFns?.[s]??Object.is)(r[s],i[s])||this.executeActions(a,this.state.event);r=i});this.contextWatchers.add(o)}),_(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,Ue("machine.stop")),this.executeActions(this.config.exit,Ue("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),_(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),_(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(n=>n()),this.contextWatchers.clear()}),_(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(n=>{n.forEach(r=>r())}),this.delayedEvents.clear()}),_(this,"stopActivities",n=>{n?(this.activityEvents.get(n)?.forEach(r=>r()),this.activityEvents.get(n)?.clear(),this.activityEvents.delete(n)):(this.activityEvents.forEach(r=>{r.forEach(o=>o()),r.clear()}),this.activityEvents.clear())}),_(this,"sendChild",(n,r)=>{const o=Ue(n),i=oc(r,this.contextSnapshot),s=this.children.get(i);s||qr(`[@zag-js/core] Cannot send '${o.type}' event to unknown child`),s.send(o)}),_(this,"stopChild",n=>{this.children.has(n)||qr(`[@zag-js/core > stop-child] Cannot stop unknown child ${n}`),this.children.get(n).stop(),this.children.delete(n)}),_(this,"removeChild",n=>{this.children.delete(n)}),_(this,"stopChildren",()=>{this.children.forEach(n=>n.stop()),this.children.clear()}),_(this,"setParent",n=>{this.parent=n}),_(this,"spawn",(n,r)=>{const o=oc(n);return r&&(o.id=r),o.type="machine.actor",o.setParent(this),this.children.set(o.id,dt(o)),o.onDone(()=>{this.removeChild(o.id)}).start(),dt(Wr(o))}),_(this,"stopActivity",n=>{if(!this.state.value)return;const r=this.activityEvents.get(this.state.value);r?.get(n)?.(),r?.delete(n)}),_(this,"addActivityCleanup",(n,r,o)=>{n&&(this.activityEvents.has(n)?this.activityEvents.get(n)?.set(r,o):this.activityEvents.set(n,new Map([[r,o]])))}),_(this,"setState",n=>{this.state.previousValue=this.state.value,this.state.value=n;const r=this.getStateNode(n);n==null?tv(this.state.tags):this.state.tags=At(r?.tags)}),_(this,"setContext",n=>{n&&sc(this.state.context,Gr(n))}),_(this,"setOptions",n=>{const r=Gr(n);this.actionMap={...this.actionMap,...r.actions},this.delayMap={...this.delayMap,...r.delays},this.activityMap={...this.activityMap,...r.activities},this.guardMap={...this.guardMap,...r.guards}}),_(this,"getStateNode",n=>{if(n)return this.config.states?.[n]}),_(this,"getNextStateInfo",(n,r)=>{const o=this.determineTransition(n,r),i=!o?.target,s=o?.target??this.state.value,a=this.state.value!==s,l=this.getStateNode(s),u={reenter:!i&&!a&&!o?.internal,transition:o,stateNode:l,target:s,changed:a};return this.log("NextState:",`[${r.type}]`,this.state.value,"---->",u.target),u}),_(this,"getAfterActions",(n,r)=>{let o;return{entry:()=>{o=globalThis.setTimeout(()=>{const i=this.getNextStateInfo(n,this.state.event);this.performStateChangeEffects(this.state.value,i,this.state.event)},r)},exit:()=>{globalThis.clearTimeout(o)}}}),_(this,"getDelayedEventActions",n=>{const r=this.getStateNode(n),o=this.state.event;if(!r||!r.after)return;const i=[],s=[];if(Hr(r.after)){const a=this.determineTransition(r.after,o);if(!a)return;if(!sv(a,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(a)}`);const c=tr(a.delay,this.delayMap)(this.contextSnapshot,o),u=this.getAfterActions(a,c);return i.push(u.entry),s.push(u.exit),{entries:i,exits:s}}if(er(r.after))for(const a in r.after){const l=r.after[a],u=tr(a,this.delayMap)(this.contextSnapshot,o),d=this.getAfterActions(l,u);i.push(d.entry),s.push(d.exit)}return{entries:i,exits:s}}),_(this,"executeActions",(n,r)=>{const o=ki(n,this.guardMap)(this.contextSnapshot,r,this.guardMeta);for(const i of At(o)){const s=Ae(i)?this.actionMap?.[i]:i;Oi(Ae(i)&&!s,`[@zag-js/core > execute-actions] No implementation found for action: \`${i}\``),s?.(this.state.context,r,this.meta)}}),_(this,"executeActivities",(n,r,o)=>{for(const i of r){const s=Ae(i)?this.activityMap?.[i]:i;if(!s){Oi(`[@zag-js/core > execute-activity] No implementation found for activity: \`${i}\``);continue}const a=s(this.state.context,n,this.meta);if(a){const l=Ae(i)?i:i.name||ic();this.addActivityCleanup(o??this.state.value,l,a)}}}),_(this,"createEveryActivities",(n,r)=>{if(n)if(Hr(n)){const o=At(n).find(l=>{const c=l.delay,d=tr(c,this.delayMap)(this.contextSnapshot,this.state.event);return cc(l.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??d!=null});if(!o)return;const s=tr(o.delay,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{const l=globalThis.setInterval(()=>{this.executeActions(o.actions,this.state.event)},s);return()=>{globalThis.clearInterval(l)}})}else for(const o in n){const i=n?.[o],a=tr(o,this.delayMap)(this.contextSnapshot,this.state.event);r(()=>{const c=globalThis.setInterval(()=>{this.executeActions(i,this.state.event)},a);return()=>{globalThis.clearInterval(c)}})}}),_(this,"setEvent",n=>{this.state.previousEvent=this.state.event,this.state.event=Wr(Ue(n))}),_(this,"performExitEffects",(n,r)=>{const o=this.state.value;if(o==="")return;const i=n?this.getStateNode(n):void 0;this.stopActivities(o);const s=ki(i?.exit,this.guardMap)(this.contextSnapshot,r,this.guardMeta),a=At(s),l=this.delayedEvents.get(o);l&&a.push(...l),this.executeActions(a,r)}),_(this,"performEntryEffects",(n,r)=>{const o=this.getStateNode(n),i=At(o?.activities);this.createEveryActivities(o?.every,c=>{i.unshift(c)}),i.length>0&&this.executeActivities(r,i);const s=ki(o?.entry,this.guardMap)(this.contextSnapshot,r,this.guardMeta),a=At(s),l=this.getDelayedEventActions(n);o?.after&&l&&(this.delayedEvents.set(n,l?.exits),a.push(...l.entries)),this.executeActions(a,r),o?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(c=>{c(this.stateSnapshot)}),this.stop())}),_(this,"performTransitionEffects",(n,r)=>{const o=this.determineTransition(n,r);this.executeActions(o?.actions,r)}),_(this,"performStateChangeEffects",(n,r,o)=>{this.setEvent(o);const i=r.changed||r.reenter;i&&this.performExitEffects(n,o),this.performTransitionEffects(r.transition,o),this.setState(r.target),i&&this.performEntryEffects(r.target,o)}),_(this,"determineTransition",(n,r)=>mv(n,this.guardMap)?.(this.contextSnapshot,r,this.guardMeta)),_(this,"sendParent",n=>{this.parent||qr("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const r=Ue(n);this.parent?.send(r)}),_(this,"log",(...n)=>{ov()&&this.options.debug&&console.log(...n)}),_(this,"send",n=>{const r=Ue(n);this.transition(this.state.value,r)}),_(this,"transition",(n,r)=>{const o=Ae(n)?this.getStateNode(n):n?.stateNode,i=Ue(r);if(!o&&!this.config.on){const l=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${n}, \`event\`: ${i.type}`;Oi(l);return}const s=o?.on?.[i.type]??this.config.on?.[i.type],a=this.getNextStateInfo(s,i);return this.performStateChangeEffects(this.state.value,a,i),a.stateNode}),_(this,"subscribe",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),()=>{this.stateListeners.delete(n)})),_(this,"onDone",n=>(this.doneListeners.add(n),this)),_(this,"onTransition",n=>(this.stateListeners.add(n),this.status==="Running"&&n(this.stateSnapshot),this)),this.config=ac(e),this.options=ac(t??{}),this.id=this.config.id??`machine-${ic()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??!1,this.state=hv(this.config),this.initialContext=bn(this.state.context)}get stateSnapshot(){return dt(bn(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const e=this.getState();return{value:e.value,tags:e.tags}}},uc=(e,t)=>new yv(e,t),vv=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),bv=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,dc=e=>{const t={};let n;for(;n=bv.exec(e);)t[n[1]]=n[2];return t},wv=(e,t)=>{if(Ae(e)){if(Ae(t))return`${e};${t}`;e=dc(e)}else Ae(t)&&(t=dc(t));return Object.assign({},e??{},t??{})};function xv(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=rv(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=vv(t[r],n[r]);continue}if(r==="style"){t[r]=wv(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function Sv(e){return new Proxy({},{get(){return e}})}var jt=()=>e=>Array.from(new Set(e));function ce(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let l=e[a];typeof l=="function"&&(l=l()),s=xv(s,{[i]:(l||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let l,c=e[a];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}})}}return t}var Ev=e=>Array.isArray(e),Pv=e=>!(e==null||typeof e!="object"||Ev(e)),Cv=e=>typeof e=="number"&&!Number.isNaN(e),fc=e=>typeof e=="string",gc={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},Ov=e=>e.startsWith("--")?e:Iv(e);function Dv(e){return e in gc?gc[e]:e}var kv=Sv(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&Pv(r)){t.style=Tv(r);continue}if(n==="children"){fc(r)&&(t.textContent=r);continue}t[Dv(n)]=r}}return t});function Tv(e){let t={};for(const n in e){const r=e[n];!fc(r)&&!Cv(r)||(t[Ov(n)]=r)}return t}var $v=/[A-Z]/g,Av=/^ms-/;function Mv(e){return"-"+e.toLowerCase()}var Ti={};function Iv(e){if(Ti.hasOwnProperty(e))return Ti[e];var t=e.replace($v,Mv);return Ti[e]=Av.test(t)?"-"+t:t}function Lv(e,t){const{actions:n,context:r}=t??{},[o,i]=Zs(e.getState());return Ft(()=>{const s=e.subscribe(a=>{i(Ad(a))});Z(()=>{s()})}),V(()=>{const s=typeof r=="function"?r():r;e.setContext(s)}),V(()=>{e.setOptions({actions:n})}),o}function Rv(e,t){const{state:n,context:r}=t??{},o=(()=>{const i=typeof e=="function"?e():e,s=typeof r=="function"?r():r;return s&&i.setContext(s),i._created(),i})();return Ft(()=>{o.start(n),Z(()=>{o.stop()})}),o}function hc(e,t){const n=Rv(e,t);return[Lv(n,t),n.send,n]}const xn=()=>(e,t)=>U(e,t);$t({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});const Nv=e=>xn()(e,["lazyMount","unmountOnExit"]),$i=e=>n=>{const[r,o]=U(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=U(o,["ref"]);return ce(a,s)};return r.asChild(i)}return h(Fn,I({component:e},o))};function Fv(){const e=new Map;return new Proxy($i,{apply(t,n,r){return $i(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,$i(r)),e.get(r)}})}const de=Fv();var Zr=(e,t=[])=>({parts:(...n)=>{if(_v(t))return Zr(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Zr(e,[...t,...n]),rename:n=>Zr(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Sn(e)}"][data-part="${Sn(r)}"]`,`& [data-scope="${Sn(e)}"][data-part="${Sn(r)}"]`].join(", "),attrs:{"data-scope":Sn(e),"data-part":Sn(r)}}}),{})}),Sn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),_v=e=>e.length===0,te=e=>e?"":void 0,Se=e=>e?"true":void 0,Vv=1,Kv=9,zv=11,Xr=e=>typeof e=="object"&&e!==null,ft=e=>Xr(e)&&e.nodeType===Vv&&typeof e.nodeName=="string",pc=e=>Xr(e)&&e.nodeType===Kv,Bv=e=>Xr(e)&&e===e.window,jv=e=>Xr(e)&&e.nodeType!==void 0,Uv=e=>jv(e)&&e.nodeType===zv&&"host"in e;function Jr(e,t){return!e||!t||!ft(e)||!ft(t)?!1:e===t||e.contains(t)}function Qr(e){return pc(e)?e:Bv(e)?e.document:e?.ownerDocument??document}function Ai(e){return Uv(e)?Ai(e.host):pc(e)?e.defaultView??window:ft(e)?e.ownerDocument?.defaultView??window:window}var Wv=()=>typeof document<"u";function Hv(){return navigator.userAgentData?.platform??navigator.platform}var mc=e=>Wv()&&e.test(Hv()),Yv=()=>mc(/^Mac/),yc=()=>mc(/iP(hone|ad|od)|iOS/);function Gv(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function nr(e){return Gv(e)?.[0]??e.target}function qv(e){return e.nativeEvent?.isComposing??e.isComposing}var Zv=e=>typeof e=="object"&&e!==null&&e.nodeType===1;function Xv(e){return Zv(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1}var Jv="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function vc(e){return!e||e.closest("[inert]")?!1:e.matches(Jv)&&Xv(e)}function Qv(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function Ve(e){const t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function eb(e,t){return Array.from(e?.querySelectorAll(t)??[])}function tb(e,t){return e?.querySelector(t)??null}function nb(e){const t={getRootNode:n=>n.getRootNode?.()??document,getDoc:n=>Qr(t.getRootNode(n)),getWin:n=>t.getDoc(n).defaultView??window,getActiveElement:n=>t.getRootNode(n).activeElement,isActiveElement:(n,r)=>r===t.getActiveElement(n),getById:(n,r)=>t.getRootNode(n).getElementById(r),setValue:(n,r)=>{if(n==null||r==null)return;const o=r.toString();n.value!==o&&(n.value=r.toString())}};return{...t,...e}}var Mi=new WeakMap;function rb(e,t,n){Mi.has(e)||Mi.set(e,new Map);const r=Mi.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{r.get(t)?.(),r.delete(t)};const i=n(),s=()=>{i(),o(),r.delete(t)};return r.set(t,s),()=>{r.get(t)===s&&(i(),r.set(t,o))}}function ob(e,t){return e?rb(e,"style",()=>{const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var ib=1e3/60;function sb(e,t){const n=e();if(ft(n)&&n.isConnected)return t(n),()=>{};{const r=setInterval(()=>{const o=e();ft(o)&&o.isConnected&&(t(o),clearInterval(r))},ib);return()=>clearInterval(r)}}function ab(e,t){const n=[];return e?.forEach(r=>{const o=sb(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}var lb=e=>e[e.length-1],bc=(e,t)=>{const n=[];return e.reduce((r,o,i)=>(i%t===0?r.push([o]):lb(r)?.push(o),r),n)},wc=e=>e?.constructor.name==="Array",cb=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ii(e[n],t[n]))return!1;return!0},Ii=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(wc(e)&&wc(t))return cb(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Ii(e[i],t[i]))return!1}return!0},ub=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,db=()=>{},xc=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function rr(e,t,...n){if(e in t){const o=t[e];return typeof o=="function"?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,rr),r}var fb=e=>typeof e=="function",gb=e=>e==null;function Li(e){if(!hb(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Li(o))}return n}var hb=e=>e&&typeof e=="object"&&e.constructor===Object;function pb(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}const[f1,mb]=$t({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),[g1,yb]=$t({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});var En="default",Ri="",eo=new WeakMap;function vb(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return yc()?(En==="default"&&(Ri=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),En="disabled"):t&&(eo.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Sc({target:t,doc:r})}function Sc(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(yc()){if(En!=="disabled")return;En="restoring",setTimeout(()=>{Qv(()=>{En==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Ri||""),Ri="",En="default")})},300)}else if(t&&eo.has(t)){const i=eo.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),eo.delete(t)}}function bb(e={}){const{defer:t,target:n,...r}=e,o=t?Ve:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(vb({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}var Ni=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}},wb=e=>e.button===2||Yv()&&e.ctrlKey&&e.button===0;function Ec(e,t,n){const o=(s=>{const a=requestAnimationFrame(s);return()=>cancelAnimationFrame(a)})(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function Pc(e,t,n){if(!e)return;const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}var xb={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Cc={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Sb(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let{key:o}=e;return o=xb[o]??o,n==="rtl"&&r==="horizontal"&&o in Cc&&(o=Cc[o]),o}function Eb(e){return e.nativeEvent??e}const Pb=e=>xn()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]);function Cb(e,t,n){const r=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&r,present:r,setNode(o){o&&t({type:"NODE.SET",node:o})},unmount(){t({type:"UNMOUNT"})}}}function to(e){return e?.animationName||"none"}function Ob(e){return uc({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...e},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(t){t.initial=!0},clearInitial(t){t.initial=!1},invokeOnExitComplete(t){t.onExitComplete?.()},setNode(t,n){t.node=Wr(n.node)},setStyles(t,n){const r=n.node.ownerDocument.defaultView||window;t.styles=Wr(r.getComputedStyle(n.node))},syncPresence(t,n,{send:r}){if(t.present){r({type:"MOUNT",src:"presence.changed"});return}const o=to(t.styles);(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.unmountAnimationName=o,o==="none"||o===t.prevAnimationName||t.styles?.display==="none"||t.styles?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(t){(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.prevAnimationName=to(t.styles)})},clearPrevAnimationName(t){t.prevAnimationName=null}},activities:{trackAnimationEvents(t,n,{send:r}){const o=t.node;if(!o)return;const i=a=>{a.target===o&&(t.prevAnimationName=to(t.styles))},s=a=>{const l=to(t.styles);a.target===o&&l===t.unmountAnimationName&&r({type:"UNMOUNT",src:"animationend"})};return o.addEventListener("animationstart",i),o.addEventListener("animationcancel",s),o.addEventListener("animationend",s),()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",s),o.removeEventListener("animationend",s)}}}})}jt()(["onExitComplete","present","immediate"]);const Db=e=>{const[t,n]=Nv(e),[r,o]=L(!1),[i,s]=hc(Ob(n),{context:n}),a=A(()=>Cb(i,s));return V(()=>{a().present&&o(!0)}),A(()=>({unmounted:!a().present&&!r()&&t.lazyMount||t.unmountOnExit&&!a().present&&r(),present:a().present,presenceProps:{ref:a().setNode,hidden:!a().present,"data-state":n.present?"open":"closed"}}))},[kb,Oc]=$t({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Fi=Math.min,Pn=Math.max,no=Math.round,ro=Math.floor,Mt=e=>({x:e,y:e});function Cn(e){return Dc(e)?(e.nodeName||"").toLowerCase():"#document"}function Me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(Dc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dc(e){return e instanceof Node||e instanceof Me(e).Node}function We(e){return e instanceof Element||e instanceof Me(e).Element}function Je(e){return e instanceof HTMLElement||e instanceof Me(e).HTMLElement}function kc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Me(e).ShadowRoot}function or(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=He(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Tb(e){return["table","td","th"].includes(Cn(e))}function oo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function _i(e){const t=Vi(),n=We(e)?He(e):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 $b(e){let t=It(e);for(;Je(t)&&!On(t);){if(_i(t))return t;if(oo(t))return null;t=It(t)}return null}function Vi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function On(e){return["html","body","#document"].includes(Cn(e))}function He(e){return Me(e).getComputedStyle(e)}function io(e){return We(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function It(e){if(Cn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kc(e)&&e.host||gt(e);return kc(t)?t.host:t}function Tc(e){const t=It(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:Je(t)&&or(t)?t:Tc(t)}function ir(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Tc(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Me(o);return i?t.concat(s,s.visualViewport||[],or(o)?o:[],s.frameElement&&n?ir(s.frameElement):[]):t.concat(o,ir(o,[],n))}function $c(e){const t=He(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Je(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=no(n)!==i||no(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ki(e){return We(e)?e:e.contextElement}function Dn(e){const t=Ki(e);if(!Je(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=$c(t);let s=(i?no(n.width):n.width)/r,a=(i?no(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ab=Mt(0);function Ac(e){const t=Me(e);return!Vi()||!t.visualViewport?Ab:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Me(e)?!1:t}function Ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ki(e);let s=Mt(1);t&&(r?We(r)&&(s=Dn(r)):s=Dn(e));const a=Mb(i,n,r)?Ac(i):Mt(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 f=Me(i),m=r&&We(r)?Me(r):r;let g=f,p=g.frameElement;for(;p&&r&&m!==g;){const y=Dn(p),v=p.getBoundingClientRect(),b=He(p),w=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,x=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=x,g=Me(p),p=g.frameElement}}return fn({width:u,height:d,x:l,y:c})}function Ib(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=gt(r),a=t?oo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Mt(1);const u=Mt(0),d=Je(r);if((d||!d&&!i)&&((Cn(r)!=="body"||or(s))&&(l=io(r)),Je(r))){const f=Ut(r);c=Dn(r),u.x=f.x+r.clientLeft,u.y=f.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 Lb(e){return Array.from(e.getClientRects())}function Mc(e){return Ut(gt(e)).left+io(e).scrollLeft}function Rb(e){const t=gt(e),n=io(e),r=e.ownerDocument.body,o=Pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Mc(e);const a=-n.scrollTop;return He(r).direction==="rtl"&&(s+=Pn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Nb(e,t){const n=Me(e),r=gt(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=Vi();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Fb(e,t){const n=Ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Je(e)?Dn(e):Mt(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 Ic(e,t,n){let r;if(t==="viewport")r=Nb(e,n);else if(t==="document")r=Rb(gt(e));else if(We(t))r=Fb(t,n);else{const o=Ac(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return fn(r)}function Lc(e,t){const n=It(e);return n===t||!We(n)||On(n)?!1:He(n).position==="fixed"||Lc(n,t)}function _b(e,t){const n=t.get(e);if(n)return n;let r=ir(e,[],!1).filter(a=>We(a)&&Cn(a)!=="body"),o=null;const i=He(e).position==="fixed";let s=i?It(e):e;for(;We(s)&&!On(s);){const a=He(s),l=_i(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||or(s)&&!l&&Lc(e,s))?r=r.filter(u=>u!==s):o=a,s=It(s)}return t.set(e,r),r}function Vb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?oo(t)?[]:_b(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Ic(t,u,o);return c.top=Pn(d.top,c.top),c.right=Fi(d.right,c.right),c.bottom=Fi(d.bottom,c.bottom),c.left=Pn(d.left,c.left),c},Ic(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Kb(e){const{width:t,height:n}=$c(e);return{width:t,height:n}}function zb(e,t,n){const r=Je(t),o=gt(t),i=n==="fixed",s=Ut(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Mt(0);if(r||!r&&!i)if((Cn(t)!=="body"||or(o))&&(a=io(t)),r){const d=Ut(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Mc(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){return He(e).position==="static"}function Rc(e,t){return!Je(e)||He(e).position==="fixed"?null:t?t(e):e.offsetParent}function Nc(e,t){const n=Me(e);if(oo(e))return n;if(!Je(e)){let o=It(e);for(;o&&!On(o);){if(We(o)&&!zi(o))return o;o=It(o)}return n}let r=Rc(e,t);for(;r&&Tb(r)&&zi(r);)r=Rc(r,t);return r&&On(r)&&zi(r)&&!_i(r)?n:r||$b(e)||n}const Bb=async function(e){const t=this.getOffsetParent||Nc,n=this.getDimensions,r=await n(e.floating);return{reference:zb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jb(e){return He(e).direction==="rtl"}const Ub={convertOffsetParentRelativeRectToViewportRelativeRect:Ib,getDocumentElement:gt,getClippingRect:Vb,getOffsetParent:Nc,getElementRects:Bb,getClientRects:Lb,getDimensions:Kb,getScale:Dn,isElement:We,isRTL:jb};function Wb(e,t){let n=null,r;const o=gt(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:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const m=ro(u),g=ro(o.clientWidth-(c+d)),p=ro(o.clientHeight-(u+f)),y=ro(c),b={rootMargin:-m+"px "+-g+"px "+-p+"px "+-y+"px",threshold:Pn(0,Fi(1,l))||1};let w=!0;function x(T){const O=T[0].intersectionRatio;if(O!==l){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function Hb(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=Ki(e),u=o||i?[...c?ir(c):[],...ir(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?Wb(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let g,p=l?Ut(e):null;l&&y();function y(){const v=Ut(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,g=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const Yb=ll,Gb=cl,qb=il,Zb=ul,Xb=ol,Jb=Rh,Qb=(e,t,n)=>{const r=new Map,o={platform:Ub,...n},i={...o.platform,_c:r};return rl(e,t,{...o,platform:i})};function Fc(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function ew(e){if(!e)return Fc();const{x:t,y:n,width:r,height:o}=e;return Fc(t,n,r,o)}function tw(e,t){return{contextElement:ft(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?ew(r):n.getBoundingClientRect()}}}var sr=e=>({variable:e,reference:`var(${e})`}),ht={arrowSize:sr("--arrow-size"),arrowSizeHalf:sr("--arrow-size-half"),arrowBg:sr("--arrow-background"),transformOrigin:sr("--transform-origin"),arrowOffset:sr("--arrow-offset")},nw=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),rw={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,o=nw(r)[e],{floating:i}=t;return i.style.setProperty(ht.transformOrigin.variable,o),{data:{transformOrigin:o}}}},ow={name:"rects",fn({rects:e}){return{data:e}}},iw=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${ht.arrowOffset.reference})`}),{}}}};function sw(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var aw={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function _c(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Vc(e){return ub(e.boundary)}function lw(e,t){if(e)return Xb({element:e,padding:t.arrowPadding})}function cw(e,t){if(!gb(t.offset??t.gutter))return Yb(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=sw(n),a=s?void 0:t.shift,l=t.offset?.crossAxis??a;return Li({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function uw(e){if(e.flip)return qb({boundary:Vc(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function dw(e){if(!(!e.slide&&!e.overlap))return Gb({boundary:Vc(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Jb()})}function fw(e){return Zb({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){const i=t.floating,s=Math.round(n.reference.width);o=Math.floor(o),r=Math.floor(r),i.style.setProperty("--reference-width",`${s}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${r}px`)}})}function gw(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function hw(e,t,n={}){const r=tw(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},aw,n),i=t.querySelector("[data-part=arrow]"),s=[cw(i,o),uw(o),dw(o),lw(i,o),iw(i),rw,fw(o),ow],{placement:a,strategy:l,onComplete:c,onPositioned:u}=o,d=async()=>{if(!r||!t)return;const p=await Qb(r,t,{placement:a,middleware:s,strategy:l});c?.(p),u?.({placed:!0});const y=Ai(t),v=_c(y,p.x),b=_c(y,p.y);t.style.setProperty("--x",`${v}px`),t.style.setProperty("--y",`${b}px`);const w=t.firstElementChild;if(w){const x=y.getComputedStyle(w).zIndex;t.style.setProperty("--z-index",x)}},f=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d}),u?.({placed:!0})):await d()},m=gw(o.listeners),g=o.listeners?Hb(r,t,f,m):db;return f(),()=>{g?.(),u?.({placed:!1})}}function pw(e,t,n={}){const{defer:r,...o}=n,i=r?Ve:a=>a(),s=[];return s.push(i(()=>{const a=typeof e=="function"?e():e,l=typeof t=="function"?t():t;s.push(hw(a,l,o))})),()=>{s.forEach(a=>a?.())}}var mw={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function yw(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:ht.arrowSize.reference,height:ht.arrowSize.reference,[ht.arrowSizeHalf.variable]:`calc(${ht.arrowSize.reference} / 2)`,[ht.arrowOffset.variable]:`calc(${ht.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?mw[t.split("-")[0]]:void 0,background:ht.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function vw(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},queueBeforeEvent(n,r){const o=new Set;return t.each(i=>{try{o.add(Ec(i.document,n,r))}catch{}}),()=>{try{o.forEach(i=>i())}catch{}}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}var Kc="pointerdown.outside",zc="focus.outside";function bw(e){for(const t of e)if(ft(t)&&vc(t))return!0;return!1}var Bc=e=>"clientY"in e;function ww(e,t){if(!Bc(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function xw(e){const t=nr(e);if(!t||!Bc(e))return!1;const r=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,i=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return r||i}function Sw(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s}=t;if(!e)return;const a=Qr(e),l=Ai(e),c=vw(l);function u(y){const v=nr(y);return!ft(v)||Jr(e,v)||ww(e,y)||xw(y)?!1:!n?.(v)}const d=new Set;function f(y){function v(){const b=s?Ve:x=>x(),w=y.composedPath?.()??[y.target];b(()=>{if(!(!e||!u(y))){if(o||i){const x=xc(o,i);e.addEventListener(Kc,x,{once:!0})}Pc(e,Kc,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:wb(y),focusable:bw(w)}})}})}y.pointerType==="touch"?(d.forEach(b=>b()),d.add(Ec(a,"pointerup",v)),d.add(c.queueBeforeEvent("pointerup",v))):v()}const m=new Set,g=setTimeout(()=>{m.add(c.addEventListener("pointerdown",f,!0)),m.add(Ni(a,"pointerdown",f,!0))},0);function p(y){(s?Ve:b=>b())(()=>{if(!(!e||!u(y))){if(r||i){const b=xc(r,i);e.addEventListener(zc,b,{once:!0})}Pc(e,zc,{bubbles:!1,cancelable:!0,detail:{originalEvent:y,contextmenu:!1,focusable:vc(nr(y))}})}})}return m.add(Ni(a,"focusin",p,!0)),m.add(c.addEventListener("focusin",p,!0)),()=>{clearTimeout(g),d.forEach(y=>y()),m.forEach(y=>y())}}function Ew(e,t){const{defer:n}=t,r=n?Ve:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(Sw(i,t))})),()=>{o.forEach(i=>i?.())}}function Pw(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Ni(Qr(e),"keydown",n,{capture:!0})}var Ye={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Jr(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Jr(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},jc;function Uc(){Ye.layers.forEach(({node:e})=>{e.style.pointerEvents=Ye.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Cw(e){e.style.pointerEvents=""}function Ow(e,t){const n=Qr(e),r=[];if(Ye.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(jc=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const o=ab(t,i=>{r.push(ob(i,{pointerEvents:"auto"}))});r.push(o)}return()=>{Ye.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=jc,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function Dw(e,t){if(!e){pb("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:n,pointerBlocking:r,exclude:o,debug:i}=t,s={dismiss:n,node:e,pointerBlocking:r};Ye.add(s),Uc();function a(f){const m=nr(f.detail.originalEvent);Ye.isBelowPointerBlockingLayer(e)||Ye.isInBranch(m)||(t.onPointerDownOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onPointerDownOutside:",f.detail.originalEvent),n?.()))}function l(f){const m=nr(f.detail.originalEvent);Ye.isInBranch(m)||(t.onFocusOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onFocusOutside:",f.detail.originalEvent),n?.()))}function c(f){Ye.isTopMost(e)&&(t.onEscapeKeyDown?.(f),!f.defaultPrevented&&n&&(f.preventDefault(),n()))}function u(f){if(!e)return!1;const m=typeof o=="function"?o():o,g=Array.isArray(m)?m:[m],p=t.persistentElements?.map(y=>y()).filter(ft);return p&&g.push(...p),g.some(y=>Jr(y,f))||Ye.isInNestedLayer(e,f)}const d=[r?Ow(e,t.persistentElements):void 0,Pw(e,c),Ew(e,{exclude:u,onFocusOutside:l,onPointerDownOutside:a,defer:t.defer})];return()=>{Ye.remove(e),Uc(),Cw(e),d.forEach(f=>f?.())}}function kw(e,t){const{defer:n}=t,r=n?Ve:i=>i(),o=[];return o.push(r(()=>{const i=fb(e)?e():e;o.push(Dw(i,t))})),()=>{o.forEach(i=>i?.())}}const[Tw,fe]=$t({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),$w=e=>{const t=fe(),n=Oc(),r=ce(()=>t().getContentProps(),()=>n().presenceProps,e);return h(ie,{get when(){return!n().unmounted},get children(){return h(de.div,r)}})},Aw=e=>e.children(fe()),Mw=e=>{const t=fe(),n=ce(()=>t().getControlProps(),e);return h(de.div,n)},[Iw,Wt]=$t({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),Lw=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getNextTriggerProps(n),e);return h(de.button,r)},Rw=e=>{const t=fe(),n=Oc(),r=ce(()=>t().getPositionerProps(),e);return h(ie,{get when(){return!n().unmounted},get children(){return h(de.div,r)}})},Nw=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getPrevTriggerProps(n),e);return h(de.button,r)},Fw=e=>{const t=fe(),n=ce(()=>t().getRangeTextProps(),e);return h(de.div,I(n,{get children(){return t().visibleRangeText.start}}))};function Bi(e,t){return e-t*Math.floor(e/t)}const Wc=1721426;function so(e,t,n,r){t=ji(e,t);let o=t-1,i=-2;return n<=2?i=0:ao(t)&&(i=-1),Wc-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function ao(e){return e%4===0&&(e%100!==0||e%400===0)}function ji(e,t){return e==="BC"?1-t:t}function _w(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const Vw={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class kn{fromJulianDay(t){let n=t,r=n-Wc,o=Math.floor(r/146097),i=Bi(r,146097),s=Math.floor(i/36524),a=Bi(i,36524),l=Math.floor(a/1461),c=Bi(a,1461),u=Math.floor(c/365),d=o*400+s*100+l*4+u+(s!==4&&u!==4?1:0),[f,m]=_w(d),g=n-so(f,m,1,1),p=2;n<so(f,m,3,1)?p=0:ao(m)&&(p=1);let y=Math.floor(((g+p)*12+373)/367),v=n-so(f,m,y,1)+1;return new vt(f,m,y,v)}toJulianDay(t){return so(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return Vw[ao(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ao(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const Kw={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Tn(e,t){return t=Ge(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function zw(e,t){return e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Bw(e,t){return Tn(e,co(t))}function lo(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1-Ww(t))%7;return r<0&&(r+=7),r}function Hc(e){return mt(Date.now(),e)}function co(e){return An(Hc(e))}function Yc(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function jw(e,t){return Gc(e)-Gc(t)}function Gc(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ui=null;function Wi(){return Ui==null&&(Ui=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ui}function Lt(e){return e.subtract({days:e.day-1})}function Hi(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Yi(e){return Lt(e.subtract({months:e.month-1}))}function Uw(e){return Hi(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function uo(e,t){let n=lo(e,t);return e.subtract({days:n})}function qc(e,t){return uo(e,t).add({days:6})}const Zc=new Map;function Xc(e){if(Intl.Locale){let n=Zc.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Zc.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function Ww(e){let t=Xc(e);return t&&Kw[t]||0}function Hw(e,t){let n=e.calendar.getDaysInMonth(e);return Math.ceil((lo(Lt(e),t)+n)/7)}function Jc(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Qc(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const Yw={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function Gw(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Xc(t),[i,s]=Yw[o]||[6,0];return r===i||r===s}function $n(e){e=Ge(e,new kn);let t=ji(e.era,e.year);return eu(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function eu(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Gi(e,t){if(t==="UTC")return 0;if(e>0&&t===Wi())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=nu(e,t);return eu(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const tu=new Map;function nu(e,t){let n=tu.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),tu.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const ru=864e5;function qw(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>Zw(e,t,i))}function Zw(e,t,n){let r=nu(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function pt(e,t,n="compatible"){let r=Ht(e);if(t==="UTC")return $n(r);if(t===Wi()&&n==="compatible"){r=Ge(r,new kn);let l=new Date,c=ji(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let o=$n(r),i=Gi(o-ru,t),s=Gi(o+ru,t),a=qw(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function ou(e,t,n="compatible"){return new Date(pt(e,t,n))}function mt(e,t){let n=Gi(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new lr(o,i,s,t,n,a,l,c,u)}function An(e){return new vt(e.calendar,e.era,e.year,e.month,e.day)}function Ht(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new po(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function Ge(e,t){if(e.calendar.identifier===t.identifier)return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Yt(r),r}function Xw(e,t,n){if(e instanceof lr)return e.timeZone===t?e:Qw(e,t);let r=pt(e,t,n);return mt(r,t)}function Jw(e){let t=$n(e)-e.offset;return new Date(t)}function Qw(e,t){let n=$n(e)-e.offset;return Ge(mt(n,t),e.calendar)}const ar=36e5;function fo(e,t){let n=e.copy(),r="hour"in n?r0(n,t):0;qi(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Zi(n),iu(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,e0(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let l=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function qi(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function Zi(e){for(;e.month<1;)qi(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,qi(e,1)}function e0(e){for(;e.day<1;)e.month--,Zi(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Zi(e)}function iu(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Yt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),iu(e)}function su(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function au(e,t){return fo(e,su(t))}function Xi(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Yt(n),n}function go(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),n0(n),n}function t0(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=ho(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=ho(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=ho(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=ho(e.hour,24),t}function n0(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function ho(e,t){let n=e%t;return n<0&&(n+=t),n}function r0(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,t0(e)}function Ji(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),l=a.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=yt(l,n,0,a.length-1,r?.round),o.era=a[l],Yt(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=yt(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=yt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=yt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),Yt(o),o}function lu(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let l=i>=12;s=l?12:0,a=l?23:11}o.hour=yt(i,n,s,a,r?.round);break}case"minute":o.minute=yt(e.minute,n,0,59,r?.round);break;case"second":o.second=yt(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=yt(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function yt(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function cu(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=fo(Ht(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=pt(o,e.timeZone)}else n=$n(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=mt(n,e.timeZone);return Ge(r,e.calendar)}function o0(e,t){return cu(e,su(t))}function i0(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let g=e.hour>=12;o=g?12:0,i=g?23:11}let s=Ht(e),a=Ge(go(s,{hour:o}),new kn),l=[pt(a,e.timeZone,"earlier"),pt(a,e.timeZone,"later")].filter(g=>mt(g,e.timeZone).day===a.day)[0],c=Ge(go(s,{hour:i}),new kn),u=[pt(c,e.timeZone,"earlier"),pt(c,e.timeZone,"later")].filter(g=>mt(g,e.timeZone).day===c.day).pop(),d=$n(e)-e.offset,f=Math.floor(d/ar),m=d%ar;return d=yt(f,n,Math.floor(l/ar),Math.floor(u/ar),r?.round)*ar+m,Ge(mt(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return lu(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Ji(Ht(e),t,n,r),i=pt(o,e.timeZone);return Ge(mt(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function s0(e,t,n){let r=Ht(e),o=go(Xi(r,t),t);if(o.compare(r)===0)return e;let i=pt(o,e.timeZone,n);return Ge(mt(i,e.timeZone),e.calendar)}const a0=/^(\d{4})-(\d{2})-(\d{2})$/;function l0(e){let t=e.match(a0);if(!t)throw new Error("Invalid ISO 8601 date string: "+e);let n=new vt(Qi(t[1],0,9999),Qi(t[2],1,12),1);return n.day=Qi(t[3],0,n.calendar.getDaysInMonth(n)),n}function Qi(e,t,n){let r=Number(e);if(r<t||r>n)throw new RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function c0(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function uu(e){let t=Ge(e,new kn);return`${String(t.year).padStart(4,"0")}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function du(e){return`${uu(e)}T${c0(e)}`}function u0(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=e%36e5/6e4;return`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function d0(e){return`${du(e)}${u0(e.offset)}[${e.timeZone}]`}function es(e){let t=typeof e[0]=="object"?e.shift():new kn,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var f0=new WeakMap;class vt{copy(){return this.era?new vt(this.calendar,this.era,this.year,this.month,this.day):new vt(this.calendar,this.year,this.month,this.day)}add(t){return fo(this,t)}subtract(t){return au(this,t)}set(t){return Xi(this,t)}cycle(t,n,r){return Ji(this,t,n,r)}toDate(t){return ou(this,t)}toString(){return uu(this)}compare(t){return Yc(this,t)}constructor(...t){ni(this,f0,{writable:!0,value:void 0});let[n,r,o,i,s]=es(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,Yt(this)}}var g0=new WeakMap;class po{copy(){return this.era?new po(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new po(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return fo(this,t)}subtract(t){return au(this,t)}set(t){return Xi(go(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Ji(this,t,n,r);default:return lu(this,t,n,r)}}toDate(t,n){return ou(this,t,n)}toString(){return du(this)}compare(t){let n=Yc(this,t);return n===0?jw(this,Ht(t)):n}constructor(...t){ni(this,g0,{writable:!0,value:void 0});let[n,r,o,i,s]=es(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Yt(this)}}var h0=new WeakMap;class lr{copy(){return this.era?new lr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new lr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return cu(this,t)}subtract(t){return o0(this,t)}set(t,n){return s0(this,t,n)}cycle(t,n,r){return i0(this,t,n,r)}toDate(){return Jw(this)}toString(){return d0(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Xw(t,this.timeZone).toDate().getTime()}constructor(...t){ni(this,h0,{writable:!0,value:void 0});let[n,r,o,i,s]=es(t),a=t.shift(),l=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Yt(this)}}let ts=new Map;class Qe{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return y0()&&(this.resolvedHourCycle||(this.resolvedHourCycle=v0(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=fu(t,n),this.options=n}}const p0={true:{ja:"h11"},false:{}};function fu(e,t={}){if(typeof t.hour12=="boolean"&&m0()){t={...t};let o=p0[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(ts.has(n))return ts.get(n);let r=new Intl.DateTimeFormat(e,t);return ts.set(n,r),r}let ns=null;function m0(){return ns==null&&(ns=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),ns}let rs=null;function y0(){return rs==null&&(rs=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),rs}function v0(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=fu(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}function b0(e,t,n,r,o){const i={};for(let a in t){const l=a,c=t[l];c!=null&&(i[l]=Math.floor(c/2),i[l]>0&&c%2===0&&i[l]--)}const s=Gt(e,t,n).subtract(i);return cr(e,s,t,n,r,o)}function Gt(e,t,n,r,o){let i=e;return t.years?i=Yi(e):t.months?i=Lt(e):t.weeks&&(i=uo(e,n)),cr(e,i,t,n,r,o)}function os(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=Gt(e,t,n).subtract(i);return cr(e,s,t,n,r,o)}function cr(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=Qc(t,Gt(An(o),n,r))),i&&e.compare(i)<=0&&(t=Jc(t,os(An(i),n,r))),t}function bt(e,t,n){return t&&(e=Qc(e,An(t))),n&&(e=Jc(e,An(n))),e}function gu(e,t,n,r,o,i){switch(t){case"start":return Gt(e,n,r,o,i);case"end":return os(e,n,r,o,i);case"center":default:return b0(e,n,r,o,i)}}function w0(e,t){return Bw(e,t)}function qe(e,t){return t!=null&&Tn(e,t)}function Rt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function x0(e,t,n,r,o){return is(e,t,n)||Rt(e,r,o)}function hu(e,t,n,r,o){return e?t?.(e,n)?!0:Rt(e,r,o):!1}function is(e,t,n){return e.compare(t)<0||e.compare(n)>0}function S0(e,t,n){const r=e.subtract({days:1});return Tn(r,e)||Rt(r,t,n)}function E0(e,t,n){const r=e.add({days:1});return Tn(r,e)||Rt(r,t,n)}function ss(e){let t={...e};for(let n in t)t[n]=1;return t}function pu(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function P0(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let c=0;c<i.length;c++){let u=i[c];if(u.source==="shared"&&u.type==="literal")s=c;else if(u.source==="endRange")break}let a="",l="";for(let c=0;c<i.length;c++)c<s?a+=i[c].value:c>s&&(l+=i[c].value);return r(a,l)}function mu(e){return e?.calendar.identifier==="gregory"&&e.era==="BC"?"short":void 0}function yu(e,t){const n=Ht(co(t));return new Qe(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:mu(n),timeZone:t})}function C0(e,t,n,r){let o=e,i=t??e,s=yu(n,r);return Tn(o,i)?s.format(o.toDate(r)):P0(o,i,s,(a,l)=>`${a} – ${l}`,r)}function O0(e,t){const n=An(co(t));return new Qe(e,{month:"long",year:"numeric",era:mu(n),calendar:n?.calendar.identifier,timeZone:t})}function mo(e){const t=e-e%10-1,n=[];for(let r=0;r<12;r+=1){const o=t+r;n.push(o)}return n}function vu(e,t,n=0){const o=(lo(e,t)-n+7)%7;return e.subtract({days:o})}function bu(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=vu(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(Tn(s,a))break;s=a}return i}function D0(e,t,n){if(n==null)return Hw(e,t);const r=(lo(Lt(e),t)-n+7)%7;return Math.ceil((r+e.calendar.getDaysInMonth(e))/7)}function k0(e,t,n,r){const o=n??D0(e,t,r);return[...new Array(o).keys()].map(s=>bu(s,e,t,r))}function T0(e,t="long"){const n=new Date(2021,0,1),r=[];for(let o=0;o<12;o++)r.push(n.toLocaleString(e,{month:t})),n.setMonth(n.getMonth()+1);return r}function $0(e,t){const n=new Qe(e,{weekday:"long",timeZone:t}),r=new Qe(e,{weekday:"short",timeZone:t}),o=new Qe(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function A0(e,t,n,r){const o=vu(e,r,t),i=[...new Array(7).keys()],s=$0(r,n);return i.map(a=>s(o.add({days:a})))}function Mn(e){return co(e??Wi())}function M0(e){return e.add({days:1})}function I0(e){return e.subtract({days:1})}function L0(e,t){return e.set({month:t})}function R0(e,t){return e.set({year:t})}function ur(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,l=pu(s,e);return Rt(a,n,r)?{startDate:s,focusedDate:bt(a,n,r),endDate:l}:a.compare(s)<0?{startDate:os(a,e,t,n,r),focusedDate:bt(a,n,r),endDate:l}:a.compare(l)>0?{startDate:Gt(a,e,t,n,r),endDate:l,focusedDate:bt(a,n,r)}:{startDate:s,endDate:l,focusedDate:bt(a,n,r)}}}function wu(e,t,n,r,o,i){const s=ur(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:Gt(cr(e,a,n,r,o,i),n,r)})}function xu(e,t,n,r,o,i){const s=ur(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:Gt(cr(e,a,n,r,o,i),n,r)})}function N0(e,t,n,r,o,i,s){const a=ur(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(ss(r)),startDate:t});if(r.days)return wu(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function F0(e,t,n,r,o,i,s){const a=ur(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(ss(r)),startDate:t});if(r.days)return xu(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var _0=e=>e!=null&&e.length===4,V0=e=>e!=null&&parseFloat(e)<=12,K0=e=>e!=null&&parseFloat(e)<=31;function Su(e,t,n){const r=z0(t,n);let{year:o,month:i,day:s}=B0(r,e)??{};if(o!=null||i!=null||s!=null){const c=new Date;o||(o=c.getFullYear().toString()),i||(i=(c.getMonth()+1).toString()),s||(s=c.getDate().toString())}if(_0(o)&&V0(i)&&K0(s))return new vt(+o,+i,+s);const l=Date.parse(e);if(!isNaN(l)){const c=new Date(l);return new vt(c.getFullYear(),c.getMonth()+1,c.getDate())}}function z0(e,t){return new Qe(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function B0(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function Eu(e,t,n){const r=Hc(n);switch(e){case"thisWeek":return[uo(r,t),qc(r,t)];case"thisMonth":return[Lt(r),r];case"thisQuarter":return[Lt(r).add({months:-r.month%3}),r];case"thisYear":return[Yi(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[Lt(r.add({months:-1})),Hi(r.add({months:-1}))];case"lastQuarter":return[Lt(r.add({months:-r.month%3-3})),Hi(r.add({months:-r.month%3-1}))];case"lastWeek":return[uo(r,t).add({weeks:-1}),qc(r,t).add({weeks:-1})];case"lastYear":return[Yi(r.add({years:-1})),Uw(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var yo="__live-region__";function j0(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0}=e,i=n.defaultView??window,s=r??n.body;function a(c,u){n.getElementById(yo)?.remove(),u=u??o;const f=n.createElement("span");f.id=yo,f.dataset.liveAnnouncer="true";const m=t!=="assertive"?"status":"alert";f.setAttribute("aria-live",t),f.setAttribute("role",m),Object.assign(f.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),s.appendChild(f),i.setTimeout(()=>{f.textContent=c},u)}function l(){n.getElementById(yo)?.remove()}return{announce:a,destroy:l,toJSON(){return yo}}}var Pu=Zr("date-picker").parts("root","label","clearTrigger","content","control","input","monthSelect","nextTrigger","positioner","prevTrigger","rangeText","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","viewTrigger","viewControl","yearSelect","presetTrigger"),ne=Pu.build(),K=nb({getLabelId:(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,getRootId:e=>e.ids?.root??`datepicker:${e.id}`,getTableId:(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,getTableHeaderId:(e,t)=>e.ids?.tableHeader?.(t)??`datepicker:${e.id}:thead`,getTableBodyId:(e,t)=>e.ids?.tableBody?.(t)??`datepicker:${e.id}:tbody`,getTableRowId:(e,t)=>e.ids?.tableRow?.(t)??`datepicker:${e.id}:tr:${t}`,getContentId:e=>e.ids?.content??`datepicker:${e.id}:content`,getCellTriggerId:(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,getPrevTriggerId:(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,getNextTriggerId:(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,getViewTriggerId:(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,getClearTriggerId:e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,getControlId:e=>e.ids?.control??`datepicker:${e.id}:control`,getInputId:(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,getTriggerId:e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,getPositionerId:e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,getMonthSelectId:e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,getYearSelectId:e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,getFocusedCell:(e,t=e.view)=>tb(K.getContentEl(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),getTriggerEl:e=>K.getById(e,K.getTriggerId(e)),getContentEl:e=>K.getById(e,K.getContentId(e)),getInputEls:e=>eb(K.getControlEl(e),"[data-part=input]"),getYearSelectEl:e=>K.getById(e,K.getYearSelectId(e)),getMonthSelectEl:e=>K.getById(e,K.getMonthSelectId(e)),getClearTriggerEl:e=>K.getById(e,K.getClearTriggerId(e)),getPositionerEl:e=>K.getById(e,K.getPositionerId(e)),getControlEl:e=>K.getById(e,K.getControlId(e))});function as(e){const[t,n]=e;return!t||!n||t.compare(n)<=0?e:[n,t]}function Cu(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function ls(e){return e.sort((t,n)=>t.compare(n))}function U0(e){return rr(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var W0={day:"dd",month:"mm",year:"yyyy"};function H0(e){return new Qe(e).formatToParts(new Date).map(t=>W0[t.type]??t.value).join("")}var Ou=(e,t)=>e?/\d/.test(e)||e===t||e.length!==1:!0,Y0=(e,t)=>e.split("").filter(n=>Ou(n,t)).join("");function G0(e){const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return r?r.value:"/"}var q0={dayCell(e){return e.unavailable?`Not available. ${e.formattedDate}`:e.selected?`Selected date. ${e.formattedDate}`:`Choose ${e.formattedDate}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return rr(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){return Array.isArray(e)?`select ${e[0].toString()} to ${e[1].toString()}`:`select ${e}`},prevTrigger(e){return rr(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return rr(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates"},Du=e=>e.toString().split("T")[0];function Z0(e,t,n){const r=e.context.startValue,o=e.context.endValue,i=e.context.value,s=e.context.focusedValue,a=e.context.hoveredValue,l=a?as([i[0],a]):[],c=e.context.disabled,u=e.context.readOnly,d=e.context.isInteractive,f=e.context.min,m=e.context.max,g=e.context.locale,p=e.context.timeZone,y=e.context.startOfWeek,v=e.matches("focused"),b=e.matches("open"),w=e.context.selectionMode==="range",x=e.context.isDateUnavailable,T=e.context.currentPlacement,O=yw({...e.context.positioning,placement:T}),k=G0(g);function j(E=r){const S=e.context.fixedWeeks?6:void 0;return k0(E,g,S,y)}function P(E={}){const{format:S}=E;return T0(g,S).map((C,W)=>({label:C,value:W+1}))}function M(){return mo(s.year).map(E=>({label:E.toString(),value:E}))}function $(E){return hu(E,x,g,f,m)}function R(E){const S=L0(r??Mn(p),E);t({type:"FOCUS.SET",value:S})}function se(E){const S=R0(r??Mn(p),E);t({type:"FOCUS.SET",value:S})}function J(E){const{value:S,disabled:C}=E,W=s.set({year:S}),be={focused:s.year===E.value,selectable:!Rt(W,f,m),selected:!!i.find(wt=>wt.year===S),valueText:S.toString(),get disabled(){return C||!be.selectable}};return be}function re(E){const{value:S,disabled:C}=E,W=s.set({month:S}),be=O0(g,p),wt={focused:s.month===E.value,selectable:!Rt(W,f,m),selected:!!i.find(G=>G.month===S&&G.year===s.year),valueText:be.format(W.toDate(p)),get disabled(){return C||!wt.selectable}};return wt}const N=e.context.translations||q0;function X(E){const{value:S,disabled:C,visibleRange:W=e.context.visibleRange}=E,be=yu(g,p),wt=ss(e.context.visibleDuration),G=W.start.add(wt).subtract({days:1}),Ee={invalid:Rt(S,f,m),disabled:C||x0(S,W.start,G,f,m),selected:i.some(dr=>qe(S,dr)),unavailable:hu(S,x,g,f,m)&&!C,outsideRange:is(S,W.start,G),inRange:w&&(Cu(S,i)||Cu(S,l)),firstInRange:w&&qe(S,i[0]),lastInRange:w&&qe(S,i[1]),today:w0(S,p),weekend:Gw(S,g),formattedDate:be.format(S.toDate(p)),get focused(){return qe(S,s)&&!Ee.outsideRange},get ariaLabel(){return N.dayCell(Ee)},get selectable(){return!Ee.disabled&&!Ee.unavailable}};return Ee}function ge(E){const{view:S="day",id:C}=E;return[S,C].filter(Boolean).join(" ")}return{focused:v,open:b,view:e.context.view,getRangePresetValue(E){return Eu(E,g,p)},getDaysInWeek(E,S=r){return bu(E,S,g,y)},getOffset(E){const S=r.add(E);return{visibleRange:{start:S,end:o.add(E)},weeks:j(S)}},getMonthWeeks:j,isUnavailable:$,weeks:j(),weekDays:A0(Mn(p),y,p,g),visibleRangeText:e.context.visibleRangeText,value:i,valueAsDate:i.map(E=>E.toDate(p)),valueAsString:i.map(Du),focusedValue:s,focusedValueAsDate:s?.toDate(p),focusedValueAsString:Du(s),visibleRange:e.context.visibleRange,selectToday(){const E=bt(Mn(p),f,m);t({type:"VALUE.SET",value:E})},setValue(E){const S=E.map(C=>bt(C,f,m));t({type:"VALUE.SET",value:S})},clearValue(){t("VALUE.CLEAR")},setFocusedValue(E){t({type:"FOCUS.SET",value:E})},setOpen(E){E!==b&&t(E?"OPEN":"CLOSE")},focusMonth:R,focusYear:se,getYears:M,getMonths:P,getYearsGrid(E={}){const{columns:S=1}=E;return bc(M(),S)},getDecade(){const E=mo(s.year);return{start:E.at(0),end:E.at(-1)}},getMonthsGrid(E={}){const{columns:S=1,format:C}=E;return bc(P({format:C}),S)},format(E,S={month:"long",year:"numeric"}){return new Qe(g,S).format(E.toDate(p))},setView(E){t({type:"VIEW.SET",cell:E})},goToNext(){t({type:"GOTO.NEXT",view:e.context.view})},goToPrev(){t({type:"GOTO.PREV",view:e.context.view})},getRootProps(){return n.element({...ne.root.attrs,dir:e.context.dir,id:K.getRootId(e.context),"data-state":b?"open":"closed","data-disabled":te(c),"data-readonly":te(u)})},getLabelProps(E={}){const{index:S=0}=E;return n.label({...ne.label.attrs,id:K.getLabelId(e.context,S),dir:e.context.dir,htmlFor:K.getInputId(e.context,S),"data-state":b?"open":"closed","data-index":S,"data-disabled":te(c),"data-readonly":te(u)})},getControlProps(){return n.element({...ne.control.attrs,dir:e.context.dir,id:K.getControlId(e.context),"data-disabled":te(c)})},getRangeTextProps(){return n.element({...ne.rangeText.attrs,dir:e.context.dir})},getContentProps(){return n.element({...ne.content.attrs,hidden:!b,dir:e.context.dir,"data-state":b?"open":"closed","data-placement":T,id:K.getContentId(e.context),role:"application","aria-roledescription":"datepicker","aria-label":N.content})},getTableProps(E={}){const{view:S="day",columns:C=S==="day"?7:4}=E,W=ge(E);return n.element({...ne.table.attrs,role:"grid","data-columns":C,"aria-roledescription":U0(S),id:K.getTableId(e.context,W),"aria-readonly":Se(u),"aria-disabled":Se(c),"aria-multiselectable":Se(e.context.selectionMode!=="single"),"data-view":S,dir:e.context.dir,tabIndex:-1,onKeyDown(be){if(be.defaultPrevented)return;const G={Enter(){$(s)||t({type:"TABLE.ENTER",view:S,columns:C,focus:!0})},ArrowLeft(){t({type:"TABLE.ARROW_LEFT",view:S,columns:C,focus:!0})},ArrowRight(){t({type:"TABLE.ARROW_RIGHT",view:S,columns:C,focus:!0})},ArrowUp(){t({type:"TABLE.ARROW_UP",view:S,columns:C,focus:!0})},ArrowDown(){t({type:"TABLE.ARROW_DOWN",view:S,columns:C,focus:!0})},PageUp(Ee){t({type:"TABLE.PAGE_UP",larger:Ee.shiftKey,view:S,columns:C,focus:!0})},PageDown(Ee){t({type:"TABLE.PAGE_DOWN",larger:Ee.shiftKey,view:S,columns:C,focus:!0})},Home(){t({type:"TABLE.HOME",view:S,columns:C,focus:!0})},End(){t({type:"TABLE.END",view:S,columns:C,focus:!0})}}[Sb(be,e.context)];G&&(G(be),be.preventDefault(),be.stopPropagation())},onPointerLeave(){t({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){t({type:"TABLE.POINTER_DOWN",view:S})},onPointerUp(){t({type:"TABLE.POINTER_UP",view:S})}})},getTableHeadProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableHead.attrs,"aria-hidden":!0,dir:e.context.dir,"data-view":S,"data-disabled":te(c)})},getTableHeaderProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableHeader.attrs,dir:e.context.dir,"data-view":S,"data-disabled":te(c)})},getTableBodyProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableBody.attrs,"data-view":S,"data-disabled":te(c)})},getTableRowProps(E={}){const{view:S="day"}=E;return n.element({...ne.tableRow.attrs,"aria-disabled":Se(c),"data-disabled":te(c),"data-view":S})},getDayTableCellState:X,getDayTableCellProps(E){const{value:S}=E,C=X(E);return n.element({...ne.tableCell.attrs,role:"gridcell","aria-disabled":Se(!C.selectable),"aria-selected":C.selected||C.inRange,"aria-invalid":Se(C.invalid),"aria-current":C.today?"date":void 0,"data-value":S.toString()})},getDayTableCellTriggerProps(E){const{value:S}=E,C=X(E);return n.element({...ne.tableCellTrigger.attrs,id:K.getCellTriggerId(e.context,S.toString()),role:"button",dir:e.context.dir,tabIndex:C.focused?0:-1,"aria-label":C.ariaLabel,"aria-disabled":Se(!C.selectable),"aria-invalid":Se(C.invalid),"data-disabled":te(!C.selectable),"data-selected":te(C.selected),"data-value":S.toString(),"data-view":"day","data-today":te(C.today),"data-focus":te(C.focused),"data-unavailable":te(C.unavailable),"data-range-start":te(C.firstInRange),"data-range-end":te(C.lastInRange),"data-in-range":te(C.inRange),"data-outside-range":te(C.outsideRange),"data-weekend":te(C.weekend),onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"day",value:S})},onPointerMove(W){if(W.pointerType==="touch"||!C.selectable)return;const be=W.currentTarget.ownerDocument.activeElement!==W.currentTarget;a&&zw(S,a)||t({type:"CELL.POINTER_MOVE",cell:"day",value:S,focus:be})}})},getMonthTableCellState:re,getMonthTableCellProps(E){const{value:S,columns:C}=E,W=re(E);return n.element({...ne.tableCell.attrs,dir:e.context.dir,colSpan:C,role:"gridcell","aria-selected":Se(W.selected),"data-selected":te(W.selected),"aria-disabled":Se(!W.selectable),"data-value":S})},getMonthTableCellTriggerProps(E){const{value:S}=E,C=re(E);return n.element({...ne.tableCellTrigger.attrs,dir:e.context.dir,role:"button",id:K.getCellTriggerId(e.context,S.toString()),"data-selected":te(C.selected),"aria-disabled":Se(!C.selectable),"data-disabled":te(!C.selectable),"data-focus":te(C.focused),"aria-label":C.valueText,"data-view":"month","data-value":S,tabIndex:C.focused?0:-1,onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"month",value:S})}})},getYearTableCellState:J,getYearTableCellProps(E){const{value:S,columns:C}=E,W=J(E);return n.element({...ne.tableCell.attrs,dir:e.context.dir,colSpan:C,role:"gridcell","aria-selected":Se(W.selected),"data-selected":te(W.selected),"aria-disabled":Se(!W.selectable),"data-value":S})},getYearTableCellTriggerProps(E){const{value:S}=E,C=J(E);return n.element({...ne.tableCellTrigger.attrs,dir:e.context.dir,role:"button",id:K.getCellTriggerId(e.context,S.toString()),"data-selected":te(C.selected),"data-focus":te(C.focused),"aria-disabled":Se(!C.selectable),"data-disabled":te(!C.selectable),"aria-label":C.valueText,"data-value":S,"data-view":"year",tabIndex:C.focused?0:-1,onClick(W){W.defaultPrevented||C.selectable&&t({type:"CELL.CLICK",cell:"year",value:S})}})},getNextTriggerProps(E={}){const{view:S="day"}=E,C=c||!e.context.isNextVisibleRangeValid;return n.button({...ne.nextTrigger.attrs,dir:e.context.dir,id:K.getNextTriggerId(e.context,S),type:"button","aria-label":N.nextTrigger(S),disabled:C,"data-disabled":te(C),onClick(W){W.defaultPrevented||t({type:"GOTO.NEXT",view:S})}})},getPrevTriggerProps(E={}){const{view:S="day"}=E,C=c||!e.context.isPrevVisibleRangeValid;return n.button({...ne.prevTrigger.attrs,dir:e.context.dir,id:K.getPrevTriggerId(e.context,S),type:"button","aria-label":N.prevTrigger(S),disabled:C,"data-disabled":te(C),onClick(W){W.defaultPrevented||t({type:"GOTO.PREV",view:S})}})},getClearTriggerProps(){return n.button({...ne.clearTrigger.attrs,id:K.getClearTriggerId(e.context),dir:e.context.dir,type:"button","aria-label":N.clearTrigger,hidden:!e.context.value.length,onClick(E){E.defaultPrevented||t("VALUE.CLEAR")}})},getTriggerProps(){return n.button({...ne.trigger.attrs,id:K.getTriggerId(e.context),dir:e.context.dir,type:"button","data-placement":T,"aria-label":N.trigger(b),"aria-controls":K.getContentId(e.context),"data-state":b?"open":"closed","aria-haspopup":"grid",disabled:c,onClick(E){E.defaultPrevented||d&&t("TRIGGER.CLICK")}})},getViewTriggerProps(E={}){const{view:S="day"}=E;return n.button({...ne.viewTrigger.attrs,"data-view":S,dir:e.context.dir,id:K.getViewTriggerId(e.context,S),type:"button",disabled:c,"aria-label":N.viewTrigger(S),onClick(C){C.defaultPrevented||d&&t("VIEW.CHANGE")}})},getViewControlProps(E={}){const{view:S="day"}=E;return n.element({...ne.viewControl.attrs,"data-view":S,dir:e.context.dir})},getInputProps(E={}){const{index:S=0}=E;return n.input({...ne.input.attrs,id:K.getInputId(e.context,S),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:e.context.dir,name:e.context.name,"data-index":S,"data-state":b?"open":"closed",readOnly:u,disabled:c,placeholder:H0(g),defaultValue:e.context.formattedValue[S],onBeforeInput(C){const{data:W}=Eb(C);Ou(W,k)||C.preventDefault()},onFocus(){t({type:"INPUT.FOCUS",index:S})},onBlur(C){t({type:"INPUT.BLUR",value:C.currentTarget.value,index:S})},onKeyDown(C){C.defaultPrevented||d&&(qv(C)||C.key==="Enter"&&($(e.context.focusedValue)||(t({type:"INPUT.ENTER",value:C.currentTarget.value,index:S}),C.preventDefault())))},onChange(C){const{value:W}=C.target;t({type:"INPUT.CHANGE",value:Y0(W,k),index:S})}})},getMonthSelectProps(){return n.select({...ne.monthSelect.attrs,id:K.getMonthSelectId(e.context),"aria-label":N.monthSelect,disabled:c,dir:e.context.dir,defaultValue:r.month,onChange(E){R(Number(E.currentTarget.value))}})},getYearSelectProps(){return n.select({...ne.yearSelect.attrs,id:K.getYearSelectId(e.context),disabled:c,"aria-label":N.yearSelect,dir:e.context.dir,defaultValue:r.year,onChange(E){se(Number(E.currentTarget.value))}})},getPositionerProps(){return n.element({id:K.getPositionerId(e.context),...ne.positioner.attrs,dir:e.context.dir,style:O.floating})},getPresetTriggerProps(E){const S=Array.isArray(E.value)?E.value:Eu(E.value,g,p),C=S.map(W=>W.toDate(p).toDateString());return n.button({...ne.presetTrigger.attrs,"aria-label":N.presetTrigger(C),type:"button",onClick(W){W.defaultPrevented||t({type:"PRESET.CLICK",value:S})}})}}}var{and:Ke}=gv,X0=e=>{const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1,i=ls(e.value||[]).map(l=>bt(l,e.min,e.max));let s=i[0]||e.focusedValue||Mn(n);s=bt(s,e.min,e.max);const a=gu(s,"start",{months:o},t);return{locale:t,numOfMonths:o,focusedValue:s,startValue:a,timeZone:n,value:i,selectionMode:r,view:"day",activeIndex:0,hoveredValue:null,closeOnSelect:!0,disabled:!1,readOnly:!1,...e,positioning:{placement:"bottom",...e.positioning}}};function J0(e){const t=Li(e);return uc({id:"datepicker",initial:t.open?"open":"idle",context:X0(t),computed:{valueAsString:n=>n.value.map(r=>C0(r,null,n.locale,n.timeZone)),isInteractive:n=>!n.disabled&&!n.readOnly,visibleDuration:n=>({months:n.numOfMonths}),endValue:n=>pu(n.startValue,n.visibleDuration),visibleRange:n=>({start:n.startValue,end:n.endValue}),visibleRangeText(n){const r=new Qe(n.locale,{month:"long",year:"numeric",timeZone:n.timeZone}),o=r.format(n.startValue.toDate(n.timeZone)),i=r.format(n.endValue.toDate(n.timeZone)),s=n.selectionMode==="range"?`${o} - ${i}`:o;return{start:o,end:i,formatted:s}},isPrevVisibleRangeValid:n=>!S0(n.startValue,n.min,n.max),isNextVisibleRangeValid:n=>!E0(n.endValue,n.min,n.max),formattedValue(n){const r={timeZone:n.timeZone,day:"2-digit",month:"2-digit",year:"numeric"},o=new Qe(n.locale,r);return n.value.map(i=>n.format?.(i)??o.format(i.toDate(n.timeZone)))}},activities:["setupLiveRegion"],created:["setStartValue"],watch:{locale:["setStartValue"],focusedValue:["setStartValue","syncMonthSelectElement","syncYearSelectElement","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"],value:["syncInputElement"],valueAsString:["announceValueText"],view:["focusActiveCell"],open:["toggleVisibility"]},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","focusFirstInputElement"]},"INPUT.CHANGE":{actions:["focusParsedDate"]},"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":{actions:["setActiveIndexToStart","selectParsedDate"]},"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:"closed",on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:"closed",on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:"open",activities:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:Ke("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isMonthView",actions:["setFocusedMonth","setViewToDay"]},{guard:"isYearView",actions:["setFocusedYear","setViewToMonth"]},{guard:Ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","invokeOnClose","setRestoreFocus"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","invokeOnClose","focusInputElement"]},{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:"isMultiPicker",actions:["setFocusedDate","toggleSelectedDate"]},{guard:Ke("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]},"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isMonthView",actions:"setViewToDay"},{guard:"isYearView",actions:"setViewToMonth"},{guard:Ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","invokeOnClose"]},{guard:Ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","invokeOnClose","focusInputElement"]},{guard:Ke("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:"isMultiPicker",actions:["toggleSelectedDate"]},{guard:Ke("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:"focusNextMonth"},{guard:"isYearView",actions:"focusNextYear"},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:"focusPreviousMonth"},{guard:"isYearView",actions:"focusPreviousYear"},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:"focusPreviousMonthColumn"},{guard:"isYearView",actions:"focusPreviousYearColumn"},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:"focusNextMonthColumn"},{guard:"isYearView",actions:"focusNextYearColumn"},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.CHANGE":[{guard:"isDayView",actions:["setViewToMonth"]},{guard:"isMonthView",actions:["setViewToYear"]}],INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}}},{guards:{isDayView:(n,r)=>(r.view||n.view)==="day",isMonthView:(n,r)=>(r.view||n.view)==="month",isYearView:(n,r)=>(r.view||n.view)==="year",isRangePicker:n=>n.selectionMode==="range",hasSelectedRange:n=>n.value.length===2,isMultiPicker:n=>n.selectionMode==="multiple",shouldRestoreFocus:n=>!!n.restoreFocus,isSelectingEndDate:n=>n.activeIndex===1,closeOnSelect:n=>!!n.closeOnSelect,isOpenControlled:n=>!!n["open.controlled"],isInteractOutsideEvent:(n,r)=>r.previousEvent?.type==="INTERACT_OUTSIDE"},activities:{trackPositioning(n){n.currentPlacement=n.positioning.placement;const r=K.getControlEl(n);return pw(r,()=>K.getPositionerEl(n),{...n.positioning,defer:!0,onComplete(i){n.currentPlacement=i.placement}})},setupLiveRegion(n){const r=K.getDoc(n);return n.announcer=j0({level:"assertive",document:r}),()=>n.announcer?.destroy?.()},trackDismissableElement(n,r,{send:o}){return kw(()=>K.getContentEl(n),{defer:!0,exclude:[...K.getInputEls(n),K.getTriggerEl(n),K.getClearTriggerEl(n)],onInteractOutside(s){n.restoreFocus=!s.detail.focusable},onDismiss(){o({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(s){s.preventDefault(),o({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setViewToDay(n){H.view(n,"day")},setViewToMonth(n){H.view(n,"month")},setViewToYear(n){H.view(n,"year")},setView(n,r){H.view(n,r.cell)},setRestoreFocus(n){n.restoreFocus=!0},announceValueText(n){n.announcer?.announce(n.valueAsString.join(","),3e3)},announceVisibleRange(n){const{formatted:r}=n.visibleRangeText;n.announcer?.announce(r)},disableTextSelection(n){bb({target:K.getContentEl(n),doc:K.getDoc(n)})},enableTextSelection(n){Sc({doc:K.getDoc(n),target:K.getContentEl(n)})},focusFirstSelectedDate(n){n.value.length&&H.focusedValue(n,n.value[0])},syncInputElement(n){Ve(()=>{K.getInputEls(n).forEach((o,i)=>{K.setValue(o,n.formattedValue[i]||"")})})},setFocusedDate(n,r){const o=Array.isArray(r.value)?r.value[0]:r.value;H.focusedValue(n,o)},setFocusedMonth(n,r){H.focusedValue(n,n.focusedValue.set({month:r.value}))},focusNextMonth(n){H.focusedValue(n,n.focusedValue.add({months:1}))},focusPreviousMonth(n){H.focusedValue(n,n.focusedValue.subtract({months:1}))},setFocusedYear(n,r){H.focusedValue(n,n.focusedValue.set({year:r.value}))},setDateValue(n,r){if(!Array.isArray(r.value))return;const o=r.value.map(i=>bt(i,n.min,n.max));H.value(n,o)},clearDateValue(n){H.value(n,[])},setSelectedDate(n,r){const o=Array.from(n.value);o[n.activeIndex]=r.value??n.focusedValue,H.value(n,as(o))},toggleSelectedDate(n,r){const o=r.value??n.focusedValue,i=n.value.findIndex(s=>qe(s,o));if(i===-1){const s=[...n.value,o];H.value(n,ls(s))}else{const s=Array.from(n.value);s.splice(i,1),H.value(n,ls(s))}},setHoveredDate(n,r){n.hoveredValue=r.value},clearHoveredDate(n){n.hoveredValue=null},selectFocusedDate(n){const r=Array.from(n.value);r[n.activeIndex]=n.focusedValue.copy(),H.value(n,as(r))},setPreviousDate(n){H.focusedValue(n,I0(n.focusedValue))},setNextDate(n){H.focusedValue(n,M0(n.focusedValue))},focusPreviousDay(n){H.focusedValue(n,n.focusedValue.subtract({days:1}))},focusNextDay(n){H.focusedValue(n,n.focusedValue.add({days:1}))},focusPreviousWeek(n){H.focusedValue(n,n.focusedValue.subtract({weeks:1}))},focusNextWeek(n){H.focusedValue(n,n.focusedValue.add({weeks:1}))},focusNextPage(n){const r=wu(n.focusedValue,n.startValue,n.visibleDuration,n.locale,n.min,n.max);H.adjustedValue(n,r)},focusPreviousPage(n){const r=xu(n.focusedValue,n.startValue,n.visibleDuration,n.locale,n.min,n.max);H.adjustedValue(n,r)},focusSectionStart(n){H.focusedValue(n,n.startValue.copy())},focusSectionEnd(n){H.focusedValue(n,n.endValue.copy())},focusNextSection(n,r){const o=N0(n.focusedValue,n.startValue,r.larger,n.visibleDuration,n.locale,n.min,n.max);o&&H.adjustedValue(n,o)},focusPreviousSection(n,r){const o=F0(n.focusedValue,n.startValue,r.larger,n.visibleDuration,n.locale,n.min,n.max);o&&H.adjustedValue(n,o)},focusNextYear(n){H.focusedValue(n,n.focusedValue.add({years:1}))},focusPreviousYear(n){H.focusedValue(n,n.focusedValue.subtract({years:1}))},focusNextDecade(n){H.focusedValue(n,n.focusedValue.add({years:10}))},focusPreviousDecade(n){H.focusedValue(n,n.focusedValue.subtract({years:10}))},clearFocusedDate(n){H.focusedValue(n,Mn(n.timeZone))},focusPreviousMonthColumn(n,r){H.focusedValue(n,n.focusedValue.subtract({months:r.columns}))},focusNextMonthColumn(n,r){H.focusedValue(n,n.focusedValue.add({months:r.columns}))},focusPreviousYearColumn(n,r){H.focusedValue(n,n.focusedValue.subtract({years:r.columns}))},focusNextYearColumn(n,r){H.focusedValue(n,n.focusedValue.add({years:r.columns}))},focusFirstMonth(n){H.focusedValue(n,n.focusedValue.set({month:0}))},focusLastMonth(n){H.focusedValue(n,n.focusedValue.set({month:12}))},focusFirstYear(n){const r=mo(n.focusedValue.year);H.focusedValue(n,n.focusedValue.set({year:r.at(0)}))},focusLastYear(n){const r=mo(n.focusedValue.year);H.focusedValue(n,n.focusedValue.set({year:r.at(-1)}))},setActiveIndex(n,r){n.activeIndex=r.index},setActiveIndexToEnd(n){n.activeIndex=1},setActiveIndexToStart(n){n.activeIndex=0},focusActiveCell(n){Ve(()=>{K.getFocusedCell(n)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded(n,r){r.focus&&Ve(()=>{K.getFocusedCell(n)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard(n,r){!r.type.startsWith("TABLE.ARROW")||n.selectionMode!=="range"||n.activeIndex===0||(n.hoveredValue=n.focusedValue.copy())},focusTriggerElement(n){Ve(()=>{K.getTriggerEl(n)?.focus({preventScroll:!0})})},focusFirstInputElement(n){Ve(()=>{K.getInputEls(n)[0]?.focus({preventScroll:!0})})},focusInputElement(n){Ve(()=>{const r=K.getInputEls(n),o=r.findLastIndex(a=>a.value!==""),i=Math.max(o,0),s=r[i];s?.focus({preventScroll:!0}),s?.setSelectionRange(s.value.length,s.value.length)})},syncMonthSelectElement(n){const r=K.getMonthSelectEl(n);r&&(r.value=n.startValue.month.toString())},syncYearSelectElement(n){const r=K.getYearSelectEl(n);r&&(r.value=n.startValue.year.toString())},focusParsedDate(n,r){if(r.index==null)return;const o=Su(r.value,n.locale,n.timeZone);o&&H.focusedValue(n,o)},selectParsedDate(n,r){if(r.index==null)return;const o=Su(r.value,n.locale,n.timeZone);if(!o)return;const i=Array.from(n.value);i[r.index]=o,H.value(n,i)},resetView(n,r,{initialContext:o}){H.view(n,o.view)},setStartValue(n){if(!is(n.focusedValue,n.startValue,n.endValue))return;const o=gu(n.focusedValue,"start",{months:n.numOfMonths},n.locale);n.startValue=o},invokeOnOpen(n){n.onOpenChange?.({open:!0})},invokeOnClose(n){n.onOpenChange?.({open:!1})},toggleVisibility(n,r,{send:o}){o({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}},compareFns:{startValue:qe,endValue:qe,focusedValue:qe,value:ku}})}var vo={change(e){const t=Array.from(e.value),n=t.map(r=>r.toString());e.onValueChange?.({value:t,valueAsString:n,view:e.view})},focusChange(e){const t=Array.from(e.value),n=t.map(r=>r.toString());e.onFocusChange?.({focusedValue:e.focusedValue,value:t,valueAsString:n,view:e.view})},viewChange(e){e.onViewChange?.({view:e.view})}},ku=(e,t)=>e.length!==t.length?!1:e.every((n,r)=>qe(n,t[r])),H={value(e,t){ku(e.value,t)||(e.value=t,vo.change(e))},focusedValue(e,t){if(!t||qe(e.focusedValue,t))return;const r=ur(e.visibleDuration,e.locale,e.min,e.max)({focusedDate:t,startDate:e.startValue});e.startValue=r.startDate,e.focusedValue=r.focusedDate,vo.focusChange(e)},adjustedValue(e,t){e.startValue=t.startDate,!qe(e.focusedValue,t.focusedDate)&&(e.focusedValue=t.focusedDate,vo.focusChange(e))},view(e,t){Ii(e.view,t)||(e.view=t,vo.viewChange(e))}};function In(e){return Array.isArray(e)?e.map(t=>In(t)):e instanceof Date?new vt(e.getFullYear(),e.getMonth()+1,e.getDate()):l0(e)}jt()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","getRootNode","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","open.controlled","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),jt()(["index"]),jt()(["value"]),jt()(["columns","id","view"]),jt()(["disabled","value","columns"]),jt()(["view"]);const Q0=e=>{const t=yb(),n=mb(),r=Le(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,"open.controlled":e.open!==void 0,open:e.defaultOpen,...e,focusedValue:e.focusedValue?In(e.focusedValue):void 0,value:e.value?In(e.value):e.defaultValue?In(e.defaultValue):void 0,max:e.max?In(e.max):void 0,min:e.min?In(e.min):void 0})),[i,s]=hc(J0(o()),{context:o});return A(()=>Z0(i,s,kv))},ex=e=>{const[t,n]=Pb(e),[r,o]=xn()(n,["closeOnSelect","defaultOpen","defaultValue","disabled","fixedWeeks","focusedValue","format","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),i=Q0(r),s=Db(ce(t,()=>({present:i().open}))),a=ce(()=>i().getRootProps(),o);return h(Tw,{value:i,get children(){return h(kb,{value:s,get children(){return h(de.div,a)}})}})},[tx,bo]=$t({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),nx=e=>{const[{columns:t},n]=xn()(e,["columns"]),r=fe(),o=Wt(),i={columns:t,id:Le(),...o},s=ce(()=>r().getTableProps(i),n);return h(tx,{value:i,get children(){return h(de.table,s)}})},rx=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableBodyProps(n),e);return h(de.tbody,r)},[ox,ix]=$t({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),sx=e=>{const[t,n]=xn()(e,["disabled","value","visibleRange","columns"]),r=fe(),o=Wt(),i=A(()=>{const l={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return l(t)}),s=ce(i,n);return h(ox,{value:t,get children(){return h(de.td,s)}})},ax=e=>{const t=fe(),n=ix(),r=Wt(),o=A(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=ce(o,e);return h(de.div,i)},lx=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableHeadProps(n),e);return h(de.thead,r)},cx=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableHeaderProps(n),e);return h(de.th,r)},ux=e=>{const t=fe(),n=bo(),r=ce(()=>t().getTableRowProps(n),e);return h(de.tr,r)},dx=e=>{const t=fe(),n=ce(()=>t().getTriggerProps(),e);return h(de.button,n)},fx=Pu.extendWith("view"),gx=e=>{const[t,n]=xn()(e,["view"]),r=fe(),o=ce(()=>fx.build().view.attrs,n);return h(Iw,{value:t,get children(){return h(de.div,I(o,{get hidden(){return r().view!==t.view}}))}})},hx=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getViewControlProps(n),e);return h(de.div,r)},px=e=>{const t=fe(),n=Wt(),r=ce(()=>t().getViewTriggerProps(n),e);return h(de.button,r)};var mx=B('<svg xmlns=http://www.w3.org/2000/svg class="h-4 w-4"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m15 6l-6 6l6 6"></path><title>Previous'),yx=B('<svg xmlns=http://www.w3.org/2000/svg class="h-4 w-4"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m9 6l6 6l-6 6"></path><title>Next'),vx=B('<svg xmlns=http://www.w3.org/2000/svg class="mx-1 h-5 w-5"viewBox="0 0 24 24"><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm12-4v4M8 3v4m-4 4h16m-9 4h1m0 0v3"></path><title>Calendar');const bx=lx,cs=rx,us=Aw,wx=e=>h(ex,I({format:t=>{const n=new Date(Date.parse(t.toString())),r=new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return new Intl.DateTimeFormat(e.locale||"pt-BR",{dateStyle:"long"}).format(r)}},e)),ds=e=>{const[t,n]=U(e,["class"]);return h(gx,I({get class(){return le("space-y-4",t.class)}},n))},fs=e=>{const[t,n]=U(e,["class","children"]);return h(hx,I({get class(){return le("flex items-center justify-between",t.class)}},n,{get children(){return[h(Nw,{get class(){return le(jn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100")},get children(){return mx()}}),A(()=>t.children),h(Lw,{get class(){return le(jn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100")},get children(){return yx()}})]}}))},gs=e=>{const[t,n]=U(e,["class"]);return h(Fw,I({get class(){return le("text-sm font-medium",t.class)}},n))},hs=e=>{const[t,n]=U(e,["class"]);return h(nx,I({get class(){return le("w-full border-collapse space-y-1",t.class)}},n))},wo=e=>{const[t,n]=U(e,["class"]);return h(ux,I({get class(){return le("mt-2 flex w-full",t.class)}},n))},xx=e=>{const[t,n]=U(e,["class"]);return h(cx,I({get class(){return le("w-8 flex-1 text-[0.8rem] font-normal text-muted-foreground",t.class)}},n))},ps=e=>{const[t,n]=U(e,["class"]);return h(sx,I({get class(){return le("flex-1 p-0 text-center text-sm","has-[[data-in-range]]:bg-accent has-[[data-in-range]]:first-of-type:rounded-l-md has-[[data-in-range]]:last-of-type:rounded-r-md","has-[[data-range-end]]:rounded-r-md has-[[data-range-start]]:rounded-l-md","has-[[data-outside-range][data-in-range]]:bg-accent/50",t.class)}},n))},ms=e=>{const[t,n]=U(e,["class"]);return h(ax,I({get class(){return le(jn({variant:"ghost"}),"size-8 w-full p-0 font-normal data-[selected]:opacity-100","data-[today]:bg-accent data-[today]:text-accent-foreground","[&:is([data-today][data-selected])]:bg-primary [&:is([data-today][data-selected])]:text-primary-foreground","data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground","data-[disabled]:text-muted-foreground data-[disabled]:opacity-50","data-[outside-range]:text-muted-foreground data-[outside-range]:opacity-50","[&:is([data-outside-range][data-in-range])]:bg-accent/50 [&:is([data-outside-range][data-in-range])]:text-muted-foreground [&:is([data-outside-range][data-in-range])]:opacity-30",t.class)}},n))},ys=e=>{const[t,n]=U(e,["class"]);return h(px,I({get class(){return le(jn({variant:"ghost"}),"h-7",t.class)}},n))},Sx=e=>{const[t,n]=U(e,["class","children"]);return h(Io,{get mount(){return Bn()},get children(){return h(Rw,{get children(){return h($w,I({get class(){return le("rounded-md border bg-popover p-3 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",t.class)}},n,{get children(){return t.children}}))}})}})},Ex=()=>h(Mw,{get children(){return h(dx,{class:"transition-shadow focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring",get children(){return h(Ce,{variant:"outline",get children(){return vx()}})}})}});var Px=B('<div class="flex flex-col space-y-2"><div>');const Cx=({text:e})=>{const[t,n]=L(!1);return(()=>{var r=Px(),o=r.firstChild;return F(r,h(zt,{get children(){return e?.trim()}}),o),F(o,h(wx,{onValueChange:i=>console.log(i),get children(){return[h(Ex,{}),h(Sx,{get children(){return[h(ds,{view:"day",get children(){return h(us,{children:i=>[h(fs,{get children(){return h(ys,{get children(){return h(gs,{})}})}}),h(hs,{get children(){return[h(bx,{get children(){return h(wo,{get children(){return h(_t,{get each(){return i().weekDays},children:s=>h(xx,{get children(){return s().short}})})}})}}),h(cs,{get children(){return h(_t,{get each(){return i().weeks},children:s=>h(wo,{get children(){return h(_t,{get each(){return s()},children:a=>h(ps,{get value(){return a()},get children(){return h(ms,{get children(){return a().day}})}})})}})})}})]}})]})}}),h(ds,{view:"month",class:"w-[calc(var(--reference-width)-(0.75rem*2))]",get children(){return h(us,{children:i=>[h(fs,{get children(){return h(ys,{get children(){return h(gs,{})}})}}),h(hs,{get children(){return h(cs,{get children(){return h(_t,{get each(){return i().getMonthsGrid({columns:4,format:"short"})},children:s=>h(wo,{get children(){return h(_t,{get each(){return s()},children:a=>h(ps,{get value(){return a().value},get children(){return h(ms,{get children(){return a().label}})}})})}})})}})}})]})}}),h(ds,{view:"year",class:"w-[calc(var(--reference-width)-(0.75rem*2))]",get children(){return h(us,{children:i=>[h(fs,{get children(){return h(ys,{get children(){return h(gs,{})}})}}),h(hs,{get children(){return h(cs,{get children(){return h(_t,{get each(){return i().getYearsGrid({columns:4})},children:s=>h(wo,{get children(){return h(_t,{get each(){return s()},children:a=>h(ps,{get value(){return a().value},get children(){return h(ms,{get children(){return a().label}})}})})}})})}})}})]})}})]}})]}})),ue(()=>xt(o,`datepicker-anchor flex items-center justify-center max-w-64 mx-[-1rem] ${t()&&"opacity-50"}`)),r})()};var Ox=B("<div>Unknown bot message type");const Dx=e=>h(om,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?h(Jl,{get text(){return e.text}}):e.type==="buttons"?h(am,I(()=>e.buttons)):e.type==="list"?h(Ry,I(()=>e.list)):e.type==="media"?h(Xl,I(()=>e.media)):e.type==="link"?h(fm,I(()=>e.link)):e.type==="cards"?h(um,I(()=>e.cards)):e.type==="date"?h(Cx,{get text(){return e.text}}):Ox()}});var kx=B('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Tx=e=>(()=>{var t=kx(),n=t.firstChild;return F(n,()=>e.text?.trim()),t})();var $x=B('<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 Ax=({children:e,createdAt:t})=>(()=>{var n=$x(),r=n.firstChild;return F(r,e),F(n,h(Fl,{createdAt:t,anchor:"end"}),null),n})();var Mx=B("<div>Unknown user message type");const Ix=e=>h(Ax,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?h(Jl,{get text(){return e.text}}):e.type==="media"?h(Xl,I(()=>e.media)):Mx()}});var Lx=B("<div>Unknown message origin");const Rx=e=>e.origin==="bot"?h(Dx,e):e.origin==="user"?h(Ix,e):e.origin==="service"?h(Tx,e):Lx();function Nx(e){return pe({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 Ln(e){return pe({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 Fx=B('<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 _x=()=>(()=>{var e=Fx(),t=e.firstChild;return F(t,h(Ln,{class:"size-2 animate-bounce"}),null),F(t,h(Ln,{class:"size-2 animate-bounce delay-150"}),null),F(t,h(Ln,{class:"size-2 animate-bounce delay-300"}),null),e})();var Vx=B('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),Kx=B("<div>No messages yet...");const vs=()=>{let e;const{messages:t,onMessage:n,typing:r}=Tt(),{onOpen:o}=Ws(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return Ft(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=Vx(),a=e;return typeof a=="function"?Fs(a,s):e=s,F(s,h(Zt,{each:t,get fallback(){return Kx()},children:l=>h(Rx,l)}),null),F(s,h(ie,{get when(){return r()},get children(){return h(_x,{})}}),null),s})()};var zx=B("<textarea>");const Bx=e=>{const[,t]=U(e,["class"]);return(()=>{var n=zx();return Xt(n,I({get class(){return le("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 jx=B('<footer class="flex-none p-4 bg-white min-h-16 flex space-x-1">');const bs=()=>{const{pushMessage:e}=Tt(),[t,n]=L(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=jx();return F(i,h(Bx,{placeholder:"Type your message here...",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),F(i,h(Ce,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return h(Lf,{size:24})}}),null),i})()};var Ux=B('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[98%] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Wx=B("<span class=sr-only>Close"),Hx=B("<div>"),Yx=B("<span class=sr-only>Open"),Gx=B("<span>"),qx=B('<div class="animate-pulse flex p-1">');const Zx=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o}=Ws(),{chatWidget:i}=Pe(),[s,a]=L(!0);return setTimeout(()=>a(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},i()?.openDelay),(()=>{var l=Hx();return F(l,h(ie,{get when(){return n()},get children(){var c=Ux();return F(c,e),c}}),null),F(l,h(ie,{get when(){return n()},get fallback(){return h(Ce,{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,Yx(),h(ie,{get when(){return i()?.balloonMessage},get children(){var c=Gx();return F(c,h(ie,{get when(){return!s()},get fallback(){return(()=>{var u=qx();return F(u,h(Ln,{class:"size-2 animate-bounce"}),null),F(u,h(Ln,{class:"size-2 animate-bounce delay-150"}),null),F(u,h(Ln,{class:"size-2 animate-bounce delay-300"}),null),u})()},get children(){return i()?.balloonMessage}})),ue(()=>xt(c,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(i()?.style.position==="left"?" left-9":" right-9"))),c}})]}})},get children(){return h(Ce,{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[h(Nx,{size:30}),Wx()]}})}}),null),ue(()=>xt(l,"max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(i()?.style.position==="left"?" left-5 items-start":" right-5 items-end"))),l})()};var Xx=B('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Jx=({children:e})=>{const{chatWidget:t}=Pe(),n={};return t()?.style.width&&(n.width=`min(100%, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Xx();return Ns(r,n),F(r,e),r})()};var Qx=B("<div id=smarttalks-widget>");const e1=({children:e})=>{const{chatWidget:t}=Pe();return(()=>{var n=Qx();return F(n,e),ue(()=>xt(n,"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"+(t()?.style.position==="left"?" left-5":" right-5"))),n})()};var t1=B('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const ws=()=>(()=>{var e=t1();return F(e,h(If,{size:45,class:"animate-spin"})),e})(),n1=()=>{const{chatWidget:e}=Pe(),{loading:t}=Tt();return Ft(async()=>{await new Promise(n=>setTimeout(n,1e4)),e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay))}),h(Zx,{get openIcon(){return h(da,{get src(){return e()?.avatar}})},get children(){return[h(ie,{get when(){return t()},get children(){return h(ws,{})}}),h(hi,{}),h(vs,{}),h(bs,{})]}})},r1=()=>{const{loading:e}=Tt();return h(e1,{get children(){return[h(ie,{get when(){return e()},get children(){return h(ws,{})}}),h(hi,{}),h(vs,{}),h(bs,{})]}})},o1=()=>{const{loading:e}=Tt();return h(Jx,{get children(){return[h(ie,{get when(){return e()},get children(){return h(ws,{})}}),h(hi,{}),h(vs,{}),h(bs,{})]}})},i1=()=>{const{chatWidget:e}=Pe();console.log(e());const t=qu(async()=>(e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay)),{default:r1}));return h(Ls,{get children(){return[h(Nn,{get when(){return e()?.mode==="standard"},get children(){return h(n1,{})}}),h(Nn,{get when(){return e()?.mode==="popup"},get children(){return h(t,{})}}),h(Nn,{get when(){return e()?.mode==="static"},get children(){return h(o1,{})}})]}})};var s1=B("<div><div>Form");const a1=()=>{const{formWidget:e}=Pe();return(()=>{var t=s1();return t.firstChild,F(t,()=>e()?._id,null),t})()};function l1(){const{widget:e}=Pe();return h(Ls,{get children(){return[h(Nn,{get when(){return e()?.type==="chat"},get children(){return h(i1,{})}}),h(Nn,{get when(){return e()?.type==="form"},get children(){return h(a1,{})}})]}})}var c1=B("<style>"),u1=B("<div>");const d1=({id:e,settings:t})=>{const{setWidgetId:n}=Pe(),r=(e||"default")+"?"+(t?"&showSettings":"");return n(r),[(()=>{var o=c1();return F(o,Sd),o})(),(()=>{var o=u1();return F(o,h(l1,{})),o})()]};(()=>{typeof window>"u"||xd("smarttalks-widget",{id:"",settings:!1},d1)})()});
|
|
181
|
+
*/function Fd(e,t){return t?Rc([e.clientX,e.clientY],t):!1}function Nd(e){const t=vt(),n=Ai(),r=ss(),o=_e({placement:"bottom-start"},e),[i,s]=H(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=_(),[h,m]=_(),[f,g]=_(),[y,w]=_(),[b,v]=_(!0),[x,P]=_(s.placement),[S,k]=_([]),[R,C]=_([]),{DomCollectionProvider:K}=Lu({items:R,onItemsChange:C}),I=fi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:j=>i.onOpenChange?.(j)}),D=tu(()=>t.forceMount()||I.isOpen()),oe=xu({selectionMode:"none",dataSource:R}),X=j=>{v(j),I.open()},te=(j=!1)=>{I.close(),j&&r&&r.close(!0)},$=j=>{v(j),I.toggle()},U=()=>{const j=y();j&&(ce(j),oe.selectionManager().setFocused(!0),oe.selectionManager().setFocusedKey(void 0))},ie=j=>{k(ro=>[...ro,j]);const Bn=r?.registerNestedMenu(j);return()=>{k(ro=>sr(ro,j)),Bn?.()}},ze=j=>c===l?.side&&Fd(j,l?.area),Kn=j=>{ze(j)&&j.preventDefault()},it=j=>{ze(j)||U()},Ct=j=>{ze(j)&&j.preventDefault()};Zc({isDisabled:()=>!(r==null&&I.isOpen()&&t.isModal()),targets:()=>[y(),...S()].filter(Boolean)}),M(()=>{const j=y();if(!j||!r)return;const Bn=r.registerNestedMenu(j);B(()=>{Bn()})});const Jp={dataset:O(()=>({"data-expanded":I.isOpen()?"":void 0,"data-closed":I.isOpen()?void 0:""})),isOpen:I.isOpen,contentPresence:D,nestedMenus:S,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>oe,parentMenuContext:()=>r,triggerRef:f,contentRef:y,triggerId:u,contentId:h,setTriggerRef:g,setContentRef:w,open:X,close:te,toggle:$,focusContent:U,onItemEnter:Kn,onItemLeave:it,onTriggerLeave:Ct,setPointerDir:j=>c=j,setPointerGraceTimeoutId:j=>a=j,setPointerGraceIntent:j=>l=j,registerNestedMenu:ie,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:gn(d),registerContentId:gn(m)};return p(K,{get children(){return p(is.Provider,{value:Jp,get children(){return p($d,T({anchorRef:f,contentRef:y,onCurrentPlacementChange:P},s))}})}})}const Kd=se();function Bd(e){let t;const n=vt(),r=wt(),o=_e({id:n.generateId(`item-${Ce()}`)},e),[i,s]=H(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=_(),[c,u]=_(),[d,h]=_(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Iu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const w=wu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=C=>{de(C,i.onPointerMove),C.pointerType==="mouse"&&(i.disabled?r.onItemLeave(C):(r.onItemEnter(C),C.defaultPrevented||(ce(C.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},v=C=>{de(C,i.onPointerLeave),C.pointerType==="mouse"&&r.onItemLeave(C)},x=C=>{de(C,i.onPointerUp),!i.disabled&&C.button===0&&y()},P=C=>{if(de(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})),R={isChecked:()=>i.checked,dataset:k,setLabelRef:h,generateId:ti(()=>s.id),registerLabel:gn(l),registerDescription:gn(u)};return p(Kd.Provider,{value:R,get children(){return p(pn,T({as:"div",ref(C){var K=tt(I=>t=I,i.ref);typeof K=="function"&&K(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 be([i.onPointerDown,w.onPointerDown])},get onPointerUp(){return be([x,w.onPointerUp])},get onClick(){return be([i.onClick,w.onClick])},get onKeyDown(){return be([P,w.onKeyDown])},get onMouseDown(){return be([i.onMouseDown,w.onMouseDown])},get onFocus(){return be([i.onFocus,w.onFocus])},onPointerMove:b,onPointerLeave:v},k,s))}})}const zd=se();function ls(){return ue(zd)}function Vd(e){let t;const n=vt(),r=wt(),o=ls(),i=_e({id:n.generateId(`content-${Ce()}`)},e),[s,a]=H(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=Eu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Xc({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Oe(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=>{de(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=y=>{if(de(y,s.onPointerMove),y.pointerType!=="mouse")return;const w=y.target,b=l!==y.clientX;Oe(y.currentTarget,w)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return M(()=>B(r.registerContentId(s.id))),p(J,{get when(){return r.contentPresence.isPresent()},get children(){return p(Hu,{get children(){return p(Uu,T({ref(y){var w=tt(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 be([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return be([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return be([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return be([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Ud(e){let t;const n=vt(),r=wt(),[o,i]=H(e,["ref"]);return Ni({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),p(Vd,T({ref(s){var a=tt(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function jd(e){return p(Bd,T({role:"menuitem",closeOnSelect:!0},e))}function Hd(e){const t=wt();return p(J,{get when(){return t.contentPresence.isPresent()},get children(){return p(_o,e)}})}function qd(e){const t=`menu-${Ce()}`,n=_e({id:t,modal:!0},e),[r,o]=H(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=fi({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:ti(()=>r.id),value:()=>r.value};return p(as.Provider,{value:s,get children(){return p(Nd,T({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Wd(e){const t=vt(),n=wt(),r=ls(),o=_e({id:t.generateId("trigger")},e),[i,s]=H(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,M(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),M(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),M(()=>{n.isOpen()&&r.setValue(a)}),B(()=>{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=>{de(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},u=f=>{de(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},d=f=>{if(de(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),$c(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=>{de(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{de(f,i.onFocus),r!==void 0&&r.setValue(a)};return M(()=>B(n.registerTriggerId(i.id))),p(Ou,T({ref(f){var g=tt(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 Gd(e){const t=vt(),n=wt(),[r,o]=H(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return p(Ud,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||ce(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function Yd(e){const t=`dropdownmenu-${Ce()}`,n=_e({id:t},e);return p(qd,n)}function Xd(e){return le({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 Jd(e){return le({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 Zd(e){return le({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 Qd(e){return le({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 ef(e){return le({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 tf=e=>p(Yd,T({gutter:4},e)),nf=Wd,rf=e=>{const[,t]=H(e,["class"]);return p(Hd,{get mount(){return ln()},get children(){return p(Gd,T({get class(){return je("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))}})},of=e=>{const[,t]=H(e,["class"]);return p(jd,T({get class(){return je("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 sf(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 af(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function lf(e,t,n){const r=`${rr}/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 cf(e,t,n){if(!e||!t||!n)return;const r=`${rr}/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 Ae=Object.create(null);Ae.open="0",Ae.close="1",Ae.ping="2",Ae.pong="3",Ae.message="4",Ae.upgrade="5",Ae.noop="6";const En=Object.create(null);Object.keys(Ae).forEach(e=>{En[Ae[e]]=e});const Pr={type:"error",data:"parser error"},cs=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",us=typeof ArrayBuffer=="function",ds=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ar=({type:e,data:t},n,r)=>cs&&t instanceof Blob?n?r(t):fs(t,r):us&&(t instanceof ArrayBuffer||ds(t))?n?r(t):fs(new Blob([t]),r):r(Ae[e]+(t||"")),fs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function hs(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Tr;function uf(e,t){if(cs&&e.data instanceof Blob)return e.data.arrayBuffer().then(hs).then(t);if(us&&(e.data instanceof ArrayBuffer||ds(e.data)))return t(hs(e.data));Ar(e,!1,n=>{Tr||(Tr=new TextEncoder),t(Tr.encode(n))})}const gs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ut=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<gs.length;e++)Ut[gs.charCodeAt(e)]=e;const df=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=Ut[e.charCodeAt(r)],s=Ut[e.charCodeAt(r+1)],a=Ut[e.charCodeAt(r+2)],l=Ut[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},ff=typeof ArrayBuffer=="function",Mr=(e,t)=>{if(typeof e!="string")return{type:"message",data:ps(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:hf(e.substring(1),t)}:En[n]?e.length>1?{type:En[n],data:e.substring(1)}:{type:En[n]}:Pr},hf=(e,t)=>{if(ff){const n=df(e);return ps(n,t)}else return{base64:!0,data:e}},ps=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ms="",gf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Ar(i,!1,a=>{r[s]=a,++o===n&&t(r.join(ms))})})},pf=(e,t)=>{const n=e.split(ms),r=[];for(let o=0;o<n.length;o++){const i=Mr(n[o],t);if(r.push(i),i.type==="error")break}return r};function mf(){return new TransformStream({transform(e,t){uf(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 Dr;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 yf(e,t){Dr||(Dr=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(Mr(i?l:Dr.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Pr);break}}}})}const ys=4;function Z(e){if(e)return bf(e)}function bf(e){for(var t in Z.prototype)e[t]=Z.prototype[t];return e}Z.prototype.on=Z.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Z.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Z.prototype.off=Z.prototype.removeListener=Z.prototype.removeAllListeners=Z.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},Z.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},Z.prototype.emitReserved=Z.prototype.emit,Z.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Z.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),xe=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),wf="arraybuffer";function Zp(){}function bs(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const vf=xe.setTimeout,xf=xe.clearTimeout;function _n(e,t){t.useNativeTimers?(e.setTimeoutFn=vf.bind(xe),e.clearTimeoutFn=xf.bind(xe)):(e.setTimeoutFn=xe.setTimeout.bind(xe),e.clearTimeoutFn=xe.clearTimeout.bind(xe))}const Sf=1.33;function Ef(e){return typeof e=="string"?kf(e):Math.ceil((e.byteLength||e.size)*Sf)}function kf(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 ws(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Cf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Of(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 _f extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Lr extends Z{constructor(t){super(),this.writable=!1,_n(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 _f(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=Mr(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=Cf(t);return n.length?"?"+n:""}}class Pf extends Lr{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)};pf(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,gf(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]=ws()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let vs=!1;try{vs=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Af=vs;function Tf(){}class Mf extends Pf{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 Te extends Z{constructor(t,n,r){super(),this.createRequest=t,_n(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=bs(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=Te.requestsCount++,Te.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=Tf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Te.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(Te.requestsCount=0,Te.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",xs);else if(typeof addEventListener=="function"){const e="onpagehide"in xe?"pagehide":"unload";addEventListener(e,xs,!1)}}function xs(){for(let e in Te.requests)Te.requests.hasOwnProperty(e)&&Te.requests[e].abort()}const Df=function(){const e=Ss({xdomain:!1});return e&&e.responseType!==null}();class Lf extends Mf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Df&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Te(Ss,this.uri(),t)}}function Ss(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Af))return new XMLHttpRequest}catch{}if(!t)try{return new xe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Es=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class If extends Lr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Es?{}:bs(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;Ar(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]=ws()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ir=xe.WebSocket||xe.MozWebSocket;class Rf extends If{createSocket(t,n,r){return Es?new Ir(t,n,r):n?new Ir(t,n):new Ir(t)}doWrite(t,n){this.ws.send(n)}}class $f extends Lr{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=yf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=mf();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 Ff={websocket:Rf,webtransport:$f,polling:Lf},Nf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Kf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Rr(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=Nf.exec(e||""),i={},s=14;for(;s--;)i[Kf[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=Bf(i,i.path),i.queryKey=zf(i,i.query),i}function Bf(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 zf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const $r=typeof addEventListener=="function"&&typeof removeEventListener=="function",Pn=[];$r&&addEventListener("offline",()=>{Pn.forEach(e=>e())},!1);class Ye extends Z{constructor(t,n){if(super(),this.binaryType=wf,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=Rr(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=Rr(n.host).host);_n(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=Of(this.opts.query)),$r&&(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"})},Pn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ys,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&&Ye.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",Ye.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+=Ef(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(Ye.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(),$r&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Pn.indexOf(this._offlineEventListener);r!==-1&&Pn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ye.protocol=ys;class Vf extends Ye{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;Ye.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;Ye.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 Uf=class extends Vf{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=>Ff[o]).filter(o=>!!o)),super(t,r)}};function jf(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=Rr(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 Hf=typeof ArrayBuffer=="function",qf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ks=Object.prototype.toString,Wf=typeof Blob=="function"||typeof Blob<"u"&&ks.call(Blob)==="[object BlobConstructor]",Gf=typeof File=="function"||typeof File<"u"&&ks.call(File)==="[object FileConstructor]";function Fr(e){return Hf&&(e instanceof ArrayBuffer||qf(e))||Wf&&e instanceof Blob||Gf&&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(Fr(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 Yf(e){const t=[],n=e.data,r=e;return r.data=Nr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Nr(e,t){if(!e)return e;if(Fr(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]=Nr(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]=Nr(e[r],t));return n}return e}function Xf(e,t){return e.data=Kr(e.data,t),delete e.attachments,e}function Kr(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]=Kr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Kr(e[n],t));return e}const Jf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Zf=5;var V;(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"})(V||(V={}));class Qf{constructor(t){this.replacer=t}encode(t){return(t.type===V.EVENT||t.type===V.ACK)&&An(t)?this.encodeAsBinary({type:t.type===V.EVENT?V.BINARY_EVENT:V.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===V.BINARY_EVENT||t.type===V.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=Yf(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Cs(e){return Object.prototype.toString.call(e)==="[object Object]"}class Br extends Z{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===V.BINARY_EVENT;r||n.type===V.BINARY_ACK?(n.type=r?V.EVENT:V.ACK,this.reconstructor=new eh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Fr(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(V[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===V.BINARY_EVENT||r.type===V.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(Br.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 V.CONNECT:return Cs(n);case V.DISCONNECT:return n===void 0;case V.CONNECT_ERROR:return typeof n=="string"||Cs(n);case V.EVENT:case V.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Jf.indexOf(n[0])===-1);case V.ACK:case V.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eh{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=Xf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const th=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Br,Encoder:Qf,get PacketType(){return V},protocol:Zf},Symbol.toStringTag,{value:"Module"}));function ke(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Os extends Z{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=[ke(t,"open",this.onopen.bind(this)),ke(t,"packet",this.onpacket.bind(this)),ke(t,"error",this.onerror.bind(this)),ke(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(nh.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:V.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:V.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 V.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 V.EVENT:case V.BINARY_EVENT:this.onevent(t);break;case V.ACK:case V.BINARY_ACK:this.onack(t);break;case V.DISCONNECT:this.ondisconnect();break;case V.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:V.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:V.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 xt(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}xt.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},xt.prototype.reset=function(){this.attempts=0},xt.prototype.setMin=function(e){this.ms=e},xt.prototype.setMax=function(e){this.max=e},xt.prototype.setJitter=function(e){this.jitter=e};class zr extends Z{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,_n(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 xt({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||th;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 Uf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=ke(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=ke(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(ke(t,"ping",this.onping.bind(this)),ke(t,"data",this.ondata.bind(this)),ke(t,"error",this.onerror.bind(this)),ke(t,"close",this.onclose.bind(this)),ke(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 Os(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 jt={};function Tn(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=jf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=jt[o]&&i in jt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new zr(r,t):(jt[o]||(jt[o]=new zr(r,t)),l=jt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Tn,{Manager:zr,Socket:Os,io:Tn,connect:Tn});class ot{static instance;constructor(){}static init(){return ot.instance||(ot.instance=Tn(Nl,{path:"/ws",withCredentials:!0}),ot.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),ot.instance}static on(t,n){ot.instance||this.init().on(t,n)}}const _s=1e3*60*60*24,[Mn,Ps]=No("smarttalks-widget-messages",{},_s),As=()=>{const{widgetId:e}=ee();return Mn[e()]??[]},rh=e=>{const{widgetId:t}=ee();Ps({...Mn,[t()]:[...Mn[t()]??[],e]})},oh=()=>{const{widgetId:e}=ee();Ps({...Mn,[e()]:[]})},[Ts,ih]=No("smarttalks-widget-conversationinfo",{},_s),Ms=()=>{const{widgetId:e}=ee();return Ts[e()]??{}},Ds=e=>{const{widgetId:t}=ee();ih({...Ts,[t()]:e})},[sh,Vr]=_(!1),[ah,Ls]=_(!1),Is=[],Rs=()=>{Is.forEach(e=>e())},lh=e=>Is.push(e),Ur=e=>{const t=sf(e);if(rh(t),t.type==="media"){setTimeout(Rs,200);return}Rs()},ch=(e,t)=>{const{chatWidget:n}=ee(),r=Ms();e.trim()&&(Ur({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ot.on("message",o=>{(o.contactId!==r.contactId||o.interactionId!==r.interactionId)&&Ds({contactId:o.contactId,interactionId:o.interactionId});for(const i of o.messages)Ur(i);Vr(!1),af(o.debug)}),Vr(!0),lf(e,t,n()?._id).catch(o=>{console.error(o),Vr(!1)}))},uh=()=>{const{chatWidget:e}=ee(),t=Ms();Ls(!0),oh(),cf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ds({}),Ls(!1),dh()})},dh=()=>{const{chatWidget:e}=ee();if(As().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Ur({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Xe=()=>({getMessages:As,pushMessage:ch,clearMessages:uh,onMessage:lh,typing:sh,loading:ah});var fh=L("<span>");const hh=()=>{const{clearMessages:e}=Xe();_(!1);const[t,n]=_(!1);return p(tf,{get open(){return t()},onOpenChange:n,get children(){return[p(nf,{get children(){return p(ye,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return p(ec,{size:20})}})}}),p(rf,{get children(){return p(of,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[p(Ql,{size:14}),(()=>{var r=fh();return A(r,()=>ft("restart")),r})()]}})}})]}})};function gh(e){return le({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 ph(e){return le({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 mh(e){return le({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 yh=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 jr=()=>{const{chatWidget:e}=ee(),[t,n]=_(!1),r=()=>{const i=ln();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=ln();i&&(i.style.display="none")}};return(()=>{var i=yh(),s=i.firstChild;return A(i,p(Jl,{}),s),A(s,p(ye,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return p(J,{get when(){return t()},get fallback(){return p(ph,{size:16})},get children(){return p(gh,{size:16})}})}}),null),A(s,p(J,{get when(){return e()?.showSettings},get children(){return p(hh,{})}}),null),A(s,p(J,{get when(){return e()?.mode==="popup"},get children(){return p(ye,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return p(mh,{size:16})}})}}),null),i})()};var bh=L("<span>");const $s=({createdAt:e,anchor:t="end"})=>(()=>{var n=bh();return Ze(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 wh=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 vh=({children:e,createdAt:t})=>(()=>{var n=wh(),r=n.firstChild;return A(r,e),A(n,p($s,{createdAt:t,anchor:"start"}),null),n})();var xh=L("<span>");const St=e=>{const[,t]=H(e,["class","children"]);let n=e.children?.toString();return n&&(n=Rl($l(n))),(()=>{var r=xh();return r.innerHTML=n,Qe(r,T({get class(){return je("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Sh=L('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const Eh=({options:e,text:t})=>{let n;const{pushMessage:r}=Xe(),[o,i]=_(!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=Sh(),c=l.firstChild,u=c.firstChild;A(l,p(St,{get children(){return t?.trim()}}),c),A(c,p(J,{get when(){return e.length>1},get children(){return p(ye,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return p(Xd,{size:20})}})}}),u);var d=n;return typeof d=="function"?So(d,u):n=u,A(u,p(at,{each:e,children:h=>p(ye,{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()}})})),A(c,p(J,{get when(){return e.length>1},get children(){return p(ye,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return p(Jd,{size:20})}})}}),null),Q(()=>Ze(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var kh=L('<div class="flex flex-col"><span>'),Ch=L("<a target=_blank><img><span></span><span>");const Oh=({options:e,text:t})=>(()=>{var n=kh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,p(at,{each:e,children:o=>(()=>{var i=Ch(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),Q(c=>{var u=o.url,d=o.image;return u!==c.e&&ae(i,"href",c.e=u),d!==c.t&&ae(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var _h=L("<a target=_blank>");const Ph=({url:e,text:t})=>(()=>{var n=_h();return ae(n,"href",e),A(n,()=>t?.trim()),n})();var Ah=e=>{const t=T({initialRegistered:!1},e),[n,r]=_(t.initialRegistered);return[O(()=>{if(n())return z(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Fs=Ah,Ht=e=>typeof e=="function",Th=["button","color","file","image","reset","submit"],Mh=(e,t)=>e==="button"?!0:e==="input"&&t?Th.indexOf(t)!==-1:!1;function Dh(e){const[t,n]=_(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>W(()=>{let a;return Ht(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Hr=Dh,Dn=new Map,Ln=(e,t)=>{if(Dn.has(e))return Dn.get(e);const n=se(t);return Dn.set(e,n),n},qr=e=>{const t=Dn.get(e);if(t)return ue(t)},Lh=e=>{const t=T({enabled:!0},e);M(()=>{z(t.enabled)&&(document.addEventListener("keydown",n),B(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Ih=Lh,Rh=e=>{const t=T({enabled:!0},e);M(()=>{const{body:n}=document;z(t.enabled)&&vr({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},$h=Rh,Fh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);M(()=>{if(!z(t.enabled))return;const r=z(t.strategy);document.addEventListener(r,n),B(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=z(t.element),i=z(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Nh=Fh,Kh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Ih({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Nh({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}),$h({enabled:t.noOutsidePointerEvents})},Bh=Kh,Wr=se(),zh=e=>O(()=>{if(ue(Wr))return p(Ns,e);const r=Ce(),[o,i]=_([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return p(Wr.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return p(Ns,e)}})}),Ns=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=H(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ue(Wr),i=Ce();M(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Bh({dismissOnEscapeKeyDown:()=>z(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>z(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>z(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=O(()=>n.children),l=()=>{const c=a();return Ht(c)?c({get isLastLayer(){return s()}}):c};return W(()=>l())},Vh=zh,Uh=()=>{const[e,t]=_(!1);return M(()=>t(!0)),e},jh=Uh,Hh=(e,t)=>(e&&(Ht(e)?e(t):e[0](e[1],t)),t.defaultPrevented),Gr=(...e)=>e.some(t=>!!t()),qh=e=>(...t)=>{for(const n of e)n&&n(...t)},In=(...e)=>qh(e),re=e=>e?"":void 0,Wh="div",Gh=e=>{const[t,n]=H(e,["as"]),r=O(()=>t.as??Wh);return O(()=>{const i=r();switch(typeof i){case"function":return W(()=>i(n));case"string":return p(tn,T({component:i},n))}})},Yr=Gh,Yh=e=>{let t,n=!1;return()=>n?t:(n=!0,t=O(e))},Ks=Yh,Xh=e=>O(()=>z(e.element)?.tagName.toLowerCase()||e.fallback),Jh=Xh,Bs="button",Zh=e=>{const[t,n]=_(null),[r,o]=H(e,["as","ref","type"]),i=Jh({element:t,fallback:Bs}),s=O(()=>Mh(i(),r.type));return p(Yr,T({get as(){return r.as??Bs},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))},Qh=Zh,pe=e=>typeof e=="function"?e():e,Rn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),eg='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"])',Xr="focusTrap.initialFocus",Jr="focusTrap.finalFocus",zs={bubbles:!1,cancelable:!0},tg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=_(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(pe(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(pe(t.element))};M(()=>{const f=pe(t.element);if(f&&pe(t.enabled)){s=document.activeElement,W(()=>{l(f),c(f)});const g=new MutationObserver(a);pe(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),B(()=>{pe(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),M(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),B(()=>{document.removeEventListener("keydown",h)}))}),M(()=>{const f=o();f&&(f.addEventListener("keydown",u),B(()=>{f.removeEventListener("keydown",u)}))}),M(()=>{const f=i();f&&(f.addEventListener("keydown",d),B(()=>{f.removeEventListener("keydown",d)}))});const l=f=>{r(Array.from(f.querySelectorAll(eg)))},c=f=>{const g=pe(t.initialFocusElement)??o()??f,y=t.onInitialFocus;let w;y&&(w=new CustomEvent(Xr,zs),f.addEventListener(Xr,y),f.dispatchEvent(w),f.removeEventListener(Xr,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(!pe(t.restoreFocus))return;const y=pe(t.finalFocusElement)??s;if(!y)return;let w;const b=t.onFinalFocus;b&&(w=new CustomEvent(Jr,zs),f.addEventListener(Jr,b),f.dispatchEvent(w),f.removeEventListener(Jr,b)),w?.defaultPrevented!==!0&&Rn(()=>y.focus())}},ng=tg,rg=ng,$n=e=>typeof e=="function"?e():e,og=e=>{const t=O(()=>{const s=$n(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=_($n(e.show)?"present":"hidden");let i="none";return M(s=>{const a=$n(e.show);return W(()=>{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}),M(()=>{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),B(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},ig=og,Vs=ig,sg=se(),ag=e=>e?Ln(`dialog-${e}`):sg,Us=se(),lg=e=>e?Ln(`dialog-internal-${e}`):Us,Et=e=>{if(!e){const n=ue(Us);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},cg="div",ug=e=>{const[t,n]=H(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=O(()=>Et(t.contextId)),o=()=>Gr(r().open,()=>t.forceMount,r().contentPresent),i=O(s=>s||o(),!1);return p(J,{get when(){return i()},get children(){return p(Vh,{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(J,{get when(){return o()},get children(){return p(Yr,T({ref(l){var c=In(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??cg},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 re(r().open())},get"data-closed"(){return re(!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()}}))}})}})}})},dg=ug,fg="div",hg=e=>{const[t,n]=H(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=O(()=>Et(t.contextId)),o=()=>Gr(r().open,()=>t.forceMount,r().overlayPresent),i=O(s=>s||o(),!1);return p(J,{get when(){return i()},get children(){return(()=>{const s=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(Yr,T({get as(){return t.as??fg},ref(a){var l=In(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return re(r().open())},get"data-closed"(){return re(!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()}}))}})})()}})},gg=hg,pg=e=>{const[t,n]=H(e,["forceMount","contextId","children"]),r=O(()=>Et(t.contextId)),o=()=>Gr(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=jh(),s=O(a=>a||o()&&i(),!1);return p(J,{get when(){return s()},get children(){return(()=>{const a=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(_o,T(n,{get children(){return a()}}))}})})()}})},mg=pg,Zr=!0,yg=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Zr),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Zr),preventScroll:()=>!!(e.modal??Zr),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ce()},e),[n,r]=Hr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Fs({value:()=>t.labelId??Ce()}),[a,l,c]=Fs({value:()=>t.descriptionId??Ce()}),[u,d]=_(null),[h,m]=_(null),[f,g]=_(null),{present:y}=Vs({show:n,element:h}),{present:w}=Vs({show:n,element:f});rg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ni({element:h,enabled:()=>y()&&z(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 z(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return z(t.noOutsidePointerEvents)},get preventScroll(){return z(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return z(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=Ks(()=>t.children),x=()=>{const S=v()();return Ht(S)?S(b):S};return O(()=>{const S=ag(t.contextId),k=lg(t.contextId);return p(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(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:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(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 W(()=>x())}})}})})},bg=yg,wg="button",vg=e=>{const[t,n]=H(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=O(()=>Et(t.contextId));return p(Qh,T({ref(i){var s=In(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??wg},onClick:i=>{!Hh(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 re(r().open())},get"data-closed"(){return re(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},xg=vg;function Sg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=_(!1),[o,i]=_(null);let s=null;M(()=>{const c=pe(t.element),u=pe(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),B(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const u=c.target,d=[u.offsetWidth,u.offsetHeight],h=pe(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Se(()=>{i(s),r(!0)}),Rn(()=>{i(d),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d:s?Fn(h,s)!==Fn(h,d)&&(Se(()=>{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=pe(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Se(()=>{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]}},Eg=Sg,kg=Eg,Cg=(e,t)=>e.length>0?()=>e(W(t)):e;function Og(e,t){let n=0;const r=e.map((o,i)=>O(()=>(n=i,o()),void 0,Qo));return O(()=>r.map(o=>o())[n],void 0,t)}function js(e,t,n){let r=()=>t;const[o,i]=_(t,Qo),s=O(Cg(e,()=>r()),t);return[r=Og([o,s],n),a=>i(()=>typeof a=="function"?a(W(r)):a)]}var _g=e=>p(xg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Hs=se(),Pg=e=>e?Ln(`drawer-${e}`):Hs,Ag=e=>{if(!e){const n=ue(Hs);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},qs=se(),Tg=e=>e?Ln(`drawer-internal-${e}`):qs,Ws=e=>{if(!e){const n=ue(qs);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},Gs=(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)},Mg=(e,t,n,r)=>{const o=Ys("upper",e,r?n:t),i=Ys("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},Ys=(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),Dg=(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},Lg=void 0,Ig=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[Lg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,U)=>{const ie=$/U;return ie<1&&ie>-1?1:ie},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=H(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=Hr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Hr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=_(),{transitioning:u,transitionSize:d}=kg({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]=_(!1),[f,g]=js(()=>u()?"resizing":null),y=O(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[w,b]=_(!1);M(()=>{const $=o();W(()=>{w()!==$&&($?(b(!0),Di(()=>{Se(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&g(null)})):(Se(()=>{g("closing"),a(0)}),Di(()=>{parseFloat(y().transitionDuration)===0&&v()})))})});const v=()=>{Se(()=>{b(!1),g(null)})},[x,P]=_(0);M(()=>{const $=l()?.contentRef();if(!$)return;k($);const U=new ResizeObserver(S);U.observe($),B(()=>{U.disconnect()})});const S=$=>{for(const U of $)U.target===l()?.contentRef()&&k(U.target)},k=$=>{const U=W(()=>x());switch(n.side){case"top":case"bottom":if(U===$.offsetHeight)return;P($.offsetHeight);break;case"left":case"right":if(U===$.offsetWidth)return;P($.offsetWidth);break}},R=O(()=>Gs(s(),x())),[C,K]=js(()=>R().offset),I=O(()=>x()?(x()-C())/x():0),D={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 I()},get translate(){return C()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},oe=Ks(()=>n.children),X=$=>{c(Et(n.contextId));const U=oe()();if(Ht(U)){const ie=T($,D);return U(ie)}return U};return O(()=>{const $=Pg(n.contextId),U=Tg(n.contextId);return W(()=>p($.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:I,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return p(U.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:I,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:K,drawerSize:x,resolvedActiveSnapPoint:R,drawerStyles:y,setTransitionState:g,transitionSize:d,closeDrawer:v}},get children(){return p(bg,T({get open(){return w()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:ie=>X(ie)}))}})}}))})},Rg=Ig,$g=e=>{const[t,n]=H(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=O(()=>Ws(t.contextId)),c=O(()=>Et(t.contextId)),u=O(()=>l().snapPoints().map((v,x)=>Gs(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`}});M(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),B(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=v=>{Dg(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,P)=>{if(!r)return;if(!l().isDragging()||o===null){const R=window.getSelection();if(R&&R.toString().length>0){b();return}if(l().handleScrollableElements()){const C=[x,P].map((te,$)=>i[$]-te),K=Math.abs(C[0])>Math.abs(C[1])?"x":"y",I=K==="x"?C[0]:C[1];if(Math.abs(I)<.3)return;const D=c().contentRef(),[oe,X]=Li(v,K,D);if(I>0&&Math.abs(oe)>1||I<0&&Math.abs(X)>0){b();return}}switch(l().side()){case"top":case"bottom":o=P;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Se(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let S;switch(l().side()){case"top":S=-(o-P);break;case"bottom":S=o-P;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),P=l().translate()*x,S=Mg(u(),l().translate(),P,l().allowSkippingSnapPoints());Se(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Se(()=>{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(dg,T({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:()=>{Se(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return re(l().isTransitioning())},get"data-opening"(){return re(l().transitionState()==="opening")},get"data-closing"(){return re(l().transitionState()==="closing")},get"data-snapping"(){return re(l().transitionState()==="snapping")},get"data-resizing"(){return re(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Fg=$g,Ng=e=>{const[t,n]=H(e,["contextId"]),r=O(()=>Ws(t.contextId));return p(gg,T({get contextId(){return t.contextId},get"data-transitioning"(){return re(r().isTransitioning())},get"data-opening"(){return re(r().transitionState()==="opening")},get"data-closing"(){return re(r().transitionState()==="closing")},get"data-snapping"(){return re(r().transitionState()==="snapping")},get"data-resizing"(){return re(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Kg=Ng,Bg=L('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const zg=Rg,Vg=_g,Ug=mg,jg=e=>{const[,t]=H(e,["class"]),n=Ag();return p(Kg,T({get class(){return je("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))},Hg=e=>{const[,t]=H(e,["class","children"]);return p(Ug,{get mount(){return ln()},get children(){return[p(jg,{}),p(Fg,T({id:"smarttalks-list-content",get class(){return je("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[Bg(),O(()=>e.children)]}}))]}})};var qg=L('<span class="font-semibold mt-2">'),Wg=L('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),Gg=L('<div class="flex flex-col space-y-2"><div>'),Yg=L('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),Xg=L('<div class="flex flex-col items-start"><span class=text-slate-500>');const Jg=({options:e,text:t,title:n})=>{const{pushMessage:r}=Xe(),[o,i]=_(!1),[s,a]=_(!1),[l,c]=_(),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=Gg(),m=h.firstChild;return A(h,p(St,{get children(){return t?.trim()}}),m),A(m,p(zg,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[p(Vg,{as:ye,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??ft("selectOption")}}),p(Hg,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=qg();return A(f,()=>n?.trim()??ft("selectOption")),f})(),(()=>{var f=Wg();return A(f,p(at,{each:e,children:g=>(()=>{var y=Yg(),w=y.firstChild;return A(w,()=>g.label?.trim()??""),A(y,p(at,{get each(){return g.items},children:b=>p(ye,{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=Xg(),x=v.firstChild;return A(v,()=>b.label?.trim(),x),A(x,()=>b.description?.trim()),v})(),p(J,{get when(){return l()===b},get fallback(){return p(Qd,{class:"size-4 text-slate-500"})},get children(){return p(Zd,{class:"size-4 text-slate-500"})}})]}})}),null),y})()})),f})(),p(ye,{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 ft("send")}})]}})]}})),Q(()=>Ze(m,o()?"opacity-50":"")),h})()};var Zg=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 Qg=e=>(()=>{var t=Zg(),n=t.firstChild,r=n.nextSibling;return Q(o=>{var i=e.link,s=e.link;return i!==o.e&&ae(n,"src",o.e=i),s!==o.t&&ae(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var ep=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 tp=e=>(()=>{var t=ep(),n=t.firstChild,r=n.firstChild;return A(n,p(ef,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(()=>ae(n,"href",e.link)),t})();var np=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 rp=e=>(()=>{var t=np(),n=t.firstChild,r=n.firstChild;return A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ae(n,"href",o.e=i),s!==o.t&&ae(r,"src",o.t=s),a!==o.a&&ae(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var op=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 ip=e=>(()=>{var t=op(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(i=>{var s=e.link,a=e.link;return s!==i.e&&ae(r,"src",i.e=s),a!==i.t&&ae(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var sp=L("<div>Media type not supported");const Xs=e=>e.type==="image"?p(rp,e):e.type==="audio"?p(Qg,e):e.type==="document"?p(tp,e):e.type==="video"?p(ip,e):sp(),Qr=({text:e})=>p(St,{get children(){return e?.trim()}});var ap=L("<div>Unknown bot message type");const lp=e=>p(vh,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Qr,{get text(){return e.text}}):e.type==="buttons"?p(Eh,T(()=>e.buttons)):e.type==="list"?p(Jg,T(()=>e.list)):e.type==="media"?p(Xs,T(()=>e.media)):e.type==="link"?p(Ph,T(()=>e.link)):e.type==="cards"?p(Oh,T(()=>e.cards)):e.type==="date"?p(Qr,{get text(){return e.text}}):ap()}});var cp=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 up=e=>(()=>{var t=cp(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var dp=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 fp=({children:e,createdAt:t})=>(()=>{var n=dp(),r=n.firstChild;return A(r,e),A(n,p($s,{createdAt:t,anchor:"end"}),null),n})();var hp=L("<div>Unknown user message type");const gp=e=>p(fp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Qr,{get text(){return e.text}}):e.type==="media"?p(Xs,T(()=>e.media)):hp()}});var pp=L("<div>Unknown message origin");const mp=e=>e.origin==="bot"?p(lp,e):e.origin==="user"?p(gp,e):e.origin==="service"?p(up,e):pp();function yp(e){return le({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 kt(e){return le({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 bp=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 wp=()=>(()=>{var e=bp(),t=e.firstChild;return A(t,p(kt,{class:"size-2 animate-bounce"}),null),A(t,p(kt,{class:"size-2 animate-bounce delay-150"}),null),A(t,p(kt,{class:"size-2 animate-bounce delay-300"}),null),e})();var vp=L('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),xp=L("<div>");const eo=()=>{let e;const{getMessages:t,onMessage:n,typing:r}=Xe(),{onOpen:o}=Mo(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return _t(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=vp(),a=e;return typeof a=="function"?So(a,s):e=s,A(s,p(at,{get each(){return t()},get fallback(){return(()=>{var l=xp();return A(l,()=>ft("emptyMessages")),l})()},children:l=>p(mp,l)}),null),A(s,p(J,{get when(){return r()},get children(){return p(wp,{})}}),null),s})()};var Sp=L("<textarea>");const Ep=e=>{const[,t]=H(e,["class"]);return(()=>{var n=Sp();return Qe(n,T({get class(){return je("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 kp=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 Cp=e=>(()=>{var t=kp();return Qe(t,e,!0,!0),t})();var Op=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 _p=()=>(()=>{var e=Op(),t=e.firstChild;return A(e,p(Cp,{height:15}),t),e})();var Pp=L('<footer class="flex-none p-4 bg-white min-h-16 flex space-x-1 mb-2">');const to=()=>{const{pushMessage:e}=Xe(),[t,n]=_(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=Pp();return A(i,p(Ep,{get placeholder(){return ft("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,p(ye,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return p(nc,{size:24})}}),null),A(i,p(_p,{}),null),i})()};var Ap=L('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[98%] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Tp=L("<span class=sr-only>Close"),Mp=L("<div>"),Dp=L("<span class=sr-only>Open"),Lp=L("<span>"),Ip=L('<div class="animate-pulse flex p-1">');const Rp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o}=Mo(),{chatWidget:i}=ee(),[s,a]=_(!0);return setTimeout(()=>a(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},i()?.openDelay),(()=>{var l=Mp();return A(l,p(J,{get when(){return n()},get children(){var c=Ap();return A(c,e),c}}),null),A(l,p(J,{get when(){return n()},get fallback(){return p(ye,{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,Dp(),p(J,{get when(){return i()?.balloonMessage},get children(){var c=Lp();return A(c,p(J,{get when(){return!s()},get fallback(){return(()=>{var u=Ip();return A(u,p(kt,{class:"size-2 animate-bounce"}),null),A(u,p(kt,{class:"size-2 animate-bounce delay-150"}),null),A(u,p(kt,{class:"size-2 animate-bounce delay-300"}),null),u})()},get children(){return i()?.balloonMessage}})),Q(()=>Ze(c,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(i()?.style.position==="left"?" left-9":" right-9"))),c}})]}})},get children(){return p(ye,{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(yp,{size:30}),Tp()]}})}}),null),Q(()=>Ze(l,"max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(i()?.style.position==="left"?" left-5 items-start":" right-5 items-end"))),l})()};var $p=L('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Fp=({children:e})=>{const{chatWidget:t}=ee(),n={};return t()?.style.width&&(n.width=`min(100%, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=$p();return xo(r,n),A(r,e),r})()};var Np=L("<div id=smarttalks-widget>");const Kp=({children:e})=>{const{chatWidget:t}=ee();return(()=>{var n=Np();return A(n,e),Q(()=>Ze(n,"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"+(t()?.style.position==="left"?" left-5":" right-5"))),n})()};var Bp=L('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const no=()=>(()=>{var e=Bp();return A(e,p(tc,{size:45,class:"animate-spin"})),e})(),zp=()=>{const{chatWidget:e}=ee(),{loading:t}=Xe();return _t(async()=>{e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay))}),p(Rp,{get openIcon(){return p(Jo,{get src(){return e()?.avatar}})},get children(){return[p(J,{get when(){return t()},get children(){return p(no,{})}}),p(jr,{}),p(eo,{}),p(to,{})]}})},Vp=()=>{const{loading:e}=Xe();return p(Kp,{get children(){return[p(J,{get when(){return e()},get children(){return p(no,{})}}),p(jr,{}),p(eo,{}),p(to,{})]}})},Up=()=>{const{loading:e}=Xe();return p(Fp,{get children(){return[p(J,{get when(){return e()},get children(){return p(no,{})}}),p(jr,{}),p(eo,{}),p(to,{})]}})},jp=()=>{const{chatWidget:e}=ee(),t=ya(async()=>(e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay)),{default:Vp}));return p(wo,{get children(){return[p(Pt,{get when(){return e()?.mode==="standard"},get children(){return p(zp,{})}}),p(Pt,{get when(){return e()?.mode==="popup"},get children(){return p(t,{})}}),p(Pt,{get when(){return e()?.mode==="static"},get children(){return p(Up,{})}})]}})};var Hp=L("<div><div>Form");const qp=()=>{const{formWidget:e}=ee();return(()=>{var t=Hp();return t.firstChild,A(t,()=>e()?._id,null),t})()};function Wp(){const{widget:e}=ee();return p(wo,{get children(){return[p(Pt,{get when(){return e()?.type==="chat"},get children(){return p(jp,{})}}),p(Pt,{get when(){return e()?.type==="form"},get children(){return p(qp,{})}})]}})}var Gp=L("<style>"),Yp=L("<div>");const Xp=({id:e,settings:t,side:n})=>{const{setWidgetId:r}=ee(),o=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"");return r(o),[(()=>{var i=Gp();return A(i,ja),i})(),(()=>{var i=Yp();return A(i,p(Wp,{})),i})()]};(()=>{typeof window>"u"||Ua("smarttalks-widget",{id:"",settings:!1,side:void 0},Xp)})()});
|