@smarttalks.ai/widget 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +501 -520
- package/lib/index.umd.cjs +16 -16
- package/package.json +1 -1
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 go(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tt(e))&&(r&&(r+=" "),r+=t);return r}const jn="-",sa=e=>{const t=la(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(jn);return a[0]===""&&a.length!==1&&a.shift(),po(a,t)||aa(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},po=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?po(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(jn);return t.validators.find(({validator:s})=>s(i))?.classGroupId},mo=/^\[(.+)\]$/,aa=e=>{if(mo.test(e)){const t=mo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},la=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ua(Object.entries(e.classGroups),n).forEach(([i,s])=>{Hn(s,r,i,t)}),r},Hn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:yo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(ca(o)){Hn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Hn(s,yo(t,i),n,r)})})},yo=(e,t)=>{let n=e;return t.split(jn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ca=e=>e.isThemeGetter,ua=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,da=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},bo="!",fa=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,d=0,u;for(let p=0;p<a.length;p++){let b=a[p];if(c===0){if(b===o&&(r||a.slice(p,p+i)===t)){l.push(a.slice(d,p)),d=p+i;continue}if(b==="/"){u=p;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?a:a.substring(d),m=h.startsWith(bo),f=m?h.substring(1):h,g=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:s}):s},ha=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ga=e=>({cache:da(e.cacheSize),parseClassName:fa(e),...sa(e)}),pa=/\s+/,ma=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(pa);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=n(c);let f=!!m,g=r(f?h.substring(0,m):h);if(!g){if(!f){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}f=!1}const p=ha(d).join(":"),b=u?p+bo:p,v=b+g;if(i.includes(v))continue;i.push(v);const w=o(g,f);for(let x=0;x<w.length;++x){const O=w[x];i.push(b+O)}a=c+(a.length>0?" "+a:a)}return a};function ya(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vo(t))&&(r&&(r+=" "),r+=n);return r}const vo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vo(e[r]))&&(n&&(n+=" "),n+=t);return n};function ba(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,u)=>u(d),e());return n=ga(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=ma(l,n);return o(l,d),d}return function(){return i(ya.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wo=/^\[(?:([a-z-]+):)?(.+)\]$/i,va=/^\d+\/\d+$/,wa=new Set(["px","full","screen"]),xa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ea=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ka=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ca=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ct(e)||wa.has(e)||va.test(e),qe=e=>ut(e,"length",Ma),ct=e=>!!e&&!Number.isNaN(Number(e)),qn=e=>ut(e,"number",ct),Dt=e=>!!e&&Number.isInteger(Number(e)),Oa=e=>e.endsWith("%")&&ct(e.slice(0,-1)),N=e=>wo.test(e),We=e=>xa.test(e),_a=new Set(["length","size","percentage"]),Pa=e=>ut(e,_a,xo),Aa=e=>ut(e,"position",xo),Ta=new Set(["image","url"]),Da=e=>ut(e,Ta,Ra),La=e=>ut(e,"",Ia),Lt=()=>!0,ut=(e,t,n)=>{const r=wo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ma=e=>Sa.test(e)&&!Ea.test(e),xo=()=>!1,Ia=e=>ka.test(e),Ra=e=>Ca.test(e),$a=ba(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),i=X("borderRadius"),s=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),h=X("gap"),m=X("gradientColorStops"),f=X("gradientColorStopPositions"),g=X("inset"),p=X("margin"),b=X("opacity"),v=X("padding"),w=X("saturate"),x=X("scale"),O=X("sepia"),k=X("skew"),E=X("space"),$=X("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",N,t],I=()=>[N,t],ne=()=>["",Ne,qe],Y=()=>["auto",ct,N],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",N],At=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Pe=()=>[ct,N];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[Ne,qe],blur:["none","",We,N],brightness:Pe(),borderColor:[e],borderRadius:["none","","full",We,N],borderSpacing:I(),borderWidth:ne(),contrast:Pe(),grayscale:ie(),hueRotate:Pe(),invert:ie(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Oa,qe],inset:L(),margin:L(),opacity:Pe(),padding:I(),saturate:Pe(),scale:Pe(),sepia:ie(),skew:Pe(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",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:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dt,N]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",Dt,N]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Dt,N]},N]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Dt,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:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",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,qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qn]}],"font-family":[{font:[Lt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",ct,qn]}],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:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ne,qe]}],"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(),Aa]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Pa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Da]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...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":[b]}],"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":[Ne,N]}],"outline-w":[{outline:[Ne,qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ne,qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,La]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",We,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Pe()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Pe()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Dt,N]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"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,qe,qn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Ge(...e){return $a(go(e))}function Fa(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",Xt(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Xt(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Xt(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Xt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Xt(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Na(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function Ka(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function Wn(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Ba={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function dt(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Ba[n][e]}const Jt="https://heimdall.smarttalks.ai/api",za="wss://heimdall.smarttalks.ai",So="smarttalkswidget";function ee(e,...t){window.postMessage({from:So,command:e,args:t})}function se(e,t){window.addEventListener("message",n=>{n.data?.from===So&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function Va(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{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=>{se("onOpen",e)},onClose:e=>{se("onClose",e)},onToggle:e=>{se("onToggle",e)},onReset:e=>{se("onReset",e)},onInput:e=>{se("onInput",e)},onAnswer:e=>{se("onAnswer",e)},onLoad:e=>{se("onLoad",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function ko(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Ua(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),_o(o.value)&&!Ga(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function ja(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=_o(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Wa(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Ha(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function qa(e,t){const n=Ua(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?Co(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&Oo(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&Oo(this,i.attribute,i.value,!!i.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function Co(e){if(e)try{return JSON.parse(e)}catch{return e}}function Oo(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Wa(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function _o(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Ga(e){return Object.prototype.toString.call(e)==="[object Function]"}function Ya(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Gn;function Xa(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=qa(this,t);const o=Ha(this.props),i=this.Component,s=Gn;try{Gn=this,this.__initialized=!0,Ya(i)?new i(o,{element:this}):i(o,{element:this})}finally{Gn=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?Co(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function Ja(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Xa(r,ja(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const B={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Po(this.context.count)},getNextContextId(){return Po(this.context.count++)}};function Po(e){const t=String(e),n=t.length-1;return B.context.id+(n?String.fromCharCode(96+n):"")+t}function Za(e){B.context=e}const Qa=!1,el=(e,t)=>e===t,be=Symbol("solid-proxy"),Ao=typeof Proxy=="function",Yn=Symbol("solid-track"),Zt={equals:el};let To=$o;const Ke=1,Qt=2,Do={owned:null,cleanups:null,context:null,owner:null},Xn={};var H=null;let Jn=null,tl=null,W=null,ae=null,Be=null,en=0;function ze(e,t){const n=W,r=H,o=e.length===0,i=t===void 0?r:t,s=o?Do:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>q(()=>Mt(s)));H=s,W=null;try{return Ve(a,!0)}finally{W=n,H=r}}function P(e,t){t=t?Object.assign({},Zt,t):Zt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ro(n,o));return[Io.bind(n),r]}function Lo(e,t,n){const r=nn(e,t,!0,Ke);ft(r)}function re(e,t,n){const r=nn(e,t,!1,Ke);ft(r)}function D(e,t,n){To=ll;const r=nn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),Be?Be.push(r):ft(r)}function C(e,t,n){n=n?Object.assign({},Zt,n):Zt;const r=nn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ft(r),Io.bind(r)}function nl(e){return e&&typeof e=="object"&&"then"in e}function rl(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Xn,l=null,c=!1,d="initialValue"in i,u=typeof r=="function"&&C(r);const h=new Set,[m,f]=(i.storage||P)(i.initialValue),[g,p]=P(void 0),[b,v]=P(void 0,{equals:!1}),[w,x]=P(d?"ready":"unresolved");B.context&&(l=B.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:B.load&&B.has(l)&&(a=B.load(l)));function O(_,R,L,I){return s===_&&(s=null,I!==void 0&&(d=!0),(_===a||R===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(I,{value:R})),a=Xn,k(R,L)),R}function k(_,R){Ve(()=>{R===void 0&&f(()=>_),x(R!==void 0?"errored":d?"ready":"unresolved"),p(R);for(const L of h.keys())L.decrement();h.clear()},!1)}function E(){const _=il,R=m(),L=g();if(L!==void 0&&!s)throw L;return W&&W.user,R}function $(_=!0){if(_!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){O(s,q(m));return}const L=a!==Xn?a:q(()=>o(R,{value:m(),refetching:_}));return nl(L)?(s=L,"value"in L?(L.status==="success"?O(s,L.value,void 0,R):O(s,void 0,er(L.value),R),L):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),v()},!1),L.then(I=>O(L,I,void 0,R),I=>O(L,void 0,er(I),R)))):(O(s,L,void 0,R),L)}return Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const _=w();return _==="pending"||_==="refreshing"}},latest:{get(){if(!d)return E();const _=g();if(_&&!s)throw _;return m()}}}),u?Lo(()=>$(!1)):$(!1),[E,{refetch:$,mutate:f}]}function Ee(e){return Ve(e,!1)}function q(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function et(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i)return i=!1,s;const l=q(()=>t(a,o,s));return o=a,l}}function tn(e){D(()=>q(e))}function K(e){return H===null||(H.cleanups===null?H.cleanups=[e]:H.cleanups.push(e)),e}function Zn(){return W}function Mo(){return H}function ol(e,t){const n=H,r=W;H=e,W=null;try{return Ve(t,!0)}catch(o){tr(o)}finally{H=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:cl(n),defaultValue:e}}function he(e){let t;return H&&H.context&&(t=H.context[e.id])!==void 0?t:e.defaultValue}function Qn(e){const t=C(e),n=C(()=>nr(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let il;function Io(){if(this.sources&&this.state)if(this.state===Ke)ft(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 Ro(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Jn&&Jn.running;s&&Jn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?ae.push(i):Be.push(i),i.observers&&Fo(i)),s||(i.state=Ke)}if(ae.length>1e6)throw ae=[],new Error},!1)),t}function ft(e){if(!e.fn)return;Mt(e);const t=en;sl(e,e.value,t)}function sl(e,t,n){let r;const o=H,i=W;W=H=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Mt),e.owned=null),e.updatedAt=n+1,tr(s)}finally{W=i,H=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ro(e,r):e.value=r,e.updatedAt=n)}function nn(e,t,n,r=Ke,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:H,context:H?H.context:null,pure:n};return H===null||H!==Do&&(H.owned?H.owned.push(i):H.owned=[i]),i}function rn(e){if(e.state===0)return;if(e.state===Qt)return on(e);if(e.suspense&&q(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<en);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)ft(e);else if(e.state===Qt){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=[]),Be?n=!0:Be=[],en++;try{const r=e();return al(n),r}catch(r){n||(Be=null),ae=null,tr(r)}}function al(e){if(ae&&($o(ae),ae=null),e)return;const t=Be;Be=null,t.length&&Ve(()=>To(t),!1)}function $o(e){for(let t=0;t<e.length;t++)rn(e[t])}function ll(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rn(r)}if(B.context){if(B.count){B.effects||(B.effects=[]),B.effects.push(...e.slice(0,n));return}Za()}for(B.effects&&(B.done||!B.count)&&(e=[...B.effects,...e],n+=B.effects.length,delete B.effects),t=0;t<n;t++)rn(e[t])}function on(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Ke?r!==t&&(!r.updatedAt||r.updatedAt<en)&&rn(r):o===Qt&&on(r,t)}}}function Fo(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Qt,n.pure?ae.push(n):Be.push(n),n.observers&&Fo(n))}}function Mt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Mt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Mt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function er(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function tr(e,t=H){throw er(e)}function nr(e){if(typeof e=="function"&&!e.length)return nr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=nr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function cl(e,t){return function(r){let o;return re(()=>o=q(()=>(H.context={...H.context,[e]:r.value},Qn(()=>r.children))),void 0),o}}const ul=Symbol("fallback");function No(e){for(let t=0;t<e.length;t++)e[t]()}function dl(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return K(()=>No(i)),()=>{let l=e()||[],c=l.length,d,u;return l[Yn],q(()=>{let m,f,g,p,b,v,w,x,O;if(c===0)s!==0&&(No(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ul],o[0]=ze(k=>(i[0]=k,n.fallback())),s=1);else if(s===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=ze(h);s=c}else{for(g=new Array(c),p=new Array(c),a&&(b=new Array(c)),v=0,w=Math.min(s,c);v<w&&r[v]===l[v];v++);for(w=s-1,x=c-1;w>=v&&x>=v&&r[w]===l[x];w--,x--)g[x]=o[w],p[x]=i[w],a&&(b[x]=a[w]);for(m=new Map,f=new Array(x+1),u=x;u>=v;u--)O=l[u],d=m.get(O),f[u]=d===void 0?-1:d,m.set(O,u);for(d=v;d<=w;d++)O=r[d],u=m.get(O),u!==void 0&&u!==-1?(g[u]=o[d],p[u]=i[d],a&&(b[u]=a[d]),u=f[u],m.set(O,u)):i[d]();for(u=v;u<c;u++)u in g?(o[u]=g[u],i[u]=p[u],a&&(a[u]=b[u],a[u](u))):o[u]=ze(h);o=o.slice(0,s=c),r=l.slice(0)}return o});function h(m){if(i[u]=m,a){const[f,g]=P(u);return a[u]=g,t(l[u],f)}return t(l[u])}}}function y(e,t){return q(()=>e(t||{}))}function sn(){return!0}const rr={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return t===be?!0:e.has(t)},set:sn,deleteProperty:sn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:sn,deleteProperty:sn}},ownKeys(e){return e.keys()}};function or(e){return(e=typeof e=="function"?e():e)?e:{}}function fl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function T(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&be in a,e[s]=typeof a=="function"?(t=!0,C(a)):a}if(Ao&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=or(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in or(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(or(e[a])));return[...new Set(s)]}},rr);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:fl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const h=n[d];h&&(u.get?h.push(u.get.bind(a)):u.value!==void 0&&h.push(()=>u.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(Ao&&be in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},rr));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},rr)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let hl=0;function Ae(){return B.context?B.getNextContextId():`cl-${hl++}`}const Ko=e=>`Stale read from <${e}>.`;function ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return C(dl(()=>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?q(()=>i(t?o:()=>{if(!q(r))throw Ko("Show");return n()})):i}return e.fallback},void 0,void 0)}function Bo(e){const t=Qn(()=>e.children),n=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:(h,m)=>!h==!m});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?q(()=>a(s.keyed?i():()=>{if(q(n)()?.[0]!==o)throw Ko("Match");return i()})):a},void 0,void 0)}function It(e){return e}const gl=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],pl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...gl]),ml=new Set(["innerHTML","textContent","innerText","children"]),yl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),bl=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function vl(e,t){const n=bl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const wl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xl=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Sl={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function El(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!c){c=new Map;let u=a;for(;u<i;)c.set(n[u],u++)}const d=c.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,h=1,m;for(;++u<o&&u<i&&!((m=c.get(t[u]))==null||m!==d+h);)h++;if(h>d-a){const f=t[s];for(;a<d;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const zo="_$DX_DELEGATE";function M(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function kl(e,t=window.document){const n=t[zo]||(t[zo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Ll))}}function ue(e,t,n){nt(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Cl(e,t,n,r){nt(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ol(e,t,n){nt(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function gt(e,t){nt(e)||(t==null?e.removeAttribute("class"):e.className=t)}function _l(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Pl(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Vo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Vo(e,a,!0),n[a]=l)}return n}function an(e,t,n){if(!t)return n?ue(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function tt(e,t={},n,r){const o={};return r||re(()=>o.children=Rt(e,t.children,o.children)),re(()=>typeof t.ref=="function"&&ir(t.ref,e)),re(()=>Al(e,t,n,!0,o,!0)),o}function ir(e,t,n){return q(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Rt(e,t,r,n);re(o=>Rt(e,t(),o,n),r)}function Al(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Uo(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Uo(e,s,a,o[s],n,i,t)}}function Tl(e){let t,n;return!nt()||!(t=B.registry.get(n=Ml()))?e():(B.completed&&B.completed.add(t),B.registry.delete(n),t)}function nt(e){return!!B.context&&!B.done&&(!e||e.isConnected)}function Dl(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Vo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Uo(e,t,n,r,o,i,s){let a,l,c,d,u;if(t==="style")return an(e,n,r);if(t==="classList")return Pl(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),m=wl.has(h);if(!m&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(m||n)&&(_l(e,h,n,m),m&&kl([h]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Ol(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=ml.has(t))||!o&&((d=vl(t,e.tagName))||(l=pl.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(u)t=t.slice(5),l=!0;else if(nt(e))return n;t==="class"||t==="className"?gt(e,n):a&&!l&&!c?e[Dl(t)]=n:e[d||t]=n}else{const h=o&&t.indexOf(":")>-1&&Sl[t.split(":")[0]];h?Cl(e,h,t,n):ue(e,yl[t]||t,n)}return n}function Ll(e){if(B.registry&&B.events&&B.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),B.registry&&!B.done&&(B.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Rt(e,t,n,r,o){const i=nt(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=pt(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=pt(e,n,r)}else{if(s==="function")return re(()=>{let l=t();for(;typeof l=="function";)l=l();n=Rt(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(sr(l,t,n,o))return re(()=>n=Rt(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const u=[d];for(;(d=d.nextSibling)!==r;)u.push(d);return n=u}if(l.length===0){if(n=pt(e,n,r),a)return n}else c?n.length===0?jo(e,l,r):El(e,n,l):(n&&pt(e),jo(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=pt(e,n,r,t);pt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function sr(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=sr(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=sr(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function jo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function pt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Ml(){return B.getNextContextId()}const Il=!1,Rl="http://www.w3.org/2000/svg";function Ho(e,t=!1){return t?document.createElementNS(Rl,e):document.createElement(e)}function qo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Mo();let i,s=!!B.context;return D(()=>{s&&(Mo().user=s=!1),i||(i=ol(o,()=>C(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),d=()=>c(!0);ze(u=>A(a,()=>l()?u():i(),null)),K(d)}else{const l=Ho(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!s}),n}function $l(e,t){const n=C(e);return C(()=>{const r=n();switch(typeof r){case"function":return q(()=>r(t));case"string":const o=xl.has(r),i=B.context?Tl():Ho(r,o);return tt(i,t,o),i}})}function ln(e){const[,t]=j(e,["component"]);return $l(()=>e.component,t)}function Fl(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=P(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function Nl(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Kl(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const i=Fl(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},Nl(r))}}function Bl(e,t,n){return arguments.length===2&&(n=t,t={}),Ja(e,t)(Kl(n))}const zl='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-9{left:2.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-80{max-width:20rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:.125rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-6{padding-bottom:1.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Wo,ar]=P(!1),Go=[],Vl=e=>Go.push(e),Yo=()=>{Go.forEach(e=>e())},Ul=()=>{const e=!Wo();ar(e),ee("onToggle"),ee(e?"onOpen":"onClose"),Yo()},jl=()=>{ar(!1),ee("onClose")},Hl=()=>{ar(!0),ee("onOpen"),Yo()},Xo=()=>({bubble:Wo,show:Hl,hide:jl,toggle:Ul,onOpen:Vl}),lr=Symbol("store-raw"),mt=Symbol("store-node"),Ue=Symbol("store-has"),Jo=Symbol("store-self");function Zo(e){let t=e[be];if(!t&&(Object.defineProperty(e,be,{value:t=new Proxy(e,Gl)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function cn(e){let t;return e!=null&&typeof e=="object"&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function $t(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[lr])return n;if(!cn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=$t(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=$t(o,t))!==o&&(e[i]=r))}return e}function un(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Ft(e,t,n){if(e[t])return e[t];const[r,o]=P(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function ql(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===be||t===mt||(delete n.value,delete n.writable,n.get=()=>e[be][t]),n}function Qo(e){Zn()&&Ft(un(e,mt),Jo)()}function Wl(e){return Qo(e),Reflect.ownKeys(e)}const Gl={get(e,t,n){if(t===lr)return e;if(t===be)return n;if(t===Yn)return Qo(e),n;const r=un(e,mt),o=r[t];let i=o?o():e[t];if(t===mt||t===Ue||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Zn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Ft(r,t,i)())}return cn(i)?Zo(i):i},has(e,t){return t===lr||t===be||t===Yn||t===mt||t===Ue||t==="__proto__"?!0:(Zn()&&Ft(un(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Wl,getOwnPropertyDescriptor:ql};function dn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Ue]&&e[Ue][t]&&o!==void 0&&e[Ue][t].$()):(e[t]=n,e[Ue]&&e[Ue][t]&&o===void 0&&e[Ue][t].$());let s=un(e,mt),a;if((a=Ft(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Ft(s,"length",i))&&a.$(e.length)}(a=s[Jo])&&a.$()}function ei(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];dn(e,o,t[o])}}function Yl(e,t){if(typeof t=="function"&&(t=t(e)),t=$t(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&dn(e,n,o)}dn(e,"length",r)}else ei(e,t)}function 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=$t(i),r===void 0||cn(o)&&cn(i)&&!Array.isArray(i)?ei(o,i):dn(e,r,i))}function Xl(...[e,t]){const n=$t(e||{}),r=Array.isArray(n),o=Zo(n);function i(...s){Ee(()=>{r&&s.length===1?Yl(n,s[0]):Nt(n,s)})}return[o,i]}function ti(e,t,n){return ze(()=>{const r=ko(e),[o,i]=Xl(r?JSON.parse(r):t);return D(()=>Eo(e,JSON.stringify(o),n)),[o,i]})}function Jl(e,t,n){return ze(()=>{const r=ko(e),[o,i]=P(r?JSON.parse(r):t);return D(()=>Eo(e,JSON.stringify(o()),n)),[o,i]})}const[gm,pm]=Jl("lang","en");function Zl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function Ql(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const ec=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Jt}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Zl(i);if(i.type==="entity")return Ql(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return se("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Jt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),i._id=n,i},[ni,tc]=P(""),[rt]=ze(()=>rl(ni,ec)),nc=()=>{if(rt()?.type==="chat")return rt()},rc=()=>{if(rt()?.type==="form")return rt()};ze(()=>D(()=>{Fa(rt()),rt()&&ee("onLoad")}));const oe=()=>({widgetId:ni,setWidgetId:tc,widget:rt,chatWidget:nc,formWidget:rc}),ri=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,oi=go,oc=(e,t)=>n=>{var r;if(t?.variants==null)return oi(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=n?.[c],u=i?.[c];if(d===null)return null;const h=ri(d)||ri(u);return o[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,h]=d;return h===void 0||(c[u]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:h,...m}=d;return Object.entries(m).every(f=>{let[g,p]=f;return Array.isArray(p)?p.includes({...i,...a}[g]):{...i,...a}[g]===p})?[...c,u,h]:c},[]);return oi(e,s,l,n?.class,n?.className)};var ic=M("<button>");const sc=oc("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Te=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=ic();return tt(n,T({get class(){return Ge(sc({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var ac=M('<img alt="widget logo">');const ii=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=ac();return tt(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var lc=M('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const cc=()=>{const{chatWidget:e}=oe(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=lc(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return A(r,y(ii,{get src(){return e()?.avatar}}),o),A(i,t),A(s,n),r})()};var uc=M("<svg stroke-width=0>");function ve(e,t){const n=T(e.a,t),[r,o]=j(n,["src"]),[i,s]=P(""),a=C(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return D(()=>s(a())),K(()=>{s("")}),(()=>{var l=uc();return tt(l,T({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),A(l,()=>Il),l})()}function dc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function fc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function hc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function gc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const cr={equals:!1};function si(e){return(...t)=>{for(const n of e)n&&n(...t)}}function pc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,ai=e=>Array.isArray(e)?e:e?[e]:[];function mc(e,...t){return typeof e=="function"?e(...t):e}const yc=K;function bc(e,t,n,r){return e.addEventListener(t,n,r),yc(e.removeEventListener.bind(e,t,n,r))}function vc(e,t,n,r){const o=()=>{ai(S(e)).forEach(i=>{i&&ai(S(t)).forEach(s=>bc(i,s,n,r))})};typeof e=="function"?D(o):re(o)}function fn(){return!0}const wc={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return e.has(t)},set:fn,deleteProperty:fn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:fn,deleteProperty:fn}},ownKeys(e){return e.keys()}},xc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function li(e){const t={};let n;for(;n=xc.exec(e);)t[n[1]]=n[2];return t}function Sc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=li(e)}else typeof t=="string"&&(t=li(t));return{...e,...t}}const ur=(e,t,n)=>{let r;for(const o of e){const i=S(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Ec(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?pc:si,o={};for(const s of n){const a=S(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const i=T(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ur(n,"style",Sc);if(s==="ref"){const a=[];for(const l of n){const c=S(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?ur(n,s,(a,l)=>`${a} ${l}`):s==="classList"?ur(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},wc)}function ot(...e){return si(e)}function kc(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 Cc(e){return typeof e=="number"}function Oc(e){return Array.isArray(e)}function yt(e){return Object.prototype.toString.call(e)==="[object String]"}function _c(e){return typeof e=="function"}function ci(e){return t=>`${e()}-${t}`}function De(e,t){return e?e===t||e.contains(t):!1}function Kt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(ui(n)&&n.contentDocument)return Kt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function ui(e){return e.tagName==="IFRAME"}var di=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(di||{});function fr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function hn(){return fr(/^Mac/i)}function Pc(){return fr(/^iPhone/i)}function Ac(){return fr(/^iPad/i)||hn()&&navigator.maxTouchPoints>1}function Tc(){return Pc()||Ac()}function Dc(){return hn()||Tc()}function ge(e,t){return t&&(_c(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function we(e){return t=>{for(const n of e)ge(t,n)}}function Lc(e){return hn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Mc())e.focus({preventScroll:!0});else{const t=Ic(e);e.focus(),Rc(t)}}var gn=null;function Mc(){if(gn==null){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch{}}return gn}function Ic(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Rc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fi=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],$c=[...fi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],hr=`${fi.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Fc=$c.join(':not([hidden]):not([tabindex="-1"]),');function hi(e,t){const r=Array.from(e.querySelectorAll(hr)).filter(gi);return t&&gi(e)&&r.unshift(e),r.forEach((o,i)=>{if(ui(o)&&o.contentDocument){const s=o.contentDocument.body,a=hi(s,!1);r.splice(i,1,...a)}}),r}function gi(e){return pi(e)&&!Nc(e)}function pi(e){return e.matches(hr)&&gr(e)}function Nc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function gr(e,t){return e.nodeName!=="#comment"&&Kc(e)&&Bc(e,t)&&(!e.parentElement||gr(e.parentElement,e))}function Kc(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Bc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function zc(e,t,n){const r=t?.tabbable?Fc:hr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&gr(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function mi(e){let t=e;for(;t&&!Vc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Vc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Uc(){}function jc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,d]=t[a],[u,h]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],f=(d-h)*(n-c)-(c-u)*(r-d);if(h<d){if(r>=h&&r<d){if(f===0)return!0;f>0&&(r===h?r>m&&(o=!o):o=!o)}}else if(d<h){if(r>d&&r<=h){if(f===0)return!0;f<0&&(r===h?r<m&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function Le(e,t){return T(e,t)}var Bt=new Map,yi=new Set;function bi(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Bt.get(n.target);r||(r=new Set,Bt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Bt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Bt.delete(n.target)),Bt.size===0)){for(const o of yi)o();yi.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?bi():document.addEventListener("DOMContentLoaded",bi));function pr(e,t){const n=vi(e,t,"left"),r=vi(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function vi(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Hc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=mi(e);for(;e&&o&&e!==n&&o!==n;)pr(o,e),e=o,o=mi(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var qc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function mr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(yt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return yt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(yt(l)||Cc(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(At){typeof define=="function"&&define.amd?define(At):At()})(function(){"use strict";function At(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=At(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function go(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=At(e))&&(r&&(r+=" "),r+=t);return r}const Un="-",sa=e=>{const t=la(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Un);return a[0]===""&&a.length!==1&&a.shift(),po(a,t)||aa(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},po=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?po(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Un);return t.validators.find(({validator:s})=>s(i))?.classGroupId},mo=/^\[(.+)\]$/,aa=e=>{if(mo.test(e)){const t=mo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},la=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ua(Object.entries(e.classGroups),n).forEach(([i,s])=>{jn(s,r,i,t)}),r},jn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:yo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(ca(o)){jn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{jn(s,yo(t,i),n,r)})})},yo=(e,t)=>{let n=e;return t.split(Un).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ca=e=>e.isThemeGetter,ua=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,da=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},bo="!",fa=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,d=0,u;for(let p=0;p<a.length;p++){let b=a[p];if(c===0){if(b===o&&(r||a.slice(p,p+i)===t)){l.push(a.slice(d,p)),d=p+i;continue}if(b==="/"){u=p;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?a:a.substring(d),m=h.startsWith(bo),f=m?h.substring(1):h,g=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:s}):s},ha=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ga=e=>({cache:da(e.cacheSize),parseClassName:fa(e),...sa(e)}),pa=/\s+/,ma=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(pa);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=n(c);let f=!!m,g=r(f?h.substring(0,m):h);if(!g){if(!f){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}f=!1}const p=ha(d).join(":"),b=u?p+bo:p,v=b+g;if(i.includes(v))continue;i.push(v);const w=o(g,f);for(let x=0;x<w.length;++x){const O=w[x];i.push(b+O)}a=c+(a.length>0?" "+a:a)}return a};function ya(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vo(t))&&(r&&(r+=" "),r+=n);return r}const vo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vo(e[r]))&&(n&&(n+=" "),n+=t);return n};function ba(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,u)=>u(d),e());return n=ga(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=ma(l,n);return o(l,d),d}return function(){return i(ya.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wo=/^\[(?:([a-z-]+):)?(.+)\]$/i,va=/^\d+\/\d+$/,wa=new Set(["px","full","screen"]),xa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ea=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ka=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ca=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ct(e)||wa.has(e)||va.test(e),qe=e=>ut(e,"length",Ma),ct=e=>!!e&&!Number.isNaN(Number(e)),Hn=e=>ut(e,"number",ct),Tt=e=>!!e&&Number.isInteger(Number(e)),Oa=e=>e.endsWith("%")&&ct(e.slice(0,-1)),N=e=>wo.test(e),We=e=>xa.test(e),_a=new Set(["length","size","percentage"]),Pa=e=>ut(e,_a,xo),Aa=e=>ut(e,"position",xo),Ta=new Set(["image","url"]),Da=e=>ut(e,Ta,Ra),La=e=>ut(e,"",Ia),Dt=()=>!0,ut=(e,t,n)=>{const r=wo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ma=e=>Sa.test(e)&&!Ea.test(e),xo=()=>!1,Ia=e=>ka.test(e),Ra=e=>Ca.test(e),$a=ba(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),i=X("borderRadius"),s=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),h=X("gap"),m=X("gradientColorStops"),f=X("gradientColorStopPositions"),g=X("inset"),p=X("margin"),b=X("opacity"),v=X("padding"),w=X("saturate"),x=X("scale"),O=X("sepia"),k=X("skew"),E=X("space"),$=X("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",N,t],M=()=>[N,t],ne=()=>["",Ne,qe],Y=()=>["auto",ct,N],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["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"],Z=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",N],Pt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Pe=()=>[ct,N];return{cacheSize:500,separator:":",theme:{colors:[Dt],spacing:[Ne,qe],blur:["none","",We,N],brightness:Pe(),borderColor:[e],borderRadius:["none","","full",We,N],borderSpacing:M(),borderWidth:ne(),contrast:Pe(),grayscale:ie(),hueRotate:Pe(),invert:ie(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Oa,qe],inset:L(),margin:L(),opacity:Pe(),padding:M(),saturate:Pe(),scale:Pe(),sepia:ie(),skew:Pe(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":Pt()}],"break-before":[{"break-before":Pt()}],"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:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tt,N]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",Tt,N]}],"grid-cols":[{"grid-cols":[Dt]}],"col-start-end":[{col:["auto",{span:["full",Tt,N]},N]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Dt]}],"row-start-end":[{row:["auto",{span:[Tt,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:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",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,qe]}],"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:[Dt]}],"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",ct,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:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ne,qe]}],"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:M()}],"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(),Aa]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Pa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Da]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...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":[b]}],"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":[Ne,N]}],"outline-w":[{outline:[Ne,qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ne,qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,La]}],"shadow-color":[{shadow:[Dt]}],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:[w]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Pe()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Pe()}],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:[Tt,N]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"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":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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,qe,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 $a(go(e))}function Fa(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",Yt(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Yt(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Yt(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Yt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Yt(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 Na(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function Ka(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function qn(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Ba={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function dt(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Ba[n][e]}const Xt="https://heimdall.smarttalks.ai/api",za="wss://heimdall.smarttalks.ai",So="smarttalkswidget";function ee(e,...t){window.postMessage({from:So,command:e,args:t})}function se(e,t){window.addEventListener("message",n=>{n.data?.from===So&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function Va(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{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=>{se("onOpen",e)},onClose:e=>{se("onClose",e)},onToggle:e=>{se("onToggle",e)},onReset:e=>{se("onReset",e)},onInput:e=>{se("onInput",e)},onAnswer:e=>{se("onAnswer",e)},onLoad:e=>{se("onLoad",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function ko(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Ua(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),_o(o.value)&&!Ga(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function ja(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=_o(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Wa(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Ha(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function qa(e,t){const n=Ua(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?Co(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&Oo(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&Oo(this,i.attribute,i.value,!!i.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function Co(e){if(e)try{return JSON.parse(e)}catch{return e}}function Oo(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Wa(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function _o(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Ga(e){return Object.prototype.toString.call(e)==="[object Function]"}function Ya(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Wn;function Xa(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=qa(this,t);const o=Ha(this.props),i=this.Component,s=Wn;try{Wn=this,this.__initialized=!0,Ya(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?Co(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function Ja(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Xa(r,ja(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const B={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Po(this.context.count)},getNextContextId(){return Po(this.context.count++)}};function Po(e){const t=String(e),n=t.length-1;return B.context.id+(n?String.fromCharCode(96+n):"")+t}function Za(e){B.context=e}const Qa=!1,el=(e,t)=>e===t,be=Symbol("solid-proxy"),Ao=typeof Proxy=="function",Gn=Symbol("solid-track"),Jt={equals:el};let To=$o;const Ke=1,Zt=2,Do={owned:null,cleanups:null,context:null,owner:null},Yn={};var H=null;let Xn=null,tl=null,W=null,ae=null,Be=null,Qt=0;function ze(e,t){const n=W,r=H,o=e.length===0,i=t===void 0?r:t,s=o?Do:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>q(()=>Lt(s)));H=s,W=null;try{return Ve(a,!0)}finally{W=n,H=r}}function P(e,t){t=t?Object.assign({},Jt,t):Jt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ro(n,o));return[Io.bind(n),r]}function Lo(e,t,n){const r=tn(e,t,!0,Ke);ft(r)}function re(e,t,n){const r=tn(e,t,!1,Ke);ft(r)}function D(e,t,n){To=ll;const r=tn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),Be?Be.push(r):ft(r)}function C(e,t,n){n=n?Object.assign({},Jt,n):Jt;const r=tn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ft(r),Io.bind(r)}function nl(e){return e&&typeof e=="object"&&"then"in e}function rl(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Yn,l=null,c=!1,d="initialValue"in i,u=typeof r=="function"&&C(r);const h=new Set,[m,f]=(i.storage||P)(i.initialValue),[g,p]=P(void 0),[b,v]=P(void 0,{equals:!1}),[w,x]=P(d?"ready":"unresolved");B.context&&(l=B.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:B.load&&B.has(l)&&(a=B.load(l)));function O(_,R,L,M){return s===_&&(s=null,M!==void 0&&(d=!0),(_===a||R===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(M,{value:R})),a=Yn,k(R,L)),R}function k(_,R){Ve(()=>{R===void 0&&f(()=>_),x(R!==void 0?"errored":d?"ready":"unresolved"),p(R);for(const L of h.keys())L.decrement();h.clear()},!1)}function E(){const _=il,R=m(),L=g();if(L!==void 0&&!s)throw L;return W&&W.user,R}function $(_=!0){if(_!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){O(s,q(m));return}const L=a!==Yn?a:q(()=>o(R,{value:m(),refetching:_}));return nl(L)?(s=L,"value"in L?(L.status==="success"?O(s,L.value,void 0,R):O(s,void 0,Qn(L.value),R),L):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),v()},!1),L.then(M=>O(L,M,void 0,R),M=>O(L,void 0,Qn(M),R)))):(O(s,L,void 0,R),L)}return Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const _=w();return _==="pending"||_==="refreshing"}},latest:{get(){if(!d)return E();const _=g();if(_&&!s)throw _;return m()}}}),u?Lo(()=>$(!1)):$(!1),[E,{refetch:$,mutate:f}]}function Ee(e){return Ve(e,!1)}function q(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function et(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i)return i=!1,s;const l=q(()=>t(a,o,s));return o=a,l}}function en(e){D(()=>q(e))}function K(e){return H===null||(H.cleanups===null?H.cleanups=[e]:H.cleanups.push(e)),e}function Jn(){return W}function Mo(){return H}function ol(e,t){const n=H,r=W;H=e,W=null;try{return Ve(t,!0)}catch(o){er(o)}finally{H=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:cl(n),defaultValue:e}}function he(e){let t;return H&&H.context&&(t=H.context[e.id])!==void 0?t:e.defaultValue}function 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 il;function Io(){if(this.sources&&this.state)if(this.state===Ke)ft(this);else{const e=ae;ae=null,Ve(()=>rn(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 Ro(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Xn&&Xn.running;s&&Xn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?ae.push(i):Be.push(i),i.observers&&Fo(i)),s||(i.state=Ke)}if(ae.length>1e6)throw ae=[],new Error},!1)),t}function ft(e){if(!e.fn)return;Lt(e);const t=Qt;sl(e,e.value,t)}function sl(e,t,n){let r;const o=H,i=W;W=H=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Lt),e.owned=null),e.updatedAt=n+1,er(s)}finally{W=i,H=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ro(e,r):e.value=r,e.updatedAt=n)}function tn(e,t,n,r=Ke,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:H,context:H?H.context:null,pure:n};return H===null||H!==Do&&(H.owned?H.owned.push(i):H.owned=[i]),i}function nn(e){if(e.state===0)return;if(e.state===Zt)return rn(e);if(e.suspense&&q(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Qt);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)ft(e);else if(e.state===Zt){const r=ae;ae=null,Ve(()=>rn(e,t[0]),!1),ae=r}}function Ve(e,t){if(ae)return e();let n=!1;t||(ae=[]),Be?n=!0:Be=[],Qt++;try{const r=e();return al(n),r}catch(r){n||(Be=null),ae=null,er(r)}}function al(e){if(ae&&($o(ae),ae=null),e)return;const t=Be;Be=null,t.length&&Ve(()=>To(t),!1)}function $o(e){for(let t=0;t<e.length;t++)nn(e[t])}function ll(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:nn(r)}if(B.context){if(B.count){B.effects||(B.effects=[]),B.effects.push(...e.slice(0,n));return}Za()}for(B.effects&&(B.done||!B.count)&&(e=[...B.effects,...e],n+=B.effects.length,delete B.effects),t=0;t<n;t++)nn(e[t])}function rn(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<Qt)&&nn(r):o===Zt&&rn(r,t)}}}function Fo(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Zt,n.pure?ae.push(n):Be.push(n),n.observers&&Fo(n))}}function Lt(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--)Lt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Lt(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=H){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 cl(e,t){return function(r){let o;return re(()=>o=q(()=>(H.context={...H.context,[e]:r.value},Zn(()=>r.children))),void 0),o}}const ul=Symbol("fallback");function No(e){for(let t=0;t<e.length;t++)e[t]()}function dl(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return K(()=>No(i)),()=>{let l=e()||[],c=l.length,d,u;return l[Gn],q(()=>{let m,f,g,p,b,v,w,x,O;if(c===0)s!==0&&(No(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ul],o[0]=ze(k=>(i[0]=k,n.fallback())),s=1);else if(s===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=ze(h);s=c}else{for(g=new Array(c),p=new Array(c),a&&(b=new Array(c)),v=0,w=Math.min(s,c);v<w&&r[v]===l[v];v++);for(w=s-1,x=c-1;w>=v&&x>=v&&r[w]===l[x];w--,x--)g[x]=o[w],p[x]=i[w],a&&(b[x]=a[w]);for(m=new Map,f=new Array(x+1),u=x;u>=v;u--)O=l[u],d=m.get(O),f[u]=d===void 0?-1:d,m.set(O,u);for(d=v;d<=w;d++)O=r[d],u=m.get(O),u!==void 0&&u!==-1?(g[u]=o[d],p[u]=i[d],a&&(b[u]=a[d]),u=f[u],m.set(O,u)):i[d]();for(u=v;u<c;u++)u in g?(o[u]=g[u],i[u]=p[u],a&&(a[u]=b[u],a[u](u))):o[u]=ze(h);o=o.slice(0,s=c),r=l.slice(0)}return o});function h(m){if(i[u]=m,a){const[f,g]=P(u);return a[u]=g,t(l[u],f)}return t(l[u])}}}function y(e,t){return q(()=>e(t||{}))}function on(){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:on,deleteProperty:on,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:on,deleteProperty:on}},ownKeys(e){return e.keys()}};function rr(e){return(e=typeof e=="function"?e():e)?e:{}}function fl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function T(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&be in a,e[s]=typeof a=="function"?(t=!0,C(a)):a}if(Ao&&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:fl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const h=n[d];h&&(u.get?h.push(u.get.bind(a)):u.value!==void 0&&h.push(()=>u.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(Ao&&be in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},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 hl=0;function Ae(){return B.context?B.getNextContextId():`cl-${hl++}`}const Ko=e=>`Stale read from <${e}>.`;function ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return C(dl(()=>e.each,e.children,t||void 0))}function Q(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?q(()=>i(t?o:()=>{if(!q(r))throw Ko("Show");return n()})):i}return e.fallback},void 0,void 0)}function Bo(e){const t=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:(h,m)=>!h==!m});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?q(()=>a(s.keyed?i():()=>{if(q(n)()?.[0]!==o)throw Ko("Match");return i()})):a},void 0,void 0)}function Mt(e){return e}const gl=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],pl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...gl]),ml=new Set(["innerHTML","textContent","innerText","children"]),yl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),bl=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function vl(e,t){const n=bl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const wl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xl=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Sl={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function El(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!c){c=new Map;let u=a;for(;u<i;)c.set(n[u],u++)}const d=c.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,h=1,m;for(;++u<o&&u<i&&!((m=c.get(t[u]))==null||m!==d+h);)h++;if(h>d-a){const f=t[s];for(;a<d;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const zo="_$DX_DELEGATE";function I(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 kl(e,t=window.document){const n=t[zo]||(t[zo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Ll))}}function ue(e,t,n){nt(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Cl(e,t,n,r){nt(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ol(e,t,n){nt(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function gt(e,t){nt(e)||(t==null?e.removeAttribute("class"):e.className=t)}function _l(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Pl(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Vo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Vo(e,a,!0),n[a]=l)}return n}function sn(e,t,n){if(!t)return n?ue(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function tt(e,t={},n,r){const o={};return r||re(()=>o.children=It(e,t.children,o.children)),re(()=>typeof t.ref=="function"&&or(t.ref,e)),re(()=>Al(e,t,n,!0,o,!0)),o}function or(e,t,n){return q(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return It(e,t,r,n);re(o=>It(e,t(),o,n),r)}function Al(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Uo(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Uo(e,s,a,o[s],n,i,t)}}function Tl(e){let t,n;return!nt()||!(t=B.registry.get(n=Ml()))?e():(B.completed&&B.completed.add(t),B.registry.delete(n),t)}function nt(e){return!!B.context&&!B.done&&(!e||e.isConnected)}function Dl(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Vo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Uo(e,t,n,r,o,i,s){let a,l,c,d,u;if(t==="style")return sn(e,n,r);if(t==="classList")return Pl(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),m=wl.has(h);if(!m&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(m||n)&&(_l(e,h,n,m),m&&kl([h]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Ol(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=ml.has(t))||!o&&((d=vl(t,e.tagName))||(l=pl.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(u)t=t.slice(5),l=!0;else if(nt(e))return n;t==="class"||t==="className"?gt(e,n):a&&!l&&!c?e[Dl(t)]=n:e[d||t]=n}else{const h=o&&t.indexOf(":")>-1&&Sl[t.split(":")[0]];h?Cl(e,h,t,n):ue(e,yl[t]||t,n)}return n}function Ll(e){if(B.registry&&B.events&&B.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),B.registry&&!B.done&&(B.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function It(e,t,n,r,o){const i=nt(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=pt(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=pt(e,n,r)}else{if(s==="function")return re(()=>{let l=t();for(;typeof l=="function";)l=l();n=It(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(ir(l,t,n,o))return re(()=>n=It(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=pt(e,n,r),a)return n}else c?n.length===0?jo(e,l,r):El(e,n,l):(n&&pt(e),jo(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=pt(e,n,r,t);pt(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 jo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function pt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Ml(){return B.getNextContextId()}const Il=!1,Rl="http://www.w3.org/2000/svg";function Ho(e,t=!1){return t?document.createElementNS(Rl,e):document.createElement(e)}function qo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Mo();let i,s=!!B.context;return D(()=>{s&&(Mo().user=s=!1),i||(i=ol(o,()=>C(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),d=()=>c(!0);ze(u=>A(a,()=>l()?u():i(),null)),K(d)}else{const l=Ho(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!s}),n}function $l(e,t){const n=C(e);return C(()=>{const r=n();switch(typeof r){case"function":return q(()=>r(t));case"string":const o=xl.has(r),i=B.context?Tl():Ho(r,o);return tt(i,t,o),i}})}function an(e){const[,t]=j(e,["component"]);return $l(()=>e.component,t)}function Fl(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=P(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function Nl(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Kl(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const i=Fl(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},Nl(r))}}function Bl(e,t,n){return arguments.length===2&&(n=t,t={}),Ja(e,t)(Kl(n))}const zl='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-9{left:2.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-80{max-width:20rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:.125rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-6{padding-bottom:1.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Wo,sr]=P(!1),Go=[],Vl=e=>Go.push(e),Yo=()=>{Go.forEach(e=>e())},Ul=()=>{const e=!Wo();sr(e),ee("onToggle"),ee(e?"onOpen":"onClose"),Yo()},jl=()=>{sr(!1),ee("onClose")},Hl=()=>{sr(!0),ee("onOpen"),Yo()},Xo=()=>({bubble:Wo,show:Hl,hide:jl,toggle:Ul,onOpen:Vl}),ar=Symbol("store-raw"),mt=Symbol("store-node"),Ue=Symbol("store-has"),Jo=Symbol("store-self");function Zo(e){let t=e[be];if(!t&&(Object.defineProperty(e,be,{value:t=new Proxy(e,Gl)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function ln(e){let t;return e!=null&&typeof e=="object"&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Rt(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ar])return n;if(!ln(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=Rt(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=Rt(o,t))!==o&&(e[i]=r))}return e}function cn(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]=P(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function ql(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===be||t===mt||(delete n.value,delete n.writable,n.get=()=>e[be][t]),n}function Qo(e){Jn()&&$t(cn(e,mt),Jo)()}function Wl(e){return Qo(e),Reflect.ownKeys(e)}const Gl={get(e,t,n){if(t===ar)return e;if(t===be)return n;if(t===Gn)return Qo(e),n;const r=cn(e,mt),o=r[t];let i=o?o():e[t];if(t===mt||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 ln(i)?Zo(i):i},has(e,t){return t===ar||t===be||t===Gn||t===mt||t===Ue||t==="__proto__"?!0:(Jn()&&$t(cn(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Wl,getOwnPropertyDescriptor:ql};function un(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=cn(e,mt),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[Jo])&&a.$()}function ei(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];un(e,o,t[o])}}function Yl(e,t){if(typeof t=="function"&&(t=t(e)),t=Rt(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&&un(e,n,o)}un(e,"length",r)}else ei(e,t)}function Ft(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Ft(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Ft(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:d=1}=r;for(let u=l;u<=c;u+=d)Ft(e,[u].concat(t),n);return}else if(t.length>1){Ft(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Rt(i),r===void 0||ln(o)&&ln(i)&&!Array.isArray(i)?ei(o,i):un(e,r,i))}function Xl(...[e,t]){const n=Rt(e||{}),r=Array.isArray(n),o=Zo(n);function i(...s){Ee(()=>{r&&s.length===1?Yl(n,s[0]):Ft(n,s)})}return[o,i]}function ti(e,t,n){return ze(()=>{const r=ko(e),[o,i]=Xl(r?JSON.parse(r):t);return D(()=>Eo(e,JSON.stringify(o),n)),[o,i]})}function Jl(e,t,n){return ze(()=>{const r=ko(e),[o,i]=P(r?JSON.parse(r):t);return D(()=>Eo(e,JSON.stringify(o()),n)),[o,i]})}const[fm,hm]=Jl("lang","en");function Zl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function Ql(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const ec=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Xt}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Zl(i);if(i.type==="entity")return Ql(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return se("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Xt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),i._id=n,i},[ni,tc]=P(""),[rt]=ze(()=>rl(ni,ec)),nc=()=>{if(rt()?.type==="chat")return rt()},rc=()=>{if(rt()?.type==="form")return rt()};ze(()=>D(()=>{Fa(rt()),rt()&&ee("onLoad")}));const oe=()=>({widgetId:ni,setWidgetId:tc,widget:rt,chatWidget:nc,formWidget:rc}),ri=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,oi=go,oc=(e,t)=>n=>{var r;if(t?.variants==null)return oi(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=n?.[c],u=i?.[c];if(d===null)return null;const h=ri(d)||ri(u);return o[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,h]=d;return h===void 0||(c[u]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:h,...m}=d;return Object.entries(m).every(f=>{let[g,p]=f;return Array.isArray(p)?p.includes({...i,...a}[g]):{...i,...a}[g]===p})?[...c,u,h]:c},[]);return oi(e,s,l,n?.class,n?.className)};var ic=I("<button>");const sc=oc("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Te=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=ic();return tt(n,T({get class(){return Ge(sc({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var ac=I('<img alt="widget logo">');const ii=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=ac();return tt(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var lc=I('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const cc=()=>{const{chatWidget:e}=oe(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=lc(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return A(r,y(ii,{get src(){return e()?.avatar}}),o),A(i,t),A(s,n),r})()};var uc=I("<svg stroke-width=0>");function ve(e,t){const n=T(e.a,t),[r,o]=j(n,["src"]),[i,s]=P(""),a=C(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return D(()=>s(a())),K(()=>{s("")}),(()=>{var l=uc();return tt(l,T({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),A(l,()=>Il),l})()}function dc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function fc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function hc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function gc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const lr={equals:!1};function si(e){return(...t)=>{for(const n of e)n&&n(...t)}}function pc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,ai=e=>Array.isArray(e)?e:e?[e]:[];function mc(e,...t){return typeof e=="function"?e(...t):e}const yc=K;function bc(e,t,n,r){return e.addEventListener(t,n,r),yc(e.removeEventListener.bind(e,t,n,r))}function vc(e,t,n,r){const o=()=>{ai(S(e)).forEach(i=>{i&&ai(S(t)).forEach(s=>bc(i,s,n,r))})};typeof e=="function"?D(o):re(o)}function dn(){return!0}const wc={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return e.has(t)},set:dn,deleteProperty:dn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:dn,deleteProperty:dn}},ownKeys(e){return e.keys()}},xc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function li(e){const t={};let n;for(;n=xc.exec(e);)t[n[1]]=n[2];return t}function Sc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=li(e)}else typeof t=="string"&&(t=li(t));return{...e,...t}}const cr=(e,t,n)=>{let r;for(const o of e){const i=S(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Ec(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?pc:si,o={};for(const s of n){const a=S(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const i=T(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return cr(n,"style",Sc);if(s==="ref"){const a=[];for(const l of n){const c=S(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?cr(n,s,(a,l)=>`${a} ${l}`):s==="classList"?cr(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},wc)}function ot(...e){return si(e)}function kc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ur(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Cc(e){return typeof e=="number"}function Oc(e){return Array.isArray(e)}function yt(e){return Object.prototype.toString.call(e)==="[object String]"}function _c(e){return typeof e=="function"}function ci(e){return t=>`${e()}-${t}`}function De(e,t){return e?e===t||e.contains(t):!1}function Nt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(ui(n)&&n.contentDocument)return Nt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function ui(e){return e.tagName==="IFRAME"}var di=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(di||{});function dr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function fn(){return dr(/^Mac/i)}function Pc(){return dr(/^iPhone/i)}function Ac(){return dr(/^iPad/i)||fn()&&navigator.maxTouchPoints>1}function Tc(){return Pc()||Ac()}function Dc(){return fn()||Tc()}function ge(e,t){return t&&(_c(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function we(e){return t=>{for(const n of e)ge(t,n)}}function Lc(e){return fn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Mc())e.focus({preventScroll:!0});else{const t=Ic(e);e.focus(),Rc(t)}}var hn=null;function Mc(){if(hn==null){hn=!1;try{document.createElement("div").focus({get preventScroll(){return hn=!0,!0}})}catch{}}return hn}function Ic(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Rc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fi=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],$c=[...fi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fr=`${fi.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Fc=$c.join(':not([hidden]):not([tabindex="-1"]),');function hi(e,t){const r=Array.from(e.querySelectorAll(fr)).filter(gi);return t&&gi(e)&&r.unshift(e),r.forEach((o,i)=>{if(ui(o)&&o.contentDocument){const s=o.contentDocument.body,a=hi(s,!1);r.splice(i,1,...a)}}),r}function gi(e){return pi(e)&&!Nc(e)}function pi(e){return e.matches(fr)&&hr(e)}function Nc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function hr(e,t){return e.nodeName!=="#comment"&&Kc(e)&&Bc(e,t)&&(!e.parentElement||hr(e.parentElement,e))}function Kc(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Bc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function zc(e,t,n){const r=t?.tabbable?Fc:fr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&hr(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function mi(e){let t=e;for(;t&&!Vc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Vc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Uc(){}function jc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,d]=t[a],[u,h]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],f=(d-h)*(n-c)-(c-u)*(r-d);if(h<d){if(r>=h&&r<d){if(f===0)return!0;f>0&&(r===h?r>m&&(o=!o):o=!o)}}else if(d<h){if(r>d&&r<=h){if(f===0)return!0;f<0&&(r===h?r<m&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function Le(e,t){return T(e,t)}var Kt=new Map,yi=new Set;function bi(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Kt.get(n.target);r||(r=new Set,Kt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Kt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Kt.delete(n.target)),Kt.size===0)){for(const o of yi)o();yi.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?bi():document.addEventListener("DOMContentLoaded",bi));function gr(e,t){const n=vi(e,t,"left"),r=vi(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function vi(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Hc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=mi(e);for(;e&&o&&e!==n&&o!==n;)gr(o,e),e=o,o=mi(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var qc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function pr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(yt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return yt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(yt(l)||Cc(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=pr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...d),t+=d.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
|
|
2
2
|
* Portions of this file are based on code from react-spectrum.
|
|
3
3
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
4
4
|
*
|
|
5
5
|
* Credits to the React Spectrum team:
|
|
6
6
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/collections/src/useCollection.ts
|
|
7
|
-
*/function Wc(e,t=[]){const n=
|
|
7
|
+
*/function Wc(e,t=[]){const n=pr({dataSource:S(e.dataSource),getKey:S(e.getKey),getTextValue:S(e.getTextValue),getDisabled:S(e.getDisabled),getSectionChildren:S(e.getSectionChildren)}),[r,o]=P(e.factory(n));return D(et([()=>S(e.dataSource),()=>S(e.getKey),()=>S(e.getTextValue),()=>S(e.getDisabled),()=>S(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,d])=>{const u=pr({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>d(u))},{defer:!0})),r}function mr(e){const[t,n]=P(e.defaultValue?.()),r=C(()=>e.value?.()!==void 0),o=C(()=>r()?e.value?.():t());return[o,s=>{q(()=>{const a=mc(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Gc(e){const[t,n]=mr(e);return[()=>t()??!1,n]}function Yc(e){const[t,n]=mr(e);return[()=>t()??[],n]}function wi(e={}){const[t,n]=Gc({value:()=>S(e.open),defaultValue:()=>!!S(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function Xc(e){const t=n=>{n.key===di.Escape&&e.onEscapeKeyDown?.(n)};D(()=>{if(S(e.isDisabled))return;const n=e.ownerDocument?.()??je();n.addEventListener("keydown",t),K(()=>{n.removeEventListener("keydown",t)})})}/*!
|
|
8
8
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
9
9
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
10
10
|
*
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Credits to the Chakra UI team:
|
|
18
18
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/dismissable/src/layer-stack.ts
|
|
19
|
-
*/const
|
|
19
|
+
*/const gn="data-kb-top-layer";let xi,yr=!1;const He=[];function Bt(e){return He.findIndex(t=>t.node===e)}function Jc(e){return He[Bt(e)]}function Zc(e){return He[He.length-1].node===e}function Si(){return He.filter(e=>e.isPointerBlocking)}function Qc(){return[...Si()].slice(-1)[0]}function br(){return Si().length>0}function Ei(e){const t=Bt(Qc()?.node);return Bt(e)<t}function eu(e){He.push(e)}function tu(e){const t=Bt(e);t<0||He.splice(t,1)}function nu(){for(const{node:e}of He)e.style.pointerEvents=Ei(e)?"none":"auto"}function ru(e){if(br()&&!yr){const t=je(e);xi=document.body.style.pointerEvents,t.body.style.pointerEvents="none",yr=!0}}function ou(e){if(br())return;const t=je(e);t.body.style.pointerEvents=xi,t.body.style.length===0&&t.body.removeAttribute("style"),yr=!1}const pe={layers:He,isTopMostLayer:Zc,hasPointerBlockingLayer:br,isBelowPointerBlockingLayer:Ei,addLayer:eu,removeLayer:tu,indexOf:Bt,find:Jc,assignPointerEventToLayers:nu,disableBodyPointerEvents:ru,restoreBodyPointerEvents:ou};/*!
|
|
20
20
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
21
21
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
22
22
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* Credits to the Chakra UI team:
|
|
30
30
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-on-child-unmount.ts
|
|
31
31
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-containment.ts
|
|
32
|
-
*/const
|
|
32
|
+
*/const vr="focusScope.autoFocusOnMount",wr="focusScope.autoFocusOnUnmount",ki={bubbles:!1,cancelable:!0},Ci={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=ur(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=ur(this.stack,e),this.active()?.resume()}};function iu(e,t){const[n,r]=P(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=f=>e.onMountAutoFocus?.(f),a=f=>e.onUnmountAutoFocus?.(f),l=()=>je(t()),c=()=>{const f=l().createElement("span");return f.setAttribute("data-focus-trap",""),f.tabIndex=0,Object.assign(f.style,qc),f},d=()=>{const f=t();return f?hi(f,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},u=()=>{const f=d();return f.length>0?f[0]:null},h=()=>{const f=d();return f.length>0?f[f.length-1]:null},m=()=>{const f=t();if(!f)return!1;const g=Nt(f);return!g||De(f,g)?!1:pi(g)};D(()=>{const f=t();if(!f)return;Ci.add(o);const g=Nt(f);if(!De(f,g)){const b=new CustomEvent(vr,ki);f.addEventListener(vr,s),f.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{de(u()),Nt(f)===g&&de(f)},0)}K(()=>{f.removeEventListener(vr,s),setTimeout(()=>{const b=new CustomEvent(wr,ki);m()&&b.preventDefault(),f.addEventListener(wr,a),f.dispatchEvent(b),b.defaultPrevented||de(g??l().body),f.removeEventListener(wr,a),Ci.remove(o)},0)})}),D(()=>{const f=t();if(!f||!S(e.trapFocus)||n())return;const g=b=>{const v=b.target;v?.closest(`[${gn}]`)||(De(f,v)?i=v:de(i))},p=b=>{const w=b.relatedTarget??Nt(f);w?.closest(`[${gn}]`)||De(f,w)||de(i)};l().addEventListener("focusin",g),l().addEventListener("focusout",p),K(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",p)})}),D(()=>{const f=t();if(!f||!S(e.trapFocus)||n())return;const g=c();f.insertAdjacentElement("afterbegin",g);const p=c();f.insertAdjacentElement("beforeend",p);function b(w){const x=u(),O=h();w.relatedTarget===x?de(O):de(x)}g.addEventListener("focusin",b),p.addEventListener("focusin",b);const v=new MutationObserver(w=>{for(const x of w)x.previousSibling===p&&(p.remove(),f.insertAdjacentElement("beforeend",p)),x.nextSibling===g&&(g.remove(),f.insertAdjacentElement("afterbegin",g))});v.observe(f,{childList:!0,subtree:!1}),K(()=>{g.removeEventListener("focusin",b),p.removeEventListener("focusin",b),g.remove(),p.remove(),v.disconnect()})})}/*!
|
|
33
33
|
* Portions of this file are based on code from react-spectrum.
|
|
34
34
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
35
35
|
*
|
|
@@ -41,7 +41,7 @@
|
|
|
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 au(e){D(()=>{S(e.isDisabled)||K(lu(S(e.targets),S(e.root)))})}const
|
|
44
|
+
*/function au(e){D(()=>{S(e.isDisabled)||K(lu(S(e.targets),S(e.root)))})}const zt=new WeakMap,xe=[];function lu(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const h of l.querySelectorAll(`[${su}], [${gn}]`))n.add(h);const c=h=>{if(n.has(h)||h.parentElement&&r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const m of n)if(h.contains(m))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},d=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),u=c(l);if(u===NodeFilter.FILTER_ACCEPT&&i(l),u!==NodeFilter.FILTER_REJECT){let h=d.nextNode();for(;h!=null;)i(h),h=d.nextNode()}},i=l=>{const c=zt.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),zt.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=zt.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),zt.delete(l)):zt.set(l,c-1)}a===xe[xe.length-1]?(xe.pop(),xe.length&&xe[xe.length-1].observe()):xe.splice(xe.indexOf(a),1)}}/*!
|
|
45
45
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
46
46
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
47
47
|
*
|
|
@@ -53,20 +53,20 @@
|
|
|
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 Oi="interactOutside.pointerDownOutside",_i="interactOutside.focusOutside";function cu(e,t){let n,r=Uc;const o=()=>je(t()),i=u=>e.onPointerDownOutside?.(u),s=u=>e.onFocusOutside?.(u),a=u=>e.onInteractOutside?.(u),l=u=>{const h=u.target;return!(h instanceof HTMLElement)||h.closest(`[${
|
|
56
|
+
*/const Oi="interactOutside.pointerDownOutside",_i="interactOutside.focusOutside";function cu(e,t){let n,r=Uc;const o=()=>je(t()),i=u=>e.onPointerDownOutside?.(u),s=u=>e.onFocusOutside?.(u),a=u=>e.onInteractOutside?.(u),l=u=>{const h=u.target;return!(h instanceof HTMLElement)||h.closest(`[${gn}]`)||!De(o(),h)||De(t(),h)?!1:!e.shouldExcludeElement?.(h)},c=u=>{function h(){const m=t(),f=u.target;if(!m||!f||!l(u))return;const g=we([i,a]);f.addEventListener(Oi,g,{once:!0});const p=new CustomEvent(Oi,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:u.button===2||Lc(u)&&u.button===0}});f.dispatchEvent(p)}u.pointerType==="touch"?(o().removeEventListener("click",h),r=h,o().addEventListener("click",h,{once:!0})):h()},d=u=>{const h=t(),m=u.target;if(!h||!m||!l(u))return;const f=we([s,a]);m.addEventListener(_i,f,{once:!0});const g=new CustomEvent(_i,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:!1}});m.dispatchEvent(g)};D(()=>{S(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",d,!0),K(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",d,!0)}))})}/*!
|
|
57
57
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
58
58
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
59
59
|
*
|
|
60
60
|
* Credits to the Radix UI team:
|
|
61
61
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
|
|
62
62
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
|
|
63
|
-
*/function uu(e){const[t,n]=P();let r={},o=e(),i="none";const[s,a]=du(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D(et(s,l=>{const c=
|
|
63
|
+
*/function uu(e){const[t,n]=P();let r={},o=e(),i="none";const[s,a]=du(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D(et(s,l=>{const c=pn(r);i=l==="mounted"?c:"none"})),D(et(e,l=>{if(o===l)return;const c=pn(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),D(et(t,l=>{if(l){const c=u=>{const m=pn(r).includes(u.animationName);u.target===l&&m&&a("ANIMATION_END")},d=u=>{u.target===l&&(i=pn(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 pn(e){return e?.animationName||"none"}function du(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=P(e);return[r,s=>{o(a=>n(a,s))}]}function mn(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 fu(e,t){const[n,r]=P(Pi(t?.()));return D(()=>{r(e()?.tagName.toLowerCase()||Pi(t?.()))}),n}function Pi(e){return yt(e)?e:void 0}function
|
|
69
|
+
*/function fu(e,t){const[n,r]=P(Pi(t?.()));return D(()=>{r(e()?.tagName.toLowerCase()||Pi(t?.()))}),n}function Pi(e){return yt(e)?e:void 0}function yn(e){const[t,n]=j(e,["asChild","as","children"]);if(!t.asChild)return y(an,T({get component(){return t.as}},n,{get children(){return t.children}}));const r=Zn(()=>t.children);if(Ai(r())){const o=Ti(n,r()?.props??{});return y(an,o)}if(Oc(r())){const o=r().find(Ai);if(o){const i=()=>y(ht,{get each(){return r()},children:a=>y(Q,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Ti(n,o?.props??{});return y(an,T(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const hu=Symbol("$$KobalteAsComponent");function Ai(e){return e?.[hu]===!0}function Ti(e,t){return Ec([e,t],{reverseEventHandlers:!0})}/*!
|
|
70
70
|
* Portions of this file are based on code from react-spectrum.
|
|
71
71
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
72
72
|
*
|
|
@@ -78,13 +78,13 @@
|
|
|
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 Di(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yu(e)}}let
|
|
81
|
+
*/function Di(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yu(e)}}let xr=Di();const Vt=new Set;function Li(){xr=Di();for(const e of Vt)e(xr)}function bu(){const[e,t]=P(xr),n=C(()=>e());return en(()=>{Vt.size===0&&window.addEventListener("languagechange",Li),Vt.add(t),K(()=>{Vt.delete(t),Vt.size===0&&window.removeEventListener("languagechange",Li)})}),{locale:()=>n().locale,direction:()=>n().direction}}const vu=ce();function Sr(){const e=bu();return he(vu)||e}/*!
|
|
82
82
|
* Portions of this file are based on code from react-spectrum.
|
|
83
83
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
84
84
|
*
|
|
85
85
|
* Credits to the React Spectrum team:
|
|
86
86
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
|
|
87
|
-
*/const
|
|
87
|
+
*/const Er=new Map;function wu(e){const{locale:t}=Sr(),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})}/*!
|
|
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,13 +92,13 @@
|
|
|
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 ke extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof ke?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function xu(e){const[t,n]=
|
|
95
|
+
*/class ke extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof ke?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function xu(e){const[t,n]=mr(e);return[()=>t()??new ke,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 Mi(e){return Dc()?e.altKey:e.ctrlKey}function bt(e){return
|
|
101
|
+
*/function Mi(e){return Dc()?e.altKey:e.ctrlKey}function bt(e){return fn()?e.metaKey:e.ctrlKey}function Ii(e){return new ke(e)}function Su(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
|
|
102
102
|
* Portions of this file are based on code from react-spectrum.
|
|
103
103
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
104
104
|
*
|
|
@@ -116,7 +116,7 @@
|
|
|
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 _u(e,t,n){const o=T({selectOnFocus:()=>S(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=
|
|
119
|
+
*/function _u(e,t,n){const o=T({selectOnFocus:()=>S(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=Sr();let a={top:0,left:0};vc(()=>S(o.isVirtualized)?void 0:i(),"scroll",()=>{const g=i();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=ku({isDisabled:()=>S(o.disallowTypeAhead),keyboardDelegate:()=>S(o.keyboardDelegate),selectionManager:()=>S(o.selectionManager)}),c=g=>{ge(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const p=t();if(!p?.contains(g.target))return;const b=S(o.selectionManager),v=S(o.selectOnFocus),w=E=>{E!=null&&(b.setFocusedKey(E),g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&!Mi(g)&&b.replaceSelection(E))},x=S(o.keyboardDelegate),O=S(o.shouldFocusWrap),k=b.focusedKey();switch(g.key){case"ArrowDown":{if(x.getKeyBelow){g.preventDefault();let E;k!=null?E=x.getKeyBelow(k):E=x.getFirstKey?.(),E==null&&O&&(E=x.getFirstKey?.(k)),w(E)}break}case"ArrowUp":{if(x.getKeyAbove){g.preventDefault();let E;k!=null?E=x.getKeyAbove(k):E=x.getLastKey?.(),E==null&&O&&(E=x.getLastKey?.(k)),w(E)}break}case"ArrowLeft":{if(x.getKeyLeftOf){g.preventDefault();const E=s()==="rtl";let $;k!=null?$=x.getKeyLeftOf(k):$=E?x.getFirstKey?.():x.getLastKey?.(),w($)}break}case"ArrowRight":{if(x.getKeyRightOf){g.preventDefault();const E=s()==="rtl";let $;k!=null?$=x.getKeyRightOf(k):$=E?x.getLastKey?.():x.getFirstKey?.(),w($)}break}case"Home":if(x.getFirstKey){g.preventDefault();const E=x.getFirstKey(k,bt(g));E!=null&&(b.setFocusedKey(E),bt(g)&&g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&b.replaceSelection(E))}break;case"End":if(x.getLastKey){g.preventDefault();const E=x.getLastKey(k,bt(g));E!=null&&(b.setFocusedKey(E),bt(g)&&g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&b.replaceSelection(E))}break;case"PageDown":if(x.getKeyPageBelow&&k!=null){g.preventDefault();const E=x.getKeyPageBelow(k);w(E)}break;case"PageUp":if(x.getKeyPageAbove&&k!=null){g.preventDefault();const E=x.getKeyPageAbove(k);w(E)}break;case"a":bt(g)&&b.selectionMode()==="multiple"&&S(o.disallowSelectAll)!==!0&&(g.preventDefault(),b.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),S(o.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!S(o.allowsTabNavigation)){if(g.shiftKey)p.focus();else{const E=zc(p,{tabbable:!0});let $,_;do _=E.lastChild(),_&&($=_);while(_);$&&!$.contains(document.activeElement)&&de($)}break}}},d=g=>{const p=S(o.selectionManager),b=S(o.keyboardDelegate),v=S(o.selectOnFocus);if(p.isFocused()){g.currentTarget.contains(g.target)||p.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(p.setFocused(!0),p.focusedKey()==null){const w=O=>{O!=null&&(p.setFocusedKey(O),v&&p.replaceSelection(O))},x=g.relatedTarget;x&&g.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?w(p.lastSelectedKey()??b.getLastKey?.()):w(p.firstSelectedKey()??b.getFirstKey?.())}else if(!S(o.isVirtualized)){const w=i();if(w){w.scrollTop=a.top,w.scrollLeft=a.left;const x=w.querySelector(`[data-key="${p.focusedKey()}"]`);x&&(de(x),gr(w,x))}}}},u=g=>{const p=S(o.selectionManager);g.currentTarget.contains(g.relatedTarget)||p.setFocused(!1)},h=g=>{i()===g.target&&g.preventDefault()},m=()=>{const g=S(o.autoFocus);if(!g)return;const p=S(o.selectionManager),b=S(o.keyboardDelegate);let v;g==="first"&&(v=b.getFirstKey?.()),g==="last"&&(v=b.getLastKey?.());const w=p.selectedKeys();w.size&&(v=w.values().next().value),p.setFocused(!0),p.setFocusedKey(v);const x=t();x&&v==null&&!S(o.shouldUseVirtualFocus)&&de(x)};return en(()=>{o.deferAutoFocus?setTimeout(m,0):m()}),D(et([i,()=>S(o.isVirtualized),()=>S(o.selectionManager).focusedKey()],g=>{const[p,b,v]=g;if(b)v&&o.scrollToKey?.(v);else if(v&&p){const w=p.querySelector(`[data-key="${v}"]`);w&&gr(p,w)}})),{tabIndex:C(()=>{if(!S(o.shouldUseVirtualFocus))return S(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:u}}/*!
|
|
120
120
|
* Portions of this file are based on code from react-spectrum.
|
|
121
121
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
122
122
|
*
|
|
@@ -158,7 +158,7 @@
|
|
|
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 Mu=["button","color","file","image","reset","submit"];function Iu(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?Mu.indexOf(e.type)!==-1:!1}function Ru(e){let t;const n=Le({type:"button"},e),[r,o]=j(n,["ref","type","disabled"]),i=fu(()=>t,()=>"button"),s=C(()=>{const c=i();return c==null?!1:Iu({tagName:c,type:r.type})}),a=C(()=>i()==="input"),l=C(()=>i()==="a"&&t?.getAttribute("href")!=null);return y(
|
|
161
|
+
*/const Mu=["button","color","file","image","reset","submit"];function Iu(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?Mu.indexOf(e.type)!==-1:!1}function Ru(e){let t;const n=Le({type:"button"},e),[r,o]=j(n,["ref","type","disabled"]),i=fu(()=>t,()=>"button"),s=C(()=>{const c=i();return c==null?!1:Iu({tagName:c,type:r.type})}),a=C(()=>i()==="input"),l=C(()=>i()==="a"&&t?.getAttribute("href")!=null);return y(yn,T({as:"button",ref(c){var d=ot(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 Fi(){return he($i)}function $u(){const e=Fi();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
|
*
|
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
|
|
173
173
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
174
174
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
|
|
175
|
-
*/function Vu(e={}){const[t,n]=Yc({value:()=>S(e.items),onChange:i=>e.onItemsChange?.(i)});zu(t,n);const r=i=>(n(s=>{const a=Fu(s,i);return kc(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>y($i.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Uu(e){const t=$u(),n=Le({shouldRegisterItem:!0},e);D(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());K(r)})}var J=e=>typeof e=="function"?e():e,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},vn=new Map,ju=e=>{D(()=>{const t=J(e.style)??{},n=J(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=vn.get(e.key);o?o.activeCount++:vn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=vn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}vn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Bi=ju,Hu=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},qu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Wu=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=Hu(o,t),u=d-l-r*c;(c!==0||u!==0)&&qu(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[zi,Vi]=P([]),Gu=e=>zi().indexOf(e)===zi().length-1,Yu=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ae();let r=[0,0],o=null,i=null;D(()=>{J(t.enabled)&&(Vi(c=>[...c,n]),K(()=>{Vi(c=>c.filter(d=>d!==n))}))}),D(()=>{if(!J(t.enabled)||!J(t.hideScrollbar))return;const{body:c}=document,d=window.innerWidth-c.offsetWidth;if(J(t.preventScrollbarShift)){const u={overflow:"hidden"},h=[];d>0&&(J(t.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${d}px)`,h.push({key:"--scrollbar-width",value:`${d}px`}));const m=window.scrollY,f=window.scrollX;Bi({key:"prevent-scroll",element:c,style:u,properties:h,cleanup:()=>{J(t.restoreScrollPosition)&&d>0&&window.scrollTo(f,m)}})}else Bi({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),D(()=>{!Gu(n)||!J(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),K(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Ui(c),o=null,i=null},a=c=>{const d=c.target,u=J(t.element),h=Xu(c),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=m==="x"?h[0]:h[1],g=ji(d,m,f,u);let p;u&&Or(u,d)?p=!g:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const d=J(t.element),u=c.target;let h;if(c.touches.length===2)h=!J(t.allowPinchZoom);else{if(o==null||i===null){const m=Ui(c).map((g,p)=>r[p]-g),f=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=f,i=f==="x"?m[0]:m[1]}if(u.type==="range")h=!1;else{const m=ji(u,o,i,d);d&&Or(d,u)?h=!m:h=!0}}h&&c.cancelable&&c.preventDefault()}},Xu=e=>[e.deltaX,e.deltaY],Ui=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ji=(e,t,n,r)=>{const o=r!==null&&Or(r,e),[i,s]=Wu(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Ju=Yu,Hi=Ju;const qi=ce();function Zu(){return he(qi)}function Qu(e){let t;const n=Zu(),[r,o]=j(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=u=>{i.add(u);const h=n?.registerNestedLayer(u);return()=>{i.delete(u),h?.()}};cu({shouldExcludeElement:u=>t?r.excludedElements?.some(h=>De(h(),u))||[...i].some(h=>De(h,u)):!1,onPointerDownOutside:u=>{!t||pe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!pe.isTopMostLayer(t)||(r.onPointerDownOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.())},onFocusOutside:u=>{r.onFocusOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.()}},()=>t),Xc({ownerDocument:()=>je(t),onEscapeKeyDown:u=>{!t||!pe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(u),!u.defaultPrevented&&r.onDismiss&&(u.preventDefault(),r.onDismiss()))}}),tn(()=>{if(!t)return;pe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const u=n?.registerNestedLayer(t);pe.assignPointerEventToLayers(),pe.disableBodyPointerEvents(t),K(()=>{t&&(pe.removeLayer(t),u?.(),pe.assignPointerEventToLayers(),pe.restoreBodyPointerEvents(t))})}),D(et([()=>t,()=>r.disableOutsidePointerEvents],([u,h])=>{if(!u)return;const m=pe.find(u);m&&m.isPointerBlocking!==h&&(m.isPointerBlocking=h,pe.assignPointerEventToLayers()),h&&pe.disableBodyPointerEvents(u),K(()=>{pe.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:s};return y(qi.Provider,{value:d,get children(){return y(bn,T({as:"div",ref(u){var h=ot(m=>t=m,r.ref);typeof h=="function"&&h(u)}},o))}})}const Wi=ce();function ed(){const e=he(Wi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function td(e){const t=ed(),[n,r]=j(e,["ref","style"]);return y(bn,T({as:"div",ref(o){var i=ot(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const nd=["top","right","bottom","left"],Ye=Math.min,me=Math.max,wn=Math.round,xn=Math.floor,Me=e=>({x:e,y:e}),rd={left:"right",right:"left",bottom:"top",top:"bottom"},od={start:"end",end:"start"};function _r(e,t,n){return me(e,Ye(t,n))}function it(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function Gi(e){return e==="x"?"y":"x"}function Pr(e){return e==="y"?"height":"width"}function st(e){return["top","bottom"].includes(Xe(e))?"y":"x"}function Ar(e){return Gi(st(e))}function id(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=Ar(e),i=Pr(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Sn(s)),[s,Sn(s)]}function sd(e){const t=Sn(e);return[Tr(e),t,Tr(t)]}function Tr(e){return e.replace(/start|end/g,t=>od[t])}function ad(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function ld(e,t,n,r){const o=vt(e);let i=ad(Xe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Tr)))),i}function Sn(e){return e.replace(/left|right|bottom|top/g,t=>rd[t])}function cd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yi(e){return typeof e!="number"?cd(e):{top:e,right:e,bottom:e,left:e}}function En(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xi(e,t,n){let{reference:r,floating:o}=e;const i=st(t),s=Ar(t),a=Pr(s),l=Xe(t),c=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-o.width,y:u};break;default:m={x:r.x,y:r.y}}switch(vt(t)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const ud=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Xi(c,r,l),h=r,m={},f=0;for(let g=0;g<a.length;g++){const{name:p,fn:b}=a[g],{x:v,y:w,data:x,reset:O}=await b({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});d=v??d,u=w??u,m={...m,[p]:{...m[p],...x}},O&&f<=50&&(f++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:u}=Xi(c,h,l)),g=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:m}};async function jt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=it(t,e),f=Yi(m),p=a[h?u==="floating"?"reference":"floating":u],b=En(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(p)))==null||n?p:p.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},O=En(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(b.top-O.top+f.top)/x.y,bottom:(O.bottom-b.bottom+f.bottom)/x.y,left:(b.left-O.left+f.left)/x.x,right:(O.right-b.right+f.right)/x.x}}const dd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=it(e,t)||{};if(c==null)return{};const u=Yi(d),h={x:n,y:r},m=Ar(o),f=Pr(m),g=await s.getDimensions(c),p=m==="y",b=p?"top":"left",v=p?"bottom":"right",w=p?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[m]-h[m]-i.floating[f],O=h[m]-i.reference[m],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=k?k[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(k)))&&(E=a.floating[w]||i.floating[f]);const $=x/2-O/2,_=E/2-g[f]/2-1,R=Ye(u[b],_),L=Ye(u[v],_),I=R,ne=E-g[f]-L,Y=E/2-g[f]/2+$,fe=_r(I,Y,ne),F=!l.arrow&&vt(o)!=null&&Y!==fe&&i.reference[f]/2-(Y<I?R:L)-g[f]/2<0,V=F?Y<I?Y-I:Y-ne:0;return{[m]:h[m]+V,data:{[m]:fe,centerOffset:Y-fe-V,...F&&{alignmentOffset:V}},reset:F}}}),fd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...p}=it(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Xe(o),v=st(a),w=Xe(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=h||(w||!g?[Sn(a)]:sd(a)),k=f!=="none";!h&&k&&O.push(...ld(a,g,f,x));const E=[a,...O],$=await jt(t,p),_=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push($[b]),u){const Y=id(o,s,x);_.push($[Y[0]],$[Y[1]])}if(R=[...R,{placement:o,overflows:_}],!_.every(Y=>Y<=0)){var L,I;const Y=(((L=i.flip)==null?void 0:L.index)||0)+1,fe=E[Y];if(fe)return{data:{index:Y,overflows:R},reset:{placement:fe}};let F=(I=R.filter(V=>V.overflows[0]<=0).sort((V,Q)=>V.overflows[1]-Q.overflows[1])[0])==null?void 0:I.placement;if(!F)switch(m){case"bestFit":{var ne;const V=(ne=R.filter(Q=>{if(k){const ie=st(Q.placement);return ie===v||ie==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(ie=>ie>0).reduce((ie,At)=>ie+At,0)]).sort((Q,ie)=>Q[1]-ie[1])[0])==null?void 0:ne[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Ji(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zi(e){return nd.some(t=>e[t]>=0)}const hd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=it(e,t);switch(r){case"referenceHidden":{const i=await jt(t,{...o,elementContext:"reference"}),s=Ji(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Zi(s)}}}case"escaped":{const i=await jt(t,{...o,altBoundary:!0}),s=Ji(i,n.floating);return{data:{escapedOffsets:s,escaped:Zi(s)}}}default:return{}}}}};async function gd(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xe(n),a=vt(n),l=st(n)==="y",c=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,u=it(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*d,y:h*c}:{x:h*c,y:m*d}}const pd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await gd(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},md=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:p=>{let{x:b,y:v}=p;return{x:b,y:v}}},...l}=it(e,t),c={x:n,y:r},d=await jt(t,l),u=st(Xe(o)),h=Gi(u);let m=c[h],f=c[u];if(i){const p=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=m+d[p],w=m-d[b];m=_r(v,m,w)}if(s){const p=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=f+d[p],w=f-d[b];f=_r(v,f,w)}const g=a.fn({...t,[h]:m,[u]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[u]:s}}}}}},yd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=it(e,t),d=await jt(t,c),u=Xe(o),h=vt(o),m=st(o)==="y",{width:f,height:g}=i.floating;let p,b;u==="top"||u==="bottom"?(p=u,b=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,p=h==="end"?"top":"bottom");const v=g-d.top-d.bottom,w=f-d.left-d.right,x=Ye(g-d[p],v),O=Ye(f-d[b],w),k=!t.middlewareData.shift;let E=x,$=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=v),k&&!h){const R=me(d.left,0),L=me(d.right,0),I=me(d.top,0),ne=me(d.bottom,0);m?$=f-2*(R!==0||L!==0?R+L:me(d.left,d.right)):E=g-2*(I!==0||ne!==0?I+ne:me(d.top,d.bottom))}await l({...t,availableWidth:$,availableHeight:E});const _=await s.getDimensions(a.floating);return f!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function kn(){return typeof window<"u"}function wt(e){return Qi(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Qi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qi(e){return kn()?e instanceof Node||e instanceof ye(e).Node:!1}function Ce(e){return kn()?e instanceof Element||e instanceof ye(e).Element:!1}function Re(e){return kn()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function es(e){return!kn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function Ht(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function bd(e){return["table","td","th"].includes(wt(e))}function Cn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Dr(e){const t=Lr(),n=Ce(e)?Oe(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vd(e){let t=Je(e);for(;Re(t)&&!xt(t);){if(Dr(t))return t;if(Cn(t))return null;t=Je(t)}return null}function Lr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xt(e){return["html","body","#document"].includes(wt(e))}function Oe(e){return ye(e).getComputedStyle(e)}function On(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||es(e)&&e.host||Ie(e);return es(t)?t.host:t}function ts(e){const t=Je(e);return xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&Ht(t)?t:ts(t)}function qt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ts(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ye(o);if(i){const a=Mr(s);return t.concat(s,s.visualViewport||[],Ht(o)?o:[],a&&n?qt(a):[])}return t.concat(o,qt(o,[],n))}function Mr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ns(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=wn(n)!==i||wn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ir(e){return Ce(e)?e:e.contextElement}function St(e){const t=Ir(e);if(!Re(t))return Me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ns(t);let s=(i?wn(n.width):n.width)/r,a=(i?wn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const wd=Me(0);function rs(e){const t=ye(e);return!Lr()||!t.visualViewport?wd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ye(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ir(e);let s=Me(1);t&&(r?Ce(r)&&(s=St(r)):s=St(e));const a=xd(i,n,r)?rs(i):Me(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const h=ye(i),m=r&&Ce(r)?ye(r):r;let f=h,g=Mr(f);for(;g&&r&&m!==f;){const p=St(g),b=g.getBoundingClientRect(),v=Oe(g),w=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*p.x,x=b.top+(g.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,c*=p.y,d*=p.x,u*=p.y,l+=w,c+=x,f=ye(g),g=Mr(f)}}return En({width:d,height:u,x:l,y:c})}function Rr(e,t){const n=On(e).scrollLeft;return t?t.left+n:at(Ie(e)).left+n}function os(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Rr(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Sd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ie(r),a=t?Cn(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Me(1);const d=Me(0),u=Re(r);if((u||!u&&!i)&&((wt(r)!=="body"||Ht(s))&&(l=On(r)),Re(r))){const m=at(r);c=St(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=s&&!u&&!i?os(s,l,!0):Me(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Ed(e){return Array.from(e.getClientRects())}function kd(e){const t=Ie(e),n=On(e),r=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Rr(e);const a=-n.scrollTop;return Oe(r).direction==="rtl"&&(s+=me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Cd(e,t){const n=ye(e),r=Ie(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Lr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Od(e,t){const n=at(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Re(e)?St(e):Me(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function is(e,t,n){let r;if(t==="viewport")r=Cd(e,n);else if(t==="document")r=kd(Ie(e));else if(Ce(t))r=Od(t,n);else{const o=rs(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return En(r)}function ss(e,t){const n=Je(e);return n===t||!Ce(n)||xt(n)?!1:Oe(n).position==="fixed"||ss(n,t)}function _d(e,t){const n=t.get(e);if(n)return n;let r=qt(e,[],!1).filter(a=>Ce(a)&&wt(a)!=="body"),o=null;const i=Oe(e).position==="fixed";let s=i?Je(e):e;for(;Ce(s)&&!xt(s);){const a=Oe(s),l=Dr(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ht(s)&&!l&&ss(e,s))?r=r.filter(d=>d!==s):o=a,s=Je(s)}return t.set(e,r),r}function Pd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Cn(t)?[]:_d(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const u=is(t,d,o);return c.top=me(u.top,c.top),c.right=Ye(u.right,c.right),c.bottom=Ye(u.bottom,c.bottom),c.left=me(u.left,c.left),c},is(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ad(e){const{width:t,height:n}=ns(e);return{width:t,height:n}}function Td(e,t,n){const r=Re(t),o=Ie(t),i=n==="fixed",s=at(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Me(0);if(r||!r&&!i)if((wt(t)!=="body"||Ht(o))&&(a=On(t)),r){const h=at(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=Rr(o));const c=o&&!r&&!i?os(o,a):Me(0),d=s.left+a.scrollLeft-l.x-c.x,u=s.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:s.width,height:s.height}}function $r(e){return Oe(e).position==="static"}function as(e,t){if(!Re(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function ls(e,t){const n=ye(e);if(Cn(e))return n;if(!Re(e)){let o=Je(e);for(;o&&!xt(o);){if(Ce(o)&&!$r(o))return o;o=Je(o)}return n}let r=as(e,t);for(;r&&bd(r)&&$r(r);)r=as(r,t);return r&&xt(r)&&$r(r)&&!Dr(r)?n:r||vd(e)||n}const Dd=async function(e){const t=this.getOffsetParent||ls,n=this.getDimensions,r=await n(e.floating);return{reference:Td(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ld(e){return Oe(e).direction==="rtl"}const cs={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:Ie,getClippingRect:Pd,getOffsetParent:ls,getElementRects:Dd,getClientRects:Ed,getDimensions:Ad,getScale:St,isElement:Ce,isRTL:Ld};function us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Md(e,t){let n=null,r;const o=Ie(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:m}=c;if(a||t(),!h||!m)return;const f=xn(u),g=xn(o.clientWidth-(d+h)),p=xn(o.clientHeight-(u+m)),b=xn(d),w={rootMargin:-f+"px "+-g+"px "+-p+"px "+-b+"px",threshold:me(0,Ye(1,l))||1};let x=!0;function O(k){const E=k[0].intersectionRatio;if(E!==l){if(!x)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!us(c,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(O,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(e)}return s(!0),i}function Id(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ir(e),d=o||i?[...c?qt(c):[],...qt(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const u=c&&a?Md(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?at(e):null;l&&p();function p(){const b=at(e);g&&!us(g,b)&&n(),g=b,f=requestAnimationFrame(p)}return n(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),u?.(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const Rd=pd,$d=md,Fd=fd,Nd=yd,Kd=hd,Bd=dd,zd=(e,t,n)=>{const r=new Map,o={platform:cs,...n},i={...o.platform,_c:r};return ud(e,t,{...o,platform:i})};function ds(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function Vd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?ds(r):e?e.getBoundingClientRect():ds()}}}function Ud(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const jd={top:"bottom",right:"left",bottom:"top",left:"right"};function Hd(e,t){const[n,r]=e.split("-"),o=jd[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function qd(e){const t=Le({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=P(),[o,i]=P(),[s,a]=P(t.placement),l=()=>Vd(t.anchorRef(),t.getAnchorRect),{direction:c}=Er();async function d(){const h=l(),m=n(),f=o();if(!h||!m)return;const g=(f?.clientHeight||0)/2,p=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const b=[Rd(({placement:k})=>{const E=!!k.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(Ud))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(Fd({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&b.push($d({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Nd({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:E,rects:$}){const _=Math.round($.reference.width);k=Math.floor(k),E=Math.floor(E),m.style.setProperty("--kb-popper-anchor-width",`${_}px`),m.style.setProperty("--kb-popper-content-available-width",`${k}px`),m.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(m.style.width=`${_}px`),t.fitViewport&&(m.style.maxWidth=`${k}px`,m.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&b.push(Kd({padding:t.detachedPadding})),f&&b.push(Bd({element:f,padding:t.arrowPadding}));const v=await zd(h,m,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...cs,isRTL:()=>c()==="rtl"}});if(a(v.placement),t.onCurrentPlacementChange?.(v.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",Hd(v.placement,c()));const w=Math.round(v.x),x=Math.round(v.y);let O;if(t.hideWhenDetached&&(O=v.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:O}),f&&v.middlewareData.arrow){const{x:k,y:E}=v.middlewareData.arrow,$=v.placement.split("-")[0];Object.assign(f.style,{left:k!=null?`${k}px`:"",top:E!=null?`${E}px`:"",[$]:"100%"})}}D(()=>{const h=l(),m=n();if(!h||!m)return;const f=Id(h,m,d,{elementResize:typeof ResizeObserver=="function"});K(f)}),D(()=>{const h=n(),m=t.contentRef();!h||!m||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(m).zIndex})});const u={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return y(Wi.Provider,{value:u,get children(){return t.children}})}const fs=ce();function hs(){return he(fs)}function Et(){const e=hs();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const gs=ce();function kt(){const e=he(gs);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
175
|
+
*/function Vu(e={}){const[t,n]=Yc({value:()=>S(e.items),onChange:i=>e.onItemsChange?.(i)});zu(t,n);const r=i=>(n(s=>{const a=Fu(s,i);return kc(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>y($i.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Uu(e){const t=$u(),n=Le({shouldRegisterItem:!0},e);D(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());K(r)})}var J=e=>typeof e=="function"?e():e,kr=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Cr=(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},bn=new Map,ju=e=>{D(()=>{const t=J(e.style)??{},n=J(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=bn.get(e.key);o?o.activeCount++:bn.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=bn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}bn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Bi=ju,Hu=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},qu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Wu=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=Hu(o,t),u=d-l-r*c;(c!==0||u!==0)&&qu(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[zi,Vi]=P([]),Gu=e=>zi().indexOf(e)===zi().length-1,Yu=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ae();let r=[0,0],o=null,i=null;D(()=>{J(t.enabled)&&(Vi(c=>[...c,n]),K(()=>{Vi(c=>c.filter(d=>d!==n))}))}),D(()=>{if(!J(t.enabled)||!J(t.hideScrollbar))return;const{body:c}=document,d=window.innerWidth-c.offsetWidth;if(J(t.preventScrollbarShift)){const u={overflow:"hidden"},h=[];d>0&&(J(t.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${d}px)`,h.push({key:"--scrollbar-width",value:`${d}px`}));const m=window.scrollY,f=window.scrollX;Bi({key:"prevent-scroll",element:c,style:u,properties:h,cleanup:()=>{J(t.restoreScrollPosition)&&d>0&&window.scrollTo(f,m)}})}else Bi({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),D(()=>{!Gu(n)||!J(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),K(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Ui(c),o=null,i=null},a=c=>{const d=c.target,u=J(t.element),h=Xu(c),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=m==="x"?h[0]:h[1],g=ji(d,m,f,u);let p;u&&Cr(u,d)?p=!g:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const d=J(t.element),u=c.target;let h;if(c.touches.length===2)h=!J(t.allowPinchZoom);else{if(o==null||i===null){const m=Ui(c).map((g,p)=>r[p]-g),f=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=f,i=f==="x"?m[0]:m[1]}if(u.type==="range")h=!1;else{const m=ji(u,o,i,d);d&&Cr(d,u)?h=!m:h=!0}}h&&c.cancelable&&c.preventDefault()}},Xu=e=>[e.deltaX,e.deltaY],Ui=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ji=(e,t,n,r)=>{const o=r!==null&&Cr(r,e),[i,s]=Wu(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Ju=Yu,Hi=Ju;const qi=ce();function Zu(){return he(qi)}function Qu(e){let t;const n=Zu(),[r,o]=j(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=u=>{i.add(u);const h=n?.registerNestedLayer(u);return()=>{i.delete(u),h?.()}};cu({shouldExcludeElement:u=>t?r.excludedElements?.some(h=>De(h(),u))||[...i].some(h=>De(h,u)):!1,onPointerDownOutside:u=>{!t||pe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!pe.isTopMostLayer(t)||(r.onPointerDownOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.())},onFocusOutside:u=>{r.onFocusOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.()}},()=>t),Xc({ownerDocument:()=>je(t),onEscapeKeyDown:u=>{!t||!pe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(u),!u.defaultPrevented&&r.onDismiss&&(u.preventDefault(),r.onDismiss()))}}),en(()=>{if(!t)return;pe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const u=n?.registerNestedLayer(t);pe.assignPointerEventToLayers(),pe.disableBodyPointerEvents(t),K(()=>{t&&(pe.removeLayer(t),u?.(),pe.assignPointerEventToLayers(),pe.restoreBodyPointerEvents(t))})}),D(et([()=>t,()=>r.disableOutsidePointerEvents],([u,h])=>{if(!u)return;const m=pe.find(u);m&&m.isPointerBlocking!==h&&(m.isPointerBlocking=h,pe.assignPointerEventToLayers()),h&&pe.disableBodyPointerEvents(u),K(()=>{pe.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:s};return y(qi.Provider,{value:d,get children(){return y(yn,T({as:"div",ref(u){var h=ot(m=>t=m,r.ref);typeof h=="function"&&h(u)}},o))}})}const Wi=ce();function ed(){const e=he(Wi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function td(e){const t=ed(),[n,r]=j(e,["ref","style"]);return y(yn,T({as:"div",ref(o){var i=ot(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const nd=["top","right","bottom","left"],Ye=Math.min,me=Math.max,vn=Math.round,wn=Math.floor,Me=e=>({x:e,y:e}),rd={left:"right",right:"left",bottom:"top",top:"bottom"},od={start:"end",end:"start"};function Or(e,t,n){return me(e,Ye(t,n))}function it(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function Gi(e){return e==="x"?"y":"x"}function _r(e){return e==="y"?"height":"width"}function st(e){return["top","bottom"].includes(Xe(e))?"y":"x"}function Pr(e){return Gi(st(e))}function id(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=Pr(e),i=_r(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=xn(s)),[s,xn(s)]}function sd(e){const t=xn(e);return[Ar(e),t,Ar(t)]}function Ar(e){return e.replace(/start|end/g,t=>od[t])}function ad(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function ld(e,t,n,r){const o=vt(e);let i=ad(Xe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ar)))),i}function xn(e){return e.replace(/left|right|bottom|top/g,t=>rd[t])}function cd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yi(e){return typeof e!="number"?cd(e):{top:e,right:e,bottom:e,left:e}}function Sn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xi(e,t,n){let{reference:r,floating:o}=e;const i=st(t),s=Pr(t),a=_r(s),l=Xe(t),c=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-o.width,y:u};break;default:m={x:r.x,y:r.y}}switch(vt(t)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const ud=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Xi(c,r,l),h=r,m={},f=0;for(let g=0;g<a.length;g++){const{name:p,fn:b}=a[g],{x:v,y:w,data:x,reset:O}=await b({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});d=v??d,u=w??u,m={...m,[p]:{...m[p],...x}},O&&f<=50&&(f++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:u}=Xi(c,h,l)),g=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:m}};async function Ut(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=it(t,e),f=Yi(m),p=a[h?u==="floating"?"reference":"floating":u],b=Sn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(p)))==null||n?p:p.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},O=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(b.top-O.top+f.top)/x.y,bottom:(O.bottom-b.bottom+f.bottom)/x.y,left:(b.left-O.left+f.left)/x.x,right:(O.right-b.right+f.right)/x.x}}const dd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=it(e,t)||{};if(c==null)return{};const u=Yi(d),h={x:n,y:r},m=Pr(o),f=_r(m),g=await s.getDimensions(c),p=m==="y",b=p?"top":"left",v=p?"bottom":"right",w=p?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[m]-h[m]-i.floating[f],O=h[m]-i.reference[m],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=k?k[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(k)))&&(E=a.floating[w]||i.floating[f]);const $=x/2-O/2,_=E/2-g[f]/2-1,R=Ye(u[b],_),L=Ye(u[v],_),M=R,ne=E-g[f]-L,Y=E/2-g[f]/2+$,fe=Or(M,Y,ne),F=!l.arrow&&vt(o)!=null&&Y!==fe&&i.reference[f]/2-(Y<M?R:L)-g[f]/2<0,V=F?Y<M?Y-M:Y-ne:0;return{[m]:h[m]+V,data:{[m]:fe,centerOffset:Y-fe-V,...F&&{alignmentOffset:V}},reset:F}}}),fd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...p}=it(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Xe(o),v=st(a),w=Xe(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=h||(w||!g?[xn(a)]:sd(a)),k=f!=="none";!h&&k&&O.push(...ld(a,g,f,x));const E=[a,...O],$=await Ut(t,p),_=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push($[b]),u){const Y=id(o,s,x);_.push($[Y[0]],$[Y[1]])}if(R=[...R,{placement:o,overflows:_}],!_.every(Y=>Y<=0)){var L,M;const Y=(((L=i.flip)==null?void 0:L.index)||0)+1,fe=E[Y];if(fe)return{data:{index:Y,overflows:R},reset:{placement:fe}};let F=(M=R.filter(V=>V.overflows[0]<=0).sort((V,Z)=>V.overflows[1]-Z.overflows[1])[0])==null?void 0:M.placement;if(!F)switch(m){case"bestFit":{var ne;const V=(ne=R.filter(Z=>{if(k){const ie=st(Z.placement);return ie===v||ie==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ie=>ie>0).reduce((ie,Pt)=>ie+Pt,0)]).sort((Z,ie)=>Z[1]-ie[1])[0])==null?void 0:ne[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Ji(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zi(e){return nd.some(t=>e[t]>=0)}const hd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=it(e,t);switch(r){case"referenceHidden":{const i=await Ut(t,{...o,elementContext:"reference"}),s=Ji(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Zi(s)}}}case"escaped":{const i=await Ut(t,{...o,altBoundary:!0}),s=Ji(i,n.floating);return{data:{escapedOffsets:s,escaped:Zi(s)}}}default:return{}}}}};async function gd(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xe(n),a=vt(n),l=st(n)==="y",c=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,u=it(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*d,y:h*c}:{x:h*c,y:m*d}}const pd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await gd(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},md=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:p=>{let{x:b,y:v}=p;return{x:b,y:v}}},...l}=it(e,t),c={x:n,y:r},d=await Ut(t,l),u=st(Xe(o)),h=Gi(u);let m=c[h],f=c[u];if(i){const p=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=m+d[p],w=m-d[b];m=Or(v,m,w)}if(s){const p=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=f+d[p],w=f-d[b];f=Or(v,f,w)}const g=a.fn({...t,[h]:m,[u]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[u]:s}}}}}},yd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=it(e,t),d=await Ut(t,c),u=Xe(o),h=vt(o),m=st(o)==="y",{width:f,height:g}=i.floating;let p,b;u==="top"||u==="bottom"?(p=u,b=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,p=h==="end"?"top":"bottom");const v=g-d.top-d.bottom,w=f-d.left-d.right,x=Ye(g-d[p],v),O=Ye(f-d[b],w),k=!t.middlewareData.shift;let E=x,$=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=v),k&&!h){const R=me(d.left,0),L=me(d.right,0),M=me(d.top,0),ne=me(d.bottom,0);m?$=f-2*(R!==0||L!==0?R+L:me(d.left,d.right)):E=g-2*(M!==0||ne!==0?M+ne:me(d.top,d.bottom))}await l({...t,availableWidth:$,availableHeight:E});const _=await s.getDimensions(a.floating);return f!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function En(){return typeof window<"u"}function wt(e){return Qi(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Qi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qi(e){return En()?e instanceof Node||e instanceof ye(e).Node:!1}function Ce(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 es(e){return!En()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function jt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function bd(e){return["table","td","th"].includes(wt(e))}function kn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Tr(e){const t=Dr(),n=Ce(e)?Oe(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vd(e){let t=Je(e);for(;Re(t)&&!xt(t);){if(Tr(t))return t;if(kn(t))return null;t=Je(t)}return null}function Dr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xt(e){return["html","body","#document"].includes(wt(e))}function Oe(e){return ye(e).getComputedStyle(e)}function Cn(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||es(e)&&e.host||Ie(e);return es(t)?t.host:t}function ts(e){const t=Je(e);return xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&jt(t)?t:ts(t)}function Ht(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ts(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ye(o);if(i){const a=Lr(s);return t.concat(s,s.visualViewport||[],jt(o)?o:[],a&&n?Ht(a):[])}return t.concat(o,Ht(o,[],n))}function Lr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ns(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=vn(n)!==i||vn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Mr(e){return Ce(e)?e:e.contextElement}function St(e){const t=Mr(e);if(!Re(t))return Me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ns(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 wd=Me(0);function rs(e){const t=ye(e);return!Dr()||!t.visualViewport?wd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ye(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Mr(e);let s=Me(1);t&&(r?Ce(r)&&(s=St(r)):s=St(e));const a=xd(i,n,r)?rs(i):Me(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const h=ye(i),m=r&&Ce(r)?ye(r):r;let f=h,g=Lr(f);for(;g&&r&&m!==f;){const p=St(g),b=g.getBoundingClientRect(),v=Oe(g),w=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*p.x,x=b.top+(g.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,c*=p.y,d*=p.x,u*=p.y,l+=w,c+=x,f=ye(g),g=Lr(f)}}return Sn({width:d,height:u,x:l,y:c})}function Ir(e,t){const n=Cn(e).scrollLeft;return t?t.left+n:at(Ie(e)).left+n}function os(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ir(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Sd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ie(r),a=t?kn(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Me(1);const d=Me(0),u=Re(r);if((u||!u&&!i)&&((wt(r)!=="body"||jt(s))&&(l=Cn(r)),Re(r))){const m=at(r);c=St(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=s&&!u&&!i?os(s,l,!0):Me(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Ed(e){return Array.from(e.getClientRects())}function kd(e){const t=Ie(e),n=Cn(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+Ir(e);const a=-n.scrollTop;return Oe(r).direction==="rtl"&&(s+=me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Cd(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=Dr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Od(e,t){const n=at(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Re(e)?St(e):Me(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function is(e,t,n){let r;if(t==="viewport")r=Cd(e,n);else if(t==="document")r=kd(Ie(e));else if(Ce(t))r=Od(t,n);else{const o=rs(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Sn(r)}function ss(e,t){const n=Je(e);return n===t||!Ce(n)||xt(n)?!1:Oe(n).position==="fixed"||ss(n,t)}function _d(e,t){const n=t.get(e);if(n)return n;let r=Ht(e,[],!1).filter(a=>Ce(a)&&wt(a)!=="body"),o=null;const i=Oe(e).position==="fixed";let s=i?Je(e):e;for(;Ce(s)&&!xt(s);){const a=Oe(s),l=Tr(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||jt(s)&&!l&&ss(e,s))?r=r.filter(d=>d!==s):o=a,s=Je(s)}return t.set(e,r),r}function Pd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?kn(t)?[]:_d(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const u=is(t,d,o);return c.top=me(u.top,c.top),c.right=Ye(u.right,c.right),c.bottom=Ye(u.bottom,c.bottom),c.left=me(u.left,c.left),c},is(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ad(e){const{width:t,height:n}=ns(e);return{width:t,height:n}}function Td(e,t,n){const r=Re(t),o=Ie(t),i=n==="fixed",s=at(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Me(0);if(r||!r&&!i)if((wt(t)!=="body"||jt(o))&&(a=Cn(t)),r){const h=at(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=Ir(o));const c=o&&!r&&!i?os(o,a):Me(0),d=s.left+a.scrollLeft-l.x-c.x,u=s.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:s.width,height:s.height}}function Rr(e){return Oe(e).position==="static"}function as(e,t){if(!Re(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function ls(e,t){const n=ye(e);if(kn(e))return n;if(!Re(e)){let o=Je(e);for(;o&&!xt(o);){if(Ce(o)&&!Rr(o))return o;o=Je(o)}return n}let r=as(e,t);for(;r&&bd(r)&&Rr(r);)r=as(r,t);return r&&xt(r)&&Rr(r)&&!Tr(r)?n:r||vd(e)||n}const Dd=async function(e){const t=this.getOffsetParent||ls,n=this.getDimensions,r=await n(e.floating);return{reference:Td(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ld(e){return Oe(e).direction==="rtl"}const cs={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:Ie,getClippingRect:Pd,getOffsetParent:ls,getElementRects:Dd,getClientRects:Ed,getDimensions:Ad,getScale:St,isElement:Ce,isRTL:Ld};function us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Md(e,t){let n=null,r;const o=Ie(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:m}=c;if(a||t(),!h||!m)return;const f=wn(u),g=wn(o.clientWidth-(d+h)),p=wn(o.clientHeight-(u+m)),b=wn(d),w={rootMargin:-f+"px "+-g+"px "+-p+"px "+-b+"px",threshold:me(0,Ye(1,l))||1};let x=!0;function O(k){const E=k[0].intersectionRatio;if(E!==l){if(!x)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!us(c,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(O,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(e)}return s(!0),i}function Id(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Mr(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?Md(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?at(e):null;l&&p();function p(){const b=at(e);g&&!us(g,b)&&n(),g=b,f=requestAnimationFrame(p)}return n(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),u?.(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const Rd=pd,$d=md,Fd=fd,Nd=yd,Kd=hd,Bd=dd,zd=(e,t,n)=>{const r=new Map,o={platform:cs,...n},i={...o.platform,_c:r};return ud(e,t,{...o,platform:i})};function ds(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function Vd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?ds(r):e?e.getBoundingClientRect():ds()}}}function Ud(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const jd={top:"bottom",right:"left",bottom:"top",left:"right"};function Hd(e,t){const[n,r]=e.split("-"),o=jd[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function qd(e){const t=Le({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=P(),[o,i]=P(),[s,a]=P(t.placement),l=()=>Vd(t.anchorRef(),t.getAnchorRect),{direction:c}=Sr();async function d(){const h=l(),m=n(),f=o();if(!h||!m)return;const g=(f?.clientHeight||0)/2,p=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const b=[Rd(({placement:k})=>{const E=!!k.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(Ud))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(Fd({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&b.push($d({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Nd({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:E,rects:$}){const _=Math.round($.reference.width);k=Math.floor(k),E=Math.floor(E),m.style.setProperty("--kb-popper-anchor-width",`${_}px`),m.style.setProperty("--kb-popper-content-available-width",`${k}px`),m.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(m.style.width=`${_}px`),t.fitViewport&&(m.style.maxWidth=`${k}px`,m.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&b.push(Kd({padding:t.detachedPadding})),f&&b.push(Bd({element:f,padding:t.arrowPadding}));const v=await zd(h,m,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...cs,isRTL:()=>c()==="rtl"}});if(a(v.placement),t.onCurrentPlacementChange?.(v.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",Hd(v.placement,c()));const w=Math.round(v.x),x=Math.round(v.y);let O;if(t.hideWhenDetached&&(O=v.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:O}),f&&v.middlewareData.arrow){const{x:k,y:E}=v.middlewareData.arrow,$=v.placement.split("-")[0];Object.assign(f.style,{left:k!=null?`${k}px`:"",top:E!=null?`${E}px`:"",[$]:"100%"})}}D(()=>{const h=l(),m=n();if(!h||!m)return;const f=Id(h,m,d,{elementResize:typeof ResizeObserver=="function"});K(f)}),D(()=>{const h=n(),m=t.contentRef();!h||!m||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(m).zIndex})});const u={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return y(Wi.Provider,{value:u,get children(){return t.children}})}const fs=ce();function hs(){return he(fs)}function Et(){const e=hs();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const gs=ce();function kt(){const e=he(gs);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
176
176
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
177
177
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
178
178
|
*
|
|
179
179
|
* Credits to the Radix UI team:
|
|
180
180
|
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
|
|
181
|
-
*/function Wd(e,t){return t?jc([e.clientX,e.clientY],t):!1}function Gd(e){const t=kt(),n=Fi(),r=hs(),o=Le({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=P(),[h,m]=P(),[f,g]=P(),[p,b]=P(),[v,w]=P(!0),[x,O]=P(s.placement),[k,E]=P([]),[$,_]=P([]),{DomCollectionProvider:R}=Vu({items:$,onItemsChange:_}),L=wi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),I=uu(()=>t.forceMount()||L.isOpen()),ne=Tu({selectionMode:"none",dataSource:$}),Y=U=>{w(U),L.open()},fe=(U=!1)=>{L.close(),U&&r&&r.close(!0)},F=U=>{w(U),L.toggle()},V=()=>{const U=p();U&&(de(U),ne.selectionManager().setFocused(!0),ne.selectionManager().setFocusedKey(void 0))},Q=U=>{E(ho=>[...ho,U]);const Un=r?.registerNestedMenu(U);return()=>{E(ho=>dr(ho,U)),Un?.()}},ie=U=>c===l?.side&&Wd(U,l?.area),At=U=>{ie(U)&&U.preventDefault()},Pe=U=>{ie(U)||V()},dm=U=>{ie(U)&&U.preventDefault()};au({isDisabled:()=>!(r==null&&L.isOpen()&&t.isModal()),targets:()=>[p(),...k()].filter(Boolean)}),D(()=>{const U=p();if(!U||!r)return;const Un=r.registerNestedMenu(U);K(()=>{Un()})});const fm={dataset:C(()=>({"data-expanded":L.isOpen()?"":void 0,"data-closed":L.isOpen()?void 0:""})),isOpen:L.isOpen,contentPresence:I,nestedMenus:k,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:v,listState:()=>ne,parentMenuContext:()=>r,triggerRef:f,contentRef:p,triggerId:d,contentId:h,setTriggerRef:g,setContentRef:b,open:Y,close:fe,toggle:F,focusContent:V,onItemEnter:At,onItemLeave:Pe,onTriggerLeave:dm,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Q,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:yn(u),registerContentId:yn(m)};return y(R,{get children(){return y(fs.Provider,{value:fm,get children(){return y(qd,T({anchorRef:f,contentRef:p,onCurrentPlacementChange:O},s))}})}})}const Yd=ce();function Xd(e){let t;const n=kt(),r=Et(),o=Le({id:n.generateId(`item-${Ae()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,d]=P(),[u,h]=P(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),p=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Uu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??u()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const b=Pu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),v=_=>{ge(_,i.onPointerMove),_.pointerType==="mouse"&&(i.disabled?r.onItemLeave(_):(r.onItemEnter(_),_.defaultPrevented||(de(_.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},w=_=>{ge(_,i.onPointerLeave),_.pointerType==="mouse"&&r.onItemLeave(_)},x=_=>{ge(_,i.onPointerUp),!i.disabled&&_.button===0&&p()},O=_=>{if(ge(_,i.onKeyDown),!_.repeat&&!i.disabled)switch(_.key){case"Enter":case" ":p();break}},k=C(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),E=C(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),$={isChecked:()=>i.checked,dataset:E,setLabelRef:h,generateId:ci(()=>s.id),registerLabel:yn(l),registerDescription:yn(d)};return y(Yd.Provider,{value:$,get children(){return y(bn,T({as:"div",ref(_){var R=ot(L=>t=L,i.ref);typeof R=="function"&&R(_)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return we([i.onPointerDown,b.onPointerDown])},get onPointerUp(){return we([x,b.onPointerUp])},get onClick(){return we([i.onClick,b.onClick])},get onKeyDown(){return we([O,b.onKeyDown])},get onMouseDown(){return we([i.onMouseDown,b.onMouseDown])},get onFocus(){return we([i.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:w},E,s))}})}const Jd=ce();function ps(){return he(Jd)}function Zd(e){let t;const n=kt(),r=Et(),o=ps(),i=Le({id:n.generateId(`content-${Ae()}`)},e),[s,a]=j(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Lu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);iu({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:p=>{o===void 0&&s.onOpenAutoFocus?.(p)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const u=p=>{if(De(p.currentTarget,p.target)&&(p.key==="Tab"&&r.isOpen()&&p.preventDefault(),o!==void 0&&p.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(p.key){case"ArrowRight":p.stopPropagation(),p.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(p.currentTarget.hasAttribute("data-closed"))break;p.stopPropagation(),p.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=p=>{s.onEscapeKeyDown?.(p),o?.setAutoFocusMenu(!1),r.close(!0)},m=p=>{s.onFocusOutside?.(p),n.isModal()&&p.preventDefault()},f=p=>{ge(p,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=p=>{if(ge(p,s.onPointerMove),p.pointerType!=="mouse")return;const b=p.target,v=l!==p.clientX;De(p.currentTarget,b)&&v&&(r.setPointerDir(p.clientX>l?"right":"left"),l=p.clientX)};return D(()=>K(r.registerContentId(s.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y(td,{get children(){return y(Qu,T({ref(p){var b=ot(v=>{r.setContentRef(v),r.contentPresence.setRef(v),t=v},s.ref);typeof b=="function"&&b(p)},role:"menu",get id(){return s.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return 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:h,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return we([s.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return we([s.onMouseDown,d.onMouseDown])},get onFocusIn(){return we([s.onFocusIn,d.onFocusIn])},get onFocusOut(){return we([s.onFocusOut,d.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Qd(e){let t;const n=kt(),r=Et(),[o,i]=j(e,["ref"]);return Hi({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Zd,T({ref(s){var a=ot(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function ef(e){return y(Xd,T({role:"menuitem",closeOnSelect:!0},e))}function tf(e){const t=Et();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(qo,e)}})}function nf(e){const t=`menu-${Ae()}`,n=Le({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=wi({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ci(()=>r.id),value:()=>r.value};return y(gs.Provider,{value:s,get children(){return y(Gd,T({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function rf(e){const t=kt(),n=Et(),r=ps(),o=Le({id:t.generateId("trigger")},e),[i,s]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,D(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),D(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),D(()=>{n.isOpen()&&r.setValue(a)}),K(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{ge(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},d=f=>{ge(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},u=f=>{if(ge(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),Hc(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{ge(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{ge(f,i.onFocus),r!==void 0&&r.setValue(a)};return D(()=>K(n.registerTriggerId(i.id))),y(Ru,T({ref(f){var g=ot(n.setTriggerRef,i.ref);typeof g=="function"&&g(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return 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:h,onClick:d,onKeyDown:u,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function of(e){const t=kt(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(Qd,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||de(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function sf(e){const t=`dropdownmenu-${Ae()}`,n=Le({id:t},e);return y(nf,n)}function af(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function lf(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function cf(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const uf=e=>y(sf,T({gutter:4},e)),df=rf,ff=e=>{const[,t]=j(e,["class"]);return y(tf,{get mount(){return Wn()},get children(){return y(of,T({get class(){return Ge("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},hf=e=>{const[,t]=j(e,["class"]);return y(ef,T({get class(){return Ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function gf(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function pf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function mf(e,t,n){const r=`${Jt}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function yf(e,t,n){if(!e||!t||!n)return;const r=`${Jt}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const $e=Object.create(null);$e.open="0",$e.close="1",$e.ping="2",$e.pong="3",$e.message="4",$e.upgrade="5",$e.noop="6";const _n=Object.create(null);Object.keys($e).forEach(e=>{_n[$e[e]]=e});const Fr={type:"error",data:"parser error"},ms=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ys=typeof ArrayBuffer=="function",bs=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Nr=({type:e,data:t},n,r)=>ms&&t instanceof Blob?n?r(t):vs(t,r):ys&&(t instanceof ArrayBuffer||bs(t))?n?r(t):vs(new Blob([t]),r):r($e[e]+(t||"")),vs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function ws(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kr;function bf(e,t){if(ms&&e.data instanceof Blob)return e.data.arrayBuffer().then(ws).then(t);if(ys&&(e.data instanceof ArrayBuffer||bs(e.data)))return t(ws(e.data));Nr(e,!1,n=>{Kr||(Kr=new TextEncoder),t(Kr.encode(n))})}const xs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<xs.length;e++)Wt[xs.charCodeAt(e)]=e;const vf=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)i=Wt[e.charCodeAt(r)],s=Wt[e.charCodeAt(r+1)],a=Wt[e.charCodeAt(r+2)],l=Wt[e.charCodeAt(r+3)],d[o++]=i<<2|s>>4,d[o++]=(s&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},wf=typeof ArrayBuffer=="function",Br=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ss(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xf(e.substring(1),t)}:_n[n]?e.length>1?{type:_n[n],data:e.substring(1)}:{type:_n[n]}:Fr},xf=(e,t)=>{if(wf){const n=vf(e);return Ss(n,t)}else return{base64:!0,data:e}},Ss=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Es="",Sf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Nr(i,!1,a=>{r[s]=a,++o===n&&t(r.join(Es))})})},Ef=(e,t)=>{const n=e.split(Es),r=[];for(let o=0;o<n.length;o++){const i=Br(n[o],t);if(r.push(i),i.type==="error")break}return r};function kf(){return new TransformStream({transform(e,t){bf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let zr;function Pn(e){return e.reduce((t,n)=>t+n.length,0)}function An(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Cf(e,t){zr||(zr=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(Pn(n)<1)break;const l=An(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Pn(n)<2)break;const l=An(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pn(n)<8)break;const l=An(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Fr);break}o=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pn(n)<o)break;const l=An(n,o);a.enqueue(Br(i?l:zr.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Fr);break}}}})}const ks=4;function te(e){if(e)return Of(e)}function Of(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")(),_f="arraybuffer";function mm(){}function Cs(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Pf=Se.setTimeout,Af=Se.clearTimeout;function Dn(e,t){t.useNativeTimers?(e.setTimeoutFn=Pf.bind(Se),e.clearTimeoutFn=Af.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Tf=1.33;function Df(e){return typeof e=="string"?Lf(e):Math.ceil((e.byteLength||e.size)*Tf)}function Lf(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Os(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Mf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function If(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Rf extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Vr extends te{constructor(t){super(),this.writable=!1,Dn(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Rf(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Br(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Mf(t);return n.length?"?"+n:""}}class $f extends Vr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Ef(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Sf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Os()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _s=!1;try{_s=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ff=_s;function Nf(){}class Kf extends $f{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Fe extends te{constructor(t,n,r){super(),this.createRequest=t,Dn(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Cs(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=Fe.requestsCount++,Fe.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=Nf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Fe.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(Fe.requestsCount=0,Fe.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ps);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,Ps,!1)}}function Ps(){for(let e in Fe.requests)Fe.requests.hasOwnProperty(e)&&Fe.requests[e].abort()}const Bf=function(){const e=As({xdomain:!1});return e&&e.responseType!==null}();class zf extends Kf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Bf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Fe(As,this.uri(),t)}}function As(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ff))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ts=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vf extends Vr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ts?{}:Cs(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]=Os()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ur=Se.WebSocket||Se.MozWebSocket;class Uf extends Vf{createSocket(t,n,r){return Ts?new Ur(t,n,r):n?new Ur(t,n):new Ur(t)}doWrite(t,n){this.ws.send(n)}}class jf extends Vr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Cf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=kf();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Hf={websocket:Uf,webtransport:jf,polling:zf},qf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function jr(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=qf.exec(e||""),i={},s=14;for(;s--;)i[Wf[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Gf(i,i.path),i.queryKey=Yf(i,i.query),i}function Gf(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Yf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Hr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ln=[];Hr&&addEventListener("offline",()=>{Ln.forEach(e=>e())},!1);class Ze extends te{constructor(t,n){if(super(),this.binaryType=_f,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=jr(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=jr(n.host).host);Dn(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=If(this.opts.query)),Hr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ln.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ks,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=Df(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ze.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Hr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ln.indexOf(this._offlineEventListener);r!==-1&&Ln.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=ks;class Xf extends Ze{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const h=new Error("probe error: "+u);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Jf=class extends Xf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Hf[o]).filter(o=>!!o)),super(t,r)}};function Zf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=jr(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const Qf=typeof ArrayBuffer=="function",eh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ds=Object.prototype.toString,th=typeof Blob=="function"||typeof Blob<"u"&&Ds.call(Blob)==="[object BlobConstructor]",nh=typeof File=="function"||typeof File<"u"&&Ds.call(File)==="[object FileConstructor]";function qr(e){return Qf&&(e instanceof ArrayBuffer||eh(e))||th&&e instanceof Blob||nh&&e instanceof File}function Mn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Mn(e[n]))return!0;return!1}if(qr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mn(e[n]))return!0;return!1}function rh(e){const t=[],n=e.data,r=e;return r.data=Wr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Wr(e,t){if(!e)return e;if(qr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Wr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Wr(e[r],t));return n}return e}function oh(e,t){return e.data=Gr(e.data,t),delete e.attachments,e}function Gr(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Gr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Gr(e[n],t));return e}const ih=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],sh=5;var z;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(z||(z={}));class ah{constructor(t){this.replacer=t}encode(t){return(t.type===z.EVENT||t.type===z.ACK)&&Mn(t)?this.encodeAsBinary({type:t.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===z.BINARY_EVENT||t.type===z.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=rh(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ls(e){return Object.prototype.toString.call(e)==="[object Object]"}class Yr extends 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===z.BINARY_EVENT;r||n.type===z.BINARY_ACK?(n.type=r?z.EVENT:z.ACK,this.reconstructor=new lh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(qr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Yr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case z.CONNECT:return Ls(n);case z.DISCONNECT:return n===void 0;case z.CONNECT_ERROR:return typeof n=="string"||Ls(n);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&ih.indexOf(n[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class lh{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=oh(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ch=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Yr,Encoder:ah,get PacketType(){return z},protocol:sh},Symbol.toStringTag,{value:"Module"}));function _e(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const uh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ms extends 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=[_e(t,"open",this.onopen.bind(this)),_e(t,"packet",this.onpacket.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(uh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:z.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),s.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:z.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case z.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case z.EVENT:case z.BINARY_EVENT:this.onevent(t);break;case z.ACK:case z.BINARY_ACK:this.onack(t);break;case z.DISCONNECT:this.ondisconnect();break;case z.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:z.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:z.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ct(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}Ct.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},Ct.prototype.reset=function(){this.attempts=0},Ct.prototype.setMin=function(e){this.ms=e},Ct.prototype.setMax=function(e){this.max=e},Ct.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,Dn(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ct({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||ch;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Jf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=_e(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=_e(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(_e(t,"ping",this.onping.bind(this)),_e(t,"data",this.ondata.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(t,"close",this.onclose.bind(this)),_e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tn(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Ms(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Gt={};function In(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Zf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Gt[o]&&i in Gt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Xr(r,t):(Gt[o]||(Gt[o]=new Xr(r,t)),l=Gt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(In,{Manager:Xr,Socket:Ms,io:In,connect:In});class lt{static instance;constructor(){}static init(t){return lt.instance||(lt.instance=In(za,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t}}),lt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),lt.instance}static on(t,n,r){lt.instance||this.init(n).on(t,r)}}const Is=1e3*60*60*24,[Rn,Rs]=ti("smarttalks-widget-messages",{},Is),$s=()=>{const{widgetId:e}=oe();return Rn[e()]??[]},dh=e=>{const{widgetId:t}=oe();Rs({...Rn,[t()]:[...Rn[t()]??[],e]})},fh=()=>{const{widgetId:e}=oe();Rs({...Rn,[e()]:[]})},[Fs,hh]=ti("smarttalks-widget-conversationinfo",{},Is),Ns=()=>{const{widgetId:e}=oe();return Fs[e()]??{}},Ks=e=>{const{widgetId:t}=oe();hh({...Fs,[t()]:e})},[gh,Jr]=P(!1),[ph,Bs]=P(!1),zs=[],Vs=()=>{zs.forEach(e=>e())},mh=e=>zs.push(e),Zr=e=>{const t=gf(e);if(dh(t),t.type==="media"){setTimeout(Vs,200);return}Vs()},yh=(e,t)=>{const{chatWidget:n,widgetId:r}=oe(),o=Ns();e.trim()&&(Zr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ee("onInput",e),lt.on("message",r(),i=>{(i.contactId!==o.contactId||i.interactionId!==o.interactionId)&&Ks({contactId:i.contactId,interactionId:i.interactionId});for(const s of i.messages)Zr(s),ee("onAnswer",s);Jr(!1),pf(i.debug)}),Jr(!0),mf(e,t,n()?._id).catch(i=>{console.error(i),Jr(!1)}))},bh=()=>{const{chatWidget:e}=oe(),t=Ns();Bs(!0),fh(),yf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ks({}),Bs(!1),vh()}),ee("onReset")},vh=()=>{const{chatWidget:e}=oe();if($s().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Zr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qe=()=>({getMessages:$s,pushMessage:yh,clearMessages:bh,onMessage:mh,typing:gh,loading:ph});var wh=M("<span>");const xh=()=>{const{clearMessages:e}=Qe();P(!1);const[t,n]=P(!1);return y(uf,{get open(){return t()},onOpenChange:n,get children(){return[y(df,{get children(){return y(Te,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(fc,{size:20})}})}}),y(ff,{get children(){return y(hf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(dc,{size:14}),(()=>{var r=wh();return A(r,()=>dt("restart")),r})()]}})}})]}})};function Sh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Eh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function kh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var Ch=M('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const Qr=()=>{const{chatWidget:e}=oe(),[t,n]=P(!1),r=()=>{try{const i=Wn();i&&(t()?document.exitFullscreen().then(()=>n(!1)):i.requestFullscreen().then(()=>n(!0)))}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{e()?.mode==="popup"&&ee("close")};return se("toggleFullscreen",()=>{r()}),(()=>{var i=Ch(),s=i.firstChild;return A(i,y(cc,{}),s),A(s,y(Te,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return y(Z,{get when(){return t()},get fallback(){return y(Eh,{size:16})},get children(){return y(Sh,{size:16})}})}}),null),A(s,y(Z,{get when(){return e()?.showSettings},get children(){return y(xh,{})}}),null),A(s,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(Te,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return y(kh,{size:16})}})}}),null),i})()};var Oh=M("<span>");const Us=({createdAt:e,anchor:t="end"})=>(()=>{var n=Oh();return gt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var _h=M('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const Ph=({children:e,createdAt:t})=>(()=>{var n=_h(),r=n.firstChild;return A(r,e),A(n,y(Us,{createdAt:t,anchor:"start"}),null),n})();var Ah=M("<span>");const Ot=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Na(Ka(n))),(()=>{var r=Ah();return r.innerHTML=n,tt(r,T({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Th=M('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Dh=({options:e,text:t})=>{let n;const{pushMessage:r}=Qe(),[o,i]=P(!1),s=(a,l)=>{i(!0),r(a,l)};return(()=>{var a=Th(),l=a.firstChild,c=l.firstChild;A(a,y(Ot,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?ir(d,c):n=c,A(c,y(ht,{each:e,children:u=>y(Te,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(u.label,u.value),get children(){return u.label?.trim()}})})),re(()=>gt(l,`flex items-center justify-center max-w-80 mx-[-1rem] ${o()&&"opacity-50"}`)),a})()};var Lh=M('<div class="flex flex-col"><span>'),Mh=M("<a target=_blank><img><span></span><span>");const Ih=({options:e,text:t})=>(()=>{var n=Lh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(ht,{each:e,children:o=>(()=>{var i=Mh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),re(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(i,"href",c.e=d),u!==c.t&&ue(s,"src",c.t=u),c},{e:void 0,t:void 0}),i})()}),null),n})();var Rh=M("<a target=_blank>");const $h=({url:e,text:t})=>(()=>{var n=Rh();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,js=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Fh=e=>{const t=T({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[C(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Hs=Fh,Yt=e=>typeof e=="function",Nh=["button","color","file","image","reset","submit"],Kh=(e,t)=>e==="button"?!0:e==="input"&&t?Nh.indexOf(t)!==-1:!1;function Bh(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>q(()=>{let a;return Yt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var eo=Bh,$n=new Map,Fn=(e,t)=>{if($n.has(e))return $n.get(e);const n=ce(t);return $n.set(e,n),n},to=e=>{const t=$n.get(e);if(t)return he(t)},Nn=new Map,zh=e=>{D(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=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?.()}})})},Vh=zh,Uh=e=>{const t=T({enabled:!0},e);D(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},jh=Uh,Hh=e=>{const t=T({enabled:!0},e);D(()=>{const{body:n}=document;G(t.enabled)&&Vh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},qh=Hh,Wh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);D(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),i=G(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Gh=Wh,Yh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);jh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Gh({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),qh({enabled:t.noOutsidePointerEvents})},Xh=Yh,no=ce(),Jh=e=>C(()=>{if(he(no))return y(qs,e);const r=Ae(),[o,i]=P([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(d=>d!==l))};return y(no.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(qs,e)}})}),qs=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(no),i=Ae();D(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Xh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=C(()=>n.children),l=()=>{const c=a();return Yt(c)?c({get isLastLayer(){return s()}}):c};return q(()=>l())},Zh=Jh,Qh=()=>{const[e,t]=P(!1);return D(()=>t(!0)),e},eg=Qh,tg=(e,t)=>(e&&(Yt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ro=(...e)=>e.some(t=>!!t()),ng=e=>(...t)=>{for(const n of e)n&&n(...t)},Kn=(...e)=>ng(e),le=e=>e?"":void 0,rg="div",og=e=>{const[t,n]=j(e,["as"]),r=C(()=>t.as??rg);return C(()=>{const i=r();switch(typeof i){case"function":return q(()=>i(n));case"string":return y(ln,T({component:i},n))}})},oo=og,ig=e=>{let t,n=!1;return()=>n?t:(n=!0,t=C(e))},Ws=ig,sg=e=>C(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),ag=sg,Gs="button",lg=e=>{const[t,n]=P(null),[r,o]=j(e,["as","ref","type"]),i=ag({element:t,fallback:Gs}),s=C(()=>Kh(i(),r.type));return y(oo,T({get as(){return r.as??Gs},ref(a){var l=Kn(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},cg=lg,ug='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',io="focusTrap.initialFocus",so="focusTrap.finalFocus",Ys={bubbles:!1,cancelable:!0},dg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=C(()=>{const f=n();return f?f[0]??null:null}),i=C(()=>{const f=n();return f?f[f.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))})};D(()=>{const f=J(t.element);if(f&&J(t.enabled)){s=document.activeElement,q(()=>{l(f),c(f)});const g=new MutationObserver(a);J(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),D(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),K(()=>{document.removeEventListener("keydown",h)}))}),D(()=>{const f=o();f&&(f.addEventListener("keydown",d),K(()=>{f.removeEventListener("keydown",d)}))}),D(()=>{const f=i();f&&(f.addEventListener("keydown",u),K(()=>{f.removeEventListener("keydown",u)}))});const l=f=>{const g=Array.from(f.querySelectorAll(ug)).map((p,b)=>({element:p,domIndex:b,tabIndex:p.tabIndex})).sort((p,b)=>p.tabIndex===b.tabIndex?p.domIndex-b.domIndex:p.tabIndex-b.tabIndex);r(g.map(({element:p})=>p))},c=f=>{Cr(()=>{const g=J(t.initialFocusElement)??o()??f,p=t.onInitialFocus;let b;p&&(b=new CustomEvent(io,Ys),f.addEventListener(io,p),f.dispatchEvent(b),f.removeEventListener(io,p)),b?.defaultPrevented!==!0&&g.focus()})},d=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},u=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},m=f=>{Cr(()=>{if(!J(t.restoreFocus))return;const p=J(t.finalFocusElement)??s;if(!p)return;let b;const v=t.onFinalFocus;v&&(b=new CustomEvent(so,Ys),f.addEventListener(so,v),f.dispatchEvent(b),f.removeEventListener(so,v)),b?.defaultPrevented!==!0&&p.focus()})}},fg=dg,hg=fg,gg=e=>{const t=C(()=>{const s=J(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=P(J(e.show)?"present":"hidden");let i="none";return D(s=>{const a=J(e.show);return q(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),D(()=>{const s=J(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const u=n().includes(c.animationName);c.target===s&&u&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),K(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},pg=gg,Xs=pg,mg=ce(),yg=e=>e?Fn(`dialog-${e}`):mg,Js=ce(),bg=e=>e?Fn(`dialog-internal-${e}`):Js,_t=e=>{if(!e){const n=he(Js);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=to(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},vg="div",wg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=C(()=>_t(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(Zh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,T({ref(l){var c=Kn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??vg},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return 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()}}))}})}})}})},xg=wg,Sg="div",Eg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=C(()=>_t(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,T({get as(){return t.as??Sg},ref(a){var l=Kn(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return 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()}}))}})})()}})},kg=Eg,Cg=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=C(()=>_t(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=eg(),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(qo,T(n,{get children(){return a()}}))}})})()}})},Og=Cg,ao=!0,_g=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??ao),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??ao),preventScroll:()=>!!(e.modal??ao),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ae()},e),[n,r]=eo({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Hs({value:()=>t.labelId??Ae()}),[a,l,c]=Hs({value:()=>t.descriptionId??Ae()}),[d,u]=P(null),[h,m]=P(null),[f,g]=P(null),{present:p}=Xs({show:n,element:h}),{present:b}=Xs({show:n,element:f});hg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Hi({element:h,enabled:()=>p()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const v={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return p()},get contentRef(){return h()},get overlayPresent(){return b()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Ws(()=>t.children),x=()=>{const k=w()();return Yt(k)?k(v):k};return C(()=>{const k=yg(t.contextId),E=bg(t.contextId);return y(k.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:p,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(E.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:p,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:g,triggerRef:d,setTriggerRef:u}},get children(){return q(()=>x())}})}})})},Pg=_g,Ag="button",Tg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=C(()=>_t(t.contextId));return y(cg,T({ref(i){var s=Kn(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Ag},onClick:i=>{!tg(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return 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))},Dg=Tg,Bn=e=>typeof e=="function"?e():e,Zs=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Lg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,i]=P(null);let s=null;D(()=>{const c=Bn(t.element),d=Bn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],h=Bn(t.dimension);h==="both"?s?s[0]!==u[0]&&s[1]!==u[1]&&(Ee(()=>{i(s),r(!0)}),Zs(()=>{i(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u:s?zn(h,s)!==zn(h,u)&&(Ee(()=>{i(zn(h,s)),r(!0)}),Zs(()=>{i(zn(h,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u},l=()=>{if(!n())return;const c=Bn(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Ee(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var zn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Mg=Lg,Ig=Mg;const Rg=(e,t)=>e.length>0?()=>e(q(t)):e;function $g(e,t){let n=0;const r=e.map((o,i)=>C(()=>(n=i,o()),void 0,cr));return C(()=>r.map(o=>o())[n],void 0,t)}function Qs(e,t,n){let r=()=>t;const[o,i]=P(t,cr),s=C(Rg(e,()=>r()),t,cr);return[r=$g([o,s],n),a=>i(()=>typeof a=="function"?a(q(r)):a)]}var Fg=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Ng=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Kg=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=Fg(o,t),u=d-l-r*c;(c!==0||u!==0)&&Ng(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},Bg=e=>y(Dg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),ea=ce(),zg=e=>e?Fn(`drawer-${e}`):ea,Vg=e=>{if(!e){const n=he(ea);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ta=ce(),Ug=e=>e?Fn(`drawer-internal-${e}`):ta,na=e=>{if(!e){const n=he(ta);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ra=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vn(e,t)};const o=r[n-1]?Vn(r[n-1],t):void 0,i=r[n]?Vn(r[n],t):void 0;return{value:e,offset:Vn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Vn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},jg=(e,t,n,r)=>{const o=oa("upper",e,r?n:t),i=oa("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},oa=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Hg=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},qg=void 0,Wg=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[qg],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,V)=>{const Q=F/V;return Q<1&&Q>-1?1:Q},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=eo({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=eo({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:d,transitionSize:u}=Ig({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,m]=P(!1),[f,g]=Qs(()=>d()?"resizing":null),p=C(()=>{const F=l()?.contentRef();if(F)return getComputedStyle(F)}),[b,v]=P(!1);D(()=>{const F=o();q(()=>{b()!==F&&(F?(v(!0),js(()=>{Ee(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(p().transitionDuration)===0&&g(null)})):(Ee(()=>{g("closing"),a(0)}),js(()=>{parseFloat(p().transitionDuration)===0&&w()})))})});const w=()=>{Ee(()=>{v(!1),g(null)})},[x,O]=P(0);D(()=>{const F=l()?.contentRef();if(!F)return;E(F);const V=new ResizeObserver(k);V.observe(F),K(()=>{V.disconnect()})});const k=F=>{for(const V of F)V.target===l()?.contentRef()&&E(V.target)},E=F=>{const V=q(()=>x());switch(n.side){case"top":case"bottom":if(V===F.offsetHeight)return;O(F.offsetHeight);break;case"left":case"right":if(V===F.offsetWidth)return;O(F.offsetWidth);break}},$=C(()=>ra(s(),x())),[_,R]=Qs(()=>$().offset),L=C(()=>x()?(x()-_())/x():0),I={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return L()},get translate(){return _()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},ne=Ws(()=>n.children),Y=F=>{c(_t(n.contextId));const V=ne()();if(Yt(V)){const Q=T(F,I);return V(Q)}return V};return C(()=>{const F=zg(n.contextId),V=Ug(n.contextId);return q(()=>y(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:L,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:L,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:$,drawerStyles:p,setTransitionState:g,transitionSize:u,closeDrawer:w}},get children(){return y(Pg,T({get open(){return b()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:Q=>Y(Q)}))}})}}))})},Gg=Wg,Yg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=C(()=>na(t.contextId)),c=C(()=>_t(t.contextId)),d=C(()=>l().snapPoints().map((w,x)=>ra(w,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)`}}),h=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),m=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});D(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",p),document.addEventListener("pointerup",v),document.addEventListener("touchend",v),K(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",p),document.removeEventListener("pointerup",v),document.removeEventListener("touchend",v)}))});const f=w=>{Hg(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[w.clientX,w.clientY]))},g=w=>{b(w.target,w.clientX,w.clientY)},p=w=>{w.touches[0]&&b(w.target,w.touches[0].clientX,w.touches[0].clientY)},b=(w,x,O)=>{if(!r)return;if(!l().isDragging()||o===null){const $=window.getSelection();if($&&$.toString().length>0){v();return}if(l().handleScrollableElements()){const _=[x,O].map((fe,F)=>i[F]-fe),R=Math.abs(_[0])>Math.abs(_[1])?"x":"y",L=R==="x"?_[0]:_[1];if(Math.abs(L)<.3)return;const I=c().contentRef(),[ne,Y]=Kg(w,R,I);if(L>0&&Math.abs(ne)>1||L<0&&Math.abs(Y)>0){v();return}}switch(l().side()){case"top":case"bottom":o=O;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Ee(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let k;switch(l().side()){case"top":k=-(o-O);break;case"bottom":k=o-O;break;case"right":k=o-x;break;case"left":k=-(o-x);break}k-=l().resolvedActiveSnapPoint().offset,k>0&&(k=l().dampFunction(k));const E=new Date;E.getTime()-s.getTime()>l().velocityCacheReset()&&(s=E,a=l().translate()),l().setTranslate(-k)},v=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-s.getTime()||1),O=l().translate()*x,k=jg(d(),l().translate(),O,l().allowSkippingSnapPoints());Ee(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Ee(()=>{l().setActiveSnapPoint(k.value),k.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(k.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(xg,T({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:m(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ee(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return 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))},Xg=Yg,Jg=e=>{const[t,n]=j(e,["contextId"]),r=C(()=>na(t.contextId));return y(kg,T({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))},Zg=Jg,Qg=M('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const ep=Gg,tp=Bg,np=Og,rp=e=>{const[,t]=j(e,["class"]),n=Vg();return y(Zg,T({get class(){return Ge("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},op=e=>{const[,t]=j(e,["class","children"]);return y(np,{get mount(){return Wn()},get children(){return[y(rp,{}),y(Xg,T({id:"smarttalks-list-content",get class(){return Ge("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[Qg(),C(()=>e.children)]}}))]}})};var ip=M('<span class="font-semibold mt-2">'),sp=M('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),ap=M('<div class="flex flex-col space-y-2"><div>'),lp=M('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),cp=M('<div class="flex flex-col items-start"><span class=text-slate-500>');const up=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qe(),[o,i]=P(!1),[s,a]=P(!1),[l,c]=P(),d=(h,m)=>{a(!1),i(!0),r(h,m)},u=h=>{const m=h.composedPath();for(const f of m)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=ap(),m=h.firstChild;return A(h,y(Ot,{get children(){return t?.trim()}}),m),A(m,y(ep,{get open(){return s()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(tp,{as:Te,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??dt("selectOption")}}),y(op,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=ip();return A(f,()=>n?.trim()??dt("selectOption")),f})(),(()=>{var f=sp();return A(f,y(ht,{each:e,children:g=>(()=>{var p=lp(),b=p.firstChild;return A(b,()=>g.label?.trim()??""),A(p,y(ht,{get each(){return g.items},children:v=>y(Te,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===v?"bg-slate-200":""}`},onClick:()=>c(v),get children(){return[(()=>{var w=cp(),x=w.firstChild;return A(w,()=>v.label?.trim(),x),A(x,()=>v.description?.trim()),w})(),y(Z,{get when(){return l()===v},get fallback(){return y(lf,{class:"size-4 text-slate-500"})},get children(){return y(af,{class:"size-4 text-slate-500"})}})]}})}),null),p})()})),f})(),y(Te,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return dt("send")}})]}})]}})),re(()=>gt(m,o()?"opacity-50":"")),h})()};var dp=M("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const fp=e=>(()=>{var t=dp(),n=t.firstChild,r=n.nextSibling;return re(o=>{var i=e.link,s=e.link;return i!==o.e&&ue(n,"src",o.e=i),s!==o.t&&ue(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var hp=M('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const gp=e=>(()=>{var t=hp(),n=t.firstChild,r=n.firstChild;return A(n,y(cf,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(()=>ue(n,"href",e.link)),t})();var pp=M('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const mp=e=>(()=>{var t=pp(),n=t.firstChild,r=n.firstChild;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ue(n,"href",o.e=i),s!==o.t&&ue(r,"src",o.t=s),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var yp=M('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const bp=e=>(()=>{var t=yp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(i=>{var s=e.link,a=e.link;return s!==i.e&&ue(r,"src",i.e=s),a!==i.t&&ue(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var vp=M("<div>Media type not supported");const ia=e=>e.type==="image"?y(mp,e):e.type==="audio"?y(fp,e):e.type==="document"?y(gp,e):e.type==="video"?y(bp,e):vp(),lo=({text:e})=>y(Ot,{get children(){return e?.trim()}});var wp=M("<div>Unknown bot message type");const xp=e=>y(Ph,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="buttons"?y(Dh,T(()=>e.buttons)):e.type==="list"?y(up,T(()=>e.list)):e.type==="media"?y(ia,T(()=>e.media)):e.type==="link"?y($h,T(()=>e.link)):e.type==="cards"?y(Ih,T(()=>e.cards)):e.type==="date"?y(lo,{get text(){return e.text}}):wp()}});var Sp=M('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Ep=e=>(()=>{var t=Sp(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var kp=M('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const Cp=({children:e,createdAt:t})=>(()=>{var n=kp(),r=n.firstChild;return A(r,e),A(n,y(Us,{createdAt:t,anchor:"end"}),null),n})();var Op=M("<div>Unknown user message type");const _p=e=>y(Cp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="media"?y(ia,T(()=>e.media)):Op()}});var Pp=M("<div>Unknown message origin");const Ap=e=>e.origin==="bot"?y(xp,e):e.origin==="user"?y(_p,e):e.origin==="service"?y(Ep,e):Pp();function Tp(e){return ve({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function Pt(e){return ve({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Dp=M('<div class="place-self-start py-1"><div class="animate-pulse bg-white flex space-x-1 shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl text-slate-400">');const Lp=()=>(()=>{var e=Dp(),t=e.firstChild;return A(t,y(Pt,{class:"size-2 animate-bounce"}),null),A(t,y(Pt,{class:"size-2 animate-bounce delay-150"}),null),A(t,y(Pt,{class:"size-2 animate-bounce delay-300"}),null),e})();var Mp=M('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),Ip=M("<div>");const co=()=>{let e;const{getMessages:t,onMessage:n,typing:r,clearMessages:o}=Qe(),{onOpen:i}=Xo(),s=(a=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},a)};return se("reset",()=>{o()}),tn(()=>{s(200)}),n(s),i(()=>s(200)),(()=>{var a=Mp(),l=e;return typeof l=="function"?ir(l,a):e=a,A(a,y(ht,{get each(){return t()},get fallback(){return(()=>{var c=Ip();return A(c,()=>dt("emptyMessages")),c})()},children:c=>y(Ap,c)}),null),A(a,y(Z,{get when(){return r()},get children(){return y(Lp,{})}}),null),a})()};var Rp=M("<textarea>");const $p=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Rp();return tt(n,T({get class(){return Ge("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var Fp=M('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const Np=e=>(()=>{var t=Fp();return tt(t,e,!0,!0),t})();var Kp=M('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Bp=()=>(()=>{var e=Kp(),t=e.firstChild;return A(e,y(Np,{height:15}),t),e})();var zp=M('<footer class="relative flex-none p-4 bg-white min-h-16 flex space-x-1 pb-6">');const uo=()=>{const{pushMessage:e}=Qe(),[t,n]=P(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return se("setInput",i=>{i&&n(i)}),(()=>{var i=zp();return A(i,y($p,{get placeholder(){return dt("inputPlaceholder")},get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),A(i,y(Te,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return y(gc,{size:24})}}),null),A(i,y(Bp,{}),null),i})()};var Vp=M('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Up=M("<span class=sr-only>Close"),jp=M("<div>"),Hp=M("<span class=sr-only>Open"),qp=M("<span>"),Wp=M('<div class="animate-pulse flex p-1">');const Gp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Xo(),{chatWidget:s}=oe(),[a,l]=P(!0);setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const c=()=>(s()?.style.margin??5)/4,d=()=>s()?.style.position==="left"?{left:`${c()}rem`}:{right:`${c()}rem`};return se("open",()=>{o()}),se("close",()=>{i()}),se("toggle",()=>{r()}),(()=>{var u=jp();return A(u,y(Z,{get when(){return n()},get children(){var h=Vp();return A(h,e),h}}),null),A(u,y(Z,{get when(){return n()},get fallback(){return y(Te,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,Hp(),y(Z,{get when(){return s()?.balloonMessage},get children(){var h=qp();return A(h,y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=Wp();return A(m,y(Pt,{class:"size-2 animate-bounce"}),null),A(m,y(Pt,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(Pt,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return s()?.balloonMessage}})),re(()=>gt(h,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(s()?.style.position==="left"?" left-9":" right-9"))),h}})]}})},get children(){return y(Te,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[y(Tp,{size:30}),Up()]}})}}),null),re(h=>{var m="max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(s()?.style.position==="left"?" items-start":" items-end"),f=d();return m!==h.e&>(u,h.e=m),h.t=an(u,f,h.t),h},{e:void 0,t:void 0}),u})()};var Yp=M('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Xp=({children:e})=>{const{chatWidget:t}=oe(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Yp();return an(r,n),A(r,e),r})()};var Jp=M('<div id=smarttalks-widget class="h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col">');const Zp=({children:e})=>{const{chatWidget:t}=oe(),[n,r]=P(!1),o=()=>(t()?.style.margin??5)/4,i=()=>{const s={};return t()?.fullscreen?(s.height="100%",s["max-height"]="100%",s.width="100%",s["max-width"]="100%",s.bottom=0,s.left=0):t()?.style.position&&(s[t()?.style.position||"right"]=`${o()}rem`),s};return se("open",()=>{r(!0),ee("onOpen")}),se("close",()=>{r(!1),ee("onClose")}),se("toggle",()=>{r(!n()),ee("onToggle")}),setTimeout(()=>{r(!0),ee("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var s=Jp();return A(s,e),re(a=>an(s,i(),a)),s}})};var Qp=M('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const fo=()=>(()=>{var e=Qp();return A(e,y(hc,{size:45,class:"animate-spin"})),e})(),em=()=>{const{chatWidget:e}=oe(),{loading:t}=Qe();return y(Gp,{get openIcon(){return y(ii,{get src(){return e()?.avatar}})},get children(){return[y(Z,{get when(){return t()},get children(){return y(fo,{})}}),y(Qr,{}),y(co,{}),y(uo,{})]}})},tm=()=>{const{loading:e}=Qe();return y(Zp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Qr,{}),y(co,{}),y(uo,{})]}})},nm=()=>{const{loading:e}=Qe();return y(Xp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Qr,{}),y(co,{}),y(uo,{})]}})},rm=()=>{const{chatWidget:e}=oe();return y(Bo,{get children(){return[y(It,{get when(){return e()?.mode==="standard"},get children(){return y(em,{})}}),y(It,{get when(){return e()?.mode==="popup"},get children(){return y(tm,{})}}),y(It,{get when(){return e()?.mode==="static"},get children(){return y(nm,{})}})]}})};var om=M("<div><div>Form");const im=()=>{const{formWidget:e}=oe();return(()=>{var t=om();return t.firstChild,A(t,()=>e()?._id,null),t})()};function sm(){const{widget:e}=oe();return y(Bo,{get children(){return[y(It,{get when(){return e()?.type==="chat"},get children(){return y(rm,{})}}),y(It,{get when(){return e()?.type==="form"},get children(){return y(im,{})}})]}})}var am=M("<style>"),lm=M("<div>");const cm=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:i}=oe(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=am();return A(a,zl),a})(),(()=>{var a=lm();return A(a,y(sm,{})),a})()]},um={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Bl("smarttalks-widget",um,cm)})(),Va()});
|
|
181
|
+
*/function Wd(e,t){return t?jc([e.clientX,e.clientY],t):!1}function Gd(e){const t=kt(),n=Fi(),r=hs(),o=Le({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=P(),[h,m]=P(),[f,g]=P(),[p,b]=P(),[v,w]=P(!0),[x,O]=P(s.placement),[k,E]=P([]),[$,_]=P([]),{DomCollectionProvider:R}=Vu({items:$,onItemsChange:_}),L=wi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),M=uu(()=>t.forceMount()||L.isOpen()),ne=Tu({selectionMode:"none",dataSource:$}),Y=U=>{w(U),L.open()},fe=(U=!1)=>{L.close(),U&&r&&r.close(!0)},F=U=>{w(U),L.toggle()},V=()=>{const U=p();U&&(de(U),ne.selectionManager().setFocused(!0),ne.selectionManager().setFocusedKey(void 0))},Z=U=>{E(ho=>[...ho,U]);const Vn=r?.registerNestedMenu(U);return()=>{E(ho=>ur(ho,U)),Vn?.()}},ie=U=>c===l?.side&&Wd(U,l?.area),Pt=U=>{ie(U)&&U.preventDefault()},Pe=U=>{ie(U)||V()},cm=U=>{ie(U)&&U.preventDefault()};au({isDisabled:()=>!(r==null&&L.isOpen()&&t.isModal()),targets:()=>[p(),...k()].filter(Boolean)}),D(()=>{const U=p();if(!U||!r)return;const Vn=r.registerNestedMenu(U);K(()=>{Vn()})});const um={dataset:C(()=>({"data-expanded":L.isOpen()?"":void 0,"data-closed":L.isOpen()?void 0:""})),isOpen:L.isOpen,contentPresence:M,nestedMenus:k,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:v,listState:()=>ne,parentMenuContext:()=>r,triggerRef:f,contentRef:p,triggerId:d,contentId:h,setTriggerRef:g,setContentRef:b,open:Y,close:fe,toggle:F,focusContent:V,onItemEnter:Pt,onItemLeave:Pe,onTriggerLeave:cm,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Z,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:mn(u),registerContentId:mn(m)};return y(R,{get children(){return y(fs.Provider,{value:um,get children(){return y(qd,T({anchorRef:f,contentRef:p,onCurrentPlacementChange:O},s))}})}})}const Yd=ce();function Xd(e){let t;const n=kt(),r=Et(),o=Le({id:n.generateId(`item-${Ae()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,d]=P(),[u,h]=P(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),p=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Uu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??u()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const b=Pu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),v=_=>{ge(_,i.onPointerMove),_.pointerType==="mouse"&&(i.disabled?r.onItemLeave(_):(r.onItemEnter(_),_.defaultPrevented||(de(_.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},w=_=>{ge(_,i.onPointerLeave),_.pointerType==="mouse"&&r.onItemLeave(_)},x=_=>{ge(_,i.onPointerUp),!i.disabled&&_.button===0&&p()},O=_=>{if(ge(_,i.onKeyDown),!_.repeat&&!i.disabled)switch(_.key){case"Enter":case" ":p();break}},k=C(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),E=C(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),$={isChecked:()=>i.checked,dataset:E,setLabelRef:h,generateId:ci(()=>s.id),registerLabel:mn(l),registerDescription:mn(d)};return y(Yd.Provider,{value:$,get children(){return y(yn,T({as:"div",ref(_){var R=ot(L=>t=L,i.ref);typeof R=="function"&&R(_)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return we([i.onPointerDown,b.onPointerDown])},get onPointerUp(){return we([x,b.onPointerUp])},get onClick(){return we([i.onClick,b.onClick])},get onKeyDown(){return we([O,b.onKeyDown])},get onMouseDown(){return we([i.onMouseDown,b.onMouseDown])},get onFocus(){return we([i.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:w},E,s))}})}const Jd=ce();function ps(){return he(Jd)}function Zd(e){let t;const n=kt(),r=Et(),o=ps(),i=Le({id:n.generateId(`content-${Ae()}`)},e),[s,a]=j(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Lu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);iu({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:p=>{o===void 0&&s.onOpenAutoFocus?.(p)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const u=p=>{if(De(p.currentTarget,p.target)&&(p.key==="Tab"&&r.isOpen()&&p.preventDefault(),o!==void 0&&p.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(p.key){case"ArrowRight":p.stopPropagation(),p.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(p.currentTarget.hasAttribute("data-closed"))break;p.stopPropagation(),p.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=p=>{s.onEscapeKeyDown?.(p),o?.setAutoFocusMenu(!1),r.close(!0)},m=p=>{s.onFocusOutside?.(p),n.isModal()&&p.preventDefault()},f=p=>{ge(p,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=p=>{if(ge(p,s.onPointerMove),p.pointerType!=="mouse")return;const b=p.target,v=l!==p.clientX;De(p.currentTarget,b)&&v&&(r.setPointerDir(p.clientX>l?"right":"left"),l=p.clientX)};return D(()=>K(r.registerContentId(s.id))),y(Q,{get when(){return r.contentPresence.isPresent()},get children(){return y(td,{get children(){return y(Qu,T({ref(p){var b=ot(v=>{r.setContentRef(v),r.contentPresence.setRef(v),t=v},s.ref);typeof b=="function"&&b(p)},role:"menu",get id(){return s.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return 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:h,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return we([s.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return we([s.onMouseDown,d.onMouseDown])},get onFocusIn(){return we([s.onFocusIn,d.onFocusIn])},get onFocusOut(){return we([s.onFocusOut,d.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Qd(e){let t;const n=kt(),r=Et(),[o,i]=j(e,["ref"]);return Hi({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Zd,T({ref(s){var a=ot(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function ef(e){return y(Xd,T({role:"menuitem",closeOnSelect:!0},e))}function tf(e){const t=Et();return y(Q,{get when(){return t.contentPresence.isPresent()},get children(){return y(qo,e)}})}function nf(e){const t=`menu-${Ae()}`,n=Le({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=wi({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ci(()=>r.id),value:()=>r.value};return y(gs.Provider,{value:s,get children(){return y(Gd,T({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function rf(e){const t=kt(),n=Et(),r=ps(),o=Le({id:t.generateId("trigger")},e),[i,s]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,D(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),D(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),D(()=>{n.isOpen()&&r.setValue(a)}),K(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{ge(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},d=f=>{ge(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},u=f=>{if(ge(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),Hc(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{ge(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{ge(f,i.onFocus),r!==void 0&&r.setValue(a)};return D(()=>K(n.registerTriggerId(i.id))),y(Ru,T({ref(f){var g=ot(n.setTriggerRef,i.ref);typeof g=="function"&&g(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return 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:h,onClick:d,onKeyDown:u,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function of(e){const t=kt(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(Qd,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||de(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function sf(e){const t=`dropdownmenu-${Ae()}`,n=Le({id:t},e);return y(nf,n)}function af(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function lf(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function cf(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const uf=e=>y(sf,T({gutter:4},e)),df=rf,ff=e=>{const[,t]=j(e,["class"]);return y(tf,{get mount(){return qn()},get children(){return y(of,T({get class(){return Ge("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},hf=e=>{const[,t]=j(e,["class"]);return y(ef,T({get class(){return Ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function gf(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function pf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function mf(e,t,n){const r=`${Xt}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function yf(e,t,n){if(!e||!t||!n)return;const r=`${Xt}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const $e=Object.create(null);$e.open="0",$e.close="1",$e.ping="2",$e.pong="3",$e.message="4",$e.upgrade="5",$e.noop="6";const On=Object.create(null);Object.keys($e).forEach(e=>{On[$e[e]]=e});const $r={type:"error",data:"parser error"},ms=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ys=typeof ArrayBuffer=="function",bs=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Fr=({type:e,data:t},n,r)=>ms&&t instanceof Blob?n?r(t):vs(t,r):ys&&(t instanceof ArrayBuffer||bs(t))?n?r(t):vs(new Blob([t]),r):r($e[e]+(t||"")),vs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function ws(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Nr;function bf(e,t){if(ms&&e.data instanceof Blob)return e.data.arrayBuffer().then(ws).then(t);if(ys&&(e.data instanceof ArrayBuffer||bs(e.data)))return t(ws(e.data));Fr(e,!1,n=>{Nr||(Nr=new TextEncoder),t(Nr.encode(n))})}const xs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<xs.length;e++)qt[xs.charCodeAt(e)]=e;const vf=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)i=qt[e.charCodeAt(r)],s=qt[e.charCodeAt(r+1)],a=qt[e.charCodeAt(r+2)],l=qt[e.charCodeAt(r+3)],d[o++]=i<<2|s>>4,d[o++]=(s&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},wf=typeof ArrayBuffer=="function",Kr=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ss(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xf(e.substring(1),t)}:On[n]?e.length>1?{type:On[n],data:e.substring(1)}:{type:On[n]}:$r},xf=(e,t)=>{if(wf){const n=vf(e);return Ss(n,t)}else return{base64:!0,data:e}},Ss=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Es="",Sf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Fr(i,!1,a=>{r[s]=a,++o===n&&t(r.join(Es))})})},Ef=(e,t)=>{const n=e.split(Es),r=[];for(let o=0;o<n.length;o++){const i=Kr(n[o],t);if(r.push(i),i.type==="error")break}return r};function kf(){return new TransformStream({transform(e,t){bf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Br;function _n(e){return e.reduce((t,n)=>t+n.length,0)}function Pn(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 Cf(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(_n(n)<1)break;const l=Pn(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(_n(n)<2)break;const l=Pn(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(_n(n)<8)break;const l=Pn(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(_n(n)<o)break;const l=Pn(n,o);a.enqueue(Kr(i?l:Br.decode(l),t)),r=0}if(o===0||o>e){a.enqueue($r);break}}}})}const ks=4;function te(e){if(e)return Of(e)}function Of(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 An=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Se=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_f="arraybuffer";function gm(){}function Cs(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Pf=Se.setTimeout,Af=Se.clearTimeout;function Tn(e,t){t.useNativeTimers?(e.setTimeoutFn=Pf.bind(Se),e.clearTimeoutFn=Af.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Tf=1.33;function Df(e){return typeof e=="string"?Lf(e):Math.ceil((e.byteLength||e.size)*Tf)}function Lf(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Os(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Mf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function If(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Rf extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class zr extends te{constructor(t){super(),this.writable=!1,Tn(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Rf(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Kr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Mf(t);return n.length?"?"+n:""}}class $f extends zr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Ef(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Sf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Os()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _s=!1;try{_s=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ff=_s;function Nf(){}class Kf extends $f{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Fe extends te{constructor(t,n,r){super(),this.createRequest=t,Tn(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=Cs(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=Fe.requestsCount++,Fe.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=Nf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Fe.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(Fe.requestsCount=0,Fe.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ps);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,Ps,!1)}}function Ps(){for(let e in Fe.requests)Fe.requests.hasOwnProperty(e)&&Fe.requests[e].abort()}const Bf=function(){const e=As({xdomain:!1});return e&&e.responseType!==null}();class zf extends Kf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Bf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Fe(As,this.uri(),t)}}function As(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ff))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ts=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vf extends zr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ts?{}:Cs(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;Fr(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&An(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Os()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Vr=Se.WebSocket||Se.MozWebSocket;class Uf extends Vf{createSocket(t,n,r){return Ts?new Vr(t,n,r):n?new Vr(t,n):new Vr(t)}doWrite(t,n){this.ws.send(n)}}class jf extends zr{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=Cf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=kf();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&&An(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Hf={websocket:Uf,webtransport:jf,polling:zf},qf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ur(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=qf.exec(e||""),i={},s=14;for(;s--;)i[Wf[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Gf(i,i.path),i.queryKey=Yf(i,i.query),i}function Gf(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Yf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const jr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Dn=[];jr&&addEventListener("offline",()=>{Dn.forEach(e=>e())},!1);class Ze extends te{constructor(t,n){if(super(),this.binaryType=_f,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ur(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=Ur(n.host).host);Tn(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=If(this.opts.query)),jr&&(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"})},Dn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ks,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=Df(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,An(()=>{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(),jr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Dn.indexOf(this._offlineEventListener);r!==-1&&Dn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=ks;class Xf extends Ze{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const h=new Error("probe error: "+u);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Jf=class extends Xf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Hf[o]).filter(o=>!!o)),super(t,r)}};function Zf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ur(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const Qf=typeof ArrayBuffer=="function",eh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ds=Object.prototype.toString,th=typeof Blob=="function"||typeof Blob<"u"&&Ds.call(Blob)==="[object BlobConstructor]",nh=typeof File=="function"||typeof File<"u"&&Ds.call(File)==="[object FileConstructor]";function Hr(e){return Qf&&(e instanceof ArrayBuffer||eh(e))||th&&e instanceof Blob||nh&&e instanceof File}function Ln(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ln(e[n]))return!0;return!1}if(Hr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ln(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ln(e[n]))return!0;return!1}function rh(e){const t=[],n=e.data,r=e;return r.data=qr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function qr(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]=qr(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]=qr(e[r],t));return n}return e}function oh(e,t){return e.data=Wr(e.data,t),delete e.attachments,e}function Wr(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]=Wr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Wr(e[n],t));return e}const ih=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],sh=5;var z;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(z||(z={}));class ah{constructor(t){this.replacer=t}encode(t){return(t.type===z.EVENT||t.type===z.ACK)&&Ln(t)?this.encodeAsBinary({type:t.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===z.BINARY_EVENT||t.type===z.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=rh(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ls(e){return Object.prototype.toString.call(e)==="[object Object]"}class Gr 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===z.BINARY_EVENT;r||n.type===z.BINARY_ACK?(n.type=r?z.EVENT:z.ACK,this.reconstructor=new lh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(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(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Gr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case z.CONNECT:return Ls(n);case z.DISCONNECT:return n===void 0;case z.CONNECT_ERROR:return typeof n=="string"||Ls(n);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&ih.indexOf(n[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class lh{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=oh(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ch=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Gr,Encoder:ah,get PacketType(){return z},protocol:sh},Symbol.toStringTag,{value:"Module"}));function _e(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const uh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ms extends 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=[_e(t,"open",this.onopen.bind(this)),_e(t,"packet",this.onpacket.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(uh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:z.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),s.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:z.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case z.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case z.EVENT:case z.BINARY_EVENT:this.onevent(t);break;case z.ACK:case z.BINARY_ACK:this.onack(t);break;case z.DISCONNECT:this.ondisconnect();break;case z.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:z.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:z.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ct(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}Ct.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},Ct.prototype.reset=function(){this.attempts=0},Ct.prototype.setMin=function(e){this.ms=e},Ct.prototype.setMax=function(e){this.max=e},Ct.prototype.setJitter=function(e){this.jitter=e};class Yr 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,Tn(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 Ct({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||ch;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Jf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=_e(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=_e(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(_e(t,"ping",this.onping.bind(this)),_e(t,"data",this.ondata.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(t,"close",this.onclose.bind(this)),_e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){An(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Ms(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Wt={};function Mn(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Zf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Wt[o]&&i in Wt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Yr(r,t):(Wt[o]||(Wt[o]=new Yr(r,t)),l=Wt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Mn,{Manager:Yr,Socket:Ms,io:Mn,connect:Mn});class lt{static instance;constructor(){}static init(t){return lt.instance||(lt.instance=Mn(za,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t}}),lt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),lt.instance}static on(t,n,r){lt.instance||this.init(n).on(t,r)}}const Is=1e3*60*60*24,[In,Rs]=ti("smarttalks-widget-messages",{},Is),$s=()=>{const{widgetId:e}=oe();return In[e()]??[]},dh=e=>{const{widgetId:t}=oe();Rs({...In,[t()]:[...In[t()]??[],e]})},fh=()=>{const{widgetId:e}=oe();Rs({...In,[e()]:[]})},[Fs,hh]=ti("smarttalks-widget-conversationinfo",{},Is),Ns=()=>{const{widgetId:e}=oe();return Fs[e()]??{}},Ks=e=>{const{widgetId:t}=oe();hh({...Fs,[t()]:e})},[gh,Xr]=P(!1),[ph,Bs]=P(!1),zs=[],Vs=()=>{zs.forEach(e=>e())},mh=e=>zs.push(e),Jr=e=>{const t=gf(e);if(dh(t),t.type==="media"){setTimeout(Vs,200);return}Vs()},yh=(e,t)=>{const{chatWidget:n,widgetId:r}=oe(),o=Ns();e.trim()&&(Jr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ee("onInput",e),lt.on("message",r(),i=>{(i.contactId!==o.contactId||i.interactionId!==o.interactionId)&&Ks({contactId:i.contactId,interactionId:i.interactionId});for(const s of i.messages)Jr(s),ee("onAnswer",s);Xr(!1),pf(i.debug)}),Xr(!0),mf(e,t,n()?._id).catch(i=>{console.error(i),Xr(!1)}))},bh=()=>{const{chatWidget:e}=oe(),t=Ns();Bs(!0),fh(),yf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ks({}),Bs(!1),vh()}),ee("onReset")},vh=()=>{const{chatWidget:e}=oe();if($s().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Jr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qe=()=>({getMessages:$s,pushMessage:yh,clearMessages:bh,onMessage:mh,typing:gh,loading:ph});var wh=I("<span>");const xh=()=>{const{clearMessages:e}=Qe();P(!1);const[t,n]=P(!1);return y(uf,{get open(){return t()},onOpenChange:n,get children(){return[y(df,{get children(){return y(Te,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(fc,{size:20})}})}}),y(ff,{get children(){return y(hf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(dc,{size:14}),(()=>{var r=wh();return A(r,()=>dt("restart")),r})()]}})}})]}})};function Sh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Eh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function kh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var Ch=I('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const Zr=()=>{const{chatWidget:e}=oe(),[t,n]=P(!1),r=()=>{try{const i=qn();i&&(t()?document.exitFullscreen().then(()=>n(!1)):i.requestFullscreen().then(()=>n(!0)))}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{e()?.mode==="popup"&&ee("close")};return se("toggleFullscreen",()=>{r()}),(()=>{var i=Ch(),s=i.firstChild;return A(i,y(cc,{}),s),A(s,y(Te,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return y(Q,{get when(){return t()},get fallback(){return y(Eh,{size:16})},get children(){return y(Sh,{size:16})}})}}),null),A(s,y(Q,{get when(){return e()?.showSettings},get children(){return y(xh,{})}}),null),A(s,y(Q,{get when(){return e()?.mode==="popup"},get children(){return y(Te,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return y(kh,{size:16})}})}}),null),i})()};var Oh=I("<span>");const Us=({createdAt:e,anchor:t="end"})=>(()=>{var n=Oh();return gt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var _h=I('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const Ph=({children:e,createdAt:t})=>(()=>{var n=_h(),r=n.firstChild;return A(r,e),A(n,y(Us,{createdAt:t,anchor:"start"}),null),n})();var Ah=I("<span>");const Ot=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Na(Ka(n))),(()=>{var r=Ah();return r.innerHTML=n,tt(r,T({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Th=I('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Dh=({options:e,text:t})=>{let n;const{pushMessage:r}=Qe(),[o,i]=P(!1),s=(a,l)=>{i(!0),r(a,l)};return(()=>{var a=Th(),l=a.firstChild,c=l.firstChild;A(a,y(Ot,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?or(d,c):n=c,A(c,y(ht,{each:e,children:u=>y(Te,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(u.label,u.value),get children(){return u.label?.trim()}})})),re(()=>gt(l,`flex items-center justify-center max-w-80 mx-[-1rem] ${o()&&"opacity-50"}`)),a})()};var Lh=I('<div class="flex flex-col"><span>'),Mh=I("<a target=_blank><img><span></span><span>");const Ih=({options:e,text:t})=>(()=>{var n=Lh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(ht,{each:e,children:o=>(()=>{var i=Mh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),re(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(i,"href",c.e=d),u!==c.t&&ue(s,"src",c.t=u),c},{e:void 0,t:void 0}),i})()}),null),n})();var Rh=I("<a target=_blank>");const $h=({url:e,text:t})=>(()=>{var n=Rh();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,js=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Fh=e=>{const t=T({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[C(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Hs=Fh,Gt=e=>typeof e=="function",Nh=["button","color","file","image","reset","submit"],Kh=(e,t)=>e==="button"?!0:e==="input"&&t?Nh.indexOf(t)!==-1:!1;function Bh(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>q(()=>{let a;return Gt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Qr=Bh,Rn=new Map,$n=(e,t)=>{if(Rn.has(e))return Rn.get(e);const n=ce(t);return Rn.set(e,n),n},eo=e=>{const t=Rn.get(e);if(t)return he(t)},Fn=new Map,zh=e=>{D(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Fn.get(e.key);o?o.activeCount++:Fn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=Fn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Fn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Vh=zh,Uh=e=>{const t=T({enabled:!0},e);D(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},jh=Uh,Hh=e=>{const t=T({enabled:!0},e);D(()=>{const{body:n}=document;G(t.enabled)&&Vh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},qh=Hh,Wh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);D(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),i=G(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Gh=Wh,Yh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);jh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Gh({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),qh({enabled:t.noOutsidePointerEvents})},Xh=Yh,to=ce(),Jh=e=>C(()=>{if(he(to))return y(qs,e);const r=Ae(),[o,i]=P([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(d=>d!==l))};return y(to.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(qs,e)}})}),qs=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(to),i=Ae();D(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Xh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=C(()=>n.children),l=()=>{const c=a();return Gt(c)?c({get isLastLayer(){return s()}}):c};return q(()=>l())},Zh=Jh,Qh=()=>{const[e,t]=P(!1);return D(()=>t(!0)),e},eg=Qh,tg=(e,t)=>(e&&(Gt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),no=(...e)=>e.some(t=>!!t()),ng=e=>(...t)=>{for(const n of e)n&&n(...t)},Nn=(...e)=>ng(e),le=e=>e?"":void 0,rg="div",og=e=>{const[t,n]=j(e,["as"]),r=C(()=>t.as??rg);return C(()=>{const i=r();switch(typeof i){case"function":return q(()=>i(n));case"string":return y(an,T({component:i},n))}})},ro=og,ig=e=>{let t,n=!1;return()=>n?t:(n=!0,t=C(e))},Ws=ig,sg=e=>C(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),ag=sg,Gs="button",lg=e=>{const[t,n]=P(null),[r,o]=j(e,["as","ref","type"]),i=ag({element:t,fallback:Gs}),s=C(()=>Kh(i(),r.type));return y(ro,T({get as(){return r.as??Gs},ref(a){var l=Nn(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},cg=lg,ug='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',oo="focusTrap.initialFocus",io="focusTrap.finalFocus",Ys={bubbles:!1,cancelable:!0},dg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=C(()=>{const f=n();return f?f[0]??null:null}),i=C(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{kr(()=>{l(J(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(J(t.element))})};D(()=>{const f=J(t.element);if(f&&J(t.enabled)){s=document.activeElement,q(()=>{l(f),c(f)});const g=new MutationObserver(a);J(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),D(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),K(()=>{document.removeEventListener("keydown",h)}))}),D(()=>{const f=o();f&&(f.addEventListener("keydown",d),K(()=>{f.removeEventListener("keydown",d)}))}),D(()=>{const f=i();f&&(f.addEventListener("keydown",u),K(()=>{f.removeEventListener("keydown",u)}))});const l=f=>{const g=Array.from(f.querySelectorAll(ug)).map((p,b)=>({element:p,domIndex:b,tabIndex:p.tabIndex})).sort((p,b)=>p.tabIndex===b.tabIndex?p.domIndex-b.domIndex:p.tabIndex-b.tabIndex);r(g.map(({element:p})=>p))},c=f=>{kr(()=>{const g=J(t.initialFocusElement)??o()??f,p=t.onInitialFocus;let b;p&&(b=new CustomEvent(oo,Ys),f.addEventListener(oo,p),f.dispatchEvent(b),f.removeEventListener(oo,p)),b?.defaultPrevented!==!0&&g.focus()})},d=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},u=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},m=f=>{kr(()=>{if(!J(t.restoreFocus))return;const p=J(t.finalFocusElement)??s;if(!p)return;let b;const v=t.onFinalFocus;v&&(b=new CustomEvent(io,Ys),f.addEventListener(io,v),f.dispatchEvent(b),f.removeEventListener(io,v)),b?.defaultPrevented!==!0&&p.focus()})}},fg=dg,hg=fg,gg=e=>{const t=C(()=>{const s=J(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=P(J(e.show)?"present":"hidden");let i="none";return D(s=>{const a=J(e.show);return q(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),D(()=>{const s=J(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const u=n().includes(c.animationName);c.target===s&&u&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),K(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},pg=gg,Xs=pg,mg=ce(),yg=e=>e?$n(`dialog-${e}`):mg,Js=ce(),bg=e=>e?$n(`dialog-internal-${e}`):Js,_t=e=>{if(!e){const n=he(Js);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=eo(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},vg="div",wg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().contentPresent),i=C(s=>s||o(),!1);return y(Q,{get when(){return i()},get children(){return y(Zh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=C(()=>t.children);return y(Q,{get when(){return o()},get children(){return y(ro,T({ref(l){var c=Nn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??vg},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return 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()}}))}})}})}})},xg=wg,Sg="div",Eg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().overlayPresent),i=C(s=>s||o(),!1);return y(Q,{get when(){return i()},get children(){return(()=>{const s=C(()=>t.children);return y(Q,{get when(){return o()},get children(){return y(ro,T({get as(){return t.as??Sg},ref(a){var l=Nn(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()}}))}})})()}})},kg=Eg,Cg=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=eg(),s=C(a=>a||o()&&i(),!1);return y(Q,{get when(){return s()},get children(){return(()=>{const a=C(()=>t.children);return y(Q,{get when(){return o()},get children(){return y(qo,T(n,{get children(){return a()}}))}})})()}})},Og=Cg,so=!0,_g=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??so),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??so),preventScroll:()=>!!(e.modal??so),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ae()},e),[n,r]=Qr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Hs({value:()=>t.labelId??Ae()}),[a,l,c]=Hs({value:()=>t.descriptionId??Ae()}),[d,u]=P(null),[h,m]=P(null),[f,g]=P(null),{present:p}=Xs({show:n,element:h}),{present:b}=Xs({show:n,element:f});hg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Hi({element:h,enabled:()=>p()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const v={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return p()},get contentRef(){return h()},get overlayPresent(){return b()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Ws(()=>t.children),x=()=>{const k=w()();return Gt(k)?k(v):k};return C(()=>{const k=yg(t.contextId),E=bg(t.contextId);return y(k.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:p,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(E.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:p,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:g,triggerRef:d,setTriggerRef:u}},get children(){return q(()=>x())}})}})})},Pg=_g,Ag="button",Tg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=C(()=>_t(t.contextId));return y(cg,T({ref(i){var s=Nn(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Ag},onClick:i=>{!tg(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return 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))},Dg=Tg,Kn=e=>typeof e=="function"?e():e,Zs=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Lg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,i]=P(null);let s=null;D(()=>{const c=Kn(t.element),d=Kn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],h=Kn(t.dimension);h==="both"?s?s[0]!==u[0]&&s[1]!==u[1]&&(Ee(()=>{i(s),r(!0)}),Zs(()=>{i(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u:s?Bn(h,s)!==Bn(h,u)&&(Ee(()=>{i(Bn(h,s)),r(!0)}),Zs(()=>{i(Bn(h,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u},l=()=>{if(!n())return;const c=Kn(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Ee(()=>{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]}},Mg=Lg,Ig=Mg;const Rg=(e,t)=>e.length>0?()=>e(q(t)):e;function $g(e,t){let n=0;const r=e.map((o,i)=>C(()=>(n=i,o()),void 0,lr));return C(()=>r.map(o=>o())[n],void 0,t)}function Qs(e,t,n){let r=()=>t;const[o,i]=P(t,lr),s=C(Rg(e,()=>r()),t,lr);return[r=$g([o,s],n),a=>i(()=>typeof a=="function"?a(q(r)):a)]}var Fg=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Ng=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Kg=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,d]=Fg(o,t),u=d-l-r*c;(c!==0||u!==0)&&Ng(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},Bg=e=>y(Dg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),ea=ce(),zg=e=>e?$n(`drawer-${e}`):ea,Vg=e=>{if(!e){const n=he(ea);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=eo(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ta=ce(),Ug=e=>e?$n(`drawer-internal-${e}`):ta,na=e=>{if(!e){const n=he(ta);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=eo(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ra=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:zn(e,t)};const o=r[n-1]?zn(r[n-1],t):void 0,i=r[n]?zn(r[n],t):void 0;return{value:e,offset:zn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},zn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},jg=(e,t,n,r)=>{const o=oa("upper",e,r?n:t),i=oa("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},oa=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Hg=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},qg=void 0,Wg=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[qg],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,V)=>{const Z=F/V;return Z<1&&Z>-1?1:Z},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]=Qr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Qr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:d,transitionSize:u}=Ig({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,m]=P(!1),[f,g]=Qs(()=>d()?"resizing":null),p=C(()=>{const F=l()?.contentRef();if(F)return getComputedStyle(F)}),[b,v]=P(!1);D(()=>{const F=o();q(()=>{b()!==F&&(F?(v(!0),js(()=>{Ee(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(p().transitionDuration)===0&&g(null)})):(Ee(()=>{g("closing"),a(0)}),js(()=>{parseFloat(p().transitionDuration)===0&&w()})))})});const w=()=>{Ee(()=>{v(!1),g(null)})},[x,O]=P(0);D(()=>{const F=l()?.contentRef();if(!F)return;E(F);const V=new ResizeObserver(k);V.observe(F),K(()=>{V.disconnect()})});const k=F=>{for(const V of F)V.target===l()?.contentRef()&&E(V.target)},E=F=>{const V=q(()=>x());switch(n.side){case"top":case"bottom":if(V===F.offsetHeight)return;O(F.offsetHeight);break;case"left":case"right":if(V===F.offsetWidth)return;O(F.offsetWidth);break}},$=C(()=>ra(s(),x())),[_,R]=Qs(()=>$().offset),L=C(()=>x()?(x()-_())/x():0),M={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return L()},get translate(){return _()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},ne=Ws(()=>n.children),Y=F=>{c(_t(n.contextId));const V=ne()();if(Gt(V)){const Z=T(F,M);return V(Z)}return V};return C(()=>{const F=zg(n.contextId),V=Ug(n.contextId);return q(()=>y(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:L,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:L,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:$,drawerStyles:p,setTransitionState:g,transitionSize:u,closeDrawer:w}},get children(){return y(Pg,T({get open(){return b()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:Z=>Y(Z)}))}})}}))})},Gg=Wg,Yg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=C(()=>na(t.contextId)),c=C(()=>_t(t.contextId)),d=C(()=>l().snapPoints().map((w,x)=>ra(w,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)`}}),h=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),m=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});D(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",p),document.addEventListener("pointerup",v),document.addEventListener("touchend",v),K(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",p),document.removeEventListener("pointerup",v),document.removeEventListener("touchend",v)}))});const f=w=>{Hg(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[w.clientX,w.clientY]))},g=w=>{b(w.target,w.clientX,w.clientY)},p=w=>{w.touches[0]&&b(w.target,w.touches[0].clientX,w.touches[0].clientY)},b=(w,x,O)=>{if(!r)return;if(!l().isDragging()||o===null){const $=window.getSelection();if($&&$.toString().length>0){v();return}if(l().handleScrollableElements()){const _=[x,O].map((fe,F)=>i[F]-fe),R=Math.abs(_[0])>Math.abs(_[1])?"x":"y",L=R==="x"?_[0]:_[1];if(Math.abs(L)<.3)return;const M=c().contentRef(),[ne,Y]=Kg(w,R,M);if(L>0&&Math.abs(ne)>1||L<0&&Math.abs(Y)>0){v();return}}switch(l().side()){case"top":case"bottom":o=O;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Ee(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let k;switch(l().side()){case"top":k=-(o-O);break;case"bottom":k=o-O;break;case"right":k=o-x;break;case"left":k=-(o-x);break}k-=l().resolvedActiveSnapPoint().offset,k>0&&(k=l().dampFunction(k));const E=new Date;E.getTime()-s.getTime()>l().velocityCacheReset()&&(s=E,a=l().translate()),l().setTranslate(-k)},v=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-s.getTime()||1),O=l().translate()*x,k=jg(d(),l().translate(),O,l().allowSkippingSnapPoints());Ee(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Ee(()=>{l().setActiveSnapPoint(k.value),k.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(k.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(xg,T({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:m(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ee(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return 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))},Xg=Yg,Jg=e=>{const[t,n]=j(e,["contextId"]),r=C(()=>na(t.contextId));return y(kg,T({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))},Zg=Jg,Qg=I('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const ep=Gg,tp=Bg,np=Og,rp=e=>{const[,t]=j(e,["class"]),n=Vg();return y(Zg,T({get class(){return Ge("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},op=e=>{const[,t]=j(e,["class","children"]);return y(np,{get mount(){return qn()},get children(){return[y(rp,{}),y(Xg,T({id:"smarttalks-list-content",get class(){return Ge("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[Qg(),C(()=>e.children)]}}))]}})};var ip=I('<span class="font-semibold mt-2">'),sp=I('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),ap=I('<div class="flex flex-col space-y-2"><div>'),lp=I('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),cp=I('<div class="flex flex-col items-start"><span class=text-slate-500>');const up=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qe(),[o,i]=P(!1),[s,a]=P(!1),[l,c]=P(),d=(h,m)=>{a(!1),i(!0),r(h,m)},u=h=>{const m=h.composedPath();for(const f of m)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=ap(),m=h.firstChild;return A(h,y(Ot,{get children(){return t?.trim()}}),m),A(m,y(ep,{get open(){return s()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(tp,{as:Te,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??dt("selectOption")}}),y(op,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=ip();return A(f,()=>n?.trim()??dt("selectOption")),f})(),(()=>{var f=sp();return A(f,y(ht,{each:e,children:g=>(()=>{var p=lp(),b=p.firstChild;return A(b,()=>g.label?.trim()??""),A(p,y(ht,{get each(){return g.items},children:v=>y(Te,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===v?"bg-slate-200":""}`},onClick:()=>c(v),get children(){return[(()=>{var w=cp(),x=w.firstChild;return A(w,()=>v.label?.trim(),x),A(x,()=>v.description?.trim()),w})(),y(Q,{get when(){return l()===v},get fallback(){return y(lf,{class:"size-4 text-slate-500"})},get children(){return y(af,{class:"size-4 text-slate-500"})}})]}})}),null),p})()})),f})(),y(Te,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return dt("send")}})]}})]}})),re(()=>gt(m,o()?"opacity-50":"")),h})()};var dp=I("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const fp=e=>(()=>{var t=dp(),n=t.firstChild,r=n.nextSibling;return re(o=>{var i=e.link,s=e.link;return i!==o.e&&ue(n,"src",o.e=i),s!==o.t&&ue(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var hp=I('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const gp=e=>(()=>{var t=hp(),n=t.firstChild,r=n.firstChild;return A(n,y(cf,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(()=>ue(n,"href",e.link)),t})();var pp=I('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const mp=e=>(()=>{var t=pp(),n=t.firstChild,r=n.firstChild;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ue(n,"href",o.e=i),s!==o.t&&ue(r,"src",o.t=s),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var yp=I('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const bp=e=>(()=>{var t=yp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),re(i=>{var s=e.link,a=e.link;return s!==i.e&&ue(r,"src",i.e=s),a!==i.t&&ue(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var vp=I("<div>Media type not supported");const ia=e=>e.type==="image"?y(mp,e):e.type==="audio"?y(fp,e):e.type==="document"?y(gp,e):e.type==="video"?y(bp,e):vp(),ao=({text:e})=>y(Ot,{get children(){return e?.trim()}});var wp=I("<div>Unknown bot message type");const xp=e=>y(Ph,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ao,{get text(){return e.text}}):e.type==="buttons"?y(Dh,T(()=>e.buttons)):e.type==="list"?y(up,T(()=>e.list)):e.type==="media"?y(ia,T(()=>e.media)):e.type==="link"?y($h,T(()=>e.link)):e.type==="cards"?y(Ih,T(()=>e.cards)):e.type==="date"?y(ao,{get text(){return e.text}}):wp()}});var Sp=I('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Ep=e=>(()=>{var t=Sp(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var kp=I('<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 Cp=({children:e,createdAt:t})=>(()=>{var n=kp(),r=n.firstChild;return A(r,e),A(n,y(Us,{createdAt:t,anchor:"end"}),null),n})();var Op=I("<div>Unknown user message type");const _p=e=>y(Cp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ao,{get text(){return e.text}}):e.type==="media"?y(ia,T(()=>e.media)):Op()}});var Pp=I("<div>Unknown message origin");const Ap=e=>e.origin==="bot"?y(xp,e):e.origin==="user"?y(_p,e):e.origin==="service"?y(Ep,e):Pp();function Tp(e){return ve({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function lo(e){return ve({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Dp=I('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),Lp=I("<div>");const co=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r}=Qe(),{onOpen:o}=Xo(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return se("reset",()=>{r()}),en(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=Dp(),a=e;return typeof a=="function"?or(a,s):e=s,A(s,y(ht,{get each(){return t()},get fallback(){return(()=>{var l=Lp();return A(l,()=>dt("emptyMessages")),l})()},children:l=>y(Ap,l)})),s})()};var Mp=I("<textarea>");const Ip=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Mp();return tt(n,T({get class(){return Ge("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var Rp=I('<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 $p=e=>(()=>{var t=Rp();return tt(t,e,!0,!0),t})();var Fp=I('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Np=()=>(()=>{var e=Fp(),t=e.firstChild;return A(e,y($p,{height:15}),t),e})();var Kp=I('<footer class="relative flex-none p-4 bg-white min-h-16 flex space-x-1 pb-6">');const uo=()=>{const{pushMessage:e}=Qe(),[t,n]=P(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return se("setInput",i=>{i&&n(i)}),(()=>{var i=Kp();return A(i,y(Ip,{get placeholder(){return dt("inputPlaceholder")},get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),A(i,y(Te,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return y(gc,{size:24})}}),null),A(i,y(Np,{}),null),i})()};var Bp=I('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),zp=I("<span class=sr-only>Close"),Vp=I("<div>"),Up=I("<span class=sr-only>Open"),jp=I("<span>"),Hp=I('<div class="animate-pulse flex p-1">');const qp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Xo(),{chatWidget:s}=oe(),[a,l]=P(!0);setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const c=()=>(s()?.style.margin??5)/4,d=()=>s()?.style.position==="left"?{left:`${c()}rem`}:{right:`${c()}rem`};return se("open",()=>{o()}),se("close",()=>{i()}),se("toggle",()=>{r()}),(()=>{var u=Vp();return A(u,y(Q,{get when(){return n()},get children(){var h=Bp();return A(h,e),h}}),null),A(u,y(Q,{get when(){return n()},get fallback(){return y(Te,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,Up(),y(Q,{get when(){return s()?.balloonMessage},get children(){var h=jp();return A(h,y(Q,{get when(){return!a()},get fallback(){return(()=>{var m=Hp();return A(m,y(lo,{class:"size-2 animate-bounce"}),null),A(m,y(lo,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(lo,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return s()?.balloonMessage}})),re(()=>gt(h,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(s()?.style.position==="left"?" left-9":" right-9"))),h}})]}})},get children(){return y(Te,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[y(Tp,{size:30}),zp()]}})}}),null),re(h=>{var m="max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(s()?.style.position==="left"?" items-start":" items-end"),f=d();return m!==h.e&>(u,h.e=m),h.t=sn(u,f,h.t),h},{e:void 0,t:void 0}),u})()};var Wp=I('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Gp=({children:e})=>{const{chatWidget:t}=oe(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Wp();return sn(r,n),A(r,e),r})()};var Yp=I('<div id=smarttalks-widget class="h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col">');const Xp=({children:e})=>{const{chatWidget:t}=oe(),[n,r]=P(!1),o=()=>(t()?.style.margin??5)/4,i=()=>{const s={};return t()?.fullscreen?(s.height="100%",s["max-height"]="100%",s.width="100%",s["max-width"]="100%",s.bottom=0,s.left=0):t()?.style.position&&(s[t()?.style.position||"right"]=`${o()}rem`),s};return se("open",()=>{r(!0),ee("onOpen")}),se("close",()=>{r(!1),ee("onClose")}),se("toggle",()=>{r(!n()),ee("onToggle")}),setTimeout(()=>{r(!0),ee("onOpen")},(t()?.openDelay||0)*1e3),y(Q,{get when(){return n()},get children(){var s=Yp();return A(s,e),re(a=>sn(s,i(),a)),s}})};var Jp=I('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const fo=()=>(()=>{var e=Jp();return A(e,y(hc,{size:45,class:"animate-spin"})),e})(),Zp=()=>{const{chatWidget:e}=oe(),{loading:t}=Qe();return y(qp,{get openIcon(){return y(ii,{get src(){return e()?.avatar}})},get children(){return[y(Q,{get when(){return t()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},Qp=()=>{const{loading:e}=Qe();return y(Xp,{get children(){return[y(Q,{get when(){return e()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},em=()=>{const{loading:e}=Qe();return y(Gp,{get children(){return[y(Q,{get when(){return e()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},tm=()=>{const{chatWidget:e}=oe();return y(Bo,{get children(){return[y(Mt,{get when(){return e()?.mode==="standard"},get children(){return y(Zp,{})}}),y(Mt,{get when(){return e()?.mode==="popup"},get children(){return y(Qp,{})}}),y(Mt,{get when(){return e()?.mode==="static"},get children(){return y(em,{})}})]}})};var nm=I("<div><div>Form");const rm=()=>{const{formWidget:e}=oe();return(()=>{var t=nm();return t.firstChild,A(t,()=>e()?._id,null),t})()};function om(){const{widget:e}=oe();return y(Bo,{get children(){return[y(Mt,{get when(){return e()?.type==="chat"},get children(){return y(tm,{})}}),y(Mt,{get when(){return e()?.type==="form"},get children(){return y(rm,{})}})]}})}var im=I("<style>"),sm=I("<div>");const am=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:i}=oe(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=im();return A(a,zl),a})(),(()=>{var a=sm();return A(a,y(om,{})),a})()]},lm={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Bl("smarttalks-widget",lm,am)})(),Va()});
|