@smarttalks.ai/widget 0.11.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(Tt){typeof define=="function"&&define.amd?define(Tt):Tt()})(function(){"use strict";function Tt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Tt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function po(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tt(e))&&(r&&(r+=" "),r+=t);return r}const jn="-",la=e=>{const t=ua(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(jn);return a[0]===""&&a.length!==1&&a.shift(),mo(a,t)||ca(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},mo=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?mo(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(jn);return t.validators.find(({validator:s})=>s(i))?.classGroupId},yo=/^\[(.+)\]$/,ca=e=>{if(yo.test(e)){const t=yo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ua=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return fa(Object.entries(e.classGroups),n).forEach(([i,s])=>{qn(s,r,i,t)}),r},qn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:bo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(da(o)){qn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{qn(s,bo(t,i),n,r)})})},bo=(e,t)=>{let n=e;return t.split(jn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},da=e=>e.isThemeGetter,fa=(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,ha=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},wo="!",ga=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,d=0,u;for(let m=0;m<a.length;m++){let b=a[m];if(c===0){if(b===o&&(r||a.slice(m,m+i)===t)){l.push(a.slice(d,m)),d=m+i;continue}if(b==="/"){u=m;continue}}b==="["?c++:b==="]"&&c--}const f=l.length===0?a:a.substring(d),g=f.startsWith(wo),h=g?f.substring(1):f,p=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},pa=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},ma=e=>({cache:ha(e.cacheSize),parseClassName:ga(e),...la(e)}),ya=/\s+/,ba=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(ya);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:g}=n(c);let h=!!g,p=r(h?f.substring(0,g):f);if(!p){if(!h){a=c+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=c+(a.length>0?" "+a:a);continue}h=!1}const m=pa(d).join(":"),b=u?m+wo:m,w=b+p;if(i.includes(w))continue;i.push(w);const v=o(p,h);for(let x=0;x<v.length;++x){const _=v[x];i.push(b+_)}a=c+(a.length>0?" "+a:a)}return a};function wa(){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 va(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,u)=>u(d),e());return n=ma(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=ba(l,n);return o(l,d),d}return function(){return i(wa.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},xo=/^\[(?:([a-z-]+):)?(.+)\]$/i,xa=/^\d+\/\d+$/,Sa=new Set(["px","full","screen"]),ka=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ea=/\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$/,Ca=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Oa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_a=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ut(e)||Sa.has(e)||xa.test(e),He=e=>dt(e,"length",Ra),ut=e=>!!e&&!Number.isNaN(Number(e)),Hn=e=>dt(e,"number",ut),Lt=e=>!!e&&Number.isInteger(Number(e)),Pa=e=>e.endsWith("%")&&ut(e.slice(0,-1)),N=e=>xo.test(e),We=e=>ka.test(e),Aa=new Set(["length","size","percentage"]),Ta=e=>dt(e,Aa,So),La=e=>dt(e,"position",So),Ma=new Set(["image","url"]),Da=e=>dt(e,Ma,$a),Ia=e=>dt(e,"",Fa),Mt=()=>!0,dt=(e,t,n)=>{const r=xo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ra=e=>Ea.test(e)&&!Ca.test(e),So=()=>!1,Fa=e=>Oa.test(e),$a=e=>_a.test(e),Na=va(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),i=X("borderRadius"),s=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),f=X("gap"),g=X("gradientColorStops"),h=X("gradientColorStopPositions"),p=X("inset"),m=X("margin"),b=X("opacity"),w=X("padding"),v=X("saturate"),x=X("scale"),_=X("sepia"),E=X("skew"),k=X("space"),F=X("translate"),P=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",N,t],I=()=>[N,t],re=()=>["",Ne,He],Y=()=>["auto",ut,N],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",N],At=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[ut,N];return{cacheSize:500,separator:":",theme:{colors:[Mt],spacing:[Ne,He],blur:["none","",We,N],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",We,N],borderSpacing:I(),borderWidth:re(),contrast:Ae(),grayscale:se(),hueRotate:Ae(),invert:se(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Pa,He],inset:M(),margin:M(),opacity:Ae(),padding:I(),saturate:Ae(),scale:Ae(),sepia:se(),skew:Ae(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":At()}],"break-before":[{"break-before":At()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...fe(),N]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Lt,N]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Lt,N]}],"grid-cols":[{"grid-cols":[Mt]}],"col-start-end":[{col:["auto",{span:["full",Lt,N]},N]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Mt]}],"row-start-end":[{row:["auto",{span:[Lt,N]},N]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[We]},We]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",We,He]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hn]}],"font-family":[{font:[Mt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",ut,Hn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ne,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ne,He]}],"underline-offset":[{"underline-offset":["auto",Ne,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),La]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ta]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Da]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Ne,N]}],"outline-w":[{outline:[Ne,He]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ne,He]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,Ia]}],"shadow-color":[{shadow:[Mt]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",We,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Ae()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Lt,N]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ne,He,Hn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Ge(...e){return Na(po(e))}function Ka(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",Xt(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Xt(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Xt(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Xt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Xt(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function za(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 Ba(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function Jt(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Va={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function ft(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Va[n][e]}const Zt="https://heimdall.smarttalks.ai/api",Ua="wss://heimdall.smarttalks.ai",ko="smarttalkswidget";function ee(e,...t){window.postMessage({from:ko,command:e,args:t})}function ne(e,t){window.addEventListener("message",n=>{n.data?.from===ko&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function ja(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ee("registerContactData",e)},open:e=>{ee("open"),e&&ee("setInput",e)},close:()=>{ee("close")},toggle:()=>{ee("toggle")},toggleFullscreen:()=>{ee("toggleFullscreen")},reset:()=>{ee("reset")},onOpen:e=>{ne("onOpen",e)},onClose:e=>{ne("onClose",e)},onToggle:e=>{ne("onToggle",e)},onReset:e=>{ne("onReset",e)},onInput:e=>{ne("onInput",e)},onAnswer:e=>{ne("onAnswer",e)},onLoad:e=>{ne("onLoad",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Co(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function qa(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Po(o.value)&&!Xa(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 Ha(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Po(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Ya(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Wa(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Ga(e,t){const n=qa(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?Oo(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&_o(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&_o(this,i.attribute,i.value,!!i.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function Oo(e){if(e)try{return JSON.parse(e)}catch{return e}}function _o(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Ya(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Po(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Xa(e){return Object.prototype.toString.call(e)==="[object Function]"}function Ja(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Wn;function Za(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=Ga(this,t);const o=Wa(this.props),i=this.Component,s=Wn;try{Wn=this,this.__initialized=!0,Ja(i)?new i(o,{element:this}):i(o,{element:this})}finally{Wn=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?Oo(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function Qa(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=Za(r,Ha(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const z={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Ao(this.context.count)},getNextContextId(){return Ao(this.context.count++)}};function Ao(e){const t=String(e),n=t.length-1;return z.context.id+(n?String.fromCharCode(96+n):"")+t}function el(e){z.context=e}const tl=!1,nl=(e,t)=>e===t,be=Symbol("solid-proxy"),To=typeof Proxy=="function",Gn=Symbol("solid-track"),Qt={equals:nl};let Lo=$o;const Ke=1,en=2,Mo={owned:null,cleanups:null,context:null,owner:null},Yn={};var q=null;let Xn=null,rl=null,W=null,ae=null,ze=null,tn=0;function Be(e,t){const n=W,r=q,o=e.length===0,i=t===void 0?r:t,s=o?Mo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>H(()=>Dt(s)));q=s,W=null;try{return Ve(a,!0)}finally{W=n,q=r}}function O(e,t){t=t?Object.assign({},Qt,t):Qt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Fo(n,o));return[Ro.bind(n),r]}function Do(e,t,n){const r=nn(e,t,!0,Ke);gt(r)}function oe(e,t,n){const r=nn(e,t,!1,Ke);gt(r)}function T(e,t,n){Lo=ul;const r=nn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),ze?ze.push(r):gt(r)}function C(e,t,n){n=n?Object.assign({},Qt,n):Qt;const r=nn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,gt(r),Ro.bind(r)}function ol(e){return e&&typeof e=="object"&&"then"in e}function il(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Yn,l=null,c=!1,d="initialValue"in i,u=typeof r=="function"&&C(r);const f=new Set,[g,h]=(i.storage||O)(i.initialValue),[p,m]=O(void 0),[b,w]=O(void 0,{equals:!1}),[v,x]=O(d?"ready":"unresolved");z.context&&(l=z.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:z.load&&z.has(l)&&(a=z.load(l)));function _(P,R,M,I){return s===P&&(s=null,I!==void 0&&(d=!0),(P===a||R===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(I,{value:R})),a=Yn,E(R,M)),R}function E(P,R){Ve(()=>{R===void 0&&h(()=>P),x(R!==void 0?"errored":d?"ready":"unresolved"),m(R);for(const M of f.keys())M.decrement();f.clear()},!1)}function k(){const P=al,R=g(),M=p();if(M!==void 0&&!s)throw M;return W&&W.user,R}function F(P=!0){if(P!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){_(s,H(g));return}const M=a!==Yn?a:H(()=>o(R,{value:g(),refetching:P}));return ol(M)?(s=M,"value"in M?(M.status==="success"?_(s,M.value,void 0,R):_(s,void 0,Qn(M.value),R),M):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),w()},!1),M.then(I=>_(M,I,void 0,R),I=>_(M,void 0,Qn(I),R)))):(_(s,M,void 0,R),M)}return Object.defineProperties(k,{state:{get:()=>v()},error:{get:()=>p()},loading:{get(){const P=v();return P==="pending"||P==="refreshing"}},latest:{get(){if(!d)return k();const P=p();if(P&&!s)throw P;return g()}}}),u?Do(()=>F(!1)):F(!1),[k,{refetch:F,mutate:h}]}function ke(e){return Ve(e,!1)}function H(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function tt(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i)return i=!1,s;const l=H(()=>t(a,o,s));return o=a,l}}function ht(e){T(()=>H(e))}function K(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Jn(){return W}function Io(){return q}function sl(e,t){const n=q,r=W;q=e,W=null;try{return Ve(t,!0)}catch(o){er(o)}finally{q=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:dl(n),defaultValue:e}}function he(e){let t;return q&&q.context&&(t=q.context[e.id])!==void 0?t:e.defaultValue}function Zn(e){const t=C(e),n=C(()=>tr(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let al;function Ro(){if(this.sources&&this.state)if(this.state===Ke)gt(this);else{const e=ae;ae=null,Ve(()=>on(this),!1),ae=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function Fo(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Xn&&Xn.running;s&&Xn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?ae.push(i):ze.push(i),i.observers&&No(i)),s||(i.state=Ke)}if(ae.length>1e6)throw ae=[],new Error},!1)),t}function gt(e){if(!e.fn)return;Dt(e);const t=tn;ll(e,e.value,t)}function ll(e,t,n){let r;const o=q,i=W;W=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Dt),e.owned=null),e.updatedAt=n+1,er(s)}finally{W=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Fo(e,r):e.value=r,e.updatedAt=n)}function nn(e,t,n,r=Ke,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==Mo&&(q.owned?q.owned.push(i):q.owned=[i]),i}function rn(e){if(e.state===0)return;if(e.state===en)return on(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<tn);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)gt(e);else if(e.state===en){const r=ae;ae=null,Ve(()=>on(e,t[0]),!1),ae=r}}function Ve(e,t){if(ae)return e();let n=!1;t||(ae=[]),ze?n=!0:ze=[],tn++;try{const r=e();return cl(n),r}catch(r){n||(ze=null),ae=null,er(r)}}function cl(e){if(ae&&($o(ae),ae=null),e)return;const t=ze;ze=null,t.length&&Ve(()=>Lo(t),!1)}function $o(e){for(let t=0;t<e.length;t++)rn(e[t])}function ul(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rn(r)}if(z.context){if(z.count){z.effects||(z.effects=[]),z.effects.push(...e.slice(0,n));return}el()}for(z.effects&&(z.done||!z.count)&&(e=[...z.effects,...e],n+=z.effects.length,delete z.effects),t=0;t<n;t++)rn(e[t])}function on(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Ke?r!==t&&(!r.updatedAt||r.updatedAt<tn)&&rn(r):o===en&&on(r,t)}}}function No(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=en,n.pure?ae.push(n):ze.push(n),n.observers&&No(n))}}function Dt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Qn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function er(e,t=q){throw Qn(e)}function tr(e){if(typeof e=="function"&&!e.length)return tr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=tr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function dl(e,t){return function(r){let o;return oe(()=>o=H(()=>(q.context={...q.context,[e]:r.value},Zn(()=>r.children))),void 0),o}}const fl=Symbol("fallback");function Ko(e){for(let t=0;t<e.length;t++)e[t]()}function hl(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return K(()=>Ko(i)),()=>{let l=e()||[],c=l.length,d,u;return l[Gn],H(()=>{let g,h,p,m,b,w,v,x,_;if(c===0)s!==0&&(Ko(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[fl],o[0]=Be(E=>(i[0]=E,n.fallback())),s=1);else if(s===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=Be(f);s=c}else{for(p=new Array(c),m=new Array(c),a&&(b=new Array(c)),w=0,v=Math.min(s,c);w<v&&r[w]===l[w];w++);for(v=s-1,x=c-1;v>=w&&x>=w&&r[v]===l[x];v--,x--)p[x]=o[v],m[x]=i[v],a&&(b[x]=a[v]);for(g=new Map,h=new Array(x+1),u=x;u>=w;u--)_=l[u],d=g.get(_),h[u]=d===void 0?-1:d,g.set(_,u);for(d=w;d<=v;d++)_=r[d],u=g.get(_),u!==void 0&&u!==-1?(p[u]=o[d],m[u]=i[d],a&&(b[u]=a[d]),u=h[u],g.set(_,u)):i[d]();for(u=w;u<c;u++)u in p?(o[u]=p[u],i[u]=m[u],a&&(a[u]=b[u],a[u](u))):o[u]=Be(f);o=o.slice(0,s=c),r=l.slice(0)}return o});function f(g){if(i[u]=g,a){const[h,p]=O(u);return a[u]=p,t(l[u],h)}return t(l[u])}}}function y(e,t){return H(()=>e(t||{}))}function sn(){return!0}const nr={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return t===be?!0:e.has(t)},set:sn,deleteProperty:sn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:sn,deleteProperty:sn}},ownKeys(e){return e.keys()}};function rr(e){return(e=typeof e=="function"?e():e)?e:{}}function gl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function L(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&be in a,e[s]=typeof a=="function"?(t=!0,C(a)):a}if(To&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=rr(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in rr(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(rr(e[a])));return[...new Set(s)]}},nr);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:gl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const f=n[d];f&&(u.get?f.push(u.get.bind(a)):u.value!==void 0&&f.push(()=>u.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(To&&be in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},nr));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},nr)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let pl=0;function Te(){return z.context?z.getNextContextId():`cl-${pl++}`}const zo=e=>`Stale read from <${e}>.`;function pt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return C(hl(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(o,i)=>!o==!i});return C(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?H(()=>i(t?o:()=>{if(!H(r))throw zo("Show");return n()})):i}return e.fallback},void 0,void 0)}function Bo(e){const t=Zn(()=>e.children),n=C(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,l=o[s],c=i,d=C(()=>c()?void 0:l.when,void 0,void 0),u=l.keyed?d:C(d,void 0,{equals:(f,g)=>!f==!g});i=()=>c()||(u()?[a,d,l]:void 0)}return i});return C(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?H(()=>a(s.keyed?i():()=>{if(H(n)()?.[0]!==o)throw zo("Match");return i()})):a},void 0,void 0)}function It(e){return e}const ml=["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"],yl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ml]),bl=new Set(["innerHTML","textContent","innerText","children"]),wl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),vl=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 xl(e,t){const n=vl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Sl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),kl=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"]),El={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Cl(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!c){c=new Map;let u=a;for(;u<i;)c.set(n[u],u++)}const d=c.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,f=1,g;for(;++u<o&&u<i&&!((g=c.get(t[u]))==null||g!==d+f);)f++;if(f>d-a){const h=t[s];for(;a<d;)e.insertBefore(n[a++],h)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Vo="_$DX_DELEGATE";function D(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function Ol(e,t=window.document){const n=t[Vo]||(t[Vo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Il))}}function ue(e,t,n){ot(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function _l(e,t,n,r){ot(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Pl(e,t,n){ot(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function nt(e,t){ot(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Al(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 Tl(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Uo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Uo(e,a,!0),n[a]=l)}return n}function an(e,t,n){if(!t)return n?ue(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function rt(e,t={},n,r){const o={};return r||oe(()=>o.children=Rt(e,t.children,o.children)),oe(()=>typeof t.ref=="function"&&or(t.ref,e)),oe(()=>Ll(e,t,n,!0,o,!0)),o}function or(e,t,n){return H(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Rt(e,t,r,n);oe(o=>Rt(e,t(),o,n),r)}function Ll(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=jo(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=jo(e,s,a,o[s],n,i,t)}}function Ml(e){let t,n;return!ot()||!(t=z.registry.get(n=Rl()))?e():(z.completed&&z.completed.add(t),z.registry.delete(n),t)}function ot(e){return!!z.context&&!z.done&&(!e||e.isConnected)}function Dl(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Uo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function jo(e,t,n,r,o,i,s){let a,l,c,d,u;if(t==="style")return an(e,n,r);if(t==="classList")return Tl(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),g=Sl.has(f);if(!g&&r){const h=Array.isArray(r)?r[0]:r;e.removeEventListener(f,h)}(g||n)&&(Al(e,f,n,g),g&&Ol([f]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Pl(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=bl.has(t))||!o&&((d=xl(t,e.tagName))||(l=yl.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(u)t=t.slice(5),l=!0;else if(ot(e))return n;t==="class"||t==="className"?nt(e,n):a&&!l&&!c?e[Dl(t)]=n:e[d||t]=n}else{const f=o&&t.indexOf(":")>-1&&El[t.split(":")[0]];f?_l(e,f,t,n):ue(e,wl[t]||t,n)}return n}function Il(e){if(z.registry&&z.events&&z.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),z.registry&&!z.done&&(z.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Rt(e,t,n,r,o){const i=ot(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=mt(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=mt(e,n,r)}else{if(s==="function")return oe(()=>{let l=t();for(;typeof l=="function";)l=l();n=Rt(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(ir(l,t,n,o))return oe(()=>n=Rt(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const u=[d];for(;(d=d.nextSibling)!==r;)u.push(d);return n=u}if(l.length===0){if(n=mt(e,n,r),a)return n}else c?n.length===0?qo(e,l,r):Cl(e,n,l):(n&&mt(e),qo(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=mt(e,n,r,t);mt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ir(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=ir(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=ir(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function qo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function mt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Rl(){return z.getNextContextId()}const Fl=!1,$l="http://www.w3.org/2000/svg";function Ho(e,t=!1){return t?document.createElementNS($l,e):document.createElement(e)}function Wo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Io();let i,s=!!z.context;return T(()=>{s&&(Io().user=s=!1),i||(i=sl(o,()=>C(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=O(!1),d=()=>c(!0);Be(u=>A(a,()=>l()?u():i(),null)),K(d)}else{const l=Ho(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Nl(e,t){const n=C(e);return C(()=>{const r=n();switch(typeof r){case"function":return H(()=>r(t));case"string":const o=kl.has(r),i=z.context?Ml():Ho(r,o);return rt(i,t,o),i}})}function ln(e){const[,t]=j(e,["component"]);return Nl(()=>e.component,t)}function Kl(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=O(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function zl(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 Bl(e){return(t,n)=>{const{element:r}=n;return Be(o=>{const i=Kl(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},zl(r))}}function Vl(e,t,n){return arguments.length===2&&(n=t,t={}),Qa(e,t)(Bl(n))}const Ul='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.top-0{top:0}.z-20{z-index:20}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.box-border{box-sizing:border-box}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-full{width:100%;height:100%}.h-10{height:40px}.h-11{height:44px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[44px\\]{height:44px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[44px\\]{min-height:44px}.w-11\\/12{width:91.666667%}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[44px\\]{width:44px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-t{border-top-width:1px}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-6{padding-top:24px;padding-bottom:24px}.pb-2{padding-bottom:8px}.pb-\\[\\.\\.\\.\\]{padding-bottom:...}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}#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: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media (max-width: 640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:bottom-5{bottom:20px}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Go,sr]=O(!1),Yo=[],jl=e=>Yo.push(e),Xo=()=>{Yo.forEach(e=>e())},ql=()=>{const e=!Go();sr(e),ee("onToggle"),ee(e?"onOpen":"onClose"),Xo()},Hl=()=>{sr(!1),ee("onClose")},Wl=()=>{sr(!0),ee("onOpen"),Xo()},Jo=()=>({bubble:Go,show:Wl,hide:Hl,toggle:ql,onOpen:jl}),ar=Symbol("store-raw"),yt=Symbol("store-node"),Ue=Symbol("store-has"),Zo=Symbol("store-self");function Qo(e){let t=e[be];if(!t&&(Object.defineProperty(e,be,{value:t=new Proxy(e,Xl)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function cn(e){let t;return e!=null&&typeof e=="object"&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ft(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ar])return n;if(!cn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=Ft(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=Ft(o,t))!==o&&(e[i]=r))}return e}function un(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function $t(e,t,n){if(e[t])return e[t];const[r,o]=O(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Gl(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===be||t===yt||(delete n.value,delete n.writable,n.get=()=>e[be][t]),n}function ei(e){Jn()&&$t(un(e,yt),Zo)()}function Yl(e){return ei(e),Reflect.ownKeys(e)}const Xl={get(e,t,n){if(t===ar)return e;if(t===be)return n;if(t===Gn)return ei(e),n;const r=un(e,yt),o=r[t];let i=o?o():e[t];if(t===yt||t===Ue||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Jn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=$t(r,t,i)())}return cn(i)?Qo(i):i},has(e,t){return t===ar||t===be||t===Gn||t===yt||t===Ue||t==="__proto__"?!0:(Jn()&&$t(un(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Yl,getOwnPropertyDescriptor:Gl};function dn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Ue]&&e[Ue][t]&&o!==void 0&&e[Ue][t].$()):(e[t]=n,e[Ue]&&e[Ue][t]&&o===void 0&&e[Ue][t].$());let s=un(e,yt),a;if((a=$t(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=$t(s,"length",i))&&a.$(e.length)}(a=s[Zo])&&a.$()}function ti(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];dn(e,o,t[o])}}function Jl(e,t){if(typeof t=="function"&&(t=t(e)),t=Ft(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&dn(e,n,o)}dn(e,"length",r)}else ti(e,t)}function Nt(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Nt(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Nt(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:d=1}=r;for(let u=l;u<=c;u+=d)Nt(e,[u].concat(t),n);return}else if(t.length>1){Nt(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Ft(i),r===void 0||cn(o)&&cn(i)&&!Array.isArray(i)?ti(o,i):dn(e,r,i))}function Zl(...[e,t]){const n=Ft(e||{}),r=Array.isArray(n),o=Qo(n);function i(...s){ke(()=>{r&&s.length===1?Jl(n,s[0]):Nt(n,s)})}return[o,i]}function ni(e,t,n){return Be(()=>{const r=Co(e),[o,i]=Zl(r?JSON.parse(r):t);return T(()=>Eo(e,JSON.stringify(o),n)),[o,i]})}function Ql(e,t,n){return Be(()=>{const r=Co(e),[o,i]=O(r?JSON.parse(r):t);return T(()=>Eo(e,JSON.stringify(o()),n)),[o,i]})}const[gm,pm]=Ql("lang","en");function ec(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 tc(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 nc=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Zt}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return ec(i);if(i.type==="entity")return tc(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return ne("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Zt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),i._id=n,i},[ri,rc]=O(""),[it]=Be(()=>il(ri,nc)),oc=()=>{if(it()?.type==="chat")return it()},ic=()=>{if(it()?.type==="form")return it()},lr=()=>{const e=it();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Be(()=>T(()=>{const e=it();Ka(e),e&&(ee("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const ie=()=>({widgetId:ri,setWidgetId:rc,widget:it,chatWidget:oc,formWidget:ic,getSessionId:lr}),oi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ii=po,sc=(e,t)=>n=>{var r;if(t?.variants==null)return ii(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=n?.[c],u=i?.[c];if(d===null)return null;const f=oi(d)||oi(u);return o[c][f]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,f]=d;return f===void 0||(c[u]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:f,...g}=d;return Object.entries(g).every(h=>{let[p,m]=h;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...c,u,f]:c},[]);return ii(e,s,l,n?.class,n?.className)};var ac=D("<button>");const lc=sc("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Ee=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=ac();return rt(n,L({get class(){return Ge(lc({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var cc=D('<img alt="widget logo">');const si=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=cc();return rt(n,L({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var uc=D('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const dc=()=>{const{chatWidget:e}=ie(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=uc(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return A(r,y(si,{get src(){return e()?.avatar}}),o),A(i,t),A(s,n),r})()};var fc=D("<svg stroke-width=0>");function we(e,t){const n=L(e.a,t),[r,o]=j(n,["src"]),[i,s]=O(""),a=C(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return T(()=>s(a())),K(()=>{s("")}),(()=>{var l=fc();return rt(l,L({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),A(l,()=>Fl),l})()}function hc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function gc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function pc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function mc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const cr={equals:!1};function ai(e){return(...t)=>{for(const n of e)n&&n(...t)}}function yc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,li=e=>Array.isArray(e)?e:e?[e]:[];function bc(e,...t){return typeof e=="function"?e(...t):e}const wc=K;function vc(e,t,n,r){return e.addEventListener(t,n,r),wc(e.removeEventListener.bind(e,t,n,r))}function xc(e,t,n,r){const o=()=>{li(S(e)).forEach(i=>{i&&li(S(t)).forEach(s=>vc(i,s,n,r))})};typeof e=="function"?T(o):oe(o)}function fn(){return!0}const Sc={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()}},kc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ci(e){const t={};let n;for(;n=kc.exec(e);)t[n[1]]=n[2];return t}function Ec(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ci(e)}else typeof t=="string"&&(t=ci(t));return{...e,...t}}const ur=(e,t,n)=>{let r;for(const o of e){const i=S(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Cc(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?yc:ai,o={};for(const s of n){const a=S(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const i=L(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ur(n,"style",Ec);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)}},Sc)}function st(...e){return ai(e)}function Oc(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 _c(e){return typeof e=="number"}function Pc(e){return Array.isArray(e)}function bt(e){return Object.prototype.toString.call(e)==="[object String]"}function Ac(e){return typeof e=="function"}function ui(e){return t=>`${e()}-${t}`}function Le(e,t){return e?e===t||e.contains(t):!1}function Kt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(di(n)&&n.contentDocument)return Kt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function di(e){return e.tagName==="IFRAME"}var fi=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(fi||{});function fr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function hn(){return fr(/^Mac/i)}function Tc(){return fr(/^iPhone/i)}function Lc(){return fr(/^iPad/i)||hn()&&navigator.maxTouchPoints>1}function Mc(){return Tc()||Lc()}function Dc(){return hn()||Mc()}function ge(e,t){return t&&(Ac(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ve(e){return t=>{for(const n of e)ge(t,n)}}function Ic(e){return hn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Rc())e.focus({preventScroll:!0});else{const t=Fc(e);e.focus(),$c(t)}}var gn=null;function Rc(){if(gn==null){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch{}}return gn}function Fc(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 $c(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var hi=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Nc=[...hi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],hr=`${hi.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Kc=Nc.join(':not([hidden]):not([tabindex="-1"]),');function gi(e,t){const r=Array.from(e.querySelectorAll(hr)).filter(pi);return t&&pi(e)&&r.unshift(e),r.forEach((o,i)=>{if(di(o)&&o.contentDocument){const s=o.contentDocument.body,a=gi(s,!1);r.splice(i,1,...a)}}),r}function pi(e){return mi(e)&&!zc(e)}function mi(e){return e.matches(hr)&&gr(e)}function zc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function gr(e,t){return e.nodeName!=="#comment"&&Bc(e)&&Vc(e,t)&&(!e.parentElement||gr(e.parentElement,e))}function Bc(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 Vc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Uc(e,t,n){const r=t?.tabbable?Kc:hr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&gr(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function yi(e){let t=e;for(;t&&!jc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function jc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function qc(){}function Hc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,d]=t[a],[u,f]=t[l],[,g]=t[l===0?s-1:l-1]||[0,0],h=(d-f)*(n-c)-(c-u)*(r-d);if(f<d){if(r>=f&&r<d){if(h===0)return!0;h>0&&(r===f?r>g&&(o=!o):o=!o)}}else if(d<f){if(r>d&&r<=f){if(h===0)return!0;h<0&&(r===f?r<g&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function Me(e,t){return L(e,t)}var zt=new Map,bi=new Set;function wi(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=zt.get(n.target);r||(r=new Set,zt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=zt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),zt.delete(n.target)),zt.size===0)){for(const o of bi)o();bi.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?wi():document.addEventListener("DOMContentLoaded",wi));function pr(e,t){const n=vi(e,t,"left"),r=vi(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function vi(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Wc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=yi(e);for(;e&&o&&e!==n&&o!==n;)pr(o,e),e=o,o=yi(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Gc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function mr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=bt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=bt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(bt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return bt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(bt(l)||_c(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(Tt){typeof define=="function"&&define.amd?define(Tt):Tt()})(function(){"use strict";function Tt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Tt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function po(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tt(e))&&(r&&(r+=" "),r+=t);return r}const jn="-",la=e=>{const t=ua(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(jn);return a[0]===""&&a.length!==1&&a.shift(),mo(a,t)||ca(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},mo=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?mo(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(jn);return t.validators.find(({validator:s})=>s(i))?.classGroupId},yo=/^\[(.+)\]$/,ca=e=>{if(yo.test(e)){const t=yo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ua=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return fa(Object.entries(e.classGroups),n).forEach(([i,s])=>{qn(s,r,i,t)}),r},qn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:bo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(da(o)){qn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{qn(s,bo(t,i),n,r)})})},bo=(e,t)=>{let n=e;return t.split(jn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},da=e=>e.isThemeGetter,fa=(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,ha=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},wo="!",ga=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,d=0,u;for(let m=0;m<a.length;m++){let b=a[m];if(c===0){if(b===o&&(r||a.slice(m,m+i)===t)){l.push(a.slice(d,m)),d=m+i;continue}if(b==="/"){u=m;continue}}b==="["?c++:b==="]"&&c--}const f=l.length===0?a:a.substring(d),g=f.startsWith(wo),h=g?f.substring(1):f,p=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},pa=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},ma=e=>({cache:ha(e.cacheSize),parseClassName:ga(e),...la(e)}),ya=/\s+/,ba=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(ya);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:g}=n(c);let h=!!g,p=r(h?f.substring(0,g):f);if(!p){if(!h){a=c+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=c+(a.length>0?" "+a:a);continue}h=!1}const m=pa(d).join(":"),b=u?m+wo:m,w=b+p;if(i.includes(w))continue;i.push(w);const v=o(p,h);for(let x=0;x<v.length;++x){const _=v[x];i.push(b+_)}a=c+(a.length>0?" "+a:a)}return a};function wa(){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 va(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,u)=>u(d),e());return n=ma(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=ba(l,n);return o(l,d),d}return function(){return i(wa.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},xo=/^\[(?:([a-z-]+):)?(.+)\]$/i,xa=/^\d+\/\d+$/,Sa=new Set(["px","full","screen"]),ka=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ea=/\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$/,Ca=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Oa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_a=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ut(e)||Sa.has(e)||xa.test(e),He=e=>dt(e,"length",Ra),ut=e=>!!e&&!Number.isNaN(Number(e)),Hn=e=>dt(e,"number",ut),Lt=e=>!!e&&Number.isInteger(Number(e)),Pa=e=>e.endsWith("%")&&ut(e.slice(0,-1)),N=e=>xo.test(e),We=e=>ka.test(e),Aa=new Set(["length","size","percentage"]),Ta=e=>dt(e,Aa,So),La=e=>dt(e,"position",So),Ma=new Set(["image","url"]),Da=e=>dt(e,Ma,$a),Ia=e=>dt(e,"",Fa),Mt=()=>!0,dt=(e,t,n)=>{const r=xo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ra=e=>Ea.test(e)&&!Ca.test(e),So=()=>!1,Fa=e=>Oa.test(e),$a=e=>_a.test(e),Na=va(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),i=X("borderRadius"),s=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),f=X("gap"),g=X("gradientColorStops"),h=X("gradientColorStopPositions"),p=X("inset"),m=X("margin"),b=X("opacity"),w=X("padding"),v=X("saturate"),x=X("scale"),_=X("sepia"),E=X("skew"),k=X("space"),F=X("translate"),P=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",N,t],I=()=>[N,t],re=()=>["",Ne,He],Y=()=>["auto",ut,N],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",N],At=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[ut,N];return{cacheSize:500,separator:":",theme:{colors:[Mt],spacing:[Ne,He],blur:["none","",We,N],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",We,N],borderSpacing:I(),borderWidth:re(),contrast:Ae(),grayscale:se(),hueRotate:Ae(),invert:se(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Pa,He],inset:M(),margin:M(),opacity:Ae(),padding:I(),saturate:Ae(),scale:Ae(),sepia:se(),skew:Ae(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":At()}],"break-before":[{"break-before":At()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...fe(),N]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Lt,N]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Lt,N]}],"grid-cols":[{"grid-cols":[Mt]}],"col-start-end":[{col:["auto",{span:["full",Lt,N]},N]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Mt]}],"row-start-end":[{row:["auto",{span:[Lt,N]},N]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[We]},We]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",We,He]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hn]}],"font-family":[{font:[Mt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",ut,Hn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ne,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ne,He]}],"underline-offset":[{"underline-offset":["auto",Ne,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),La]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ta]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Da]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Ne,N]}],"outline-w":[{outline:[Ne,He]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ne,He]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,Ia]}],"shadow-color":[{shadow:[Mt]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",We,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Ae()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Lt,N]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ne,He,Hn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Ge(...e){return Na(po(e))}function Ka(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",Xt(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Xt(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Xt(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Xt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Xt(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function za(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 Ba(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function Jt(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Va={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function ft(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Va[n][e]}const Zt="https://heimdall.smarttalks.ai/api",Ua="wss://heimdall.smarttalks.ai",ko="smarttalkswidget";function ee(e,...t){window.postMessage({from:ko,command:e,args:t})}function ne(e,t){window.addEventListener("message",n=>{n.data?.from===ko&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function ja(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ee("registerContactData",e)},open:e=>{ee("open"),e&&ee("setInput",e)},close:()=>{ee("close")},toggle:()=>{ee("toggle")},toggleFullscreen:()=>{ee("toggleFullscreen")},reset:()=>{ee("reset")},onOpen:e=>{ne("onOpen",e)},onClose:e=>{ne("onClose",e)},onToggle:e=>{ne("onToggle",e)},onReset:e=>{ne("onReset",e)},onInput:e=>{ne("onInput",e)},onAnswer:e=>{ne("onAnswer",e)},onLoad:e=>{ne("onLoad",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Co(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function qa(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Po(o.value)&&!Xa(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 Ha(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Po(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Ya(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Wa(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Ga(e,t){const n=qa(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?Oo(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&_o(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&_o(this,i.attribute,i.value,!!i.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function Oo(e){if(e)try{return JSON.parse(e)}catch{return e}}function _o(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Ya(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Po(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Xa(e){return Object.prototype.toString.call(e)==="[object Function]"}function Ja(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Wn;function Za(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=Ga(this,t);const o=Wa(this.props),i=this.Component,s=Wn;try{Wn=this,this.__initialized=!0,Ja(i)?new i(o,{element:this}):i(o,{element:this})}finally{Wn=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?Oo(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function Qa(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=Za(r,Ha(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const z={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Ao(this.context.count)},getNextContextId(){return Ao(this.context.count++)}};function Ao(e){const t=String(e),n=t.length-1;return z.context.id+(n?String.fromCharCode(96+n):"")+t}function el(e){z.context=e}const tl=!1,nl=(e,t)=>e===t,be=Symbol("solid-proxy"),To=typeof Proxy=="function",Gn=Symbol("solid-track"),Qt={equals:nl};let Lo=$o;const Ke=1,en=2,Mo={owned:null,cleanups:null,context:null,owner:null},Yn={};var q=null;let Xn=null,rl=null,W=null,ae=null,ze=null,tn=0;function Be(e,t){const n=W,r=q,o=e.length===0,i=t===void 0?r:t,s=o?Mo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>H(()=>Dt(s)));q=s,W=null;try{return Ve(a,!0)}finally{W=n,q=r}}function O(e,t){t=t?Object.assign({},Qt,t):Qt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Fo(n,o));return[Ro.bind(n),r]}function Do(e,t,n){const r=nn(e,t,!0,Ke);gt(r)}function oe(e,t,n){const r=nn(e,t,!1,Ke);gt(r)}function T(e,t,n){Lo=ul;const r=nn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),ze?ze.push(r):gt(r)}function C(e,t,n){n=n?Object.assign({},Qt,n):Qt;const r=nn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,gt(r),Ro.bind(r)}function ol(e){return e&&typeof e=="object"&&"then"in e}function il(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Yn,l=null,c=!1,d="initialValue"in i,u=typeof r=="function"&&C(r);const f=new Set,[g,h]=(i.storage||O)(i.initialValue),[p,m]=O(void 0),[b,w]=O(void 0,{equals:!1}),[v,x]=O(d?"ready":"unresolved");z.context&&(l=z.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:z.load&&z.has(l)&&(a=z.load(l)));function _(P,R,M,I){return s===P&&(s=null,I!==void 0&&(d=!0),(P===a||R===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(I,{value:R})),a=Yn,E(R,M)),R}function E(P,R){Ve(()=>{R===void 0&&h(()=>P),x(R!==void 0?"errored":d?"ready":"unresolved"),m(R);for(const M of f.keys())M.decrement();f.clear()},!1)}function k(){const P=al,R=g(),M=p();if(M!==void 0&&!s)throw M;return W&&W.user,R}function F(P=!0){if(P!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){_(s,H(g));return}const M=a!==Yn?a:H(()=>o(R,{value:g(),refetching:P}));return ol(M)?(s=M,"value"in M?(M.status==="success"?_(s,M.value,void 0,R):_(s,void 0,Qn(M.value),R),M):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),w()},!1),M.then(I=>_(M,I,void 0,R),I=>_(M,void 0,Qn(I),R)))):(_(s,M,void 0,R),M)}return Object.defineProperties(k,{state:{get:()=>v()},error:{get:()=>p()},loading:{get(){const P=v();return P==="pending"||P==="refreshing"}},latest:{get(){if(!d)return k();const P=p();if(P&&!s)throw P;return g()}}}),u?Do(()=>F(!1)):F(!1),[k,{refetch:F,mutate:h}]}function ke(e){return Ve(e,!1)}function H(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function tt(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i)return i=!1,s;const l=H(()=>t(a,o,s));return o=a,l}}function ht(e){T(()=>H(e))}function K(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Jn(){return W}function Io(){return q}function sl(e,t){const n=q,r=W;q=e,W=null;try{return Ve(t,!0)}catch(o){er(o)}finally{q=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:dl(n),defaultValue:e}}function he(e){let t;return q&&q.context&&(t=q.context[e.id])!==void 0?t:e.defaultValue}function Zn(e){const t=C(e),n=C(()=>tr(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let al;function Ro(){if(this.sources&&this.state)if(this.state===Ke)gt(this);else{const e=ae;ae=null,Ve(()=>on(this),!1),ae=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function Fo(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Xn&&Xn.running;s&&Xn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?ae.push(i):ze.push(i),i.observers&&No(i)),s||(i.state=Ke)}if(ae.length>1e6)throw ae=[],new Error},!1)),t}function gt(e){if(!e.fn)return;Dt(e);const t=tn;ll(e,e.value,t)}function ll(e,t,n){let r;const o=q,i=W;W=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Dt),e.owned=null),e.updatedAt=n+1,er(s)}finally{W=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Fo(e,r):e.value=r,e.updatedAt=n)}function nn(e,t,n,r=Ke,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==Mo&&(q.owned?q.owned.push(i):q.owned=[i]),i}function rn(e){if(e.state===0)return;if(e.state===en)return on(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<tn);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)gt(e);else if(e.state===en){const r=ae;ae=null,Ve(()=>on(e,t[0]),!1),ae=r}}function Ve(e,t){if(ae)return e();let n=!1;t||(ae=[]),ze?n=!0:ze=[],tn++;try{const r=e();return cl(n),r}catch(r){n||(ze=null),ae=null,er(r)}}function cl(e){if(ae&&($o(ae),ae=null),e)return;const t=ze;ze=null,t.length&&Ve(()=>Lo(t),!1)}function $o(e){for(let t=0;t<e.length;t++)rn(e[t])}function ul(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rn(r)}if(z.context){if(z.count){z.effects||(z.effects=[]),z.effects.push(...e.slice(0,n));return}el()}for(z.effects&&(z.done||!z.count)&&(e=[...z.effects,...e],n+=z.effects.length,delete z.effects),t=0;t<n;t++)rn(e[t])}function on(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Ke?r!==t&&(!r.updatedAt||r.updatedAt<tn)&&rn(r):o===en&&on(r,t)}}}function No(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=en,n.pure?ae.push(n):ze.push(n),n.observers&&No(n))}}function Dt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Qn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function er(e,t=q){throw Qn(e)}function tr(e){if(typeof e=="function"&&!e.length)return tr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=tr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function dl(e,t){return function(r){let o;return oe(()=>o=H(()=>(q.context={...q.context,[e]:r.value},Zn(()=>r.children))),void 0),o}}const fl=Symbol("fallback");function Ko(e){for(let t=0;t<e.length;t++)e[t]()}function hl(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return K(()=>Ko(i)),()=>{let l=e()||[],c=l.length,d,u;return l[Gn],H(()=>{let g,h,p,m,b,w,v,x,_;if(c===0)s!==0&&(Ko(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[fl],o[0]=Be(E=>(i[0]=E,n.fallback())),s=1);else if(s===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=Be(f);s=c}else{for(p=new Array(c),m=new Array(c),a&&(b=new Array(c)),w=0,v=Math.min(s,c);w<v&&r[w]===l[w];w++);for(v=s-1,x=c-1;v>=w&&x>=w&&r[v]===l[x];v--,x--)p[x]=o[v],m[x]=i[v],a&&(b[x]=a[v]);for(g=new Map,h=new Array(x+1),u=x;u>=w;u--)_=l[u],d=g.get(_),h[u]=d===void 0?-1:d,g.set(_,u);for(d=w;d<=v;d++)_=r[d],u=g.get(_),u!==void 0&&u!==-1?(p[u]=o[d],m[u]=i[d],a&&(b[u]=a[d]),u=h[u],g.set(_,u)):i[d]();for(u=w;u<c;u++)u in p?(o[u]=p[u],i[u]=m[u],a&&(a[u]=b[u],a[u](u))):o[u]=Be(f);o=o.slice(0,s=c),r=l.slice(0)}return o});function f(g){if(i[u]=g,a){const[h,p]=O(u);return a[u]=p,t(l[u],h)}return t(l[u])}}}function y(e,t){return H(()=>e(t||{}))}function sn(){return!0}const nr={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return t===be?!0:e.has(t)},set:sn,deleteProperty:sn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:sn,deleteProperty:sn}},ownKeys(e){return e.keys()}};function rr(e){return(e=typeof e=="function"?e():e)?e:{}}function gl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function L(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&be in a,e[s]=typeof a=="function"?(t=!0,C(a)):a}if(To&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=rr(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in rr(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(rr(e[a])));return[...new Set(s)]}},nr);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:gl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const f=n[d];f&&(u.get?f.push(u.get.bind(a)):u.value!==void 0&&f.push(()=>u.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(To&&be in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},nr));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},nr)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let pl=0;function Te(){return z.context?z.getNextContextId():`cl-${pl++}`}const zo=e=>`Stale read from <${e}>.`;function pt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return C(hl(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(o,i)=>!o==!i});return C(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?H(()=>i(t?o:()=>{if(!H(r))throw zo("Show");return n()})):i}return e.fallback},void 0,void 0)}function Bo(e){const t=Zn(()=>e.children),n=C(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,l=o[s],c=i,d=C(()=>c()?void 0:l.when,void 0,void 0),u=l.keyed?d:C(d,void 0,{equals:(f,g)=>!f==!g});i=()=>c()||(u()?[a,d,l]:void 0)}return i});return C(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?H(()=>a(s.keyed?i():()=>{if(H(n)()?.[0]!==o)throw zo("Match");return i()})):a},void 0,void 0)}function It(e){return e}const ml=["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"],yl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ml]),bl=new Set(["innerHTML","textContent","innerText","children"]),wl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),vl=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 xl(e,t){const n=vl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Sl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),kl=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"]),El={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Cl(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!c){c=new Map;let u=a;for(;u<i;)c.set(n[u],u++)}const d=c.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,f=1,g;for(;++u<o&&u<i&&!((g=c.get(t[u]))==null||g!==d+f);)f++;if(f>d-a){const h=t[s];for(;a<d;)e.insertBefore(n[a++],h)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Vo="_$DX_DELEGATE";function D(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function Ol(e,t=window.document){const n=t[Vo]||(t[Vo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Il))}}function ue(e,t,n){ot(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function _l(e,t,n,r){ot(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Pl(e,t,n){ot(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function nt(e,t){ot(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Al(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 Tl(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Uo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Uo(e,a,!0),n[a]=l)}return n}function an(e,t,n){if(!t)return n?ue(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function rt(e,t={},n,r){const o={};return r||oe(()=>o.children=Rt(e,t.children,o.children)),oe(()=>typeof t.ref=="function"&&or(t.ref,e)),oe(()=>Ll(e,t,n,!0,o,!0)),o}function or(e,t,n){return H(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Rt(e,t,r,n);oe(o=>Rt(e,t(),o,n),r)}function Ll(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=jo(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=jo(e,s,a,o[s],n,i,t)}}function Ml(e){let t,n;return!ot()||!(t=z.registry.get(n=Rl()))?e():(z.completed&&z.completed.add(t),z.registry.delete(n),t)}function ot(e){return!!z.context&&!z.done&&(!e||e.isConnected)}function Dl(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Uo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function jo(e,t,n,r,o,i,s){let a,l,c,d,u;if(t==="style")return an(e,n,r);if(t==="classList")return Tl(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),g=Sl.has(f);if(!g&&r){const h=Array.isArray(r)?r[0]:r;e.removeEventListener(f,h)}(g||n)&&(Al(e,f,n,g),g&&Ol([f]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Pl(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=bl.has(t))||!o&&((d=xl(t,e.tagName))||(l=yl.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(u)t=t.slice(5),l=!0;else if(ot(e))return n;t==="class"||t==="className"?nt(e,n):a&&!l&&!c?e[Dl(t)]=n:e[d||t]=n}else{const f=o&&t.indexOf(":")>-1&&El[t.split(":")[0]];f?_l(e,f,t,n):ue(e,wl[t]||t,n)}return n}function Il(e){if(z.registry&&z.events&&z.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),z.registry&&!z.done&&(z.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function Rt(e,t,n,r,o){const i=ot(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=mt(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=mt(e,n,r)}else{if(s==="function")return oe(()=>{let l=t();for(;typeof l=="function";)l=l();n=Rt(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(ir(l,t,n,o))return oe(()=>n=Rt(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const u=[d];for(;(d=d.nextSibling)!==r;)u.push(d);return n=u}if(l.length===0){if(n=mt(e,n,r),a)return n}else c?n.length===0?qo(e,l,r):Cl(e,n,l):(n&&mt(e),qo(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=mt(e,n,r,t);mt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ir(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=ir(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=ir(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function qo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function mt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Rl(){return z.getNextContextId()}const Fl=!1,$l="http://www.w3.org/2000/svg";function Ho(e,t=!1){return t?document.createElementNS($l,e):document.createElement(e)}function Wo(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Io();let i,s=!!z.context;return T(()=>{s&&(Io().user=s=!1),i||(i=sl(o,()=>C(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=O(!1),d=()=>c(!0);Be(u=>A(a,()=>l()?u():i(),null)),K(d)}else{const l=Ho(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Nl(e,t){const n=C(e);return C(()=>{const r=n();switch(typeof r){case"function":return H(()=>r(t));case"string":const o=kl.has(r),i=z.context?Ml():Ho(r,o);return rt(i,t,o),i}})}function ln(e){const[,t]=j(e,["component"]);return Nl(()=>e.component,t)}function Kl(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=O(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function zl(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 Bl(e){return(t,n)=>{const{element:r}=n;return Be(o=>{const i=Kl(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},zl(r))}}function Vl(e,t,n){return arguments.length===2&&(n=t,t={}),Qa(e,t)(Bl(n))}const Ul='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.top-0{top:0}.z-20{z-index:20}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.box-border{box-sizing:border-box}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-full{width:100%;height:100%}.h-10{height:40px}.h-11{height:44px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[44px\\]{height:44px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[44px\\]{min-height:44px}.w-11\\/12{width:91.666667%}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[44px\\]{width:44px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-t{border-top-width:1px}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-6{padding-top:24px;padding-bottom:24px}.pb-2{padding-bottom:8px}.pb-\\[\\.\\.\\.\\]{padding-bottom:...}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}#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: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media (max-width: 640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Go,sr]=O(!1),Yo=[],jl=e=>Yo.push(e),Xo=()=>{Yo.forEach(e=>e())},ql=()=>{const e=!Go();sr(e),ee("onToggle"),ee(e?"onOpen":"onClose"),Xo()},Hl=()=>{sr(!1),ee("onClose")},Wl=()=>{sr(!0),ee("onOpen"),Xo()},Jo=()=>({bubble:Go,show:Wl,hide:Hl,toggle:ql,onOpen:jl}),ar=Symbol("store-raw"),yt=Symbol("store-node"),Ue=Symbol("store-has"),Zo=Symbol("store-self");function Qo(e){let t=e[be];if(!t&&(Object.defineProperty(e,be,{value:t=new Proxy(e,Xl)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function cn(e){let t;return e!=null&&typeof e=="object"&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ft(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ar])return n;if(!cn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=Ft(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=Ft(o,t))!==o&&(e[i]=r))}return e}function un(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function $t(e,t,n){if(e[t])return e[t];const[r,o]=O(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Gl(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===be||t===yt||(delete n.value,delete n.writable,n.get=()=>e[be][t]),n}function ei(e){Jn()&&$t(un(e,yt),Zo)()}function Yl(e){return ei(e),Reflect.ownKeys(e)}const Xl={get(e,t,n){if(t===ar)return e;if(t===be)return n;if(t===Gn)return ei(e),n;const r=un(e,yt),o=r[t];let i=o?o():e[t];if(t===yt||t===Ue||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Jn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=$t(r,t,i)())}return cn(i)?Qo(i):i},has(e,t){return t===ar||t===be||t===Gn||t===yt||t===Ue||t==="__proto__"?!0:(Jn()&&$t(un(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Yl,getOwnPropertyDescriptor:Gl};function dn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Ue]&&e[Ue][t]&&o!==void 0&&e[Ue][t].$()):(e[t]=n,e[Ue]&&e[Ue][t]&&o===void 0&&e[Ue][t].$());let s=un(e,yt),a;if((a=$t(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=$t(s,"length",i))&&a.$(e.length)}(a=s[Zo])&&a.$()}function ti(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];dn(e,o,t[o])}}function Jl(e,t){if(typeof t=="function"&&(t=t(e)),t=Ft(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&dn(e,n,o)}dn(e,"length",r)}else ti(e,t)}function Nt(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Nt(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Nt(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:d=1}=r;for(let u=l;u<=c;u+=d)Nt(e,[u].concat(t),n);return}else if(t.length>1){Nt(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Ft(i),r===void 0||cn(o)&&cn(i)&&!Array.isArray(i)?ti(o,i):dn(e,r,i))}function Zl(...[e,t]){const n=Ft(e||{}),r=Array.isArray(n),o=Qo(n);function i(...s){ke(()=>{r&&s.length===1?Jl(n,s[0]):Nt(n,s)})}return[o,i]}function ni(e,t,n){return Be(()=>{const r=Co(e),[o,i]=Zl(r?JSON.parse(r):t);return T(()=>Eo(e,JSON.stringify(o),n)),[o,i]})}function Ql(e,t,n){return Be(()=>{const r=Co(e),[o,i]=O(r?JSON.parse(r):t);return T(()=>Eo(e,JSON.stringify(o()),n)),[o,i]})}const[gm,pm]=Ql("smarttalks-widget-lang","en");function ec(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 tc(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 nc=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Zt}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return ec(i);if(i.type==="entity")return tc(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return ne("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Zt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),i._id=n,i},[ri,rc]=O(""),[it]=Be(()=>il(ri,nc)),oc=()=>{if(it()?.type==="chat")return it()},ic=()=>{if(it()?.type==="form")return it()},lr=()=>{const e=it();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Be(()=>T(()=>{const e=it();Ka(e),e&&(ee("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const ie=()=>({widgetId:ri,setWidgetId:rc,widget:it,chatWidget:oc,formWidget:ic,getSessionId:lr}),oi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ii=po,sc=(e,t)=>n=>{var r;if(t?.variants==null)return ii(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=n?.[c],u=i?.[c];if(d===null)return null;const f=oi(d)||oi(u);return o[c][f]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,f]=d;return f===void 0||(c[u]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:f,...g}=d;return Object.entries(g).every(h=>{let[p,m]=h;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...c,u,f]:c},[]);return ii(e,s,l,n?.class,n?.className)};var ac=D("<button>");const lc=sc("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Ee=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=ac();return rt(n,L({get class(){return Ge(lc({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var cc=D('<img alt="widget logo">');const si=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=cc();return rt(n,L({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var uc=D('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const dc=()=>{const{chatWidget:e}=ie(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=uc(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return A(r,y(si,{get src(){return e()?.avatar}}),o),A(i,t),A(s,n),r})()};var fc=D("<svg stroke-width=0>");function we(e,t){const n=L(e.a,t),[r,o]=j(n,["src"]),[i,s]=O(""),a=C(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return T(()=>s(a())),K(()=>{s("")}),(()=>{var l=fc();return rt(l,L({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),A(l,()=>Fl),l})()}function hc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function gc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function pc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function mc(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const cr={equals:!1};function ai(e){return(...t)=>{for(const n of e)n&&n(...t)}}function yc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,li=e=>Array.isArray(e)?e:e?[e]:[];function bc(e,...t){return typeof e=="function"?e(...t):e}const wc=K;function vc(e,t,n,r){return e.addEventListener(t,n,r),wc(e.removeEventListener.bind(e,t,n,r))}function xc(e,t,n,r){const o=()=>{li(S(e)).forEach(i=>{i&&li(S(t)).forEach(s=>vc(i,s,n,r))})};typeof e=="function"?T(o):oe(o)}function fn(){return!0}const Sc={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()}},kc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ci(e){const t={};let n;for(;n=kc.exec(e);)t[n[1]]=n[2];return t}function Ec(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ci(e)}else typeof t=="string"&&(t=ci(t));return{...e,...t}}const ur=(e,t,n)=>{let r;for(const o of e){const i=S(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Cc(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?yc:ai,o={};for(const s of n){const a=S(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const i=L(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ur(n,"style",Ec);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)}},Sc)}function st(...e){return ai(e)}function Oc(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 _c(e){return typeof e=="number"}function Pc(e){return Array.isArray(e)}function bt(e){return Object.prototype.toString.call(e)==="[object String]"}function Ac(e){return typeof e=="function"}function ui(e){return t=>`${e()}-${t}`}function Le(e,t){return e?e===t||e.contains(t):!1}function Kt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(di(n)&&n.contentDocument)return Kt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function di(e){return e.tagName==="IFRAME"}var fi=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(fi||{});function fr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function hn(){return fr(/^Mac/i)}function Tc(){return fr(/^iPhone/i)}function Lc(){return fr(/^iPad/i)||hn()&&navigator.maxTouchPoints>1}function Mc(){return Tc()||Lc()}function Dc(){return hn()||Mc()}function ge(e,t){return t&&(Ac(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ve(e){return t=>{for(const n of e)ge(t,n)}}function Ic(e){return hn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Rc())e.focus({preventScroll:!0});else{const t=Fc(e);e.focus(),$c(t)}}var gn=null;function Rc(){if(gn==null){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch{}}return gn}function Fc(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 $c(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var hi=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Nc=[...hi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],hr=`${hi.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Kc=Nc.join(':not([hidden]):not([tabindex="-1"]),');function gi(e,t){const r=Array.from(e.querySelectorAll(hr)).filter(pi);return t&&pi(e)&&r.unshift(e),r.forEach((o,i)=>{if(di(o)&&o.contentDocument){const s=o.contentDocument.body,a=gi(s,!1);r.splice(i,1,...a)}}),r}function pi(e){return mi(e)&&!zc(e)}function mi(e){return e.matches(hr)&&gr(e)}function zc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function gr(e,t){return e.nodeName!=="#comment"&&Bc(e)&&Vc(e,t)&&(!e.parentElement||gr(e.parentElement,e))}function Bc(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 Vc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Uc(e,t,n){const r=t?.tabbable?Kc:hr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&gr(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function yi(e){let t=e;for(;t&&!jc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function jc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function qc(){}function Hc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,d]=t[a],[u,f]=t[l],[,g]=t[l===0?s-1:l-1]||[0,0],h=(d-f)*(n-c)-(c-u)*(r-d);if(f<d){if(r>=f&&r<d){if(h===0)return!0;h>0&&(r===f?r>g&&(o=!o):o=!o)}}else if(d<f){if(r>d&&r<=f){if(h===0)return!0;h<0&&(r===f?r<g&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function Me(e,t){return L(e,t)}var zt=new Map,bi=new Set;function wi(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=zt.get(n.target);r||(r=new Set,zt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=zt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),zt.delete(n.target)),zt.size===0)){for(const o of bi)o();bi.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?wi():document.addEventListener("DOMContentLoaded",wi));function pr(e,t){const n=vi(e,t,"left"),r=vi(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function vi(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Wc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=yi(e);for(;e&&o&&e!==n&&o!==n;)pr(o,e),e=o,o=yi(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Gc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function mr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=bt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=bt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(bt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return bt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(bt(l)||_c(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const d=mr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...d),t+=d.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
2
2
  * Portions of this file are based on code from react-spectrum.
3
3
  * Apache License Version 2.0, Copyright 2020 Adobe.
4
4
  *
@@ -178,7 +178,7 @@
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 Yd(e,t){return t?Hc([e.clientX,e.clientY],t):!1}function Xd(e){const t=Ct(),n=Ni(),r=gs(),o=Me({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=O(),[f,g]=O(),[h,p]=O(),[m,b]=O(),[w,v]=O(!0),[x,_]=O(s.placement),[E,k]=O([]),[F,P]=O([]),{DomCollectionProvider:R}=ju({items:F,onItemsChange:P}),M=xi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),I=fu(()=>t.forceMount()||M.isOpen()),re=Mu({selectionMode:"none",dataSource:F}),Y=U=>{v(U),M.open()},fe=(U=!1)=>{M.close(),U&&r&&r.close(!0)},$=U=>{v(U),M.toggle()},V=()=>{const U=m();U&&(de(U),re.selectionManager().setFocused(!0),re.selectionManager().setFocusedKey(void 0))},Q=U=>{k(go=>[...go,U]);const Un=r?.registerNestedMenu(U);return()=>{k(go=>dr(go,U)),Un?.()}},se=U=>c===l?.side&&Yd(U,l?.area),At=U=>{se(U)&&U.preventDefault()},Ae=U=>{se(U)||V()},dm=U=>{se(U)&&U.preventDefault()};cu({isDisabled:()=>!(r==null&&M.isOpen()&&t.isModal()),targets:()=>[m(),...E()].filter(Boolean)}),T(()=>{const U=m();if(!U||!r)return;const Un=r.registerNestedMenu(U);K(()=>{Un()})});const fm={dataset:C(()=>({"data-expanded":M.isOpen()?"":void 0,"data-closed":M.isOpen()?void 0:""})),isOpen:M.isOpen,contentPresence:I,nestedMenus:E,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:w,listState:()=>re,parentMenuContext:()=>r,triggerRef:h,contentRef:m,triggerId:d,contentId:f,setTriggerRef:p,setContentRef:b,open:Y,close:fe,toggle:$,focusContent:V,onItemEnter:At,onItemLeave:Ae,onTriggerLeave:dm,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Q,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:yn(u),registerContentId:yn(g)};return y(R,{get children(){return y(hs.Provider,{value:fm,get children(){return y(Gd,L({anchorRef:h,contentRef:m,onCurrentPlacementChange:_},s))}})}})}const Jd=ce();function Zd(e){let t;const n=Ct(),r=Et(),o=Me({id:n.generateId(`item-${Te()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=O(),[c,d]=O(),[u,f]=O(),g=()=>r.listState().selectionManager(),h=()=>s.id,p=()=>g().focusedKey()===h(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};qu({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??u()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const b=Tu({key:h,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),w=P=>{ge(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(de(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},v=P=>{ge(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},x=P=>{ge(P,i.onPointerUp),!i.disabled&&P.button===0&&m()},_=P=>{if(ge(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":m();break}},E=C(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=C(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),F={isChecked:()=>i.checked,dataset:k,setLabelRef:f,generateId:ui(()=>s.id),registerLabel:yn(l),registerDescription:yn(d)};return y(Jd.Provider,{value:F,get children(){return y(bn,L({as:"div",ref(P){var R=st(M=>t=M,i.ref);typeof R=="function"&&R(P)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return E()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return ve([i.onPointerDown,b.onPointerDown])},get onPointerUp(){return ve([x,b.onPointerUp])},get onClick(){return ve([i.onClick,b.onClick])},get onKeyDown(){return ve([_,b.onKeyDown])},get onMouseDown(){return ve([i.onMouseDown,b.onMouseDown])},get onFocus(){return ve([i.onFocus,b.onFocus])},onPointerMove:w,onPointerLeave:v},k,s))}})}const Qd=ce();function ms(){return he(Qd)}function ef(e){let t;const n=Ct(),r=Et(),o=ms(),i=Me({id:n.generateId(`content-${Te()}`)},e),[s,a]=j(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Iu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);au({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const u=m=>{if(Le(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},f=m=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},h=m=>{ge(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(ge(m,s.onPointerMove),m.pointerType!=="mouse")return;const b=m.target,w=l!==m.clientX;Le(m.currentTarget,b)&&w&&(r.setPointerDir(m.clientX>l?"right":"left"),l=m.clientX)};return T(()=>K(r.registerContentId(s.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y(rd,{get children(){return y(td,L({ref(m){var b=st(w=>{r.setContentRef(w),r.contentPresence.setRef(w),t=w},s.ref);typeof b=="function"&&b(m)},role:"menu",get id(){return s.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return C(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:f,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return ve([s.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return ve([s.onMouseDown,d.onMouseDown])},get onFocusIn(){return ve([s.onFocusIn,d.onFocusIn])},get onFocusOut(){return ve([s.onFocusOut,d.onFocusOut])},onPointerEnter:h,onPointerMove:p},()=>r.dataset(),a))}})}})}function tf(e){let t;const n=Ct(),r=Et(),[o,i]=j(e,["ref"]);return Hi({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(ef,L({ref(s){var a=st(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function nf(e){return y(Zd,L({role:"menuitem",closeOnSelect:!0},e))}function rf(e){const t=Et();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(Wo,e)}})}function of(e){const t=`menu-${Te()}`,n=Me({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=xi({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ui(()=>r.id),value:()=>r.value};return y(ps.Provider,{value:s,get children(){return y(Xd,L({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function sf(e){const t=Ct(),n=Et(),r=ms(),o=Me({id:t.generateId("trigger")},e),[i,s]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,T(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),T(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),T(()=>{n.isOpen()&&r.setValue(a)}),K(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=h=>{ge(h,i.onPointerDown),h.currentTarget.dataset.pointerType=h.pointerType,!i.disabled&&h.pointerType!=="touch"&&h.button===0&&l()},d=h=>{ge(h,i.onClick),i.disabled||h.currentTarget.dataset.pointerType==="touch"&&l()},u=h=>{if(ge(h,i.onKeyDown),!i.disabled)switch(h.key){case"Enter":case" ":case"ArrowDown":h.stopPropagation(),h.preventDefault(),Wc(h.currentTarget),n.toggle("first");break;case"ArrowUp":h.stopPropagation(),h.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.previousMenu();break}},f=h=>{ge(h,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=h=>{ge(h,i.onFocus),r!==void 0&&r.setValue(a)};return T(()=>K(n.registerTriggerId(i.id))),y($u,L({ref(h){var p=st(n.setTriggerRef,i.ref);typeof p=="function"&&p(h)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return C(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:f,onClick:d,onKeyDown:u,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function af(e){const t=Ct(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(tf,L({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||de(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function lf(e){const t=`dropdownmenu-${Te()}`,n=Me({id:t},e);return y(of,n)}function cf(e){return we({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function uf(e){return we({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function df(e){return we({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const ff=e=>y(lf,L({gutter:4},e)),hf=sf,gf=e=>{const[,t]=j(e,["class"]);return y(rf,{get mount(){return Jt()},get children(){return y(af,L({get class(){return Ge("z-50 min-w-[128px] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},pf=e=>{const[,t]=j(e,["class"]);return y(nf,L({get class(){return Ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function mf(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 yf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function bf(e,t,n){const r=`${Zt}/v1/messages`,o=lr(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,s)}async function wf(e,t,n){if(!e||!t||!n)return;const r=`${Zt}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const Fe=Object.create(null);Fe.open="0",Fe.close="1",Fe.ping="2",Fe.pong="3",Fe.message="4",Fe.upgrade="5",Fe.noop="6";const _n=Object.create(null);Object.keys(Fe).forEach(e=>{_n[Fe[e]]=e});const $r={type:"error",data:"parser error"},ys=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",bs=typeof ArrayBuffer=="function",ws=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Nr=({type:e,data:t},n,r)=>ys&&t instanceof Blob?n?r(t):vs(t,r):bs&&(t instanceof ArrayBuffer||ws(t))?n?r(t):vs(new Blob([t]),r):r(Fe[e]+(t||"")),vs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function xs(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kr;function vf(e,t){if(ys&&e.data instanceof Blob)return e.data.arrayBuffer().then(xs).then(t);if(bs&&(e.data instanceof ArrayBuffer||ws(e.data)))return t(xs(e.data));Nr(e,!1,n=>{Kr||(Kr=new TextEncoder),t(Kr.encode(n))})}const Ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Ss.length;e++)Wt[Ss.charCodeAt(e)]=e;const xf=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},Sf=typeof ArrayBuffer=="function",zr=(e,t)=>{if(typeof e!="string")return{type:"message",data:ks(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:kf(e.substring(1),t)}:_n[n]?e.length>1?{type:_n[n],data:e.substring(1)}:{type:_n[n]}:$r},kf=(e,t)=>{if(Sf){const n=xf(e);return ks(n,t)}else return{base64:!0,data:e}},ks=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Es="",Ef=(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))})})},Cf=(e,t)=>{const n=e.split(Es),r=[];for(let o=0;o<n.length;o++){const i=zr(n[o],t);if(r.push(i),i.type==="error")break}return r};function Of(){return new TransformStream({transform(e,t){vf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Br;function Pn(e){return e.reduce((t,n)=>t+n.length,0)}function An(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function _f(e,t){Br||(Br=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(Pn(n)<1)break;const l=An(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Pn(n)<2)break;const l=An(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pn(n)<8)break;const l=An(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue($r);break}o=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pn(n)<o)break;const l=An(n,o);a.enqueue(zr(i?l:Br.decode(l),t)),r=0}if(o===0||o>e){a.enqueue($r);break}}}})}const Cs=4;function te(e){if(e)return Pf(e)}function Pf(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")(),Af="arraybuffer";function mm(){}function Os(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Tf=Se.setTimeout,Lf=Se.clearTimeout;function Ln(e,t){t.useNativeTimers?(e.setTimeoutFn=Tf.bind(Se),e.clearTimeoutFn=Lf.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Mf=1.33;function Df(e){return typeof e=="string"?If(e):Math.ceil((e.byteLength||e.size)*Mf)}function If(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function _s(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Rf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Ff(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class $f extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Vr extends te{constructor(t){super(),this.writable=!1,Ln(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new $f(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=zr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Rf(t);return n.length?"?"+n:""}}class Nf 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)};Cf(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,Ef(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=_s()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Ps=!1;try{Ps=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Kf=Ps;function zf(){}class Bf extends Nf{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class $e extends te{constructor(t,n,r){super(),this.createRequest=t,Ln(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Os(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=$e.requestsCount++,$e.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=zf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $e.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if($e.requestsCount=0,$e.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",As);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,As,!1)}}function As(){for(let e in $e.requests)$e.requests.hasOwnProperty(e)&&$e.requests[e].abort()}const Vf=function(){const e=Ts({xdomain:!1});return e&&e.responseType!==null}();class Uf extends Bf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Vf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new $e(Ts,this.uri(),t)}}function Ts(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Kf))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ls=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class jf extends Vr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ls?{}:Os(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;Nr(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=_s()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ur=Se.WebSocket||Se.MozWebSocket;class qf extends jf{createSocket(t,n,r){return Ls?new Ur(t,n,r):n?new Ur(t,n):new Ur(t)}doWrite(t,n){this.ws.send(n)}}class Hf 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=_f(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Of();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 Wf={websocket:qf,webtransport:Hf,polling:Uf},Gf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yf=["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=Gf.exec(e||""),i={},s=14;for(;s--;)i[Yf[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=Xf(i,i.path),i.queryKey=Jf(i,i.query),i}function Xf(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 Jf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const qr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Mn=[];qr&&addEventListener("offline",()=>{Mn.forEach(e=>e())},!1);class Ze extends te{constructor(t,n){if(super(),this.binaryType=Af,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=jr(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=jr(n.host).host);Ln(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ff(this.opts.query)),qr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Mn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Cs,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=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(),qr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Mn.indexOf(this._offlineEventListener);r!==-1&&Mn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=Cs;class Zf extends Ze{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const f=new Error("probe error: "+u);f.transport=n.name,i(),this.emitReserved("upgradeError",f)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Qf=class extends Zf{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=>Wf[o]).filter(o=>!!o)),super(t,r)}};function eh(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 th=typeof ArrayBuffer=="function",nh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ms=Object.prototype.toString,rh=typeof Blob=="function"||typeof Blob<"u"&&Ms.call(Blob)==="[object BlobConstructor]",oh=typeof File=="function"||typeof File<"u"&&Ms.call(File)==="[object FileConstructor]";function Hr(e){return th&&(e instanceof ArrayBuffer||nh(e))||rh&&e instanceof Blob||oh&&e instanceof File}function Dn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Dn(e[n]))return!0;return!1}if(Hr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Dn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Dn(e[n]))return!0;return!1}function ih(e){const t=[],n=e.data,r=e;return r.data=Wr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Wr(e,t){if(!e)return e;if(Hr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Wr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Wr(e[r],t));return n}return e}function sh(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 ah=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],lh=5;var B;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(B||(B={}));class ch{constructor(t){this.replacer=t}encode(t){return(t.type===B.EVENT||t.type===B.ACK)&&Dn(t)?this.encodeAsBinary({type:t.type===B.EVENT?B.BINARY_EVENT:B.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===B.BINARY_EVENT||t.type===B.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=ih(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ds(e){return Object.prototype.toString.call(e)==="[object Object]"}class Yr extends te{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===B.BINARY_EVENT;r||n.type===B.BINARY_ACK?(n.type=r?B.EVENT:B.ACK,this.reconstructor=new uh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Hr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(B[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===B.BINARY_EVENT||r.type===B.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Yr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case B.CONNECT:return Ds(n);case B.DISCONNECT:return n===void 0;case B.CONNECT_ERROR:return typeof n=="string"||Ds(n);case B.EVENT:case B.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&ah.indexOf(n[0])===-1);case B.ACK:case B.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class uh{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=sh(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const dh=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Yr,Encoder:ch,get PacketType(){return B},protocol:lh},Symbol.toStringTag,{value:"Module"}));function Pe(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const fh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Is extends te{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Pe(t,"open",this.onopen.bind(this)),Pe(t,"packet",this.onpacket.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(fh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:B.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),s.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:B.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case B.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case B.EVENT:case B.BINARY_EVENT:this.onevent(t);break;case B.ACK:case B.BINARY_ACK:this.onack(t);break;case B.DISCONNECT:this.ondisconnect();break;case B.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:B.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:B.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ot(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ot.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Ot.prototype.reset=function(){this.attempts=0},Ot.prototype.setMin=function(e){this.ms=e},Ot.prototype.setMax=function(e){this.max=e},Ot.prototype.setJitter=function(e){this.jitter=e};class Xr extends te{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ln(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ot({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||dh;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 Qf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Pe(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=Pe(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Pe(t,"ping",this.onping.bind(this)),Pe(t,"data",this.ondata.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this)),Pe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tn(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Is(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Gt={};function In(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=eh(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Gt[o]&&i in Gt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Xr(r,t):(Gt[o]||(Gt[o]=new Xr(r,t)),l=Gt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(In,{Manager:Xr,Socket:Is,io:In,connect:In});class Qe{static instance;constructor(){}static init(t){if(!Qe.instance){const n=lr();Qe.instance=In(Ua,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),Qe.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",Qe.instance.id)})}return Qe.instance}static on(t,n,r){const o=Qe.instance||this.init(n);o.off(t),o.on(t,r)}}const Rs=1e3*60*60*24,[Rn,Fs]=ni("smarttalks-widget-messages",{},Rs),$s=()=>{const{widgetId:e}=ie();return Rn[e()]??[]},hh=e=>{const{widgetId:t}=ie();Fs({...Rn,[t()]:[...Rn[t()]??[],e]})},gh=()=>{const{widgetId:e}=ie();Fs({...Rn,[e()]:[]})},[Ns,ph]=ni("smarttalks-widget-conversationinfo",{},Rs),Ks=()=>{const{widgetId:e}=ie();return Ns[e()]??{}},zs=e=>{const{widgetId:t}=ie();ph({...Ns,[t()]:e})},[mh,Jr]=O(!1),[yh,Bs]=O(!1),Vs=[],Us=()=>{Vs.forEach(e=>e())},bh=e=>Vs.push(e),Zr=e=>{const t=mf(e);if(hh(t),t.type==="media"){setTimeout(Us,200);return}Us()},wh=(e,t)=>{const{chatWidget:n,widgetId:r}=ie(),o=Ks();e.trim()&&(Zr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ee("onInput",e),Qe.on("message",r(),i=>{(i.contactId!==o.contactId||i.interactionId!==o.interactionId)&&zs({contactId:i.contactId,interactionId:i.interactionId});for(const s of i.messages)Zr(s),ee("onAnswer",s);Jr(!1),yf(i.debug)}),Jr(!0),bf(e,t,n()?._id).catch(i=>{console.error(i),Jr(!1)}))},vh=()=>{const{chatWidget:e}=ie(),t=Ks();Bs(!0),gh(),wf(e()?._id,t.contactId,t.interactionId).finally(()=>{zs({}),Bs(!1),js()}),ee("onReset")},js=()=>{const{chatWidget:e}=ie();if($s().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Zr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},et=()=>({getMessages:$s,pushMessage:wh,clearMessages:vh,addBalloonMessage:js,onMessage:bh,typing:mh,loading:yh});var xh=D("<span>");const Sh=()=>{const{clearMessages:e}=et();O(!1);const[t,n]=O(!1);return y(ff,{get open(){return t()},onOpenChange:n,get children(){return[y(hf,{get children(){return y(Ee,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(gc,{size:20})}})}}),y(gf,{get children(){return y(pf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(hc,{size:14}),(()=>{var r=xh();return A(r,()=>ft("restart")),r})()]}})}})]}})};function kh(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Eh(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function Ch(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function Oh(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var _h=D('<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}=ie(),[t,n]=O(!1);let r=null;ht(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&c()});const o=f=>{const g=f;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async f=>{const g=f;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=async()=>{const f=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(f.webkitExitFullscreen)return f.webkitExitFullscreen(),!0;if(f.msExitFullscreen)return f.msExitFullscreen(),!0}catch{}return!1},a=f=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",f.classList.add("st-fullscreen"),n(!0)},l=f=>{f.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},c=async()=>{try{const f=Jt();if(!f)return;if(!t())o(f)&&await i(f)||a(f);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||l(f)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},d=()=>{const f=document,g=!!(document.fullscreenElement||f.webkitFullscreenElement||f.msFullscreenElement);if(n(g),!g)try{const h=Jt();h.classList.contains("st-fullscreen")&&l(h)}catch{}};document.addEventListener("fullscreenchange",d),document.addEventListener("webkitfullscreenchange",d);const u=()=>{e()?.mode==="popup"&&ee("close")};return ne("toggleFullscreen",()=>{c()}),(()=>{var f=_h(),g=f.firstChild;return A(f,y(dc,{}),g),A(g,y(Ee,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:c,get children(){return y(Z,{get when(){return t()},get fallback(){return y(Eh,{size:16})},get children(){return y(kh,{size:16})}})}}),null),A(g,y(Z,{get when(){return e()?.showSettings},get children(){return y(Sh,{})}}),null),A(g,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(Ee,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:u,get children(){return y(Oh,{size:16})}})}}),null),f})()};var Ph=D("<span>");const qs=({createdAt:e,anchor:t="end"})=>(()=>{var n=Ph();return nt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var Ah=D('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const Th=({children:e,createdAt:t})=>(()=>{var n=Ah(),r=n.firstChild;return A(r,e),A(n,y(qs,{createdAt:t,anchor:"start"}),null),n})();var Lh=D("<span>");const _t=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=za(Ba(n))),(()=>{var r=Lh();return r.innerHTML=n,rt(r,L({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Mh=D('<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}=et(),[o,i]=O(!1),s=(a,l)=>{i(!0),r(a,l)};return(()=>{var a=Mh(),l=a.firstChild,c=l.firstChild;A(a,y(_t,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?or(d,c):n=c,A(c,y(pt,{each:e,children:u=>y(Ee,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(u.label,u.value),get children(){return u.label?.trim()}})})),oe(()=>nt(l,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Ih=D('<div class="flex flex-col"><span>'),Rh=D("<a target=_blank><img><span></span><span>");const Fh=({options:e,text:t})=>(()=>{var n=Ih(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(pt,{each:e,children:o=>(()=>{var i=Rh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),oe(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(i,"href",c.e=d),u!==c.t&&ue(s,"src",c.t=u),c},{e:void 0,t:void 0}),i})()}),null),n})();var $h=D("<a target=_blank>");const Nh=({url:e,text:t})=>(()=>{var n=$h();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,Hs=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Kh=e=>{const t=L({initialRegistered:!1},e),[n,r]=O(t.initialRegistered);return[C(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Ws=Kh,Yt=e=>typeof e=="function",zh=["button","color","file","image","reset","submit"],Bh=(e,t)=>e==="button"?!0:e==="input"&&t?zh.indexOf(t)!==-1:!1;function Vh(e){const[t,n]=O(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>H(()=>{let a;return Yt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var eo=Vh,Fn=new Map,$n=(e,t)=>{if(Fn.has(e))return Fn.get(e);const n=ce(t);return Fn.set(e,n),n},to=e=>{const t=Fn.get(e);if(t)return he(t)},Nn=new Map,Uh=e=>{T(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Nn.get(e.key);o?o.activeCount++:Nn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=Nn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Nn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},jh=Uh,qh=e=>{const t=L({enabled:!0},e);T(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Hh=qh,Wh=e=>{const t=L({enabled:!0},e);T(()=>{const{body:n}=document;G(t.enabled)&&jh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Gh=Wh,Yh=e=>{const t=L({enabled:!0,strategy:"pointerup"},e);T(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),i=G(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Xh=Yh,Jh=e=>{const t=L({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Hh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Xh({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}),Gh({enabled:t.noOutsidePointerEvents})},Zh=Jh,no=ce(),Qh=e=>C(()=>{if(he(no))return y(Gs,e);const r=Te(),[o,i]=O([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(d=>d!==l))};return y(no.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(Gs,e)}})}),Gs=e=>{const t=L({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(no),i=Te();T(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Zh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=C(()=>n.children),l=()=>{const c=a();return Yt(c)?c({get isLastLayer(){return s()}}):c};return H(()=>l())},eg=Qh,tg=()=>{const[e,t]=O(!1);return T(()=>t(!0)),e},ng=tg,rg=(e,t)=>(e&&(Yt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ro=(...e)=>e.some(t=>!!t()),og=e=>(...t)=>{for(const n of e)n&&n(...t)},Kn=(...e)=>og(e),le=e=>e?"":void 0,ig="div",sg=e=>{const[t,n]=j(e,["as"]),r=C(()=>t.as??ig);return C(()=>{const i=r();switch(typeof i){case"function":return H(()=>i(n));case"string":return y(ln,L({component:i},n))}})},oo=sg,ag=e=>{let t,n=!1;return()=>n?t:(n=!0,t=C(e))},Ys=ag,lg=e=>C(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),cg=lg,Xs="button",ug=e=>{const[t,n]=O(null),[r,o]=j(e,["as","ref","type"]),i=cg({element:t,fallback:Xs}),s=C(()=>Bh(i(),r.type));return y(oo,L({get as(){return r.as??Xs},ref(a){var l=Kn(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},dg=ug,fg='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',io="focusTrap.initialFocus",so="focusTrap.finalFocus",Js={bubbles:!1,cancelable:!0},hg=e=>{const t=L({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=O(null),o=C(()=>{const h=n();return h?h[0]??null:null}),i=C(()=>{const h=n();return h?h[h.length-1]??null:null});let s=null;const a=()=>{Cr(()=>{l(J(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(J(t.element))})};T(()=>{const h=J(t.element);if(h&&J(t.enabled)){s=document.activeElement,H(()=>{l(h),c(h)});const p=new MutationObserver(a);J(t.observeChanges)&&p.observe(h,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&p.disconnect(),r(null),g(h)})}}),T(()=>{const h=n();h===null||h.length!==0||(document.addEventListener("keydown",f),K(()=>{document.removeEventListener("keydown",f)}))}),T(()=>{const h=o();h&&(h.addEventListener("keydown",d),K(()=>{h.removeEventListener("keydown",d)}))}),T(()=>{const h=i();h&&(h.addEventListener("keydown",u),K(()=>{h.removeEventListener("keydown",u)}))});const l=h=>{const p=Array.from(h.querySelectorAll(fg)).map((m,b)=>({element:m,domIndex:b,tabIndex:m.tabIndex})).sort((m,b)=>m.tabIndex===b.tabIndex?m.domIndex-b.domIndex:m.tabIndex-b.tabIndex);r(p.map(({element:m})=>m))},c=h=>{Cr(()=>{const p=J(t.initialFocusElement)??o()??h,m=t.onInitialFocus;let b;m&&(b=new CustomEvent(io,Js),h.addEventListener(io,m),h.dispatchEvent(b),h.removeEventListener(io,m)),b?.defaultPrevented!==!0&&p.focus()})},d=h=>{h.key==="Tab"&&h.shiftKey&&(h.preventDefault(),i().focus())},u=h=>{h.key==="Tab"&&!h.shiftKey&&(h.preventDefault(),o().focus())},f=h=>{h.key==="Tab"&&h.preventDefault()},g=h=>{Cr(()=>{if(!J(t.restoreFocus))return;const m=J(t.finalFocusElement)??s;if(!m)return;let b;const w=t.onFinalFocus;w&&(b=new CustomEvent(so,Js),h.addEventListener(so,w),h.dispatchEvent(b),h.removeEventListener(so,w)),b?.defaultPrevented!==!0&&m.focus()})}},gg=hg,pg=gg,mg=e=>{const t=C(()=>{const s=J(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=O(J(e.show)?"present":"hidden");let i="none";return T(s=>{const a=J(e.show);return H(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),T(()=>{const s=J(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const u=n().includes(c.animationName);c.target===s&&u&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),K(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},yg=mg,Zs=yg,bg=ce(),wg=e=>e?$n(`dialog-${e}`):bg,Qs=ce(),vg=e=>e?$n(`dialog-internal-${e}`):Qs,Pt=e=>{if(!e){const n=he(Qs);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=to(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},xg="div",Sg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent),i=C(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return y(eg,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,L({ref(l){var c=Kn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??xg},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()}}))}})}})}})},kg=Sg,Eg="div",Cg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().overlayPresent),i=C(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const s=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,L({get as(){return t.as??Eg},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()}}))}})})()}})},Og=Cg,_g=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=ng(),s=C(a=>a||o()&&i(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(Wo,L(n,{get children(){return a()}}))}})})()}})},Pg=_g,ao=!0,Ag=e=>{const t=L({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??ao),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??ao),preventScroll:()=>!!(e.modal??ao),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Te()},e),[n,r]=eo({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Ws({value:()=>t.labelId??Te()}),[a,l,c]=Ws({value:()=>t.descriptionId??Te()}),[d,u]=O(null),[f,g]=O(null),[h,p]=O(null),{present:m}=Zs({show:n,element:f}),{present:b}=Zs({show:n,element:h});pg({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Hi({element:f,enabled:()=>m()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const w={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return m()},get contentRef(){return f()},get overlayPresent(){return b()},get overlayRef(){return h()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},v=Ys(()=>t.children),x=()=>{const E=v()();return Yt(E)?E(w):E};return C(()=>{const E=wg(t.contextId),k=vg(t.contextId);return y(E.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:b,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:b,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:g,setOverlayRef:p,triggerRef:d,setTriggerRef:u}},get children(){return H(()=>x())}})}})})},Tg=Ag,Lg="button",Mg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=C(()=>Pt(t.contextId));return y(dg,L({ref(i){var s=Kn(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Lg},onClick:i=>{!rg(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=Mg,zn=e=>typeof e=="function"?e():e,ea=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Ig(e){const t=L({enabled:!0,dimension:"both"},e),[n,r]=O(!1),[o,i]=O(null);let s=null;T(()=>{const c=zn(t.element),d=zn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],f=zn(t.dimension);f==="both"?s?s[0]!==u[0]&&s[1]!==u[1]&&(ke(()=>{i(s),r(!0)}),ea(()=>{i(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u:s?Bn(f,s)!==Bn(f,u)&&(ke(()=>{i(Bn(f,s)),r(!0)}),ea(()=>{i(Bn(f,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u},l=()=>{if(!n())return;const c=zn(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,ke(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Bn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Rg=Ig,Fg=Rg;const $g=(e,t)=>e.length>0?()=>e(H(t)):e;function Ng(e,t){let n=0;const r=e.map((o,i)=>C(()=>(n=i,o()),void 0,cr));return C(()=>r.map(o=>o())[n],void 0,t)}function ta(e,t,n){let r=()=>t;const[o,i]=O(t,cr),s=C($g(e,()=>r()),t,cr);return[r=Ng([o,s],n),a=>i(()=>typeof a=="function"?a(H(r)):a)]}var Kg=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},zg=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Bg=(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]=Kg(o,t),u=d-l-r*c;(c!==0||u!==0)&&zg(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},Vg=e=>y(Dg,L({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),na=ce(),Ug=e=>e?$n(`drawer-${e}`):na,jg=e=>{if(!e){const n=he(na);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ra=ce(),qg=e=>e?$n(`drawer-internal-${e}`):ra,oa=e=>{if(!e){const n=he(ra);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ia=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vn(e,t)};const o=r[n-1]?Vn(r[n-1],t):void 0,i=r[n]?Vn(r[n],t):void 0;return{value:e,offset:Vn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Vn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},Hg=(e,t,n,r)=>{const o=sa("upper",e,r?n:t),i=sa("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},sa=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Wg=(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},Gg=void 0,Yg=e=>{const t=L({initialOpen:!1,snapPoints:[0,1],breakPoints:[Gg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,V)=>{const Q=$/V;return Q<1&&Q>-1?1:Q},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=eo({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=eo({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=O(),{transitioning:d,transitionSize:u}=Fg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,g]=O(!1),[h,p]=ta(()=>d()?"resizing":null),m=C(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[b,w]=O(!1);T(()=>{const $=o();H(()=>{b()!==$&&($?(w(!0),Hs(()=>{ke(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(ke(()=>{p("closing"),a(0)}),Hs(()=>{parseFloat(m().transitionDuration)===0&&v()})))})});const v=()=>{ke(()=>{w(!1),p(null)})},[x,_]=O(0);T(()=>{const $=l()?.contentRef();if(!$)return;k($);const V=new ResizeObserver(E);V.observe($),K(()=>{V.disconnect()})});const E=$=>{for(const V of $)V.target===l()?.contentRef()&&k(V.target)},k=$=>{const V=H(()=>x());switch(n.side){case"top":case"bottom":if(V===$.offsetHeight)return;_($.offsetHeight);break;case"left":case"right":if(V===$.offsetWidth)return;_($.offsetWidth);break}},F=C(()=>ia(s(),x())),[P,R]=ta(()=>F().offset),M=C(()=>x()?(x()-P())/x():0),I={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return f()},get isTransitioning(){return h()!==null},get transitionState(){return h()},get openPercentage(){return M()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},re=Ys(()=>n.children),Y=$=>{c(Pt(n.contextId));const V=re()();if(Yt(V)){const Q=L($,I);return V(Q)}return V};return C(()=>{const $=Ug(n.contextId),V=qg(n.contextId);return H(()=>y($.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:M,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:M,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:F,drawerStyles:m,setTransitionState:p,transitionSize:u,closeDrawer:v}},get children(){return y(Tg,L({get open(){return b()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:Q=>Y(Q)}))}})}}))})},Xg=Yg,Jg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=C(()=>oa(t.contextId)),c=C(()=>Pt(t.contextId)),d=C(()=>l().snapPoints().map((v,x)=>ia(v,l().drawerSize(),x,l().breakPoints()))),u=C(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),f=C(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"top":case"bottom":return`${v}px`}}),g=C(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"left":case"right":return`${v}px`}});T(()=>{c().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",w),document.addEventListener("touchend",w),K(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)}))});const h=v=>{Wg(v.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[v.clientX,v.clientY]))},p=v=>{b(v.target,v.clientX,v.clientY)},m=v=>{v.touches[0]&&b(v.target,v.touches[0].clientX,v.touches[0].clientY)},b=(v,x,_)=>{if(!r)return;if(!l().isDragging()||o===null){const F=window.getSelection();if(F&&F.toString().length>0){w();return}if(l().handleScrollableElements()){const P=[x,_].map((fe,$)=>i[$]-fe),R=Math.abs(P[0])>Math.abs(P[1])?"x":"y",M=R==="x"?P[0]:P[1];if(Math.abs(M)<.3)return;const I=c().contentRef(),[re,Y]=Bg(v,R,I);if(M>0&&Math.abs(re)>1||M<0&&Math.abs(Y)>0){w();return}}switch(l().side()){case"top":case"bottom":o=_;break;case"right":case"left":o=x}s=new Date,a=l().translate(),ke(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let E;switch(l().side()){case"top":E=-(o-_);break;case"bottom":E=o-_;break;case"right":E=o-x;break;case"left":E=-(o-x);break}E-=l().resolvedActiveSnapPoint().offset,E>0&&(E=l().dampFunction(E));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-E)},w=()=>{if(r=!1,!l().isDragging())return;const v=new Date,x=l().velocityFunction(-(a-l().translate()),v.getTime()-s.getTime()||1),_=l().translate()*x,E=Hg(d(),l().translate(),_,l().allowSkippingSnapPoints());ke(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),ke(()=>{l().setActiveSnapPoint(E.value),E.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(E.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(kg,L({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:f(),width:g(),...t.style}},onPointerDown:h,onTransitionEnd:()=>{ke(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return le(l().isTransitioning())},get"data-opening"(){return le(l().transitionState()==="opening")},get"data-closing"(){return le(l().transitionState()==="closing")},get"data-snapping"(){return le(l().transitionState()==="snapping")},get"data-resizing"(){return le(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Zg=Jg,Qg=e=>{const[t,n]=j(e,["contextId"]),r=C(()=>oa(t.contextId));return y(Og,L({get contextId(){return t.contextId},get"data-transitioning"(){return le(r().isTransitioning())},get"data-opening"(){return le(r().transitionState()==="opening")},get"data-closing"(){return le(r().transitionState()==="closing")},get"data-snapping"(){return le(r().transitionState()==="snapping")},get"data-resizing"(){return le(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},ep=Qg,tp=D('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const np=Xg,rp=Vg,op=Pg,ip=e=>{const[,t]=j(e,["class"]),n=jg();return y(ep,L({get class(){return Ge("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},sp=e=>{const[,t]=j(e,["class","children"]);return y(op,{get mount(){return Jt()},get children(){return[y(ip,{}),y(Zg,L({id:"smarttalks-list-content",get class(){return Ge("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[tp(),C(()=>e.children)]}}))]}})};var ap=D('<span class="font-semibold mt-2">'),lp=D('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),cp=D('<div class="flex flex-col space-y-2"><div>'),up=D('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),dp=D('<div class="flex flex-col items-start"><span class=text-slate-500>');const fp=({options:e,text:t,title:n})=>{const{pushMessage:r}=et(),[o,i]=O(!1),[s,a]=O(!1),[l,c]=O(),d=(f,g)=>{a(!1),i(!0),r(f,g)},u=f=>{const g=f.composedPath();for(const h of g)if(h.id==="smarttalks-list-content"){f.preventDefault();return}};return(()=>{var f=cp(),g=f.firstChild;return A(f,y(_t,{get children(){return t?.trim()}}),g),A(g,y(np,{get open(){return s()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(rp,{as:Ee,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??ft("selectOption")}}),y(sp,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var h=ap();return A(h,()=>n?.trim()??ft("selectOption")),h})(),(()=>{var h=lp();return A(h,y(pt,{each:e,children:p=>(()=>{var m=up(),b=m.firstChild;return A(b,()=>p.label?.trim()??""),A(m,y(pt,{get each(){return p.items},children:w=>y(Ee,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===w?"bg-slate-200":""}`},onClick:()=>c(w),get children(){return[(()=>{var v=dp(),x=v.firstChild;return A(v,()=>w.label?.trim(),x),A(x,()=>w.description?.trim()),v})(),y(Z,{get when(){return l()===w},get fallback(){return y(uf,{class:"size-4 text-slate-500"})},get children(){return y(cf,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),h})(),y(Ee,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return ft("send")}})]}})]}})),oe(()=>nt(g,o()?"opacity-50":"")),f})()};var hp=D("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const gp=e=>(()=>{var t=hp(),n=t.firstChild,r=n.nextSibling;return oe(o=>{var i=e.link,s=e.link;return i!==o.e&&ue(n,"src",o.e=i),s!==o.t&&ue(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var pp=D('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const mp=e=>(()=>{var t=pp(),n=t.firstChild,r=n.firstChild;return A(n,y(df,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(()=>ue(n,"href",e.link)),t})();var yp=D('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const bp=e=>(()=>{var t=yp(),n=t.firstChild,r=n.firstChild;return A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ue(n,"href",o.e=i),s!==o.t&&ue(r,"src",o.t=s),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var wp=D('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const vp=e=>(()=>{var t=wp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(i=>{var s=e.link,a=e.link;return s!==i.e&&ue(r,"src",i.e=s),a!==i.t&&ue(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var xp=D("<div>Media type not supported");const aa=e=>e.type==="image"?y(bp,e):e.type==="audio"?y(gp,e):e.type==="document"?y(mp,e):e.type==="video"?y(vp,e):xp(),lo=({text:e})=>y(_t,{get children(){return e?.trim()}});var Sp=D("<div>Unknown bot message type");const kp=e=>y(Th,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="buttons"?y(Dh,L(()=>e.buttons)):e.type==="list"?y(fp,L(()=>e.list)):e.type==="media"?y(aa,L(()=>e.media)):e.type==="link"?y(Nh,L(()=>e.link)):e.type==="cards"?y(Fh,L(()=>e.cards)):e.type==="date"?y(lo,{get text(){return e.text}}):Sp()}});var Ep=D('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Cp=e=>(()=>{var t=Ep(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var Op=D('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const _p=({children:e,createdAt:t})=>(()=>{var n=Op(),r=n.firstChild;return A(r,e),A(n,y(qs,{createdAt:t,anchor:"end"}),null),n})();var Pp=D("<div>Unknown user message type");const Ap=e=>y(_p,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="media"?y(aa,L(()=>e.media)):Pp()}});var Tp=D("<div>Unknown message origin");const Lp=e=>e.origin==="bot"?y(kp,e):e.origin==="user"?y(Ap,e):e.origin==="service"?y(Cp,e):Tp();function co(e){return we({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Mp=D('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),Dp=D("<div>");const uo=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o}=et(),{onOpen:i}=Jo(),s=(a=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},a)};return ne("reset",()=>{r()}),ht(()=>{o(),s(200)}),n(s),i(()=>s(200)),(()=>{var a=Mp(),l=e;return typeof l=="function"?or(l,a):e=a,A(a,y(pt,{get each(){return t()},get fallback(){return(()=>{var c=Dp();return A(c,()=>ft("emptyMessages")),c})()},children:c=>y(Lp,c)})),a})()};var Ip=D("<textarea>");const Rp=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Ip();return rt(n,L({get class(){return Ge("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md:text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var Fp=D('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const $p=e=>(()=>{var t=Fp();return rt(t,e,!0,!0),t})();var Np=D('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Kp=()=>(()=>{var e=Np(),t=e.firstChild;return A(e,y($p,{height:15}),t),e})();var zp=D('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"></div><div class="flex justify-center opacity-70 scale-95">');const fo=()=>{const{pushMessage:e}=et(),[t,n]=O(""),r=()=>{t().trim()&&(e(t()),n(""))},o=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),r())};return ne("setInput",i=>{i&&n(i)}),(()=>{var i=zp(),s=i.firstChild,a=s.firstChild,l=a.nextSibling;return A(a,y(Rp,{id:"chat-input",get placeholder(){return ft("inputPlaceholder")},get value(){return t()},onInput:c=>n(c.currentTarget.value),onKeyDown:o,class:"focus-visible:ring-primary min-h-[44px] max-h-[120px] py-3 leading-tight resize-none"}),null),A(a,y(Ee,{variant:"outline",class:"h-[44px] w-[44px] p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",onClick:r,get children(){return y(mc,{size:20})}}),null),A(l,y(Kp,{})),i})()};var Bp=D('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Vp=D("<span class=sr-only>Close"),Up=D('<div><div class="flex justify-center gap-3 items-center">'),jp=D("<span class=sr-only>Open"),qp=D("<span class=font-bold>"),Hp=D("<span>"),Wp=D('<div class="animate-pulse flex p-1">');const Gp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Jo(),{chatWidget:s}=ie(),[a,l]=O(!0),[c,d]=O("");setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const u=()=>(s()?.style.margin??5)/4,f=()=>s()?.style.position==="left"?{left:`${u()}rem`}:{right:`${u()}rem`};return ne("open",()=>{o()}),ne("close",()=>{i()}),ne("toggle",()=>{r()}),ne("onAnswer",g=>{g.text&&d(g.text),o()}),(()=>{var g=Up(),h=g.firstChild;return A(g,y(Z,{get when(){return n()},get children(){var p=Bp();return A(p,e),p}}),h),A(h,y(Z,{get when(){return s()?.whatsappBtn},get children(){return y(Ee,{onclick:()=>window.open(s()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return y(Ch,{class:"size-9",color:"white"})}})}}),null),A(h,y(Z,{get when(){return n()},get fallback(){return y(Ee,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,jp(),y(Z,{get when(){return s()?.balloonMessage},get children(){var p=Hp();return A(p,y(Z,{get when(){return c()},get fallback(){return y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=Wp();return A(m,y(co,{class:"size-2 animate-bounce"}),null),A(m,y(co,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(co,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return s()?.balloonMessage}})},get children(){var m=qp();return A(m,(()=>{var b=C(()=>c().length>20);return()=>b()?c().substring(0,17)+"...":c()})()),m}})),oe(()=>nt(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return y(Ee,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,Vp()]}})}}),null),oe(p=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(s()?.style.position==="left"?" items-start":" items-end"),b=f();return m!==p.e&&nt(g,p.e=m),p.t=an(g,b,p.t),p},{e:void 0,t:void 0}),g})()};var Yp=D('<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}=ie(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Yp();return an(r,n),A(r,e),r})()};var Jp=D("<div id=smarttalks-widget>");const Zp=({children:e})=>{const{chatWidget:t}=ie(),[n,r]=O(!1),[o,i]=O(!1),[s,a]=O("100%"),l=()=>{typeof window<"u"&&i(window.innerWidth<768)},c=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};T(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),ht(()=>{l(),window.addEventListener("resize",l),window.visualViewport&&(window.visualViewport.addEventListener("resize",c),window.visualViewport.addEventListener("scroll",c))}),K(()=>{window.removeEventListener("resize",l),window.visualViewport&&(window.visualViewport.removeEventListener("resize",c),window.visualViewport.removeEventListener("scroll",c)),document.body.style.overflow="",document.body.style.position=""});const d=()=>(t()?.style.margin??5)/4,u=()=>{if(o())return{height:s(),top:"0px"};const f={};return t()?.fullscreen?(f.height="100%",f["max-height"]="100%",f.width="100%",f["max-width"]="100%",f.bottom=0,f.left=0):t()?.style.position&&(f[t()?.style.position||"right"]=`${d()}rem`),f};return ne("open",()=>{r(!0),ee("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),ne("close",()=>{r(!1),ee("onClose")}),ne("toggle",()=>{r(!n()),ee("onToggle")}),ne("onAnswer",()=>{r(!0),ee("onOpen")}),setTimeout(()=>{r(!0),ee("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var f=Jp();return A(f,e),oe(g=>{var h=`
181
+ */function Yd(e,t){return t?Hc([e.clientX,e.clientY],t):!1}function Xd(e){const t=Ct(),n=Ni(),r=gs(),o=Me({placement:"bottom-start"},e),[i,s]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=O(),[f,g]=O(),[h,p]=O(),[m,b]=O(),[w,v]=O(!0),[x,_]=O(s.placement),[E,k]=O([]),[F,P]=O([]),{DomCollectionProvider:R}=ju({items:F,onItemsChange:P}),M=xi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:U=>i.onOpenChange?.(U)}),I=fu(()=>t.forceMount()||M.isOpen()),re=Mu({selectionMode:"none",dataSource:F}),Y=U=>{v(U),M.open()},fe=(U=!1)=>{M.close(),U&&r&&r.close(!0)},$=U=>{v(U),M.toggle()},V=()=>{const U=m();U&&(de(U),re.selectionManager().setFocused(!0),re.selectionManager().setFocusedKey(void 0))},Q=U=>{k(go=>[...go,U]);const Un=r?.registerNestedMenu(U);return()=>{k(go=>dr(go,U)),Un?.()}},se=U=>c===l?.side&&Yd(U,l?.area),At=U=>{se(U)&&U.preventDefault()},Ae=U=>{se(U)||V()},dm=U=>{se(U)&&U.preventDefault()};cu({isDisabled:()=>!(r==null&&M.isOpen()&&t.isModal()),targets:()=>[m(),...E()].filter(Boolean)}),T(()=>{const U=m();if(!U||!r)return;const Un=r.registerNestedMenu(U);K(()=>{Un()})});const fm={dataset:C(()=>({"data-expanded":M.isOpen()?"":void 0,"data-closed":M.isOpen()?void 0:""})),isOpen:M.isOpen,contentPresence:I,nestedMenus:E,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:w,listState:()=>re,parentMenuContext:()=>r,triggerRef:h,contentRef:m,triggerId:d,contentId:f,setTriggerRef:p,setContentRef:b,open:Y,close:fe,toggle:$,focusContent:V,onItemEnter:At,onItemLeave:Ae,onTriggerLeave:dm,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Q,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:yn(u),registerContentId:yn(g)};return y(R,{get children(){return y(hs.Provider,{value:fm,get children(){return y(Gd,L({anchorRef:h,contentRef:m,onCurrentPlacementChange:_},s))}})}})}const Jd=ce();function Zd(e){let t;const n=Ct(),r=Et(),o=Me({id:n.generateId(`item-${Te()}`)},e),[i,s]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=O(),[c,d]=O(),[u,f]=O(),g=()=>r.listState().selectionManager(),h=()=>s.id,p=()=>g().focusedKey()===h(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};qu({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??u()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const b=Tu({key:h,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),w=P=>{ge(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(de(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},v=P=>{ge(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},x=P=>{ge(P,i.onPointerUp),!i.disabled&&P.button===0&&m()},_=P=>{if(ge(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":m();break}},E=C(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=C(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),F={isChecked:()=>i.checked,dataset:k,setLabelRef:f,generateId:ui(()=>s.id),registerLabel:yn(l),registerDescription:yn(d)};return y(Jd.Provider,{value:F,get children(){return y(bn,L({as:"div",ref(P){var R=st(M=>t=M,i.ref);typeof R=="function"&&R(P)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return E()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return ve([i.onPointerDown,b.onPointerDown])},get onPointerUp(){return ve([x,b.onPointerUp])},get onClick(){return ve([i.onClick,b.onClick])},get onKeyDown(){return ve([_,b.onKeyDown])},get onMouseDown(){return ve([i.onMouseDown,b.onMouseDown])},get onFocus(){return ve([i.onFocus,b.onFocus])},onPointerMove:w,onPointerLeave:v},k,s))}})}const Qd=ce();function ms(){return he(Qd)}function ef(e){let t;const n=Ct(),r=Et(),o=ms(),i=Me({id:n.generateId(`content-${Te()}`)},e),[s,a]=j(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Iu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);au({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const u=m=>{if(Le(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},f=m=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},h=m=>{ge(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(ge(m,s.onPointerMove),m.pointerType!=="mouse")return;const b=m.target,w=l!==m.clientX;Le(m.currentTarget,b)&&w&&(r.setPointerDir(m.clientX>l?"right":"left"),l=m.clientX)};return T(()=>K(r.registerContentId(s.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y(rd,{get children(){return y(td,L({ref(m){var b=st(w=>{r.setContentRef(w),r.contentPresence.setRef(w),t=w},s.ref);typeof b=="function"&&b(m)},role:"menu",get id(){return s.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return C(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:f,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return ve([s.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return ve([s.onMouseDown,d.onMouseDown])},get onFocusIn(){return ve([s.onFocusIn,d.onFocusIn])},get onFocusOut(){return ve([s.onFocusOut,d.onFocusOut])},onPointerEnter:h,onPointerMove:p},()=>r.dataset(),a))}})}})}function tf(e){let t;const n=Ct(),r=Et(),[o,i]=j(e,["ref"]);return Hi({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(ef,L({ref(s){var a=st(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function nf(e){return y(Zd,L({role:"menuitem",closeOnSelect:!0},e))}function rf(e){const t=Et();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(Wo,e)}})}function of(e){const t=`menu-${Te()}`,n=Me({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=xi({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ui(()=>r.id),value:()=>r.value};return y(ps.Provider,{value:s,get children(){return y(Xd,L({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function sf(e){const t=Ct(),n=Et(),r=ms(),o=Me({id:t.generateId("trigger")},e),[i,s]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,T(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),T(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),T(()=>{n.isOpen()&&r.setValue(a)}),K(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=h=>{ge(h,i.onPointerDown),h.currentTarget.dataset.pointerType=h.pointerType,!i.disabled&&h.pointerType!=="touch"&&h.button===0&&l()},d=h=>{ge(h,i.onClick),i.disabled||h.currentTarget.dataset.pointerType==="touch"&&l()},u=h=>{if(ge(h,i.onKeyDown),!i.disabled)switch(h.key){case"Enter":case" ":case"ArrowDown":h.stopPropagation(),h.preventDefault(),Wc(h.currentTarget),n.toggle("first");break;case"ArrowUp":h.stopPropagation(),h.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.previousMenu();break}},f=h=>{ge(h,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=h=>{ge(h,i.onFocus),r!==void 0&&r.setValue(a)};return T(()=>K(n.registerTriggerId(i.id))),y($u,L({ref(h){var p=st(n.setTriggerRef,i.ref);typeof p=="function"&&p(h)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return C(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:f,onClick:d,onKeyDown:u,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function af(e){const t=Ct(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(tf,L({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||de(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function lf(e){const t=`dropdownmenu-${Te()}`,n=Me({id:t},e);return y(of,n)}function cf(e){return we({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function uf(e){return we({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function df(e){return we({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const ff=e=>y(lf,L({gutter:4},e)),hf=sf,gf=e=>{const[,t]=j(e,["class"]);return y(rf,{get mount(){return Jt()},get children(){return y(af,L({get class(){return Ge("z-50 min-w-[128px] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},pf=e=>{const[,t]=j(e,["class"]);return y(nf,L({get class(){return Ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function mf(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 yf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function bf(e,t,n){const r=`${Zt}/v1/messages`,o=lr(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,s)}async function wf(e,t,n){if(!e||!t||!n)return;const r=`${Zt}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const Fe=Object.create(null);Fe.open="0",Fe.close="1",Fe.ping="2",Fe.pong="3",Fe.message="4",Fe.upgrade="5",Fe.noop="6";const _n=Object.create(null);Object.keys(Fe).forEach(e=>{_n[Fe[e]]=e});const $r={type:"error",data:"parser error"},ys=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",bs=typeof ArrayBuffer=="function",ws=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Nr=({type:e,data:t},n,r)=>ys&&t instanceof Blob?n?r(t):vs(t,r):bs&&(t instanceof ArrayBuffer||ws(t))?n?r(t):vs(new Blob([t]),r):r(Fe[e]+(t||"")),vs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function xs(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kr;function vf(e,t){if(ys&&e.data instanceof Blob)return e.data.arrayBuffer().then(xs).then(t);if(bs&&(e.data instanceof ArrayBuffer||ws(e.data)))return t(xs(e.data));Nr(e,!1,n=>{Kr||(Kr=new TextEncoder),t(Kr.encode(n))})}const Ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Ss.length;e++)Wt[Ss.charCodeAt(e)]=e;const xf=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},Sf=typeof ArrayBuffer=="function",zr=(e,t)=>{if(typeof e!="string")return{type:"message",data:ks(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:kf(e.substring(1),t)}:_n[n]?e.length>1?{type:_n[n],data:e.substring(1)}:{type:_n[n]}:$r},kf=(e,t)=>{if(Sf){const n=xf(e);return ks(n,t)}else return{base64:!0,data:e}},ks=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Es="",Ef=(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))})})},Cf=(e,t)=>{const n=e.split(Es),r=[];for(let o=0;o<n.length;o++){const i=zr(n[o],t);if(r.push(i),i.type==="error")break}return r};function Of(){return new TransformStream({transform(e,t){vf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Br;function Pn(e){return e.reduce((t,n)=>t+n.length,0)}function An(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function _f(e,t){Br||(Br=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(Pn(n)<1)break;const l=An(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Pn(n)<2)break;const l=An(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pn(n)<8)break;const l=An(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue($r);break}o=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pn(n)<o)break;const l=An(n,o);a.enqueue(zr(i?l:Br.decode(l),t)),r=0}if(o===0||o>e){a.enqueue($r);break}}}})}const Cs=4;function te(e){if(e)return Pf(e)}function Pf(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")(),Af="arraybuffer";function mm(){}function Os(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Tf=Se.setTimeout,Lf=Se.clearTimeout;function Ln(e,t){t.useNativeTimers?(e.setTimeoutFn=Tf.bind(Se),e.clearTimeoutFn=Lf.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Mf=1.33;function Df(e){return typeof e=="string"?If(e):Math.ceil((e.byteLength||e.size)*Mf)}function If(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function _s(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Rf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Ff(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class $f extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Vr extends te{constructor(t){super(),this.writable=!1,Ln(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new $f(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=zr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Rf(t);return n.length?"?"+n:""}}class Nf 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)};Cf(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,Ef(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=_s()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Ps=!1;try{Ps=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Kf=Ps;function zf(){}class Bf extends Nf{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class $e extends te{constructor(t,n,r){super(),this.createRequest=t,Ln(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Os(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=$e.requestsCount++,$e.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=zf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $e.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if($e.requestsCount=0,$e.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",As);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,As,!1)}}function As(){for(let e in $e.requests)$e.requests.hasOwnProperty(e)&&$e.requests[e].abort()}const Vf=function(){const e=Ts({xdomain:!1});return e&&e.responseType!==null}();class Uf extends Bf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Vf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new $e(Ts,this.uri(),t)}}function Ts(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Kf))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ls=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class jf extends Vr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ls?{}:Os(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;Nr(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=_s()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ur=Se.WebSocket||Se.MozWebSocket;class qf extends jf{createSocket(t,n,r){return Ls?new Ur(t,n,r):n?new Ur(t,n):new Ur(t)}doWrite(t,n){this.ws.send(n)}}class Hf 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=_f(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Of();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 Wf={websocket:qf,webtransport:Hf,polling:Uf},Gf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yf=["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=Gf.exec(e||""),i={},s=14;for(;s--;)i[Yf[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=Xf(i,i.path),i.queryKey=Jf(i,i.query),i}function Xf(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 Jf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const qr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Mn=[];qr&&addEventListener("offline",()=>{Mn.forEach(e=>e())},!1);class Ze extends te{constructor(t,n){if(super(),this.binaryType=Af,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=jr(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=jr(n.host).host);Ln(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ff(this.opts.query)),qr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Mn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Cs,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=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(),qr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Mn.indexOf(this._offlineEventListener);r!==-1&&Mn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=Cs;class Zf extends Ze{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const f=new Error("probe error: "+u);f.transport=n.name,i(),this.emitReserved("upgradeError",f)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Qf=class extends Zf{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=>Wf[o]).filter(o=>!!o)),super(t,r)}};function eh(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 th=typeof ArrayBuffer=="function",nh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ms=Object.prototype.toString,rh=typeof Blob=="function"||typeof Blob<"u"&&Ms.call(Blob)==="[object BlobConstructor]",oh=typeof File=="function"||typeof File<"u"&&Ms.call(File)==="[object FileConstructor]";function Hr(e){return th&&(e instanceof ArrayBuffer||nh(e))||rh&&e instanceof Blob||oh&&e instanceof File}function Dn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Dn(e[n]))return!0;return!1}if(Hr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Dn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Dn(e[n]))return!0;return!1}function ih(e){const t=[],n=e.data,r=e;return r.data=Wr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Wr(e,t){if(!e)return e;if(Hr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Wr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Wr(e[r],t));return n}return e}function sh(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 ah=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],lh=5;var B;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(B||(B={}));class ch{constructor(t){this.replacer=t}encode(t){return(t.type===B.EVENT||t.type===B.ACK)&&Dn(t)?this.encodeAsBinary({type:t.type===B.EVENT?B.BINARY_EVENT:B.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===B.BINARY_EVENT||t.type===B.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=ih(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Ds(e){return Object.prototype.toString.call(e)==="[object Object]"}class Yr extends te{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===B.BINARY_EVENT;r||n.type===B.BINARY_ACK?(n.type=r?B.EVENT:B.ACK,this.reconstructor=new uh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Hr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(B[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===B.BINARY_EVENT||r.type===B.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Yr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case B.CONNECT:return Ds(n);case B.DISCONNECT:return n===void 0;case B.CONNECT_ERROR:return typeof n=="string"||Ds(n);case B.EVENT:case B.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&ah.indexOf(n[0])===-1);case B.ACK:case B.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class uh{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=sh(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const dh=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Yr,Encoder:ch,get PacketType(){return B},protocol:lh},Symbol.toStringTag,{value:"Module"}));function Pe(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const fh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Is extends te{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Pe(t,"open",this.onopen.bind(this)),Pe(t,"packet",this.onpacket.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(fh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:B.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),s.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:B.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case B.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case B.EVENT:case B.BINARY_EVENT:this.onevent(t);break;case B.ACK:case B.BINARY_ACK:this.onack(t);break;case B.DISCONNECT:this.ondisconnect();break;case B.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:B.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:B.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ot(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ot.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Ot.prototype.reset=function(){this.attempts=0},Ot.prototype.setMin=function(e){this.ms=e},Ot.prototype.setMax=function(e){this.max=e},Ot.prototype.setJitter=function(e){this.jitter=e};class Xr extends te{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ln(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ot({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||dh;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 Qf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Pe(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=Pe(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Pe(t,"ping",this.onping.bind(this)),Pe(t,"data",this.ondata.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this)),Pe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tn(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Is(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Gt={};function In(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=eh(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Gt[o]&&i in Gt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Xr(r,t):(Gt[o]||(Gt[o]=new Xr(r,t)),l=Gt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(In,{Manager:Xr,Socket:Is,io:In,connect:In});class Qe{static instance;constructor(){}static init(t){if(!Qe.instance){const n=lr();Qe.instance=In(Ua,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),Qe.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",Qe.instance.id)})}return Qe.instance}static on(t,n,r){const o=Qe.instance||this.init(n);o.off(t),o.on(t,r)}}const Rs=1e3*60*60*24,[Rn,Fs]=ni("smarttalks-widget-messages",{},Rs),$s=()=>{const{widgetId:e}=ie();return Rn[e()]??[]},hh=e=>{const{widgetId:t}=ie();Fs({...Rn,[t()]:[...Rn[t()]??[],e]})},gh=()=>{const{widgetId:e}=ie();Fs({...Rn,[e()]:[]})},[Ns,ph]=ni("smarttalks-widget-conversationinfo",{},Rs),Ks=()=>{const{widgetId:e}=ie();return Ns[e()]??{}},zs=e=>{const{widgetId:t}=ie();ph({...Ns,[t()]:e})},[mh,Jr]=O(!1),[yh,Bs]=O(!1),Vs=[],Us=()=>{Vs.forEach(e=>e())},bh=e=>Vs.push(e),Zr=e=>{const t=mf(e);if(hh(t),t.type==="media"){setTimeout(Us,200);return}Us()},wh=(e,t)=>{const{chatWidget:n,widgetId:r}=ie(),o=Ks();e.trim()&&(Zr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ee("onInput",e),Qe.on("message",r(),i=>{(i.contactId!==o.contactId||i.interactionId!==o.interactionId)&&zs({contactId:i.contactId,interactionId:i.interactionId});for(const s of i.messages)Zr(s),ee("onAnswer",s);Jr(!1),yf(i.debug)}),Jr(!0),bf(e,t,n()?._id).catch(i=>{console.error(i),Jr(!1)}))},vh=()=>{const{chatWidget:e}=ie(),t=Ks();Bs(!0),gh(),wf(e()?._id,t.contactId,t.interactionId).finally(()=>{zs({}),Bs(!1),js()}),ee("onReset")},js=()=>{const{chatWidget:e}=ie();if($s().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Zr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},et=()=>({getMessages:$s,pushMessage:wh,clearMessages:vh,addBalloonMessage:js,onMessage:bh,typing:mh,loading:yh});var xh=D("<span>");const Sh=()=>{const{clearMessages:e}=et();O(!1);const[t,n]=O(!1);return y(ff,{get open(){return t()},onOpenChange:n,get children(){return[y(hf,{get children(){return y(Ee,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(gc,{size:20})}})}}),y(gf,{get children(){return y(pf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(hc,{size:14}),(()=>{var r=xh();return A(r,()=>ft("restart")),r})()]}})}})]}})};function kh(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Eh(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function Ch(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function Oh(e){return we({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var _h=D('<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}=ie(),[t,n]=O(!1);let r=null;ht(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&c()});const o=f=>{const g=f;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async f=>{const g=f;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=async()=>{const f=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(f.webkitExitFullscreen)return f.webkitExitFullscreen(),!0;if(f.msExitFullscreen)return f.msExitFullscreen(),!0}catch{}return!1},a=f=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",f.classList.add("st-fullscreen"),n(!0)},l=f=>{f.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},c=async()=>{try{const f=Jt();if(!f)return;if(!t())o(f)&&await i(f)||a(f);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||l(f)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},d=()=>{const f=document,g=!!(document.fullscreenElement||f.webkitFullscreenElement||f.msFullscreenElement);if(n(g),!g)try{const h=Jt();h.classList.contains("st-fullscreen")&&l(h)}catch{}};document.addEventListener("fullscreenchange",d),document.addEventListener("webkitfullscreenchange",d);const u=()=>{e()?.mode==="popup"&&ee("close")};return ne("toggleFullscreen",()=>{c()}),(()=>{var f=_h(),g=f.firstChild;return A(f,y(dc,{}),g),A(g,y(Ee,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:c,get children(){return y(Z,{get when(){return t()},get fallback(){return y(Eh,{size:16})},get children(){return y(kh,{size:16})}})}}),null),A(g,y(Z,{get when(){return e()?.showSettings},get children(){return y(Sh,{})}}),null),A(g,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(Ee,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:u,get children(){return y(Oh,{size:16})}})}}),null),f})()};var Ph=D("<span>");const qs=({createdAt:e,anchor:t="end"})=>(()=>{var n=Ph();return nt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var Ah=D('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const Th=({children:e,createdAt:t})=>(()=>{var n=Ah(),r=n.firstChild;return A(r,e),A(n,y(qs,{createdAt:t,anchor:"start"}),null),n})();var Lh=D("<span>");const _t=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=za(Ba(n))),(()=>{var r=Lh();return r.innerHTML=n,rt(r,L({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Mh=D('<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}=et(),[o,i]=O(!1),s=(a,l)=>{i(!0),r(a,l)};return(()=>{var a=Mh(),l=a.firstChild,c=l.firstChild;A(a,y(_t,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?or(d,c):n=c,A(c,y(pt,{each:e,children:u=>y(Ee,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(u.label,u.value),get children(){return u.label?.trim()}})})),oe(()=>nt(l,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Ih=D('<div class="flex flex-col"><span>'),Rh=D("<a target=_blank><img><span></span><span>");const Fh=({options:e,text:t})=>(()=>{var n=Ih(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(pt,{each:e,children:o=>(()=>{var i=Rh(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),oe(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(i,"href",c.e=d),u!==c.t&&ue(s,"src",c.t=u),c},{e:void 0,t:void 0}),i})()}),null),n})();var $h=D("<a target=_blank>");const Nh=({url:e,text:t})=>(()=>{var n=$h();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,Hs=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Kh=e=>{const t=L({initialRegistered:!1},e),[n,r]=O(t.initialRegistered);return[C(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Ws=Kh,Yt=e=>typeof e=="function",zh=["button","color","file","image","reset","submit"],Bh=(e,t)=>e==="button"?!0:e==="input"&&t?zh.indexOf(t)!==-1:!1;function Vh(e){const[t,n]=O(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>H(()=>{let a;return Yt(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var eo=Vh,Fn=new Map,$n=(e,t)=>{if(Fn.has(e))return Fn.get(e);const n=ce(t);return Fn.set(e,n),n},to=e=>{const t=Fn.get(e);if(t)return he(t)},Nn=new Map,Uh=e=>{T(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Nn.get(e.key);o?o.activeCount++:Nn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);K(()=>{const i=Nn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Nn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},jh=Uh,qh=e=>{const t=L({enabled:!0},e);T(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Hh=qh,Wh=e=>{const t=L({enabled:!0},e);T(()=>{const{body:n}=document;G(t.enabled)&&jh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Gh=Wh,Yh=e=>{const t=L({enabled:!0,strategy:"pointerup"},e);T(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),i=G(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Xh=Yh,Jh=e=>{const t=L({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Hh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Xh({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}),Gh({enabled:t.noOutsidePointerEvents})},Zh=Jh,no=ce(),Qh=e=>C(()=>{if(he(no))return y(Gs,e);const r=Te(),[o,i]=O([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(d=>d!==l))};return y(no.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(Gs,e)}})}),Gs=e=>{const t=L({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(no),i=Te();T(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Zh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=C(()=>n.children),l=()=>{const c=a();return Yt(c)?c({get isLastLayer(){return s()}}):c};return H(()=>l())},eg=Qh,tg=()=>{const[e,t]=O(!1);return T(()=>t(!0)),e},ng=tg,rg=(e,t)=>(e&&(Yt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ro=(...e)=>e.some(t=>!!t()),og=e=>(...t)=>{for(const n of e)n&&n(...t)},Kn=(...e)=>og(e),le=e=>e?"":void 0,ig="div",sg=e=>{const[t,n]=j(e,["as"]),r=C(()=>t.as??ig);return C(()=>{const i=r();switch(typeof i){case"function":return H(()=>i(n));case"string":return y(ln,L({component:i},n))}})},oo=sg,ag=e=>{let t,n=!1;return()=>n?t:(n=!0,t=C(e))},Ys=ag,lg=e=>C(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),cg=lg,Xs="button",ug=e=>{const[t,n]=O(null),[r,o]=j(e,["as","ref","type"]),i=cg({element:t,fallback:Xs}),s=C(()=>Bh(i(),r.type));return y(oo,L({get as(){return r.as??Xs},ref(a){var l=Kn(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},dg=ug,fg='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',io="focusTrap.initialFocus",so="focusTrap.finalFocus",Js={bubbles:!1,cancelable:!0},hg=e=>{const t=L({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=O(null),o=C(()=>{const h=n();return h?h[0]??null:null}),i=C(()=>{const h=n();return h?h[h.length-1]??null:null});let s=null;const a=()=>{Cr(()=>{l(J(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(J(t.element))})};T(()=>{const h=J(t.element);if(h&&J(t.enabled)){s=document.activeElement,H(()=>{l(h),c(h)});const p=new MutationObserver(a);J(t.observeChanges)&&p.observe(h,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&p.disconnect(),r(null),g(h)})}}),T(()=>{const h=n();h===null||h.length!==0||(document.addEventListener("keydown",f),K(()=>{document.removeEventListener("keydown",f)}))}),T(()=>{const h=o();h&&(h.addEventListener("keydown",d),K(()=>{h.removeEventListener("keydown",d)}))}),T(()=>{const h=i();h&&(h.addEventListener("keydown",u),K(()=>{h.removeEventListener("keydown",u)}))});const l=h=>{const p=Array.from(h.querySelectorAll(fg)).map((m,b)=>({element:m,domIndex:b,tabIndex:m.tabIndex})).sort((m,b)=>m.tabIndex===b.tabIndex?m.domIndex-b.domIndex:m.tabIndex-b.tabIndex);r(p.map(({element:m})=>m))},c=h=>{Cr(()=>{const p=J(t.initialFocusElement)??o()??h,m=t.onInitialFocus;let b;m&&(b=new CustomEvent(io,Js),h.addEventListener(io,m),h.dispatchEvent(b),h.removeEventListener(io,m)),b?.defaultPrevented!==!0&&p.focus()})},d=h=>{h.key==="Tab"&&h.shiftKey&&(h.preventDefault(),i().focus())},u=h=>{h.key==="Tab"&&!h.shiftKey&&(h.preventDefault(),o().focus())},f=h=>{h.key==="Tab"&&h.preventDefault()},g=h=>{Cr(()=>{if(!J(t.restoreFocus))return;const m=J(t.finalFocusElement)??s;if(!m)return;let b;const w=t.onFinalFocus;w&&(b=new CustomEvent(so,Js),h.addEventListener(so,w),h.dispatchEvent(b),h.removeEventListener(so,w)),b?.defaultPrevented!==!0&&m.focus()})}},gg=hg,pg=gg,mg=e=>{const t=C(()=>{const s=J(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=O(J(e.show)?"present":"hidden");let i="none";return T(s=>{const a=J(e.show);return H(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),T(()=>{const s=J(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const u=n().includes(c.animationName);c.target===s&&u&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),K(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},yg=mg,Zs=yg,bg=ce(),wg=e=>e?$n(`dialog-${e}`):bg,Qs=ce(),vg=e=>e?$n(`dialog-internal-${e}`):Qs,Pt=e=>{if(!e){const n=he(Qs);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=to(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},xg="div",Sg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent),i=C(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return y(eg,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,L({ref(l){var c=Kn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??xg},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()}}))}})}})}})},kg=Sg,Eg="div",Cg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().overlayPresent),i=C(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const s=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(oo,L({get as(){return t.as??Eg},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()}}))}})})()}})},Og=Cg,_g=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=C(()=>Pt(t.contextId)),o=()=>ro(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=ng(),s=C(a=>a||o()&&i(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(Wo,L(n,{get children(){return a()}}))}})})()}})},Pg=_g,ao=!0,Ag=e=>{const t=L({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??ao),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??ao),preventScroll:()=>!!(e.modal??ao),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Te()},e),[n,r]=eo({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Ws({value:()=>t.labelId??Te()}),[a,l,c]=Ws({value:()=>t.descriptionId??Te()}),[d,u]=O(null),[f,g]=O(null),[h,p]=O(null),{present:m}=Zs({show:n,element:f}),{present:b}=Zs({show:n,element:h});pg({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Hi({element:f,enabled:()=>m()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const w={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return m()},get contentRef(){return f()},get overlayPresent(){return b()},get overlayRef(){return h()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},v=Ys(()=>t.children),x=()=>{const E=v()();return Yt(E)?E(w):E};return C(()=>{const E=wg(t.contextId),k=vg(t.contextId);return y(E.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:b,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:b,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:g,setOverlayRef:p,triggerRef:d,setTriggerRef:u}},get children(){return H(()=>x())}})}})})},Tg=Ag,Lg="button",Mg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=C(()=>Pt(t.contextId));return y(dg,L({ref(i){var s=Kn(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Lg},onClick:i=>{!rg(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=Mg,zn=e=>typeof e=="function"?e():e,ea=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Ig(e){const t=L({enabled:!0,dimension:"both"},e),[n,r]=O(!1),[o,i]=O(null);let s=null;T(()=>{const c=zn(t.element),d=zn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],f=zn(t.dimension);f==="both"?s?s[0]!==u[0]&&s[1]!==u[1]&&(ke(()=>{i(s),r(!0)}),ea(()=>{i(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u:s?Bn(f,s)!==Bn(f,u)&&(ke(()=>{i(Bn(f,s)),r(!0)}),ea(()=>{i(Bn(f,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=u},l=()=>{if(!n())return;const c=zn(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,ke(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Bn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Rg=Ig,Fg=Rg;const $g=(e,t)=>e.length>0?()=>e(H(t)):e;function Ng(e,t){let n=0;const r=e.map((o,i)=>C(()=>(n=i,o()),void 0,cr));return C(()=>r.map(o=>o())[n],void 0,t)}function ta(e,t,n){let r=()=>t;const[o,i]=O(t,cr),s=C($g(e,()=>r()),t,cr);return[r=Ng([o,s],n),a=>i(()=>typeof a=="function"?a(H(r)):a)]}var Kg=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},zg=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Bg=(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]=Kg(o,t),u=d-l-r*c;(c!==0||u!==0)&&zg(o,t)&&(i+=u,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},Vg=e=>y(Dg,L({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),na=ce(),Ug=e=>e?$n(`drawer-${e}`):na,jg=e=>{if(!e){const n=he(na);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ra=ce(),qg=e=>e?$n(`drawer-internal-${e}`):ra,oa=e=>{if(!e){const n=he(ra);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=to(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ia=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vn(e,t)};const o=r[n-1]?Vn(r[n-1],t):void 0,i=r[n]?Vn(r[n],t):void 0;return{value:e,offset:Vn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Vn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},Hg=(e,t,n,r)=>{const o=sa("upper",e,r?n:t),i=sa("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},sa=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Wg=(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},Gg=void 0,Yg=e=>{const t=L({initialOpen:!1,snapPoints:[0,1],breakPoints:[Gg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,V)=>{const Q=$/V;return Q<1&&Q>-1?1:Q},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=eo({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=eo({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=O(),{transitioning:d,transitionSize:u}=Fg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,g]=O(!1),[h,p]=ta(()=>d()?"resizing":null),m=C(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[b,w]=O(!1);T(()=>{const $=o();H(()=>{b()!==$&&($?(w(!0),Hs(()=>{ke(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(ke(()=>{p("closing"),a(0)}),Hs(()=>{parseFloat(m().transitionDuration)===0&&v()})))})});const v=()=>{ke(()=>{w(!1),p(null)})},[x,_]=O(0);T(()=>{const $=l()?.contentRef();if(!$)return;k($);const V=new ResizeObserver(E);V.observe($),K(()=>{V.disconnect()})});const E=$=>{for(const V of $)V.target===l()?.contentRef()&&k(V.target)},k=$=>{const V=H(()=>x());switch(n.side){case"top":case"bottom":if(V===$.offsetHeight)return;_($.offsetHeight);break;case"left":case"right":if(V===$.offsetWidth)return;_($.offsetWidth);break}},F=C(()=>ia(s(),x())),[P,R]=ta(()=>F().offset),M=C(()=>x()?(x()-P())/x():0),I={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return f()},get isTransitioning(){return h()!==null},get transitionState(){return h()},get openPercentage(){return M()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},re=Ys(()=>n.children),Y=$=>{c(Pt(n.contextId));const V=re()();if(Yt(V)){const Q=L($,I);return V(Q)}return V};return C(()=>{const $=Ug(n.contextId),V=qg(n.contextId);return H(()=>y($.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:M,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:M,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:F,drawerStyles:m,setTransitionState:p,transitionSize:u,closeDrawer:v}},get children(){return y(Tg,L({get open(){return b()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:Q=>Y(Q)}))}})}}))})},Xg=Yg,Jg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=C(()=>oa(t.contextId)),c=C(()=>Pt(t.contextId)),d=C(()=>l().snapPoints().map((v,x)=>ia(v,l().drawerSize(),x,l().breakPoints()))),u=C(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),f=C(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"top":case"bottom":return`${v}px`}}),g=C(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"left":case"right":return`${v}px`}});T(()=>{c().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",w),document.addEventListener("touchend",w),K(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)}))});const h=v=>{Wg(v.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[v.clientX,v.clientY]))},p=v=>{b(v.target,v.clientX,v.clientY)},m=v=>{v.touches[0]&&b(v.target,v.touches[0].clientX,v.touches[0].clientY)},b=(v,x,_)=>{if(!r)return;if(!l().isDragging()||o===null){const F=window.getSelection();if(F&&F.toString().length>0){w();return}if(l().handleScrollableElements()){const P=[x,_].map((fe,$)=>i[$]-fe),R=Math.abs(P[0])>Math.abs(P[1])?"x":"y",M=R==="x"?P[0]:P[1];if(Math.abs(M)<.3)return;const I=c().contentRef(),[re,Y]=Bg(v,R,I);if(M>0&&Math.abs(re)>1||M<0&&Math.abs(Y)>0){w();return}}switch(l().side()){case"top":case"bottom":o=_;break;case"right":case"left":o=x}s=new Date,a=l().translate(),ke(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let E;switch(l().side()){case"top":E=-(o-_);break;case"bottom":E=o-_;break;case"right":E=o-x;break;case"left":E=-(o-x);break}E-=l().resolvedActiveSnapPoint().offset,E>0&&(E=l().dampFunction(E));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-E)},w=()=>{if(r=!1,!l().isDragging())return;const v=new Date,x=l().velocityFunction(-(a-l().translate()),v.getTime()-s.getTime()||1),_=l().translate()*x,E=Hg(d(),l().translate(),_,l().allowSkippingSnapPoints());ke(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),ke(()=>{l().setActiveSnapPoint(E.value),E.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(E.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(kg,L({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:f(),width:g(),...t.style}},onPointerDown:h,onTransitionEnd:()=>{ke(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return le(l().isTransitioning())},get"data-opening"(){return le(l().transitionState()==="opening")},get"data-closing"(){return le(l().transitionState()==="closing")},get"data-snapping"(){return le(l().transitionState()==="snapping")},get"data-resizing"(){return le(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Zg=Jg,Qg=e=>{const[t,n]=j(e,["contextId"]),r=C(()=>oa(t.contextId));return y(Og,L({get contextId(){return t.contextId},get"data-transitioning"(){return le(r().isTransitioning())},get"data-opening"(){return le(r().transitionState()==="opening")},get"data-closing"(){return le(r().transitionState()==="closing")},get"data-snapping"(){return le(r().transitionState()==="snapping")},get"data-resizing"(){return le(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},ep=Qg,tp=D('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const np=Xg,rp=Vg,op=Pg,ip=e=>{const[,t]=j(e,["class"]),n=jg();return y(ep,L({get class(){return Ge("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},sp=e=>{const[,t]=j(e,["class","children"]);return y(op,{get mount(){return Jt()},get children(){return[y(ip,{}),y(Zg,L({id:"smarttalks-list-content",get class(){return Ge("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[tp(),C(()=>e.children)]}}))]}})};var ap=D('<span class="font-semibold mt-2">'),lp=D('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),cp=D('<div class="flex flex-col space-y-2"><div>'),up=D('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),dp=D('<div class="flex flex-col items-start"><span class=text-slate-500>');const fp=({options:e,text:t,title:n})=>{const{pushMessage:r}=et(),[o,i]=O(!1),[s,a]=O(!1),[l,c]=O(),d=(f,g)=>{a(!1),i(!0),r(f,g)},u=f=>{const g=f.composedPath();for(const h of g)if(h.id==="smarttalks-list-content"){f.preventDefault();return}};return(()=>{var f=cp(),g=f.firstChild;return A(f,y(_t,{get children(){return t?.trim()}}),g),A(g,y(np,{get open(){return s()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(rp,{as:Ee,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??ft("selectOption")}}),y(sp,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var h=ap();return A(h,()=>n?.trim()??ft("selectOption")),h})(),(()=>{var h=lp();return A(h,y(pt,{each:e,children:p=>(()=>{var m=up(),b=m.firstChild;return A(b,()=>p.label?.trim()??""),A(m,y(pt,{get each(){return p.items},children:w=>y(Ee,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===w?"bg-slate-200":""}`},onClick:()=>c(w),get children(){return[(()=>{var v=dp(),x=v.firstChild;return A(v,()=>w.label?.trim(),x),A(x,()=>w.description?.trim()),v})(),y(Z,{get when(){return l()===w},get fallback(){return y(uf,{class:"size-4 text-slate-500"})},get children(){return y(cf,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),h})(),y(Ee,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return ft("send")}})]}})]}})),oe(()=>nt(g,o()?"opacity-50":"")),f})()};var hp=D("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const gp=e=>(()=>{var t=hp(),n=t.firstChild,r=n.nextSibling;return oe(o=>{var i=e.link,s=e.link;return i!==o.e&&ue(n,"src",o.e=i),s!==o.t&&ue(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var pp=D('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const mp=e=>(()=>{var t=pp(),n=t.firstChild,r=n.firstChild;return A(n,y(df,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(()=>ue(n,"href",e.link)),t})();var yp=D('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const bp=e=>(()=>{var t=yp(),n=t.firstChild,r=n.firstChild;return A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ue(n,"href",o.e=i),s!==o.t&&ue(r,"src",o.t=s),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var wp=D('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const vp=e=>(()=>{var t=wp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(_t,{get children(){return e.text?.trim()}}),null),oe(i=>{var s=e.link,a=e.link;return s!==i.e&&ue(r,"src",i.e=s),a!==i.t&&ue(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var xp=D("<div>Media type not supported");const aa=e=>e.type==="image"?y(bp,e):e.type==="audio"?y(gp,e):e.type==="document"?y(mp,e):e.type==="video"?y(vp,e):xp(),lo=({text:e})=>y(_t,{get children(){return e?.trim()}});var Sp=D("<div>Unknown bot message type");const kp=e=>y(Th,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="buttons"?y(Dh,L(()=>e.buttons)):e.type==="list"?y(fp,L(()=>e.list)):e.type==="media"?y(aa,L(()=>e.media)):e.type==="link"?y(Nh,L(()=>e.link)):e.type==="cards"?y(Fh,L(()=>e.cards)):e.type==="date"?y(lo,{get text(){return e.text}}):Sp()}});var Ep=D('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Cp=e=>(()=>{var t=Ep(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var Op=D('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const _p=({children:e,createdAt:t})=>(()=>{var n=Op(),r=n.firstChild;return A(r,e),A(n,y(qs,{createdAt:t,anchor:"end"}),null),n})();var Pp=D("<div>Unknown user message type");const Ap=e=>y(_p,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(lo,{get text(){return e.text}}):e.type==="media"?y(aa,L(()=>e.media)):Pp()}});var Tp=D("<div>Unknown message origin");const Lp=e=>e.origin==="bot"?y(kp,e):e.origin==="user"?y(Ap,e):e.origin==="service"?y(Cp,e):Tp();function co(e){return we({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Mp=D('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),Dp=D("<div>");const uo=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o}=et(),{onOpen:i}=Jo(),s=(a=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},a)};return ne("reset",()=>{r()}),ht(()=>{o(),s(200)}),n(s),i(()=>s(200)),(()=>{var a=Mp(),l=e;return typeof l=="function"?or(l,a):e=a,A(a,y(pt,{get each(){return t()},get fallback(){return(()=>{var c=Dp();return A(c,()=>ft("emptyMessages")),c})()},children:c=>y(Lp,c)})),a})()};var Ip=D("<textarea>");const Rp=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Ip();return rt(n,L({get class(){return Ge("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md:text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var Fp=D('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const $p=e=>(()=>{var t=Fp();return rt(t,e,!0,!0),t})();var Np=D('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Kp=()=>(()=>{var e=Np(),t=e.firstChild;return A(e,y($p,{height:15}),t),e})();var zp=D('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"></div><div class="flex justify-center opacity-70 scale-95">');const fo=()=>{const{pushMessage:e}=et(),[t,n]=O(""),r=()=>{t().trim()&&(e(t()),n(""))},o=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),r())};return ne("setInput",i=>{i&&n(i)}),(()=>{var i=zp(),s=i.firstChild,a=s.firstChild,l=a.nextSibling;return A(a,y(Rp,{id:"chat-input",get placeholder(){return ft("inputPlaceholder")},get value(){return t()},onInput:c=>n(c.currentTarget.value),onKeyDown:o,class:"focus-visible:ring-primary min-h-[44px] max-h-[120px] py-3 leading-tight resize-none"}),null),A(a,y(Ee,{variant:"outline",class:"h-[44px] w-[44px] p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",onClick:r,get children(){return y(mc,{size:20})}}),null),A(l,y(Kp,{})),i})()};var Bp=D('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Vp=D("<span class=sr-only>Close"),Up=D('<div><div class="flex justify-center gap-3 items-center">'),jp=D("<span class=sr-only>Open"),qp=D("<span class=font-bold>"),Hp=D("<span>"),Wp=D('<div class="animate-pulse flex p-1">');const Gp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Jo(),{chatWidget:s}=ie(),[a,l]=O(!0),[c,d]=O("");setTimeout(()=>l(!1),2e3),s()?.openDelay&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const u=()=>(s()?.style.margin??5)/4,f=()=>s()?.style.position==="left"?{left:`${u()}rem`}:{right:`${u()}rem`};return ne("open",()=>{o()}),ne("close",()=>{i()}),ne("toggle",()=>{r()}),ne("onAnswer",g=>{g.text&&d(g.text),o()}),(()=>{var g=Up(),h=g.firstChild;return A(g,y(Z,{get when(){return n()},get children(){var p=Bp();return A(p,e),p}}),h),A(h,y(Z,{get when(){return s()?.whatsappBtn},get children(){return y(Ee,{onclick:()=>window.open(s()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return y(Ch,{class:"size-9",color:"white"})}})}}),null),A(h,y(Z,{get when(){return n()},get fallback(){return y(Ee,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,jp(),y(Z,{get when(){return s()?.balloonMessage},get children(){var p=Hp();return A(p,y(Z,{get when(){return c()},get fallback(){return y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=Wp();return A(m,y(co,{class:"size-2 animate-bounce"}),null),A(m,y(co,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(co,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return C(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=qp();return A(m,(()=>{var b=C(()=>c().length>20);return()=>b()?c().substring(0,17)+"...":c()})()),m}})),oe(()=>nt(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return y(Ee,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,Vp()]}})}}),null),oe(p=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(s()?.style.position==="left"?" items-start":" items-end"),b=f();return m!==p.e&&nt(g,p.e=m),p.t=an(g,b,p.t),p},{e:void 0,t:void 0}),g})()};var Yp=D('<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}=ie(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Yp();return an(r,n),A(r,e),r})()};var Jp=D("<div id=smarttalks-widget>");const Zp=({children:e})=>{const{chatWidget:t}=ie(),[n,r]=O(!1),[o,i]=O(!1),[s,a]=O("100%"),l=()=>{typeof window<"u"&&i(window.innerWidth<768)},c=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};T(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),ht(()=>{l(),window.addEventListener("resize",l),window.visualViewport&&(window.visualViewport.addEventListener("resize",c),window.visualViewport.addEventListener("scroll",c))}),K(()=>{window.removeEventListener("resize",l),window.visualViewport&&(window.visualViewport.removeEventListener("resize",c),window.visualViewport.removeEventListener("scroll",c)),document.body.style.overflow="",document.body.style.position=""});const d=()=>(t()?.style.margin??5)/4,u=()=>{if(o())return{height:s(),top:"0px"};const f={};return t()?.fullscreen?(f.height="100%",f["max-height"]="100%",f.width="100%",f["max-width"]="100%",f.bottom=0,f.left=0):t()?.style.position&&(f[t()?.style.position||"right"]=`${d()}rem`),f};return ne("open",()=>{r(!0),ee("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),ne("close",()=>{r(!1),ee("onClose")}),ne("toggle",()=>{r(!n()),ee("onToggle")}),ne("onAnswer",()=>{r(!0),ee("onOpen")}),setTimeout(()=>{r(!0),ee("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var f=Jp();return A(f,e),oe(g=>{var h=`
182
182
  fixed flex flex-col bg-background text-foreground shadow-xl overflow-hidden z-[99999]
183
183
 
184
184
  ${o()?"inset-x-0 top-0 w-full rounded-none m-0":"transition-all duration-300 ease-in-out w-[400px] h-[min(85vh,700px)] md:w-[400px] md:max-h-[90%] md:rounded-xl md:bottom-5"}