@smarttalks.ai/widget 0.14.0 → 0.17.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.
Files changed (3) hide show
  1. package/lib/index.js +10664 -3940
  2. package/lib/index.umd.cjs +28 -28
  3. package/package.json +7 -7
package/lib/index.umd.cjs CHANGED
@@ -1,10 +1,10 @@
1
- (function(Tt){typeof define=="function"&&define.amd?define(Tt):Tt()})(function(){"use strict";function Tt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Tt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function po(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tt(e))&&(r&&(r+=" "),r+=t);return r}const jn="-",ca=e=>{const t=da(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(jn);return a[0]===""&&a.length!==1&&a.shift(),mo(a,t)||ua(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},mo=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?mo(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(jn);return t.validators.find(({validator:s})=>s(i))?.classGroupId},yo=/^\[(.+)\]$/,ua=e=>{if(yo.test(e)){const t=yo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},da=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ha(Object.entries(e.classGroups),n).forEach(([i,s])=>{qn(s,r,i,t)}),r},qn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:bo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(fa(o)){qn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{qn(s,bo(t,i),n,r)})})},bo=(e,t)=>{let n=e;return t.split(jn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},fa=e=>e.isThemeGetter,ha=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,ga=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},wo="!",pa=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,d=0,u;for(let m=0;m<a.length;m++){let b=a[m];if(c===0){if(b===o&&(r||a.slice(m,m+i)===t)){l.push(a.slice(d,m)),d=m+i;continue}if(b==="/"){u=m;continue}}b==="["?c++:b==="]"&&c--}const f=l.length===0?a:a.substring(d),g=f.startsWith(wo),h=g?f.substring(1):f,p=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},ma=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},ya=e=>({cache:ga(e.cacheSize),parseClassName:pa(e),...ca(e)}),ba=/\s+/,wa=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(ba);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:g}=n(c);let h=!!g,p=r(h?f.substring(0,g):f);if(!p){if(!h){a=c+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=c+(a.length>0?" "+a:a);continue}h=!1}const m=ma(d).join(":"),b=u?m+wo:m,w=b+p;if(i.includes(w))continue;i.push(w);const v=o(p,h);for(let x=0;x<v.length;++x){const _=v[x];i.push(b+_)}a=c+(a.length>0?" "+a:a)}return a};function va(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vo(t))&&(r&&(r+=" "),r+=n);return r}const vo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vo(e[r]))&&(n&&(n+=" "),n+=t);return n};function xa(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,u)=>u(d),e());return n=ya(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=wa(l,n);return o(l,d),d}return function(){return i(va.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},xo=/^\[(?:([a-z-]+):)?(.+)\]$/i,Sa=/^\d+\/\d+$/,ka=new Set(["px","full","screen"]),Ea=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ca=/\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$/,Oa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_a=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pa=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ut(e)||ka.has(e)||Sa.test(e),He=e=>dt(e,"length",Fa),ut=e=>!!e&&!Number.isNaN(Number(e)),Hn=e=>dt(e,"number",ut),Lt=e=>!!e&&Number.isInteger(Number(e)),Aa=e=>e.endsWith("%")&&ut(e.slice(0,-1)),N=e=>xo.test(e),We=e=>Ea.test(e),Ta=new Set(["length","size","percentage"]),La=e=>dt(e,Ta,So),Ma=e=>dt(e,"position",So),Da=new Set(["image","url"]),Ia=e=>dt(e,Da,Na),Ra=e=>dt(e,"",$a),Mt=()=>!0,dt=(e,t,n)=>{const r=xo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Fa=e=>Ca.test(e)&&!Oa.test(e),So=()=>!1,$a=e=>_a.test(e),Na=e=>Pa.test(e),Ka=xa(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),i=X("borderRadius"),s=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),f=X("gap"),g=X("gradientColorStops"),h=X("gradientColorStopPositions"),p=X("inset"),m=X("margin"),b=X("opacity"),w=X("padding"),v=X("saturate"),x=X("scale"),_=X("sepia"),E=X("skew"),k=X("space"),F=X("translate"),P=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",N,t],I=()=>[N,t],re=()=>["",Ne,He],Y=()=>["auto",ut,N],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",N],At=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[ut,N];return{cacheSize:500,separator:":",theme:{colors:[Mt],spacing:[Ne,He],blur:["none","",We,N],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",We,N],borderSpacing:I(),borderWidth:re(),contrast:Ae(),grayscale:se(),hueRotate:Ae(),invert:se(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Aa,He],inset:M(),margin:M(),opacity:Ae(),padding:I(),saturate:Ae(),scale:Ae(),sepia:se(),skew:Ae(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":At()}],"break-before":[{"break-before":At()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...fe(),N]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],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",Lt,N]}],basis:[{basis:M()}],"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:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Lt,N]}],"grid-cols":[{"grid-cols":[Mt]}],"col-start-end":[{col:["auto",{span:["full",Lt,N]},N]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Mt]}],"row-start-end":[{row:["auto",{span:[Lt,N]},N]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"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:[We]},We]}],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",We,He]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hn]}],"font-family":[{font:[Mt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",ut,Hn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ne,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":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ne,He]}],"underline-offset":[{"underline-offset":["auto",Ne,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:I()}],"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":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),Ma]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",La]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ia]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Ne,N]}],"outline-w":[{outline:[Ne,He]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ne,He]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,Ra]}],"shadow-color":[{shadow:[Mt]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",We,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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:Ae()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ae()}],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:[Lt,N]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ne,He,Hn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Ge(...e){return Ka(po(e))}function za(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",Xt(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Xt(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Xt(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Xt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Xt(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Ba(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 Va(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 Jt(){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 Ua={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"),Ua[n][e]}const Zt="https://heimdall.smarttalks.ai/api",ja="wss://heimdall.smarttalks.ai",ko="smarttalkswidget";function ee(e,...t){window.postMessage({from:ko,command:e,args:t})}function ne(e,t){window.addEventListener("message",n=>{n.data?.from===ko&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function qa(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ee("registerContactData",e)},open:e=>{ee("open"),e&&ee("setInput",e)},close:()=>{ee("close")},toggle:()=>{ee("toggle")},toggleFullscreen:()=>{ee("toggleFullscreen")},reset:()=>{ee("reset")},onOpen:e=>{ne("onOpen",e)},onClose:e=>{ne("onClose",e)},onToggle:e=>{ne("onToggle",e)},onReset:e=>{ne("onReset",e)},onInput:e=>{ne("onInput",e)},onAnswer:e=>{ne("onAnswer",e)},onLoad:e=>{ne("onLoad",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Co(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Ha(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Po(o.value)&&!Ja(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 Wa(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Po(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Xa(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Ga(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Ya(e,t){const n=Ha(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?Oo(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&_o(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&&_o(this,i.attribute,i.value,!!i.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function Oo(e){if(e)try{return JSON.parse(e)}catch{return e}}function _o(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 Xa(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Po(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Ja(e){return Object.prototype.toString.call(e)==="[object Function]"}function Za(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Wn;function Qa(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=Ya(this,t);const o=Ga(this.props),i=this.Component,s=Wn;try{Wn=this,this.__initialized=!0,Za(i)?new i(o,{element:this}):i(o,{element:this})}finally{Wn=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 el(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Qa(r,Wa(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const z={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Ao(this.context.count)},getNextContextId(){return Ao(this.context.count++)}};function Ao(e){const t=String(e),n=t.length-1;return z.context.id+(n?String.fromCharCode(96+n):"")+t}function tl(e){z.context=e}const nl=!1,rl=(e,t)=>e===t,be=Symbol("solid-proxy"),To=typeof Proxy=="function",Gn=Symbol("solid-track"),Qt={equals:rl};let Lo=$o;const Ke=1,en=2,Mo={owned:null,cleanups:null,context:null,owner:null},Yn={};var q=null;let Xn=null,ol=null,W=null,ae=null,ze=null,tn=0;function Be(e,t){const n=W,r=q,o=e.length===0,i=t===void 0?r:t,s=o?Mo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>H(()=>Dt(s)));q=s,W=null;try{return Ve(a,!0)}finally{W=n,q=r}}function O(e,t){t=t?Object.assign({},Qt,t):Qt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Fo(n,o));return[Ro.bind(n),r]}function Do(e,t,n){const r=nn(e,t,!0,Ke);gt(r)}function oe(e,t,n){const r=nn(e,t,!1,Ke);gt(r)}function T(e,t,n){Lo=dl;const r=nn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),ze?ze.push(r):gt(r)}function C(e,t,n){n=n?Object.assign({},Qt,n):Qt;const r=nn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,gt(r),Ro.bind(r)}function il(e){return e&&typeof e=="object"&&"then"in e}function sl(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Yn,l=null,c=!1,d="initialValue"in i,u=typeof r=="function"&&C(r);const f=new Set,[g,h]=(i.storage||O)(i.initialValue),[p,m]=O(void 0),[b,w]=O(void 0,{equals:!1}),[v,x]=O(d?"ready":"unresolved");z.context&&(l=z.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:z.load&&z.has(l)&&(a=z.load(l)));function _(P,R,M,I){return s===P&&(s=null,I!==void 0&&(d=!0),(P===a||R===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(I,{value:R})),a=Yn,E(R,M)),R}function E(P,R){Ve(()=>{R===void 0&&h(()=>P),x(R!==void 0?"errored":d?"ready":"unresolved"),m(R);for(const M of f.keys())M.decrement();f.clear()},!1)}function k(){const P=ll,R=g(),M=p();if(M!==void 0&&!s)throw M;return W&&W.user,R}function F(P=!0){if(P!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){_(s,H(g));return}const M=a!==Yn?a:H(()=>o(R,{value:g(),refetching:P}));return il(M)?(s=M,"value"in M?(M.status==="success"?_(s,M.value,void 0,R):_(s,void 0,Qn(M.value),R),M):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),w()},!1),M.then(I=>_(M,I,void 0,R),I=>_(M,void 0,Qn(I),R)))):(_(s,M,void 0,R),M)}return Object.defineProperties(k,{state:{get:()=>v()},error:{get:()=>p()},loading:{get(){const P=v();return P==="pending"||P==="refreshing"}},latest:{get(){if(!d)return k();const P=p();if(P&&!s)throw P;return g()}}}),u?Do(()=>F(!1)):F(!1),[k,{refetch:F,mutate:h}]}function ke(e){return Ve(e,!1)}function H(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function tt(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i)return i=!1,s;const l=H(()=>t(a,o,s));return o=a,l}}function ht(e){T(()=>H(e))}function K(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Jn(){return W}function Io(){return q}function al(e,t){const n=q,r=W;q=e,W=null;try{return Ve(t,!0)}catch(o){er(o)}finally{q=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:fl(n),defaultValue:e}}function he(e){let t;return q&&q.context&&(t=q.context[e.id])!==void 0?t:e.defaultValue}function Zn(e){const t=C(e),n=C(()=>tr(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let ll;function Ro(){if(this.sources&&this.state)if(this.state===Ke)gt(this);else{const e=ae;ae=null,Ve(()=>on(this),!1),ae=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function Fo(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Xn&&Xn.running;s&&Xn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?ae.push(i):ze.push(i),i.observers&&No(i)),s||(i.state=Ke)}if(ae.length>1e6)throw ae=[],new Error},!1)),t}function gt(e){if(!e.fn)return;Dt(e);const t=tn;cl(e,e.value,t)}function cl(e,t,n){let r;const o=q,i=W;W=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Dt),e.owned=null),e.updatedAt=n+1,er(s)}finally{W=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Fo(e,r):e.value=r,e.updatedAt=n)}function nn(e,t,n,r=Ke,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==Mo&&(q.owned?q.owned.push(i):q.owned=[i]),i}function rn(e){if(e.state===0)return;if(e.state===en)return on(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<tn);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)gt(e);else if(e.state===en){const r=ae;ae=null,Ve(()=>on(e,t[0]),!1),ae=r}}function Ve(e,t){if(ae)return e();let n=!1;t||(ae=[]),ze?n=!0:ze=[],tn++;try{const r=e();return ul(n),r}catch(r){n||(ze=null),ae=null,er(r)}}function ul(e){if(ae&&($o(ae),ae=null),e)return;const t=ze;ze=null,t.length&&Ve(()=>Lo(t),!1)}function $o(e){for(let t=0;t<e.length;t++)rn(e[t])}function dl(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rn(r)}if(z.context){if(z.count){z.effects||(z.effects=[]),z.effects.push(...e.slice(0,n));return}tl()}for(z.effects&&(z.done||!z.count)&&(e=[...z.effects,...e],n+=z.effects.length,delete z.effects),t=0;t<n;t++)rn(e[t])}function on(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Ke?r!==t&&(!r.updatedAt||r.updatedAt<tn)&&rn(r):o===en&&on(r,t)}}}function No(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=en,n.pure?ae.push(n):ze.push(n),n.observers&&No(n))}}function Dt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dt(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 Qn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function er(e,t=q){throw Qn(e)}function tr(e){if(typeof e=="function"&&!e.length)return tr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=tr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function fl(e,t){return function(r){let o;return oe(()=>o=H(()=>(q.context={...q.context,[e]:r.value},Zn(()=>r.children))),void 0),o}}const hl=Symbol("fallback");function Ko(e){for(let t=0;t<e.length;t++)e[t]()}function gl(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return K(()=>Ko(i)),()=>{let l=e()||[],c=l.length,d,u;return l[Gn],H(()=>{let g,h,p,m,b,w,v,x,_;if(c===0)s!==0&&(Ko(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[hl],o[0]=Be(E=>(i[0]=E,n.fallback())),s=1);else if(s===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=Be(f);s=c}else{for(p=new Array(c),m=new Array(c),a&&(b=new Array(c)),w=0,v=Math.min(s,c);w<v&&r[w]===l[w];w++);for(v=s-1,x=c-1;v>=w&&x>=w&&r[v]===l[x];v--,x--)p[x]=o[v],m[x]=i[v],a&&(b[x]=a[v]);for(g=new Map,h=new Array(x+1),u=x;u>=w;u--)_=l[u],d=g.get(_),h[u]=d===void 0?-1:d,g.set(_,u);for(d=w;d<=v;d++)_=r[d],u=g.get(_),u!==void 0&&u!==-1?(p[u]=o[d],m[u]=i[d],a&&(b[u]=a[d]),u=h[u],g.set(_,u)):i[d]();for(u=w;u<c;u++)u in p?(o[u]=p[u],i[u]=m[u],a&&(a[u]=b[u],a[u](u))):o[u]=Be(f);o=o.slice(0,s=c),r=l.slice(0)}return o});function f(g){if(i[u]=g,a){const[h,p]=O(u);return a[u]=p,t(l[u],h)}return t(l[u])}}}function y(e,t){return H(()=>e(t||{}))}function sn(){return!0}const nr={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return t===be?!0:e.has(t)},set:sn,deleteProperty:sn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:sn,deleteProperty:sn}},ownKeys(e){return e.keys()}};function rr(e){return(e=typeof e=="function"?e():e)?e:{}}function pl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function L(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&be in a,e[s]=typeof a=="function"?(t=!0,C(a)):a}if(To&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=rr(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in rr(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(rr(e[a])));return[...new Set(s)]}},nr);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:pl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const f=n[d];f&&(u.get?f.push(u.get.bind(a)):u.value!==void 0&&f.push(()=>u.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(To&&be in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},nr));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))}},nr)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let ml=0;function Te(){return z.context?z.getNextContextId():`cl-${ml++}`}const zo=e=>`Stale read from <${e}>.`;function pt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return C(gl(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(o,i)=>!o==!i});return C(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?H(()=>i(t?o:()=>{if(!H(r))throw zo("Show");return n()})):i}return e.fallback},void 0,void 0)}function Bo(e){const t=Zn(()=>e.children),n=C(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,l=o[s],c=i,d=C(()=>c()?void 0:l.when,void 0,void 0),u=l.keyed?d:C(d,void 0,{equals:(f,g)=>!f==!g});i=()=>c()||(u()?[a,d,l]:void 0)}return i});return C(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?H(()=>a(s.keyed?i():()=>{if(H(n)()?.[0]!==o)throw zo("Match");return i()})):a},void 0,void 0)}function It(e){return e}const yl=["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"],bl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...yl]),wl=new Set(["innerHTML","textContent","innerText","children"]),vl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),xl=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 Sl(e,t){const n=xl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const kl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),El=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Cl={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Ol(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!c){c=new Map;let u=a;for(;u<i;)c.set(n[u],u++)}const d=c.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,f=1,g;for(;++u<o&&u<i&&!((g=c.get(t[u]))==null||g!==d+f);)f++;if(f>d-a){const h=t[s];for(;a<d;)e.insertBefore(n[a++],h)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Vo="_$DX_DELEGATE";function D(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function _l(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,Rl))}}function ue(e,t,n){ot(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Pl(e,t,n,r){ot(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Al(e,t,n){ot(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function nt(e,t){ot(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Tl(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Ll(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]||(Uo(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||(Uo(e,a,!0),n[a]=l)}return n}function an(e,t,n){if(!t)return n?ue(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function rt(e,t={},n,r){const o={};return r||oe(()=>o.children=Rt(e,t.children,o.children)),oe(()=>typeof t.ref=="function"&&or(t.ref,e)),oe(()=>Ml(e,t,n,!0,o,!0)),o}function or(e,t,n){return H(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Rt(e,t,r,n);oe(o=>Rt(e,t(),o,n),r)}function Ml(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=jo(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=jo(e,s,a,o[s],n,i,t)}}function Dl(e){let t,n;return!ot()||!(t=z.registry.get(n=Fl()))?e():(z.completed&&z.completed.add(t),z.registry.delete(n),t)}function ot(e){return!!z.context&&!z.done&&(!e||e.isConnected)}function Il(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Uo(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 jo(e,t,n,r,o,i,s){let a,l,c,d,u;if(t==="style")return an(e,n,r);if(t==="classList")return Ll(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),g=kl.has(f);if(!g&&r){const h=Array.isArray(r)?r[0]:r;e.removeEventListener(f,h)}(g||n)&&(Tl(e,f,n,g),g&&_l([f]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Al(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=wl.has(t))||!o&&((d=Sl(t,e.tagName))||(l=bl.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(u)t=t.slice(5),l=!0;else if(ot(e))return n;t==="class"||t==="className"?nt(e,n):a&&!l&&!c?e[Il(t)]=n:e[d||t]=n}else{const f=o&&t.indexOf(":")>-1&&Cl[t.split(":")[0]];f?Pl(e,f,t,n):ue(e,vl[t]||t,n)}return n}function Rl(e){if(z.registry&&z.events&&z.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),z.registry&&!z.done&&(z.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Rt(e,t,n,r,o){const i=ot(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=mt(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=mt(e,n,r)}else{if(s==="function")return oe(()=>{let l=t();for(;typeof l=="function";)l=l();n=Rt(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(ir(l,t,n,o))return oe(()=>n=Rt(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const u=[d];for(;(d=d.nextSibling)!==r;)u.push(d);return n=u}if(l.length===0){if(n=mt(e,n,r),a)return n}else c?n.length===0?qo(e,l,r):Ol(e,n,l):(n&&mt(e),qo(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=mt(e,n,r,t);mt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ir(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=ir(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=ir(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function qo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function mt(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 Fl(){return z.getNextContextId()}const $l=!1,Nl="http://www.w3.org/2000/svg";function Ho(e,t=!1){return t?document.createElementNS(Nl,e):document.createElement(e)}function Wo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Io();let i,s=!!z.context;return T(()=>{s&&(Io().user=s=!1),i||(i=al(o,()=>C(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=O(!1),d=()=>c(!0);Be(u=>A(a,()=>l()?u():i(),null)),K(d)}else{const l=Ho(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Kl(e,t){const n=C(e);return C(()=>{const r=n();switch(typeof r){case"function":return H(()=>r(t));case"string":const o=El.has(r),i=z.context?Dl():Ho(r,o);return rt(i,t,o),i}})}function ln(e){const[,t]=j(e,["component"]);return Kl(()=>e.component,t)}function zl(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=O(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function Bl(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 Vl(e){return(t,n)=>{const{element:r}=n;return Be(o=>{const i=zl(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},Bl(r))}}function Ul(e,t,n){return arguments.length===2&&(n=t,t={}),el(e,t)(Vl(n))}const jl='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.box-border{box-sizing:border-box}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-full{width:100%;height:100%}.h-10{height:40px}.h-11{height:44px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[44px\\]{height:44px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[44px\\]{min-height:44px}.w-11\\/12{width:91.666667%}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[44px\\]{width:44px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.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))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.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-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.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-t{border-top-width:1px}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-6{padding-top:24px;padding-bottom:24px}.pb-2{padding-bottom:8px}.pb-\\[\\.\\.\\.\\]{padding-bottom:...}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.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}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@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}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--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: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media (max-width: 640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.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-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\: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))}',[Go,sr]=O(!1),Yo=[],ql=e=>Yo.push(e),Xo=()=>{Yo.forEach(e=>e())},Hl=()=>{const e=!Go();sr(e),ee("onToggle"),ee(e?"onOpen":"onClose"),Xo()},Wl=()=>{sr(!1),ee("onClose")},Gl=()=>{sr(!0),ee("onOpen"),Xo()},Jo=()=>({bubble:Go,show:Gl,hide:Wl,toggle:Hl,onOpen:ql}),ar=Symbol("store-raw"),yt=Symbol("store-node"),Ue=Symbol("store-has"),Zo=Symbol("store-self");function Qo(e){let t=e[be];if(!t&&(Object.defineProperty(e,be,{value:t=new Proxy(e,Jl)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function cn(e){let t;return e!=null&&typeof e=="object"&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ft(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ar])return n;if(!cn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=Ft(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=Ft(o,t))!==o&&(e[i]=r))}return e}function un(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function $t(e,t,n){if(e[t])return e[t];const[r,o]=O(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Yl(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===be||t===yt||(delete n.value,delete n.writable,n.get=()=>e[be][t]),n}function ei(e){Jn()&&$t(un(e,yt),Zo)()}function Xl(e){return ei(e),Reflect.ownKeys(e)}const Jl={get(e,t,n){if(t===ar)return e;if(t===be)return n;if(t===Gn)return ei(e),n;const r=un(e,yt),o=r[t];let i=o?o():e[t];if(t===yt||t===Ue||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Jn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=$t(r,t,i)())}return cn(i)?Qo(i):i},has(e,t){return t===ar||t===be||t===Gn||t===yt||t===Ue||t==="__proto__"?!0:(Jn()&&$t(un(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Xl,getOwnPropertyDescriptor:Yl};function dn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Ue]&&e[Ue][t]&&o!==void 0&&e[Ue][t].$()):(e[t]=n,e[Ue]&&e[Ue][t]&&o===void 0&&e[Ue][t].$());let s=un(e,yt),a;if((a=$t(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=$t(s,"length",i))&&a.$(e.length)}(a=s[Zo])&&a.$()}function ti(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];dn(e,o,t[o])}}function Zl(e,t){if(typeof t=="function"&&(t=t(e)),t=Ft(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&dn(e,n,o)}dn(e,"length",r)}else ti(e,t)}function Nt(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++)Nt(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Nt(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:d=1}=r;for(let u=l;u<=c;u+=d)Nt(e,[u].concat(t),n);return}else if(t.length>1){Nt(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=Ft(i),r===void 0||cn(o)&&cn(i)&&!Array.isArray(i)?ti(o,i):dn(e,r,i))}function Ql(...[e,t]){const n=Ft(e||{}),r=Array.isArray(n),o=Qo(n);function i(...s){ke(()=>{r&&s.length===1?Zl(n,s[0]):Nt(n,s)})}return[o,i]}function ni(e,t,n){return Be(()=>{const r=Co(e),[o,i]=Ql(r?JSON.parse(r):t);return T(()=>Eo(e,JSON.stringify(o),n)),[o,i]})}function ec(e,t,n){return Be(()=>{const r=Co(e),[o,i]=O(r?JSON.parse(r):t);return T(()=>Eo(e,JSON.stringify(o()),n)),[o,i]})}const[pm,mm]=ec("smarttalks-widget-lang","en");function tc(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 nc(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 rc=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Zt}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return tc(i);if(i.type==="entity")return nc(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return ne("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Zt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),i._id=n,i},[ri,oc]=O(""),[it]=Be(()=>sl(ri,rc)),ic=()=>{if(it()?.type==="chat")return it()},sc=()=>{if(it()?.type==="form")return it()},lr=()=>{const e=it();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Be(()=>T(()=>{const e=it();za(e),e&&(ee("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const ie=()=>({widgetId:ri,setWidgetId:oc,widget:it,chatWidget:ic,formWidget:sc,getSessionId:lr}),oi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ii=po,ac=(e,t)=>n=>{var r;if(t?.variants==null)return ii(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=n?.[c],u=i?.[c];if(d===null)return null;const f=oi(d)||oi(u);return o[c][f]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,f]=d;return f===void 0||(c[u]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:f,...g}=d;return Object.entries(g).every(h=>{let[p,m]=h;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...c,u,f]:c},[]);return ii(e,s,l,n?.class,n?.className)};var lc=D("<button>");const cc=ac("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"}}),Ee=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=lc();return rt(n,L({get class(){return Ge(cc({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var uc=D('<img alt="widget logo">');const si=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=uc();return rt(n,L({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var dc=D('<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 fc=()=>{const{chatWidget:e}=ie(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=dc(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return A(r,y(si,{get src(){return e()?.avatar}}),o),A(i,t),A(s,n),r})()};var hc=D("<svg stroke-width=0>");function we(e,t){const n=L(e.a,t),[r,o]=j(n,["src"]),[i,s]=O(""),a=C(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return T(()=>s(a())),K(()=>{s("")}),(()=>{var l=hc();return rt(l,L({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,()=>$l),l})()}function gc(e){return we({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 pc(e){return we({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 mc(e){return we({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 yc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const cr={equals:!1};function ai(e){return(...t)=>{for(const n of e)n&&n(...t)}}function bc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,li=e=>Array.isArray(e)?e:e?[e]:[];function wc(e,...t){return typeof e=="function"?e(...t):e}const vc=K;function xc(e,t,n,r){return e.addEventListener(t,n,r),vc(e.removeEventListener.bind(e,t,n,r))}function Sc(e,t,n,r){const o=()=>{li(S(e)).forEach(i=>{i&&li(S(t)).forEach(s=>xc(i,s,n,r))})};typeof e=="function"?T(o):oe(o)}function fn(){return!0}const kc={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return e.has(t)},set:fn,deleteProperty:fn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:fn,deleteProperty:fn}},ownKeys(e){return e.keys()}},Ec=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ci(e){const t={};let n;for(;n=Ec.exec(e);)t[n[1]]=n[2];return t}function Cc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ci(e)}else typeof t=="string"&&(t=ci(t));return{...e,...t}}const ur=(e,t,n)=>{let r;for(const o of e){const i=S(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Oc(...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?bc:ai,o={};for(const s of n){const a=S(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const i=L(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ur(n,"style",Cc);if(s==="ref"){const a=[];for(const l of n){const c=S(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?ur(n,s,(a,l)=>`${a} ${l}`):s==="classList"?ur(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},kc)}function st(...e){return ai(e)}function _c(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function dr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pc(e){return typeof e=="number"}function Ac(e){return Array.isArray(e)}function bt(e){return Object.prototype.toString.call(e)==="[object String]"}function Tc(e){return typeof e=="function"}function ui(e){return t=>`${e()}-${t}`}function Le(e,t){return e?e===t||e.contains(t):!1}function Kt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(di(n)&&n.contentDocument)return Kt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function di(e){return e.tagName==="IFRAME"}var fi=(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))(fi||{});function fr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function hn(){return fr(/^Mac/i)}function Lc(){return fr(/^iPhone/i)}function Mc(){return fr(/^iPad/i)||hn()&&navigator.maxTouchPoints>1}function Dc(){return Lc()||Mc()}function Ic(){return hn()||Dc()}function ge(e,t){return t&&(Tc(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ve(e){return t=>{for(const n of e)ge(t,n)}}function Rc(e){return hn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Fc())e.focus({preventScroll:!0});else{const t=$c(e);e.focus(),Nc(t)}}var gn=null;function Fc(){if(gn==null){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch{}}return gn}function $c(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 Nc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var hi=["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'])"],Kc=[...hi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],hr=`${hi.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,zc=Kc.join(':not([hidden]):not([tabindex="-1"]),');function gi(e,t){const r=Array.from(e.querySelectorAll(hr)).filter(pi);return t&&pi(e)&&r.unshift(e),r.forEach((o,i)=>{if(di(o)&&o.contentDocument){const s=o.contentDocument.body,a=gi(s,!1);r.splice(i,1,...a)}}),r}function pi(e){return mi(e)&&!Bc(e)}function mi(e){return e.matches(hr)&&gr(e)}function Bc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function gr(e,t){return e.nodeName!=="#comment"&&Vc(e)&&Uc(e,t)&&(!e.parentElement||gr(e.parentElement,e))}function Vc(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 Uc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function jc(e,t,n){const r=t?.tabbable?zc:hr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&gr(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function yi(e){let t=e;for(;t&&!qc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function qc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Hc(){}function Wc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,d]=t[a],[u,f]=t[l],[,g]=t[l===0?s-1:l-1]||[0,0],h=(d-f)*(n-c)-(c-u)*(r-d);if(f<d){if(r>=f&&r<d){if(h===0)return!0;h>0&&(r===f?r>g&&(o=!o):o=!o)}}else if(d<f){if(r>d&&r<=f){if(h===0)return!0;h<0&&(r===f?r<g&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function Me(e,t){return L(e,t)}var zt=new Map,bi=new Set;function wi(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=zt.get(n.target);r||(r=new Set,zt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=zt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),zt.delete(n.target)),zt.size===0)){for(const o of bi)o();bi.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?wi():document.addEventListener("DOMContentLoaded",wi));function pr(e,t){const n=vi(e,t,"left"),r=vi(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function vi(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Gc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=yi(e);for(;e&&o&&e!==n&&o!==n;)pr(o,e),e=o,o=yi(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Yc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function mr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=bt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=bt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(bt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return bt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(bt(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 d=mr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...d),t+=d.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
1
+ (function(or){typeof define=="function"&&define.amd?define(or):or()})((function(){"use strict";function or(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=or(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ja(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=or(e))&&(r&&(r+=" "),r+=t);return r}const Oi="-",hh=e=>{const t=ph(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Oi);return a[0]===""&&a.length!==1&&a.shift(),Qa(a,t)||gh(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&r[s]?[...c,...r[s]]:c}}},Qa=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Qa(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Oi);return t.validators.find(({validator:s})=>s(i))?.classGroupId},ec=/^\[(.+)\]$/,gh=e=>{if(ec.test(e)){const t=ec.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ph=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return yh(Object.entries(e.classGroups),n).forEach(([i,s])=>{Ti(s,r,i,t)}),r},Ti=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:tc(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(mh(o)){Ti(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Ti(s,tc(t,i),n,r)})})},tc=(e,t)=>{let n=e;return t.split(Oi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mh=e=>e.isThemeGetter,yh=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,vh=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},nc="!",bh=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const c=[];let l=0,d=0,u;for(let m=0;m<a.length;m++){let y=a[m];if(l===0){if(y===o&&(r||a.slice(m,m+i)===t)){c.push(a.slice(d,m)),d=m+i;continue}if(y==="/"){u=m;continue}}y==="["?l++:y==="]"&&l--}const h=c.length===0?a:a.substring(d),g=h.startsWith(nc),f=g?h.substring(1):h,p=u&&u>d?u-d:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},wh=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},xh=e=>({cache:vh(e.cacheSize),parseClassName:bh(e),...hh(e)}),Sh=/\s+/,Eh=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Sh);let a="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:g}=n(l);let f=!!g,p=r(f?h.substring(0,g):h);if(!p){if(!f){a=l+(a.length>0?" "+a:a);continue}if(p=r(h),!p){a=l+(a.length>0?" "+a:a);continue}f=!1}const m=wh(d).join(":"),y=u?m+nc:m,b=y+p;if(i.includes(b))continue;i.push(b);const x=o(p,f);for(let w=0;w<x.length;++w){const C=x[w];i.push(y+C)}a=l+(a.length>0?" "+a:a)}return a};function Ph(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=rc(t))&&(r&&(r+=" "),r+=n);return r}const rc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ch(e,...t){let n,r,o,i=s;function s(c){const l=t.reduce((d,u)=>u(d),e());return n=xh(l),r=n.cache.get,o=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const d=Eh(c,n);return o(c,d),d}return function(){return i(Ph.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},oc=/^\[(?:([a-z-]+):)?(.+)\]$/i,kh=/^\d+\/\d+$/,Oh=new Set(["px","full","screen"]),Th=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ah=/\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$/,$h=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Dh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bt=e=>Pn(e)||Oh.has(e)||kh.test(e),Vt=e=>Cn(e,"length",Bh),Pn=e=>!!e&&!Number.isNaN(Number(e)),Ai=e=>Cn(e,"number",Pn),ir=e=>!!e&&Number.isInteger(Number(e)),Mh=e=>e.endsWith("%")&&Pn(e.slice(0,-1)),H=e=>oc.test(e),Bt=e=>Th.test(e),Ih=new Set(["length","size","percentage"]),_h=e=>Cn(e,Ih,ic),Lh=e=>Cn(e,"position",ic),Nh=new Set(["image","url"]),Fh=e=>Cn(e,Nh,zh),Vh=e=>Cn(e,"",Kh),sr=()=>!0,Cn=(e,t,n)=>{const r=oc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Bh=e=>Ah.test(e)&&!$h.test(e),ic=()=>!1,Kh=e=>Dh.test(e),zh=e=>Rh.test(e),Uh=Ch(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),a=ue("borderWidth"),c=ue("contrast"),l=ue("grayscale"),d=ue("hueRotate"),u=ue("invert"),h=ue("gap"),g=ue("gradientColorStops"),f=ue("gradientColorStopPositions"),p=ue("inset"),m=ue("margin"),y=ue("opacity"),b=ue("padding"),x=ue("saturate"),w=ue("scale"),C=ue("sepia"),S=ue("skew"),O=ue("space"),D=ue("translate"),P=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",H,t],$=()=>[H,t],K=()=>["",bt,Vt],U=()=>["auto",Pn,H],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",H],qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$e=()=>[Pn,H];return{cacheSize:500,separator:":",theme:{colors:[sr],spacing:[bt,Vt],blur:["none","",Bt,H],brightness:$e(),borderColor:[e],borderRadius:["none","","full",Bt,H],borderSpacing:$(),borderWidth:K(),contrast:$e(),grayscale:q(),hueRotate:$e(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Mh,Vt],inset:I(),margin:I(),opacity:$e(),padding:$(),saturate:$e(),scale:$e(),sepia:q(),skew:$e(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",H]}],container:["container"],columns:[{columns:[Bt]}],"break-after":[{"break-after":qe()}],"break-before":[{"break-before":qe()}],"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:[...Q(),H]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],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",ir,H]}],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",H]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",ir,H]}],"grid-cols":[{"grid-cols":[sr]}],"col-start-end":[{col:["auto",{span:["full",ir,H]},H]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[sr]}],"row-start-end":[{row:["auto",{span:[ir,H]},H]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",H]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",H]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"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:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",H,t]}],"min-w":[{"min-w":[H,t,"min","max","fit"]}],"max-w":[{"max-w":[H,t,"none","full","min","max","fit","prose",{screen:[Bt]},Bt]}],h:[{h:[H,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[H,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Bt,Vt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ai]}],"font-family":[{font:[sr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",H]}],"line-clamp":[{"line-clamp":["none",Pn,Ai]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bt,H]}],"list-image":[{"list-image":["none",H]}],"list-style-type":[{list:["none","disc","decimal",H]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bt,Vt]}],"underline-offset":[{"underline-offset":["auto",bt,H]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",H]}],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",H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),Lh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_h]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Fh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[y]}],"border-style":[{border:[...F(),"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":[y]}],"divide-style":[{divide:F()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[bt,H]}],"outline-w":[{outline:[bt,Vt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[bt,Vt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Bt,Vh]}],"shadow-color":[{shadow:[sr]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Bt,H]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",H]}],duration:[{duration:$e()}],ease:[{ease:["linear","in","out","in-out",H]}],delay:[{delay:$e()}],animate:[{animate:["none","spin","ping","pulse","bounce",H]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ir,H]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"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",H]}],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",H]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",H]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[bt,Vt,Ai]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Kt(...e){return Uh(Ja(e))}function Wh(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",jr(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",jr(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",jr(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",jr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function jr(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,c=0,l=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),l=(i+o)/2,c=s==0?0:s/(1-Math.abs(2*l-1)),c=+(c*100).toFixed(1),l=+(l*100).toFixed(1),a+","+c+"%,"+l+"%"}function jh(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 Hh(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 Hr(){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 Yh={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 kn(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"),Yh[n][e]}const ar="https://heimdall.smarttalks.ai/api",qh="wss://heimdall.smarttalks.ai",sc="smarttalkswidget";function he(e,...t){window.postMessage({from:sc,command:e,args:t})}function ge(e,t){window.addEventListener("message",n=>{n.origin===window.location.origin&&n.data?.from===sc&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function Gh(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{he("registerContactData",e)},registerMetadata:e=>{he("registerMetadata",e)},open:e=>{he("open"),e&&he("setInput",e)},close:()=>{he("close")},toggle:()=>{he("toggle")},toggleFullscreen:()=>{he("toggleFullscreen")},reset:()=>{he("reset")},onOpen:e=>{ge("onOpen",e)},onClose:e=>{ge("onClose",e)},onToggle:e=>{ge("onToggle",e)},onReset:e=>{ge("onReset",e)},onInput:e=>{ge("onInput",e)},onAnswer:e=>{ge("onAnswer",e)},onLoad:e=>{ge("onLoad",e)}})}function ac(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function cc(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 Xh(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),dc(o.value)&&!tg(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 Zh(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=dc(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=eg(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Jh(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Qh(e,t){const n=Xh(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?lc(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&uc(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){const l=i.value;i.value=c,i.reflect&&uc(this,i.attribute,i.value,!!i.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,c,l)},enumerable:!0,configurable:!0})}),n}function lc(e){if(e)try{return JSON.parse(e)}catch{return e}}function uc(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 eg(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function dc(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function tg(e){return Object.prototype.toString.call(e)==="[object Function]"}function ng(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let $i;function rg(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=Qh(this,t);const o=Jh(this.props),i=this.Component,s=$i;try{$i=this,this.__initialized=!0,ng(i)?new i(o,{element:this}):i(o,{element:this})}finally{$i=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?lc(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 og(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=rg(r,Zh(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const ig=!1,sg=(e,t)=>e===t,Ve=Symbol("solid-proxy"),fc=typeof Proxy=="function",Yr=Symbol("solid-track"),qr={equals:sg};let hc=bc;const wt=1,Gr=2,gc={owned:null,cleanups:null,context:null,owner:null},Di={};var te=null;let Ri=null,ag=null,se=null,be=null,xt=null,Xr=0;function Xe(e,t){const n=se,r=te,o=e.length===0,i=t===void 0?r:t,s=o?gc:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ne(()=>cr(s)));te=s,se=null;try{return St(a,!0)}finally{se=n,te=r}}function L(e,t){t=t?Object.assign({},qr,t):qr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),vc(n,o));return[yc.bind(n),r]}function pc(e,t,n){const r=Zr(e,t,!0,wt);On(r)}function me(e,t,n){const r=Zr(e,t,!1,wt);On(r)}function V(e,t,n){hc=gg;const r=Zr(e,t,!1,wt);(!n||!n.render)&&(r.user=!0),xt?xt.push(r):On(r)}function _(e,t,n){n=n?Object.assign({},qr,n):qr;const r=Zr(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,On(r),yc.bind(r)}function cg(e){return e&&typeof e=="object"&&"then"in e}function lg(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Di,c=!1,l="initialValue"in i,d=typeof r=="function"&&_(r);const u=new Set,[h,g]=(i.storage||L)(i.initialValue),[f,p]=L(void 0),[m,y]=L(void 0,{equals:!1}),[b,x]=L(l?"ready":"unresolved");function w(P,T,I,$){return s===P&&(s=null,$!==void 0&&(l=!0),(P===a||T===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated($,{value:T})),a=Di,C(T,I)),T}function C(P,T){St(()=>{T===void 0&&g(()=>P),x(T!==void 0?"errored":l?"ready":"unresolved"),p(T);for(const I of u.keys())I.decrement();u.clear()},!1)}function S(){const P=dg,T=h(),I=f();if(I!==void 0&&!s)throw I;return se&&se.user,T}function O(P=!0){if(P!==!1&&c)return;c=!1;const T=d?d():r;if(T==null||T===!1){w(s,ne(h));return}let I;const $=a!==Di?a:ne(()=>{try{return o(T,{value:h(),refetching:P})}catch(K){I=K}});if(I!==void 0){w(s,void 0,eo(I),T);return}else if(!cg($))return w(s,$,void 0,T),$;return s=$,"v"in $?($.s===1?w(s,$.v,void 0,T):w(s,void 0,eo($.v),T),$):(c=!0,queueMicrotask(()=>c=!1),St(()=>{x(l?"refreshing":"pending"),y()},!1),$.then(K=>w($,K,void 0,T),K=>w($,void 0,eo(K),T)))}Object.defineProperties(S,{state:{get:()=>b()},error:{get:()=>f()},loading:{get(){const P=b();return P==="pending"||P==="refreshing"}},latest:{get(){if(!l)return S();const P=f();if(P&&!s)throw P;return h()}}});let D=te;return d?pc(()=>(D=te,O(!1))):O(!1),[S,{refetch:P=>mc(D,()=>O(P)),mutate:g}]}function Ze(e){return St(e,!1)}function ne(e){if(se===null)return e();const t=se;se=null;try{return e()}finally{se=t}}function sn(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 l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(i)return i=!1,s;const c=ne(()=>t(a,o,s));return o=a,c}}function an(e){V(()=>ne(e))}function Y(e){return te===null||(te.cleanups===null?te.cleanups=[e]:te.cleanups.push(e)),e}function Mi(){return se}function ug(){return te}function mc(e,t){const n=te,r=se;te=e,se=null;try{return St(t,!0)}catch(o){_i(o)}finally{te=n,se=r}}function xe(e,t){const n=Symbol("context");return{id:n,Provider:pg(n),defaultValue:e}}function Ce(e){let t;return te&&te.context&&(t=te.context[e.id])!==void 0?t:e.defaultValue}function Ii(e){const t=_(e),n=_(()=>Li(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let dg;function yc(){if(this.sources&&this.state)if(this.state===wt)On(this);else{const e=be;be=null,St(()=>Qr(this),!1),be=e}if(se){const e=this.observers;if(!e||e[e.length-1]!==se){const t=e?e.length:0;se.sources?(se.sources.push(this),se.sourceSlots.push(t)):(se.sources=[this],se.sourceSlots=[t]),e?(e.push(se),this.observerSlots.push(se.sources.length-1)):(this.observers=[se],this.observerSlots=[se.sources.length-1])}}return this.value}function vc(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&St(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Ri&&Ri.running;s&&Ri.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?be.push(i):xt.push(i),i.observers&&wc(i)),s||(i.state=wt)}if(be.length>1e6)throw be=[],new Error},!1)),t}function On(e){if(!e.fn)return;cr(e);const t=Xr;fg(e,e.value,t)}function fg(e,t,n){let r;const o=te,i=se;se=te=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=wt,e.owned&&e.owned.forEach(cr),e.owned=null),e.updatedAt=n+1,_i(s)}finally{se=i,te=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?vc(e,r):e.value=r,e.updatedAt=n)}function Zr(e,t,n,r=wt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:te,context:te?te.context:null,pure:n};return te===null||te!==gc&&(te.owned?te.owned.push(i):te.owned=[i]),i}function Jr(e){if(e.state===0)return;if(e.state===Gr)return Qr(e);if(e.suspense&&ne(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Xr);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===wt)On(e);else if(e.state===Gr){const r=be;be=null,St(()=>Qr(e,t[0]),!1),be=r}}function St(e,t){if(be)return e();let n=!1;t||(be=[]),xt?n=!0:xt=[],Xr++;try{const r=e();return hg(n),r}catch(r){n||(xt=null),be=null,_i(r)}}function hg(e){if(be&&(bc(be),be=null),e)return;const t=xt;xt=null,t.length&&St(()=>hc(t),!1)}function bc(e){for(let t=0;t<e.length;t++)Jr(e[t])}function gg(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jr(r)}for(t=0;t<n;t++)Jr(e[t])}function Qr(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===wt?r!==t&&(!r.updatedAt||r.updatedAt<Xr)&&Jr(r):o===Gr&&Qr(r,t)}}}function wc(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Gr,n.pure?be.push(n):xt.push(n),n.observers&&wc(n))}}function cr(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)cr(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)cr(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 eo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function _i(e,t=te){throw eo(e)}function Li(e){if(typeof e=="function"&&!e.length)return Li(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Li(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function pg(e,t){return function(r){let o;return me(()=>o=ne(()=>(te.context={...te.context,[e]:r.value},Ii(()=>r.children))),void 0),o}}const Ni=Symbol("fallback");function to(e){for(let t=0;t<e.length;t++)e[t]()}function mg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Y(()=>to(i)),()=>{let c=e()||[],l=c.length,d,u;return c[Yr],ne(()=>{let g,f,p,m,y,b,x,w,C;if(l===0)s!==0&&(to(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Ni],o[0]=Xe(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(l),u=0;u<l;u++)r[u]=c[u],o[u]=Xe(h);s=l}else{for(p=new Array(l),m=new Array(l),a&&(y=new Array(l)),b=0,x=Math.min(s,l);b<x&&r[b]===c[b];b++);for(x=s-1,w=l-1;x>=b&&w>=b&&r[x]===c[w];x--,w--)p[w]=o[x],m[w]=i[x],a&&(y[w]=a[x]);for(g=new Map,f=new Array(w+1),u=w;u>=b;u--)C=c[u],d=g.get(C),f[u]=d===void 0?-1:d,g.set(C,u);for(d=b;d<=x;d++)C=r[d],u=g.get(C),u!==void 0&&u!==-1?(p[u]=o[d],m[u]=i[d],a&&(y[u]=a[d]),u=f[u],g.set(C,u)):i[d]();for(u=b;u<l;u++)u in p?(o[u]=p[u],i[u]=m[u],a&&(a[u]=y[u],a[u](u))):o[u]=Xe(h);o=o.slice(0,s=l),r=c.slice(0)}return o});function h(g){if(i[u]=g,a){const[f,p]=L(u);return a[u]=p,t(c[u],f)}return t(c[u])}}}function yg(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,c;return Y(()=>to(i)),()=>{const l=e()||[],d=l.length;return l[Yr],ne(()=>{if(d===0)return a!==0&&(to(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Ni],o[0]=Xe(h=>(i[0]=h,n.fallback())),a=1),o;for(r[0]===Ni&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<d;c++)c<r.length&&r[c]!==l[c]?s[c](()=>l[c]):c>=r.length&&(o[c]=Xe(u));for(;c<r.length;c++)i[c]();return a=s.length=i.length=d,r=l.slice(0),o=o.slice(0,a)});function u(h){i[c]=h;const[g,f]=L(l[c]);return s[c]=f,t(g,c)}}}function v(e,t){return ne(()=>e(t||{}))}function no(){return!0}const Fi={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return t===Ve?!0:e.has(t)},set:no,deleteProperty:no,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:no,deleteProperty:no}},ownKeys(e){return e.keys()}};function Vi(e){return(e=typeof e=="function"?e():e)?e:{}}function vg(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function N(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ve in a,e[s]=typeof a=="function"?(t=!0,_(a)):a}if(fc&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const c=Vi(e[a])[s];if(c!==void 0)return c}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Vi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Vi(e[a])));return[...new Set(s)]}},Fi);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let l=c.length-1;l>=0;l--){const d=c[l];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:vg.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const h=n[d];h&&(u.get?h.push(u.get.bind(a)):u.value!==void 0&&h.push(()=>u.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function J(e,...t){const n=t.length;if(fc&&Ve in e){const o=n>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)}},Fi));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Fi)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let c=0;c<t.length;c++)if(t[c].includes(o)){i=c;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let bg=0;function Be(){return`cl-${bg++}`}const xc=e=>`Stale read from <${e}>.`;function cn(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(mg(()=>e.each,e.children,t||void 0))}function Sc(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(yg(()=>e.each,e.children,t||void 0))}function ie(e){const t=e.keyed,n=_(()=>e.when,void 0,void 0),r=t?n:_(n,void 0,{equals:(o,i)=>!o==!i});return _(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?ne(()=>i(t?o:()=>{if(!ne(r))throw xc("Show");return n()})):i}return e.fallback},void 0,void 0)}function Ec(e){const t=Ii(()=>e.children),n=_(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],l=i,d=_(()=>l()?void 0:c.when,void 0,void 0),u=c.keyed?d:_(d,void 0,{equals:(h,g)=>!h==!g});i=()=>l()||(u()?[a,d,c]:void 0)}return i});return _(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?ne(()=>a(s.keyed?i():()=>{if(ne(n)()?.[0]!==o)throw xc("Match");return i()})):a},void 0,void 0)}function lr(e){return e}const wg=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],xg=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...wg]),Sg=new Set(["innerHTML","textContent","innerText","children"]),Eg=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Pg=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Cg(e,t){const n=Pg[e];return typeof n=="object"?n[t]?n.$:void 0:n}const kg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Og=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Tg={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},zt=e=>_(()=>e());function Ag(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,c=t[o-1].nextSibling,l=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:c;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!l){l=new Map;let u=a;for(;u<i;)l.set(n[u],u++)}const d=l.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,h=1,g;for(;++u<o&&u<i&&!((g=l.get(t[u]))==null||g!==d+h);)h++;if(h>d-a){const f=t[s];for(;a<d;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Pc="_$DX_DELEGATE";function j(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function $g(e,t=window.document){const n=t[Pc]||(t[Pc]=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,Ng))}}function ke(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Dg(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function Rg(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function ln(e,t){t==null?e.removeAttribute("class"):e.className=t}function Mg(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Ig(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]||(Cc(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(Cc(e,a,!0),n[a]=c)}return n}function ro(e,t,n){if(!t)return n?ke(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 un(e,t={},n,r){const o={};return r||me(()=>o.children=ur(e,t.children,o.children)),me(()=>typeof t.ref=="function"&&Bi(t.ref,e)),me(()=>_g(e,t,n,!0,o,!0)),o}function Bi(e,t,n){return ne(()=>e(t,n))}function B(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ur(e,t,r,n);me(o=>ur(e,t(),o,n),r)}function _g(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=kc(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=kc(e,s,a,o[s],n,i,t)}}function Lg(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Cc(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 kc(e,t,n,r,o,i,s){let a,c,l,d,u;if(t==="style")return ro(e,n,r);if(t==="classList")return Ig(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),g=kg.has(h);if(!g&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(g||n)&&(Mg(e,h,n,g),g&&$g([h]))}else if(t.slice(0,5)==="attr:")ke(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Rg(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=Sg.has(t))||!o&&((d=Cg(t,e.tagName))||(c=xg.has(t)))||(a=e.nodeName.includes("-")||"is"in s))u&&(t=t.slice(5),c=!0),t==="class"||t==="className"?ln(e,n):a&&!c&&!l?e[Lg(t)]=n:e[d||t]=n;else{const h=o&&t.indexOf(":")>-1&&Tg[t.split(":")[0]];h?Dg(e,h,t,n):ke(e,Eg[t]||t,n)}return n}function Ng(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),s=()=>{const c=t[n];if(c&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function ur(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(t=t.toString(),t===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=Tn(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=Tn(e,n,r);else{if(i==="function")return me(()=>{let a=t();for(;typeof a=="function";)a=a();n=ur(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(Ki(a,t,n,o))return me(()=>n=ur(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=Tn(e,n,r),s)return n}else c?n.length===0?Oc(e,a,r):Ag(e,n,a):(n&&Tn(e),Oc(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=Tn(e,n,r,t);Tn(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Ki(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],c=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Ki(e,a,c)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=Ki(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const d=String(a);c&&c.nodeType===3&&c.data===d?e.push(c):e.push(document.createTextNode(d))}}return o}function Oc(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Tn(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 c=a.parentNode===e;!i&&!s?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const Fg=!1,Vg="http://www.w3.org/2000/svg";function Tc(e,t=!1,n=void 0){return t?document.createElementNS(Vg,e):document.createElement(e,{is:n})}function Ac(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=ug();let i;return V(()=>{i||(i=mc(o,()=>_(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[a,c]=L(!1),l=()=>c(!0);Xe(d=>B(s,()=>a()?d():i(),null)),Y(l)}else{const a=Tc(e.isSVG?"g":"div",e.isSVG),c=t&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),B(c,i),s.appendChild(a),e.ref&&e.ref(a),Y(()=>s.removeChild(a))}},void 0,{render:!0}),n}function Bg(e,t){const n=_(e);return _(()=>{const r=n();switch(typeof r){case"function":return ne(()=>r(t));case"string":const o=Og.has(r),i=Tc(r,o,ne(()=>t.is));return un(i,t,o),i}})}function dr(e){const[,t]=J(e,["component"]);return Bg(()=>e.component,t)}function Kg(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 zg(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 Ug(e){return(t,n)=>{const{element:r}=n;return Xe(o=>{const i=Kg(t);r.addPropertyChangedCallback((a,c)=>i[a]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return B(r.renderRoot,s)},zg(r))}}function Wg(e,t,n){return arguments.length===2&&(n=t,t={}),og(e,t)(Ug(n))}const jg='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.box-border{box-sizing:border-box}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-full{width:100%;height:100%}.h-10{height:40px}.h-11{height:44px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[44px\\]{height:44px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[44px\\]{min-height:44px}.w-11\\/12{width:91.666667%}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[44px\\]{width:44px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.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))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.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-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.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-t{border-top-width:1px}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-6{padding-top:24px;padding-bottom:24px}.pb-2{padding-bottom:8px}.pb-\\[\\.\\.\\.\\]{padding-bottom:...}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.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}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.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))}.filter{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)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@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}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--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: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media(max-width:640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.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-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media(min-width:640px){.sm\\:text-left{text-align:left}}@media(min-width:768px){.md\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\: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))}',[$c,zi]=L(!1),Dc=[],Hg=e=>Dc.push(e),Rc=()=>{Dc.forEach(e=>e())},Yg=()=>{const e=!$c();zi(e),he("onToggle"),he(e?"onOpen":"onClose"),Rc()},qg=()=>{zi(!1),he("onClose")},Gg=()=>{zi(!0),he("onOpen"),Rc()},Mc=()=>({bubble:$c,show:Gg,hide:qg,toggle:Yg,onOpen:Hg}),Ui=Symbol("store-raw"),An=Symbol("store-node"),Et=Symbol("store-has"),Ic=Symbol("store-self");function _c(e){let t=e[Ve];if(!t&&(Object.defineProperty(e,Ve,{value:t=new Proxy(e,Jg)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const c=n[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(e,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(t)})}}return t}function oo(e){let t;return e!=null&&typeof e=="object"&&(e[Ve]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function fr(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Ui])return n;if(!oo(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=fr(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 c=0,l=s.length;c<l;c++)i=s[c],!a[i].get&&(o=e[i],(r=fr(o,t))!==o&&(e[i]=r))}return e}function io(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function hr(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 Xg(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Ve||t===An||(delete n.value,delete n.writable,n.get=()=>e[Ve][t]),n}function Lc(e){Mi()&&hr(io(e,An),Ic)()}function Zg(e){return Lc(e),Reflect.ownKeys(e)}const Jg={get(e,t,n){if(t===Ui)return e;if(t===Ve)return n;if(t===Yr)return Lc(e),n;const r=io(e,An),o=r[t];let i=o?o():e[t];if(t===An||t===Et||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Mi()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=hr(r,t,i)())}return oo(i)?_c(i):i},has(e,t){return t===Ui||t===Ve||t===Yr||t===An||t===Et||t==="__proto__"?!0:(Mi()&&hr(io(e,Et),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Zg,getOwnPropertyDescriptor:Xg};function so(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Et]&&e[Et][t]&&o!==void 0&&e[Et][t].$()):(e[t]=n,e[Et]&&e[Et][t]&&o===void 0&&e[Et][t].$());let s=io(e,An),a;if((a=hr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(a=s[c])&&a.$();(a=hr(s,"length",i))&&a.$(e.length)}(a=s[Ic])&&a.$()}function Nc(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Fc(o)||so(e,o,t[o])}}function Fc(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function Qg(e,t){if(typeof t=="function"&&(t=t(e)),t=fr(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&&so(e,n,o)}so(e,"length",r)}else Nc(e,t)}function gr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&Fc(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)gr(e,[r[c]].concat(t),n);return}else if(a&&s==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&gr(e,[c].concat(t),n);return}else if(a&&s==="object"){const{from:c=0,to:l=e.length-1,by:d=1}=r;for(let u=c;u<=l;u+=d)gr(e,[u].concat(t),n);return}else if(t.length>1){gr(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=fr(i),r===void 0||oo(o)&&oo(i)&&!Array.isArray(i)?Nc(o,i):so(e,r,i))}function ep(...[e,t]){const n=fr(e||{}),r=Array.isArray(n),o=_c(n);function i(...s){Ze(()=>{r&&s.length===1?Qg(n,s[0]):gr(n,s)})}return[o,i]}function Vc(e,t,n){return Xe(()=>{const r=cc(e),[o,i]=ep(r?JSON.parse(r):t);return V(()=>ac(e,JSON.stringify(o),n)),[o,i]})}function tp(e,t,n){return Xe(()=>{const r=cc(e),[o,i]=L(r?JSON.parse(r):t);return V(()=>ac(e,JSON.stringify(o()),n)),[o,i]})}const[QC,ek]=tp("smarttalks-widget-lang","en");function np(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 rp(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 ao={};function op(e){for(const[t,n]of Object.entries(e))n===null?ao[t]=null:ao[t]=n;return{...ao}}function ip(){const e=Object.entries(ao).filter(([,t])=>t!==void 0);if(e.length)return Object.fromEntries(e)}function sp(e){const t=new URLSearchParams(e),n={},r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];for(const o of r){const i=t.get(o);if(i){const s=o.replace(/_([a-z])/g,(a,c)=>c.toUpperCase());n[s]=i}}return n}function ap(){if(typeof window>"u")return{};const e={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,...sp(window.location.search)};try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}e.isMobile=String(/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)),e.viewportW=String(window.innerWidth),e.viewportH=String(window.innerHeight);const t=ip();t&&(e.custom=t);for(const n of Object.keys(e))(e[n]===void 0||e[n]==="")&&delete e[n];return e}const cp=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${ar}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return np(i);if(i.type==="entity")return rp(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return ge("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${ar}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),ge("registerMetadata",s=>{!s||!Object.keys(s).length||(op(s),fetch(`${ar}/v1/widget-metadata/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:s})}).catch(console.error))}),i._id=n,i},[Bc,lp]=L(""),[dn]=Xe(()=>lg(Bc,cp)),up=()=>{if(dn()?.type==="chat")return dn()},dp=()=>{if(dn()?.type==="form")return dn()},Wi=()=>{const e=dn();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Xe(()=>V(()=>{const e=dn();Wh(e),e&&(he("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const ye=()=>({widgetId:Bc,setWidgetId:lp,widget:dn,chatWidget:up,formWidget:dp,getSessionId:Wi}),Kc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,zc=Ja,fp=(e,t)=>n=>{var r;if(t?.variants==null)return zc(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(l=>{const d=n?.[l],u=i?.[l];if(d===null)return null;const h=Kc(d)||Kc(u);return o[l][h]}),a=n&&Object.entries(n).reduce((l,d)=>{let[u,h]=d;return h===void 0||(l[u]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:u,className:h,...g}=d;return Object.entries(g).every(f=>{let[p,m]=f;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...l,u,h]:l},[]);return zc(e,s,c,n?.class,n?.className)};var hp=j("<button>");const gp=fp("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"}}),Je=e=>{const[,t]=J(e,["variant","size","class"]);return(()=>{var n=hp();return un(n,N({get class(){return Kt(gp({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var pp=j('<img alt="widget logo">');const Uc=e=>{const[,t]=J(e,["class","src"]);return(()=>{var n=pp();return un(n,N({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Kt("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var mp=j('<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 yp=()=>{const{chatWidget:e}=ye(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=mp(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return B(r,v(Uc,{get src(){return e()?.avatar}}),o),B(i,t),B(s,n),r})()};var vp=j("<svg stroke-width=0>");function Ke(e,t){const n=N(e.a,t),[r,o]=J(n,["src"]),[i,s]=L(""),a=_(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return V(()=>s(a())),Y(()=>{s("")}),(()=>{var c=vp();return un(c,N({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),B(c,()=>Fg),c})()}function bp(e){return Ke({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 wp(e){return Ke({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 xp(e){return Ke({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 Sp(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const ji={equals:!1};function Wc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Ep(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const M=e=>typeof e=="function"&&!e.length?e():e,jc=e=>Array.isArray(e)?e:e?[e]:[];function Pp(e,...t){return typeof e=="function"?e(...t):e}const Cp=Y;function kp(e,t,n,r){return e.addEventListener(t,n,r),Cp(e.removeEventListener.bind(e,t,n,r))}function Op(e,t,n,r){const o=()=>{jc(M(e)).forEach(i=>{i&&jc(M(t)).forEach(s=>kp(i,s,n,r))})};typeof e=="function"?V(o):me(o)}function co(){return!0}const Tp={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return e.has(t)},set:co,deleteProperty:co,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:co,deleteProperty:co}},ownKeys(e){return e.keys()}},Ap=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Hc(e){const t={};let n;for(;n=Ap.exec(e);)t[n[1]]=n[2];return t}function $p(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Hc(e)}else typeof t=="string"&&(t=Hc(t));return{...e,...t}}const Hi=(e,t,n)=>{let r;for(const o of e){const i=M(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Dp(...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?Ep:Wc,o={};for(const s of n){const a=M(s);for(const c in a)if(c[0]==="o"&&c[1]==="n"&&c[2]){const l=a[c],d=c.toLowerCase(),u=typeof l=="function"?l:Array.isArray(l)?l.length===1?l[0]:l[0].bind(void 0,l[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const i=N(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return Hi(n,"style",$p);if(s==="ref"){const a=[];for(const c of n){const l=M(c)[s];typeof l=="function"&&a.push(l)}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"?Hi(n,s,(a,c)=>`${a} ${c}`):s==="classList"?Hi(n,s,(a,c)=>({...a,...c})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},Tp)}function fn(...e){return Wc(e)}function Rp(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Yi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mp(e){return typeof e=="number"}function Ip(e){return Array.isArray(e)}function $n(e){return Object.prototype.toString.call(e)==="[object String]"}function _p(e){return typeof e=="function"}function Yc(e){return t=>`${e()}-${t}`}function at(e,t){return e?e===t||e.contains(t):!1}function pr(e,t=!1){const{activeElement:n}=Pt(e);if(!n?.nodeName)return null;if(qc(n)&&n.contentDocument)return pr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Pt(n).getElementById(r);if(o)return o}}return n}function Pt(e){return e?e.ownerDocument||e:document}function qc(e){return e.tagName==="IFRAME"}var Gc=(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))(Gc||{});function qi(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function lo(){return qi(/^Mac/i)}function Lp(){return qi(/^iPhone/i)}function Np(){return qi(/^iPad/i)||lo()&&navigator.maxTouchPoints>1}function Fp(){return Lp()||Np()}function Vp(){return lo()||Fp()}function De(e,t){return t&&(_p(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ze(e){return t=>{for(const n of e)De(t,n)}}function Bp(e){return lo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Oe(e){if(e)if(Kp())e.focus({preventScroll:!0});else{const t=zp(e);e.focus(),Up(t)}}var uo=null;function Kp(){if(uo==null){uo=!1;try{document.createElement("div").focus({get preventScroll(){return uo=!0,!0}})}catch{}}return uo}function zp(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 Up(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Xc=["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'])"],Wp=[...Xc,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Gi=`${Xc.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,jp=Wp.join(':not([hidden]):not([tabindex="-1"]),');function Zc(e,t){const r=Array.from(e.querySelectorAll(Gi)).filter(Jc);return t&&Jc(e)&&r.unshift(e),r.forEach((o,i)=>{if(qc(o)&&o.contentDocument){const s=o.contentDocument.body,a=Zc(s,!1);r.splice(i,1,...a)}}),r}function Jc(e){return Qc(e)&&!Hp(e)}function Qc(e){return e.matches(Gi)&&Xi(e)}function Hp(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Xi(e,t){return e.nodeName!=="#comment"&&Yp(e)&&qp(e,t)&&(!e.parentElement||Xi(e.parentElement,e))}function Yp(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 qp(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Gp(e,t,n){const r=t?.tabbable?jp:Gi,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Xi(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function el(e){let t=e;for(;t&&!Xp(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Xp(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Zp(){}function Jp(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,c=s-1;a<s;c=a++){const[l,d]=t[a],[u,h]=t[c],[,g]=t[c===0?s-1:c-1]||[0,0],f=(d-h)*(n-l)-(l-u)*(r-d);if(h<d){if(r>=h&&r<d){if(f===0)return!0;f>0&&(r===h?r>g&&(o=!o):o=!o)}}else if(d<h){if(r>d&&r<=h){if(f===0)return!0;f<0&&(r===h?r<g&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=l||n>=l&&n<=u))return!0}return o}function ct(e,t){return N(e,t)}var mr=new Map,tl=new Set;function nl(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=mr.get(n.target);r||(r=new Set,mr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=mr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),mr.delete(n.target)),mr.size===0)){for(const o of tl)o();tl.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?nl():document.addEventListener("DOMContentLoaded",nl));function Zi(e,t){const n=rl(e,t,"left"),r=rl(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const c=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+o>c&&(s+=n+o-c),r<=a?a=r:r+i>l&&(a+=r+i-l),e.scrollLeft=s,e.scrollTop=a}function rl(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 Qp(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=el(e);for(;e&&o&&e!==n&&o!==n;)Zi(o,e),e=o,o=el(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var em={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 Ji(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=c=>{if(c==null)return"";const l=e.getKey??"key",d=$n(l)?c[l]:l(c);return d!=null?String(d):""},i=c=>{if(c==null)return"";const l=e.getTextValue??"textValue",d=$n(l)?c[l]:l(c);return d!=null?String(d):""},s=c=>{if(c==null)return!1;const l=e.getDisabled??"disabled";return($n(l)?c[l]:l(c))??!1},a=c=>{if(c!=null)return $n(e.getSectionChildren)?c[e.getSectionChildren]:e.getSectionChildren?.(c)};for(const c of e.dataSource){if($n(c)||Mp(c)){r.push({type:"item",rawValue:c,key:String(c),textValue:String(c),disabled:s(c),level:n,index:t}),t++;continue}if(a(c)!=null){r.push({type:"section",rawValue:c,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(c)??[];if(l.length>0){const d=Ji({dataSource:l,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...d),t+=d.length}}else r.push({type:"item",rawValue:c,key:o(c),textValue:i(c),disabled:s(c),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 Xc(e,t=[]){const n=mr({dataSource:S(e.dataSource),getKey:S(e.getKey),getTextValue:S(e.getTextValue),getDisabled:S(e.getDisabled),getSectionChildren:S(e.getSectionChildren)}),[r,o]=O(e.factory(n));return T(tt([()=>S(e.dataSource),()=>S(e.getKey),()=>S(e.getTextValue),()=>S(e.getDisabled),()=>S(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,d])=>{const u=mr({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>d(u))},{defer:!0})),r}function yr(e){const[t,n]=O(e.defaultValue?.()),r=C(()=>e.value?.()!==void 0),o=C(()=>r()?e.value?.():t());return[o,s=>{H(()=>{const a=wc(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Jc(e){const[t,n]=yr(e);return[()=>t()??!1,n]}function Zc(e){const[t,n]=yr(e);return[()=>t()??[],n]}function xi(e={}){const[t,n]=Jc({value:()=>S(e.open),defaultValue:()=>!!S(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function Qc(e){const t=n=>{n.key===fi.Escape&&e.onEscapeKeyDown?.(n)};T(()=>{if(S(e.isDisabled))return;const n=e.ownerDocument?.()??je();n.addEventListener("keydown",t),K(()=>{n.removeEventListener("keydown",t)})})}/*!
7
+ */function tm(e,t=[]){const n=Ji({dataSource:M(e.dataSource),getKey:M(e.getKey),getTextValue:M(e.getTextValue),getDisabled:M(e.getDisabled),getSectionChildren:M(e.getSectionChildren)}),[r,o]=L(e.factory(n));return V(sn([()=>M(e.dataSource),()=>M(e.getKey),()=>M(e.getTextValue),()=>M(e.getDisabled),()=>M(e.getSectionChildren),()=>e.factory,...t],([i,s,a,c,l,d])=>{const u=Ji({dataSource:i,getKey:s,getTextValue:a,getDisabled:c,getSectionChildren:l});o(()=>d(u))},{defer:!0})),r}function Qi(e){const[t,n]=L(e.defaultValue?.()),r=_(()=>e.value?.()!==void 0),o=_(()=>r()?e.value?.():t());return[o,s=>{ne(()=>{const a=Pp(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function nm(e){const[t,n]=Qi(e);return[()=>t()??!1,n]}function rm(e){const[t,n]=Qi(e);return[()=>t()??[],n]}function ol(e={}){const[t,n]=nm({value:()=>M(e.open),defaultValue:()=>!!M(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 om(e){const t=n=>{n.key===Gc.Escape&&e.onEscapeKeyDown?.(n)};V(()=>{if(M(e.isDisabled))return;const n=e.ownerDocument?.()??Pt();n.addEventListener("keydown",t),Y(()=>{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 pn="data-kb-top-layer";let Si,br=!1;const qe=[];function Bt(e){return qe.findIndex(t=>t.node===e)}function eu(e){return qe[Bt(e)]}function tu(e){return qe[qe.length-1].node===e}function ki(){return qe.filter(e=>e.isPointerBlocking)}function nu(){return[...ki()].slice(-1)[0]}function wr(){return ki().length>0}function Ei(e){const t=Bt(nu()?.node);return Bt(e)<t}function ru(e){qe.push(e)}function ou(e){const t=Bt(e);t<0||qe.splice(t,1)}function iu(){for(const{node:e}of qe)e.style.pointerEvents=Ei(e)?"none":"auto"}function su(e){if(wr()&&!br){const t=je(e);Si=document.body.style.pointerEvents,t.body.style.pointerEvents="none",br=!0}}function au(e){if(wr())return;const t=je(e);t.body.style.pointerEvents=Si,t.body.style.length===0&&t.body.removeAttribute("style"),br=!1}const pe={layers:qe,isTopMostLayer:tu,hasPointerBlockingLayer:wr,isBelowPointerBlockingLayer:Ei,addLayer:ru,removeLayer:ou,indexOf:Bt,find:eu,assignPointerEventToLayers:iu,disableBodyPointerEvents:su,restoreBodyPointerEvents:au};/*!
19
+ */const fo="data-kb-top-layer";let il,es=!1;const Ct=[];function yr(e){return Ct.findIndex(t=>t.node===e)}function im(e){return Ct[yr(e)]}function sm(e){return Ct[Ct.length-1].node===e}function sl(){return Ct.filter(e=>e.isPointerBlocking)}function am(){return[...sl()].slice(-1)[0]}function ts(){return sl().length>0}function al(e){const t=yr(am()?.node);return yr(e)<t}function cm(e){Ct.push(e)}function lm(e){const t=yr(e);t<0||Ct.splice(t,1)}function um(){for(const{node:e}of Ct)e.style.pointerEvents=al(e)?"none":"auto"}function dm(e){if(ts()&&!es){const t=Pt(e);il=document.body.style.pointerEvents,t.body.style.pointerEvents="none",es=!0}}function fm(e){if(ts())return;const t=Pt(e);t.body.style.pointerEvents=il,t.body.style.length===0&&t.body.removeAttribute("style"),es=!1}const Re={layers:Ct,isTopMostLayer:sm,hasPointerBlockingLayer:ts,isBelowPointerBlockingLayer:al,addLayer:cm,removeLayer:lm,indexOf:yr,find:im,assignPointerEventToLayers:um,disableBodyPointerEvents:dm,restoreBodyPointerEvents:fm};/*!
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 vr="focusScope.autoFocusOnMount",xr="focusScope.autoFocusOnUnmount",Ci={bubbles:!1,cancelable:!0},Oi={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=dr(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=dr(this.stack,e),this.active()?.resume()}};function lu(e,t){const[n,r]=O(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=h=>e.onMountAutoFocus?.(h),a=h=>e.onUnmountAutoFocus?.(h),l=()=>je(t()),c=()=>{const h=l().createElement("span");return h.setAttribute("data-focus-trap",""),h.tabIndex=0,Object.assign(h.style,Yc),h},d=()=>{const h=t();return h?gi(h,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},u=()=>{const h=d();return h.length>0?h[0]:null},f=()=>{const h=d();return h.length>0?h[h.length-1]:null},g=()=>{const h=t();if(!h)return!1;const p=Kt(h);return!p||Le(h,p)?!1:mi(p)};T(()=>{const h=t();if(!h)return;Oi.add(o);const p=Kt(h);if(!Le(h,p)){const b=new CustomEvent(vr,Ci);h.addEventListener(vr,s),h.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{de(u()),Kt(h)===p&&de(h)},0)}K(()=>{h.removeEventListener(vr,s),setTimeout(()=>{const b=new CustomEvent(xr,Ci);g()&&b.preventDefault(),h.addEventListener(xr,a),h.dispatchEvent(b),b.defaultPrevented||de(p??l().body),h.removeEventListener(xr,a),Oi.remove(o)},0)})}),T(()=>{const h=t();if(!h||!S(e.trapFocus)||n())return;const p=b=>{const w=b.target;w?.closest(`[${pn}]`)||(Le(h,w)?i=w:de(i))},m=b=>{const v=b.relatedTarget??Kt(h);v?.closest(`[${pn}]`)||Le(h,v)||de(i)};l().addEventListener("focusin",p),l().addEventListener("focusout",m),K(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",m)})}),T(()=>{const h=t();if(!h||!S(e.trapFocus)||n())return;const p=c();h.insertAdjacentElement("afterbegin",p);const m=c();h.insertAdjacentElement("beforeend",m);function b(v){const x=u(),_=f();v.relatedTarget===x?de(_):de(x)}p.addEventListener("focusin",b),m.addEventListener("focusin",b);const w=new MutationObserver(v=>{for(const x of v)x.previousSibling===m&&(m.remove(),h.insertAdjacentElement("beforeend",m)),x.nextSibling===p&&(p.remove(),h.insertAdjacentElement("afterbegin",p))});w.observe(h,{childList:!0,subtree:!1}),K(()=>{p.removeEventListener("focusin",b),m.removeEventListener("focusin",b),p.remove(),m.remove(),w.disconnect()})})}/*!
32
+ */const ns="focusScope.autoFocusOnMount",rs="focusScope.autoFocusOnUnmount",cl={bubbles:!1,cancelable:!0},ll={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=Yi(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=Yi(this.stack,e),this.active()?.resume()}};function hm(e,t){const[n,r]=L(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=f=>e.onMountAutoFocus?.(f),a=f=>e.onUnmountAutoFocus?.(f),c=()=>Pt(t()),l=()=>{const f=c().createElement("span");return f.setAttribute("data-focus-trap",""),f.tabIndex=0,Object.assign(f.style,em),f},d=()=>{const f=t();return f?Zc(f,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},u=()=>{const f=d();return f.length>0?f[0]:null},h=()=>{const f=d();return f.length>0?f[f.length-1]:null},g=()=>{const f=t();if(!f)return!1;const p=pr(f);return!p||at(f,p)?!1:Qc(p)};V(()=>{const f=t();if(!f)return;ll.add(o);const p=pr(f);if(!at(f,p)){const y=new CustomEvent(ns,cl);f.addEventListener(ns,s),f.dispatchEvent(y),y.defaultPrevented||setTimeout(()=>{Oe(u()),pr(f)===p&&Oe(f)},0)}Y(()=>{f.removeEventListener(ns,s),setTimeout(()=>{const y=new CustomEvent(rs,cl);g()&&y.preventDefault(),f.addEventListener(rs,a),f.dispatchEvent(y),y.defaultPrevented||Oe(p??c().body),f.removeEventListener(rs,a),ll.remove(o)},0)})}),V(()=>{const f=t();if(!f||!M(e.trapFocus)||n())return;const p=y=>{const b=y.target;b?.closest(`[${fo}]`)||(at(f,b)?i=b:Oe(i))},m=y=>{const x=y.relatedTarget??pr(f);x?.closest(`[${fo}]`)||at(f,x)||Oe(i)};c().addEventListener("focusin",p),c().addEventListener("focusout",m),Y(()=>{c().removeEventListener("focusin",p),c().removeEventListener("focusout",m)})}),V(()=>{const f=t();if(!f||!M(e.trapFocus)||n())return;const p=l();f.insertAdjacentElement("afterbegin",p);const m=l();f.insertAdjacentElement("beforeend",m);function y(x){const w=u(),C=h();x.relatedTarget===w?Oe(C):Oe(w)}p.addEventListener("focusin",y),m.addEventListener("focusin",y);const b=new MutationObserver(x=>{for(const w of x)w.previousSibling===m&&(m.remove(),f.insertAdjacentElement("beforeend",m)),w.nextSibling===p&&(p.remove(),f.insertAdjacentElement("afterbegin",p))});b.observe(f,{childList:!0,subtree:!1}),Y(()=>{p.removeEventListener("focusin",y),m.removeEventListener("focusin",y),p.remove(),m.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 cu="data-live-announcer";/*!
38
+ */const gm="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 uu(e){T(()=>{S(e.isDisabled)||K(du(S(e.targets),S(e.root)))})}const Vt=new WeakMap,xe=[];function du(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const f of l.querySelectorAll(`[${cu}], [${pn}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(f.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},d=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),u=c(l);if(u===NodeFilter.FILTER_ACCEPT&&i(l),u!==NodeFilter.FILTER_REJECT){let f=d.nextNode();for(;f!=null;)i(f),f=d.nextNode()}},i=l=>{const c=Vt.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Vt.set(l,c+1))};xe.length&&xe[xe.length-1].disconnect(),o(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(d=>d.contains(c.target))){for(const d of c.removedNodes)d instanceof Element&&(n.delete(d),r.delete(d));for(const d of c.addedNodes)(d instanceof HTMLElement||d instanceof SVGElement)&&(d.dataset.liveAnnouncer==="true"||d.dataset.reactAriaTopLayer==="true")?n.add(d):d instanceof Element&&o(d)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return xe.push(a),()=>{s.disconnect();for(const l of r){const c=Vt.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Vt.delete(l)):Vt.set(l,c-1)}a===xe[xe.length-1]?(xe.pop(),xe.length&&xe[xe.length-1].observe()):xe.splice(xe.indexOf(a),1)}}/*!
44
+ */function pm(e){V(()=>{M(e.isDisabled)||Y(mm(M(e.targets),M(e.root)))})}const vr=new WeakMap,Ue=[];function mm(e,t=document.body){const n=new Set(e),r=new Set,o=c=>{for(const h of c.querySelectorAll(`[${gm}], [${fo}]`))n.add(h);const l=h=>{if(n.has(h)||h.parentElement&&r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(h.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},d=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT,{acceptNode:l}),u=l(c);if(u===NodeFilter.FILTER_ACCEPT&&i(c),u!==NodeFilter.FILTER_REJECT){let h=d.nextNode();for(;h!=null;)i(h),h=d.nextNode()}},i=c=>{const l=vr.get(c)??0;c.getAttribute("aria-hidden")==="true"&&l===0||(l===0&&c.setAttribute("aria-hidden","true"),r.add(c),vr.set(c,l+1))};Ue.length&&Ue[Ue.length-1].disconnect(),o(t);const s=new MutationObserver(c=>{for(const l of c)if(!(l.type!=="childList"||l.addedNodes.length===0)&&![...n,...r].some(d=>d.contains(l.target))){for(const d of l.removedNodes)d instanceof Element&&(n.delete(d),r.delete(d));for(const d of l.addedNodes)(d instanceof HTMLElement||d instanceof SVGElement)&&(d.dataset.liveAnnouncer==="true"||d.dataset.reactAriaTopLayer==="true")?n.add(d):d instanceof Element&&o(d)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return Ue.push(a),()=>{s.disconnect();for(const c of r){const l=vr.get(c);if(l==null)return;l===1?(c.removeAttribute("aria-hidden"),vr.delete(c)):vr.set(c,l-1)}a===Ue[Ue.length-1]?(Ue.pop(),Ue.length&&Ue[Ue.length-1].observe()):Ue.splice(Ue.indexOf(a),1)}}/*!
45
45
  * Portions of this file are based on code from radix-ui-primitives.
46
46
  * MIT Licensed, Copyright (c) 2022 WorkOS.
47
47
  *
@@ -53,38 +53,38 @@
53
53
  *
54
54
  * Credits to the Chakra UI team:
55
55
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/interact-outside/src/index.ts
56
- */const _i="interactOutside.pointerDownOutside",Pi="interactOutside.focusOutside";function fu(e,t){let n,r=Hc;const o=()=>je(t()),i=u=>e.onPointerDownOutside?.(u),s=u=>e.onFocusOutside?.(u),a=u=>e.onInteractOutside?.(u),l=u=>{const f=u.target;return!(f instanceof HTMLElement)||f.closest(`[${pn}]`)||!Le(o(),f)||Le(t(),f)?!1:!e.shouldExcludeElement?.(f)},c=u=>{function f(){const g=t(),h=u.target;if(!g||!h||!l(u))return;const p=ve([i,a]);h.addEventListener(_i,p,{once:!0});const m=new CustomEvent(_i,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:u.button===2||Rc(u)&&u.button===0}});h.dispatchEvent(m)}u.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},d=u=>{const f=t(),g=u.target;if(!f||!g||!l(u))return;const h=ve([s,a]);g.addEventListener(Pi,h,{once:!0});const p=new CustomEvent(Pi,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:!1}});g.dispatchEvent(p)};T(()=>{S(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",d,!0),K(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",d,!0)}))})}/*!
56
+ */const ul="interactOutside.pointerDownOutside",dl="interactOutside.focusOutside";function ym(e,t){let n,r=Zp;const o=()=>Pt(t()),i=u=>e.onPointerDownOutside?.(u),s=u=>e.onFocusOutside?.(u),a=u=>e.onInteractOutside?.(u),c=u=>{const h=u.target;return!(h instanceof HTMLElement)||h.closest(`[${fo}]`)||!at(o(),h)||at(t(),h)?!1:!e.shouldExcludeElement?.(h)},l=u=>{function h(){const g=t(),f=u.target;if(!g||!f||!c(u))return;const p=ze([i,a]);f.addEventListener(ul,p,{once:!0});const m=new CustomEvent(ul,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:u.button===2||Bp(u)&&u.button===0}});f.dispatchEvent(m)}u.pointerType==="touch"?(o().removeEventListener("click",h),r=h,o().addEventListener("click",h,{once:!0})):h()},d=u=>{const h=t(),g=u.target;if(!h||!g||!c(u))return;const f=ze([s,a]);g.addEventListener(dl,f,{once:!0});const p=new CustomEvent(dl,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:!1}});g.dispatchEvent(p)};V(()=>{M(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",l,!0)},0),o().addEventListener("focusin",d,!0),Y(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",l,!0),o().removeEventListener("focusin",d,!0)}))})}/*!
57
57
  * Portions of this file are based on code from radix-ui-primitives.
58
58
  * MIT Licensed, Copyright (c) 2022 WorkOS.
59
59
  *
60
60
  * Credits to the Radix UI team:
61
61
  * https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
62
62
  * https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
63
- */function hu(e){const[t,n]=O();let r={},o=e(),i="none";const[s,a]=gu(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T(tt(s,l=>{const c=mn(r);i=l==="mounted"?c:"none"})),T(tt(e,l=>{if(o===l)return;const c=mn(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),T(tt(t,l=>{if(l){const c=u=>{const g=mn(r).includes(u.animationName);u.target===l&&g&&a("ANIMATION_END")},d=u=>{u.target===l&&(i=mn(r))};l.addEventListener("animationstart",d),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),K(()=>{l.removeEventListener("animationstart",d),l.removeEventListener("animationcancel",c),l.removeEventListener("animationend",c)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:l=>{l&&(r=getComputedStyle(l)),n(l)}}}function mn(e){return e?.animationName||"none"}function gu(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=O(e);return[r,s=>{o(a=>n(a,s))}]}function yn(e){return t=>(e(t),()=>e(void 0))}/*!
63
+ */function vm(e){const[t,n]=L();let r={},o=e(),i="none";const[s,a]=bm(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(sn(s,c=>{const l=ho(r);i=c==="mounted"?l:"none"})),V(sn(e,c=>{if(o===c)return;const l=ho(r);c?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==l?"ANIMATION_OUT":"UNMOUNT"),o=c})),V(sn(t,c=>{if(c){const l=u=>{const g=ho(r).includes(u.animationName);u.target===c&&g&&a("ANIMATION_END")},d=u=>{u.target===c&&(i=ho(r))};c.addEventListener("animationstart",d),c.addEventListener("animationcancel",l),c.addEventListener("animationend",l),Y(()=>{c.removeEventListener("animationstart",d),c.removeEventListener("animationcancel",l),c.removeEventListener("animationend",l)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:c=>{c&&(r=getComputedStyle(c)),n(c)}}}function ho(e){return e?.animationName||"none"}function bm(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=L(e);return[r,s=>{o(a=>n(a,s))}]}function go(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 pu(e,t){const[n,r]=O(Ai(t?.()));return T(()=>{r(e()?.tagName.toLowerCase()||Ai(t?.()))}),n}function Ai(e){return bt(e)?e:void 0}function bn(e){const[t,n]=j(e,["asChild","as","children"]);if(!t.asChild)return y(ln,L({get component(){return t.as}},n,{get children(){return t.children}}));const r=Zn(()=>t.children);if(Ti(r())){const o=Li(n,r()?.props??{});return y(ln,o)}if(Ac(r())){const o=r().find(Ti);if(o){const i=()=>y(pt,{get each(){return r()},children:a=>y(Z,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Li(n,o?.props??{});return y(ln,L(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const mu=Symbol("$$KobalteAsComponent");function Ti(e){return e?.[mu]===!0}function Li(e,t){return Oc([e,t],{reverseEventHandlers:!0})}/*!
69
+ */function wm(e,t){const[n,r]=L(fl(t?.()));return V(()=>{r(e()?.tagName.toLowerCase()||fl(t?.()))}),n}function fl(e){return $n(e)?e:void 0}function po(e){const[t,n]=J(e,["asChild","as","children"]);if(!t.asChild)return v(dr,N({get component(){return t.as}},n,{get children(){return t.children}}));const r=Ii(()=>t.children);if(hl(r())){const o=gl(n,r()?.props??{});return v(dr,o)}if(Ip(r())){const o=r().find(hl);if(o){const i=()=>v(cn,{get each(){return r()},children:a=>v(ie,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=gl(n,o?.props??{});return v(dr,N(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const xm=Symbol("$$KobalteAsComponent");function hl(e){return e?.[xm]===!0}function gl(e,t){return Dp([e,t],{reverseEventHandlers:!0})}/*!
70
70
  * Portions of this file are based on code from react-spectrum.
71
71
  * Apache License Version 2.0, Copyright 2020 Adobe.
72
72
  *
73
73
  * Credits to the React Spectrum team:
74
74
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
75
- */const yu=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),bu=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function wu(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return yu.has(n)}const t=e.split("-")[0];return bu.has(t)}function vu(e){return wu(e)?"rtl":"ltr"}/*!
75
+ */const Sm=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Em=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Pm(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Sm.has(n)}const t=e.split("-")[0];return Em.has(t)}function Cm(e){return Pm(e)?"rtl":"ltr"}/*!
76
76
  * Portions of this file are based on code from react-spectrum.
77
77
  * Apache License Version 2.0, Copyright 2020 Adobe.
78
78
  *
79
79
  * Credits to the React Spectrum team:
80
80
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
81
- */function Mi(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:vu(e)}}let Sr=Mi();const Ut=new Set;function Di(){Sr=Mi();for(const e of Ut)e(Sr)}function xu(){const[e,t]=O(Sr),n=C(()=>e());return ht(()=>{Ut.size===0&&window.addEventListener("languagechange",Di),Ut.add(t),K(()=>{Ut.delete(t),Ut.size===0&&window.removeEventListener("languagechange",Di)})}),{locale:()=>n().locale,direction:()=>n().direction}}const Su=ce();function kr(){const e=xu();return he(Su)||e}/*!
81
+ */function pl(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Cm(e)}}let os=pl();const br=new Set;function ml(){os=pl();for(const e of br)e(os)}function km(){const[e,t]=L(os),n=_(()=>e());return an(()=>{br.size===0&&window.addEventListener("languagechange",ml),br.add(t),Y(()=>{br.delete(t),br.size===0&&window.removeEventListener("languagechange",ml)})}),{locale:()=>n().locale,direction:()=>n().direction}}const Om=xe();function is(){const e=km();return Ce(Om)||e}/*!
82
82
  * Portions of this file are based on code from react-spectrum.
83
83
  * Apache License Version 2.0, Copyright 2020 Adobe.
84
84
  *
85
85
  * Credits to the React Spectrum team:
86
86
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
87
- */const Er=new Map;function ku(e){const{locale:t}=kr(),n=C(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return C(()=>{const r=n();let o;return Er.has(r)&&(o=Er.get(r)),o||(o=new Intl.Collator(t(),e),Er.set(r,o)),o})}/*!
87
+ */const ss=new Map;function Tm(e){const{locale:t}=is(),n=_(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return _(()=>{const r=n();let o;return ss.has(r)&&(o=ss.get(r)),o||(o=new Intl.Collator(t(),e),ss.set(r,o)),o})}function Am(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function as(e,t,n){Am(e,t),t.set(e,n)}/*!
88
88
  * Portions of this file are based on code from react-spectrum.
89
89
  * Apache License Version 2.0, Copyright 2020 Adobe.
90
90
  *
@@ -92,79 +92,79 @@
92
92
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
93
93
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
94
94
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
95
- */class Ce extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Ce?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function Eu(e){const[t,n]=yr(e);return[()=>t()??new Ce,n]}/*!
95
+ */class Qe extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Qe?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function $m(e){const[t,n]=Qi(e);return[()=>t()??new Qe,n]}/*!
96
96
  * Portions of this file are based on code from react-spectrum.
97
97
  * Apache License Version 2.0, Copyright 2020 Adobe.
98
98
  *
99
99
  * Credits to the React Spectrum team:
100
100
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
101
- */function Ii(e){return Ic()?e.altKey:e.ctrlKey}function wt(e){return hn()?e.metaKey:e.ctrlKey}function Ri(e){return new Ce(e)}function Cu(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
101
+ */function yl(e){return Vp()?e.altKey:e.ctrlKey}function Dn(e){return lo()?e.metaKey:e.ctrlKey}function vl(e){return new Qe(e)}function Dm(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
102
102
  * Portions of this file are based on code from react-spectrum.
103
103
  * Apache License Version 2.0, Copyright 2020 Adobe.
104
104
  *
105
105
  * Credits to the React Spectrum team:
106
106
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
107
- */function Ou(e){const t=Me({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=O(!1),[o,i]=O(),s=C(()=>{const p=S(t.selectedKeys);return p!=null?Ri(p):p}),a=C(()=>{const p=S(t.defaultSelectedKeys);return p!=null?Ri(p):new Ce}),[l,c]=Eu({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[d,u]=O(S(t.selectionBehavior)),f=()=>S(t.selectionMode),g=()=>S(t.disallowEmptySelection)??!1,h=p=>{(S(t.allowDuplicateSelectionEvents)||!Cu(p,l()))&&c(p)};return T(()=>{const p=l();S(t.selectionBehavior)==="replace"&&d()==="toggle"&&typeof p=="object"&&p.size===0&&u("replace")}),T(()=>{u(S(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:g,selectionBehavior:d,setSelectionBehavior:u,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:h}}/*!
107
+ */function Rm(e){const t=ct({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=L(!1),[o,i]=L(),s=_(()=>{const p=M(t.selectedKeys);return p!=null?vl(p):p}),a=_(()=>{const p=M(t.defaultSelectedKeys);return p!=null?vl(p):new Qe}),[c,l]=$m({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[d,u]=L(M(t.selectionBehavior)),h=()=>M(t.selectionMode),g=()=>M(t.disallowEmptySelection)??!1,f=p=>{(M(t.allowDuplicateSelectionEvents)||!Dm(p,c()))&&l(p)};return V(()=>{const p=c();M(t.selectionBehavior)==="replace"&&d()==="toggle"&&typeof p=="object"&&p.size===0&&u("replace")}),V(()=>{u(M(t.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:g,selectionBehavior:d,setSelectionBehavior:u,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:c,setSelectedKeys:f}}/*!
108
108
  * Portions of this file are based on code from react-spectrum.
109
109
  * Apache License Version 2.0, Copyright 2020 Adobe.
110
110
  *
111
111
  * Credits to the React Spectrum team:
112
112
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
113
- */function _u(e){const[t,n]=O(""),[r,o]=O(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(S(e.isDisabled))return;const a=S(e.keyboardDelegate),l=S(e.selectionManager);if(!a.getKeyForSearch)return;const c=Pu(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let d=n(f=>f+c),u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d);u==null&&Au(d)&&(d=d[0],u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d)),u!=null&&(l.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function Pu(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Au(e){return e.split("").every(t=>t===e[0])}/*!
113
+ */function Mm(e){const[t,n]=L(""),[r,o]=L(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(M(e.isDisabled))return;const a=M(e.keyboardDelegate),c=M(e.selectionManager);if(!a.getKeyForSearch)return;const l=Im(s.key);if(!l||s.ctrlKey||s.metaKey)return;l===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let d=n(h=>h+l),u=a.getKeyForSearch(d,c.focusedKey())??a.getKeyForSearch(d);u==null&&_m(d)&&(d=d[0],u=a.getKeyForSearch(d,c.focusedKey())??a.getKeyForSearch(d)),u!=null&&(c.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function Im(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function _m(e){return e.split("").every(t=>t===e[0])}/*!
114
114
  * Portions of this file are based on code from react-spectrum.
115
115
  * Apache License Version 2.0, Copyright 2020 Adobe.
116
116
  *
117
117
  * Credits to the React Spectrum team:
118
118
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
119
- */function Tu(e,t,n){const o=L({selectOnFocus:()=>S(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=kr();let a={top:0,left:0};Sc(()=>S(o.isVirtualized)?void 0:i(),"scroll",()=>{const p=i();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=_u({isDisabled:()=>S(o.disallowTypeAhead),keyboardDelegate:()=>S(o.keyboardDelegate),selectionManager:()=>S(o.selectionManager)}),c=p=>{ge(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const m=t();if(!m?.contains(p.target))return;const b=S(o.selectionManager),w=S(o.selectOnFocus),v=k=>{k!=null&&(b.setFocusedKey(k),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(k):w&&!Ii(p)&&b.replaceSelection(k))},x=S(o.keyboardDelegate),_=S(o.shouldFocusWrap),E=b.focusedKey();switch(p.key){case"ArrowDown":{if(x.getKeyBelow){p.preventDefault();let k;E!=null?k=x.getKeyBelow(E):k=x.getFirstKey?.(),k==null&&_&&(k=x.getFirstKey?.(E)),v(k)}break}case"ArrowUp":{if(x.getKeyAbove){p.preventDefault();let k;E!=null?k=x.getKeyAbove(E):k=x.getLastKey?.(),k==null&&_&&(k=x.getLastKey?.(E)),v(k)}break}case"ArrowLeft":{if(x.getKeyLeftOf){p.preventDefault();const k=s()==="rtl";let F;E!=null?F=x.getKeyLeftOf(E):F=k?x.getFirstKey?.():x.getLastKey?.(),v(F)}break}case"ArrowRight":{if(x.getKeyRightOf){p.preventDefault();const k=s()==="rtl";let F;E!=null?F=x.getKeyRightOf(E):F=k?x.getLastKey?.():x.getFirstKey?.(),v(F)}break}case"Home":if(x.getFirstKey){p.preventDefault();const k=x.getFirstKey(E,wt(p));k!=null&&(b.setFocusedKey(k),wt(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(k):w&&b.replaceSelection(k))}break;case"End":if(x.getLastKey){p.preventDefault();const k=x.getLastKey(E,wt(p));k!=null&&(b.setFocusedKey(k),wt(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(k):w&&b.replaceSelection(k))}break;case"PageDown":if(x.getKeyPageBelow&&E!=null){p.preventDefault();const k=x.getKeyPageBelow(E);v(k)}break;case"PageUp":if(x.getKeyPageAbove&&E!=null){p.preventDefault();const k=x.getKeyPageAbove(E);v(k)}break;case"a":wt(p)&&b.selectionMode()==="multiple"&&S(o.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),S(o.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!S(o.allowsTabNavigation)){if(p.shiftKey)m.focus();else{const k=jc(m,{tabbable:!0});let F,P;do P=k.lastChild(),P&&(F=P);while(P);F&&!F.contains(document.activeElement)&&de(F)}break}}},d=p=>{const m=S(o.selectionManager),b=S(o.keyboardDelegate),w=S(o.selectOnFocus);if(m.isFocused()){p.currentTarget.contains(p.target)||m.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(m.setFocused(!0),m.focusedKey()==null){const v=_=>{_!=null&&(m.setFocusedKey(_),w&&m.replaceSelection(_))},x=p.relatedTarget;x&&p.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?v(m.lastSelectedKey()??b.getLastKey?.()):v(m.firstSelectedKey()??b.getFirstKey?.())}else if(!S(o.isVirtualized)){const v=i();if(v){v.scrollTop=a.top,v.scrollLeft=a.left;const x=v.querySelector(`[data-key="${m.focusedKey()}"]`);x&&(de(x),pr(v,x))}}}},u=p=>{const m=S(o.selectionManager);p.currentTarget.contains(p.relatedTarget)||m.setFocused(!1)},f=p=>{i()===p.target&&p.preventDefault()},g=()=>{const p=S(o.autoFocus);if(!p)return;const m=S(o.selectionManager),b=S(o.keyboardDelegate);let w;p==="first"&&(w=b.getFirstKey?.()),p==="last"&&(w=b.getLastKey?.());const v=m.selectedKeys();v.size&&(w=v.values().next().value),m.setFocused(!0),m.setFocusedKey(w);const x=t();x&&w==null&&!S(o.shouldUseVirtualFocus)&&de(x)};return ht(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),T(tt([i,()=>S(o.isVirtualized),()=>S(o.selectionManager).focusedKey()],p=>{const[m,b,w]=p;if(b)w&&o.scrollToKey?.(w);else if(w&&m){const v=m.querySelector(`[data-key="${w}"]`);v&&pr(m,v)}})),{tabIndex:C(()=>{if(!S(o.shouldUseVirtualFocus))return S(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:f,onFocusIn:d,onFocusOut:u}}/*!
119
+ */function Lm(e,t,n){const o=N({selectOnFocus:()=>M(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=is();let a={top:0,left:0};Op(()=>M(o.isVirtualized)?void 0:i(),"scroll",()=>{const p=i();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:c}=Mm({isDisabled:()=>M(o.disallowTypeAhead),keyboardDelegate:()=>M(o.keyboardDelegate),selectionManager:()=>M(o.selectionManager)}),l=p=>{De(p,c.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const m=t();if(!m?.contains(p.target))return;const y=M(o.selectionManager),b=M(o.selectOnFocus),x=O=>{O!=null&&(y.setFocusedKey(O),p.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(O):b&&!yl(p)&&y.replaceSelection(O))},w=M(o.keyboardDelegate),C=M(o.shouldFocusWrap),S=y.focusedKey();switch(p.key){case"ArrowDown":{if(w.getKeyBelow){p.preventDefault();let O;S!=null?O=w.getKeyBelow(S):O=w.getFirstKey?.(),O==null&&C&&(O=w.getFirstKey?.(S)),x(O)}break}case"ArrowUp":{if(w.getKeyAbove){p.preventDefault();let O;S!=null?O=w.getKeyAbove(S):O=w.getLastKey?.(),O==null&&C&&(O=w.getLastKey?.(S)),x(O)}break}case"ArrowLeft":{if(w.getKeyLeftOf){p.preventDefault();const O=s()==="rtl";let D;S!=null?D=w.getKeyLeftOf(S):D=O?w.getFirstKey?.():w.getLastKey?.(),x(D)}break}case"ArrowRight":{if(w.getKeyRightOf){p.preventDefault();const O=s()==="rtl";let D;S!=null?D=w.getKeyRightOf(S):D=O?w.getLastKey?.():w.getFirstKey?.(),x(D)}break}case"Home":if(w.getFirstKey){p.preventDefault();const O=w.getFirstKey(S,Dn(p));O!=null&&(y.setFocusedKey(O),Dn(p)&&p.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(O):b&&y.replaceSelection(O))}break;case"End":if(w.getLastKey){p.preventDefault();const O=w.getLastKey(S,Dn(p));O!=null&&(y.setFocusedKey(O),Dn(p)&&p.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(O):b&&y.replaceSelection(O))}break;case"PageDown":if(w.getKeyPageBelow&&S!=null){p.preventDefault();const O=w.getKeyPageBelow(S);x(O)}break;case"PageUp":if(w.getKeyPageAbove&&S!=null){p.preventDefault();const O=w.getKeyPageAbove(S);x(O)}break;case"a":Dn(p)&&y.selectionMode()==="multiple"&&M(o.disallowSelectAll)!==!0&&(p.preventDefault(),y.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),M(o.disallowEmptySelection)||y.clearSelection());break;case"Tab":if(!M(o.allowsTabNavigation)){if(p.shiftKey)m.focus();else{const O=Gp(m,{tabbable:!0});let D,P;do P=O.lastChild(),P&&(D=P);while(P);D&&!D.contains(document.activeElement)&&Oe(D)}break}}},d=p=>{const m=M(o.selectionManager),y=M(o.keyboardDelegate),b=M(o.selectOnFocus);if(m.isFocused()){p.currentTarget.contains(p.target)||m.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(m.setFocused(!0),m.focusedKey()==null){const x=C=>{C!=null&&(m.setFocusedKey(C),b&&m.replaceSelection(C))},w=p.relatedTarget;w&&p.currentTarget.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_FOLLOWING?x(m.lastSelectedKey()??y.getLastKey?.()):x(m.firstSelectedKey()??y.getFirstKey?.())}else if(!M(o.isVirtualized)){const x=i();if(x){x.scrollTop=a.top,x.scrollLeft=a.left;const w=x.querySelector(`[data-key="${m.focusedKey()}"]`);w&&(Oe(w),Zi(x,w))}}}},u=p=>{const m=M(o.selectionManager);p.currentTarget.contains(p.relatedTarget)||m.setFocused(!1)},h=p=>{i()===p.target&&p.preventDefault()},g=()=>{const p=M(o.autoFocus);if(!p)return;const m=M(o.selectionManager),y=M(o.keyboardDelegate);let b;p==="first"&&(b=y.getFirstKey?.()),p==="last"&&(b=y.getLastKey?.());const x=m.selectedKeys();x.size&&(b=x.values().next().value),m.setFocused(!0),m.setFocusedKey(b);const w=t();w&&b==null&&!M(o.shouldUseVirtualFocus)&&Oe(w)};return an(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),V(sn([i,()=>M(o.isVirtualized),()=>M(o.selectionManager).focusedKey()],p=>{const[m,y,b]=p;if(y)b&&o.scrollToKey?.(b);else if(b&&m){const x=m.querySelector(`[data-key="${b}"]`);x&&Zi(m,x)}})),{tabIndex:_(()=>{if(!M(o.shouldUseVirtualFocus))return M(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:l,onMouseDown:h,onFocusIn:d,onFocusOut:u}}/*!
120
120
  * Portions of this file are based on code from react-spectrum.
121
121
  * Apache License Version 2.0, Copyright 2020 Adobe.
122
122
  *
123
123
  * Credits to the React Spectrum team:
124
124
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
125
- */function Lu(e,t){const n=()=>S(e.selectionManager),r=()=>S(e.key),o=()=>S(e.shouldUseVirtualFocus),i=w=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):w?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||wt(w)||"pointerType"in w&&w.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>S(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const d=w=>{l()&&(c=w.pointerType,w.pointerType==="mouse"&&w.button===0&&!S(e.shouldSelectOnPressUp)&&i(w))},u=w=>{l()&&w.pointerType==="mouse"&&w.button===0&&S(e.shouldSelectOnPressUp)&&S(e.allowsDifferentPressOrigin)&&i(w)},f=w=>{l()&&(S(e.shouldSelectOnPressUp)&&!S(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(w)},g=w=>{!l()||!["Enter"," "].includes(w.key)||(Ii(w)?n().toggleSelection(r()):i(w))},h=w=>{a()&&w.preventDefault()},p=w=>{const v=t();o()||a()||!v||w.target===v&&n().setFocusedKey(r())},m=C(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),b=C(()=>S(e.virtualized)?void 0:r());return T(tt([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([w,v,x,_,E])=>{w&&v===_&&E&&!x&&document.activeElement!==w&&(e.focus?e.focus():de(w))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:m,dataKey:b,onPointerDown:d,onPointerUp:u,onClick:f,onKeyDown:g,onMouseDown:h,onFocus:p}}/*!
125
+ */function Nm(e,t){const n=()=>M(e.selectionManager),r=()=>M(e.key),o=()=>M(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"||Dn(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>M(e.disabled)||n().isDisabled(r()),c=()=>!a()&&n().canSelectItem(r());let l=null;const d=b=>{c()&&(l=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!M(e.shouldSelectOnPressUp)&&i(b))},u=b=>{c()&&b.pointerType==="mouse"&&b.button===0&&M(e.shouldSelectOnPressUp)&&M(e.allowsDifferentPressOrigin)&&i(b)},h=b=>{c()&&(M(e.shouldSelectOnPressUp)&&!M(e.allowsDifferentPressOrigin)||l!=="mouse")&&i(b)},g=b=>{!c()||!["Enter"," "].includes(b.key)||(yl(b)?n().toggleSelection(r()):i(b))},f=b=>{a()&&b.preventDefault()},p=b=>{const x=t();o()||a()||!x||b.target===x&&n().setFocusedKey(r())},m=_(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),y=_(()=>M(e.virtualized)?void 0:r());return V(sn([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([b,x,w,C,S])=>{b&&x===C&&S&&!w&&document.activeElement!==b&&(e.focus?e.focus():Oe(b))})),{isSelected:s,isDisabled:a,allowsSelection:c,tabIndex:m,dataKey:y,onPointerDown:d,onPointerUp:u,onClick:h,onKeyDown:g,onMouseDown:f,onFocus:p}}/*!
126
126
  * Portions of this file are based on code from react-spectrum.
127
127
  * Apache License Version 2.0, Copyright 2020 Adobe.
128
128
  *
129
129
  * Credits to the React Spectrum team:
130
130
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
131
- */class Mu{collection;state;constructor(t,n){this.collection=t,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}isFocused(){return this.state.isFocused()}setFocused(t){this.state.setFocused(t)}focusedKey(){return this.state.focusedKey()}setFocusedKey(t){(t==null||this.collection().getItem(t))&&this.state.setFocusedKey(t)}selectedKeys(){return this.state.selectedKeys()}isSelected(t){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(t);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const t=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>t.has(n))}firstSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index<t.index;(!t||o)&&(t=r)}return t?.key}lastSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index>t.index;(!t||o)&&(t=r)}return t?.key}extendSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=this.state.selectedKeys(),o=r.anchorKey||n,i=new Ce(r,o,n);for(const s of this.getKeyRange(o,r.currentKey||n))i.delete(s);for(const s of this.getKeyRange(n,o))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(t,n){const r=this.collection().getItem(t),o=this.collection().getItem(n);return r&&o?r.index!=null&&o.index!=null&&r.index<=o.index?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){const r=[];let o=t;for(;o!=null;){const i=this.collection().getItem(o);if(i&&i.type==="item"&&r.push(o),o===n)return r;o=this.collection().getKeyAfter(o)}return[]}getKey(t){const n=this.collection().getItem(t);return n?!n||n.type!=="item"?null:n.key:t}toggleSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=new Ce(this.state.selectedKeys());r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection()&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode()==="none")return;const n=this.getKey(t);if(n==null)return;const r=this.canSelectItem(n)?new Ce([n],n,n):new Ce;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new Ce;for(const r of t){const o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const t=this.state.selectedKeys();!this.disallowEmptySelection()&&t.size>0&&this.state.setSelectedKeys(new Ce)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
131
+ */class Fm{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 Qe(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 Qe(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 Qe([n],n,n):new Qe;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new Qe;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 Qe)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
132
132
  * Portions of this file are based on code from react-spectrum.
133
133
  * Apache License Version 2.0, Copyright 2020 Adobe.
134
134
  *
135
135
  * Credits to the React Spectrum team:
136
136
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
137
- */class Fi{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])}}/*!
137
+ */class bl{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
138
138
  * Portions of this file are based on code from react-spectrum.
139
139
  * Apache License Version 2.0, Copyright 2020 Adobe.
140
140
  *
141
141
  * Credits to the React Spectrum team:
142
142
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
143
- */function Du(e){const t=Ou(e),r=Xc({dataSource:()=>S(e.dataSource),getKey:()=>S(e.getKey),getTextValue:()=>S(e.getTextValue),getDisabled:()=>S(e.getDisabled),getSectionChildren:()=>S(e.getSectionChildren),factory:i=>e.filter?new Fi(e.filter(i)):new Fi(i)},[()=>e.filter]),o=new Mu(r,t);return Do(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
143
+ */function Vm(e){const t=Rm(e),r=tm({dataSource:()=>M(e.dataSource),getKey:()=>M(e.getKey),getTextValue:()=>M(e.getTextValue),getDisabled:()=>M(e.getDisabled),getSectionChildren:()=>M(e.getSectionChildren),factory:i=>e.filter?new bl(e.filter(i)):new bl(i)},[()=>e.filter]),o=new Fm(r,t);return pc(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
144
144
  * Portions of this file are based on code from react-spectrum.
145
145
  * Apache License Version 2.0, Copyright 2020 Adobe.
146
146
  *
147
147
  * Credits to the React Spectrum team:
148
148
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
149
- */class Iu{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)}}}/*!
149
+ */class Bm{collection;ref;collator;constructor(t,n,r){this.collection=t,this.ref=n,this.collator=r}getKeyBelow(t){let n=this.collection().getKeyAfter(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(t){let n=this.collection().getKeyBefore(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let t=this.collection().getFirstKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getLastKey(){let t=this.collection().getLastKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getItem(t){return this.ref?.()?.querySelector(`[data-key="${t}"]`)??null}getKeyPageAbove(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=i!=null?this.getItem(i):null;return i}getKeyPageBelow(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=i!=null?this.getItem(i):null;return i}getKeyForSearch(t,n){const r=this.collator?.();if(!r)return;let o=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;o!=null;){const i=this.collection().getItem(o);if(i){const s=i.textValue.slice(0,t.length);if(i.textValue&&r.compare(s,t)===0)return o}o=this.getKeyBelow(o)}}}/*!
150
150
  * Portions of this file are based on code from react-spectrum.
151
151
  * Apache License Version 2.0, Copyright 2020 Adobe.
152
152
  *
153
153
  * Credits to the React Spectrum team:
154
154
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
155
- */function Ru(e,t,n){const r=ku({usage:"search",sensitivity:"base"}),o=C(()=>{const i=S(e.keyboardDelegate);return i||new Iu(e.collection,t,r)});return Tu({selectionManager:()=>S(e.selectionManager),keyboardDelegate:o,autoFocus:()=>S(e.autoFocus),deferAutoFocus:()=>S(e.deferAutoFocus),shouldFocusWrap:()=>S(e.shouldFocusWrap),disallowEmptySelection:()=>S(e.disallowEmptySelection),selectOnFocus:()=>S(e.selectOnFocus),disallowTypeAhead:()=>S(e.disallowTypeAhead),shouldUseVirtualFocus:()=>S(e.shouldUseVirtualFocus),allowsTabNavigation:()=>S(e.allowsTabNavigation),isVirtualized:()=>S(e.isVirtualized),scrollToKey:i=>S(e.scrollToKey)?.(i)},t)}/*!
155
+ */function Km(e,t,n){const r=Tm({usage:"search",sensitivity:"base"}),o=_(()=>{const i=M(e.keyboardDelegate);return i||new Bm(e.collection,t,r)});return Lm({selectionManager:()=>M(e.selectionManager),keyboardDelegate:o,autoFocus:()=>M(e.autoFocus),deferAutoFocus:()=>M(e.deferAutoFocus),shouldFocusWrap:()=>M(e.shouldFocusWrap),disallowEmptySelection:()=>M(e.disallowEmptySelection),selectOnFocus:()=>M(e.selectOnFocus),disallowTypeAhead:()=>M(e.disallowTypeAhead),shouldUseVirtualFocus:()=>M(e.shouldUseVirtualFocus),allowsTabNavigation:()=>M(e.allowsTabNavigation),isVirtualized:()=>M(e.isVirtualized),scrollToKey:i=>M(e.scrollToKey)?.(i)},t)}/*!
156
156
  * Portions of this file are based on code from ariakit
157
157
  * MIT Licensed, Copyright (c) Diego Haz.
158
158
  *
159
159
  * Credits to the ariakit team:
160
160
  * https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
161
- */const Fu=["button","color","file","image","reset","submit"];function $u(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?Fu.indexOf(e.type)!==-1:!1}function Nu(e){let t;const n=Me({type:"button"},e),[r,o]=j(n,["ref","type","disabled"]),i=pu(()=>t,()=>"button"),s=C(()=>{const c=i();return c==null?!1:$u({tagName:c,type:r.type})}),a=C(()=>i()==="input"),l=C(()=>i()==="a"&&t?.getAttribute("href")!=null);return y(bn,L({as:"button",ref(c){var d=st(u=>t=u,r.ref);typeof d=="function"&&d(c)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const $i=ce();function Ni(){return he($i)}function Ku(){const e=Ni();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
161
+ */const zm=["button","color","file","image","reset","submit"];function Um(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?zm.indexOf(e.type)!==-1:!1}function Wm(e){let t;const n=ct({type:"button"},e),[r,o]=J(n,["ref","type","disabled"]),i=wm(()=>t,()=>"button"),s=_(()=>{const l=i();return l==null?!1:Um({tagName:l,type:r.type})}),a=_(()=>i()==="input"),c=_(()=>i()==="a"&&t?.getAttribute("href")!=null);return v(po,N({as:"button",ref(l){var d=fn(u=>t=u,r.ref);typeof d=="function"&&d(l)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!c()?"button":void 0},get tabIndex(){return!s()&&!c()&&!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 wl=xe();function xl(){return Ce(wl)}function jm(){const e=xl();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
162
162
  * Portions of this file are based on code from ariakit.
163
163
  * MIT Licensed, Copyright (c) Diego Haz.
164
164
  *
165
165
  * Credits to the Ariakit team:
166
166
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
167
- */function Ki(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function zu(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&&Ki(o,n))return r+1}return 0}function Bu(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:Ki(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function zi(e,t){const n=Bu(e);e!==n&&t(n)}function Vu(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return je(r).body}function Uu(e,t){T(()=>{const n=setTimeout(()=>{zi(e(),t)});K(()=>clearTimeout(n))})}function ju(e,t){if(typeof IntersectionObserver!="function"){Uu(e,t);return}let n=[];T(()=>{const r=()=>{const s=!!n.length;n=e(),s&&zi(e(),t)},o=Vu(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}K(()=>i.disconnect())})}/*!
167
+ */function Sl(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Hm(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&&Sl(o,n))return r+1}return 0}function Ym(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),c=s.ref();return a===c||!a||!c?0:Sl(a,c)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function El(e,t){const n=Ym(e);e!==n&&t(n)}function qm(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 Pt(r).body}function Gm(e,t){V(()=>{const n=setTimeout(()=>{El(e(),t)});Y(()=>clearTimeout(n))})}function Xm(e,t){if(typeof IntersectionObserver!="function"){Gm(e,t);return}let n=[];V(()=>{const r=()=>{const s=!!n.length;n=e(),s&&El(e(),t)},o=qm(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}Y(()=>i.disconnect())})}/*!
168
168
  * Portions of this file are based on code from ariakit.
169
169
  * MIT Licensed, Copyright (c) Diego Haz.
170
170
  *
@@ -172,14 +172,14 @@
172
172
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
173
173
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
174
174
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
175
- */function qu(e={}){const[t,n]=Zc({value:()=>S(e.items),onChange:i=>e.onItemsChange?.(i)});ju(t,n);const r=i=>(n(s=>{const a=zu(s,i);return _c(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>y($i.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Hu(e){const t=Ku(),n=Me({shouldRegisterItem:!0},e);T(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());K(r)})}var J=e=>typeof e=="function"?e():e,Cr=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Or=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},wn=new Map,Wu=e=>{T(()=>{const t=J(e.style)??{},n=J(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=wn.get(e.key);o?o.activeCount++:wn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=wn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}wn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Bi=Wu,Gu=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Yu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Xu=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=Gu(o,t),u=d-l-r*c;(c!==0||u!==0)&&Yu(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Vi,Ui]=O([]),Ju=e=>Vi().indexOf(e)===Vi().length-1,Zu=e=>{const t=L({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Te();let r=[0,0],o=null,i=null;T(()=>{J(t.enabled)&&(Ui(c=>[...c,n]),K(()=>{Ui(c=>c.filter(d=>d!==n))}))}),T(()=>{if(!J(t.enabled)||!J(t.hideScrollbar))return;const{body:c}=document,d=window.innerWidth-c.offsetWidth;if(J(t.preventScrollbarShift)){const u={overflow:"hidden"},f=[];d>0&&(J(t.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${d}px)`,f.push({key:"--scrollbar-width",value:`${d}px`}));const g=window.scrollY,h=window.scrollX;Bi({key:"prevent-scroll",element:c,style:u,properties:f,cleanup:()=>{J(t.restoreScrollPosition)&&d>0&&window.scrollTo(h,g)}})}else Bi({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),T(()=>{!Ju(n)||!J(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),K(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=ji(c),o=null,i=null},a=c=>{const d=c.target,u=J(t.element),f=Qu(c),g=Math.abs(f[0])>Math.abs(f[1])?"x":"y",h=g==="x"?f[0]:f[1],p=qi(d,g,h,u);let m;u&&Or(u,d)?m=!p:m=!0,m&&c.cancelable&&c.preventDefault()},l=c=>{const d=J(t.element),u=c.target;let f;if(c.touches.length===2)f=!J(t.allowPinchZoom);else{if(o==null||i===null){const g=ji(c).map((p,m)=>r[m]-p),h=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=h,i=h==="x"?g[0]:g[1]}if(u.type==="range")f=!1;else{const g=qi(u,o,i,d);d&&Or(d,u)?f=!g:f=!0}}f&&c.cancelable&&c.preventDefault()}},Qu=e=>[e.deltaX,e.deltaY],ji=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],qi=(e,t,n,r)=>{const o=r!==null&&Or(r,e),[i,s]=Xu(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},ed=Zu,Hi=ed;const Wi=ce();function td(){return he(Wi)}function nd(e){let t;const n=td(),[r,o]=j(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=u=>{i.add(u);const f=n?.registerNestedLayer(u);return()=>{i.delete(u),f?.()}};fu({shouldExcludeElement:u=>t?r.excludedElements?.some(f=>Le(f(),u))||[...i].some(f=>Le(f,u)):!1,onPointerDownOutside:u=>{!t||pe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!pe.isTopMostLayer(t)||(r.onPointerDownOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.())},onFocusOutside:u=>{r.onFocusOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.()}},()=>t),Qc({ownerDocument:()=>je(t),onEscapeKeyDown:u=>{!t||!pe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(u),!u.defaultPrevented&&r.onDismiss&&(u.preventDefault(),r.onDismiss()))}}),ht(()=>{if(!t)return;pe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const u=n?.registerNestedLayer(t);pe.assignPointerEventToLayers(),pe.disableBodyPointerEvents(t),K(()=>{t&&(pe.removeLayer(t),u?.(),pe.assignPointerEventToLayers(),pe.restoreBodyPointerEvents(t))})}),T(tt([()=>t,()=>r.disableOutsidePointerEvents],([u,f])=>{if(!u)return;const g=pe.find(u);g&&g.isPointerBlocking!==f&&(g.isPointerBlocking=f,pe.assignPointerEventToLayers()),f&&pe.disableBodyPointerEvents(u),K(()=>{pe.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:s};return y(Wi.Provider,{value:d,get children(){return y(bn,L({as:"div",ref(u){var f=st(g=>t=g,r.ref);typeof f=="function"&&f(u)}},o))}})}const Gi=ce();function rd(){const e=he(Gi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function od(e){const t=rd(),[n,r]=j(e,["ref","style"]);return y(bn,L({as:"div",ref(o){var i=st(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 id=["top","right","bottom","left"],Ye=Math.min,me=Math.max,vn=Math.round,xn=Math.floor,De=e=>({x:e,y:e}),sd={left:"right",right:"left",bottom:"top",top:"bottom"},ad={start:"end",end:"start"};function _r(e,t,n){return me(e,Ye(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function Yi(e){return e==="x"?"y":"x"}function Pr(e){return e==="y"?"height":"width"}function lt(e){return["top","bottom"].includes(Xe(e))?"y":"x"}function Ar(e){return Yi(lt(e))}function ld(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=Ar(e),i=Pr(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Sn(s)),[s,Sn(s)]}function cd(e){const t=Sn(e);return[Tr(e),t,Tr(t)]}function Tr(e){return e.replace(/start|end/g,t=>ad[t])}function ud(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 dd(e,t,n,r){const o=vt(e);let i=ud(Xe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Tr)))),i}function Sn(e){return e.replace(/left|right|bottom|top/g,t=>sd[t])}function fd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xi(e){return typeof e!="number"?fd(e):{top:e,right:e,bottom:e,left:e}}function kn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ji(e,t,n){let{reference:r,floating:o}=e;const i=lt(t),s=Ar(t),a=Pr(s),l=Xe(t),c=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-o.width,y:u};break;default:g={x:r.x,y:r.y}}switch(vt(t)){case"start":g[s]-=f*(n&&c?-1:1);break;case"end":g[s]+=f*(n&&c?-1:1);break}return g}const hd=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Ji(c,r,l),f=r,g={},h=0;for(let p=0;p<a.length;p++){const{name:m,fn:b}=a[p],{x:w,y:v,data:x,reset:_}=await b({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});d=w??d,u=v??u,g={...g,[m]:{...g[m],...x}},_&&h<=50&&(h++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(c=_.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:d,y:u}=Ji(c,f,l)),p=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:g}};async function jt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:g=0}=at(t,e),h=Xi(g),m=a[f?u==="floating"?"reference":"floating":u],b=kn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=u==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}: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},_=kn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:l}):w);return{top:(b.top-_.top+h.top)/x.y,bottom:(_.bottom-b.bottom+h.bottom)/x.y,left:(b.left-_.left+h.left)/x.x,right:(_.right-b.right+h.right)/x.x}}const gd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=at(e,t)||{};if(c==null)return{};const u=Xi(d),f={x:n,y:r},g=Ar(o),h=Pr(g),p=await s.getDimensions(c),m=g==="y",b=m?"top":"left",w=m?"bottom":"right",v=m?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[g]-f[g]-i.floating[h],_=f[g]-i.reference[g],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=E?E[v]:0;(!k||!await(s.isElement==null?void 0:s.isElement(E)))&&(k=a.floating[v]||i.floating[h]);const F=x/2-_/2,P=k/2-p[h]/2-1,R=Ye(u[b],P),M=Ye(u[w],P),I=R,re=k-p[h]-M,Y=k/2-p[h]/2+F,fe=_r(I,Y,re),$=!l.arrow&&vt(o)!=null&&Y!==fe&&i.reference[h]/2-(Y<I?R:M)-p[h]/2<0,V=$?Y<I?Y-I:Y-re:0;return{[g]:f[g]+V,data:{[g]:fe,centerOffset:Y-fe-V,...$&&{alignmentOffset:V}},reset:$}}}),pd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=at(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Xe(o),w=lt(a),v=Xe(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(v||!p?[Sn(a)]:cd(a)),E=h!=="none";!f&&E&&_.push(...dd(a,p,h,x));const k=[a,..._],F=await jt(t,m),P=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(F[b]),u){const Y=ld(o,s,x);P.push(F[Y[0]],F[Y[1]])}if(R=[...R,{placement:o,overflows:P}],!P.every(Y=>Y<=0)){var M,I;const Y=(((M=i.flip)==null?void 0:M.index)||0)+1,fe=k[Y];if(fe)return{data:{index:Y,overflows:R},reset:{placement:fe}};let $=(I=R.filter(V=>V.overflows[0]<=0).sort((V,Q)=>V.overflows[1]-Q.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(g){case"bestFit":{var re;const V=(re=R.filter(Q=>{if(E){const se=lt(Q.placement);return se===w||se==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(se=>se>0).reduce((se,At)=>se+At,0)]).sort((Q,se)=>Q[1]-se[1])[0])==null?void 0:re[0];V&&($=V);break}case"initialPlacement":$=a;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function Zi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qi(e){return id.some(t=>e[t]>=0)}const md=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 jt(t,{...o,elementContext:"reference"}),s=Zi(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Qi(s)}}}case"escaped":{const i=await jt(t,{...o,altBoundary:!0}),s=Zi(i,n.floating);return{data:{escapedOffsets:s,escaped:Qi(s)}}}default:return{}}}}};async function yd(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xe(n),a=vt(n),l=lt(n)==="y",c=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,u=at(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),l?{x:g*d,y:f*c}:{x:f*c,y:g*d}}const bd=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 yd(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}}}}},wd=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:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...l}=at(e,t),c={x:n,y:r},d=await jt(t,l),u=lt(Xe(o)),f=Yi(u);let g=c[f],h=c[u];if(i){const m=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=g+d[m],v=g-d[b];g=_r(w,g,v)}if(s){const m=u==="y"?"top":"left",b=u==="y"?"bottom":"right",w=h+d[m],v=h-d[b];h=_r(w,h,v)}const p=a.fn({...t,[f]:g,[u]:h});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[u]:s}}}}}},vd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=at(e,t),d=await jt(t,c),u=Xe(o),f=vt(o),g=lt(o)==="y",{width:h,height:p}=i.floating;let m,b;u==="top"||u==="bottom"?(m=u,b=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,m=f==="end"?"top":"bottom");const w=p-d.top-d.bottom,v=h-d.left-d.right,x=Ye(p-d[m],w),_=Ye(h-d[b],v),E=!t.middlewareData.shift;let k=x,F=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=w),E&&!f){const R=me(d.left,0),M=me(d.right,0),I=me(d.top,0),re=me(d.bottom,0);g?F=h-2*(R!==0||M!==0?R+M:me(d.left,d.right)):k=p-2*(I!==0||re!==0?I+re:me(d.top,d.bottom))}await l({...t,availableWidth:F,availableHeight:k});const P=await s.getDimensions(a.floating);return h!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function En(){return typeof window<"u"}function xt(e){return es(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(es(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function es(e){return En()?e instanceof Node||e instanceof ye(e).Node:!1}function Oe(e){return En()?e instanceof Element||e instanceof ye(e).Element:!1}function Re(e){return En()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function ts(e){return!En()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function qt(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 xd(e){return["table","td","th"].includes(xt(e))}function Cn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Lr(e){const t=Mr(),n=Oe(e)?_e(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Sd(e){let t=Je(e);for(;Re(t)&&!St(t);){if(Lr(t))return t;if(Cn(t))return null;t=Je(t)}return null}function Mr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function St(e){return["html","body","#document"].includes(xt(e))}function _e(e){return ye(e).getComputedStyle(e)}function On(e){return Oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ts(e)&&e.host||Ie(e);return ts(t)?t.host:t}function ns(e){const t=Je(e);return St(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&qt(t)?t:ns(t)}function Ht(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ns(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ye(o);if(i){const a=Dr(s);return t.concat(s,s.visualViewport||[],qt(o)?o:[],a&&n?Ht(a):[])}return t.concat(o,Ht(o,[],n))}function Dr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rs(e){const t=_e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=vn(n)!==i||vn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ir(e){return Oe(e)?e:e.contextElement}function kt(e){const t=Ir(e);if(!Re(t))return De(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=rs(t);let s=(i?vn(n.width):n.width)/r,a=(i?vn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const kd=De(0);function os(e){const t=ye(e);return!Mr()||!t.visualViewport?kd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ed(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ye(e)?!1:t}function ct(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ir(e);let s=De(1);t&&(r?Oe(r)&&(s=kt(r)):s=kt(e));const a=Ed(i,n,r)?os(i):De(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const f=ye(i),g=r&&Oe(r)?ye(r):r;let h=f,p=Dr(h);for(;p&&r&&g!==h;){const m=kt(p),b=p.getBoundingClientRect(),w=_e(p),v=b.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,x=b.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,u*=m.y,l+=v,c+=x,h=ye(p),p=Dr(h)}}return kn({width:d,height:u,x:l,y:c})}function Rr(e,t){const n=On(e).scrollLeft;return t?t.left+n:ct(Ie(e)).left+n}function is(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Rr(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Cd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ie(r),a=t?Cn(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=De(1);const d=De(0),u=Re(r);if((u||!u&&!i)&&((xt(r)!=="body"||qt(s))&&(l=On(r)),Re(r))){const g=ct(r);c=kt(r),d.x=g.x+r.clientLeft,d.y=g.y+r.clientTop}const f=s&&!u&&!i?is(s,l,!0):De(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function Od(e){return Array.from(e.getClientRects())}function _d(e){const t=Ie(e),n=On(e),r=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Rr(e);const a=-n.scrollTop;return _e(r).direction==="rtl"&&(s+=me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Pd(e,t){const n=ye(e),r=Ie(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Mr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Ad(e,t){const n=ct(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Re(e)?kt(e):De(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 ss(e,t,n){let r;if(t==="viewport")r=Pd(e,n);else if(t==="document")r=_d(Ie(e));else if(Oe(t))r=Ad(t,n);else{const o=os(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return kn(r)}function as(e,t){const n=Je(e);return n===t||!Oe(n)||St(n)?!1:_e(n).position==="fixed"||as(n,t)}function Td(e,t){const n=t.get(e);if(n)return n;let r=Ht(e,[],!1).filter(a=>Oe(a)&&xt(a)!=="body"),o=null;const i=_e(e).position==="fixed";let s=i?Je(e):e;for(;Oe(s)&&!St(s);){const a=_e(s),l=Lr(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||qt(s)&&!l&&as(e,s))?r=r.filter(d=>d!==s):o=a,s=Je(s)}return t.set(e,r),r}function Ld(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Cn(t)?[]:Td(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const u=ss(t,d,o);return c.top=me(u.top,c.top),c.right=Ye(u.right,c.right),c.bottom=Ye(u.bottom,c.bottom),c.left=me(u.left,c.left),c},ss(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Md(e){const{width:t,height:n}=rs(e);return{width:t,height:n}}function Dd(e,t,n){const r=Re(t),o=Ie(t),i=n==="fixed",s=ct(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=De(0);if(r||!r&&!i)if((xt(t)!=="body"||qt(o))&&(a=On(t)),r){const f=ct(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Rr(o));const c=o&&!r&&!i?is(o,a):De(0),d=s.left+a.scrollLeft-l.x-c.x,u=s.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:s.width,height:s.height}}function Fr(e){return _e(e).position==="static"}function ls(e,t){if(!Re(e)||_e(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function cs(e,t){const n=ye(e);if(Cn(e))return n;if(!Re(e)){let o=Je(e);for(;o&&!St(o);){if(Oe(o)&&!Fr(o))return o;o=Je(o)}return n}let r=ls(e,t);for(;r&&xd(r)&&Fr(r);)r=ls(r,t);return r&&St(r)&&Fr(r)&&!Lr(r)?n:r||Sd(e)||n}const Id=async function(e){const t=this.getOffsetParent||cs,n=this.getDimensions,r=await n(e.floating);return{reference:Dd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Rd(e){return _e(e).direction==="rtl"}const us={convertOffsetParentRelativeRectToViewportRelativeRect:Cd,getDocumentElement:Ie,getClippingRect:Ld,getOffsetParent:cs,getElementRects:Id,getClientRects:Od,getDimensions:Md,getScale:kt,isElement:Oe,isRTL:Rd};function ds(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fd(e,t){let n=null,r;const o=Ie(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:g}=c;if(a||t(),!f||!g)return;const h=xn(u),p=xn(o.clientWidth-(d+f)),m=xn(o.clientHeight-(u+g)),b=xn(d),v={rootMargin:-h+"px "+-p+"px "+-m+"px "+-b+"px",threshold:me(0,Ye(1,l))||1};let x=!0;function _(E){const k=E[0].intersectionRatio;if(k!==l){if(!x)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!ds(c,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(_,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,v)}n.observe(e)}return s(!0),i}function $d(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ir(e),d=o||i?[...c?Ht(c):[],...Ht(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const u=c&&a?Fd(c,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(b=>{let[w]=b;w&&w.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=g)==null||v.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let h,p=l?ct(e):null;l&&m();function m(){const b=ct(e);p&&!ds(p,b)&&n(),p=b,h=requestAnimationFrame(m)}return n(),()=>{var b;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),u?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const Nd=bd,Kd=wd,zd=pd,Bd=vd,Vd=md,Ud=gd,jd=(e,t,n)=>{const r=new Map,o={platform:us,...n},i={...o.platform,_c:r};return hd(e,t,{...o,platform:i})};function fs(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 qd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?fs(r):e?e.getBoundingClientRect():fs()}}}function Hd(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const Wd={top:"bottom",right:"left",bottom:"top",left:"right"};function Gd(e,t){const[n,r]=e.split("-"),o=Wd[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 Yd(e){const t=Me({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]=O(),[o,i]=O(),[s,a]=O(t.placement),l=()=>qd(t.anchorRef(),t.getAnchorRect),{direction:c}=kr();async function d(){const f=l(),g=n(),h=o();if(!f||!g)return;const p=(h?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const b=[Nd(({placement:E})=>{const k=!!E.split("-")[1];return{mainAxis:m,crossAxis:k?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const E=typeof t.flip=="string"?t.flip.split(" "):void 0;if(E!==void 0&&!E.every(Hd))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(zd({padding:t.overflowPadding,fallbackPlacements:E}))}(t.slide||t.overlap)&&b.push(Kd({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Bd({padding:t.overflowPadding,apply({availableWidth:E,availableHeight:k,rects:F}){const P=Math.round(F.reference.width);E=Math.floor(E),k=Math.floor(k),g.style.setProperty("--kb-popper-anchor-width",`${P}px`),g.style.setProperty("--kb-popper-content-available-width",`${E}px`),g.style.setProperty("--kb-popper-content-available-height",`${k}px`),t.sameWidth&&(g.style.width=`${P}px`),t.fitViewport&&(g.style.maxWidth=`${E}px`,g.style.maxHeight=`${k}px`)}})),t.hideWhenDetached&&b.push(Vd({padding:t.detachedPadding})),h&&b.push(Ud({element:h,padding:t.arrowPadding}));const w=await jd(f,g,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...us,isRTL:()=>c()==="rtl"}});if(a(w.placement),t.onCurrentPlacementChange?.(w.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",Gd(w.placement,c()));const v=Math.round(w.x),x=Math.round(w.y);let _;if(t.hideWhenDetached&&(_=w.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${v}px, ${x}px, 0)`,visibility:_}),h&&w.middlewareData.arrow){const{x:E,y:k}=w.middlewareData.arrow,F=w.placement.split("-")[0];Object.assign(h.style,{left:E!=null?`${E}px`:"",top:k!=null?`${k}px`:"",[F]:"100%"})}}T(()=>{const f=l(),g=n();if(!f||!g)return;const h=$d(f,g,d,{elementResize:typeof ResizeObserver=="function"});K(h)}),T(()=>{const f=n(),g=t.contentRef();!f||!g||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(g).zIndex})});const u={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return y(Gi.Provider,{value:u,get children(){return t.children}})}const hs=ce();function gs(){return he(hs)}function Et(){const e=gs();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const ps=ce();function Ct(){const e=he(ps);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
175
+ */function Zm(e={}){const[t,n]=rm({value:()=>M(e.items),onChange:i=>e.onItemsChange?.(i)});Xm(t,n);const r=i=>(n(s=>{const a=Hm(s,i);return Rp(s,i,a)}),()=>{n(s=>{const a=s.filter(c=>c.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>v(wl.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Jm(e){const t=jm(),n=ct({shouldRegisterItem:!0},e);V(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Y(r)})}var de=e=>typeof e=="function"?e():e,cs=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),ls=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},mo=new Map,Qm=e=>{V(()=>{const t=de(e.style)??{},n=de(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=mo.get(e.key);o?o.activeCount++:mo.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);Y(()=>{const i=mo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}mo.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?.()}})})},Pl=Qm,ey=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},ty=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},ny=(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[c,l,d]=ey(o,t),u=d-c-r*l;(l!==0||u!==0)&&ty(o,t)&&(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Cl,kl]=L([]),ry=e=>Cl().indexOf(e)===Cl().length-1,oy=e=>{const t=N({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Be();let r=[0,0],o=null,i=null;V(()=>{de(t.enabled)&&(kl(l=>[...l,n]),Y(()=>{kl(l=>l.filter(d=>d!==n))}))}),V(()=>{if(!de(t.enabled)||!de(t.hideScrollbar))return;const{body:l}=document,d=window.innerWidth-l.offsetWidth;if(de(t.preventScrollbarShift)){const u={overflow:"hidden"},h=[];d>0&&(de(t.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${d}px)`,h.push({key:"--scrollbar-width",value:`${d}px`}));const g=window.scrollY,f=window.scrollX;Pl({key:"prevent-scroll",element:l,style:u,properties:h,cleanup:()=>{de(t.restoreScrollPosition)&&d>0&&window.scrollTo(f,g)}})}else Pl({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),V(()=>{!ry(n)||!de(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",c,{passive:!1}),Y(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",c)}))});const s=l=>{r=Ol(l),o=null,i=null},a=l=>{const d=l.target,u=de(t.element),h=iy(l),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=g==="x"?h[0]:h[1],p=Tl(d,g,f,u);let m;u&&ls(u,d)?m=!p:m=!0,m&&l.cancelable&&l.preventDefault()},c=l=>{const d=de(t.element),u=l.target;let h;if(l.touches.length===2)h=!de(t.allowPinchZoom);else{if(o==null||i===null){const g=Ol(l).map((p,m)=>r[m]-p),f=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=f,i=f==="x"?g[0]:g[1]}if(u.type==="range")h=!1;else{const g=Tl(u,o,i,d);d&&ls(d,u)?h=!g:h=!0}}h&&l.cancelable&&l.preventDefault()}},iy=e=>[e.deltaX,e.deltaY],Ol=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Tl=(e,t,n,r)=>{const o=r!==null&&ls(r,e),[i,s]=ny(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},sy=oy,Al=sy;const $l=xe();function ay(){return Ce($l)}function cy(e){let t;const n=ay(),[r,o]=J(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=u=>{i.add(u);const h=n?.registerNestedLayer(u);return()=>{i.delete(u),h?.()}};ym({shouldExcludeElement:u=>t?r.excludedElements?.some(h=>at(h(),u))||[...i].some(h=>at(h,u)):!1,onPointerDownOutside:u=>{!t||Re.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Re.isTopMostLayer(t)||(r.onPointerDownOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.())},onFocusOutside:u=>{r.onFocusOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.()}},()=>t),om({ownerDocument:()=>Pt(t),onEscapeKeyDown:u=>{!t||!Re.isTopMostLayer(t)||(r.onEscapeKeyDown?.(u),!u.defaultPrevented&&r.onDismiss&&(u.preventDefault(),r.onDismiss()))}}),an(()=>{if(!t)return;Re.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const u=n?.registerNestedLayer(t);Re.assignPointerEventToLayers(),Re.disableBodyPointerEvents(t),Y(()=>{t&&(Re.removeLayer(t),u?.(),Re.assignPointerEventToLayers(),Re.restoreBodyPointerEvents(t))})}),V(sn([()=>t,()=>r.disableOutsidePointerEvents],([u,h])=>{if(!u)return;const g=Re.find(u);g&&g.isPointerBlocking!==h&&(g.isPointerBlocking=h,Re.assignPointerEventToLayers()),h&&Re.disableBodyPointerEvents(u),Y(()=>{Re.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:s};return v($l.Provider,{value:d,get children(){return v(po,N({as:"div",ref(u){var h=fn(g=>t=g,r.ref);typeof h=="function"&&h(u)}},o))}})}const Dl=xe();function ly(){const e=Ce(Dl);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function uy(e){const t=ly(),[n,r]=J(e,["ref","style"]);return v(po,N({as:"div",ref(o){var i=fn(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 dy=["top","right","bottom","left"],Ut=Math.min,Me=Math.max,yo=Math.round,vo=Math.floor,lt=e=>({x:e,y:e}),fy={left:"right",right:"left",bottom:"top",top:"bottom"},hy={start:"end",end:"start"};function us(e,t,n){return Me(e,Ut(t,n))}function hn(e,t){return typeof e=="function"?e(t):e}function Wt(e){return e.split("-")[0]}function Rn(e){return e.split("-")[1]}function Rl(e){return e==="x"?"y":"x"}function ds(e){return e==="y"?"height":"width"}function gn(e){return["top","bottom"].includes(Wt(e))?"y":"x"}function fs(e){return Rl(gn(e))}function gy(e,t,n){n===void 0&&(n=!1);const r=Rn(e),o=fs(e),i=ds(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=bo(s)),[s,bo(s)]}function py(e){const t=bo(e);return[hs(e),t,hs(t)]}function hs(e){return e.replace(/start|end/g,t=>hy[t])}function my(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 yy(e,t,n,r){const o=Rn(e);let i=my(Wt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(hs)))),i}function bo(e){return e.replace(/left|right|bottom|top/g,t=>fy[t])}function vy(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ml(e){return typeof e!="number"?vy(e):{top:e,right:e,bottom:e,left:e}}function wo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Il(e,t,n){let{reference:r,floating:o}=e;const i=gn(t),s=fs(t),a=ds(s),c=Wt(t),l=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-o.width,y:u};break;default:g={x:r.x,y:r.y}}switch(Rn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}const by=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Il(l,r,c),h=r,g={},f=0;for(let p=0;p<a.length;p++){const{name:m,fn:y}=a[p],{x:b,y:x,data:w,reset:C}=await y({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:l,platform:s,elements:{reference:e,floating:t}});d=b??d,u=x??u,g={...g,[m]:{...g[m],...w}},C&&f<=50&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:u}=Il(l,h,c)),p=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:g}};async function wr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:g=0}=hn(t,e),f=Ml(g),m=a[h?u==="floating"?"reference":"floating":u],y=wo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:d,strategy:c})),b=u==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=wo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-C.top+f.top)/w.y,bottom:(C.bottom-y.bottom+f.bottom)/w.y,left:(y.left-C.left+f.left)/w.x,right:(C.right-y.right+f.right)/w.x}}const wy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:d=0}=hn(e,t)||{};if(l==null)return{};const u=Ml(d),h={x:n,y:r},g=fs(o),f=ds(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",b=m?"bottom":"right",x=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=w/2-C/2,P=O/2-p[f]/2-1,T=Ut(u[y],P),I=Ut(u[b],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=us($,U,K),F=!c.arrow&&Rn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,W=F?U<$?U-$:U-K:0;return{[g]:h[g]+W,data:{[g]:Q,centerOffset:U-Q-W,...F&&{alignmentOffset:W}},reset:F}}}),xy=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:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=hn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Wt(o),b=gn(a),x=Wt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[bo(a)]:py(a)),S=f!=="none";!h&&S&&C.push(...yy(a,p,f,w));const O=[a,...C],D=await wr(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(D[y]),u){const U=gy(o,s,w);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q)return{data:{index:U,overflows:T},reset:{placement:Q}};let F=($=T.filter(W=>W.overflows[0]<=0).sort((W,G)=>W.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(g){case"bestFit":{var K;const W=(K=T.filter(G=>{if(S){const q=gn(G.placement);return q===b||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function _l(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ll(e){return dy.some(t=>e[t]>=0)}const Sy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=hn(e,t);switch(r){case"referenceHidden":{const i=await wr(t,{...o,elementContext:"reference"}),s=_l(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ll(s)}}}case"escaped":{const i=await wr(t,{...o,altBoundary:!0}),s=_l(i,n.floating);return{data:{escapedOffsets:s,escaped:Ll(s)}}}default:return{}}}}};async function Ey(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Wt(n),a=Rn(n),c=gn(n)==="y",l=["left","top"].includes(s)?-1:1,d=i&&c?-1:1,u=hn(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*d,y:h*l}:{x:h*l,y:g*d}}const Py=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,c=await Ey(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Cy=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:m=>{let{x:y,y:b}=m;return{x:y,y:b}}},...c}=hn(e,t),l={x:n,y:r},d=await wr(t,c),u=gn(Wt(o)),h=Rl(u);let g=l[h],f=l[u];if(i){const m=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=g+d[m],x=g-d[y];g=us(b,g,x)}if(s){const m=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=f+d[m],x=f-d[y];f=us(b,f,x)}const p=a.fn({...t,[h]:g,[u]:f});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:i,[u]:s}}}}}},ky=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=hn(e,t),d=await wr(t,l),u=Wt(o),h=Rn(o),g=gn(o)==="y",{width:f,height:p}=i.floating;let m,y;u==="top"||u==="bottom"?(m=u,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=u,m=h==="end"?"top":"bottom");const b=p-d.top-d.bottom,x=f-d.left-d.right,w=Ut(p-d[m],b),C=Ut(f-d[y],x),S=!t.middlewareData.shift;let O=w,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=b),S&&!h){const T=Me(d.left,0),I=Me(d.right,0),$=Me(d.top,0),K=Me(d.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Me(d.left,d.right)):O=p-2*($!==0||K!==0?$+K:Me(d.top,d.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function xo(){return typeof window<"u"}function Mn(e){return Nl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ut(e){var t;return(t=(Nl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nl(e){return xo()?e instanceof Node||e instanceof Ie(e).Node:!1}function et(e){return xo()?e instanceof Element||e instanceof Ie(e).Element:!1}function dt(e){return xo()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function Fl(e){return!xo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}function xr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Oy(e){return["table","td","th"].includes(Mn(e))}function So(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gs(e){const t=ps(),n=et(e)?tt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ty(e){let t=jt(e);for(;dt(t)&&!In(t);){if(gs(t))return t;if(So(t))return null;t=jt(t)}return null}function ps(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function In(e){return["html","body","#document"].includes(Mn(e))}function tt(e){return Ie(e).getComputedStyle(e)}function Eo(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if(Mn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fl(e)&&e.host||ut(e);return Fl(t)?t.host:t}function Vl(e){const t=jt(e);return In(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&xr(t)?t:Vl(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Vl(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ie(o);if(i){const a=ms(s);return t.concat(s,s.visualViewport||[],xr(o)?o:[],a&&n?Sr(a):[])}return t.concat(o,Sr(o,[],n))}function ms(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bl(e){const t=tt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=dt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=yo(n)!==i||yo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ys(e){return et(e)?e:e.contextElement}function _n(e){const t=ys(e);if(!dt(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Bl(t);let s=(i?yo(n.width):n.width)/r,a=(i?yo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ay=lt(0);function Kl(e){const t=Ie(e);return!ps()||!t.visualViewport?Ay:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $y(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ie(e)?!1:t}function pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ys(e);let s=lt(1);t&&(r?et(r)&&(s=_n(r)):s=_n(e));const a=$y(i,n,r)?Kl(i):lt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const h=Ie(i),g=r&&et(r)?Ie(r):r;let f=h,p=ms(f);for(;p&&r&&g!==f;){const m=_n(p),y=p.getBoundingClientRect(),b=tt(p),x=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,w=y.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,l*=m.y,d*=m.x,u*=m.y,c+=x,l+=w,f=Ie(p),p=ms(f)}}return wo({width:d,height:u,x:c,y:l})}function vs(e,t){const n=Eo(e).scrollLeft;return t?t.left+n:pn(ut(e)).left+n}function zl(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:vs(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Dy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ut(r),a=t?So(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const d=lt(0),u=dt(r);if((u||!u&&!i)&&((Mn(r)!=="body"||xr(s))&&(c=Eo(r)),dt(r))){const g=pn(r);l=_n(r),d.x=g.x+r.clientLeft,d.y=g.y+r.clientTop}const h=s&&!u&&!i?zl(s,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-c.scrollTop*l.y+d.y+h.y}}function Ry(e){return Array.from(e.getClientRects())}function My(e){const t=ut(e),n=Eo(e),r=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+vs(e);const a=-n.scrollTop;return tt(r).direction==="rtl"&&(s+=Me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Iy(e,t){const n=Ie(e),r=ut(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=ps();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function _y(e,t){const n=pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=dt(e)?_n(e):lt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Ul(e,t,n){let r;if(t==="viewport")r=Iy(e,n);else if(t==="document")r=My(ut(e));else if(et(t))r=_y(t,n);else{const o=Kl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return wo(r)}function Wl(e,t){const n=jt(e);return n===t||!et(n)||In(n)?!1:tt(n).position==="fixed"||Wl(n,t)}function Ly(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>et(a)&&Mn(a)!=="body"),o=null;const i=tt(e).position==="fixed";let s=i?jt(e):e;for(;et(s)&&!In(s);){const a=tt(s),c=gs(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xr(s)&&!c&&Wl(e,s))?r=r.filter(d=>d!==s):o=a,s=jt(s)}return t.set(e,r),r}function Ny(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?So(t)?[]:Ly(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,d)=>{const u=Ul(t,d,o);return l.top=Me(u.top,l.top),l.right=Ut(u.right,l.right),l.bottom=Ut(u.bottom,l.bottom),l.left=Me(u.left,l.left),l},Ul(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fy(e){const{width:t,height:n}=Bl(e);return{width:t,height:n}}function Vy(e,t,n){const r=dt(t),o=ut(t),i=n==="fixed",s=pn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!i)if((Mn(t)!=="body"||xr(o))&&(a=Eo(t)),r){const h=pn(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=vs(o));const l=o&&!r&&!i?zl(o,a):lt(0),d=s.left+a.scrollLeft-c.x-l.x,u=s.top+a.scrollTop-c.y-l.y;return{x:d,y:u,width:s.width,height:s.height}}function bs(e){return tt(e).position==="static"}function jl(e,t){if(!dt(e)||tt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ut(e)===n&&(n=n.ownerDocument.body),n}function Hl(e,t){const n=Ie(e);if(So(e))return n;if(!dt(e)){let o=jt(e);for(;o&&!In(o);){if(et(o)&&!bs(o))return o;o=jt(o)}return n}let r=jl(e,t);for(;r&&Oy(r)&&bs(r);)r=jl(r,t);return r&&In(r)&&bs(r)&&!gs(r)?n:r||Ty(e)||n}const By=async function(e){const t=this.getOffsetParent||Hl,n=this.getDimensions,r=await n(e.floating);return{reference:Vy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ky(e){return tt(e).direction==="rtl"}const Yl={convertOffsetParentRelativeRectToViewportRelativeRect:Dy,getDocumentElement:ut,getClippingRect:Ny,getOffsetParent:Hl,getElementRects:By,getClientRects:Ry,getDimensions:Fy,getScale:_n,isElement:et,isRTL:Ky};function ql(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zy(e,t){let n=null,r;const o=ut(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:d,top:u,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=vo(u),p=vo(o.clientWidth-(d+h)),m=vo(o.clientHeight-(u+g)),y=vo(d),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Me(0,Ut(1,c))||1};let w=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!ql(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function Uy(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:c=!1}=r,l=ys(e),d=o||i?[...l?Sr(l):[],...Sr(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const u=l&&a?zy(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let f,p=c?pn(e):null;c&&m();function m(){const y=pn(e);p&&!ql(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const Wy=Py,jy=Cy,Hy=xy,Yy=ky,qy=Sy,Gy=wy,Xy=(e,t,n)=>{const r=new Map,o={platform:Yl,...n},i={...o.platform,_c:r};return by(e,t,{...o,platform:i})};function Gl(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 Zy(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Gl(r):e?e.getBoundingClientRect():Gl()}}}function Jy(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const Qy={top:"bottom",right:"left",bottom:"top",left:"right"};function ev(e,t){const[n,r]=e.split("-"),o=Qy[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 tv(e){const t=ct({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]=L(),[o,i]=L(),[s,a]=L(t.placement),c=()=>Zy(t.anchorRef(),t.getAnchorRect),{direction:l}=is();async function d(){const h=c(),g=n(),f=o();if(!h||!g)return;const p=(f?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const y=[Wy(({placement:S})=>{const O=!!S.split("-")[1];return{mainAxis:m,crossAxis:O?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(Jy))throw new Error("`flip` expects a spaced-delimited list of placements");y.push(Hy({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&y.push(jy({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),y.push(Yy({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:O,rects:D}){const P=Math.round(D.reference.width);S=Math.floor(S),O=Math.floor(O),g.style.setProperty("--kb-popper-anchor-width",`${P}px`),g.style.setProperty("--kb-popper-content-available-width",`${S}px`),g.style.setProperty("--kb-popper-content-available-height",`${O}px`),t.sameWidth&&(g.style.width=`${P}px`),t.fitViewport&&(g.style.maxWidth=`${S}px`,g.style.maxHeight=`${O}px`)}})),t.hideWhenDetached&&y.push(qy({padding:t.detachedPadding})),f&&y.push(Gy({element:f,padding:t.arrowPadding}));const b=await Xy(h,g,{placement:t.placement,strategy:"absolute",middleware:y,platform:{...Yl,isRTL:()=>l()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",ev(b.placement,l()));const x=Math.round(b.x),w=Math.round(b.y);let C;if(t.hideWhenDetached&&(C=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${w}px, 0)`,visibility:C}),f&&b.middlewareData.arrow){const{x:S,y:O}=b.middlewareData.arrow,D=b.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:O!=null?`${O}px`:"",[D]:"100%"})}}V(()=>{const h=c(),g=n();if(!h||!g)return;const f=Uy(h,g,d,{elementResize:typeof ResizeObserver=="function"});Y(f)}),V(()=>{const h=n(),g=t.contentRef();!h||!g||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(g).zIndex})});const u={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return v(Dl.Provider,{value:u,get children(){return t.children}})}const Xl=xe();function Zl(){return Ce(Xl)}function Ln(){const e=Zl();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const Jl=xe();function Nn(){const e=Ce(Jl);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
176
176
  * Portions of this file are based on code from radix-ui-primitives.
177
177
  * MIT Licensed, Copyright (c) 2022 WorkOS.
178
178
  *
179
179
  * Credits to the Radix UI team:
180
180
  * https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
181
- */function Xd(e,t){return t?Wc([e.clientX,e.clientY],t):!1}function Jd(e){const t=Ct(),n=Ni(),r=gs(),o=Me({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=O(),[f,g]=O(),[h,p]=O(),[m,b]=O(),[w,v]=O(!0),[x,_]=O(s.placement),[E,k]=O([]),[F,P]=O([]),{DomCollectionProvider:R}=qu({items:F,onItemsChange:P}),M=xi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),I=hu(()=>t.forceMount()||M.isOpen()),re=Du({selectionMode:"none",dataSource:F}),Y=U=>{v(U),M.open()},fe=(U=!1)=>{M.close(),U&&r&&r.close(!0)},$=U=>{v(U),M.toggle()},V=()=>{const U=m();U&&(de(U),re.selectionManager().setFocused(!0),re.selectionManager().setFocusedKey(void 0))},Q=U=>{k(go=>[...go,U]);const Un=r?.registerNestedMenu(U);return()=>{k(go=>dr(go,U)),Un?.()}},se=U=>c===l?.side&&Xd(U,l?.area),At=U=>{se(U)&&U.preventDefault()},Ae=U=>{se(U)||V()},fm=U=>{se(U)&&U.preventDefault()};uu({isDisabled:()=>!(r==null&&M.isOpen()&&t.isModal()),targets:()=>[m(),...E()].filter(Boolean)}),T(()=>{const U=m();if(!U||!r)return;const Un=r.registerNestedMenu(U);K(()=>{Un()})});const hm={dataset:C(()=>({"data-expanded":M.isOpen()?"":void 0,"data-closed":M.isOpen()?void 0:""})),isOpen:M.isOpen,contentPresence:I,nestedMenus:E,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:w,listState:()=>re,parentMenuContext:()=>r,triggerRef:h,contentRef:m,triggerId:d,contentId:f,setTriggerRef:p,setContentRef:b,open:Y,close:fe,toggle:$,focusContent:V,onItemEnter:At,onItemLeave:Ae,onTriggerLeave:fm,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Q,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:yn(u),registerContentId:yn(g)};return y(R,{get children(){return y(hs.Provider,{value:hm,get children(){return y(Yd,L({anchorRef:h,contentRef:m,onCurrentPlacementChange:_},s))}})}})}const Zd=ce();function Qd(e){let t;const n=Ct(),r=Et(),o=Me({id:n.generateId(`item-${Te()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=O(),[c,d]=O(),[u,f]=O(),g=()=>r.listState().selectionManager(),h=()=>s.id,p=()=>g().focusedKey()===h(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Hu({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??u()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const b=Lu({key:h,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),w=P=>{ge(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(de(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},v=P=>{ge(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},x=P=>{ge(P,i.onPointerUp),!i.disabled&&P.button===0&&m()},_=P=>{if(ge(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":m();break}},E=C(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=C(()=>({"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})),F={isChecked:()=>i.checked,dataset:k,setLabelRef:f,generateId:ui(()=>s.id),registerLabel:yn(l),registerDescription:yn(d)};return y(Zd.Provider,{value:F,get children(){return y(bn,L({as:"div",ref(P){var R=st(M=>t=M,i.ref);typeof R=="function"&&R(P)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return E()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return ve([i.onPointerDown,b.onPointerDown])},get onPointerUp(){return ve([x,b.onPointerUp])},get onClick(){return ve([i.onClick,b.onClick])},get onKeyDown(){return ve([_,b.onKeyDown])},get onMouseDown(){return ve([i.onMouseDown,b.onMouseDown])},get onFocus(){return ve([i.onFocus,b.onFocus])},onPointerMove:w,onPointerLeave:v},k,s))}})}const ef=ce();function ms(){return he(ef)}function tf(e){let t;const n=Ct(),r=Et(),o=ms(),i=Me({id:n.generateId(`content-${Te()}`)},e),[s,a]=j(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Ru({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);lu({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const u=m=>{if(Le(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},f=m=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},h=m=>{ge(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(ge(m,s.onPointerMove),m.pointerType!=="mouse")return;const b=m.target,w=l!==m.clientX;Le(m.currentTarget,b)&&w&&(r.setPointerDir(m.clientX>l?"right":"left"),l=m.clientX)};return T(()=>K(r.registerContentId(s.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y(od,{get children(){return y(nd,L({ref(m){var b=st(w=>{r.setContentRef(w),r.contentPresence.setRef(w),t=w},s.ref);typeof b=="function"&&b(m)},role:"menu",get id(){return s.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return C(()=>!!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:g,get onDismiss(){return r.close},get onKeyDown(){return ve([s.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return ve([s.onMouseDown,d.onMouseDown])},get onFocusIn(){return ve([s.onFocusIn,d.onFocusIn])},get onFocusOut(){return ve([s.onFocusOut,d.onFocusOut])},onPointerEnter:h,onPointerMove:p},()=>r.dataset(),a))}})}})}function nf(e){let t;const n=Ct(),r=Et(),[o,i]=j(e,["ref"]);return Hi({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(tf,L({ref(s){var a=st(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function rf(e){return y(Qd,L({role:"menuitem",closeOnSelect:!0},e))}function of(e){const t=Et();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(Wo,e)}})}function sf(e){const t=`menu-${Te()}`,n=Me({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=xi({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:ui(()=>r.id),value:()=>r.value};return y(ps.Provider,{value:s,get children(){return y(Jd,L({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function af(e){const t=Ct(),n=Et(),r=ms(),o=Me({id:t.generateId("trigger")},e),[i,s]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,T(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),T(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),T(()=>{n.isOpen()&&r.setValue(a)}),K(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=h=>{ge(h,i.onPointerDown),h.currentTarget.dataset.pointerType=h.pointerType,!i.disabled&&h.pointerType!=="touch"&&h.button===0&&l()},d=h=>{ge(h,i.onClick),i.disabled||h.currentTarget.dataset.pointerType==="touch"&&l()},u=h=>{if(ge(h,i.onKeyDown),!i.disabled)switch(h.key){case"Enter":case" ":case"ArrowDown":h.stopPropagation(),h.preventDefault(),Gc(h.currentTarget),n.toggle("first");break;case"ArrowUp":h.stopPropagation(),h.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.previousMenu();break}},f=h=>{ge(h,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=h=>{ge(h,i.onFocus),r!==void 0&&r.setValue(a)};return T(()=>K(n.registerTriggerId(i.id))),y(Nu,L({ref(h){var p=st(n.setTriggerRef,i.ref);typeof p=="function"&&p(h)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return C(()=>!!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:d,onKeyDown:u,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function lf(e){const t=Ct(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(nf,L({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||de(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function cf(e){const t=`dropdownmenu-${Te()}`,n=Me({id:t},e);return y(sf,n)}function uf(e){return we({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 df(e){return we({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 ff(e){return we({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 hf=e=>y(cf,L({gutter:4},e)),gf=af,pf=e=>{const[,t]=j(e,["class"]);return y(of,{get mount(){return Jt()},get children(){return y(lf,L({get class(){return Ge("z-50 min-w-[128px] 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))}})},mf=e=>{const[,t]=j(e,["class"]);return y(rf,L({get class(){return Ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function yf(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function bf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function wf(e,t,n){const r=`${Zt}/v1/messages`,o=lr(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:{pageUrl:window.location.href,pageTitle:document.title}})};await fetch(r,s)}async function vf(e,t,n){if(!e||!t||!n)return;const r=`${Zt}/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 Fe=Object.create(null);Fe.open="0",Fe.close="1",Fe.ping="2",Fe.pong="3",Fe.message="4",Fe.upgrade="5",Fe.noop="6";const _n=Object.create(null);Object.keys(Fe).forEach(e=>{_n[Fe[e]]=e});const $r={type:"error",data:"parser error"},ys=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",bs=typeof ArrayBuffer=="function",ws=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Nr=({type:e,data:t},n,r)=>ys&&t instanceof Blob?n?r(t):vs(t,r):bs&&(t instanceof ArrayBuffer||ws(t))?n?r(t):vs(new Blob([t]),r):r(Fe[e]+(t||"")),vs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function xs(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kr;function xf(e,t){if(ys&&e.data instanceof Blob)return e.data.arrayBuffer().then(xs).then(t);if(bs&&(e.data instanceof ArrayBuffer||ws(e.data)))return t(xs(e.data));Nr(e,!1,n=>{Kr||(Kr=new TextEncoder),t(Kr.encode(n))})}const Ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Ss.length;e++)Wt[Ss.charCodeAt(e)]=e;const Sf=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)i=Wt[e.charCodeAt(r)],s=Wt[e.charCodeAt(r+1)],a=Wt[e.charCodeAt(r+2)],l=Wt[e.charCodeAt(r+3)],d[o++]=i<<2|s>>4,d[o++]=(s&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},kf=typeof ArrayBuffer=="function",zr=(e,t)=>{if(typeof e!="string")return{type:"message",data:ks(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Ef(e.substring(1),t)}:_n[n]?e.length>1?{type:_n[n],data:e.substring(1)}:{type:_n[n]}:$r},Ef=(e,t)=>{if(kf){const n=Sf(e);return ks(n,t)}else return{base64:!0,data:e}},ks=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Es="",Cf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Nr(i,!1,a=>{r[s]=a,++o===n&&t(r.join(Es))})})},Of=(e,t)=>{const n=e.split(Es),r=[];for(let o=0;o<n.length;o++){const i=zr(n[o],t);if(r.push(i),i.type==="error")break}return r};function _f(){return new TransformStream({transform(e,t){xf(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 Br;function Pn(e){return e.reduce((t,n)=>t+n.length,0)}function An(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Pf(e,t){Br||(Br=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(Pn(n)<1)break;const l=An(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Pn(n)<2)break;const l=An(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pn(n)<8)break;const l=An(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue($r);break}o=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pn(n)<o)break;const l=An(n,o);a.enqueue(zr(i?l:Br.decode(l),t)),r=0}if(o===0||o>e){a.enqueue($r);break}}}})}const Cs=4;function te(e){if(e)return Af(e)}function Af(e){for(var t in te.prototype)e[t]=te.prototype[t];return e}te.prototype.on=te.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},te.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.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},te.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},te.prototype.emitReserved=te.prototype.emit,te.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},te.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Se=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Tf="arraybuffer";function ym(){}function Os(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Lf=Se.setTimeout,Mf=Se.clearTimeout;function Ln(e,t){t.useNativeTimers?(e.setTimeoutFn=Lf.bind(Se),e.clearTimeoutFn=Mf.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Df=1.33;function If(e){return typeof e=="string"?Rf(e):Math.ceil((e.byteLength||e.size)*Df)}function Rf(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 _s(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ff(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function $f(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 Nf extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Vr extends te{constructor(t){super(),this.writable=!1,Ln(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 Nf(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=zr(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=Ff(t);return n.length?"?"+n:""}}class Kf extends Vr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Of(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,Cf(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]=_s()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Ps=!1;try{Ps=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const zf=Ps;function Bf(){}class Vf extends Kf{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class $e extends te{constructor(t,n,r){super(),this.createRequest=t,Ln(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=Os(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=$e.requestsCount++,$e.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=Bf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $e.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($e.requestsCount=0,$e.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",As);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,As,!1)}}function As(){for(let e in $e.requests)$e.requests.hasOwnProperty(e)&&$e.requests[e].abort()}const Uf=function(){const e=Ts({xdomain:!1});return e&&e.responseType!==null}();class jf extends Vf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Uf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new $e(Ts,this.uri(),t)}}function Ts(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||zf))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ls=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class qf extends Vr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ls?{}:Os(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;Nr(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=_s()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ur=Se.WebSocket||Se.MozWebSocket;class Hf extends qf{createSocket(t,n,r){return Ls?new Ur(t,n,r):n?new Ur(t,n):new Ur(t)}doWrite(t,n){this.ws.send(n)}}class Wf extends Vr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Pf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=_f();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Gf={websocket:Hf,webtransport:Wf,polling:jf},Yf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Xf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function jr(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=Yf.exec(e||""),i={},s=14;for(;s--;)i[Xf[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=Jf(i,i.path),i.queryKey=Zf(i,i.query),i}function Jf(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 qr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Mn=[];qr&&addEventListener("offline",()=>{Mn.forEach(e=>e())},!1);class Ze extends te{constructor(t,n){if(super(),this.binaryType=Tf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=jr(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=jr(n.host).host);Ln(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=$f(this.opts.query)),qr&&(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"})},Mn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Cs,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=If(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ze.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),qr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Mn.indexOf(this._offlineEventListener);r!==-1&&Mn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=Cs;class Qf extends Ze{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const f=new Error("probe error: "+u);f.transport=n.name,i(),this.emitReserved("upgradeError",f)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let eh=class extends Qf{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=>Gf[o]).filter(o=>!!o)),super(t,r)}};function th(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=jr(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const nh=typeof ArrayBuffer=="function",rh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ms=Object.prototype.toString,oh=typeof Blob=="function"||typeof Blob<"u"&&Ms.call(Blob)==="[object BlobConstructor]",ih=typeof File=="function"||typeof File<"u"&&Ms.call(File)==="[object FileConstructor]";function Hr(e){return nh&&(e instanceof ArrayBuffer||rh(e))||oh&&e instanceof Blob||ih&&e instanceof File}function Dn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Dn(e[n]))return!0;return!1}if(Hr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Dn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Dn(e[n]))return!0;return!1}function sh(e){const t=[],n=e.data,r=e;return r.data=Wr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Wr(e,t){if(!e)return e;if(Hr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Wr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Wr(e[r],t));return n}return e}function ah(e,t){return e.data=Gr(e.data,t),delete e.attachments,e}function Gr(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Gr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Gr(e[n],t));return e}const lh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ch=5;var B;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(B||(B={}));class uh{constructor(t){this.replacer=t}encode(t){return(t.type===B.EVENT||t.type===B.ACK)&&Dn(t)?this.encodeAsBinary({type:t.type===B.EVENT?B.BINARY_EVENT:B.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===B.BINARY_EVENT||t.type===B.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=sh(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ds(e){return Object.prototype.toString.call(e)==="[object Object]"}class Yr extends te{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===B.BINARY_EVENT;r||n.type===B.BINARY_ACK?(n.type=r?B.EVENT:B.ACK,this.reconstructor=new dh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Hr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(B[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===B.BINARY_EVENT||r.type===B.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Yr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case B.CONNECT:return Ds(n);case B.DISCONNECT:return n===void 0;case B.CONNECT_ERROR:return typeof n=="string"||Ds(n);case B.EVENT:case B.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&lh.indexOf(n[0])===-1);case B.ACK:case B.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class dh{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=ah(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const fh=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Yr,Encoder:uh,get PacketType(){return B},protocol:ch},Symbol.toStringTag,{value:"Module"}));function Pe(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const hh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Is extends te{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=[Pe(t,"open",this.onopen.bind(this)),Pe(t,"packet",this.onpacket.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(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(hh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:B.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),s.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:B.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case B.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case B.EVENT:case B.BINARY_EVENT:this.onevent(t);break;case B.ACK:case B.BINARY_ACK:this.onack(t);break;case B.DISCONNECT:this.ondisconnect();break;case B.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:B.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:B.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ot(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}Ot.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},Ot.prototype.reset=function(){this.attempts=0},Ot.prototype.setMin=function(e){this.ms=e},Ot.prototype.setMax=function(e){this.max=e},Ot.prototype.setJitter=function(e){this.jitter=e};class Xr extends te{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,Ln(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 Ot({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||fh;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 eh(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Pe(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=Pe(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(Pe(t,"ping",this.onping.bind(this)),Pe(t,"data",this.ondata.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this)),Pe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tn(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Is(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Gt={};function In(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=th(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Gt[o]&&i in Gt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Xr(r,t):(Gt[o]||(Gt[o]=new Xr(r,t)),l=Gt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(In,{Manager:Xr,Socket:Is,io:In,connect:In});class Qe{static instance;constructor(){}static init(t){if(!Qe.instance){const n=lr();Qe.instance=In(ja,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),Qe.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",Qe.instance.id)})}return Qe.instance}static on(t,n,r){const o=Qe.instance||this.init(n);o.off(t),o.on(t,r)}}const Rs=1e3*60*60*24,[Rn,Fs]=ni("smarttalks-widget-messages",{},Rs),$s=()=>{const{widgetId:e}=ie();return Rn[e()]??[]},gh=e=>{const{widgetId:t}=ie();Fs({...Rn,[t()]:[...Rn[t()]??[],e]})},ph=()=>{const{widgetId:e}=ie();Fs({...Rn,[e()]:[]})},[Ns,mh]=ni("smarttalks-widget-conversationinfo",{},Rs),Ks=()=>{const{widgetId:e}=ie();return Ns[e()]??{}},zs=e=>{const{widgetId:t}=ie();mh({...Ns,[t()]:e})},[yh,Jr]=O(!1),[bh,Bs]=O(!1),Vs=[],Us=()=>{Vs.forEach(e=>e())},wh=e=>Vs.push(e),Zr=e=>{const t=yf(e);if(gh(t),t.type==="media"){setTimeout(Us,200);return}Us()},vh=(e,t)=>{const{chatWidget:n,widgetId:r}=ie(),o=Ks();e.trim()&&(Zr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ee("onInput",e),Qe.on("message",r(),i=>{(i.contactId!==o.contactId||i.interactionId!==o.interactionId)&&zs({contactId:i.contactId,interactionId:i.interactionId});for(const s of i.messages)Zr(s),ee("onAnswer",s);Jr(!1),bf(i.debug)}),Jr(!0),wf(e,t,n()?._id).catch(i=>{console.error(i),Jr(!1)}))},xh=()=>{const{chatWidget:e}=ie(),t=Ks();Bs(!0),ph(),vf(e()?._id,t.contactId,t.interactionId).finally(()=>{zs({}),Bs(!1),js()}),ee("onReset")},js=()=>{const{chatWidget:e}=ie();if($s().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Zr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},et=()=>({getMessages:$s,pushMessage:vh,clearMessages:xh,addBalloonMessage:js,onMessage:wh,typing:yh,loading:bh});var Sh=D("<span>");const kh=()=>{const{clearMessages:e}=et();O(!1);const[t,n]=O(!1);return y(hf,{get open(){return t()},onOpenChange:n,get children(){return[y(gf,{get children(){return y(Ee,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(pc,{size:20})}})}}),y(pf,{get children(){return y(mf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(gc,{size:14}),(()=>{var r=Sh();return A(r,()=>ft("restart")),r})()]}})}})]}})};function Eh(e){return we({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 Ch(e){return we({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 Oh(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function _h(e){return we({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 Ph=D('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Qr=()=>{const{chatWidget:e}=ie(),[t,n]=O(!1);let r=null;ht(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&c()});const o=f=>{const g=f;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async f=>{const g=f;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=async()=>{const f=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(f.webkitExitFullscreen)return f.webkitExitFullscreen(),!0;if(f.msExitFullscreen)return f.msExitFullscreen(),!0}catch{}return!1},a=f=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",f.classList.add("st-fullscreen"),n(!0)},l=f=>{f.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},c=async()=>{try{const f=Jt();if(!f)return;if(!t())o(f)&&await i(f)||a(f);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||l(f)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},d=()=>{const f=document,g=!!(document.fullscreenElement||f.webkitFullscreenElement||f.msFullscreenElement);if(n(g),!g)try{const h=Jt();h.classList.contains("st-fullscreen")&&l(h)}catch{}};document.addEventListener("fullscreenchange",d),document.addEventListener("webkitfullscreenchange",d);const u=()=>{e()?.mode==="popup"&&ee("close")};return ne("toggleFullscreen",()=>{c()}),(()=>{var f=Ph(),g=f.firstChild;return A(f,y(fc,{}),g),A(g,y(Ee,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:c,get children(){return y(Z,{get when(){return t()},get fallback(){return y(Ch,{size:16})},get children(){return y(Eh,{size:16})}})}}),null),A(g,y(Z,{get when(){return e()?.showSettings},get children(){return y(kh,{})}}),null),A(g,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(Ee,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:u,get children(){return y(_h,{size:16})}})}}),null),f})()};var Ah=D("<span>");const qs=({createdAt:e,anchor:t="end"})=>(()=>{var n=Ah();return nt(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 Th=D('<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 Lh=({children:e,createdAt:t})=>(()=>{var n=Th(),r=n.firstChild;return A(r,e),A(n,y(qs,{createdAt:t,anchor:"start"}),null),n})();var Mh=D("<span>");const _t=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Ba(Va(n))),(()=>{var r=Mh();return r.innerHTML=n,rt(r,L({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Dh=D('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Ih=({options:e,text:t})=>{let n;const{pushMessage:r}=et(),[o,i]=O(!1),s=(a,l)=>{i(!0),r(a,l)};return(()=>{var a=Dh(),l=a.firstChild,c=l.firstChild;A(a,y(_t,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?or(d,c):n=c,A(c,y(pt,{each:e,children:u=>y(Ee,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(u.label,u.value),get children(){return u.label?.trim()}})})),oe(()=>nt(l,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Rh=D('<div class="flex flex-col"><span>'),Fh=D("<a target=_blank><img><span></span><span>");const $h=({options:e,text:t})=>(()=>{var n=Rh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(pt,{each:e,children:o=>(()=>{var i=Fh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),oe(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(i,"href",c.e=d),u!==c.t&&ue(s,"src",c.t=u),c},{e:void 0,t:void 0}),i})()}),null),n})();var Nh=D("<a target=_blank>");const Kh=({url:e,text:t})=>(()=>{var n=Nh();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,Hs=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),zh=e=>{const t=L({initialRegistered:!1},e),[n,r]=O(t.initialRegistered);return[C(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Ws=zh,Yt=e=>typeof e=="function",Bh=["button","color","file","image","reset","submit"],Vh=(e,t)=>e==="button"?!0:e==="input"&&t?Bh.indexOf(t)!==-1:!1;function Uh(e){const[t,n]=O(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>H(()=>{let a;return Yt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var eo=Uh,Fn=new Map,$n=(e,t)=>{if(Fn.has(e))return Fn.get(e);const n=ce(t);return Fn.set(e,n),n},to=e=>{const t=Fn.get(e);if(t)return he(t)},Nn=new Map,jh=e=>{T(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Nn.get(e.key);o?o.activeCount++:Nn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=Nn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Nn.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?.()}})})},qh=jh,Hh=e=>{const t=L({enabled:!0},e);T(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Wh=Hh,Gh=e=>{const t=L({enabled:!0},e);T(()=>{const{body:n}=document;G(t.enabled)&&qh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Yh=Gh,Xh=e=>{const t=L({enabled:!0,strategy:"pointerup"},e);T(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),i=G(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Jh=Xh,Zh=e=>{const t=L({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Wh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Jh({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}),Yh({enabled:t.noOutsidePointerEvents})},Qh=Zh,no=ce(),eg=e=>C(()=>{if(he(no))return y(Gs,e);const r=Te(),[o,i]=O([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(d=>d!==l))};return y(no.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(Gs,e)}})}),Gs=e=>{const t=L({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(no),i=Te();T(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Qh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=C(()=>n.children),l=()=>{const c=a();return Yt(c)?c({get isLastLayer(){return s()}}):c};return H(()=>l())},tg=eg,ng=()=>{const[e,t]=O(!1);return T(()=>t(!0)),e},rg=ng,og=(e,t)=>(e&&(Yt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ro=(...e)=>e.some(t=>!!t()),ig=e=>(...t)=>{for(const n of e)n&&n(...t)},Kn=(...e)=>ig(e),le=e=>e?"":void 0,sg="div",ag=e=>{const[t,n]=j(e,["as"]),r=C(()=>t.as??sg);return C(()=>{const i=r();switch(typeof i){case"function":return H(()=>i(n));case"string":return y(ln,L({component:i},n))}})},oo=ag,lg=e=>{let t,n=!1;return()=>n?t:(n=!0,t=C(e))},Ys=lg,cg=e=>C(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),ug=cg,Xs="button",dg=e=>{const[t,n]=O(null),[r,o]=j(e,["as","ref","type"]),i=ug({element:t,fallback:Xs}),s=C(()=>Vh(i(),r.type));return y(oo,L({get as(){return r.as??Xs},ref(a){var l=Kn(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},fg=dg,hg='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',io="focusTrap.initialFocus",so="focusTrap.finalFocus",Js={bubbles:!1,cancelable:!0},gg=e=>{const t=L({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=O(null),o=C(()=>{const h=n();return h?h[0]??null:null}),i=C(()=>{const h=n();return h?h[h.length-1]??null:null});let s=null;const a=()=>{Cr(()=>{l(J(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(J(t.element))})};T(()=>{const h=J(t.element);if(h&&J(t.enabled)){s=document.activeElement,H(()=>{l(h),c(h)});const p=new MutationObserver(a);J(t.observeChanges)&&p.observe(h,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&p.disconnect(),r(null),g(h)})}}),T(()=>{const h=n();h===null||h.length!==0||(document.addEventListener("keydown",f),K(()=>{document.removeEventListener("keydown",f)}))}),T(()=>{const h=o();h&&(h.addEventListener("keydown",d),K(()=>{h.removeEventListener("keydown",d)}))}),T(()=>{const h=i();h&&(h.addEventListener("keydown",u),K(()=>{h.removeEventListener("keydown",u)}))});const l=h=>{const p=Array.from(h.querySelectorAll(hg)).map((m,b)=>({element:m,domIndex:b,tabIndex:m.tabIndex})).sort((m,b)=>m.tabIndex===b.tabIndex?m.domIndex-b.domIndex:m.tabIndex-b.tabIndex);r(p.map(({element:m})=>m))},c=h=>{Cr(()=>{const p=J(t.initialFocusElement)??o()??h,m=t.onInitialFocus;let b;m&&(b=new CustomEvent(io,Js),h.addEventListener(io,m),h.dispatchEvent(b),h.removeEventListener(io,m)),b?.defaultPrevented!==!0&&p.focus()})},d=h=>{h.key==="Tab"&&h.shiftKey&&(h.preventDefault(),i().focus())},u=h=>{h.key==="Tab"&&!h.shiftKey&&(h.preventDefault(),o().focus())},f=h=>{h.key==="Tab"&&h.preventDefault()},g=h=>{Cr(()=>{if(!J(t.restoreFocus))return;const m=J(t.finalFocusElement)??s;if(!m)return;let b;const w=t.onFinalFocus;w&&(b=new CustomEvent(so,Js),h.addEventListener(so,w),h.dispatchEvent(b),h.removeEventListener(so,w)),b?.defaultPrevented!==!0&&m.focus()})}},pg=gg,mg=pg,yg=e=>{const t=C(()=>{const s=J(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=O(J(e.show)?"present":"hidden");let i="none";return T(s=>{const a=J(e.show);return H(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),T(()=>{const s=J(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const u=n().includes(c.animationName);c.target===s&&u&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),K(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},bg=yg,Zs=bg,wg=ce(),vg=e=>e?$n(`dialog-${e}`):wg,Qs=ce(),xg=e=>e?$n(`dialog-internal-${e}`):Qs,Pt=e=>{if(!e){const n=he(Qs);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=to(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},Sg="div",kg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent),i=C(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return y(tg,{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=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,L({ref(l){var c=Kn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??Sg},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 le(r().open())},get"data-closed"(){return le(!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()}}))}})}})}})},Eg=kg,Cg="div",Og=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().overlayPresent),i=C(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const s=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,L({get as(){return t.as??Cg},ref(a){var l=Kn(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return le(r().open())},get"data-closed"(){return le(!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()}}))}})})()}})},_g=Og,Pg=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=rg(),s=C(a=>a||o()&&i(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(Wo,L(n,{get children(){return a()}}))}})})()}})},Ag=Pg,ao=!0,Tg=e=>{const t=L({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??ao),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??ao),preventScroll:()=>!!(e.modal??ao),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Te()},e),[n,r]=eo({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Ws({value:()=>t.labelId??Te()}),[a,l,c]=Ws({value:()=>t.descriptionId??Te()}),[d,u]=O(null),[f,g]=O(null),[h,p]=O(null),{present:m}=Zs({show:n,element:f}),{present:b}=Zs({show:n,element:h});mg({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Hi({element:f,enabled:()=>m()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const w={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return m()},get contentRef(){return f()},get overlayPresent(){return b()},get overlayRef(){return h()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},v=Ys(()=>t.children),x=()=>{const E=v()();return Yt(E)?E(w):E};return C(()=>{const E=vg(t.contextId),k=xg(t.contextId);return y(E.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:b,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:b,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:g,setOverlayRef:p,triggerRef:d,setTriggerRef:u}},get children(){return H(()=>x())}})}})})},Lg=Tg,Mg="button",Dg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=C(()=>Pt(t.contextId));return y(fg,L({ref(i){var s=Kn(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Mg},onClick:i=>{!og(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 le(r().open())},get"data-closed"(){return le(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},Ig=Dg,zn=e=>typeof e=="function"?e():e,ea=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Rg(e){const t=L({enabled:!0,dimension:"both"},e),[n,r]=O(!1),[o,i]=O(null);let s=null;T(()=>{const c=zn(t.element),d=zn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],f=zn(t.dimension);f==="both"?s?s[0]!==u[0]&&s[1]!==u[1]&&(ke(()=>{i(s),r(!0)}),ea(()=>{i(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u:s?Bn(f,s)!==Bn(f,u)&&(ke(()=>{i(Bn(f,s)),r(!0)}),ea(()=>{i(Bn(f,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u},l=()=>{if(!n())return;const c=zn(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,ke(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Bn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Fg=Rg,$g=Fg;const Ng=(e,t)=>e.length>0?()=>e(H(t)):e;function Kg(e,t){let n=0;const r=e.map((o,i)=>C(()=>(n=i,o()),void 0,cr));return C(()=>r.map(o=>o())[n],void 0,t)}function ta(e,t,n){let r=()=>t;const[o,i]=O(t,cr),s=C(Ng(e,()=>r()),t,cr);return[r=Kg([o,s],n),a=>i(()=>typeof a=="function"?a(H(r)):a)]}var zg=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Bg=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Vg=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=zg(o,t),u=d-l-r*c;(c!==0||u!==0)&&Bg(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},Ug=e=>y(Ig,L({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),na=ce(),jg=e=>e?$n(`drawer-${e}`):na,qg=e=>{if(!e){const n=he(na);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ra=ce(),Hg=e=>e?$n(`drawer-internal-${e}`):ra,oa=e=>{if(!e){const n=he(ra);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ia=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vn(e,t)};const o=r[n-1]?Vn(r[n-1],t):void 0,i=r[n]?Vn(r[n],t):void 0;return{value:e,offset:Vn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Vn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},Wg=(e,t,n,r)=>{const o=sa("upper",e,r?n:t),i=sa("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},sa=(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),Gg=(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},Yg=void 0,Xg=e=>{const t=L({initialOpen:!1,snapPoints:[0,1],breakPoints:[Yg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,V)=>{const Q=$/V;return Q<1&&Q>-1?1:Q},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=eo({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=eo({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=O(),{transitioning:d,transitionSize:u}=$g({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,g]=O(!1),[h,p]=ta(()=>d()?"resizing":null),m=C(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[b,w]=O(!1);T(()=>{const $=o();H(()=>{b()!==$&&($?(w(!0),Hs(()=>{ke(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(ke(()=>{p("closing"),a(0)}),Hs(()=>{parseFloat(m().transitionDuration)===0&&v()})))})});const v=()=>{ke(()=>{w(!1),p(null)})},[x,_]=O(0);T(()=>{const $=l()?.contentRef();if(!$)return;k($);const V=new ResizeObserver(E);V.observe($),K(()=>{V.disconnect()})});const E=$=>{for(const V of $)V.target===l()?.contentRef()&&k(V.target)},k=$=>{const V=H(()=>x());switch(n.side){case"top":case"bottom":if(V===$.offsetHeight)return;_($.offsetHeight);break;case"left":case"right":if(V===$.offsetWidth)return;_($.offsetWidth);break}},F=C(()=>ia(s(),x())),[P,R]=ta(()=>F().offset),M=C(()=>x()?(x()-P())/x():0),I={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return f()},get isTransitioning(){return h()!==null},get transitionState(){return h()},get openPercentage(){return M()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},re=Ys(()=>n.children),Y=$=>{c(Pt(n.contextId));const V=re()();if(Yt(V)){const Q=L($,I);return V(Q)}return V};return C(()=>{const $=jg(n.contextId),V=Hg(n.contextId);return H(()=>y($.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:M,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:M,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:F,drawerStyles:m,setTransitionState:p,transitionSize:u,closeDrawer:v}},get children(){return y(Lg,L({get open(){return b()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:Q=>Y(Q)}))}})}}))})},Jg=Xg,Zg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=C(()=>oa(t.contextId)),c=C(()=>Pt(t.contextId)),d=C(()=>l().snapPoints().map((v,x)=>ia(v,l().drawerSize(),x,l().breakPoints()))),u=C(()=>{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=C(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"top":case"bottom":return`${v}px`}}),g=C(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"left":case"right":return`${v}px`}});T(()=>{c().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",w),document.addEventListener("touchend",w),K(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)}))});const h=v=>{Gg(v.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[v.clientX,v.clientY]))},p=v=>{b(v.target,v.clientX,v.clientY)},m=v=>{v.touches[0]&&b(v.target,v.touches[0].clientX,v.touches[0].clientY)},b=(v,x,_)=>{if(!r)return;if(!l().isDragging()||o===null){const F=window.getSelection();if(F&&F.toString().length>0){w();return}if(l().handleScrollableElements()){const P=[x,_].map((fe,$)=>i[$]-fe),R=Math.abs(P[0])>Math.abs(P[1])?"x":"y",M=R==="x"?P[0]:P[1];if(Math.abs(M)<.3)return;const I=c().contentRef(),[re,Y]=Vg(v,R,I);if(M>0&&Math.abs(re)>1||M<0&&Math.abs(Y)>0){w();return}}switch(l().side()){case"top":case"bottom":o=_;break;case"right":case"left":o=x}s=new Date,a=l().translate(),ke(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let E;switch(l().side()){case"top":E=-(o-_);break;case"bottom":E=o-_;break;case"right":E=o-x;break;case"left":E=-(o-x);break}E-=l().resolvedActiveSnapPoint().offset,E>0&&(E=l().dampFunction(E));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-E)},w=()=>{if(r=!1,!l().isDragging())return;const v=new Date,x=l().velocityFunction(-(a-l().translate()),v.getTime()-s.getTime()||1),_=l().translate()*x,E=Wg(d(),l().translate(),_,l().allowSkippingSnapPoints());ke(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),ke(()=>{l().setActiveSnapPoint(E.value),E.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(E.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(Eg,L({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:f(),width:g(),...t.style}},onPointerDown:h,onTransitionEnd:()=>{ke(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return le(l().isTransitioning())},get"data-opening"(){return le(l().transitionState()==="opening")},get"data-closing"(){return le(l().transitionState()==="closing")},get"data-snapping"(){return le(l().transitionState()==="snapping")},get"data-resizing"(){return le(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Qg=Zg,ep=e=>{const[t,n]=j(e,["contextId"]),r=C(()=>oa(t.contextId));return y(_g,L({get contextId(){return t.contextId},get"data-transitioning"(){return le(r().isTransitioning())},get"data-opening"(){return le(r().transitionState()==="opening")},get"data-closing"(){return le(r().transitionState()==="closing")},get"data-snapping"(){return le(r().transitionState()==="snapping")},get"data-resizing"(){return le(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},tp=ep,np=D('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const rp=Jg,op=Ug,ip=Ag,sp=e=>{const[,t]=j(e,["class"]),n=qg();return y(tp,L({get class(){return Ge("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},ap=e=>{const[,t]=j(e,["class","children"]);return y(ip,{get mount(){return Jt()},get children(){return[y(sp,{}),y(Qg,L({id:"smarttalks-list-content",get class(){return Ge("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[np(),C(()=>e.children)]}}))]}})};var lp=D('<span class="font-semibold mt-2">'),cp=D('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),up=D('<div class="flex flex-col space-y-2"><div>'),dp=D('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),fp=D('<div class="flex flex-col items-start"><span class=text-slate-500>');const hp=({options:e,text:t,title:n})=>{const{pushMessage:r}=et(),[o,i]=O(!1),[s,a]=O(!1),[l,c]=O(),d=(f,g)=>{a(!1),i(!0),r(f,g)},u=f=>{const g=f.composedPath();for(const h of g)if(h.id==="smarttalks-list-content"){f.preventDefault();return}};return(()=>{var f=up(),g=f.firstChild;return A(f,y(_t,{get children(){return t?.trim()}}),g),A(g,y(rp,{get open(){return s()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(op,{as:Ee,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??ft("selectOption")}}),y(ap,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var h=lp();return A(h,()=>n?.trim()??ft("selectOption")),h})(),(()=>{var h=cp();return A(h,y(pt,{each:e,children:p=>(()=>{var m=dp(),b=m.firstChild;return A(b,()=>p.label?.trim()??""),A(m,y(pt,{get each(){return p.items},children:w=>y(Ee,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===w?"bg-slate-200":""}`},onClick:()=>c(w),get children(){return[(()=>{var v=fp(),x=v.firstChild;return A(v,()=>w.label?.trim(),x),A(x,()=>w.description?.trim()),v})(),y(Z,{get when(){return l()===w},get fallback(){return y(df,{class:"size-4 text-slate-500"})},get children(){return y(uf,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),h})(),y(Ee,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return ft("send")}})]}})]}})),oe(()=>nt(g,o()?"opacity-50":"")),f})()};var gp=D("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const pp=e=>(()=>{var t=gp(),n=t.firstChild,r=n.nextSibling;return oe(o=>{var i=e.link,s=e.link;return i!==o.e&&ue(n,"src",o.e=i),s!==o.t&&ue(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var mp=D('<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 yp=e=>(()=>{var t=mp(),n=t.firstChild,r=n.firstChild;return A(n,y(ff,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(()=>ue(n,"href",e.link)),t})();var bp=D('<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 wp=e=>(()=>{var t=bp(),n=t.firstChild,r=n.firstChild;return A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ue(n,"href",o.e=i),s!==o.t&&ue(r,"src",o.t=s),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var vp=D('<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 xp=e=>(()=>{var t=vp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(i=>{var s=e.link,a=e.link;return s!==i.e&&ue(r,"src",i.e=s),a!==i.t&&ue(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var Sp=D("<div>Media type not supported");const aa=e=>e.type==="image"?y(wp,e):e.type==="audio"?y(pp,e):e.type==="document"?y(yp,e):e.type==="video"?y(xp,e):Sp(),lo=({text:e})=>y(_t,{get children(){return e?.trim()}});var kp=D("<div>Unknown bot message type");const Ep=e=>y(Lh,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="buttons"?y(Ih,L(()=>e.buttons)):e.type==="list"?y(hp,L(()=>e.list)):e.type==="media"?y(aa,L(()=>e.media)):e.type==="link"?y(Kh,L(()=>e.link)):e.type==="cards"?y($h,L(()=>e.cards)):e.type==="date"?y(lo,{get text(){return e.text}}):kp()}});var Cp=D('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Op=e=>(()=>{var t=Cp(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var _p=D('<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 Pp=({children:e,createdAt:t})=>(()=>{var n=_p(),r=n.firstChild;return A(r,e),A(n,y(qs,{createdAt:t,anchor:"end"}),null),n})();var Ap=D("<div>Unknown user message type");const Tp=e=>y(Pp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="media"?y(aa,L(()=>e.media)):Ap()}});var Lp=D("<div>Unknown message origin");const Mp=e=>e.origin==="bot"?y(Ep,e):e.origin==="user"?y(Tp,e):e.origin==="service"?y(Op,e):Lp();function co(e){return we({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Dp=D('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),Ip=D("<div>");const uo=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o}=et(),{onOpen:i}=Jo(),s=(a=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},a)};return ne("reset",()=>{r()}),ht(()=>{o(),s(200)}),n(s),i(()=>s(200)),(()=>{var a=Dp(),l=e;return typeof l=="function"?or(l,a):e=a,A(a,y(pt,{get each(){return t()},get fallback(){return(()=>{var c=Ip();return A(c,()=>ft("emptyMessages")),c})()},children:c=>y(Mp,c)})),a})()};var Rp=D("<textarea>");const Fp=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Rp();return rt(n,L({get class(){return Ge("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md: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 $p=D('<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 Np=e=>(()=>{var t=$p();return rt(t,e,!0,!0),t})();var Kp=D('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const zp=()=>(()=>{var e=Kp(),t=e.firstChild;return A(e,y(Np,{height:15}),t),e})();var Bp=D('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"></div><div class="flex justify-center opacity-70 scale-95">');const fo=()=>{const{pushMessage:e}=et(),[t,n]=O(""),r=()=>{t().trim()&&(e(t()),n(""))},o=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),r())};return ne("setInput",i=>{i&&n(i)}),(()=>{var i=Bp(),s=i.firstChild,a=s.firstChild,l=a.nextSibling;return A(a,y(Fp,{id:"chat-input",get placeholder(){return ft("inputPlaceholder")},get value(){return t()},onInput:c=>n(c.currentTarget.value),onKeyDown:o,class:"focus-visible:ring-primary min-h-[44px] max-h-[120px] py-3 leading-tight resize-none"}),null),A(a,y(Ee,{variant:"outline",class:"h-[44px] w-[44px] p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",onClick:r,get children(){return y(yc,{size:20})}}),null),A(l,y(zp,{})),i})()};var Vp=D('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Up=D("<span class=sr-only>Close"),jp=D('<div><div class="flex justify-center gap-3 items-center">'),qp=D("<span class=sr-only>Open"),Hp=D("<span class=font-bold>"),Wp=D("<span>"),Gp=D('<div class="animate-pulse flex p-1">');const Yp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Jo(),{chatWidget:s}=ie(),[a,l]=O(!0),[c,d]=O("");setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const u=()=>(s()?.style.margin??5)*4,f=()=>s()?.style.position==="left"?{left:`${u()}px`}:{right:`${u()}px`};return ne("open",()=>{o()}),ne("close",()=>{i()}),ne("toggle",()=>{r()}),ne("onAnswer",g=>{g.text&&d(g.text),o()}),(()=>{var g=jp(),h=g.firstChild;return A(g,y(Z,{get when(){return n()},get children(){var p=Vp();return A(p,e),p}}),h),A(h,y(Z,{get when(){return s()?.whatsappBtn},get children(){return y(Ee,{onclick:()=>window.open(s()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return y(Oh,{class:"size-9",color:"white"})}})}}),null),A(h,y(Z,{get when(){return n()},get fallback(){return y(Ee,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,qp(),y(Z,{get when(){return s()?.balloonMessage},get children(){var p=Wp();return A(p,y(Z,{get when(){return c()},get fallback(){return y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=Gp();return A(m,y(co,{class:"size-2 animate-bounce"}),null),A(m,y(co,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(co,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return C(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=Hp();return A(m,(()=>{var b=C(()=>c().length>20);return()=>b()?c().substring(0,17)+"...":c()})()),m}})),oe(()=>nt(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return y(Ee,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,Up()]}})}}),null),oe(p=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(s()?.style.position==="left"?" items-start":" items-end"),b=f();return m!==p.e&&nt(g,p.e=m),p.t=an(g,b,p.t),p},{e:void 0,t:void 0}),g})()};var Xp=D('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Jp=({children:e})=>{const{chatWidget:t}=ie(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Xp();return an(r,n),A(r,e),r})()};var Zp=D("<div id=smarttalks-widget>");const Qp=({children:e})=>{const{chatWidget:t}=ie(),[n,r]=O(!1),[o,i]=O(!1),[s,a]=O("100%"),l=()=>{typeof window<"u"&&i(window.innerWidth<768)},c=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};T(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),ht(()=>{l(),window.addEventListener("resize",l),window.visualViewport&&(window.visualViewport.addEventListener("resize",c),window.visualViewport.addEventListener("scroll",c))}),K(()=>{window.removeEventListener("resize",l),window.visualViewport&&(window.visualViewport.removeEventListener("resize",c),window.visualViewport.removeEventListener("scroll",c)),document.body.style.overflow="",document.body.style.position=""});const d=()=>(t()?.style.margin??5)*4,u=()=>{if(o())return{height:s(),top:"0px"};const f={};return t()?.fullscreen?(f.height="100%",f["max-height"]="100%",f.width="100%",f["max-width"]="100%",f.bottom=0,f.left=0):t()?.style.position&&(f[t()?.style.position||"right"]=`${d()}px`),f};return ne("open",()=>{r(!0),ee("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),ne("close",()=>{r(!1),ee("onClose")}),ne("toggle",()=>{r(!n()),ee("onToggle")}),ne("onAnswer",()=>{r(!0),ee("onOpen")}),setTimeout(()=>{r(!0),ee("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var f=Zp();return A(f,e),oe(g=>{var h=`
181
+ */function nv(e,t){return t?Jp([e.clientX,e.clientY],t):!1}function rv(e){const t=Nn(),n=xl(),r=Zl(),o=ct({placement:"bottom-start"},e),[i,s]=J(o,["open","defaultOpen","onOpenChange"]);let a=0,c=null,l="right";const[d,u]=L(),[h,g]=L(),[f,p]=L(),[m,y]=L(),[b,x]=L(!0),[w,C]=L(s.placement),[S,O]=L([]),[D,P]=L([]),{DomCollectionProvider:T}=Zm({items:D,onItemsChange:P}),I=ol({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:X=>i.onOpenChange?.(X)}),$=vm(()=>t.forceMount()||I.isOpen()),K=Vm({selectionMode:"none",dataSource:D}),U=X=>{x(X),I.open()},Q=(X=!1)=>{I.close(),X&&r&&r.close(!0)},F=X=>{x(X),I.toggle()},W=()=>{const X=m();X&&(Oe(X),K.selectionManager().setFocused(!0),K.selectionManager().setFocusedKey(void 0))},G=X=>{O(tn=>[...tn,X]);const Ft=r?.registerNestedMenu(X);return()=>{O(tn=>Yi(tn,X)),Ft?.()}},q=X=>l===c?.side&&nv(X,c?.area),qe=X=>{q(X)&&X.preventDefault()},$e=X=>{q(X)||W()},Xa=X=>{q(X)&&X.preventDefault()};pm({isDisabled:()=>!(r==null&&I.isOpen()&&t.isModal()),targets:()=>[m(),...S()].filter(Boolean)}),V(()=>{const X=m();if(!X||!r)return;const Ft=r.registerNestedMenu(X);Y(()=>{Ft()})});const Ei={dataset:_(()=>({"data-expanded":I.isOpen()?"":void 0,"data-closed":I.isOpen()?void 0:""})),isOpen:I.isOpen,contentPresence:$,nestedMenus:S,currentPlacement:w,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>K,parentMenuContext:()=>r,triggerRef:f,contentRef:m,triggerId:d,contentId:h,setTriggerRef:p,setContentRef:y,open:U,close:Q,toggle:F,focusContent:W,onItemEnter:qe,onItemLeave:$e,onTriggerLeave:Xa,setPointerDir:X=>l=X,setPointerGraceTimeoutId:X=>a=X,setPointerGraceIntent:X=>c=X,registerNestedMenu:G,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:go(u),registerContentId:go(g)};return v(T,{get children(){return v(Xl.Provider,{value:Ei,get children(){return v(tv,N({anchorRef:f,contentRef:m,onCurrentPlacementChange:C},s))}})}})}const ov=xe();function iv(e){let t;const n=Nn(),r=Ln(),o=ct({id:n.generateId(`item-${Be()}`)},e),[i,s]=J(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,c]=L(),[l,d]=L(),[u,h]=L(),g=()=>r.listState().selectionManager(),f=()=>s.id,p=()=>g().focusedKey()===f(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Jm({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??u()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const y=Nm({key:f,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=P=>{De(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(Oe(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},x=P=>{De(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},w=P=>{De(P,i.onPointerUp),!i.disabled&&P.button===0&&m()},C=P=>{if(De(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":m();break}},S=_(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),O=_(()=>({"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})),D={isChecked:()=>i.checked,dataset:O,setLabelRef:h,generateId:Yc(()=>s.id),registerLabel:go(c),registerDescription:go(d)};return v(ov.Provider,{value:D,get children(){return v(po,N({as:"div",ref(P){var T=fn(I=>t=I,i.ref);typeof T=="function"&&T(P)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return y.dataKey()},get onPointerDown(){return ze([i.onPointerDown,y.onPointerDown])},get onPointerUp(){return ze([w,y.onPointerUp])},get onClick(){return ze([i.onClick,y.onClick])},get onKeyDown(){return ze([C,y.onKeyDown])},get onMouseDown(){return ze([i.onMouseDown,y.onMouseDown])},get onFocus(){return ze([i.onFocus,y.onFocus])},onPointerMove:b,onPointerLeave:x},O,s))}})}const sv=xe();function Ql(){return Ce(sv)}function av(e){let t;const n=Nn(),r=Ln(),o=Ql(),i=ct({id:n.generateId(`content-${Be()}`)},e),[s,a]=J(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const l=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Km({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);hm({trapFocus:()=>l()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const u=m=>{if(at(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=m=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},f=m=>{De(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(De(m,s.onPointerMove),m.pointerType!=="mouse")return;const y=m.target,b=c!==m.clientX;at(m.currentTarget,y)&&b&&(r.setPointerDir(m.clientX>c?"right":"left"),c=m.clientX)};return V(()=>Y(r.registerContentId(s.id))),v(ie,{get when(){return r.contentPresence.isPresent()},get children(){return v(uy,{get children(){return v(cy,N({ref(m){var y=fn(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof y=="function"&&y(m)},role:"menu",get id(){return s.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return zt(()=>!!l())()&&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:g,get onDismiss(){return r.close},get onKeyDown(){return ze([s.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return ze([s.onMouseDown,d.onMouseDown])},get onFocusIn(){return ze([s.onFocusIn,d.onFocusIn])},get onFocusOut(){return ze([s.onFocusOut,d.onFocusOut])},onPointerEnter:f,onPointerMove:p},()=>r.dataset(),a))}})}})}function cv(e){let t;const n=Nn(),r=Ln(),[o,i]=J(e,["ref"]);return Al({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),v(av,N({ref(s){var a=fn(c=>{t=c},o.ref);typeof a=="function"&&a(s)}},i))}function lv(e){return v(iv,N({role:"menuitem",closeOnSelect:!0},e))}function uv(e){const t=Ln();return v(ie,{get when(){return t.contentPresence.isPresent()},get children(){return v(Ac,e)}})}function dv(e){const t=`menu-${Be()}`,n=ct({id:t,modal:!0},e),[r,o]=J(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=ol({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:Yc(()=>r.id),value:()=>r.value};return v(Jl.Provider,{value:s,get children(){return v(rv,N({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function fv(e){const t=Nn(),n=Ln(),r=Ql(),o=ct({id:t.generateId("trigger")},e),[i,s]=J(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,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)}),Y(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const c=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},l=f=>{De(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&c()},d=f=>{De(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&c()},u=f=>{if(De(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),Qp(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)},g=f=>{De(f,i.onFocus),r!==void 0&&r.setValue(a)};return V(()=>Y(n.registerTriggerId(i.id))),v(Wm,N({ref(f){var p=fn(n.setTriggerRef,i.ref);typeof p=="function"&&p(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return zt(()=>!!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:l,onMouseOver:h,onClick:d,onKeyDown:u,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function hv(e){const t=Nn(),n=Ln(),[r,o]=J(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return v(cv,N({onCloseAutoFocus:c=>{r.onCloseAutoFocus?.(c),i||Oe(n.triggerRef()),i=!1,c.preventDefault()},onInteractOutside:c=>{r.onInteractOutside?.(c),(!t.isModal()||c.detail.isContextMenu)&&(i=!0)}},o))}function gv(e){const t=`dropdownmenu-${Be()}`,n=ct({id:t},e);return v(dv,n)}function pv(e){return Ke({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 mv(e){return Ke({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 yv(e){return Ke({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 vv=e=>v(gv,N({gutter:4},e)),bv=fv,wv=e=>{const[,t]=J(e,["class"]);return v(uv,{get mount(){return Hr()},get children(){return v(hv,N({get class(){return Kt("z-50 min-w-[128px] 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))}})},xv=e=>{const[,t]=J(e,["class"]);return v(lv,N({get class(){return Kt("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 Sv(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function Ev(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function Pv(e,t,n){const r=`${ar}/v1/messages`,o=Wi(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:ap()})};await fetch(r,s)}async function Cv(e,t,n){if(!e||!t||!n)return;const r=`${ar}/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 ft=Object.create(null);ft.open="0",ft.close="1",ft.ping="2",ft.pong="3",ft.message="4",ft.upgrade="5",ft.noop="6";const Po=Object.create(null);Object.keys(ft).forEach(e=>{Po[ft[e]]=e});const ws={type:"error",data:"parser error"},eu=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",tu=typeof ArrayBuffer=="function",nu=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,xs=({type:e,data:t},n,r)=>eu&&t instanceof Blob?n?r(t):ru(t,r):tu&&(t instanceof ArrayBuffer||nu(t))?n?r(t):ru(new Blob([t]),r):r(ft[e]+(t||"")),ru=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function ou(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ss;function kv(e,t){if(eu&&e.data instanceof Blob)return e.data.arrayBuffer().then(ou).then(t);if(tu&&(e.data instanceof ArrayBuffer||nu(e.data)))return t(ou(e.data));xs(e,!1,n=>{Ss||(Ss=new TextEncoder),t(Ss.encode(n))})}const iu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Er=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<iu.length;e++)Er[iu.charCodeAt(e)]=e;const Ov=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),d=new Uint8Array(l);for(r=0;r<n;r+=4)i=Er[e.charCodeAt(r)],s=Er[e.charCodeAt(r+1)],a=Er[e.charCodeAt(r+2)],c=Er[e.charCodeAt(r+3)],d[o++]=i<<2|s>>4,d[o++]=(s&15)<<4|a>>2,d[o++]=(a&3)<<6|c&63;return l},Tv=typeof ArrayBuffer=="function",Es=(e,t)=>{if(typeof e!="string")return{type:"message",data:su(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Av(e.substring(1),t)}:Po[n]?e.length>1?{type:Po[n],data:e.substring(1)}:{type:Po[n]}:ws},Av=(e,t)=>{if(Tv){const n=Ov(e);return su(n,t)}else return{base64:!0,data:e}},su=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},au="",$v=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{xs(i,!1,a=>{r[s]=a,++o===n&&t(r.join(au))})})},Dv=(e,t)=>{const n=e.split(au),r=[];for(let o=0;o<n.length;o++){const i=Es(n[o],t);if(r.push(i),i.type==="error")break}return r};function Rv(){return new TransformStream({transform(e,t){kv(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 Ps;function Co(e){return e.reduce((t,n)=>t+n.length,0)}function ko(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 Mv(e,t){Ps||(Ps=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(Co(n)<1)break;const c=ko(n,1);i=(c[0]&128)===128,o=c[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Co(n)<2)break;const c=ko(n,2);o=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(Co(n)<8)break;const c=ko(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),d=l.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(ws);break}o=d*Math.pow(2,32)+l.getUint32(4),r=3}else{if(Co(n)<o)break;const c=ko(n,o);a.enqueue(Es(i?c:Ps.decode(c),t)),r=0}if(o===0||o>e){a.enqueue(ws);break}}}})}const cu=4;function pe(e){if(e)return Iv(e)}function Iv(e){for(var t in pe.prototype)e[t]=pe.prototype[t];return e}pe.prototype.on=pe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},pe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},pe.prototype.off=pe.prototype.removeListener=pe.prototype.removeAllListeners=pe.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},pe.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},pe.prototype.emitReserved=pe.prototype.emit,pe.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},pe.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Oo=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),We=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_v="arraybuffer";function tk(){}function lu(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Lv=We.setTimeout,Nv=We.clearTimeout;function To(e,t){t.useNativeTimers?(e.setTimeoutFn=Lv.bind(We),e.clearTimeoutFn=Nv.bind(We)):(e.setTimeoutFn=We.setTimeout.bind(We),e.clearTimeoutFn=We.clearTimeout.bind(We))}const Fv=1.33;function Vv(e){return typeof e=="string"?Bv(e):Math.ceil((e.byteLength||e.size)*Fv)}function Bv(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 uu(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Kv(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function zv(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 Uv extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Cs extends pe{constructor(t){super(),this.writable=!1,To(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 Uv(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=Es(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=Kv(t);return n.length?"?"+n:""}}class Wv extends Cs{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)};Dv(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,$v(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]=uu()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let du=!1;try{du=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jv=du;function Hv(){}class Yv extends Wv{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 ht extends pe{constructor(t,n,r){super(),this.createRequest=t,To(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=lu(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=ht.requestsCount++,ht.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=Hv,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ht.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(ht.requestsCount=0,ht.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fu);else if(typeof addEventListener=="function"){const e="onpagehide"in We?"pagehide":"unload";addEventListener(e,fu,!1)}}function fu(){for(let e in ht.requests)ht.requests.hasOwnProperty(e)&&ht.requests[e].abort()}const qv=(function(){const e=hu({xdomain:!1});return e&&e.responseType!==null})();class Gv extends Yv{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=qv&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ht(hu,this.uri(),t)}}function hu(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jv))return new XMLHttpRequest}catch{}if(!t)try{return new We[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const gu=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Xv extends Cs{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=gu?{}:lu(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;xs(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Oo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=uu()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ks=We.WebSocket||We.MozWebSocket;class Zv extends Xv{createSocket(t,n,r){return gu?new ks(t,n,r):n?new ks(t,n):new ks(t)}doWrite(t,n){this.ws.send(n)}}class Jv extends Cs{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=Mv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Rv();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),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&&Oo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Qv={websocket:Zv,webtransport:Jv,polling:Gv},eb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,tb=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Os(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=eb.exec(e||""),i={},s=14;for(;s--;)i[tb[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=nb(i,i.path),i.queryKey=rb(i,i.query),i}function nb(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 rb(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Ts=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ao=[];Ts&&addEventListener("offline",()=>{Ao.forEach(e=>e())},!1);class Ht extends pe{constructor(t,n){if(super(),this.binaryType=_v,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=Os(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=Os(n.host).host);To(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=zv(this.opts.query)),Ts&&(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"})},Ao.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=cu,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&&Ht.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",Ht.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+=Vv(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,Oo(()=>{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(Ht.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(),Ts&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ao.indexOf(this._offlineEventListener);r!==-1&&Ao.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ht.protocol=cu;class ob extends Ht{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;Ht.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ht.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const h=new Error("probe error: "+u);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function c(){s("socket closed")}function l(u){n&&u.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),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 ib=class extends ob{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=>Qv[o]).filter(o=>!!o)),super(t,r)}};function sb(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=Os(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 ab=typeof ArrayBuffer=="function",cb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,pu=Object.prototype.toString,lb=typeof Blob=="function"||typeof Blob<"u"&&pu.call(Blob)==="[object BlobConstructor]",ub=typeof File=="function"||typeof File<"u"&&pu.call(File)==="[object FileConstructor]";function As(e){return ab&&(e instanceof ArrayBuffer||cb(e))||lb&&e instanceof Blob||ub&&e instanceof File}function $o(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if($o(e[n]))return!0;return!1}if(As(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return $o(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&$o(e[n]))return!0;return!1}function db(e){const t=[],n=e.data,r=e;return r.data=$s(n,t),r.attachments=t.length,{packet:r,buffers:t}}function $s(e,t){if(!e)return e;if(As(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]=$s(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]=$s(e[r],t));return n}return e}function fb(e,t){return e.data=Ds(e.data,t),delete e.attachments,e}function Ds(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]=Ds(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ds(e[n],t));return e}const hb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Z;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Z||(Z={}));class gb{constructor(t){this.replacer=t}encode(t){return(t.type===Z.EVENT||t.type===Z.ACK)&&$o(t)?this.encodeAsBinary({type:t.type===Z.EVENT?Z.BINARY_EVENT:Z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Z.BINARY_EVENT||t.type===Z.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=db(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class Rs extends pe{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Z.BINARY_EVENT;r||n.type===Z.BINARY_ACK?(n.type=r?Z.EVENT:Z.ACK,this.reconstructor=new pb(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(As(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Z.BINARY_EVENT||r.type===Z.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(s);if(!mb(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}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(Rs.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Z.CONNECT:return mu(n);case Z.DISCONNECT:return n===void 0;case Z.CONNECT_ERROR:return typeof n=="string"||mu(n);case Z.EVENT:case Z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&hb.indexOf(n[0])===-1);case Z.ACK:case Z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pb{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=fb(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const mb=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function mu(e){return Object.prototype.toString.call(e)==="[object Object]"}const yb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Rs,Encoder:gb,get PacketType(){return Z}},Symbol.toStringTag,{value:"Module"}));function nt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const vb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yu extends pe{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=[nt(t,"open",this.onopen.bind(this)),nt(t,"packet",this.onpacket.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(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(vb.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:Z.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),s.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,c=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Z.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Z.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Z.EVENT:case Z.BINARY_EVENT:this.onevent(t);break;case Z.ACK:case Z.BINARY_ACK:this.onack(t);break;case Z.DISCONNECT:this.ondisconnect();break;case Z.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:Z.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Z.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Fn(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}Fn.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)==0?e-n:e+n}return Math.min(e,this.max)|0},Fn.prototype.reset=function(){this.attempts=0},Fn.prototype.setMin=function(e){this.ms=e},Fn.prototype.setMax=function(e){this.max=e},Fn.prototype.setJitter=function(e){this.jitter=e};class Ms extends pe{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,To(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 Fn({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||yb;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 ib(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=nt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=nt(n,"error",i);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}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(nt(t,"ping",this.onping.bind(this)),nt(t,"data",this.ondata.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(t,"close",this.onclose.bind(this)),nt(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){Oo(()=>{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 yu(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 Pr={};function Do(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=sb(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Pr[o]&&i in Pr[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new Ms(r,t):(Pr[o]||(Pr[o]=new Ms(r,t)),c=Pr[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Do,{Manager:Ms,Socket:yu,io:Do,connect:Do});class Yt{static instance;constructor(){}static init(t){if(!Yt.instance){const n=Wi();Yt.instance=Do(qh,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),Yt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",Yt.instance.id)})}return Yt.instance}static on(t,n,r){const o=Yt.instance||this.init(n);o.off(t),o.on(t,r)}}const vu=1e3*60*60*24,[Ro,bu]=Vc("smarttalks-widget-messages",{},vu),wu=()=>{const{widgetId:e}=ye();return Ro[e()]??[]},bb=e=>{const{widgetId:t}=ye();bu({...Ro,[t()]:[...Ro[t()]??[],e]})},wb=()=>{const{widgetId:e}=ye();bu({...Ro,[e()]:[]})},[xu,xb]=Vc("smarttalks-widget-conversationinfo",{},vu),Su=()=>{const{widgetId:e}=ye();return xu[e()]??{}},Eu=e=>{const{widgetId:t}=ye();xb({...xu,[t()]:e})},[Sb,Is]=L(!1),[Eb,Pu]=L(!1),Cu=[],ku=()=>{Cu.forEach(e=>e())},Pb=e=>Cu.push(e),_s=e=>{const t=Sv(e);if(bb(t),t.type==="media"){setTimeout(ku,200);return}ku()},Cb=(e,t)=>{const{chatWidget:n,widgetId:r}=ye(),o=Su();e.trim()&&(_s({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),he("onInput",e),Yt.on("message",r(),i=>{(i.contactId!==o.contactId||i.interactionId!==o.interactionId)&&Eu({contactId:i.contactId,interactionId:i.interactionId});for(const s of i.messages)_s(s),he("onAnswer",s);Is(!1),Ev(i.debug)}),Is(!0),Pv(e,t,n()?._id).catch(i=>{console.error(i),Is(!1)}))},kb=()=>{const{chatWidget:e}=ye(),t=Su();Pu(!0),wb(),Cv(e()?._id,t.contactId,t.interactionId).finally(()=>{Eu({}),Pu(!1),Ou()}),he("onReset")},Ou=()=>{const{chatWidget:e}=ye();if(wu().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&_s({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},qt=()=>({getMessages:wu,pushMessage:Cb,clearMessages:kb,addBalloonMessage:Ou,onMessage:Pb,typing:Sb,loading:Eb});var Ob=j("<span>");const Tb=()=>{const{clearMessages:e}=qt();L(!1);const[t,n]=L(!1);return v(vv,{get open(){return t()},onOpenChange:n,get children(){return[v(bv,{get children(){return v(Je,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return v(wp,{size:20})}})}}),v(wv,{get children(){return v(xv,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[v(bp,{size:14}),(()=>{var r=Ob();return B(r,()=>kn("restart")),r})()]}})}})]}})};function Ab(e){return Ke({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 $b(e){return Ke({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 Db(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function Rb(e){return Ke({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 Mb=j('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Ls=()=>{const{chatWidget:e}=ye(),[t,n]=L(!1);let r=null;an(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&l()});const o=h=>{const g=h;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async h=>{const g=h;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=async()=>{const h=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(h.webkitExitFullscreen)return h.webkitExitFullscreen(),!0;if(h.msExitFullscreen)return h.msExitFullscreen(),!0}catch{}return!1},a=h=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",h.classList.add("st-fullscreen"),n(!0)},c=h=>{h.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},l=async()=>{try{const h=Hr();if(!h)return;if(!t())o(h)&&await i(h)||a(h);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||c(h)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},d=()=>{const h=document,g=!!(document.fullscreenElement||h.webkitFullscreenElement||h.msFullscreenElement);if(n(g),!g)try{const f=Hr();f.classList.contains("st-fullscreen")&&c(f)}catch{}};document.addEventListener("fullscreenchange",d),document.addEventListener("webkitfullscreenchange",d);const u=()=>{e()?.mode==="popup"&&he("close")};return ge("toggleFullscreen",()=>{l()}),(()=>{var h=Mb(),g=h.firstChild;return B(h,v(yp,{}),g),B(g,v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:l,get children(){return v(ie,{get when(){return t()},get fallback(){return v($b,{size:16})},get children(){return v(Ab,{size:16})}})}}),null),B(g,v(ie,{get when(){return e()?.showSettings},get children(){return v(Tb,{})}}),null),B(g,v(ie,{get when(){return e()?.mode==="popup"},get children(){return v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:u,get children(){return v(Rb,{size:16})}})}}),null),h})()};var Ib=j("<span>");const Tu=({createdAt:e,anchor:t="end"})=>(()=>{var n=Ib();return ln(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),B(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var _b=j('<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 Lb=({children:e,createdAt:t})=>(()=>{var n=_b(),r=n.firstChild;return B(r,e),B(n,v(Tu,{createdAt:t,anchor:"start"}),null),n})();var Nb=j("<span>");const Vn=e=>{const[,t]=J(e,["class","children"]);let n=e.children?.toString();return n&&(n=jh(Hh(n))),(()=>{var r=Nb();return r.innerHTML=n,un(r,N({get class(){return Kt("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Fb=j('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Vb=({options:e,text:t})=>{let n;const{pushMessage:r}=qt(),[o,i]=L(!1),s=(a,c)=>{i(!0),r(a,c)};return(()=>{var a=Fb(),c=a.firstChild,l=c.firstChild;B(a,v(Vn,{get children(){return t?.trim()}}),c);var d=n;return typeof d=="function"?Bi(d,l):n=l,B(l,v(cn,{each:e,children:u=>v(Je,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(u.label,u.value),get children(){return u.label?.trim()}})})),me(()=>ln(c,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Bb=j('<div class="flex flex-col"><span>'),Kb=j("<a target=_blank><img><span></span><span>");const zb=({options:e,text:t})=>(()=>{var n=Bb(),r=n.firstChild;return B(r,()=>t?.trim()),B(n,v(cn,{each:e,children:o=>(()=>{var i=Kb(),s=i.firstChild,a=s.nextSibling,c=a.nextSibling;return B(a,()=>o.title?.trim()),B(c,()=>o.description?.trim()),me(l=>{var d=o.url,u=o.image;return d!==l.e&&ke(i,"href",l.e=d),u!==l.t&&ke(s,"src",l.t=u),l},{e:void 0,t:void 0}),i})()}),null),n})();var Ub=j("<a target=_blank>");const Wb=({url:e,text:t})=>(()=>{var n=Ub();return ke(n,"href",e),B(n,()=>t?.trim()),n})();var ce=e=>typeof e=="function"?e():e,Au=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),jb=e=>{const t=N({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[_(()=>{if(n())return ce(t.value)}),()=>{r(!0)},()=>{r(!1)}]},$u=jb,Cr=e=>typeof e=="function",Hb=["button","color","file","image","reset","submit"],Yb=(e,t)=>e==="button"?!0:e==="input"&&t?Hb.indexOf(t)!==-1:!1;function qb(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>ne(()=>{let a;return Cr(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Ns=qb,Mo=new Map,Io=(e,t)=>{if(Mo.has(e))return Mo.get(e);const n=xe(t);return Mo.set(e,n),n},Fs=e=>{const t=Mo.get(e);if(t)return Ce(t)},_o=new Map,Gb=e=>{V(()=>{const t=ce(e.style)??{},n=ce(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=_o.get(e.key);o?o.activeCount++:_o.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);Y(()=>{const i=_o.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}_o.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?.()}})})},Xb=Gb,Zb=e=>{const t=N({enabled:!0},e);V(()=>{ce(t.enabled)&&(document.addEventListener("keydown",n),Y(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Jb=Zb,Qb=e=>{const t=N({enabled:!0},e);V(()=>{const{body:n}=document;ce(t.enabled)&&Xb({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},ew=Qb,tw=e=>{const t=N({enabled:!0,strategy:"pointerup"},e);V(()=>{if(!ce(t.enabled))return;const r=ce(t.strategy);document.addEventListener(r,n),Y(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=ce(t.element),i=ce(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},nw=tw,rw=e=>{const t=N({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Jb({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),nw({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}),ew({enabled:t.noOutsidePointerEvents})},ow=rw,Vs=xe(),iw=e=>_(()=>{if(Ce(Vs))return v(Du,e);const r=Be(),[o,i]=L([r]),s=c=>{i(l=>[...l,c])},a=c=>{i(l=>l.filter(d=>d!==c))};return v(Vs.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return v(Du,e)}})}),Du=e=>{const t=N({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=J(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=Ce(Vs),i=Be();V(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;ow({dismissOnEscapeKeyDown:()=>ce(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>ce(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>ce(n.noOutsidePointerEvents)&&n.enabled,onDismiss:l=>{n.onDismiss(l)},...r});const a=_(()=>n.children),c=()=>{const l=a();return Cr(l)?l({get isLastLayer(){return s()}}):l};return ne(()=>c())},sw=iw,aw=()=>{const[e,t]=L(!1);return V(()=>t(!0)),e},cw=aw,lw=(e,t)=>(e&&(Cr(e)?e(t):e[0](e[1],t)),t.defaultPrevented),Bs=(...e)=>e.some(t=>!!t()),uw=e=>(...t)=>{for(const n of e)n&&n(...t)},Lo=(...e)=>uw(e),we=e=>e?"":void 0,dw="div",fw=e=>{const[t,n]=J(e,["as"]),r=_(()=>t.as??dw);return _(()=>{const i=r();switch(typeof i){case"function":return ne(()=>i(n));case"string":return v(dr,N({component:i},n))}})},Ks=fw,hw=e=>{let t,n=!1;return()=>n?t:(n=!0,t=_(e))},Ru=hw,gw=e=>_(()=>ce(e.element)?.tagName.toLowerCase()||e.fallback),pw=gw,Mu="button",mw=e=>{const[t,n]=L(null),[r,o]=J(e,["as","ref","type"]),i=pw({element:t,fallback:Mu}),s=_(()=>Yb(i(),r.type));return v(Ks,N({get as(){return r.as??Mu},ref(a){var c=Lo(n,r.ref);typeof c=="function"&&c(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},yw=mw,vw='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"])',zs="focusTrap.initialFocus",Us="focusTrap.finalFocus",Iu={bubbles:!1,cancelable:!0},bw=e=>{const t=N({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=_(()=>{const f=n();return f?f[0]??null:null}),i=_(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{cs(()=>{c(de(t.element)),(document.activeElement===null||document.activeElement===document.body)&&l(de(t.element))})};V(()=>{const f=de(t.element);if(f&&de(t.enabled)){s=document.activeElement,ne(()=>{c(f),l(f)});const p=new MutationObserver(a);de(t.observeChanges)&&p.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),Y(()=>{de(t.observeChanges)&&p.disconnect(),r(null),g(f)})}}),V(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),Y(()=>{document.removeEventListener("keydown",h)}))}),V(()=>{const f=o();f&&(f.addEventListener("keydown",d),Y(()=>{f.removeEventListener("keydown",d)}))}),V(()=>{const f=i();f&&(f.addEventListener("keydown",u),Y(()=>{f.removeEventListener("keydown",u)}))});const c=f=>{const p=Array.from(f.querySelectorAll(vw)).map((m,y)=>({element:m,domIndex:y,tabIndex:m.tabIndex})).sort((m,y)=>m.tabIndex===y.tabIndex?m.domIndex-y.domIndex:m.tabIndex-y.tabIndex);r(p.map(({element:m})=>m))},l=f=>{cs(()=>{const p=de(t.initialFocusElement)??o()??f,m=t.onInitialFocus;let y;m&&(y=new CustomEvent(zs,Iu),f.addEventListener(zs,m),f.dispatchEvent(y),f.removeEventListener(zs,m)),y?.defaultPrevented!==!0&&p.focus()})},d=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},u=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},g=f=>{cs(()=>{if(!de(t.restoreFocus))return;const m=de(t.finalFocusElement)??s;if(!m)return;let y;const b=t.onFinalFocus;b&&(y=new CustomEvent(Us,Iu),f.addEventListener(Us,b),f.dispatchEvent(y),f.removeEventListener(Us,b)),y?.defaultPrevented!==!0&&m.focus()})}},ww=bw,xw=ww,Sw=e=>{const t=_(()=>{const s=de(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(de(e.show)?"present":"hidden");let i="none";return V(s=>{const a=de(e.show);return ne(()=>{if(s===a)return a;const c=i,l=n();a?o("present"):l==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&c!==l?"hiding":"hidden")}),a}),V(()=>{const s=de(e.element);if(!s)return;const a=l=>{l.target===s&&(i=n())},c=l=>{const u=n().includes(l.animationName);l.target===s&&u&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c),Y(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",c),s.removeEventListener("animationend",c)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},Ew=Sw,_u=Ew,Pw=xe(),Cw=e=>e?Io(`dialog-${e}`):Pw,Lu=xe(),kw=e=>e?Io(`dialog-internal-${e}`):Lu,Bn=e=>{if(!e){const n=Ce(Lu);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=Fs(`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},Ow="div",Tw=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=_(()=>Bn(t.contextId)),o=()=>Bs(r().open,()=>t.forceMount,r().contentPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return v(sw,{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=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ks,N({ref(c){var l=Lo(r().setContentRef,t.ref);typeof l=="function"&&l(c)},get as(){return t.as??Ow},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 we(r().open())},get"data-closed"(){return we(!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()}}))}})}})}})},Aw=Tw,$w="div",Dw=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=_(()=>Bn(t.contextId)),o=()=>Bs(r().open,()=>t.forceMount,r().overlayPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return(()=>{const s=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ks,N({get as(){return t.as??$w},ref(a){var c=Lo(r().setOverlayRef,t.ref);typeof c=="function"&&c(a)},"aria-hidden":"true",get"data-open"(){return we(r().open())},get"data-closed"(){return we(!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()}}))}})})()}})},Rw=Dw,Mw=e=>{const[t,n]=J(e,["forceMount","contextId","children"]),r=_(()=>Bn(t.contextId)),o=()=>Bs(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=cw(),s=_(a=>a||o()&&i(),!1);return v(ie,{get when(){return s()},get children(){return(()=>{const a=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ac,N(n,{get children(){return a()}}))}})})()}})},Iw=Mw,Ws=!0,_w=e=>{const t=N({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Ws),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Ws),preventScroll:()=>!!(e.modal??Ws),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Be()},e),[n,r]=Ns({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=$u({value:()=>t.labelId??Be()}),[a,c,l]=$u({value:()=>t.descriptionId??Be()}),[d,u]=L(null),[h,g]=L(null),[f,p]=L(null),{present:m}=_u({show:n,element:h}),{present:y}=_u({show:n,element:f});xw({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Al({element:h,enabled:()=>m()&&ce(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 ce(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return ce(t.noOutsidePointerEvents)},get preventScroll(){return ce(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return ce(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 m()},get contentRef(){return h()},get overlayPresent(){return y()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},x=Ru(()=>t.children),w=()=>{const S=x()();return Cr(S)?S(b):S};return _(()=>{const S=Cw(t.contextId),O=kw(t.contextId);return v(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return v(O.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:c,unregisterDescriptionId:l,setContentRef:g,setOverlayRef:p,triggerRef:d,setTriggerRef:u}},get children(){return ne(()=>w())}})}})})},Lw=_w,Nw="button",Fw=e=>{const[t,n]=J(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=_(()=>Bn(t.contextId));return v(yw,N({ref(i){var s=Lo(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Nw},onClick:i=>{!lw(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 we(r().open())},get"data-closed"(){return we(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},Vw=Fw,No=e=>typeof e=="function"?e():e,Nu=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Bw(e){const t=N({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;V(()=>{const l=No(t.element),d=No(t.enabled);if(!l||!d)return;const u=new ResizeObserver(a);u.observe(l),l.addEventListener("transitionend",c),Y(()=>{u.disconnect(),l.removeEventListener("transitionend",c),c()})});const a=([l])=>{if(n())return;const d=l.target,u=[d.offsetWidth,d.offsetHeight],h=No(t.dimension);h==="both"?s?s[0]!==u[0]&&s[1]!==u[1]&&(Ze(()=>{i(s),r(!0)}),Nu(()=>{i(u),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=u:s?Fo(h,s)!==Fo(h,u)&&(Ze(()=>{i(Fo(h,s)),r(!0)}),Nu(()=>{i(Fo(h,u)),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=u},c=()=>{if(!n())return;const l=No(t.element);l?s=[l.offsetWidth,l.offsetHeight]:s=null,Ze(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Fo=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Kw=Bw,zw=Kw;const Uw=(e,t)=>e.length>0?()=>e(ne(t)):e;function Ww(e,t){let n=0;const r=e.map((o,i)=>_(()=>(n=i,o()),void 0,ji));return _(()=>r.map(o=>o())[n],void 0,t)}function Fu(e,t,n){let r=()=>t;const[o,i]=L(t,ji),s=_(Uw(e,()=>r()),t,ji);return[r=Ww([o,s],n),(a=>i(()=>typeof a=="function"?a(ne(r)):a))]}var jw=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Hw=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Yw=(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[c,l,d]=jw(o,t),u=d-c-r*l;(l!==0||u!==0)&&Hw(o,t)&&(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},qw=e=>v(Vw,N({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Vu=xe(),Gw=e=>e?Io(`drawer-${e}`):Vu,Xw=e=>{if(!e){const n=Ce(Vu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Fs(`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},Bu=xe(),Zw=e=>e?Io(`drawer-internal-${e}`):Bu,Ku=e=>{if(!e){const n=Ce(Bu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Fs(`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},zu=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vo(e,t)};const o=r[n-1]?Vo(r[n-1],t):void 0,i=r[n]?Vo(r[n],t):void 0;return{value:e,offset:Vo(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Vo=(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)},Jw=(e,t,n,r)=>{const o=Uu("upper",e,r?n:t),i=Uu("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},Uu=(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),Qw=(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},e0=void 0,t0=e=>{const t=N({initialOpen:!1,snapPoints:[0,1],breakPoints:[e0],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,W)=>{const G=F/W;return G<1&&G>-1?1:G},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=J(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=Ns({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Ns({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[c,l]=L(),{transitioning:d,transitionSize:u}=zw({element:()=>c()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,g]=L(!1),[f,p]=Fu(()=>d()?"resizing":null),m=_(()=>{const F=c()?.contentRef();if(F)return getComputedStyle(F)}),[y,b]=L(!1);V(()=>{const F=o();ne(()=>{y()!==F&&(F?(b(!0),Au(()=>{Ze(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(Ze(()=>{p("closing"),a(0)}),Au(()=>{parseFloat(m().transitionDuration)===0&&x()})))})});const x=()=>{Ze(()=>{b(!1),p(null)})},[w,C]=L(0);V(()=>{const F=c()?.contentRef();if(!F)return;O(F);const W=new ResizeObserver(S);W.observe(F),Y(()=>{W.disconnect()})});const S=F=>{for(const W of F)W.target===c()?.contentRef()&&O(W.target)},O=F=>{const W=ne(()=>w());switch(n.side){case"top":case"bottom":if(W===F.offsetHeight)return;C(F.offsetHeight);break;case"left":case"right":if(W===F.offsetWidth)return;C(F.offsetWidth);break}},D=_(()=>zu(s(),w())),[P,T]=Fu(()=>D().offset),I=_(()=>w()?(w()-P())/w():0),$={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 P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},K=Ru(()=>n.children),U=F=>{l(Bn(n.contextId));const W=K()();if(Cr(W)){const G=N(F,$);return W(G)}return W};return _(()=>{const F=Gw(n.contextId),W=Zw(n.contextId);return ne(()=>v(F.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:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return v(W.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:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:T,drawerSize:w,resolvedActiveSnapPoint:D,drawerStyles:m,setTransitionState:p,transitionSize:u,closeDrawer:x}},get children(){return v(Lw,N({get open(){return y()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:G=>U(G)}))}})}}))})},n0=t0,r0=e=>{const[t,n]=J(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const c=_(()=>Ku(t.contextId)),l=_(()=>Bn(t.contextId)),d=_(()=>c().snapPoints().map((x,w)=>zu(x,c().drawerSize(),w,c().breakPoints()))),u=_(()=>{switch(c().side()){case"top":return`translate3d(0, ${-c().translate()}px, 0)`;case"bottom":return`translate3d(0, ${c().translate()}px, 0)`;case"right":return`translate3d(${c().translate()}px, 0, 0)`;case"left":return`translate3d(${-c().translate()}px, 0, 0)`}}),h=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"top":case"bottom":return`${x}px`}}),g=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"left":case"right":return`${x}px`}});V(()=>{l().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),Y(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=x=>{Qw(x.target,l().contentRef())&&c().transitionState()!=="closing"&&(r=!0,c().handleScrollableElements()&&(i=[x.clientX,x.clientY]))},p=x=>{y(x.target,x.clientX,x.clientY)},m=x=>{x.touches[0]&&y(x.target,x.touches[0].clientX,x.touches[0].clientY)},y=(x,w,C)=>{if(!r)return;if(!c().isDragging()||o===null){const D=window.getSelection();if(D&&D.toString().length>0){b();return}if(c().handleScrollableElements()){const P=[w,C].map((Q,F)=>i[F]-Q),T=Math.abs(P[0])>Math.abs(P[1])?"x":"y",I=T==="x"?P[0]:P[1];if(Math.abs(I)<.3)return;const $=l().contentRef(),[K,U]=Yw(x,T,$);if(I>0&&Math.abs(K)>1||I<0&&Math.abs(U)>0){b();return}}switch(c().side()){case"top":case"bottom":o=C;break;case"right":case"left":o=w}s=new Date,a=c().translate(),Ze(()=>{c().setIsDragging(!0),c().setTransitionState(null)})}let S;switch(c().side()){case"top":S=-(o-C);break;case"bottom":S=o-C;break;case"right":S=o-w;break;case"left":S=-(o-w);break}S-=c().resolvedActiveSnapPoint().offset,S>0&&(S=c().dampFunction(S));const O=new Date;O.getTime()-s.getTime()>c().velocityCacheReset()&&(s=O,a=c().translate()),c().setTranslate(-S)},b=()=>{if(r=!1,!c().isDragging())return;const x=new Date,w=c().velocityFunction(-(a-c().translate()),x.getTime()-s.getTime()||1),C=c().translate()*w,S=Jw(d(),c().translate(),C,c().allowSkippingSnapPoints());Ze(()=>{c().setTransitionState("snapping"),c().setIsDragging(!1)}),Ze(()=>{c().setActiveSnapPoint(S.value),S.offset===c().drawerSize()?l().setOpen(!1):(c().setTranslate(S.offset),parseFloat(c().drawerStyles().transitionDuration)===0&&c().setTransitionState(null))})};return v(Aw,N({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":c().isDragging()?"0ms":void 0,height:h(),width:g(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ze(()=>{c().transitionState()==="closing"&&c().closeDrawer(),c().transitionState()!=="resizing"&&c().setTransitionState(null)})},get"data-transitioning"(){return we(c().isTransitioning())},get"data-opening"(){return we(c().transitionState()==="opening")},get"data-closing"(){return we(c().transitionState()==="closing")},get"data-snapping"(){return we(c().transitionState()==="snapping")},get"data-resizing"(){return we(c().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},o0=r0,i0=e=>{const[t,n]=J(e,["contextId"]),r=_(()=>Ku(t.contextId));return v(Rw,N({get contextId(){return t.contextId},get"data-transitioning"(){return we(r().isTransitioning())},get"data-opening"(){return we(r().transitionState()==="opening")},get"data-closing"(){return we(r().transitionState()==="closing")},get"data-snapping"(){return we(r().transitionState()==="snapping")},get"data-resizing"(){return we(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},s0=i0,a0=j('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const c0=n0,l0=qw,u0=Iw,d0=e=>{const[,t]=J(e,["class"]),n=Xw();return v(s0,N({get class(){return Kt("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))},f0=e=>{const[,t]=J(e,["class","children"]);return v(u0,{get mount(){return Hr()},get children(){return[v(d0,{}),v(o0,N({id:"smarttalks-list-content",get class(){return Kt("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[a0(),zt(()=>e.children)]}}))]}})};var h0=j('<span class="font-semibold mt-2">'),g0=j('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),p0=j('<div class="flex flex-col space-y-2"><div>'),m0=j('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),y0=j('<div class="flex flex-col items-start"><span class=text-slate-500>');const v0=({options:e,text:t,title:n})=>{const{pushMessage:r}=qt(),[o,i]=L(!1),[s,a]=L(!1),[c,l]=L(),d=(h,g)=>{a(!1),i(!0),r(h,g)},u=h=>{const g=h.composedPath();for(const f of g)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=p0(),g=h.firstChild;return B(h,v(Vn,{get children(){return t?.trim()}}),g),B(g,v(c0,{get open(){return s()},onOpenChange:a,onOutsidePointer:u,get children(){return[v(l0,{as:Je,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??kn("selectOption")}}),v(f0,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=h0();return B(f,()=>n?.trim()??kn("selectOption")),f})(),(()=>{var f=g0();return B(f,v(cn,{each:e,children:p=>(()=>{var m=m0(),y=m.firstChild;return B(y,()=>p.label?.trim()??""),B(m,v(cn,{get each(){return p.items},children:b=>v(Je,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${c()===b?"bg-slate-200":""}`},onClick:()=>l(b),get children(){return[(()=>{var x=y0(),w=x.firstChild;return B(x,()=>b.label?.trim(),w),B(w,()=>b.description?.trim()),x})(),v(ie,{get when(){return c()===b},get fallback(){return v(mv,{class:"size-4 text-slate-500"})},get children(){return v(pv,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),f})(),v(Je,{get disabled(){return o()||!c()},onClick:()=>d(c().label,c().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return kn("send")}})]}})]}})),me(()=>ln(g,o()?"opacity-50":"")),h})()};var b0=j("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const w0=e=>(()=>{var t=b0(),n=t.firstChild,r=n.nextSibling;return me(o=>{var i=e.link,s=e.link;return i!==o.e&&ke(n,"src",o.e=i),s!==o.t&&ke(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var x0=j('<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 S0=e=>(()=>{var t=x0(),n=t.firstChild,r=n.firstChild;return B(n,v(yv,{class:"size-10"}),r),B(r,()=>e.filename?.trim()),B(t,v(Vn,{get children(){return e.text?.trim()}}),null),me(()=>ke(n,"href",e.link)),t})();var E0=j('<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 P0=e=>(()=>{var t=E0(),n=t.firstChild,r=n.firstChild;return B(t,v(Vn,{get children(){return e.text?.trim()}}),null),me(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ke(n,"href",o.e=i),s!==o.t&&ke(r,"src",o.t=s),a!==o.a&&ke(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var C0=j('<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 k0=e=>(()=>{var t=C0(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return B(t,v(Vn,{get children(){return e.text?.trim()}}),null),me(i=>{var s=e.link,a=e.link;return s!==i.e&&ke(r,"src",i.e=s),a!==i.t&&ke(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var O0=j("<div>Media type not supported");const Wu=e=>e.type==="image"?v(P0,e):e.type==="audio"?v(w0,e):e.type==="document"?v(S0,e):e.type==="video"?v(k0,e):O0(),js=({text:e})=>v(Vn,{get children(){return e?.trim()}});var gt=()=>(e,t)=>J(e,t);function T0(e){return e==null?[]:Array.isArray(e)?e:[e]}var A0=e=>e[e.length-1],$0=e=>Array.from(new Set(e));function ju(e,t){return e.reduce((n,r,o)=>(o%t===0?n.push([r]):A0(n)?.push(r),n),[])}var Hu=e=>e?.constructor.name==="Array",D0=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Bo(e[n],t[n]))return!1;return!0},Bo=(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(Hu(e)&&Hu(t))return D0(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(!Bo(e[i],t[i]))return!1}return!0},R0=e=>Array.isArray(e),Yu=e=>e!=null&&typeof e=="object",M0=e=>Yu(e)&&!R0(e),I0=e=>typeof e=="number"&&!Number.isNaN(e),Kn=e=>typeof e=="string",rt=e=>typeof e=="function",_0=e=>e==null,qu=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),L0=e=>Object.prototype.toString.call(e),Gu=Function.prototype.toString,N0=Gu.call(Object),F0=e=>{if(!Yu(e)||L0(e)!="[object Object]"||K0(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=qu(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Gu.call(n)==N0},V0=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,B0=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,K0=e=>V0(e)||B0(e),Xu=()=>{},kr=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function Or(e,t,...n){if(e in t){const o=t[e];return rt(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,Or),r}var{min:z0,max:U0}=Math,W0=e=>Number.isNaN(e),Zu=e=>W0(e)?0:e,Hs=(e,t,n)=>{const r=Zu(e),o=t==null||r>=t,i=n==null||r<=n;return o&&i},j0=(e,t,n)=>z0(U0(Zu(e),t),n);function Ys(e){if(!F0(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]=Ys(o))}return n}function Ko(...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 Ju(...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 qs(e,t){if(e==null)throw new Error(t())}function H0(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Gt(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=xe(i);function a(){const c=Ce(s);if(!c&&t){const l=new Error(o??H0(n,r));throw l.name="ContextError",qu(Error,"captureStackTrace")&&rt(Error.captureStackTrace)&&Error.captureStackTrace(l,a),l}return c}return[s.Provider,a,s]}Gt({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});var Y0=e=>gt()(e,["lazyMount","unmountOnExit"]),q0=e=>typeof e=="function",Qu=(e,...t)=>q0(e)?e(...t):e;function G0(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var X0=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),Z0=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,ed=e=>{const t={};let n;for(;n=Z0.exec(e);)t[n[1]]=n[2];return t},J0=(e,t)=>{if(Kn(e)){if(Kn(t))return`${e};${t}`;e=ed(e)}else Kn(t)&&(t=ed(t));return Object.assign({},e??{},t??{})};function Q0(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=kr(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=X0(t[o],n[o]);continue}if(o==="style"){t[o]=J0(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function ex(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((c,l)=>!Bo(r[l],c)))&&(r=s,o=t(s,i)),o}}var Xt=".",td="#",nd=new WeakMap,rd=new WeakMap;function Gs(e){return e.join(Xt)}function tx(e){return e.includes(Xt)}function od(e){return e.startsWith(td)}function nx(e){return e.startsWith(Xt)}function rx(e){return od(e)?e.slice(td.length):e}function Xs(e,t){return e?`${e}${Xt}${t}`:t}function ox(e){const t=new Map,n=new Map,r=(o,i)=>{t.set(o,i);const s=i.id;s&&(n.has(s)&&Ju(`[zag-js] Duplicate state id: "${s}"`),n.set(s,o));const a=i.states;if(a){qs(i.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),i.initial in a||Ju(`[zag-js] Compound state "${o}" has initial "${String(i.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const d=Xs(o,c);r(d,l)}}};for(const[o,i]of Object.entries(e.states))i&&r(o,i);return{index:t,idIndex:n}}function Tr(e){const t=nd.get(e);if(t)return t;const{index:n,idIndex:r}=ox(e);return nd.set(e,n),rd.set(e,r),n}function ix(e,t){return Tr(e),rd.get(e)?.get(t)}function Zs(e){return e?String(e).split(Xt).filter(Boolean):[]}function zo(e,t){if(!t)return[];const n=Tr(e),r=Zs(t),o=[],i=[];for(const s of r){i.push(s);const a=Gs(i),c=n.get(a);if(!c)break;o.push({path:a,state:c})}return o}function Ar(e,t){const n=Tr(e),r=Zs(t);if(!r.length)return t;const o=[];for(const a of r){o.push(a);const c=Gs(o);if(!n.has(c))return t}let i=Gs(o),s=n.get(i);for(;s?.initial;){const a=`${i}${Xt}${s.initial}`,c=n.get(a);if(!c)break;i=a,s=c}return i}function id(e,t){return Tr(e).has(t)}function sd(e,t,n){const r=String(t);if(od(r)){const o=rx(r),i=ix(e,o);return qs(i,()=>`[zag-js] Unknown state id: "${o}"`),Ar(e,i)}if(nx(r)&&n){const o=Xs(n,r.slice(1));return Ar(e,o)}if(!tx(r)&&n){const o=Zs(n);for(let i=o.length-1;i>=1;i--){const s=o.slice(0,i).join(Xt),a=Xs(s,r);if(id(e,a))return Ar(e,a)}if(id(e,r))return Ar(e,r)}return Ar(e,r)}function sx(e,t,n){const r=zo(e,t);for(let i=r.length-1;i>=0;i--){const a=r[i]?.state.on?.[n];if(a)return{transitions:a,source:r[i]?.path}}return{transitions:e.on?.[n],source:void 0}}function ax(e,t,n,r){const o=t?zo(e,t):[],i=zo(e,n);let s=0;for(;s<o.length&&s<i.length&&o[s]?.path===i[s]?.path;)s+=1;let a=o.slice(s).reverse(),c=i.slice(s);const l=o.at(-1)?.path===i.at(-1)?.path;return r&&l&&(a=o.slice().reverse(),c=i),{exiting:a,entering:c}}function cx(e,t){return e?e===t||e.startsWith(`${t}${Xt}`):!1}function lx(e,t,n){return zo(e,t).some(r=>r.state.tags?.includes(n))}function ux(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function ad(e){return Tr(e),e}var zn=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(zn||{}),Uo="__init__",dx=Object.defineProperty,fx=(e,t,n)=>t in e?dx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Js=(e,t,n)=>fx(e,typeof t!="symbol"?t+"":t,n),cd=()=>{},Wo=e=>typeof e=="object"&&e!==null,z=e=>e?"":void 0,Se=e=>e?"true":void 0,hx=1,gx=9,px=11,_e=e=>Wo(e)&&e.nodeType===hx&&typeof e.nodeName=="string",Qs=e=>Wo(e)&&e.nodeType===gx,mx=e=>Wo(e)&&e===e.window,ld=e=>_e(e)?e.localName||"":"#document";function yx(e){return["html","body","#document"].includes(ld(e))}var ud=e=>Wo(e)&&e.nodeType!==void 0,Un=e=>ud(e)&&e.nodeType===px&&"host"in e,vx=e=>_e(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function bx(e){if(!e)return!1;const t=e.getRootNode();return dd(t)===e}function jo(e,t){if(!e||!t||!_e(e)||!ud(t))return!1;if(_e(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&Un(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function mn(e){return Qs(e)?e:mx(e)?e.document:e?.ownerDocument??document}function wx(e){return mn(e).documentElement}function kt(e){return Un(e)?kt(e.host):Qs(e)?e.defaultView??window:_e(e)?e.ownerDocument?.defaultView??window:window}function dd(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function xx(e){if(ld(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Un(e)&&e.host||wx(e);return Un(t)?t.host:t}function Sx(e){let t;try{if(t=e.getRootNode({composed:!0}),Qs(t)||Un(t))return t}catch{}return e.ownerDocument??document}var ea=new WeakMap;function ta(e){return ea.has(e)||ea.set(e,kt(e).getComputedStyle(e)),ea.get(e)}var Ex=new Set(["menu","listbox","dialog","grid","tree","region","application"]),Px=e=>Ex.has(e),Cx=e=>e.getAttribute("aria-controls")?.split(" ")||[];function kx(e,t){const n=new Set,r=Sx(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const c=Cx(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const d=r.getElementById(l);if(d){const u=d.getAttribute("role"),h=d.getAttribute("aria-modal")==="true";if(u&&Px(u)&&!h&&(d===t||d.contains(t)||o(d)))return!0}}}return!1};return o(e)}var fd=()=>typeof document<"u";function Ox(){return navigator.userAgentData?.platform??navigator.platform}var na=e=>fd()&&e.test(Ox()),hd=()=>fd()&&!!navigator.maxTouchPoints,Tx=()=>na(/^iPhone/i),Ax=()=>na(/^iPad/i)||pd()&&navigator.maxTouchPoints>1,gd=()=>Tx()||Ax(),pd=()=>na(/^Mac/i);function $x(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Wn(e){return $x(e)?.[0]??e.target}function Dx(e){return yd(e).isComposing||e.keyCode===229}var Rx=e=>e.button===2||pd()&&e.ctrlKey&&e.button===0,Mx={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},md={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Ix(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=Mx[o]??o,n==="rtl"&&r==="horizontal"&&o in md&&(o=md[o]),o}function yd(e){return e.nativeEvent??e}var Ho=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function _x(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=kt(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function Lx(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Yo(e,t,n="value"){if(!e)return;const r=Lx(e);r&&_x(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}var Nx="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 vd(e){return!_e(e)||e.closest("[inert]")?!1:e.matches(Nx)&&vx(e)}var Fx=class fh{constructor(){Js(this,"id",null),Js(this,"fn_cleanup"),Js(this,"cleanup",()=>{this.cancel()})}static create(){return new fh}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function Te(e){const t=Fx.create();return t.request(e),t.cleanup}function ra(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 oa(e){const t=xx(e);return yx(t)?mn(t).body:_e(t)&&Kx(t)?t:oa(t)}var Vx=/auto|scroll|overlay|hidden|clip/,Bx=new Set(["inline","contents"]);function Kx(e){const t=kt(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return Vx.test(n+o+r)&&!Bx.has(i)}var jn="default",ia="",qo=new WeakMap;function zx(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return gd()?(jn==="default"&&(ia=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),jn="disabled"):t&&(qo.set(t,t.style.userSelect),t.style.userSelect="none"),()=>bd({target:t,doc:r})}function bd(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(gd()){if(jn!=="disabled")return;jn="restoring",setTimeout(()=>{ra(()=>{jn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=ia||""),ia="",jn="default")})},300)}else if(t&&qo.has(t)){const i=qo.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),qo.delete(t)}}function Ux(e={}){const{defer:t,target:n,...r}=e,o=t?Te:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(zx({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function Wx(e,t){return Array.from(e?.querySelectorAll(t)??[])}function jx(e,t){return e?.querySelector(t)??null}function wd(e,t){if(!e)return cd;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return Hx(n,t)?cd:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function Hx(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function Yx(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{r.aborted||(clearTimeout(c),s(l))}).catch(l=>{r.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function qx(e,t){const{timeout:n,rootNode:r}=t,o=kt(r),i=mn(r),s=new o.AbortController;return Yx(new Promise(a=>{const c=e();if(c){a(c);return}const l=new o.MutationObserver(()=>{const d=e();d&&d.isConnected&&(l.disconnect(),a(d))});l.observe(i.body,{childList:!0,subtree:!0})}),s,n)}function Gx(e){const t=()=>e.getRootNode?.()??document,n=()=>mn(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>dd(t()),isActiveElement:bx,getById:s=>t().getElementById(s)}}var Xx=ad({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e("onExitComplete")?.();const n=t.get("node");if(!n)return;const r=kt(n),o=new r.CustomEvent("exitcomplete",{bubbles:!1});n.dispatchEvent(o)},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",ta(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Te(()=>{if(r("present"))return;const s=Go(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{Te(()=>{e.set("prevAnimationName",Go(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=l=>{(l.composedPath?.()?.[0]??l.target)===o&&e.set("prevAnimationName",Go(t.get("styles")))},s=l=>{const d=Go(t.get("styles"));Wn(l)===o&&d===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})},a=l=>{Wn(l)===o&&!r("present")&&n({type:"UNMOUNT",src:"animationcancel"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",s);const c=wd(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",s),ra(()=>c())}}}}});function Go(e){return e?.animationName||"none"}function Zx(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}function Xo(e){const t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=L(t),i=_(()=>e().value!=null),s={current:r()},a={current:void 0};V(()=>{const d=i()?e().value:r();a.current=d,s.current=d});const c=d=>{const u=a.current,h=rt(d)?d(s.current):d;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:h,prev:u}),i()||o(h),n(h,u)||e().onChange?.(h,u)};function l(){const d=i()?e().value:r;return rt(d)?d():d}return{initial:t,ref:s,get:l,set:c,invoke(d,u){e().onChange?.(d,u)},hash(d){return e().hash?.(d)??String(d)}}}Xo.cleanup=e=>{Y(()=>e())},Xo.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function Jx(e){const t={current:e};return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}function sa(e){return rt(e)?e():e}var Qx=(e,t)=>{let n=[],r=!0;V(()=>{if(r){n=e.map(i=>sa(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!Bo(n[i],sa(e[i]))){o=!0;break}o&&(n=e.map(i=>sa(i)),t())})};function xd(e,t={}){const n=_(()=>{const{id:D,ids:P,getRootNode:T}=aa(t);return Gx({id:D,ids:P,getRootNode:T})}),r=(...D)=>{e.debug&&console.log(...D)},o=_(()=>e.props?.({props:Ys(aa(t)),scope:n()})??aa(t)),i=e1(o),s=e.context?.({prop:i,bindable:Xo,get scope(){return n()},flush:Sd,getContext(){return a},getComputed(){return w},getRefs(){return f},getEvent(){return h()}}),a={get(D){return s?.[D].get()},set(D,P){s?.[D].set(P)},initial(D){return s?.[D].initial},hash(D){const P=s?.[D].get();return s?.[D].hash(P)}},c={current:new Map},l={current:null},d={current:null},u={current:{type:""}},h=()=>N(u.current,{current(){return u.current},previous(){return d.current}}),g=()=>N(C,{matches(...D){const P=C.get();return D.some(T=>cx(P,T))},hasTag(D){const P=C.get();return lx(e,P,D)}}),f=Jx(e.refs?.({prop:i,context:a})??{}),p=()=>({state:g(),context:a,event:h(),prop:i,send:O,action:m,guard:y,track:Qx,refs:f,computed:w,flush:Sd,get scope(){return n()},choose:x}),m=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map(I=>{const $=e.implementations?.actions?.[I];return $||Ko(`[zag-js] No implementation found for action "${JSON.stringify(I)}"`),$});for(const I of T)I?.(p())},y=D=>{if(rt(D))return D(p());const P=e.implementations?.guards?.[D];return P||Ko(`[zag-js] No implementation found for guard "${JSON.stringify(D)}"`),P?.(p())},b=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map($=>{const K=e.implementations?.effects?.[$];return K||Ko(`[zag-js] No implementation found for effect "${JSON.stringify($)}"`),K}),I=[];for(const $ of T){const K=$?.(p());K&&I.push(K)}return()=>I.forEach($=>$?.())},x=D=>T0(D).find(P=>{let T=!P.guard;return Kn(P.guard)?T=!!y(P.guard):rt(P.guard)&&(T=P.guard(p())),T}),w=D=>{qs(e.computed,()=>"[zag-js] No computed object found on machine");const P=e.computed[D];return P({context:a,event:u.current,prop:i,refs:f,scope:n(),computed:w})},C=Xo(()=>({defaultValue:sd(e,e.initialState({prop:i})),onChange(D,P){const{exiting:T,entering:I}=ax(e,P,D,l.current?.reenter);if(T.forEach($=>{c.current.get($.path)?.(),c.current.delete($.path)}),T.forEach($=>{m($.state?.exit)}),m(l.current?.actions),I.forEach($=>{const K=b($.state?.effects);if(K){const U=c.current.get($.path);c.current.set($.path,U?kr(U,K):K)}}),P===Uo){m(e.entry);const $=b(e.effects);if($){const K=c.current.get(Uo);c.current.set(Uo,K?kr(K,$):$)}}I.forEach($=>{m($.state?.entry)})}}));let S=zn.NotStarted;an(()=>{const D=S===zn.Started;S=zn.Started,r(D?"rehydrating...":"initializing..."),C.invoke(C.initial,Uo)}),Y(()=>{r("unmounting..."),S=zn.Stopped,c.current.forEach(P=>P?.()),c.current=new Map,l.current=null,m(e.exit)});const O=D=>{queueMicrotask(()=>{if(S!==zn.Started)return;d.current=u.current,u.current=D;let P=ne(()=>C.get());const{transitions:T,source:I}=sx(e,P,D.type),$=x(T);if(!$)return;l.current=$;const K=sd(e,$.target??P,I);r("transition",D.type,$.target||P,`(${$.actions})`),K!==P?C.set(K):$.reenter?C.invoke(P,P):m($.actions)})};return e.watch?.(p()),{state:g(),send:O,context:a,prop:i,get scope(){return n()},refs:f,computed:w,event:h(),getStatus:()=>S}}function Sd(e){e()}function aa(e){return rt(e)?e():e}function e1(e){return function(n){return e()[n]}}function ee(...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 c=e[a];typeof c=="function"&&(c=c()),s=Q0(s,{[i]:(c||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let c,l=e[a];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}})}}return t}var Ed={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},t1=e=>e.startsWith("--")?e:c1(e);function n1(e){return e in Ed?Ed[e]:e}var r1=Zx(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&M0(r)){t.style=o1(r);continue}if(n==="children"){Kn(r)&&(t.textContent=r);continue}t[n1(n)]=r}}return t});function o1(e){let t={};for(const n in e){const r=e[n];!Kn(r)&&!I0(r)||(t[t1(n)]=r)}return t}var i1=/[A-Z]/g,s1=/^ms-/;function a1(e){return"-"+e.toLowerCase()}var ca={};function c1(e){if(ca.hasOwnProperty(e))return ca[e];const t=e.replace(i1,a1);return ca[e]=s1.test(t)?"-"+t:t}var Pd=e=>{const[t,n]=Y0(Qu(e)),[r,o]=L(!1),i=xd(Xx,e),s=_(()=>G0(i));V(()=>{s().present&&o(!0)});const a=c=>{c&&i.send({type:"NODE.SET",node:c})};return _(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,ref:a,presenceProps:{hidden:!s().present,"data-state":s().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))},l1=e=>typeof e=="function",Cd=(e,t)=>{for(const n of e)l1(n)&&n(t)};function u1(...e){let t=null;return V(()=>{Cd(e,t)}),n=>{t=n,Cd(e,n)}}var la=e=>n=>{const[r,o]=J(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=J(o,["ref"]);return ee(a,s)};return r.asChild(i)}return v(dr,N({component:e},o))};function d1(){const e=new Map;return new Proxy(la,{apply(t,n,r){return la(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,la(r)),e.get(r)}})}var re=d1(),kd=e=>gt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),[Od,Td]=Gt({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),$r=(e,t=[])=>({parts:(...n)=>{if(f1(t))return $r(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>$r(e,[...t,...n]),omit:(...n)=>$r(e,t.filter(r=>!n.includes(r))),rename:n=>$r(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Hn(e)}"][data-part="${Hn(r)}"]`,`& [data-scope="${Hn(e)}"][data-part="${Hn(r)}"]`].join(", "),attrs:{"data-scope":Hn(e),"data-part":Hn(r)}}}),{})}),Hn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),f1=e=>e.length===0;const h1=["top","right","bottom","left"],Zt=Math.min,Le=Math.max,Zo=Math.round,Jo=Math.floor,pt=e=>({x:e,y:e}),g1={left:"right",right:"left",bottom:"top",top:"bottom"};function ua(e,t,n){return Le(e,Zt(t,n))}function Ot(e,t){return typeof e=="function"?e(t):e}function Tt(e){return e.split("-")[0]}function Yn(e){return e.split("-")[1]}function da(e){return e==="x"?"y":"x"}function fa(e){return e==="y"?"height":"width"}function mt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ha(e){return da(mt(e))}function p1(e,t,n){n===void 0&&(n=!1);const r=Yn(e),o=ha(e),i=fa(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Qo(s)),[s,Qo(s)]}function m1(e){const t=Qo(e);return[ga(e),t,ga(t)]}function ga(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ad=["left","right"],$d=["right","left"],y1=["top","bottom"],v1=["bottom","top"];function b1(e,t,n){switch(e){case"top":case"bottom":return n?t?$d:Ad:t?Ad:$d;case"left":case"right":return t?y1:v1;default:return[]}}function w1(e,t,n,r){const o=Yn(e);let i=b1(Tt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ga)))),i}function Qo(e){const t=Tt(e);return g1[t]+e.slice(t.length)}function x1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dd(e){return typeof e!="number"?x1(e):{top:e,right:e,bottom:e,left:e}}function ei(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Rd(e,t,n){let{reference:r,floating:o}=e;const i=mt(t),s=ha(t),a=fa(s),c=Tt(t),l=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-o.width,y:u};break;default:g={x:r.x,y:r.y}}switch(Yn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}async function S1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:g=0}=Ot(t,e),f=Dd(g),m=a[h?u==="floating"?"reference":"floating":u],y=ei(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:d,strategy:c})),b=u==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=ei(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-C.top+f.top)/w.y,bottom:(C.bottom-y.bottom+f.bottom)/w.y,left:(y.left-C.left+f.left)/w.x,right:(C.right-y.right+f.right)/w.x}}const E1=50,P1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:S1},c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Rd(l,r,c),h=r,g=0;const f={};for(let p=0;p<i.length;p++){const m=i[p];if(!m)continue;const{name:y,fn:b}=m,{x,y:w,data:C,reset:S}=await b({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:l,platform:a,elements:{reference:e,floating:t}});d=x??d,u=w??u,f[y]={...f[y],...C},S&&g<E1&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:d,y:u}=Rd(l,h,c)),p=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:f}},C1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:d=0}=Ot(e,t)||{};if(l==null)return{};const u=Dd(d),h={x:n,y:r},g=ha(o),f=fa(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",b=m?"bottom":"right",x=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=w/2-C/2,P=O/2-p[f]/2-1,T=Zt(u[y],P),I=Zt(u[b],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=ua($,U,K),F=!c.arrow&&Yn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,W=F?U<$?U-$:U-K:0;return{[g]:h[g]+W,data:{[g]:Q,centerOffset:U-Q-W,...F&&{alignmentOffset:W}},reset:F}}}),k1=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:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=Ot(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Tt(o),b=mt(a),x=Tt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[Qo(a)]:m1(a)),S=f!=="none";!h&&S&&C.push(...w1(a,p,f,w));const O=[a,...C],D=await c.detectOverflow(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(D[y]),u){const U=p1(o,s,w);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q&&(!(u==="alignment"?b!==mt(Q):!1)||T.every(G=>mt(G.placement)===b?G.overflows[0]>0:!0)))return{data:{index:U,overflows:T},reset:{placement:Q}};let F=($=T.filter(W=>W.overflows[0]<=0).sort((W,G)=>W.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(g){case"bestFit":{var K;const W=(K=T.filter(G=>{if(S){const q=mt(G.placement);return q===b||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Md(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Id(e){return h1.some(t=>e[t]>=0)}const O1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Ot(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Md(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Id(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Md(s,n.floating);return{data:{escapedOffsets:a,escaped:Id(a)}}}default:return{}}}}},_d=new Set(["left","top"]);async function T1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Tt(n),a=Yn(n),c=mt(n)==="y",l=_d.has(s)?-1:1,d=i&&c?-1:1,u=Ot(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*d,y:h*l}:{x:h*l,y:g*d}}const A1=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,c=await T1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},$1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=Ot(e,t),d={x:n,y:r},u=await i.detectOverflow(t,l),h=mt(Tt(o)),g=da(h);let f=d[g],p=d[h];if(s){const y=g==="y"?"top":"left",b=g==="y"?"bottom":"right",x=f+u[y],w=f-u[b];f=ua(x,f,w)}if(a){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+u[y],w=p-u[b];p=ua(x,p,w)}const m=c.fn({...t,[g]:f,[h]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:s,[h]:a}}}}}},D1=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:c=!0,crossAxis:l=!0}=Ot(e,t),d={x:n,y:r},u=mt(o),h=da(u);let g=d[h],f=d[u];const p=Ot(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=h==="y"?"height":"width",w=i.reference[h]-i.floating[x]+m.mainAxis,C=i.reference[h]+i.reference[x]-m.mainAxis;g<w?g=w:g>C&&(g=C)}if(l){var y,b;const x=h==="y"?"width":"height",w=_d.has(Tt(o)),C=i.reference[u]-i.floating[x]+(w&&((y=s.offset)==null?void 0:y[u])||0)+(w?0:m.crossAxis),S=i.reference[u]+i.reference[x]+(w?0:((b=s.offset)==null?void 0:b[u])||0)-(w?m.crossAxis:0);f<C?f=C:f>S&&(f=S)}return{[h]:g,[u]:f}}}},R1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=Ot(e,t),d=await s.detectOverflow(t,l),u=Tt(o),h=Yn(o),g=mt(o)==="y",{width:f,height:p}=i.floating;let m,y;u==="top"||u==="bottom"?(m=u,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=u,m=h==="end"?"top":"bottom");const b=p-d.top-d.bottom,x=f-d.left-d.right,w=Zt(p-d[m],b),C=Zt(f-d[y],x),S=!t.middlewareData.shift;let O=w,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=b),S&&!h){const T=Le(d.left,0),I=Le(d.right,0),$=Le(d.top,0),K=Le(d.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Le(d.left,d.right)):O=p-2*($!==0||K!==0?$+K:Le(d.top,d.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function ti(){return typeof window<"u"}function qn(e){return Ld(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(Ld(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ld(e){return ti()?e instanceof Node||e instanceof Ne(e).Node:!1}function ot(e){return ti()?e instanceof Element||e instanceof Ne(e).Element:!1}function At(e){return ti()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function Nd(e){return!ti()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}function Dr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=it(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function M1(e){return/^(table|td|th)$/.test(qn(e))}function ni(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const I1=/transform|translate|scale|rotate|perspective|filter/,_1=/paint|layout|strict|content/,yn=e=>!!e&&e!=="none";let pa;function ma(e){const t=ot(e)?it(e):e;return yn(t.transform)||yn(t.translate)||yn(t.scale)||yn(t.rotate)||yn(t.perspective)||!ya()&&(yn(t.backdropFilter)||yn(t.filter))||I1.test(t.willChange||"")||_1.test(t.contain||"")}function L1(e){let t=Jt(e);for(;At(t)&&!Gn(t);){if(ma(t))return t;if(ni(t))return null;t=Jt(t)}return null}function ya(){return pa==null&&(pa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pa}function Gn(e){return/^(html|body|#document)$/.test(qn(e))}function it(e){return Ne(e).getComputedStyle(e)}function ri(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nd(e)&&e.host||yt(e);return Nd(t)?t.host:t}function Fd(e){const t=Jt(e);return Gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:At(t)&&Dr(t)?t:Fd(t)}function Rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Fd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=va(s);return t.concat(s,s.visualViewport||[],Dr(o)?o:[],a&&n?Rr(a):[])}else return t.concat(o,Rr(o,[],n))}function va(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vd(e){const t=it(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=At(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Zo(n)!==i||Zo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ba(e){return ot(e)?e:e.contextElement}function Xn(e){const t=ba(e);if(!At(t))return pt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Vd(t);let s=(i?Zo(n.width):n.width)/r,a=(i?Zo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const N1=pt(0);function Bd(e){const t=Ne(e);return!ya()||!t.visualViewport?N1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function F1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ba(e);let s=pt(1);t&&(r?ot(r)&&(s=Xn(r)):s=Xn(e));const a=F1(i,n,r)?Bd(i):pt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const h=Ne(i),g=r&&ot(r)?Ne(r):r;let f=h,p=va(f);for(;p&&r&&g!==f;){const m=Xn(p),y=p.getBoundingClientRect(),b=it(p),x=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,w=y.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,l*=m.y,d*=m.x,u*=m.y,c+=x,l+=w,f=Ne(p),p=va(f)}}return ei({width:d,height:u,x:c,y:l})}function oi(e,t){const n=ri(e).scrollLeft;return t?t.left+n:vn(yt(e)).left+n}function Kd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-oi(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function V1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=yt(r),a=t?ni(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=pt(1);const d=pt(0),u=At(r);if((u||!u&&!i)&&((qn(r)!=="body"||Dr(s))&&(c=ri(r)),u)){const g=vn(r);l=Xn(r),d.x=g.x+r.clientLeft,d.y=g.y+r.clientTop}const h=s&&!u&&!i?Kd(s,c):pt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-c.scrollTop*l.y+d.y+h.y}}function B1(e){return Array.from(e.getClientRects())}function K1(e){const t=yt(e),n=ri(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+oi(e);const a=-n.scrollTop;return it(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const zd=25;function z1(e,t){const n=Ne(e),r=yt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const d=ya();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=oi(r);if(l<=0){const d=r.ownerDocument,u=d.body,h=getComputedStyle(u),g=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,f=Math.abs(r.clientWidth-u.clientWidth-g);f<=zd&&(i-=f)}else l<=zd&&(i+=l);return{width:i,height:s,x:a,y:c}}function U1(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=At(e)?Xn(e):pt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Ud(e,t,n){let r;if(t==="viewport")r=z1(e,n);else if(t==="document")r=K1(yt(e));else if(ot(t))r=U1(t,n);else{const o=Bd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ei(r)}function Wd(e,t){const n=Jt(e);return n===t||!ot(n)||Gn(n)?!1:it(n).position==="fixed"||Wd(n,t)}function W1(e,t){const n=t.get(e);if(n)return n;let r=Rr(e,[],!1).filter(a=>ot(a)&&qn(a)!=="body"),o=null;const i=it(e).position==="fixed";let s=i?Jt(e):e;for(;ot(s)&&!Gn(s);){const a=it(s),c=ma(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Dr(s)&&!c&&Wd(e,s))?r=r.filter(d=>d!==s):o=a,s=Jt(s)}return t.set(e,r),r}function j1(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ni(t)?[]:W1(t,this._c):[].concat(n),r],a=Ud(t,s[0],o);let c=a.top,l=a.right,d=a.bottom,u=a.left;for(let h=1;h<s.length;h++){const g=Ud(t,s[h],o);c=Le(g.top,c),l=Zt(g.right,l),d=Zt(g.bottom,d),u=Le(g.left,u)}return{width:l-u,height:d-c,x:u,y:c}}function H1(e){const{width:t,height:n}=Vd(e);return{width:t,height:n}}function Y1(e,t,n){const r=At(t),o=yt(t),i=n==="fixed",s=vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=pt(0);function l(){c.x=oi(o)}if(r||!r&&!i)if((qn(t)!=="body"||Dr(o))&&(a=ri(t)),r){const g=vn(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&l();i&&!r&&o&&l();const d=o&&!r&&!i?Kd(o,a):pt(0),u=s.left+a.scrollLeft-c.x-d.x,h=s.top+a.scrollTop-c.y-d.y;return{x:u,y:h,width:s.width,height:s.height}}function wa(e){return it(e).position==="static"}function jd(e,t){if(!At(e)||it(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function Hd(e,t){const n=Ne(e);if(ni(e))return n;if(!At(e)){let o=Jt(e);for(;o&&!Gn(o);){if(ot(o)&&!wa(o))return o;o=Jt(o)}return n}let r=jd(e,t);for(;r&&M1(r)&&wa(r);)r=jd(r,t);return r&&Gn(r)&&wa(r)&&!ma(r)?n:r||L1(e)||n}const q1=async function(e){const t=this.getOffsetParent||Hd,n=this.getDimensions,r=await n(e.floating);return{reference:Y1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function G1(e){return it(e).direction==="rtl"}const X1={convertOffsetParentRelativeRectToViewportRelativeRect:V1,getDocumentElement:yt,getClippingRect:j1,getOffsetParent:Hd,getElementRects:q1,getClientRects:B1,getDimensions:H1,getScale:Xn,isElement:ot,isRTL:G1};function Yd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Z1(e,t){let n=null,r;const o=yt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:d,top:u,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=Jo(u),p=Jo(o.clientWidth-(d+h)),m=Jo(o.clientHeight-(u+g)),y=Jo(d),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Le(0,Zt(1,c))||1};let w=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Yd(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function J1(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:c=!1}=r,l=ba(e),d=o||i?[...l?Rr(l):[],...t?Rr(t):[]]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const u=l&&a?Z1(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let f,p=c?vn(e):null;c&&m();function m(){const y=vn(e);p&&!Yd(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const Q1=A1,eS=$1,tS=k1,nS=R1,rS=O1,oS=C1,iS=D1,sS=(e,t,n)=>{const r=new Map,o={platform:X1,...n},i={...o.platform,_c:r};return P1(e,t,{...o,platform:i})};function qd(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 aS(e){if(!e)return qd();const{x:t,y:n,width:r,height:o}=e;return qd(t,n,r,o)}function cS(e,t){return{contextElement:_e(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?aS(r):n.getBoundingClientRect()}}}var Mr=e=>({variable:e,reference:`var(${e})`}),$t={arrowSize:Mr("--arrow-size"),arrowSizeHalf:Mr("--arrow-size-half"),arrowBg:Mr("--arrow-background"),transformOrigin:Mr("--transform-origin"),arrowOffset:Mr("--arrow-offset")},lS=e=>e==="top"||e==="bottom"?"y":"x";function uS(e,t){return{name:"transformOrigin",fn(n){const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,c=i.split("-")[0],l=lS(c),d=o.arrow?.x||0,u=o.arrow?.y||0,h=t?.clientWidth||0,g=t?.clientHeight||0,f=d+h/2,p=u+g/2,m=Math.abs(o.shift?.y||0),y=s.reference.height/2,b=g/2,x=e.offset?.mainAxis??e.gutter,w=typeof x=="number"?x+b:x??b,C=m>w,S={top:`${f}px calc(100% + ${w}px)`,bottom:`${f}px ${-w}px`,left:`calc(100% + ${w}px) ${p}px`,right:`${-w}px ${p}px`}[c],O=`${f}px ${s.reference.y+y-a}px`,D=!!e.overlap&&l==="y"&&C;return r.floating.style.setProperty($t.transformOrigin.variable,D?O:S),{data:{transformOrigin:D?O:S}}}}}var dS={name:"rects",fn({rects:e}){return{data:e}}},fS=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% + ${$t.arrowOffset.reference})`}),{}}}};function hS(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function gS(e){return e.split("-")[0]}var pS={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Gd(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Zn(e,t){return e!=null&&Math.abs(e-t)<.5}function ii(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function mS(e,t,n){const r=e||t.createElement("div");return oS({element:r,padding:n.arrowPadding})}function yS(e,t){if(!_0(t.offset??t.gutter))return Q1(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=hS(n),a=s?void 0:t.shift,c=t.offset?.crossAxis??a;return Ys({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function vS(e){if(e.flip)return tS(()=>{const t=ii(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function bS(e){if(!(!e.slide&&!e.overlap))return eS(()=>{const t=ii(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:iS()}})}function wS(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,o;return nS(()=>{const i=ii(e.boundary);return{padding:e.overflowPadding,...i?{boundary:i}:void 0,apply({elements:s,rects:a,availableHeight:c,availableWidth:l}){const d=s.floating,u=Math.round(a.reference.width),h=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),Zn(t,u)||(d.style.setProperty("--reference-width",`${u}px`),t=u),Zn(n,h)||(d.style.setProperty("--reference-height",`${h}px`),n=h),Zn(r,l)||(d.style.setProperty("--available-width",`${l}px`),r=l),Zn(o,c)||(d.style.setProperty("--available-height",`${c}px`),o=c)}}})}function xS(e){if(e.hideWhenDetached)return rS(()=>({strategy:"referenceHidden",boundary:ii(e.boundary)??"clippingAncestors"}))}function SS(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var ES=["transform","visibility","pointer-events","--x","--y","--z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],PS=["top","right","bottom","left"];function Xd(e,t){if(!e)return Xu;const n=new Map(t.map(r=>[r,e.style.getPropertyValue(r)]));return()=>{n.forEach((r,o)=>{r?e.style.setProperty(o,r):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function Zd(e){return e==null?null:_e(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function CS(e,t,n={}){const r=()=>(typeof t=="function"?t():t)??null,o=()=>{const T=typeof e=="function"?e():e;return n.getAnchorElement?.()??T},i=()=>{const T=o();return!T&&!n.getAnchorRect?null:cS(T,n.getAnchorRect)},s=Object.assign({},pS,n);let a=[],c=null,l,d;function u(T){l?.(),d?.(),c=T,l=s.restoreStyles?Xd(T,ES):void 0;const I=T.querySelector("[data-part=arrow]");d=s.restoreStyles?Xd(I,PS):void 0,a=[yS(I,s),vS(s),bS(s),mS(I,T.ownerDocument,s),fS(I),uS({gutter:s.gutter,offset:s.offset,overlap:s.overlap},I),wS(s),xS(s),dS]}const{placement:h,strategy:g,onComplete:f,onPositioned:p}=s;let m,y,b=!1,x,w,C=Xu;const S=SS(s.listeners);function O(){if(!s.listeners)return;const T=o(),I=i(),$=r();if(!I||!$)return;(Zd(T)!==Zd(x)||$!==w)&&(C(),x=T,w=$,C=J1(I,$,P,S))}async function D(){O();const T=r();if(!T)return;T!==c&&(u(T),b=!1);const I=i();if(!I)return;const $=await sS(I,T,{placement:h,middleware:a,strategy:g});f?.($);const K=kt(T),U=Gd(K,$.x),Q=Gd(K,$.y);if(Zn(m,U)||(T.style.setProperty("--x",`${U}px`),m=U),Zn(y,Q)||(T.style.setProperty("--y",`${Q}px`),y=Q),s.hideWhenDetached&&($.middlewareData.hide?.referenceHidden?(T.style.setProperty("visibility","hidden"),T.style.setProperty("pointer-events","none")):(T.style.removeProperty("visibility"),T.style.removeProperty("pointer-events"))),!b){const F=T.firstElementChild;F&&(T.style.setProperty("--z-index",ta(F).zIndex),b=!0)}}async function P(){n.updatePosition?(await n.updatePosition({updatePosition:D,floatingElement:r()}),p?.({placed:!0})):await D()}return P(),()=>{C(),d?.(),l?.(),p?.({placed:!1})}}function kS(e,t,n={}){const{defer:r,...o}=n,i=r?Te:a=>a(),s=[];return s.push(i(()=>{s.push(CS(e,t,o))})),()=>{s.forEach(a=>a?.())}}var OS={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function TS(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:$t.arrowSize.reference,height:$t.arrowSize.reference,[$t.arrowSizeHalf.variable]:`calc(${$t.arrowSize.reference} / 2)`,[$t.arrowOffset.variable]:`calc(${$t.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?OS[t.split("-")[0]]:void 0,background:$t.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,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function AS(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},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}function $S(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var Jd="pointerdown.outside",Qd="focus.outside";function DS(e){for(const t of e)if(_e(t)&&vd(t))return!0;return!1}var ef=e=>"clientY"in e;function RS(e,t){if(!ef(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 MS(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function tf(e,t){if(!t||!ef(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return MS(s,a)?r||i:!1}function IS(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const c=mn(e),l=kt(e),d=AS(l),u=$S(l);function h(w,C){if(!_e(C)||!C.isConnected||jo(e,C)||RS(e,w)||a&&kx(e,C))return!1;const S=c.querySelector(`[aria-controls="${e.id}"]`);if(S){const D=oa(S);if(tf(w,D))return!1}const O=oa(e);return tf(w,O)?!1:!n?.(C)}const g=new Set,f=Un(e?.getRootNode());let p=!1;function m(w){p=!0;const C=()=>{p=!1};c.addEventListener("pointerup",C,{once:!0}),l.addEventListener("pointerup",C,{once:!0});function S(O){const D=s&&!hd()?Te:I=>I(),P=O??w,T=P?.composedPath?.()??[P?.target];D(()=>{const I=f?T[0]:Wn(w);if(!(!e||!h(w,I))){if(o||i){const $=kr(o,i);e.addEventListener(Jd,$,{once:!0})}nf(e,Jd,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:Rx(P),focusable:DS(T),target:I}})}})}w.pointerType==="touch"?(g.forEach(O=>O()),g.add(Ho(c,"click",S,{once:!0})),g.add(u.addEventListener("click",S,{once:!0})),g.add(d.addEventListener("click",S,{once:!0}))):S()}const y=new Set,b=setTimeout(()=>{y.add(Ho(c,"pointerdown",m,!0)),y.add(u.addEventListener("pointerdown",m,!0)),y.add(d.addEventListener("pointerdown",m,!0))},0);function x(w){if(p)return;(s?Te:S=>S())(()=>{const S=w?.composedPath?.()??[w?.target],O=f?S[0]:Wn(w);if(!(!e||!h(w,O))){if(r||i){const D=kr(r,i);e.addEventListener(Qd,D,{once:!0})}nf(e,Qd,{bubbles:!1,cancelable:!0,detail:{originalEvent:w,contextmenu:!1,focusable:vd(O),target:O}})}})}return hd()||(y.add(Ho(c,"focusin",x,!0)),y.add(u.addEventListener("focusin",x,!0)),y.add(d.addEventListener("focusin",x,!0))),()=>{clearTimeout(b),g.forEach(w=>w()),y.forEach(w=>w())}}function _S(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(IS(i,t))})),()=>{o.forEach(i=>i?.())}}function nf(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function LS(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Ho(mn(e),"keydown",n,{capture:!0})}var rf="layer:request-dismiss",Ae={layers:[],branches:[],recentlyRemoved:new Set,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)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(r=>jo(r.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>jo(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(r=>{const o=r();o&&NS(o)}),this.recentlyRemoved.add(e),ra(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>Ae.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{of(e,t,e.node),e.styleTargets?.forEach(n=>{const r=n();if(!r||r===e.node)return;of(e,t,r);const{zIndex:o}=ta(e.node);r.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];VS(e,rf,o=>{r.requestDismiss?.(o),o.defaultPrevented||r?.dismiss()}),FS(e,rf,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function of(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),Ae.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=Ae.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function NS(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.style.removeProperty("--z-index"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function FS(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function VS(e,t,n){e.addEventListener(t,n,{once:!0})}var xa=new WeakMap,Ir=new WeakMap;function BS(e){return Ae.isBelowPointerBlockingLayer(e)?"none":"auto"}function sf(e){const t=BS(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function KS(e){if(Ir.has(e))return;const t=kt(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{Ir.has(e)&&sf(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),Ir.set(e,n)}function af(){Ae.layers.forEach(({node:e})=>{sf(e),KS(e)})}function zS(e){const t=Ir.get(e);t&&(t.disconnect(),Ir.delete(e)),e.style.pointerEvents=""}function US(e,t){const n=mn(e),r=[];return Ae.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(xa.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[i,s]=qx(()=>{const a=o();return _e(a)?a:null},{timeout:1e3});i.then(a=>r.push(wd(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{Ae.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const i=xa.get(o);i!==void 0&&(o.style.pointerEvents=i,xa.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),r.forEach(o=>o()))}}function WS(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Ko("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:c="dialog",layerStyleTargets:l}=t,d={dismiss:r,node:e,type:c,pointerBlocking:i,requestDismiss:o,styleTargets:l};Ae.add(d),af();function u(m){const y=Wn(m.detail.originalEvent);Ae.isBelowPointerBlockingLayer(e)||Ae.isInBranch(y)||(t.onPointerDownOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),r?.()))}function h(m){const y=Wn(m.detail.originalEvent);Ae.isInBranch(y)||(t.onFocusOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),r?.()))}function g(m){Ae.isTopMost(e)&&(t.onEscapeKeyDown?.(m),!m.defaultPrevented&&r&&(m.preventDefault(),r()))}function f(m){if(!e)return!1;const y=typeof s=="function"?s():s,b=Array.isArray(y)?y:[y],x=t.persistentElements?.map(w=>w()).filter(_e);return x&&b.push(...x),b.some(w=>jo(w,m))||Ae.isInNestedLayer(e,m)}const p=[i?US(e,t.persistentElements):void 0,LS(e,g),_S(e,{exclude:f,onFocusOutside:h,onPointerDownOutside:u,defer:t.defer})];return()=>{Ae.remove(e),af(),zS(e),p.forEach(m=>m?.())}}function jS(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=rt(e)?e():e;o.push(WS(i,t))})),()=>{o.forEach(i=>i?.())}}var[nk,HS]=Gt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});function Sa(e,t){return e-t*Math.floor(e/t)}const cf=1721426;function si(e,t,n,r){t=Ea(e,t);let o=t-1,i=-2;return n<=2?i=0:ai(t)&&(i=-1),cf-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function ai(e){return e%4===0&&(e%100!==0||e%400===0)}function Ea(e,t){return e==="BC"?1-t:t}function YS(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const qS={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 Jn{fromJulianDay(t){let n=t,r=n-cf,o=Math.floor(r/146097),i=Sa(r,146097),s=Math.floor(i/36524),a=Sa(i,36524),c=Math.floor(a/1461),l=Sa(a,1461),d=Math.floor(l/365),u=o*400+s*100+c*4+d+(s!==4&&d!==4?1:0),[h,g]=YS(u),f=n-si(h,g,1,1),p=2;n<si(h,g,3,1)?p=0:ai(g)&&(p=1);let m=Math.floor(((f+p)*12+373)/367),y=n-si(h,g,m,1)+1;return new _t(h,g,m,y)}toJulianDay(t){return si(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return qS[ai(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ai(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}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 GS={"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 Fe(e,t){return t=ve(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function XS(e,t){return t=ve(t,e.calendar),e=Dt(e),t=Dt(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function ZS(e,t){return t=ve(t,e.calendar),e=Nr(e),t=Nr(t),e.era===t.era&&e.year===t.year}function JS(e,t){return ci(e.calendar,t.calendar)&&Fe(e,t)}function _r(e,t){return ci(e.calendar,t.calendar)&&XS(e,t)}function Lr(e,t){return ci(e.calendar,t.calendar)&&ZS(e,t)}function ci(e,t){var n,r,o,i;return(i=(o=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function QS(e,t){return Fe(e,li(t))}const eE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function lf(e,t,n){let r=e.calendar.toJulianDay(e),o=n?eE[n]:oE(t),i=Math.ceil(r+1-o)%7;return i<0&&(i+=7),i}function uf(e){return Mt(Date.now(),e)}function li(e){return bn(uf(e))}function df(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function tE(e,t){return ff(e)-ff(t)}function ff(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Pa=null,nE=!1;function Ca(){return Pa==null&&(Pa=new Intl.DateTimeFormat().resolvedOptions().timeZone),Pa}function hf(){return nE}function Dt(e){return e.subtract({days:e.day-1})}function ka(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Nr(e){return Dt(e.subtract({months:e.month-1}))}function rE(e){return ka(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function Qt(e,t,n){let r=lf(e,t,n);return e.subtract({days:r})}function gf(e,t,n){return Qt(e,t,n).add({days:6})}const pf=new Map,Oa=new Map;function mf(e){if(Intl.Locale){let n=pf.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&pf.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function oE(e){let t=Oa.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo(),t))return Oa.set(e,t),t.firstDay}let n=mf(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];r==="mon"?t={firstDay:1}:r==="tue"?t={firstDay:2}:r==="wed"?t={firstDay:3}:r==="thu"?t={firstDay:4}:r==="fri"?t={firstDay:5}:r==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&GS[n]||0};Oa.set(e,t)}return t.firstDay}function iE(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((lf(Dt(e),t,n)+r)/7)}function yf(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function vf(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const sE={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 aE(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=mf(t),[i,s]=sE[o]||[6,0];return r===i||r===s}function Qn(e){e=ve(e,new Jn);let t=Ea(e.era,e.year);return bf(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function bf(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 Ta(e,t){if(t==="UTC")return 0;if(e>0&&t===Ca()&&!hf())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=xf(e,t);return bf(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const wf=new Map;function xf(e,t){let n=wf.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"}),wf.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 Sf=864e5;function cE(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>lE(e,t,i))}function lE(e,t,n){let r=xf(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 Rt(e,t,n="compatible"){let r=je(e);if(t==="UTC")return Qn(r);if(t===Ca()&&n==="compatible"&&!hf()){r=ve(r,new Jn);let c=new Date,l=Ea(r.era,r.year);return c.setFullYear(l,r.month-1,r.day),c.setHours(r.hour,r.minute,r.second,r.millisecond),c.getTime()}let o=Qn(r),i=Ta(o-Sf,t),s=Ta(o+Sf,t),a=cE(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 Ef(e,t,n="compatible"){return new Date(Rt(e,t,n))}function Mt(e,t){let n=Ta(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),d=r.getUTCMilliseconds();return new Vr(o<1?"BC":"AD",o<1?-o+1:o,i,s,t,n,a,c,l,d)}function bn(e){return new _t(e.calendar,e.era,e.year,e.month,e.day)}function je(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 hi(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function ve(e,t){if(ci(e.calendar,t))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,wn(r),r}function Pf(e,t,n){if(e instanceof Vr)return e.timeZone===t?e:dE(e,t);let r=Rt(e,t,n);return Mt(r,t)}function uE(e){let t=Qn(e)-e.offset;return new Date(t)}function dE(e,t){let n=Qn(e)-e.offset;return ve(Mt(n,t),e.calendar)}const Fr=36e5;function ui(e,t){let n=e.copy(),r="hour"in n?pE(n,t):0;Aa(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,$a(n),Cf(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,fE(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 c=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?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 Aa(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function $a(e){for(;e.month<1;)Aa(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Aa(e,1)}function fE(e){for(;e.day<1;)e.month--,$a(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,$a(e)}function Cf(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 wn(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Cf(e)}function kf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Of(e,t){return ui(e,kf(t))}function Da(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),wn(n),n}function di(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),gE(n),n}function hE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=fi(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=fi(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=fi(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=fi(e.hour,24),t}function gE(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 fi(e,t){let n=e%t;return n<0&&(n+=t),n}function pE(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,hE(e)}function Ra(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),c=a.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=It(c,n,0,a.length-1,r?.round),o.era=a[c],wn(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=It(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=It(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=It(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),wn(o),o}function Tf(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 c=i>=12;s=c?12:0,a=c?23:11}o.hour=It(i,n,s,a,r?.round);break}case"minute":o.minute=It(e.minute,n,0,59,r?.round);break;case"second":o.second=It(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=It(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function It(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 Af(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=ui(je(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Rt(o,e.timeZone)}else n=Qn(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 ve(r,e.calendar)}function mE(e,t){return Af(e,kf(t))}function yE(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let f=e.hour>=12;o=f?12:0,i=f?23:11}let s=je(e),a=ve(di(s,{hour:o}),new Jn),c=[Rt(a,e.timeZone,"earlier"),Rt(a,e.timeZone,"later")].filter(f=>Mt(f,e.timeZone).day===a.day)[0],l=ve(di(s,{hour:i}),new Jn),d=[Rt(l,e.timeZone,"earlier"),Rt(l,e.timeZone,"later")].filter(f=>Mt(f,e.timeZone).day===l.day).pop(),u=Qn(e)-e.offset,h=Math.floor(u/Fr),g=u%Fr;return u=It(h,n,Math.floor(c/Fr),Math.floor(d/Fr),r?.round)*Fr+g,ve(Mt(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Tf(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Ra(je(e),t,n,r),i=Rt(o,e.timeZone);return ve(Mt(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function vE(e,t,n){let r=je(e),o=di(Da(r,t),t);if(o.compare(r)===0)return e;let i=Rt(o,e.timeZone,n);return ve(Mt(i,e.timeZone),e.calendar)}function bE(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 $f(e){let t=ve(e,new Jn),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Df(e){return`${$f(e)}T${bE(e)}`}function wE(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return o!==0&&(i+=`:${String(o).padStart(2,"0")}`),i}function xE(e){return`${Df(e)}${wE(e.offset)}[${e.timeZone}]`}function Ma(e){let t=typeof e[0]=="object"?e.shift():new Jn,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 SE=new WeakMap;class _t{copy(){return this.era?new _t(this.calendar,this.era,this.year,this.month,this.day):new _t(this.calendar,this.year,this.month,this.day)}add(t){return ui(this,t)}subtract(t){return Of(this,t)}set(t){return Da(this,t)}cycle(t,n,r){return Ra(this,t,n,r)}toDate(t){return Ef(this,t)}toString(){return $f(this)}compare(t){return df(this,t)}constructor(...t){as(this,SE,{writable:!0,value:void 0});let[n,r,o,i,s]=Ma(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,wn(this)}}var EE=new WeakMap;class hi{copy(){return this.era?new hi(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new hi(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return ui(this,t)}subtract(t){return Of(this,t)}set(t){return Da(di(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Ra(this,t,n,r);default:return Tf(this,t,n,r)}}toDate(t,n){return Ef(this,t,n)}toString(){return Df(this)}compare(t){let n=df(this,t);return n===0?tE(this,je(t)):n}constructor(...t){as(this,EE,{writable:!0,value:void 0});let[n,r,o,i,s]=Ma(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,wn(this)}}var PE=new WeakMap;class Vr{copy(){return this.era?new Vr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Vr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Af(this,t)}subtract(t){return mE(this,t)}set(t,n){return vE(this,t,n)}cycle(t,n,r){return yE(this,t,n,r)}toDate(){return uE(this)}toString(){return xE(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Pf(t,this.timeZone).toDate().getTime()}constructor(...t){as(this,PE,{writable:!0,value:void 0});let[n,r,o,i,s]=Ma(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,wn(this)}}let Ia=new Map;class He{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 OE()&&(this.resolvedHourCycle||(this.resolvedHourCycle=TE(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=Rf(t,n),this.options=n}}const CE={true:{ja:"h11"},false:{}};function Rf(e,t={}){if(typeof t.hour12=="boolean"&&kE()){t={...t};let o=CE[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(Ia.has(n))return Ia.get(n);let r=new Intl.DateTimeFormat(e,t);return Ia.set(n,r),r}let _a=null;function kE(){return _a==null&&(_a=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),_a}let La=null;function OE(){return La==null&&(La=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),La}function TE(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=Rf(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")}var[rk,AE]=Gt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),$E=Object.defineProperty,DE=(e,t)=>{for(var n in t)$E(e,n,{get:t[n],enumerable:!0})},gi="__live-region__",Na="__live-region-debug__",RE="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;";function ME(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0,debug:i=!1}=e,s=n.defaultView??window,a=r??n.body;function c(){if(!i)return;let u=n.getElementById(Na);return u||(u=n.createElement("div"),u.id=Na,u.dataset.liveAnnouncerDebug="true",u.setAttribute("aria-hidden","true"),u.style.cssText=RE,a.appendChild(u),u)}function l(u,h){n.getElementById(gi)?.remove(),h=h??o;const f=n.createElement("span");f.id=gi,f.dataset.liveAnnouncer="true";const p=t!=="assertive"?"status":"alert";f.setAttribute("aria-live",t),f.setAttribute("role",p),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"}),a.appendChild(f),s.setTimeout(()=>{if(!f.isConnected)return;f.textContent=u;const m=c();m&&(m.textContent=u)},h)}function d(){n.getElementById(gi)?.remove(),n.getElementById(Na)?.remove()}return{announce:l,destroy:d,toJSON(){return gi}}}function IE(e,t,n,r,o){const i={};for(let a in t){const c=a,l=t[c];l!=null&&(i[c]=Math.floor(l/2),i[c]>0&&l%2===0&&i[c]--)}const s=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function xn(e,t,n,r,o){let i=e;return t.years?i=Nr(e):t.months?i=Dt(e):t.weeks&&(i=Qt(e,n)),Br(e,i,t,n,r,o)}function Fa(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=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function Br(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=vf(t,xn(bn(o),n,r))),i&&e.compare(i)<=0&&(t=yf(t,Fa(bn(i),n,r))),t}function Ye(e,t,n){const r=bn(e),o=t?bn(t):void 0,i=n?bn(n):void 0;let s=r;return o&&(s=vf(s,o)),i&&(s=yf(s,i)),s.compare(r)===0?e:"hour"in e?e.set({year:s.year,month:s.month,day:s.day}):s}function Mf(e,t,n,r,o,i){switch(t){case"start":return xn(e,n,r,o,i);case"end":return Fa(e,n,r,o,i);case"center":default:return IE(e,n,r,o,i)}}function en(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?Fe(e,t):je(e).compare(je(t))===0}function If(e,t,n,r,o){return e?t?.(e,n)?!0:vt(e,r,o):!1}function vt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function _E(e,t,n){const r=e.subtract({days:1});return Fe(r,e)||vt(r,t,n)}function LE(e,t,n){const r=e.add({days:1});return Fe(r,e)||vt(r,t,n)}function Va(e){let t={...e};for(let n in t)t[n]=1;return t}function _f(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Lf(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function Nf(e,t,n){const r=n??je(li(t));return new He(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Lf(r),calendar:r.calendar.identifier,timeZone:t})}function Ff(e,t,n){const r=n??li(t);return new He(e,{month:"long",year:"numeric",era:Lf(r),calendar:r.calendar.identifier,timeZone:t})}function NE(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let l=0;l<i.length;l++){let d=i[l];if(d.source==="shared"&&d.type==="literal")s=l;else if(d.source==="endRange")break}let a="",c="";for(let l=0;l<i.length;l++)l<s?a+=i[l].value:l>s&&(c+=i[l].value);return r(a,c)}function pi(e,t,n,r){if(!e)return"";let o=e,i=t??e,s=Nf(n,r);return Fe(o,i)?s.format(o.toDate(r)):NE(o,i,s,(a,c)=>`${a} – ${c}`,r)}var FE=["sun","mon","tue","wed","thu","fri","sat"];function Vf(e){return e!=null?FE[e]:void 0}function Bf(e,t,n){const r=Vf(n);return Qt(e,t,r)}function Kf(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=Bf(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(Fe(s,a))break;s=a}return i}function VE(e,t,n,r){const o=Vf(r),i=n??iE(e,t,o);return[...new Array(i).keys()].map(a=>Kf(a,e,t,r))}function BE(e,t){const n=new He(e,{weekday:"long",timeZone:t}),r=new He(e,{weekday:"short",timeZone:t}),o=new He(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 KE(e,t,n,r){const o=Bf(e,r,t),i=[...new Array(7).keys()],s=BE(r,n);return i.map(a=>s(o.add({days:a})))}function zE(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const s=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(s.toLocaleString(e,{month:t})),s.setMonth(s.getMonth()+1);return a}const r=n.calendar.getMonthsInYear(n),o=new He(e,{month:t,calendar:n.calendar.identifier}),i=[];for(let s=1;s<=r;s++){const a=n.set({month:s});i.push(o.format(a.toDate("UTC")))}return i}function zf(e,t){const n=Qt(e,t,"mon"),r=n.year,o=n.set({month:1,day:4}),i=Qt(o,t,"mon"),s=n.calendar.toJulianDay(n),a=i.calendar.toJulianDay(i);if(s>=a)return 1+Math.floor((s-a)/7);const c=n.set({year:r-1,month:1,day:4}),l=Qt(c,t,"mon"),d=l.calendar.toJulianDay(l);return 1+Math.floor((s-d)/7)}function UE(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var WE=1900,jE=2099;function HE(e,t,n){const r=e.calendar,o=t?.year??ve(new _t(WE,1,1),r).year,i=n?.year??ve(new _t(jE,12,31),r).year;return{from:o,to:i}}var YE=10;function qE(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,r=parseInt(e.slice(-2),10),o=n+r;return o>t+YE?(o-100).toString():o.toString()}return e}}function er(e,t){const n=t?.strict?10:12,r=e-e%10,o=[];for(let i=0;i<n;i+=1){const s=r+i;o.push(s)}return o}function Kr(e,t){const n=li(e??Ca());return t?ve(n,t):n}function zr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,c=_f(s,e);return vt(a,n,r)?{startDate:s,focusedDate:Ye(a,n,r),endDate:c}:a.compare(s)<0?{startDate:Fa(a,e,t,n,r),focusedDate:Ye(a,n,r),endDate:c}:a.compare(c)>0?{startDate:xn(a,e,t,n,r),endDate:c,focusedDate:Ye(a,n,r)}:{startDate:s,endDate:c,focusedDate:Ye(a,n,r)}}}function Uf(e,t,n,r,o,i){const s=zr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function Wf(e,t,n,r,o,i){const s=zr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function GE(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(Va(r)),startDate:t});if(r.days)return Uf(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 XE(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(Va(r)),startDate:t});if(r.days)return Wf(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 jf=(e,t)=>e?/\d/.test(e)||t.includes(e)||e.length!==1:!0,ZE=(e,t)=>e.split("").filter(n=>jf(n,t)).join(""),Hf=new Map;function JE(e){let t=Hf.get(e);if(t!=null)return t;const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=r?r.value:"/",Hf.set(e,t),t}var Yf=e=>e!=null&&e.length===4,QE=e=>e!=null&&parseFloat(e)<=12,eP=e=>e!=null&&parseFloat(e)<=31;function tP(e,t,n){const r=nP(t,n);let{year:o,month:i,day:s}=rP(r,e)??{};if(o!=null||i!=null||s!=null){const l=new Date;o||(o=l.getFullYear().toString()),i||(i=(l.getMonth()+1).toString()),s||(s=l.getDate().toString())}if(Yf(o)||(o=qE(o)),Yf(o)&&QE(i)&&eP(s))return new _t(+o,+i,+s);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new _t(l.getFullYear(),l.getMonth()+1,l.getDate())}}function nP(e,t){return new He(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 rP(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 qf(e,t,n){const r=bn(uf(n));switch(e){case"thisWeek":return[Qt(r,t),gf(r,t)];case"thisMonth":return[Dt(r),r];case"thisQuarter":return[Dt(r).add({months:-((r.month-1)%3)}),r];case"thisYear":return[Nr(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[Dt(r.add({months:-1})),ka(r.add({months:-1}))];case"lastQuarter":return[Dt(r.add({months:-((r.month-1)%3)-3})),ka(r.add({months:-((r.month-1)%3)-1}))];case"lastWeek":return[Qt(r,t).add({weeks:-1}),gf(r,t).add({weeks:-1})];case"lastYear":return[Nr(r.add({years:-1})),rE(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var Gf=$r("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),oe=Gf.build(),oP=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,iP=e=>e.ids?.root??`datepicker:${e.id}`,sP=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,Ba=e=>e.ids?.content??`datepicker:${e.id}:content`,Ka=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,aP=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,cP=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,lP=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,Xf=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,Zf=e=>e.ids?.control??`datepicker:${e.id}:control`,Jf=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,Qf=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,eh=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,th=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,nh=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,rh=(e,t)=>jx(yi(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),mi=e=>e.getById(Qf(e)),yi=e=>e.getById(Ba(e)),Ur=e=>Wx(ih(e),"[data-part=input]"),uP=e=>e.getById(nh(e)),dP=e=>e.getById(th(e)),fP=e=>e.getById(Xf(e)),oh=e=>e.getById(eh(e)),ih=e=>e.getById(Zf(e));function za(e){const[t,n]=e;let r;return!t||!n?r=e:r=t.compare(n)<=0?e:[n,t],r}function tr(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function vi(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function hP(e){return Or(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var gP={day:"dd",month:"mm",year:"yyyy"};function pP(e){return new He(e).formatToParts(new Date).map(t=>gP[t.type]??t.value).join("")}var sh=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),mP={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return Or(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return Or(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return Or(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",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function Lt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Ua(e){return e===0?"day":e===1?"month":"year"}function Wa(e,t,n){return Ua(j0(Lt(e,0),Lt(t,0),Lt(n,2)))}function yP(e,t){return Lt(e,0)>Lt(t,0)}function vP(e,t){return Lt(e,0)<Lt(t,0)}function bP(e,t,n){const r=Lt(e,0)+1;return Wa(Ua(r),t,n)}function wP(e,t,n){const r=Lt(e,0)-1;return Wa(Ua(r),t,n)}var xP=["day","month","year"];function SP(e){xP.forEach(t=>e(t))}var EP=ex(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale],([e],t)=>{const{startValue:n,endValue:r,locale:o,timeZone:i,selectionMode:s}=t;if(e==="year"){const u=er(n.year,{strict:!0}),h=u.at(0).toString(),g=u.at(-1).toString();return{start:h,end:g,formatted:`${h} - ${g}`}}if(e==="month"){const u=new He(o,{year:"numeric",timeZone:i,calendar:n.calendar.identifier}),h=u.format(n.toDate(i)),g=u.format(r.toDate(i)),f=s==="range"?`${h} - ${g}`:h;return{start:h,end:g,formatted:f}}const a=new He(o,{month:"long",year:"numeric",timeZone:i,calendar:n.calendar.identifier}),c=a.format(n.toDate(i)),l=a.format(r.toDate(i)),d=s==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:d}});function PP(e,t){const{state:n,context:r,prop:o,send:i,computed:s,scope:a}=e,c=r.get("startValue"),l=s("endValue"),d=r.get("value"),u=r.get("focusedValue"),h=r.get("hoveredValue"),g=h?za([d[0],h]):[],f=!!o("disabled"),p=!!o("readOnly"),m=!!o("invalid"),y=s("isInteractive"),b=d.length===0,x=o("min"),w=o("max"),C=o("locale"),S=o("timeZone"),O=o("startOfWeek"),D=n.matches("focused"),P=n.matches("open"),T=o("selectionMode")==="range",I=o("selectionMode")==="multiple",$=o("isDateUnavailable"),K=o("maxSelectedDates"),U=I&&K!=null&&d.length>=K,Q=r.get("currentPlacement"),F=Q?gS(Q):void 0,W=TS({...o("positioning"),placement:Q}),G=JE(C),q={...mP,...o("translations")};function qe(A=c){const E=o("fixedWeeks")?6:void 0;return VE(A,C,E,O)}function $e(A={}){const{format:E}=A;return zE(C,E,u).map((k,R)=>{const le=R+1,Ge=u.set({month:le}),Pe=vt(Ge,x,w);return{label:k,value:le,disabled:Pe}})}function Xa(){const A=HE(u,x,w);return UE(A).map(k=>({label:k.toString(),value:k,disabled:!Hs(k,x?.year,w?.year)}))}function Si(A){return If(A,$,C,x,w)}function Ei(A){const E=c??Kr(S,u.calendar);i({type:"FOCUS.SET",value:E.set({month:A})})}function X(A){const E=c??Kr(S,u.calendar);i({type:"FOCUS.SET",value:E.set({year:A})})}function Ft(A){const{value:E,disabled:k}=A,R=u.set({year:E}),Ge=!er(c.year,{strict:!0}).includes(E),Pe=Hs(E,x?.year,w?.year),st=T&&tr(R,d),nn=T&&d[0]&&Lr(R,d[0]),nr=T&&d[1]&&Lr(R,d[1]),En=T&&g.length>0,rr=En&&tr(R,g),rn=En&&g[0]&&Lr(R,g[0]),on=En&&g[1]&&Lr(R,g[1]),Pi={focused:u.year===A.value,selectable:!Ge&&Pe,outsideRange:Ge,selected:!!d.find(Ci=>Ci&&Ci.year===E),valueText:E.toString(),inRange:st||rr,firstInRange:!!nn,lastInRange:!!nr,inHoveredRange:!!rr,firstInHoveredRange:!!rn,lastInHoveredRange:!!on,value:R,get disabled(){return k||!Pi.selectable}};return Pi}function tn(A){const{value:E,disabled:k}=A,R=u.set({month:E}),le=Ff(C,S,u),Ge=T&&tr(R,d),Pe=T&&d[0]&&_r(R,d[0]),st=T&&d[1]&&_r(R,d[1]),nn=T&&g.length>0,nr=nn&&tr(R,g),En=nn&&g[0]&&_r(R,g[0]),rr=nn&&g[1]&&_r(R,g[1]),rn={focused:u.month===A.value,selectable:!vt(R,x,w),selected:!!d.find(on=>on&&on.month===E&&on.year===u.year),valueText:le.format(R.toDate(S)),inRange:Ge||nr,firstInRange:!!Pe,lastInRange:!!st,inHoveredRange:!!nr,firstInHoveredRange:!!En,lastInHoveredRange:!!rr,outsideRange:!1,value:R,get disabled(){return k||!rn.selectable}};return rn}function Za(A){const{value:E,disabled:k,visibleRange:R=s("visibleRange")}=A,le=Nf(C,S,u),Ge=Va(s("visibleDuration")),Pe=o("outsideDaySelectable"),st=R.start.add(Ge).subtract({days:1}),nn=vt(E,R.start,st),nr=T&&tr(E,d),En=T&&d[0]&&Fe(E,d[0]),rr=T&&d[1]&&Fe(E,d[1]),rn=T&&g.length>0,on=rn&&tr(E,g),Pi=rn&&g[0]&&Fe(E,g[0]),Ci=rn&&g[1]&&Fe(E,g[1]),uh=d.some(dh=>dh!=null&&Fe(E,dh)),ki={invalid:vt(E,x,w),disabled:k||!Pe&&nn||vt(E,x,w)||U&&!uh,selected:uh,unavailable:If(E,$,C,x,w)&&!k,outsideRange:nn,today:QS(E,S),weekend:aE(E,C),value:E,valueText:le.format(E.toDate(S)),get focused(){return u!=null&&Fe(E,u)&&(!ki.outsideRange||Pe)},get selectable(){return!ki.disabled&&!ki.unavailable},inRange:nr||on,firstInRange:En,lastInRange:rr,inHoveredRange:on,firstInHoveredRange:Pi,lastInHoveredRange:Ci};return ki}function ZC(A){const{view:E="day",id:k}=A;return[E,k].filter(Boolean).join(" ")}return{focused:D,open:P,disabled:f,invalid:m,readOnly:p,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:K,isMaxSelected:U,view:r.get("view"),getRangePresetValue(A){return qf(A,C,S)},getWeekNumber(A){const E=A[0];return E?zf(E,C):0},getDaysInWeek(A,E=c){return Kf(A,E,C,O)},getOffset(A){const E=c.add(A),k=l.add(A),R=Ff(C,S,u);return{visibleRange:{start:E,end:k},weeks:qe(E),visibleRangeText:{start:R.format(E.toDate(S)),end:R.format(k.toDate(S))}}},getMonthWeeks:qe,isUnavailable:Si,weeks:qe(),weekDays:KE(c,O,S,C),visibleRangeText:s("visibleRangeText"),value:d,valueAsDate:d.filter(A=>A!=null).map(A=>A.toDate(S)),valueAsString:s("valueAsString"),focusedValue:u,focusedValueAsDate:u?.toDate(S),focusedValueAsString:o("format")(u,{locale:C,timeZone:S}),visibleRange:s("visibleRange"),selectToday(){const A=Ye(Kr(S,u.calendar),x,w);i({type:"VALUE.SET",value:[A]})},setValue(A){const E=A.map(k=>Ye(k,x,w));i({type:"VALUE.SET",value:E})},setTime(A,E=0){const k=Array.from(d);let R=k[E];R&&("hour"in R||(R=je(R)),R=R.set({hour:A.hour??("hour"in R?R.hour:0),minute:A.minute??("minute"in R?R.minute:0),second:A.second??("second"in R?R.second:0),millisecond:A.millisecond??("millisecond"in R?R.millisecond:0)}),k[E]=Ye(R,x,w),i({type:"VALUE.SET",value:k}))},clearValue(A={}){const{focus:E=!0}=A;i({type:"VALUE.CLEAR",focus:E})},setFocusedValue(A){i({type:"FOCUS.SET",value:A})},setOpen(A){o("inline")||n.matches("open")===A||i({type:A?"OPEN":"CLOSE"})},focusMonth:Ei,focusYear:X,getYears:Xa,getMonths:$e,getYearsGrid(A={}){const{columns:E=1}=A,k=er(c.year,{strict:!0}).map(R=>({label:R.toString(),value:R,disabled:!Hs(R,x?.year,w?.year)}));return ju(k,E)},getDecade(){const A=er(c.year,{strict:!0});return{start:A.at(0),end:A.at(-1)}},getMonthsGrid(A={}){const{columns:E=1,format:k}=A;return ju($e({format:k}),E)},format(A,E={month:"long",year:"numeric"}){return new He(C,{...E,calendar:A.calendar.identifier}).format(A.toDate(S))},setView(A){i({type:"VIEW.SET",view:A})},goToNext(){i({type:"GOTO.NEXT",view:r.get("view")})},goToPrev(){i({type:"GOTO.PREV",view:r.get("view")})},getRootProps(){return t.element({...oe.root.attrs,dir:o("dir"),id:iP(a),"data-state":P?"open":"closed","data-disabled":z(f),"data-readonly":z(p),"data-empty":z(b)})},getLabelProps(A={}){const{index:E=0}=A;return t.label({...oe.label.attrs,id:oP(a,E),dir:o("dir"),htmlFor:Jf(a,E),"data-state":P?"open":"closed","data-index":E,"data-disabled":z(f),"data-readonly":z(p)})},getControlProps(){return t.element({...oe.control.attrs,dir:o("dir"),id:Zf(a),"data-disabled":z(f),"data-placeholder-shown":z(b)})},getRangeTextProps(){return t.element({...oe.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...oe.content.attrs,hidden:!P,dir:o("dir"),"data-state":P?"open":"closed","data-placement":Q,"data-side":F,"data-inline":z(o("inline")),id:Ba(a),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":q.content})},getTableProps(A={}){const{view:E="day",columns:k=E==="day"?7:4}=A,R=ZC(A);return t.element({...oe.table.attrs,role:"grid","data-columns":k,"aria-roledescription":hP(E),id:sP(a,R),"aria-readonly":Se(p),"aria-disabled":Se(f),"aria-multiselectable":Se(o("selectionMode")!=="single"),"data-view":E,dir:o("dir"),tabIndex:-1,onKeyDown(le){if(le.defaultPrevented)return;const Pe={Enter(){E==="day"&&Si(u)||E==="month"&&!tn({value:u.month}).selectable||E==="year"&&!Ft({value:u.year}).selectable||i({type:"TABLE.ENTER",view:E,columns:k,focus:!0})},ArrowLeft(){i({type:"TABLE.ARROW_LEFT",view:E,columns:k,focus:!0})},ArrowRight(){i({type:"TABLE.ARROW_RIGHT",view:E,columns:k,focus:!0})},ArrowUp(){i({type:"TABLE.ARROW_UP",view:E,columns:k,focus:!0})},ArrowDown(){i({type:"TABLE.ARROW_DOWN",view:E,columns:k,focus:!0})},PageUp(st){i({type:"TABLE.PAGE_UP",larger:st.shiftKey,view:E,columns:k,focus:!0})},PageDown(st){i({type:"TABLE.PAGE_DOWN",larger:st.shiftKey,view:E,columns:k,focus:!0})},Home(){i({type:"TABLE.HOME",view:E,columns:k,focus:!0})},End(){i({type:"TABLE.END",view:E,columns:k,focus:!0})}}[Ix(le,{dir:o("dir")})];Pe&&(Pe(le),le.preventDefault(),le.stopPropagation())},onPointerLeave(){i({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){i({type:"TABLE.POINTER_DOWN",view:E})},onPointerUp(){i({type:"TABLE.POINTER_UP",view:E})}})},getTableHeadProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableHeaderProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHeader.attrs,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableBodyProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableBody.attrs,"data-view":E,"data-disabled":z(f)})},getTableRowProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableRow.attrs,"aria-disabled":Se(f),"data-disabled":z(f),"data-view":E})},getWeekNumberHeaderCellProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableCell.attrs,scope:"col","aria-label":q.weekColumnHeader,"data-view":E,"data-type":"week-number","data-disabled":z(f)})},getWeekNumberCellProps(A){const{weekIndex:E,week:k}=A,R=k[0]?zf(k[0],C):0;return t.element({...oe.tableCell.attrs,role:"rowheader","aria-label":q.weekNumberCell?.(R),"data-view":"day","data-week-index":E,"data-type":"week-number","data-disabled":z(f)})},getDayTableCellState:Za,getDayTableCellProps(A){const{value:E}=A,k=Za(A);return t.element({...oe.tableCell.attrs,role:"gridcell","aria-disabled":Se(!k.selectable),"aria-selected":k.selected||k.inRange,"aria-invalid":Se(k.invalid),"aria-current":k.today?"date":void 0,"data-value":E.toString()})},getDayTableCellTriggerProps(A){const{value:E}=A,k=Za(A);return t.element({...oe.tableCellTrigger.attrs,id:Ka(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":q.dayCell(k),"aria-disabled":Se(!k.selectable),"aria-invalid":Se(k.invalid),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E.toString(),"data-view":"day","data-today":z(k.today),"data-focus":z(k.focused),"data-unavailable":z(k.unavailable),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-outside-range":z(k.outsideRange),"data-weekend":z(k.weekend),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"day",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&JS(E,h)||i({type:"CELL.POINTER_MOVE",cell:"day",value:E,focus:le,outsideRange:k.outsideRange})}:void 0})},getMonthTableCellState:tn,getMonthTableCellProps(A){const{value:E,columns:k}=A,R=tn(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Se(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Se(!R.selectable),"data-value":E})},getMonthTableCellTriggerProps(A){const{value:E}=A,k=tn(A);return t.element({...oe.tableCellTrigger.attrs,id:Ka(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Se(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"month","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"month",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&_r(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"month",value:k.value,focus:le})}:void 0})},getYearTableCellState:Ft,getYearTableCellProps(A){const{value:E,columns:k}=A,R=Ft(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Se(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Se(!R.selectable),"data-value":E})},getYearTableCellTriggerProps(A){const{value:E}=A,k=Ft(A);return t.element({...oe.tableCellTrigger.attrs,id:Ka(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Se(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"year","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"year",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&Lr(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"year",value:k.value,focus:le})}:void 0})},getNextTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isNextVisibleRangeValid");return t.button({...oe.nextTrigger.attrs,dir:o("dir"),id:cP(a,E),type:"button","aria-label":q.nextTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.NEXT",view:E})}})},getPrevTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isPrevVisibleRangeValid");return t.button({...oe.prevTrigger.attrs,dir:o("dir"),id:aP(a,E),type:"button","aria-label":q.prevTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.PREV",view:E})}})},getClearTriggerProps(){return t.button({...oe.clearTrigger.attrs,id:Xf(a),dir:o("dir"),type:"button","aria-label":q.clearTrigger,hidden:!d.length,onClick(A){A.defaultPrevented||i({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...oe.trigger.attrs,id:Qf(a),dir:o("dir"),type:"button","data-placement":Q,"data-side":F,"aria-label":q.trigger(P),"aria-controls":Ba(a),"aria-expanded":P,"data-state":P?"open":"closed","data-placeholder-shown":z(b),"aria-haspopup":"grid",disabled:f,onClick(A){A.defaultPrevented||y&&i({type:"TRIGGER.CLICK"})}})},getViewProps(A={}){const{view:E="day"}=A;return t.element({...oe.view.attrs,"data-view":E,hidden:r.get("view")!==E})},getViewTriggerProps(A={}){const{view:E="day"}=A;return t.button({...oe.viewTrigger.attrs,"data-view":E,dir:o("dir"),id:lP(a,E),type:"button",disabled:f,"aria-label":q.viewTrigger(E),onClick(k){k.defaultPrevented||y&&i({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(A={}){const{view:E="day"}=A;return t.element({...oe.viewControl.attrs,"data-view":E,dir:o("dir")})},getInputProps(A={}){const{index:E=0,fixOnBlur:k=!0}=A;return t.input({...oe.input.attrs,id:Jf(a,E),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":E,"data-state":P?"open":"closed","data-placeholder-shown":z(b),readOnly:p,disabled:f,required:o("required"),"aria-invalid":Se(m),"data-invalid":z(m),placeholder:o("placeholder")||pP(C),defaultValue:s("valueAsString")[E],onBeforeInput(R){const{data:le}=yd(R);jf(le,G)||R.preventDefault()},onClick(R){R.defaultPrevented||o("openOnClick")&&y&&i({type:"OPEN",src:"input.click"})},onFocus(){i({type:"INPUT.FOCUS",index:E})},onBlur(R){const le=R.currentTarget.value.trim();i({type:"INPUT.BLUR",value:le,index:E,fixOnBlur:k})},onKeyDown(R){if(R.defaultPrevented||!y)return;const Ge={Enter(Pe){Dx(Pe)||Si(u)||Pe.currentTarget.value.trim()!==""&&i({type:"INPUT.ENTER",value:Pe.currentTarget.value,index:E})}}[R.key];Ge&&(Ge(R),R.preventDefault())},onInput(R){const le=R.currentTarget.value;i({type:"INPUT.CHANGE",value:ZE(le,G),index:E})}})},getMonthSelectProps(){return t.select({...oe.monthSelect.attrs,id:th(a),"aria-label":q.monthSelect,disabled:f,dir:o("dir"),defaultValue:c.month,onChange(A){Ei(Number(A.currentTarget.value))}})},getYearSelectProps(){return t.select({...oe.yearSelect.attrs,id:nh(a),disabled:f,"aria-label":q.yearSelect,dir:o("dir"),defaultValue:c.year,onChange(A){X(Number(A.currentTarget.value))}})},getPositionerProps(){return t.element({id:eh(a),...oe.positioner.attrs,dir:o("dir"),style:W.floating})},getPresetTriggerProps(A){const E=Array.isArray(A.value)?A.value:qf(A.value,C,S),k=E.filter(R=>R!=null).map(R=>R.toDate(S).toDateString());return t.button({...oe.presetTrigger.attrs,"aria-label":q.presetTrigger(k),type:"button",onClick(R){R.defaultPrevented||i({type:"PRESET.CLICK",value:E})}})}}}var{and:Ee}=ux();function CP(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if(!en(e[r],t[r]))return!1;return!0}function bi(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var kP=ad({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1;let i;if(e.createCalendar){const f=new Intl.DateTimeFormat(t).resolvedOptions().calendar;f!=="gregory"&&f!=="iso8601"&&(i=e.createCalendar(f))}const s=g=>!i||g.calendar.identifier===i.identifier?g:ve(g,i),a=e.defaultValue?vi(e.defaultValue).map(g=>Ye(s(g),e.min,e.max)):void 0,c=e.value?vi(e.value).map(g=>Ye(s(g),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||Kr(n,i);l=Ye(s(l),e.min,e.max);const d="day",u="year",h=Wa(e.view||d,d,u);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:r,defaultView:h,minView:d,maxView:u,outsideDaySelectable:!1,closeOnSelect:!0,format(g,{locale:f,timeZone:p}){return new He(f,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric",calendar:i?.identifier}).format(g.toDate(p))},parse(g,{locale:f,timeZone:p}){return tP(g,f,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")||e("inline")?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:en,hash:r=>r.toString(),sync:!0,onChange(r){const o=n(),i=o.get("view"),s=o.get("value"),a=bi(s,e);e("onFocusChange")?.({value:s,valueAsString:a,view:i,focusedValue:r})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:CP,hash:r=>r.map(o=>o?.toString()??"").join(","),onChange(r){const o=n(),i=bi(r,e);e("onValueChange")?.({value:r,valueAsString:i,view:o.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:en})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(r){e("onViewChange")?.({view:r})}})),startValue:t(()=>{const r=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:Mf(r,"start",{months:e("numOfMonths")},e("locale")),isEqual:en,hash:o=>o.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>_f(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>EP({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!_E(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!LE(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>bi(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:r,computed:o}){e([()=>t("locale")],()=>{r(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{r(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{r(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{r(["syncInputValue"])}),e([()=>n.hash("value")],()=>{r(["syncInputElement"])}),e([()=>o("valueAsString").toString()],()=>{r(["announceValueText"])}),e([()=>n.get("view")],()=>{r(["focusActiveCell"])}),e([()=>t("open")],()=>{r(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"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"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:Ee("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:Ee("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:Ee("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:"isAboveMinView",actions:["setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:Ee("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.TOGGLE":{actions:["setNextView"]},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"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>yP(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:({context:e,prop:t,event:n})=>{const r=t("maxSelectedDates");if(r==null)return!0;const o=e.get("value"),i=n.value??e.get("focusedValue");return o.some(a=>en(a,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const r=ih(n);return kS(r,()=>oh(n),{...t("positioning"),defer:!0,onComplete(i){e.set("currentPlacement",i.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",ME({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:r}){return r("inline")?void 0:jS(()=>yi(e),{type:"popover",defer:!0,layerStyleTargets:[()=>oh(e)],exclude:[...Ur(e),mi(e),fP(e)],onInteractOutside(i){n.set("restoreFocus",!i.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(i){i.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setNextView({context:e,prop:t}){const n=bP(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=wP(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const r=e.get("value"),o=t("locale"),i=t("timeZone");let s;if(t("selectionMode")==="range"){const[a,c]=r;a&&c?s=pi(a,c,o,i):a?s=pi(a,null,o,i):c?s=pi(c,null,o,i):s=""}else s=r.map(a=>pi(a,null,o,i)).filter(Boolean).join(",");n.get("announcer")?.announce(s,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){Ux({target:yi(e),doc:e.getDoc()})},enableTextSelection({scope:e}){bd({doc:e.getDoc(),target:yi(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&fe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){Te(()=>{Ur(e).forEach((r,o)=>{Yo(r,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;fe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;fe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const r=t.value.map(o=>Ye(o,n("min"),n("max")));e.set("value",r)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,r=Array.from(t.get("value")),o=t.get("activeIndex"),i=r[o],s=wi(e,n.value??t.get("focusedValue"));r[o]=ja(i,s),t.set("value",za(r))},resetSelection(e){const{context:t,event:n}=e,r=t.get("value")[0],o=wi(e,n.value??t.get("focusedValue"));t.set("value",[ja(r,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,r=wi(e,n.value??t.get("focusedValue")),o=t.get("value"),i=o.findIndex(s=>en(s,r));if(i===-1){const s=[...o,r];t.set("value",vi(s))}else{const s=Array.from(o);s.splice(i,1),t.set("value",vi(s))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),r=e.get("activeIndex"),o=n[r],i=e.get("focusedValue").copy();n[r]=ja(o,i),e.set("value",za(n));const s=t("valueAsString");e.set("inputValue",s[r])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});fe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});fe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});fe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});fe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:r}=e,o=Uf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));xi(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:r}=e,o=Wf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));xi(e,o)},focusSectionStart(e){const{context:t}=e;fe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;fe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=GE(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&xi(e,i)},focusPreviousSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=XE(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&xi(e,i)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});fe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});fe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});fe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});fe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,r=t.get("focusedValue").calendar;fe(e,Kr(n("timeZone"),r))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({months:n.columns});fe(e,r)},focusNextMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({months:n.columns});fe(e,r)},focusPreviousYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({years:n.columns});fe(e,r)},focusNextYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({years:n.columns});fe(e,r)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMinimumMonthInYear?.(n)??1;fe(e,n.set({month:r}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMonthsInYear(n);fe(e,n.set({month:r}))},focusFirstYear(e){const{context:t}=e,n=er(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[0]});fe(e,r)},focusLastYear(e){const{context:t}=e,n=er(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[n.length-1]});fe(e,r)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&Te(()=>{const r=t.get("view");rh(e,r)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&Te(()=>{const r=t.get("view");rh(e,r)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!t.type.startsWith("TABLE.ARROW")||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},focusTriggerElement({scope:e}){Te(()=>{mi(e)?.focus({preventScroll:!0})})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&Te(()=>{const[n]=Ur(e);(n??mi(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){Te(()=>{const t=Ur(e);if(t.length===0){mi(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(i=>i.value!==""),r=Math.max(n,0),o=t[r];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=dP(e);Yo(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=uP(e);Yo(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const r=Ur(e),o=n.index??t.get("activeIndex");Yo(r[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!sh(o)||fe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!sh(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Ye(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const s=bi(i,n);e.set("inputValue",s[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const r=e.get("focusedValue");if(!vt(r,e.get("startValue"),t("endValue")))return;const i=Mf(r,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),wi=(e,t)=>{const{context:n,prop:r}=e,o=n.get("view");let i=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return SP(s=>{vP(s,r("minView"))&&(i=i.set({[s]:s==="day"?1:0}))}),i},ja=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let r=t;return"hour"in t||(n?r=Pf(je(t),e.timeZone):r=je(t)),r.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function fe(e,t){const{context:n,prop:r,computed:o}=e;if(!t)return;const i=wi(e,t);if(en(n.get("focusedValue"),i))return;const a=zr(o("visibleDuration"),r("locale"),r("min"),r("max"))({focusedDate:i,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function xi(e,t){const{context:n}=e;n.set("startValue",t.startDate);const r=n.get("focusedValue");en(r,t.focusedDate)||n.set("focusedValue",t.focusedDate)}var ah=Gf.extendWith("view","valueText"),[ch,ae]=Gt({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),OP=e=>{const t=ae(),n=ee(()=>t().getClearTriggerProps(),e);return v(re.button,n)},TP=e=>{const t=ae(),n=Td(),r=ee(()=>t().getContentProps(),()=>n().presenceProps,e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,N(r,{ref(o){var i=u1(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},AP=e=>e.children(ae()),$P=e=>{const t=ae(),n=ee(()=>t().getControlProps(),e);return v(re.div,n)},DP=e=>{const[t,n]=gt()(e,["index","fixOnBlur"]),r=ae(),o=ee(()=>r().getInputProps(t),n);return v(re.input,o)},RP=e=>{const t=ae(),n=ee(()=>t().getLabelProps(),e);return v(re.label,n)},MP=e=>{const t=ae(),n=ee(()=>t().getMonthSelectProps(),e);return v(re.select,N(n,{get children(){return v(Sc,{get each(){return t().getMonths()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},[IP,Sn]=Gt({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),_P=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getNextTriggerProps(n),e);return v(re.button,r)},LP=e=>{const t=ae(),n=Td(),r=ee(()=>t().getPositionerProps(),e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,r)}})},NP=e=>{const[t,n]=gt()(e,["value"]),r=ae(),o=ee(()=>r().getPresetTriggerProps(t),n);return v(re.button,o)},FP=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getPrevTriggerProps(n),e);return v(re.button,r)},VP=e=>{const t=ae(),n=ee(()=>t().getRangeTextProps(),e),r=_(()=>{const{start:o,end:i}=t().visibleRangeText;return $0([o,i]).filter(Boolean).join(" - ")});return v(re.div,N(n,{get children(){return r()}}))},BP=e=>{const t=ae(),n=()=>t().value.length>0;return v(ie,{get when(){return typeof e.children=="function"},get fallback(){return v(re.span,N(()=>ah.build().valueText.attrs,e,{get children(){return zt(()=>!!n())()?t().valueAsString.join(e.separator??", "):e.placeholder}}))},get children(){return v(ie,{get when(){return n()},get fallback(){return e.placeholder},get children(){return v(cn,{get each(){return t().value},children:(r,o)=>zt(()=>e.children({value:r,index:o(),valueAsString:t().valueAsString[o()],remove:()=>{t().setValue(t().value.filter((i,s)=>s!==o()))}}))})}})}})},KP=e=>{const t=Be(),n=AE(),r=HS(),o=_(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...Qu(e)})),i=xd(kP,o);return _(()=>PP(i,r1))},zP=e=>{const[t,n]=kd(e),[r,o]=gt()(n,["closeOnSelect","createCalendar","defaultFocusedValue","defaultOpen","defaultValue","defaultView","disabled","fixedWeeks","focusedValue","format","id","ids","inline","invalid","isDateUnavailable","locale","max","maxSelectedDates","maxView","min","minView","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","onVisibleRangeChange","open","openOnClick","outsideDaySelectable","parse","placeholder","positioning","readOnly","required","selectionMode","showWeekNumbers","startOfWeek","timeZone","translations","value","view"]),i=KP(r),s=Pd(ee(t,()=>({present:i().open}))),a=ee(()=>i().getRootProps(),o);return v(ch,{value:i,get children(){return v(Od,{value:s,get children(){return v(re.div,a)}})}})},UP=e=>{const[t,n]=kd(e),[{value:r},o]=gt()(n,["value"]),i=Pd(ee(t,()=>({present:r().open}))),s=ee(()=>r().getRootProps(),o);return v(ch,{value:r,get children(){return v(Od,{value:i,get children(){return v(re.div,s)}})}})},[WP,Wr]=Gt({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),jP=e=>{const[t,n]=gt()(e,["columns"]),r=ae(),o=Sn(),i=Be(),s=ee(()=>({columns:t.columns,id:i}),o),a=ee(()=>r().getTableProps(s),n);return v(WP,{value:s,get children(){return v(re.table,a)}})},HP=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableBodyProps(n),e);return v(re.tbody,r)},[YP,qP]=Gt({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),GP=e=>{const[t,n]=gt()(e,["disabled","value","visibleRange","columns"]),r=ae(),o=Sn(),i=_(()=>{const c={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return c(t)}),s=ee(i,n);return v(YP,{value:t,get children(){return v(re.td,s)}})},XP=e=>{const t=ae(),n=qP(),r=Sn(),o=_(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=ee(o,e);return v(re.div,i)},ZP=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableHeadProps(n),e);return v(re.thead,r)},JP=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableHeaderProps(n),e);return v(re.th,r)},QP=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableRowProps(n),e);return v(re.tr,r)},eC=e=>{const t=ae(),n=ee(()=>t().getTriggerProps(),e);return v(re.button,n)},tC=e=>{const[t,n]=gt()(e,["view"]),r=ae(),o=ee(()=>ah.build().view.attrs,n);return v(IP,{value:t,get children(){return v(re.div,N(o,{get hidden(){return r().view!==t.view}}))}})},nC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewControlProps(n),e);return v(re.div,r)},rC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewTriggerProps(n),e);return v(re.button,r)},oC=gt(),iC=e=>{const[t,n]=oC(e,["weekIndex","week"]),r=ae(),o=ee(()=>r().getWeekNumberCellProps(t),n);return v(re.td,o)},sC=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getWeekNumberHeaderCellProps(n),e);return v(re.th,r)},aC=e=>{const t=ae(),n=ee(()=>t().getYearSelectProps(),e);return v(re.select,N(n,{get children(){return v(Sc,{get each(){return t().getYears()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},Nt={};DE(Nt,{ClearTrigger:()=>OP,Content:()=>TP,Context:()=>AP,Control:()=>$P,Input:()=>DP,Label:()=>RP,MonthSelect:()=>MP,NextTrigger:()=>_P,Positioner:()=>LP,PresetTrigger:()=>NP,PrevTrigger:()=>FP,RangeText:()=>VP,Root:()=>zP,RootProvider:()=>UP,Table:()=>jP,TableBody:()=>HP,TableCell:()=>GP,TableCellTrigger:()=>XP,TableHead:()=>ZP,TableHeader:()=>JP,TableRow:()=>QP,Trigger:()=>eC,ValueText:()=>BP,View:()=>tC,ViewControl:()=>nC,ViewTrigger:()=>rC,WeekNumberCell:()=>iC,WeekNumberHeaderCell:()=>sC,YearSelect:()=>aC}),Nt.Label,Nt.TableHead,Nt.TableBody,Nt.ClearTrigger,Nt.YearSelect,Nt.MonthSelect,Nt.Context,Nt.RootProvider;var cC=j("<div>Unknown bot message type");const lC=e=>v(Lb,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(js,{get text(){return e.text}}):e.type==="buttons"?v(Vb,N(()=>e.buttons)):e.type==="list"?v(v0,N(()=>e.list)):e.type==="media"?v(Wu,N(()=>e.media)):e.type==="link"?v(Wb,N(()=>e.link)):e.type==="cards"?v(zb,N(()=>e.cards)):e.type==="date"?v(js,{get text(){return e.text}}):cC()}});var uC=j('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const dC=e=>(()=>{var t=uC(),n=t.firstChild;return B(n,()=>e.text?.trim()),t})();var fC=j('<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 hC=({children:e,createdAt:t})=>(()=>{var n=fC(),r=n.firstChild;return B(r,e),B(n,v(Tu,{createdAt:t,anchor:"end"}),null),n})();var gC=j("<div>Unknown user message type");const pC=e=>v(hC,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(js,{get text(){return e.text}}):e.type==="media"?v(Wu,N(()=>e.media)):gC()}});var mC=j("<div>Unknown message origin");const yC=e=>e.origin==="bot"?v(lC,e):e.origin==="user"?v(pC,e):e.origin==="service"?v(dC,e):mC();function Ha(e){return Ke({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 vC=j('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),bC=j("<div>");const Ya=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o}=qt(),{onOpen:i}=Mc(),s=(a=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},a)};return ge("reset",()=>{r()}),an(()=>{o(),s(200)}),n(s),i(()=>s(200)),(()=>{var a=vC(),c=e;return typeof c=="function"?Bi(c,a):e=a,B(a,v(cn,{get each(){return t()},get fallback(){return(()=>{var l=bC();return B(l,()=>kn("emptyMessages")),l})()},children:l=>v(yC,l)})),a})()};var wC=j("<textarea>");const xC=e=>{const[,t]=J(e,["class"]);return(()=>{var n=wC();return un(n,N({get class(){return Kt("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md: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 SC=j('<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 EC=e=>(()=>{var t=SC();return un(t,e,!0,!0),t})();var PC=j('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const CC=()=>(()=>{var e=PC(),t=e.firstChild;return B(e,v(EC,{height:15}),t),e})();var kC=j('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"></div><div class="flex justify-center opacity-70 scale-95">');const qa=()=>{const{pushMessage:e}=qt(),[t,n]=L(""),r=()=>{t().trim()&&(e(t()),n(""))},o=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),r())};return ge("setInput",i=>{i&&n(i)}),(()=>{var i=kC(),s=i.firstChild,a=s.firstChild,c=a.nextSibling;return B(a,v(xC,{id:"chat-input",get placeholder(){return kn("inputPlaceholder")},get value(){return t()},onInput:l=>n(l.currentTarget.value),onKeyDown:o,class:"focus-visible:ring-primary min-h-[44px] max-h-[120px] py-3 leading-tight resize-none"}),null),B(a,v(Je,{variant:"outline",class:"h-[44px] w-[44px] p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",onClick:r,get children(){return v(Sp,{size:20})}}),null),B(c,v(CC,{})),i})()};var OC=j('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),TC=j("<span class=sr-only>Close"),AC=j('<div><div class="flex justify-center gap-3 items-center">'),$C=j("<span class=sr-only>Open"),DC=j("<span class=font-bold>"),RC=j("<span>"),MC=j('<div class="animate-pulse flex p-1">');const IC=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Mc(),{chatWidget:s}=ye(),[a,c]=L(!0),[l,d]=L("");setTimeout(()=>c(!1),2e3),s()?.openDelay&&!s()?.hideWidget&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const u=()=>(s()?.style.margin??5)*4,h=()=>s()?.style.position==="left"?{left:`${u()}px`}:{right:`${u()}px`};return ge("open",()=>{o()}),ge("close",()=>{i()}),ge("toggle",()=>{r()}),ge("onAnswer",g=>{g.text&&d(g.text),o()}),(()=>{var g=AC(),f=g.firstChild;return B(g,v(ie,{get when(){return zt(()=>!!n())()&&!s()?.hideWidget},get children(){var p=OC();return B(p,e),p}}),f),B(f,v(ie,{get when(){return s()?.whatsappBtn},get children(){return v(Je,{onclick:()=>window.open(s()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return v(Db,{class:"size-9",color:"white"})}})}}),null),B(f,v(ie,{get when(){return!s()?.hideWidget},get children(){return v(ie,{get when(){return n()},get fallback(){return v(Je,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,$C(),v(ie,{get when(){return s()?.balloonMessage},get children(){var p=RC();return B(p,v(ie,{get when(){return l()},get fallback(){return v(ie,{get when(){return!a()},get fallback(){return(()=>{var m=MC();return B(m,v(Ha,{class:"size-2 animate-bounce"}),null),B(m,v(Ha,{class:"size-2 animate-bounce delay-150"}),null),B(m,v(Ha,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return zt(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=DC();return B(m,(()=>{var y=zt(()=>l().length>20);return()=>y()?l().substring(0,17)+"...":l()})()),m}})),me(()=>ln(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return v(Je,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,TC()]}})}})}}),null),me(p=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(s()?.style.position==="left"?" items-start":" items-end"),y=h();return m!==p.e&&ln(g,p.e=m),p.t=ro(g,y,p.t),p},{e:void 0,t:void 0}),g})()};var _C=j('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const LC=({children:e})=>{const{chatWidget:t}=ye(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=_C();return ro(r,n),B(r,e),r})()};var NC=j("<div id=smarttalks-widget>");const FC=({children:e})=>{const{chatWidget:t}=ye(),[n,r]=L(!1),[o,i]=L(!1),[s,a]=L("100%"),c=()=>{typeof window<"u"&&i(window.innerWidth<768)},l=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};V(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),an(()=>{c(),window.addEventListener("resize",c),window.visualViewport&&(window.visualViewport.addEventListener("resize",l),window.visualViewport.addEventListener("scroll",l))}),Y(()=>{window.removeEventListener("resize",c),window.visualViewport&&(window.visualViewport.removeEventListener("resize",l),window.visualViewport.removeEventListener("scroll",l)),document.body.style.overflow="",document.body.style.position=""});const d=()=>(t()?.style.margin??5)*4,u=()=>{if(o())return{height:s(),top:"0px"};const h={};return t()?.fullscreen?(h.height="100%",h["max-height"]="100%",h.width="100%",h["max-width"]="100%",h.bottom=0,h.left=0):t()?.style.position&&(h[t()?.style.position||"right"]=`${d()}px`),h};return ge("open",()=>{r(!0),he("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),ge("close",()=>{r(!1),he("onClose")}),ge("toggle",()=>{r(!n()),he("onToggle")}),ge("onAnswer",()=>{r(!0),he("onOpen")}),setTimeout(()=>{r(!0),he("onOpen")},(t()?.openDelay||0)*1e3),v(ie,{get when(){return n()},get children(){var h=NC();return B(h,e),me(g=>{var f=`
182
182
  fixed flex flex-col bg-background text-foreground shadow-xl overflow-hidden z-[99999]
183
183
 
184
184
  ${o()?"inset-x-0 top-0 w-full rounded-none m-0":"transition-all duration-300 ease-in-out w-[400px] h-[min(85vh,700px)] md:w-[400px] md:max-h-[90%] md:rounded-xl md:bottom-5"}
185
- `,p=u();return h!==g.e&&nt(f,g.e=h),g.t=an(f,p,g.t),g},{e:void 0,t:void 0}),f}})};var em=D('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const ho=()=>(()=>{var e=em();return A(e,y(mc,{size:45,class:"animate-spin"})),e})(),tm=()=>{const{chatWidget:e}=ie(),{loading:t}=et();return y(Yp,{get openIcon(){return y(si,{get src(){return e()?.avatar}})},get children(){return[y(Z,{get when(){return t()},get children(){return y(ho,{})}}),y(Qr,{}),y(uo,{}),y(fo,{})]}})},nm=()=>{const{loading:e}=et();return y(Qp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(ho,{})}}),y(Qr,{}),y(uo,{}),y(fo,{})]}})},rm=()=>{const{loading:e}=et();return y(Jp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(ho,{})}}),y(Qr,{}),y(uo,{}),y(fo,{})]}})},om=()=>{const{chatWidget:e}=ie();return y(Bo,{get children(){return[y(It,{get when(){return e()?.mode==="standard"},get children(){return y(tm,{})}}),y(It,{get when(){return e()?.mode==="popup"},get children(){return y(nm,{})}}),y(It,{get when(){return e()?.mode==="static"},get children(){return y(rm,{})}})]}})};var im=D("<div><div>Form");const sm=()=>{const{formWidget:e}=ie();return(()=>{var t=im();return t.firstChild,A(t,()=>e()?._id,null),t})()};function am(){const{widget:e}=ie();return y(Bo,{get children(){return[y(It,{get when(){return e()?.type==="chat"},get children(){return y(om,{})}}),y(It,{get when(){return e()?.type==="form"},get children(){return y(sm,{})}})]}})}var lm=D("<style>"),cm=D("<div>");let la=!1;const um=({id:e,settings:t,side:n,margin:r,mode:o})=>{if(la)return console.warn("SmartTalks.ai Widget: duplicate instance blocked"),[];la=!0;const{setWidgetId:i}=ie(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=lm();return A(a,jl),a})(),(()=>{var a=cm();return A(a,y(am,{})),a})()]},dm={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Ul("smarttalks-widget",dm,um)})(),qa()});
185
+ `,p=u();return f!==g.e&&ln(h,g.e=f),g.t=ro(h,p,g.t),g},{e:void 0,t:void 0}),h}})};var VC=j('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const Ga=()=>(()=>{var e=VC();return B(e,v(xp,{size:45,class:"animate-spin"})),e})(),BC=()=>{const{chatWidget:e}=ye(),{loading:t}=qt();return v(IC,{get openIcon(){return v(Uc,{get src(){return e()?.avatar}})},get children(){return[v(ie,{get when(){return t()},get children(){return v(Ga,{})}}),v(Ls,{}),v(Ya,{}),v(qa,{})]}})},KC=()=>{const{loading:e}=qt();return v(FC,{get children(){return[v(ie,{get when(){return e()},get children(){return v(Ga,{})}}),v(Ls,{}),v(Ya,{}),v(qa,{})]}})},zC=()=>{const{loading:e}=qt();return v(LC,{get children(){return[v(ie,{get when(){return e()},get children(){return v(Ga,{})}}),v(Ls,{}),v(Ya,{}),v(qa,{})]}})},UC=()=>{const{chatWidget:e}=ye();return v(Ec,{get children(){return[v(lr,{get when(){return e()?.mode==="standard"},get children(){return v(BC,{})}}),v(lr,{get when(){return e()?.mode==="popup"},get children(){return v(KC,{})}}),v(lr,{get when(){return e()?.mode==="static"},get children(){return v(zC,{})}})]}})};var WC=j("<div><div>Form");const jC=()=>{const{formWidget:e}=ye();return(()=>{var t=WC();return t.firstChild,B(t,()=>e()?._id,null),t})()};function HC(){const{widget:e}=ye();return v(Ec,{get children(){return[v(lr,{get when(){return e()?.type==="chat"},get children(){return v(UC,{})}}),v(lr,{get when(){return e()?.type==="form"},get children(){return v(jC,{})}})]}})}var YC=j("<style>"),qC=j("<div>");let lh=!1;const GC=({id:e,settings:t,side:n,margin:r,mode:o})=>{if(lh)return console.warn("SmartTalks.ai Widget: duplicate instance blocked"),[];lh=!0;const{setWidgetId:i}=ye(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=YC();return B(a,jg),a})(),(()=>{var a=qC();return B(a,v(HC,{})),a})()]},XC={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Wg("smarttalks-widget",XC,GC)})(),Gh()}));