@smarttalks.ai/widget 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +5830 -5314
- package/lib/index.umd.cjs +28 -28
- package/package.json +1 -1
package/lib/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(ir){typeof define=="function"&&define.amd?define(ir):ir()})((function(){"use strict";function ir(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=ir(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ir(e))&&(r&&(r+=" "),r+=t);return r}const Ti="-",bh=e=>{const t=xh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Ti);return a[0]===""&&a.length!==1&&a.shift(),rc(a,t)||wh(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&r[s]?[...c,...r[s]]:c}}},rc=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?rc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Ti);return t.validators.find(({validator:s})=>s(i))?.classGroupId},oc=/^\[(.+)\]$/,wh=e=>{if(oc.test(e)){const t=oc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},xh=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Eh(Object.entries(e.classGroups),n).forEach(([i,s])=>{Ai(s,r,i,t)}),r},Ai=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ic(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Sh(o)){Ai(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Ai(s,ic(t,i),n,r)})})},ic=(e,t)=>{let n=e;return t.split(Ti).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sh=e=>e.isThemeGetter,Eh=(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,Ph=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)}}},sc="!",Ch=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const c=[];let l=0,u=0,d;for(let m=0;m<a.length;m++){let y=a[m];if(l===0){if(y===o&&(r||a.slice(m,m+i)===t)){c.push(a.slice(u,m)),u=m+i;continue}if(y==="/"){d=m;continue}}y==="["?l++:y==="]"&&l--}const h=c.length===0?a:a.substring(u),g=h.startsWith(sc),f=g?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},kh=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},Oh=e=>({cache:Ph(e.cacheSize),parseClassName:Ch(e),...bh(e)}),Th=/\s+/,Ah=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Th);let a="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:g}=n(l);let f=!!g,p=r(f?h.substring(0,g):h);if(!p){if(!f){a=l+(a.length>0?" "+a:a);continue}if(p=r(h),!p){a=l+(a.length>0?" "+a:a);continue}f=!1}const m=kh(u).join(":"),y=d?m+sc:m,b=y+p;if(i.includes(b))continue;i.push(b);const x=o(p,f);for(let w=0;w<x.length;++w){const C=x[w];i.push(y+C)}a=l+(a.length>0?" "+a:a)}return a};function $h(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ac(t))&&(r&&(r+=" "),r+=n);return r}const ac=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ac(e[r]))&&(n&&(n+=" "),n+=t);return n};function Dh(e,...t){let n,r,o,i=s;function s(c){const l=t.reduce((u,d)=>d(u),e());return n=Oh(l),r=n.cache.get,o=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=Ah(c,n);return o(c,u),u}return function(){return i($h.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},cc=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rh=/^\d+\/\d+$/,Mh=new Set(["px","full","screen"]),Ih=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_h=/\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$/,Lh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wt=e=>Pn(e)||Mh.has(e)||Rh.test(e),Bt=e=>Cn(e,"length",Hh),Pn=e=>!!e&&!Number.isNaN(Number(e)),$i=e=>Cn(e,"number",Pn),sr=e=>!!e&&Number.isInteger(Number(e)),Vh=e=>e.endsWith("%")&&Pn(e.slice(0,-1)),H=e=>cc.test(e),Kt=e=>Ih.test(e),Bh=new Set(["length","size","percentage"]),Kh=e=>Cn(e,Bh,lc),zh=e=>Cn(e,"position",lc),Uh=new Set(["image","url"]),jh=e=>Cn(e,Uh,qh),Wh=e=>Cn(e,"",Yh),ar=()=>!0,Cn=(e,t,n)=>{const r=cc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Hh=e=>_h.test(e)&&!Lh.test(e),lc=()=>!1,Yh=e=>Nh.test(e),qh=e=>Fh.test(e),Gh=Dh(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),a=ue("borderWidth"),c=ue("contrast"),l=ue("grayscale"),u=ue("hueRotate"),d=ue("invert"),h=ue("gap"),g=ue("gradientColorStops"),f=ue("gradientColorStopPositions"),p=ue("inset"),m=ue("margin"),y=ue("opacity"),b=ue("padding"),x=ue("saturate"),w=ue("scale"),C=ue("sepia"),S=ue("skew"),O=ue("space"),D=ue("translate"),P=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",H,t],$=()=>[H,t],K=()=>["",wt,Bt],U=()=>["auto",Pn,H],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",H],qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$e=()=>[Pn,H];return{cacheSize:500,separator:":",theme:{colors:[ar],spacing:[wt,Bt],blur:["none","",Kt,H],brightness:$e(),borderColor:[e],borderRadius:["none","","full",Kt,H],borderSpacing:$(),borderWidth:K(),contrast:$e(),grayscale:q(),hueRotate:$e(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Vh,Bt],inset:I(),margin:I(),opacity:$e(),padding:$(),saturate:$e(),scale:$e(),sepia:q(),skew:$e(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",H]}],container:["container"],columns:[{columns:[Kt]}],"break-after":[{"break-after":qe()}],"break-before":[{"break-before":qe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Q(),H]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sr,H]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",H]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",sr,H]}],"grid-cols":[{"grid-cols":[ar]}],"col-start-end":[{col:["auto",{span:["full",sr,H]},H]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ar]}],"row-start-end":[{row:["auto",{span:[sr,H]},H]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",H]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",H]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",H,t]}],"min-w":[{"min-w":[H,t,"min","max","fit"]}],"max-w":[{"max-w":[H,t,"none","full","min","max","fit","prose",{screen:[Kt]},Kt]}],h:[{h:[H,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[H,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Kt,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$i]}],"font-family":[{font:[ar]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",H]}],"line-clamp":[{"line-clamp":["none",Pn,$i]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",wt,H]}],"list-image":[{"list-image":["none",H]}],"list-style-type":[{list:["none","disc","decimal",H]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",wt,Bt]}],"underline-offset":[{"underline-offset":["auto",wt,H]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),zh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:F()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[wt,H]}],"outline-w":[{outline:[wt,Bt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[wt,Bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Kt,Wh]}],"shadow-color":[{shadow:[ar]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...j(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Kt,H]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",H]}],duration:[{duration:$e()}],ease:[{ease:["linear","in","out","in-out",H]}],delay:[{delay:$e()}],animate:[{animate:["none","spin","ping","pulse","bounce",H]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[sr,H]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",H]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",H]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",H]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[wt,Bt,$i]}],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 zt(...e){return Gh(nc(e))}function Xh(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",Wr(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Wr(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Wr(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Wr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Wr(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,c=0,l=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),l=(i+o)/2,c=s==0?0:s/(1-Math.abs(2*l-1)),c=+(c*100).toFixed(1),l=+(l*100).toFixed(1),a+","+c+"%,"+l+"%"}function Zh(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 Jh(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function Hr(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Qh={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function kn(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Qh[n][e]}const On="https://heimdall.smarttalks.ai/api",eg="wss://heimdall.smarttalks.ai",uc="smarttalkswidget";function he(e,...t){window.postMessage({from:uc,command:e,args:t})}function pe(e,t){window.addEventListener("message",n=>{n.origin===window.location.origin&&n.data?.from===uc&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function tg(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{he("registerContactData",e)},registerMetadata:e=>{he("registerMetadata",e)},open:e=>{he("open"),e&&he("setInput",e)},close:()=>{he("close")},toggle:()=>{he("toggle")},toggleFullscreen:()=>{he("toggleFullscreen")},reset:()=>{he("reset")},onOpen:e=>{pe("onOpen",e)},onClose:e=>{pe("onClose",e)},onToggle:e=>{pe("onToggle",e)},onReset:e=>{pe("onReset",e)},onInput:e=>{pe("onInput",e)},onAnswer:e=>{pe("onAnswer",e)},onLoad:e=>{pe("onLoad",e)}})}function dc(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function fc(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 ng(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),pc(o.value)&&!ag(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 rg(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=pc(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=sg(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function og(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function ig(e,t){const n=ng(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?hc(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&gc(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){const l=i.value;i.value=c,i.reflect&&gc(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,c,l)},enumerable:!0,configurable:!0})}),n}function hc(e){if(e)try{return JSON.parse(e)}catch{return e}}function gc(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 sg(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function pc(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function ag(e){return Object.prototype.toString.call(e)==="[object Function]"}function cg(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Di;function lg(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=ig(this,t);const o=og(this.props),i=this.Component,s=Di;try{Di=this,this.__initialized=!0,cg(i)?new i(o,{element:this}):i(o,{element:this})}finally{Di=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?hc(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 ug(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=lg(r,rg(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const dg=!1,fg=(e,t)=>e===t,Ve=Symbol("solid-proxy"),mc=typeof Proxy=="function",Yr=Symbol("solid-track"),qr={equals:fg};let yc=Ec;const xt=1,Gr=2,vc={owned:null,cleanups:null,context:null,owner:null},Ri={};var te=null;let Mi=null,hg=null,se=null,be=null,St=null,Xr=0;function Xe(e,t){const n=se,r=te,o=e.length===0,i=t===void 0?r:t,s=o?vc:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ne(()=>cr(s)));te=s,se=null;try{return Et(a,!0)}finally{se=n,te=r}}function L(e,t){t=t?Object.assign({},qr,t):qr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Sc(n,o));return[xc.bind(n),r]}function bc(e,t,n){const r=Zr(e,t,!0,xt);Tn(r)}function ye(e,t,n){const r=Zr(e,t,!1,xt);Tn(r)}function V(e,t,n){yc=wg;const r=Zr(e,t,!1,xt);(!n||!n.render)&&(r.user=!0),St?St.push(r):Tn(r)}function _(e,t,n){n=n?Object.assign({},qr,n):qr;const r=Zr(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Tn(r),xc.bind(r)}function gg(e){return e&&typeof e=="object"&&"then"in e}function pg(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=Ri,c=!1,l="initialValue"in i,u=typeof r=="function"&&_(r);const d=new Set,[h,g]=(i.storage||L)(i.initialValue),[f,p]=L(void 0),[m,y]=L(void 0,{equals:!1}),[b,x]=L(l?"ready":"unresolved");function w(P,T,I,$){return s===P&&(s=null,$!==void 0&&(l=!0),(P===a||T===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated($,{value:T})),a=Ri,C(T,I)),T}function C(P,T){Et(()=>{T===void 0&&g(()=>P),x(T!==void 0?"errored":l?"ready":"unresolved"),p(T);for(const I of d.keys())I.decrement();d.clear()},!1)}function S(){const P=yg,T=h(),I=f();if(I!==void 0&&!s)throw I;return se&&se.user,T}function O(P=!0){if(P!==!1&&c)return;c=!1;const T=u?u():r;if(T==null||T===!1){w(s,ne(h));return}let I;const $=a!==Ri?a:ne(()=>{try{return o(T,{value:h(),refetching:P})}catch(K){I=K}});if(I!==void 0){w(s,void 0,eo(I),T);return}else if(!gg($))return w(s,$,void 0,T),$;return s=$,"v"in $?($.s===1?w(s,$.v,void 0,T):w(s,void 0,eo($.v),T),$):(c=!0,queueMicrotask(()=>c=!1),Et(()=>{x(l?"refreshing":"pending"),y()},!1),$.then(K=>w($,K,void 0,T),K=>w($,void 0,eo(K),T)))}Object.defineProperties(S,{state:{get:()=>b()},error:{get:()=>f()},loading:{get(){const P=b();return P==="pending"||P==="refreshing"}},latest:{get(){if(!l)return S();const P=f();if(P&&!s)throw P;return h()}}});let D=te;return u?bc(()=>(D=te,O(!1))):O(!1),[S,{refetch:P=>wc(D,()=>O(P)),mutate:g}]}function Ze(e){return Et(e,!1)}function ne(e){if(se===null)return e();const t=se;se=null;try{return e()}finally{se=t}}function sn(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(i)return i=!1,s;const c=ne(()=>t(a,o,s));return o=a,c}}function an(e){V(()=>ne(e))}function Y(e){return te===null||(te.cleanups===null?te.cleanups=[e]:te.cleanups.push(e)),e}function Ii(){return se}function mg(){return te}function wc(e,t){const n=te,r=se;te=e,se=null;try{return Et(t,!0)}catch(o){Li(o)}finally{te=n,se=r}}function xe(e,t){const n=Symbol("context");return{id:n,Provider:xg(n),defaultValue:e}}function Ce(e){let t;return te&&te.context&&(t=te.context[e.id])!==void 0?t:e.defaultValue}function _i(e){const t=_(e),n=_(()=>Ni(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let yg;function xc(){if(this.sources&&this.state)if(this.state===xt)Tn(this);else{const e=be;be=null,Et(()=>Qr(this),!1),be=e}if(se){const e=this.observers;if(!e||e[e.length-1]!==se){const t=e?e.length:0;se.sources?(se.sources.push(this),se.sourceSlots.push(t)):(se.sources=[this],se.sourceSlots=[t]),e?(e.push(se),this.observerSlots.push(se.sources.length-1)):(this.observers=[se],this.observerSlots=[se.sources.length-1])}}return this.value}function Sc(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Et(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Mi&&Mi.running;s&&Mi.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?be.push(i):St.push(i),i.observers&&Pc(i)),s||(i.state=xt)}if(be.length>1e6)throw be=[],new Error},!1)),t}function Tn(e){if(!e.fn)return;cr(e);const t=Xr;vg(e,e.value,t)}function vg(e,t,n){let r;const o=te,i=se;se=te=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=xt,e.owned&&e.owned.forEach(cr),e.owned=null),e.updatedAt=n+1,Li(s)}finally{se=i,te=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Sc(e,r):e.value=r,e.updatedAt=n)}function Zr(e,t,n,r=xt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:te,context:te?te.context:null,pure:n};return te===null||te!==vc&&(te.owned?te.owned.push(i):te.owned=[i]),i}function Jr(e){if(e.state===0)return;if(e.state===Gr)return Qr(e);if(e.suspense&&ne(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Xr);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===xt)Tn(e);else if(e.state===Gr){const r=be;be=null,Et(()=>Qr(e,t[0]),!1),be=r}}function Et(e,t){if(be)return e();let n=!1;t||(be=[]),St?n=!0:St=[],Xr++;try{const r=e();return bg(n),r}catch(r){n||(St=null),be=null,Li(r)}}function bg(e){if(be&&(Ec(be),be=null),e)return;const t=St;St=null,t.length&&Et(()=>yc(t),!1)}function Ec(e){for(let t=0;t<e.length;t++)Jr(e[t])}function wg(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jr(r)}for(t=0;t<n;t++)Jr(e[t])}function Qr(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===xt?r!==t&&(!r.updatedAt||r.updatedAt<Xr)&&Jr(r):o===Gr&&Qr(r,t)}}}function Pc(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Gr,n.pure?be.push(n):St.push(n),n.observers&&Pc(n))}}function cr(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)cr(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)cr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function eo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Li(e,t=te){throw eo(e)}function Ni(e){if(typeof e=="function"&&!e.length)return Ni(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Ni(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function xg(e,t){return function(r){let o;return ye(()=>o=ne(()=>(te.context={...te.context,[e]:r.value},_i(()=>r.children))),void 0),o}}const Fi=Symbol("fallback");function to(e){for(let t=0;t<e.length;t++)e[t]()}function Sg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Y(()=>to(i)),()=>{let c=e()||[],l=c.length,u,d;return c[Yr],ne(()=>{let g,f,p,m,y,b,x,w,C;if(l===0)s!==0&&(to(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Fi],o[0]=Xe(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(l),d=0;d<l;d++)r[d]=c[d],o[d]=Xe(h);s=l}else{for(p=new Array(l),m=new Array(l),a&&(y=new Array(l)),b=0,x=Math.min(s,l);b<x&&r[b]===c[b];b++);for(x=s-1,w=l-1;x>=b&&w>=b&&r[x]===c[w];x--,w--)p[w]=o[x],m[w]=i[x],a&&(y[w]=a[x]);for(g=new Map,f=new Array(w+1),d=w;d>=b;d--)C=c[d],u=g.get(C),f[d]=u===void 0?-1:u,g.set(C,d);for(u=b;u<=x;u++)C=r[u],d=g.get(C),d!==void 0&&d!==-1?(p[d]=o[u],m[d]=i[u],a&&(y[d]=a[u]),d=f[d],g.set(C,d)):i[u]();for(d=b;d<l;d++)d in p?(o[d]=p[d],i[d]=m[d],a&&(a[d]=y[d],a[d](d))):o[d]=Xe(h);o=o.slice(0,s=l),r=c.slice(0)}return o});function h(g){if(i[d]=g,a){const[f,p]=L(d);return a[d]=p,t(c[d],f)}return t(c[d])}}}function Eg(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,c;return Y(()=>to(i)),()=>{const l=e()||[],u=l.length;return l[Yr],ne(()=>{if(u===0)return a!==0&&(to(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Fi],o[0]=Xe(h=>(i[0]=h,n.fallback())),a=1),o;for(r[0]===Fi&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?s[c](()=>l[c]):c>=r.length&&(o[c]=Xe(d));for(;c<r.length;c++)i[c]();return a=s.length=i.length=u,r=l.slice(0),o=o.slice(0,a)});function d(h){i[c]=h;const[g,f]=L(l[c]);return s[c]=f,t(g,c)}}}function v(e,t){return ne(()=>e(t||{}))}function no(){return!0}const Vi={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return t===Ve?!0:e.has(t)},set:no,deleteProperty:no,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:no,deleteProperty:no}},ownKeys(e){return e.keys()}};function Bi(e){return(e=typeof e=="function"?e():e)?e:{}}function Pg(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function N(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ve in a,e[s]=typeof a=="function"?(t=!0,_(a)):a}if(mc&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const c=Bi(e[a])[s];if(c!==void 0)return c}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Bi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Bi(e[a])));return[...new Set(s)]}},Vi);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let l=c.length-1;l>=0;l--){const u=c[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:Pg.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const h=n[u];h&&(d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function J(e,...t){const n=t.length;if(mc&&Ve in e){const o=n>1?t.flat():t[0],i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Vi));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Vi)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let c=0;c<t.length;c++)if(t[c].includes(o)){i=c;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let Cg=0;function Be(){return`cl-${Cg++}`}const Cc=e=>`Stale read from <${e}>.`;function cn(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Sg(()=>e.each,e.children,t||void 0))}function kc(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Eg(()=>e.each,e.children,t||void 0))}function ie(e){const t=e.keyed,n=_(()=>e.when,void 0,void 0),r=t?n:_(n,void 0,{equals:(o,i)=>!o==!i});return _(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?ne(()=>i(t?o:()=>{if(!ne(r))throw Cc("Show");return n()})):i}return e.fallback},void 0,void 0)}function Oc(e){const t=_i(()=>e.children),n=_(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],l=i,u=_(()=>l()?void 0:c.when,void 0,void 0),d=c.keyed?u:_(u,void 0,{equals:(h,g)=>!h==!g});i=()=>l()||(d()?[a,u,c]:void 0)}return i});return _(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?ne(()=>a(s.keyed?i():()=>{if(ne(n)()?.[0]!==o)throw Cc("Match");return i()})):a},void 0,void 0)}function lr(e){return e}const kg=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Og=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...kg]),Tg=new Set(["innerHTML","textContent","innerText","children"]),Ag=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),$g=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Dg(e,t){const n=$g[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Rg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Mg=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"]),Ig={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Ut=e=>_(()=>e());function _g(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,c=t[o-1].nextSibling,l=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:c;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!l){l=new Map;let d=a;for(;d<i;)l.set(n[d],d++)}const u=l.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,g;for(;++d<o&&d<i&&!((g=l.get(t[d]))==null||g!==u+h);)h++;if(h>u-a){const f=t[s];for(;a<u;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Tc="_$DX_DELEGATE";function W(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 Lg(e,t=window.document){const n=t[Tc]||(t[Tc]=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,Ug))}}function ke(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Ng(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function Fg(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function ln(e,t){t==null?e.removeAttribute("class"):e.className=t}function Vg(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 Bg(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]||(Ac(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(Ac(e,a,!0),n[a]=c)}return n}function ro(e,t,n){if(!t)return n?ke(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function un(e,t={},n,r){const o={};return r||ye(()=>o.children=ur(e,t.children,o.children)),ye(()=>typeof t.ref=="function"&&Ki(t.ref,e)),ye(()=>Kg(e,t,n,!0,o,!0)),o}function Ki(e,t,n){return ne(()=>e(t,n))}function B(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ur(e,t,r,n);ye(o=>ur(e,t(),o,n),r)}function Kg(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=$c(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=$c(e,s,a,o[s],n,i,t)}}function zg(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ac(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 $c(e,t,n,r,o,i,s){let a,c,l,u,d;if(t==="style")return ro(e,n,r);if(t==="classList")return Bg(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),g=Rg.has(h);if(!g&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(g||n)&&(Vg(e,h,n,g),g&&Lg([h]))}else if(t.slice(0,5)==="attr:")ke(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Fg(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=Tg.has(t))||!o&&((u=Dg(t,e.tagName))||(c=Og.has(t)))||(a=e.nodeName.includes("-")||"is"in s))d&&(t=t.slice(5),c=!0),t==="class"||t==="className"?ln(e,n):a&&!c&&!l?e[zg(t)]=n:e[u||t]=n;else{const h=o&&t.indexOf(":")>-1&&Ig[t.split(":")[0]];h?Ng(e,h,t,n):ke(e,Ag[t]||t,n)}return n}function Ug(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),s=()=>{const c=t[n];if(c&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function ur(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(t=t.toString(),t===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=An(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=An(e,n,r);else{if(i==="function")return ye(()=>{let a=t();for(;typeof a=="function";)a=a();n=ur(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(zi(a,t,n,o))return ye(()=>n=ur(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=An(e,n,r),s)return n}else c?n.length===0?Dc(e,a,r):_g(e,n,a):(n&&An(e),Dc(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=An(e,n,r,t);An(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function zi(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],c=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=zi(e,a,c)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=zi(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const u=String(a);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function Dc(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function An(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const c=a.parentNode===e;!i&&!s?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const jg=!1,Wg="http://www.w3.org/2000/svg";function Rc(e,t=!1,n=void 0){return t?document.createElementNS(Wg,e):document.createElement(e,{is:n})}function Mc(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=mg();let i;return V(()=>{i||(i=wc(o,()=>_(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[a,c]=L(!1),l=()=>c(!0);Xe(u=>B(s,()=>a()?u():i(),null)),Y(l)}else{const a=Rc(e.isSVG?"g":"div",e.isSVG),c=t&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),B(c,i),s.appendChild(a),e.ref&&e.ref(a),Y(()=>s.removeChild(a))}},void 0,{render:!0}),n}function Hg(e,t){const n=_(e);return _(()=>{const r=n();switch(typeof r){case"function":return ne(()=>r(t));case"string":const o=Mg.has(r),i=Rc(r,o,ne(()=>t.is));return un(i,t,o),i}})}function dr(e){const[,t]=J(e,["component"]);return Hg(()=>e.component,t)}function Yg(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function qg(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 Gg(e){return(t,n)=>{const{element:r}=n;return Xe(o=>{const i=Yg(t);r.addPropertyChangedCallback((a,c)=>i[a]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return B(r.renderRoot,s)},qg(r))}}function Xg(e,t,n){return arguments.length===2&&(n=t,t={}),ug(e,t)(Gg(n))}const Zg='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.box-border{box-sizing:border-box}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-full{width:100%;height:100%}.h-10{height:40px}.h-11{height:44px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[44px\\]{height:44px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[44px\\]{min-height:44px}.w-11\\/12{width:91.666667%}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[44px\\]{width:44px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-t{border-top-width:1px}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-6{padding-top:24px;padding-bottom:24px}.pb-2{padding-bottom:8px}.pb-\\[\\.\\.\\.\\]{padding-bottom:...}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media(max-width:640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media(min-width:640px){.sm\\:text-left{text-align:left}}@media(min-width:768px){.md\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Ic,Ui]=L(!1),_c=[],Jg=e=>_c.push(e),Lc=()=>{_c.forEach(e=>e())},Qg=()=>{const e=!Ic();Ui(e),he("onToggle"),he(e?"onOpen":"onClose"),Lc()},ep=()=>{Ui(!1),he("onClose")},tp=()=>{Ui(!0),he("onOpen"),Lc()},Nc=()=>({bubble:Ic,show:tp,hide:ep,toggle:Qg,onOpen:Jg}),ji=Symbol("store-raw"),$n=Symbol("store-node"),Pt=Symbol("store-has"),Fc=Symbol("store-self");function Vc(e){let t=e[Ve];if(!t&&(Object.defineProperty(e,Ve,{value:t=new Proxy(e,op)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const c=n[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(e,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(t)})}}return t}function oo(e){let t;return e!=null&&typeof e=="object"&&(e[Ve]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function fr(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ji])return n;if(!oo(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=fr(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,l=s.length;c<l;c++)i=s[c],!a[i].get&&(o=e[i],(r=fr(o,t))!==o&&(e[i]=r))}return e}function io(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function hr(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function np(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Ve||t===$n||(delete n.value,delete n.writable,n.get=()=>e[Ve][t]),n}function Bc(e){Ii()&&hr(io(e,$n),Fc)()}function rp(e){return Bc(e),Reflect.ownKeys(e)}const op={get(e,t,n){if(t===ji)return e;if(t===Ve)return n;if(t===Yr)return Bc(e),n;const r=io(e,$n),o=r[t];let i=o?o():e[t];if(t===$n||t===Pt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Ii()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=hr(r,t,i)())}return oo(i)?Vc(i):i},has(e,t){return t===ji||t===Ve||t===Yr||t===$n||t===Pt||t==="__proto__"?!0:(Ii()&&hr(io(e,Pt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:rp,getOwnPropertyDescriptor:np};function so(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Pt]&&e[Pt][t]&&o!==void 0&&e[Pt][t].$()):(e[t]=n,e[Pt]&&e[Pt][t]&&o===void 0&&e[Pt][t].$());let s=io(e,$n),a;if((a=hr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(a=s[c])&&a.$();(a=hr(s,"length",i))&&a.$(e.length)}(a=s[Fc])&&a.$()}function Kc(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];zc(o)||so(e,o,t[o])}}function zc(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function ip(e,t){if(typeof t=="function"&&(t=t(e)),t=fr(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&so(e,n,o)}so(e,"length",r)}else Kc(e,t)}function gr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&zc(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)gr(e,[r[c]].concat(t),n);return}else if(a&&s==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&gr(e,[c].concat(t),n);return}else if(a&&s==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=r;for(let d=c;d<=l;d+=u)gr(e,[d].concat(t),n);return}else if(t.length>1){gr(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=fr(i),r===void 0||oo(o)&&oo(i)&&!Array.isArray(i)?Kc(o,i):so(e,r,i))}function sp(...[e,t]){const n=fr(e||{}),r=Array.isArray(n),o=Vc(n);function i(...s){Ze(()=>{r&&s.length===1?ip(n,s[0]):gr(n,s)})}return[o,i]}function Wi(e,t,n){return Xe(()=>{const r=fc(e),[o,i]=sp(r?JSON.parse(r):t);return V(()=>dc(e,JSON.stringify(o),n)),[o,i]})}function ap(e,t,n){return Xe(()=>{const r=fc(e),[o,i]=L(r?JSON.parse(r):t);return V(()=>dc(e,JSON.stringify(o()),n)),[o,i]})}const[ck,lk]=ap("smarttalks-widget-lang","en");function cp(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 lp(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const ao={};function up(e){for(const[t,n]of Object.entries(e))n===null?ao[t]=null:ao[t]=n;return{...ao}}function dp(){const e=Object.entries(ao).filter(([,t])=>t!==void 0);if(e.length)return Object.fromEntries(e)}function fp(e){const t=new URLSearchParams(e),n={},r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];for(const o of r){const i=t.get(o);if(i){const s=o.replace(/_([a-z])/g,(a,c)=>c.toUpperCase());n[s]=i}}return n}function Uc(){if(typeof window>"u")return{};const e={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,...fp(window.location.search)};try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}e.isMobile=String(/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)),e.viewportW=String(window.innerWidth),e.viewportH=String(window.innerHeight);const t=dp();t&&(e.custom=t);for(const n of Object.keys(e))(e[n]===void 0||e[n]==="")&&delete e[n];return e}const hp=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${On}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return cp(i);if(i.type==="entity")return lp(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 pe("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${On}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),pe("registerMetadata",s=>{!s||!Object.keys(s).length||(up(s),fetch(`${On}/v1/widget-metadata/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:s})}).catch(console.error))}),i._id=n,i},[jc,gp]=L(""),[dn]=Xe(()=>pg(jc,hp)),pp=()=>{if(dn()?.type==="chat")return dn()},mp=()=>{if(dn()?.type==="form")return dn()},co=()=>{const e=dn();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Xe(()=>V(()=>{const e=dn();Xh(e),e&&(he("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const ge=()=>({widgetId:jc,setWidgetId:gp,widget:dn,chatWidget:pp,formWidget:mp,getSessionId:co}),Wc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hc=nc,yp=(e,t)=>n=>{var r;if(t?.variants==null)return Hc(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(l=>{const u=n?.[l],d=i?.[l];if(u===null)return null;const h=Wc(u)||Wc(d);return o[l][h]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,h]=u;return h===void 0||(l[d]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:h,...g}=u;return Object.entries(g).every(f=>{let[p,m]=f;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...l,d,h]:l},[]);return Hc(e,s,c,n?.class,n?.className)};var vp=W("<button>");const bp=yp("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Je=e=>{const[,t]=J(e,["variant","size","class"]);return(()=>{var n=vp();return un(n,N({get class(){return zt(bp({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var wp=W('<img alt="widget logo">');const Yc=e=>{const[,t]=J(e,["class","src"]);return(()=>{var n=wp();return un(n,N({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return zt("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var xp=W('<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 Sp=()=>{const{chatWidget:e}=ge(),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=xp(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return B(r,v(Yc,{get src(){return e()?.avatar}}),o),B(i,t),B(s,n),r})()};var Ep=W("<svg stroke-width=0>");function Ke(e,t){const n=N(e.a,t),[r,o]=J(n,["src"]),[i,s]=L(""),a=_(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return V(()=>s(a())),Y(()=>{s("")}),(()=>{var c=Ep();return un(c,N({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),B(c,()=>jg),c})()}function Pp(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function Cp(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function kp(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function Op(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const Hi={equals:!1};function qc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Tp(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const M=e=>typeof e=="function"&&!e.length?e():e,Gc=e=>Array.isArray(e)?e:e?[e]:[];function Ap(e,...t){return typeof e=="function"?e(...t):e}const $p=Y;function Dp(e,t,n,r){return e.addEventListener(t,n,r),$p(e.removeEventListener.bind(e,t,n,r))}function Rp(e,t,n,r){const o=()=>{Gc(M(e)).forEach(i=>{i&&Gc(M(t)).forEach(s=>Dp(i,s,n,r))})};typeof e=="function"?V(o):ye(o)}function lo(){return!0}const Mp={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return e.has(t)},set:lo,deleteProperty:lo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:lo,deleteProperty:lo}},ownKeys(e){return e.keys()}},Ip=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Xc(e){const t={};let n;for(;n=Ip.exec(e);)t[n[1]]=n[2];return t}function _p(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Xc(e)}else typeof t=="string"&&(t=Xc(t));return{...e,...t}}const Yi=(e,t,n)=>{let r;for(const o of e){const i=M(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Lp(...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?Tp:qc,o={};for(const s of n){const a=M(s);for(const c in a)if(c[0]==="o"&&c[1]==="n"&&c[2]){const l=a[c],u=c.toLowerCase(),d=typeof l=="function"?l:Array.isArray(l)?l.length===1?l[0]:l[0].bind(void 0,l[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=N(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return Yi(n,"style",_p);if(s==="ref"){const a=[];for(const c of n){const l=M(c)[s];typeof l=="function"&&a.push(l)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?Yi(n,s,(a,c)=>`${a} ${c}`):s==="classList"?Yi(n,s,(a,c)=>({...a,...c})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},Mp)}function fn(...e){return qc(e)}function Np(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function qi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fp(e){return typeof e=="number"}function Vp(e){return Array.isArray(e)}function Dn(e){return Object.prototype.toString.call(e)==="[object String]"}function Bp(e){return typeof e=="function"}function Zc(e){return t=>`${e()}-${t}`}function at(e,t){return e?e===t||e.contains(t):!1}function pr(e,t=!1){const{activeElement:n}=Ct(e);if(!n?.nodeName)return null;if(Jc(n)&&n.contentDocument)return pr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ct(n).getElementById(r);if(o)return o}}return n}function Ct(e){return e?e.ownerDocument||e:document}function Jc(e){return e.tagName==="IFRAME"}var Qc=(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))(Qc||{});function Gi(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function uo(){return Gi(/^Mac/i)}function Kp(){return Gi(/^iPhone/i)}function zp(){return Gi(/^iPad/i)||uo()&&navigator.maxTouchPoints>1}function Up(){return Kp()||zp()}function jp(){return uo()||Up()}function De(e,t){return t&&(Bp(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ze(e){return t=>{for(const n of e)De(t,n)}}function Wp(e){return uo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Oe(e){if(e)if(Hp())e.focus({preventScroll:!0});else{const t=Yp(e);e.focus(),qp(t)}}var fo=null;function Hp(){if(fo==null){fo=!1;try{document.createElement("div").focus({get preventScroll(){return fo=!0,!0}})}catch{}}return fo}function Yp(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 qp(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var el=["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'])"],Gp=[...el,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Xi=`${el.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Xp=Gp.join(':not([hidden]):not([tabindex="-1"]),');function tl(e,t){const r=Array.from(e.querySelectorAll(Xi)).filter(nl);return t&&nl(e)&&r.unshift(e),r.forEach((o,i)=>{if(Jc(o)&&o.contentDocument){const s=o.contentDocument.body,a=tl(s,!1);r.splice(i,1,...a)}}),r}function nl(e){return rl(e)&&!Zp(e)}function rl(e){return e.matches(Xi)&&Zi(e)}function Zp(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Zi(e,t){return e.nodeName!=="#comment"&&Jp(e)&&Qp(e,t)&&(!e.parentElement||Zi(e.parentElement,e))}function Jp(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Qp(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function em(e,t,n){const r=t?.tabbable?Xp:Xi,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Zi(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function ol(e){let t=e;for(;t&&!tm(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function tm(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function nm(){}function rm(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,c=s-1;a<s;c=a++){const[l,u]=t[a],[d,h]=t[c],[,g]=t[c===0?s-1:c-1]||[0,0],f=(u-h)*(n-l)-(l-d)*(r-u);if(h<u){if(r>=h&&r<u){if(f===0)return!0;f>0&&(r===h?r>g&&(o=!o):o=!o)}}else if(u<h){if(r>u&&r<=h){if(f===0)return!0;f<0&&(r===h?r<g&&(o=!o):o=!o)}}else if(r===u&&(n>=d&&n<=l||n>=l&&n<=d))return!0}return o}function ct(e,t){return N(e,t)}var mr=new Map,il=new Set;function sl(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=mr.get(n.target);r||(r=new Set,mr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=mr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),mr.delete(n.target)),mr.size===0)){for(const o of il)o();il.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?sl():document.addEventListener("DOMContentLoaded",sl));function Ji(e,t){const n=al(e,t,"left"),r=al(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const c=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+o>c&&(s+=n+o-c),r<=a?a=r:r+i>l&&(a+=r+i-l),e.scrollLeft=s,e.scrollTop=a}function al(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 om(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=ol(e);for(;e&&o&&e!==n&&o!==n;)Ji(o,e),e=o,o=ol(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 im={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 Qi(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=c=>{if(c==null)return"";const l=e.getKey??"key",u=Dn(l)?c[l]:l(c);return u!=null?String(u):""},i=c=>{if(c==null)return"";const l=e.getTextValue??"textValue",u=Dn(l)?c[l]:l(c);return u!=null?String(u):""},s=c=>{if(c==null)return!1;const l=e.getDisabled??"disabled";return(Dn(l)?c[l]:l(c))??!1},a=c=>{if(c!=null)return Dn(e.getSectionChildren)?c[e.getSectionChildren]:e.getSectionChildren?.(c)};for(const c of e.dataSource){if(Dn(c)||Fp(c)){r.push({type:"item",rawValue:c,key:String(c),textValue:String(c),disabled:s(c),level:n,index:t}),t++;continue}if(a(c)!=null){r.push({type:"section",rawValue:c,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(c)??[];if(l.length>0){const u=Qi({dataSource:l,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:c,key:o(c),textValue:i(c),disabled:s(c),level:n,index:t}),t++}return r}/*!
|
|
1
|
+
(function(cr){typeof define=="function"&&define.amd?define(cr):cr()})((function(){"use strict";function cr(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=cr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cr(e))&&(r&&(r+=" "),r+=t);return r}const Fi="-",Fh=e=>{const t=Bh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Fi);return a[0]===""&&a.length!==1&&a.shift(),pc(a,t)||Vh(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&r[s]?[...c,...r[s]]:c}}},pc=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?pc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Fi);return t.validators.find(({validator:s})=>s(i))?.classGroupId},mc=/^\[(.+)\]$/,Vh=e=>{if(mc.test(e)){const t=mc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Bh=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Kh(Object.entries(e.classGroups),n).forEach(([i,s])=>{Vi(s,r,i,t)}),r},Vi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:yc(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(zh(o)){Vi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Vi(s,yc(t,i),n,r)})})},yc=(e,t)=>{let n=e;return t.split(Fi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zh=e=>e.isThemeGetter,Kh=(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,Uh=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)}}},vc="!",jh=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const c=[];let l=0,u=0,d;for(let m=0;m<a.length;m++){let v=a[m];if(l===0){if(v===o&&(r||a.slice(m,m+i)===t)){c.push(a.slice(u,m)),u=m+i;continue}if(v==="/"){d=m;continue}}v==="["?l++:v==="]"&&l--}const f=c.length===0?a:a.substring(u),g=f.startsWith(vc),h=g?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},Wh=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Hh=e=>({cache:Uh(e.cacheSize),parseClassName:jh(e),...Fh(e)}),Yh=/\s+/,qh=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Yh);let a="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:g}=n(l);let h=!!g,p=r(h?f.substring(0,g):f);if(!p){if(!h){a=l+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=l+(a.length>0?" "+a:a);continue}h=!1}const m=Wh(u).join(":"),v=d?m+vc:m,w=v+p;if(i.includes(w))continue;i.push(w);const x=o(p,h);for(let b=0;b<x.length;++b){const C=x[b];i.push(v+C)}a=l+(a.length>0?" "+a:a)}return a};function Gh(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=wc(t))&&(r&&(r+=" "),r+=n);return r}const wc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Xh(e,...t){let n,r,o,i=s;function s(c){const l=t.reduce((u,d)=>d(u),e());return n=Hh(l),r=n.cache.get,o=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=qh(c,n);return o(c,u),u}return function(){return i(Gh.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},bc=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zh=/^\d+\/\d+$/,Jh=new Set(["px","full","screen"]),Qh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eg=/\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$/,tg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ng=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=e=>On(e)||Jh.has(e)||Zh.test(e),Kt=e=>Tn(e,"length",dg),On=e=>!!e&&!Number.isNaN(Number(e)),Bi=e=>Tn(e,"number",On),lr=e=>!!e&&Number.isInteger(Number(e)),og=e=>e.endsWith("%")&&On(e.slice(0,-1)),q=e=>bc.test(e),Ut=e=>Qh.test(e),ig=new Set(["length","size","percentage"]),sg=e=>Tn(e,ig,xc),ag=e=>Tn(e,"position",xc),cg=new Set(["image","url"]),lg=e=>Tn(e,cg,hg),ug=e=>Tn(e,"",fg),ur=()=>!0,Tn=(e,t,n)=>{const r=bc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},dg=e=>eg.test(e)&&!tg.test(e),xc=()=>!1,fg=e=>ng.test(e),hg=e=>rg.test(e),gg=Xh(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),a=ue("borderWidth"),c=ue("contrast"),l=ue("grayscale"),u=ue("hueRotate"),d=ue("invert"),f=ue("gap"),g=ue("gradientColorStops"),h=ue("gradientColorStopPositions"),p=ue("inset"),m=ue("margin"),v=ue("opacity"),w=ue("padding"),x=ue("saturate"),b=ue("scale"),C=ue("sepia"),E=ue("skew"),T=ue("space"),D=ue("translate"),S=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",q,t],O=()=>[q,t],V=()=>["",St,Kt],K=()=>["auto",On,q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",q],Xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Re=()=>[On,q];return{cacheSize:500,separator:":",theme:{colors:[ur],spacing:[St,Kt],blur:["none","",Ut,q],brightness:Re(),borderColor:[e],borderRadius:["none","","full",Ut,q],borderSpacing:O(),borderWidth:V(),contrast:Re(),grayscale:G(),hueRotate:Re(),invert:G(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[og,Kt],inset:R(),margin:R(),opacity:Re(),padding:O(),saturate:Re(),scale:Re(),sepia:G(),skew:Re(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[Ut]}],"break-after":[{"break-after":Xe()}],"break-before":[{"break-before":Xe()}],"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:[...Y(),q]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],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",lr,q]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",lr,q]}],"grid-cols":[{"grid-cols":[ur]}],"col-start-end":[{col:["auto",{span:["full",lr,q]},q]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[ur]}],"row-start-end":[{row:["auto",{span:[lr,q]},q]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",q,t]}],"min-w":[{"min-w":[q,t,"min","max","fit"]}],"max-w":[{"max-w":[q,t,"none","full","min","max","fit","prose",{screen:[Ut]},Ut]}],h:[{h:[q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ut,Kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bi]}],"font-family":[{font:[ur]}],"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",q]}],"line-clamp":[{"line-clamp":["none",On,Bi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",St,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",St,Kt]}],"underline-offset":[{"underline-offset":["auto",St,q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),ag]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lg]}],"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":[v]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:F()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[St,q]}],"outline-w":[{outline:[St,Kt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[St,Kt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ut,ug]}],"shadow-color":[{shadow:[ur]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ut,q]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",q]}],duration:[{duration:Re()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:Re()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[lr,q]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"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",q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[St,Kt,Bi]}],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 jt(...e){return gg(gc(e))}function pg(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",Qr(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Qr(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Qr(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Qr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Qr(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,c=0,l=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),l=(i+o)/2,c=s==0?0:s/(1-Math.abs(2*l-1)),c=+(c*100).toFixed(1),l=+(l*100).toFixed(1),a+","+c+"%,"+l+"%"}function mg(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 yg(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 dr(){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 vg={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart",attachFile:"Attach a file",uploading:"Uploading...",uploadFailed:"Upload failed. Tap to retry.",fileTooLarge:"File is too large.",fileTypeNotAllowed:"This file type is not allowed.",dropToUpload:"Drop files to attach"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar",attachFile:"Anexar um arquivo",uploading:"Enviando...",uploadFailed:"Falha no envio. Toque para tentar novamente.",fileTooLarge:"O arquivo é muito grande.",fileTypeNotAllowed:"Este tipo de arquivo não é permitido.",dropToUpload:"Solte os arquivos para anexar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar",attachFile:"Adjuntar un archivo",uploading:"Subiendo...",uploadFailed:"Error al subir. Toca para reintentar.",fileTooLarge:"El archivo es demasiado grande.",fileTypeNotAllowed:"Este tipo de archivo no está permitido.",dropToUpload:"Suelta los archivos para adjuntar"}};function Oe(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"),vg[n][e]}const Et="https://heimdall.smarttalks.ai/api",wg="wss://heimdall.smarttalks.ai",Sc="smarttalkswidget";function ge(e,...t){window.postMessage({from:Sc,command:e,args:t})}function ye(e,t){window.addEventListener("message",n=>{n.origin===window.location.origin&&n.data?.from===Sc&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function bg(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ge("registerContactData",e)},registerMetadata:e=>{ge("registerMetadata",e)},open:e=>{ge("open"),e&&ge("setInput",e)},close:()=>{ge("close")},toggle:()=>{ge("toggle")},toggleFullscreen:()=>{ge("toggleFullscreen")},reset:()=>{ge("reset")},onOpen:e=>{ye("onOpen",e)},onClose:e=>{ye("onClose",e)},onToggle:e=>{ye("onToggle",e)},onReset:e=>{ye("onReset",e)},onInput:e=>{ye("onInput",e)},onAnswer:e=>{ye("onAnswer",e)},onLoad:e=>{ye("onLoad",e)}})}function Ec(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Pc(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 xg(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Oc(o.value)&&!Cg(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 Sg(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Oc(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=kg(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Eg(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Pg(e,t){const n=xg(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?kc(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&Cc(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){const l=i.value;i.value=c,i.reflect&&Cc(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,c,l)},enumerable:!0,configurable:!0})}),n}function kc(e){if(e)try{return JSON.parse(e)}catch{return e}}function Cc(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 kg(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Oc(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Cg(e){return Object.prototype.toString.call(e)==="[object Function]"}function Og(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let zi;function Tg(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=Pg(this,t);const o=Eg(this.props),i=this.Component,s=zi;try{zi=this,this.__initialized=!0,Og(i)?new i(o,{element:this}):i(o,{element:this})}finally{zi=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?kc(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 Ag(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=Tg(r,Sg(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const $g=!1,Dg=(e,t)=>e===t,Me=Symbol("solid-proxy"),Tc=typeof Proxy=="function",fr=Symbol("solid-track"),eo={equals:Dg};let Ac=_c;const Pt=1,to=2,$c={owned:null,cleanups:null,context:null,owner:null},Ki={};var ne=null;let Ui=null,Rg=null,se=null,be=null,kt=null,no=0;function Je(e,t){const n=se,r=ne,o=e.length===0,i=t===void 0?r:t,s=o?$c:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>re(()=>hr(s)));ne=s,se=null;try{return Ct(a,!0)}finally{se=n,ne=r}}function L(e,t){t=t?Object.assign({},eo,t):eo;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ic(n,o));return[Mc.bind(n),r]}function Dc(e,t,n){const r=ro(e,t,!0,Pt);An(r)}function pe(e,t,n){const r=ro(e,t,!1,Pt);An(r)}function z(e,t,n){Ac=Vg;const r=ro(e,t,!1,Pt);(!n||!n.render)&&(r.user=!0),kt?kt.push(r):An(r)}function _(e,t,n){n=n?Object.assign({},eo,n):eo;const r=ro(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,An(r),Mc.bind(r)}function Mg(e){return e&&typeof e=="object"&&"then"in e}function Ig(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=Ki,c=!1,l="initialValue"in i,u=typeof r=="function"&&_(r);const d=new Set,[f,g]=(i.storage||L)(i.initialValue),[h,p]=L(void 0),[m,v]=L(void 0,{equals:!1}),[w,x]=L(l?"ready":"unresolved");function b(S,P,R,O){return s===S&&(s=null,O!==void 0&&(l=!0),(S===a||P===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(O,{value:P})),a=Ki,C(P,R)),P}function C(S,P){Ct(()=>{P===void 0&&g(()=>S),x(P!==void 0?"errored":l?"ready":"unresolved"),p(P);for(const R of d.keys())R.decrement();d.clear()},!1)}function E(){const S=Lg,P=f(),R=h();if(R!==void 0&&!s)throw R;return se&&se.user,P}function T(S=!0){if(S!==!1&&c)return;c=!1;const P=u?u():r;if(P==null||P===!1){b(s,re(f));return}let R;const O=a!==Ki?a:re(()=>{try{return o(P,{value:f(),refetching:S})}catch(V){R=V}});if(R!==void 0){b(s,void 0,so(R),P);return}else if(!Mg(O))return b(s,O,void 0,P),O;return s=O,"v"in O?(O.s===1?b(s,O.v,void 0,P):b(s,void 0,so(O.v),P),O):(c=!0,queueMicrotask(()=>c=!1),Ct(()=>{x(l?"refreshing":"pending"),v()},!1),O.then(V=>b(O,V,void 0,P),V=>b(O,void 0,so(V),P)))}Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>h()},loading:{get(){const S=w();return S==="pending"||S==="refreshing"}},latest:{get(){if(!l)return E();const S=h();if(S&&!s)throw S;return f()}}});let D=ne;return u?Dc(()=>(D=ne,T(!1))):T(!1),[E,{refetch:S=>Rc(D,()=>T(S)),mutate:g}]}function Qe(e){return Ct(e,!1)}function re(e){if(se===null)return e();const t=se;se=null;try{return e()}finally{se=t}}function dn(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(i)return i=!1,s;const c=re(()=>t(a,o,s));return o=a,c}}function Wt(e){z(()=>re(e))}function H(e){return ne===null||(ne.cleanups===null?ne.cleanups=[e]:ne.cleanups.push(e)),e}function ji(){return se}function _g(){return ne}function Rc(e,t){const n=ne,r=se;ne=e,se=null;try{return Ct(t,!0)}catch(o){Hi(o)}finally{ne=n,se=r}}function Se(e,t){const n=Symbol("context");return{id:n,Provider:Bg(n),defaultValue:e}}function Te(e){let t;return ne&&ne.context&&(t=ne.context[e.id])!==void 0?t:e.defaultValue}function Wi(e){const t=_(e),n=_(()=>Yi(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Lg;function Mc(){if(this.sources&&this.state)if(this.state===Pt)An(this);else{const e=be;be=null,Ct(()=>io(this),!1),be=e}if(se){const e=this.observers;if(!e||e[e.length-1]!==se){const t=e?e.length:0;se.sources?(se.sources.push(this),se.sourceSlots.push(t)):(se.sources=[this],se.sourceSlots=[t]),e?(e.push(se),this.observerSlots.push(se.sources.length-1)):(this.observers=[se],this.observerSlots=[se.sources.length-1])}}return this.value}function Ic(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ct(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Ui&&Ui.running;s&&Ui.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?be.push(i):kt.push(i),i.observers&&Lc(i)),s||(i.state=Pt)}if(be.length>1e6)throw be=[],new Error},!1)),t}function An(e){if(!e.fn)return;hr(e);const t=no;Ng(e,e.value,t)}function Ng(e,t,n){let r;const o=ne,i=se;se=ne=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Pt,e.owned&&e.owned.forEach(hr),e.owned=null),e.updatedAt=n+1,Hi(s)}finally{se=i,ne=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ic(e,r):e.value=r,e.updatedAt=n)}function ro(e,t,n,r=Pt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ne,context:ne?ne.context:null,pure:n};return ne===null||ne!==$c&&(ne.owned?ne.owned.push(i):ne.owned=[i]),i}function oo(e){if(e.state===0)return;if(e.state===to)return io(e);if(e.suspense&&re(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<no);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Pt)An(e);else if(e.state===to){const r=be;be=null,Ct(()=>io(e,t[0]),!1),be=r}}function Ct(e,t){if(be)return e();let n=!1;t||(be=[]),kt?n=!0:kt=[],no++;try{const r=e();return Fg(n),r}catch(r){n||(kt=null),be=null,Hi(r)}}function Fg(e){if(be&&(_c(be),be=null),e)return;const t=kt;kt=null,t.length&&Ct(()=>Ac(t),!1)}function _c(e){for(let t=0;t<e.length;t++)oo(e[t])}function Vg(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:oo(r)}for(t=0;t<n;t++)oo(e[t])}function io(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===Pt?r!==t&&(!r.updatedAt||r.updatedAt<no)&&oo(r):o===to&&io(r,t)}}}function Lc(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=to,n.pure?be.push(n):kt.push(n),n.observers&&Lc(n))}}function hr(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--)hr(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)hr(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 so(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Hi(e,t=ne){throw so(e)}function Yi(e){if(typeof e=="function"&&!e.length)return Yi(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Yi(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function Bg(e,t){return function(r){let o;return pe(()=>o=re(()=>(ne.context={...ne.context,[e]:r.value},Wi(()=>r.children))),void 0),o}}const qi=Symbol("fallback");function ao(e){for(let t=0;t<e.length;t++)e[t]()}function zg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return H(()=>ao(i)),()=>{let c=e()||[],l=c.length,u,d;return c[fr],re(()=>{let g,h,p,m,v,w,x,b,C;if(l===0)s!==0&&(ao(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[qi],o[0]=Je(E=>(i[0]=E,n.fallback())),s=1);else if(s===0){for(o=new Array(l),d=0;d<l;d++)r[d]=c[d],o[d]=Je(f);s=l}else{for(p=new Array(l),m=new Array(l),a&&(v=new Array(l)),w=0,x=Math.min(s,l);w<x&&r[w]===c[w];w++);for(x=s-1,b=l-1;x>=w&&b>=w&&r[x]===c[b];x--,b--)p[b]=o[x],m[b]=i[x],a&&(v[b]=a[x]);for(g=new Map,h=new Array(b+1),d=b;d>=w;d--)C=c[d],u=g.get(C),h[d]=u===void 0?-1:u,g.set(C,d);for(u=w;u<=x;u++)C=r[u],d=g.get(C),d!==void 0&&d!==-1?(p[d]=o[u],m[d]=i[u],a&&(v[d]=a[u]),d=h[d],g.set(C,d)):i[u]();for(d=w;d<l;d++)d in p?(o[d]=p[d],i[d]=m[d],a&&(a[d]=v[d],a[d](d))):o[d]=Je(f);o=o.slice(0,s=l),r=c.slice(0)}return o});function f(g){if(i[d]=g,a){const[h,p]=L(d);return a[d]=p,t(c[d],h)}return t(c[d])}}}function Kg(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,c;return H(()=>ao(i)),()=>{const l=e()||[],u=l.length;return l[fr],re(()=>{if(u===0)return a!==0&&(ao(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[qi],o[0]=Je(f=>(i[0]=f,n.fallback())),a=1),o;for(r[0]===qi&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?s[c](()=>l[c]):c>=r.length&&(o[c]=Je(d));for(;c<r.length;c++)i[c]();return a=s.length=i.length=u,r=l.slice(0),o=o.slice(0,a)});function d(f){i[c]=f;const[g,h]=L(l[c]);return s[c]=h,t(g,c)}}}function y(e,t){return re(()=>e(t||{}))}function co(){return!0}const Gi={get(e,t,n){return t===Me?n:e.get(t)},has(e,t){return t===Me?!0:e.has(t)},set:co,deleteProperty:co,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:co,deleteProperty:co}},ownKeys(e){return e.keys()}};function Xi(e){return(e=typeof e=="function"?e():e)?e:{}}function Ug(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function B(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Me in a,e[s]=typeof a=="function"?(t=!0,_(a)):a}if(Tc&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const c=Xi(e[a])[s];if(c!==void 0)return c}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Xi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Xi(e[a])));return[...new Set(s)]}},Gi);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let l=c.length-1;l>=0;l--){const u=c[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:Ug.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function ee(e,...t){const n=t.length;if(Tc&&Me in e){const o=n>1?t.flat():t[0],i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Gi));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Gi)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let c=0;c<t.length;c++)if(t[c].includes(o)){i=c;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let jg=0;function Ke(){return`cl-${jg++}`}const Nc=e=>`Stale read from <${e}>.`;function Ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(zg(()=>e.each,e.children,t||void 0))}function Fc(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Kg(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=_(()=>e.when,void 0,void 0),r=t?n:_(n,void 0,{equals:(o,i)=>!o==!i});return _(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?re(()=>i(t?o:()=>{if(!re(r))throw Nc("Show");return n()})):i}return e.fallback},void 0,void 0)}function Vc(e){const t=Wi(()=>e.children),n=_(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],l=i,u=_(()=>l()?void 0:c.when,void 0,void 0),d=c.keyed?u:_(u,void 0,{equals:(f,g)=>!f==!g});i=()=>l()||(d()?[a,u,c]:void 0)}return i});return _(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?re(()=>a(s.keyed?i():()=>{if(re(n)()?.[0]!==o)throw Nc("Match");return i()})):a},void 0,void 0)}function gr(e){return e}const Wg=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Hg=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Wg]),Yg=new Set(["innerHTML","textContent","innerText","children"]),qg=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Gg=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Xg(e,t){const n=Gg[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Zg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Jg=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"]),Qg={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Yt=e=>_(()=>e());function ep(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,c=t[o-1].nextSibling,l=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:c;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!l){l=new Map;let d=a;for(;d<i;)l.set(n[d],d++)}const u=l.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,f=1,g;for(;++d<o&&d<i&&!((g=l.get(t[d]))==null||g!==u+f);)f++;if(f>u-a){const h=t[s];for(;a<u;)e.insertBefore(n[a++],h)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Bc="_$DX_DELEGATE";function U(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 zc(e,t=window.document){const n=t[Bc]||(t[Bc]=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,sp))}}function me(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function tp(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function np(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function qt(e,t){t==null?e.removeAttribute("class"):e.className=t}function lo(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 rp(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]||(Kc(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(Kc(e,a,!0),n[a]=c)}return n}function uo(e,t,n){if(!t)return n?me(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 fn(e,t={},n,r){const o={};return r||pe(()=>o.children=mr(e,t.children,o.children)),pe(()=>typeof t.ref=="function"&&pr(t.ref,e)),pe(()=>op(e,t,n,!0,o,!0)),o}function pr(e,t,n){return re(()=>e(t,n))}function N(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return mr(e,t,r,n);pe(o=>mr(e,t(),o,n),r)}function op(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Uc(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Uc(e,s,a,o[s],n,i,t)}}function ip(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Kc(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 Uc(e,t,n,r,o,i,s){let a,c,l,u,d;if(t==="style")return uo(e,n,r);if(t==="classList")return rp(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=Zg.has(f);if(!g&&r){const h=Array.isArray(r)?r[0]:r;e.removeEventListener(f,h)}(g||n)&&(lo(e,f,n,g),g&&zc([f]))}else if(t.slice(0,5)==="attr:")me(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")np(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=Yg.has(t))||!o&&((u=Xg(t,e.tagName))||(c=Hg.has(t)))||(a=e.nodeName.includes("-")||"is"in s))d&&(t=t.slice(5),c=!0),t==="class"||t==="className"?qt(e,n):a&&!c&&!l?e[ip(t)]=n:e[u||t]=n;else{const f=o&&t.indexOf(":")>-1&&Qg[t.split(":")[0]];f?tp(e,f,t,n):me(e,qg[t]||t,n)}return n}function sp(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),s=()=>{const c=t[n];if(c&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function mr(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(t=t.toString(),t===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=$n(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=$n(e,n,r);else{if(i==="function")return pe(()=>{let a=t();for(;typeof a=="function";)a=a();n=mr(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(Zi(a,t,n,o))return pe(()=>n=mr(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=$n(e,n,r),s)return n}else c?n.length===0?jc(e,a,r):ep(e,n,a):(n&&$n(e),jc(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=$n(e,n,r,t);$n(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Zi(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],c=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Zi(e,a,c)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=Zi(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const u=String(a);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function jc(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function $n(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const c=a.parentNode===e;!i&&!s?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const ap=!1,cp="http://www.w3.org/2000/svg";function Wc(e,t=!1,n=void 0){return t?document.createElementNS(cp,e):document.createElement(e,{is:n})}function Hc(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=_g();let i;return z(()=>{i||(i=Rc(o,()=>_(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[a,c]=L(!1),l=()=>c(!0);Je(u=>N(s,()=>a()?u():i(),null)),H(l)}else{const a=Wc(e.isSVG?"g":"div",e.isSVG),c=t&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),N(c,i),s.appendChild(a),e.ref&&e.ref(a),H(()=>s.removeChild(a))}},void 0,{render:!0}),n}function lp(e,t){const n=_(e);return _(()=>{const r=n();switch(typeof r){case"function":return re(()=>r(t));case"string":const o=Jg.has(r),i=Wc(r,o,re(()=>t.is));return fn(i,t,o),i}})}function yr(e){const[,t]=ee(e,["component"]);return lp(()=>e.component,t)}function up(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function dp(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 fp(e){return(t,n)=>{const{element:r}=n;return Je(o=>{const i=up(t);r.addPropertyChangedCallback((a,c)=>i[a]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return N(r.renderRoot,s)},dp(r))}}function hp(e,t,n){return arguments.length===2&&(n=t,t={}),Ag(e,t)(fp(n))}const gp='*,: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}.right-0\\.5{right:2px}.top-0{top:0}.top-0\\.5{top:2px}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.m-3{margin:12px}.-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}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.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-7{width:28px;height:28px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.h-10{height:40px}.h-11{height:44px}.h-16{height:64px}.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-\\[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-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[36px\\]{min-height:36px}.w-11\\/12{width:91.666667%}.w-16{width:64px}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-9{width:36px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80,.max-w-\\[320px\\]{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.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}.overflow-y-hidden{overflow-y:hidden}.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}.break-words{overflow-wrap:break-word}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.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-2{border-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-background\\/85{background-color:hsl(var(--background) / .85)}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\\/70{background-color:hsl(var(--destructive) / .7)}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.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}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.p-6{padding:24px}.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}.pb-2{padding-bottom:8px}.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-left{text-align:left}.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{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.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{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media(max-width:640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media(min-width:640px){.sm\\:text-left{text-align:left}}@media(min-width:768px){.md\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Yc,Ji]=L(!1),qc=[],pp=e=>qc.push(e),Gc=()=>{qc.forEach(e=>e())},mp=()=>{const e=!Yc();Ji(e),ge("onToggle"),ge(e?"onOpen":"onClose"),Gc()},yp=()=>{Ji(!1),ge("onClose")},vp=()=>{Ji(!0),ge("onOpen"),Gc()},Xc=()=>({bubble:Yc,show:vp,hide:yp,toggle:mp,onOpen:pp}),fo=Symbol("store-raw"),hn=Symbol("store-node"),ct=Symbol("store-has"),Zc=Symbol("store-self");function Jc(e){let t=e[Me];if(!t&&(Object.defineProperty(e,Me,{value:t=new Proxy(e,xp)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const c=n[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(e,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(t)})}}return t}function Dn(e){let t;return e!=null&&typeof e=="object"&&(e[Me]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Rn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[fo])return n;if(!Dn(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=Rn(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,l=s.length;c<l;c++)i=s[c],!a[i].get&&(o=e[i],(r=Rn(o,t))!==o&&(e[i]=r))}return e}function ho(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function vr(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function wp(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Me||t===hn||(delete n.value,delete n.writable,n.get=()=>e[Me][t]),n}function Qc(e){ji()&&vr(ho(e,hn),Zc)()}function bp(e){return Qc(e),Reflect.ownKeys(e)}const xp={get(e,t,n){if(t===fo)return e;if(t===Me)return n;if(t===fr)return Qc(e),n;const r=ho(e,hn),o=r[t];let i=o?o():e[t];if(t===hn||t===ct||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);ji()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=vr(r,t,i)())}return Dn(i)?Jc(i):i},has(e,t){return t===fo||t===Me||t===fr||t===hn||t===ct||t==="__proto__"?!0:(ji()&&vr(ho(e,ct),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:bp,getOwnPropertyDescriptor:wp};function Mn(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[ct]&&e[ct][t]&&o!==void 0&&e[ct][t].$()):(e[t]=n,e[ct]&&e[ct][t]&&o===void 0&&e[ct][t].$());let s=ho(e,hn),a;if((a=vr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(a=s[c])&&a.$();(a=vr(s,"length",i))&&a.$(e.length)}(a=s[Zc])&&a.$()}function el(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];tl(o)||Mn(e,o,t[o])}}function tl(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function Sp(e,t){if(typeof t=="function"&&(t=t(e)),t=Rn(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&&Mn(e,n,o)}Mn(e,"length",r)}else el(e,t)}function wr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&tl(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)wr(e,[r[c]].concat(t),n);return}else if(a&&s==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&wr(e,[c].concat(t),n);return}else if(a&&s==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=r;for(let d=c;d<=l;d+=u)wr(e,[d].concat(t),n);return}else if(t.length>1){wr(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=Rn(i),r===void 0||Dn(o)&&Dn(i)&&!Array.isArray(i)?el(o,i):Mn(e,r,i))}function nl(...[e,t]){const n=Rn(e||{}),r=Array.isArray(n),o=Jc(n);function i(...s){Qe(()=>{r&&s.length===1?Sp(n,s[0]):wr(n,s)})}return[o,i]}const go=new WeakMap,rl={get(e,t){if(t===fo)return e;const n=e[t];if(t===Me||t===fr||t===hn||t===ct||t==="__proto__")return n;let r;return Dn(n)?go.get(n)||(go.set(n,r=new Proxy(n,rl)),r):n},set(e,t,n){return Mn(e,t,Rn(n)),!0},deleteProperty(e,t){return Mn(e,t,void 0,!0),!0}};function ol(e){return t=>{if(Dn(t)){let n;(n=go.get(t))||go.set(t,n=new Proxy(t,rl)),e(n)}return t}}function Qi(e,t,n){return Je(()=>{const r=Pc(e),[o,i]=nl(r?JSON.parse(r):t);return z(()=>Ec(e,JSON.stringify(o),n)),[o,i]})}function Ep(e,t,n){return Je(()=>{const r=Pc(e),[o,i]=L(r?JSON.parse(r):t);return z(()=>Ec(e,JSON.stringify(o()),n)),[o,i]})}const[XC,ZC]=Ep("smarttalks-widget-lang","en");function Pp(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 kp(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 po={};function Cp(e){for(const[t,n]of Object.entries(e))n===null?po[t]=null:po[t]=n;return{...po}}function Op(){const e=Object.entries(po).filter(([,t])=>t!==void 0);if(e.length)return Object.fromEntries(e)}function Tp(e){const t=new URLSearchParams(e),n={},r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];for(const o of r){const i=t.get(o);if(i){const s=o.replace(/_([a-z])/g,(a,c)=>c.toUpperCase());n[s]=i}}return n}function es(){if(typeof window>"u")return{};const e={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,...Tp(window.location.search)};try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}e.isMobile=String(/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)),e.viewportW=String(window.innerWidth),e.viewportH=String(window.innerHeight);const t=Op();t&&(e.custom=t);for(const n of Object.keys(e))(e[n]===void 0||e[n]==="")&&delete e[n];return e}const Ap=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Et}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Pp(i);if(i.type==="entity")return kp(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 ye("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Et}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),ye("registerMetadata",s=>{!s||!Object.keys(s).length||(Cp(s),fetch(`${Et}/v1/widget-metadata/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:s})}).catch(console.error))}),i._id=n,i},[il,$p]=L(""),[gn]=Je(()=>Ig(il,Ap)),Dp=()=>{if(gn()?.type==="chat")return gn()},Rp=()=>{if(gn()?.type==="form")return gn()},br=()=>{const e=gn();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Je(()=>z(()=>{const e=gn();pg(e),e&&(ge("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const he=()=>({widgetId:il,setWidgetId:$p,widget:gn,chatWidget:Dp,formWidget:Rp,getSessionId:br}),sl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,al=gc,Mp=(e,t)=>n=>{var r;if(t?.variants==null)return al(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(l=>{const u=n?.[l],d=i?.[l];if(u===null)return null;const f=sl(u)||sl(d);return o[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...g}=u;return Object.entries(g).every(h=>{let[p,m]=h;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...l,d,f]:l},[]);return al(e,s,c,n?.class,n?.className)};var Ip=U("<button>");const _p=Mp("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"}}),Ue=e=>{const[,t]=ee(e,["variant","size","class"]);return(()=>{var n=Ip();return fn(n,B({get class(){return jt(_p({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Lp=U('<img alt="widget logo">');const cl=e=>{const[,t]=ee(e,["class","src"]);return(()=>{var n=Lp();return fn(n,B({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return jt("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Np=U('<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 Fp=()=>{const{chatWidget:e}=he(),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=Np(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return N(r,y(cl,{get src(){return e()?.avatar}}),o),N(i,t),N(s,n),r})()};var Vp=U("<svg stroke-width=0>");function Ee(e,t){const n=B(e.a,t),[r,o]=ee(n,["src"]),[i,s]=L(""),a=_(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return z(()=>s(a())),H(()=>{s("")}),(()=>{var c=Vp();return fn(c,B({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),N(c,()=>ap),c})()}function Bp(e){return Ee({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 zp(e){return Ee({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 ll(e){return Ee({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 Kp(e){return Ee({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 ts={equals:!1};function ul(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Up(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const I=e=>typeof e=="function"&&!e.length?e():e,dl=e=>Array.isArray(e)?e:e?[e]:[];function jp(e,...t){return typeof e=="function"?e(...t):e}const Wp=H;function Hp(e,t,n,r){return e.addEventListener(t,n,r),Wp(e.removeEventListener.bind(e,t,n,r))}function Yp(e,t,n,r){const o=()=>{dl(I(e)).forEach(i=>{i&&dl(I(t)).forEach(s=>Hp(i,s,n,r))})};typeof e=="function"?z(o):pe(o)}function mo(){return!0}const qp={get(e,t,n){return t===Me?n:e.get(t)},has(e,t){return e.has(t)},set:mo,deleteProperty:mo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:mo,deleteProperty:mo}},ownKeys(e){return e.keys()}},Gp=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function fl(e){const t={};let n;for(;n=Gp.exec(e);)t[n[1]]=n[2];return t}function Xp(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=fl(e)}else typeof t=="string"&&(t=fl(t));return{...e,...t}}const ns=(e,t,n)=>{let r;for(const o of e){const i=I(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Zp(...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?Up:ul,o={};for(const s of n){const a=I(s);for(const c in a)if(c[0]==="o"&&c[1]==="n"&&c[2]){const l=a[c],u=c.toLowerCase(),d=typeof l=="function"?l:Array.isArray(l)?l.length===1?l[0]:l[0].bind(void 0,l[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=B(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ns(n,"style",Xp);if(s==="ref"){const a=[];for(const c of n){const l=I(c)[s];typeof l=="function"&&a.push(l)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?ns(n,s,(a,c)=>`${a} ${c}`):s==="classList"?ns(n,s,(a,c)=>({...a,...c})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},qp)}function pn(...e){return ul(e)}function Jp(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function rs(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Qp(e){return typeof e=="number"}function em(e){return Array.isArray(e)}function In(e){return Object.prototype.toString.call(e)==="[object String]"}function tm(e){return typeof e=="function"}function hl(e){return t=>`${e()}-${t}`}function lt(e,t){return e?e===t||e.contains(t):!1}function xr(e,t=!1){const{activeElement:n}=Ot(e);if(!n?.nodeName)return null;if(gl(n)&&n.contentDocument)return xr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ot(n).getElementById(r);if(o)return o}}return n}function Ot(e){return e?e.ownerDocument||e:document}function gl(e){return e.tagName==="IFRAME"}var pl=(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))(pl||{});function os(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function yo(){return os(/^Mac/i)}function nm(){return os(/^iPhone/i)}function rm(){return os(/^iPad/i)||yo()&&navigator.maxTouchPoints>1}function om(){return nm()||rm()}function im(){return yo()||om()}function Ie(e,t){return t&&(tm(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function je(e){return t=>{for(const n of e)Ie(t,n)}}function sm(e){return yo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ae(e){if(e)if(am())e.focus({preventScroll:!0});else{const t=cm(e);e.focus(),lm(t)}}var vo=null;function am(){if(vo==null){vo=!1;try{document.createElement("div").focus({get preventScroll(){return vo=!0,!0}})}catch{}}return vo}function cm(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 lm(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ml=["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'])"],um=[...ml,'[tabindex]:not([tabindex="-1"]):not([disabled])'],is=`${ml.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,dm=um.join(':not([hidden]):not([tabindex="-1"]),');function yl(e,t){const r=Array.from(e.querySelectorAll(is)).filter(vl);return t&&vl(e)&&r.unshift(e),r.forEach((o,i)=>{if(gl(o)&&o.contentDocument){const s=o.contentDocument.body,a=yl(s,!1);r.splice(i,1,...a)}}),r}function vl(e){return wl(e)&&!fm(e)}function wl(e){return e.matches(is)&&ss(e)}function fm(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function ss(e,t){return e.nodeName!=="#comment"&&hm(e)&&gm(e,t)&&(!e.parentElement||ss(e.parentElement,e))}function hm(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 gm(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function pm(e,t,n){const r=t?.tabbable?dm:is,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&ss(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function bl(e){let t=e;for(;t&&!mm(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function mm(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ym(){}function vm(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,c=s-1;a<s;c=a++){const[l,u]=t[a],[d,f]=t[c],[,g]=t[c===0?s-1:c-1]||[0,0],h=(u-f)*(n-l)-(l-d)*(r-u);if(f<u){if(r>=f&&r<u){if(h===0)return!0;h>0&&(r===f?r>g&&(o=!o):o=!o)}}else if(u<f){if(r>u&&r<=f){if(h===0)return!0;h<0&&(r===f?r<g&&(o=!o):o=!o)}}else if(r===u&&(n>=d&&n<=l||n>=l&&n<=d))return!0}return o}function ut(e,t){return B(e,t)}var Sr=new Map,xl=new Set;function Sl(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Sr.get(n.target);r||(r=new Set,Sr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Sr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Sr.delete(n.target)),Sr.size===0)){for(const o of xl)o();xl.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Sl():document.addEventListener("DOMContentLoaded",Sl));function as(e,t){const n=El(e,t,"left"),r=El(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const c=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+o>c&&(s+=n+o-c),r<=a?a=r:r+i>l&&(a+=r+i-l),e.scrollLeft=s,e.scrollTop=a}function El(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 wm(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=bl(e);for(;e&&o&&e!==n&&o!==n;)as(o,e),e=o,o=bl(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 bm={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 cs(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=c=>{if(c==null)return"";const l=e.getKey??"key",u=In(l)?c[l]:l(c);return u!=null?String(u):""},i=c=>{if(c==null)return"";const l=e.getTextValue??"textValue",u=In(l)?c[l]:l(c);return u!=null?String(u):""},s=c=>{if(c==null)return!1;const l=e.getDisabled??"disabled";return(In(l)?c[l]:l(c))??!1},a=c=>{if(c!=null)return In(e.getSectionChildren)?c[e.getSectionChildren]:e.getSectionChildren?.(c)};for(const c of e.dataSource){if(In(c)||Qp(c)){r.push({type:"item",rawValue:c,key:String(c),textValue:String(c),disabled:s(c),level:n,index:t}),t++;continue}if(a(c)!=null){r.push({type:"section",rawValue:c,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(c)??[];if(l.length>0){const u=cs({dataSource:l,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:c,key:o(c),textValue:i(c),disabled:s(c),level:n,index:t}),t++}return r}/*!
|
|
2
2
|
* Portions of this file are based on code from react-spectrum.
|
|
3
3
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
4
4
|
*
|
|
5
5
|
* Credits to the React Spectrum team:
|
|
6
6
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/collections/src/useCollection.ts
|
|
7
|
-
*/function
|
|
7
|
+
*/function xm(e,t=[]){const n=cs({dataSource:I(e.dataSource),getKey:I(e.getKey),getTextValue:I(e.getTextValue),getDisabled:I(e.getDisabled),getSectionChildren:I(e.getSectionChildren)}),[r,o]=L(e.factory(n));return z(dn([()=>I(e.dataSource),()=>I(e.getKey),()=>I(e.getTextValue),()=>I(e.getDisabled),()=>I(e.getSectionChildren),()=>e.factory,...t],([i,s,a,c,l,u])=>{const d=cs({dataSource:i,getKey:s,getTextValue:a,getDisabled:c,getSectionChildren:l});o(()=>u(d))},{defer:!0})),r}function ls(e){const[t,n]=L(e.defaultValue?.()),r=_(()=>e.value?.()!==void 0),o=_(()=>r()?e.value?.():t());return[o,s=>{re(()=>{const a=jp(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Sm(e){const[t,n]=ls(e);return[()=>t()??!1,n]}function Em(e){const[t,n]=ls(e);return[()=>t()??[],n]}function Pl(e={}){const[t,n]=Sm({value:()=>I(e.open),defaultValue:()=>!!I(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function Pm(e){const t=n=>{n.key===pl.Escape&&e.onEscapeKeyDown?.(n)};z(()=>{if(I(e.isDisabled))return;const n=e.ownerDocument?.()??Ot();n.addEventListener("keydown",t),H(()=>{n.removeEventListener("keydown",t)})})}/*!
|
|
8
8
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
9
9
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
10
10
|
*
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Credits to the Chakra UI team:
|
|
18
18
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/dismissable/src/layer-stack.ts
|
|
19
|
-
*/const
|
|
19
|
+
*/const wo="data-kb-top-layer";let kl,us=!1;const Tt=[];function Er(e){return Tt.findIndex(t=>t.node===e)}function km(e){return Tt[Er(e)]}function Cm(e){return Tt[Tt.length-1].node===e}function Cl(){return Tt.filter(e=>e.isPointerBlocking)}function Om(){return[...Cl()].slice(-1)[0]}function ds(){return Cl().length>0}function Ol(e){const t=Er(Om()?.node);return Er(e)<t}function Tm(e){Tt.push(e)}function Am(e){const t=Er(e);t<0||Tt.splice(t,1)}function $m(){for(const{node:e}of Tt)e.style.pointerEvents=Ol(e)?"none":"auto"}function Dm(e){if(ds()&&!us){const t=Ot(e);kl=document.body.style.pointerEvents,t.body.style.pointerEvents="none",us=!0}}function Rm(e){if(ds())return;const t=Ot(e);t.body.style.pointerEvents=kl,t.body.style.length===0&&t.body.removeAttribute("style"),us=!1}const _e={layers:Tt,isTopMostLayer:Cm,hasPointerBlockingLayer:ds,isBelowPointerBlockingLayer:Ol,addLayer:Tm,removeLayer:Am,indexOf:Er,find:km,assignPointerEventToLayers:$m,disableBodyPointerEvents:Dm,restoreBodyPointerEvents:Rm};/*!
|
|
20
20
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
21
21
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
22
22
|
*
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
* Credits to the Chakra UI team:
|
|
30
30
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-on-child-unmount.ts
|
|
31
31
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-containment.ts
|
|
32
|
-
*/const
|
|
32
|
+
*/const fs="focusScope.autoFocusOnMount",hs="focusScope.autoFocusOnUnmount",Tl={bubbles:!1,cancelable:!0},Al={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=rs(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=rs(this.stack,e),this.active()?.resume()}};function Mm(e,t){const[n,r]=L(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=h=>e.onMountAutoFocus?.(h),a=h=>e.onUnmountAutoFocus?.(h),c=()=>Ot(t()),l=()=>{const h=c().createElement("span");return h.setAttribute("data-focus-trap",""),h.tabIndex=0,Object.assign(h.style,bm),h},u=()=>{const h=t();return h?yl(h,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const h=u();return h.length>0?h[0]:null},f=()=>{const h=u();return h.length>0?h[h.length-1]:null},g=()=>{const h=t();if(!h)return!1;const p=xr(h);return!p||lt(h,p)?!1:wl(p)};z(()=>{const h=t();if(!h)return;Al.add(o);const p=xr(h);if(!lt(h,p)){const v=new CustomEvent(fs,Tl);h.addEventListener(fs,s),h.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Ae(d()),xr(h)===p&&Ae(h)},0)}H(()=>{h.removeEventListener(fs,s),setTimeout(()=>{const v=new CustomEvent(hs,Tl);g()&&v.preventDefault(),h.addEventListener(hs,a),h.dispatchEvent(v),v.defaultPrevented||Ae(p??c().body),h.removeEventListener(hs,a),Al.remove(o)},0)})}),z(()=>{const h=t();if(!h||!I(e.trapFocus)||n())return;const p=v=>{const w=v.target;w?.closest(`[${wo}]`)||(lt(h,w)?i=w:Ae(i))},m=v=>{const x=v.relatedTarget??xr(h);x?.closest(`[${wo}]`)||lt(h,x)||Ae(i)};c().addEventListener("focusin",p),c().addEventListener("focusout",m),H(()=>{c().removeEventListener("focusin",p),c().removeEventListener("focusout",m)})}),z(()=>{const h=t();if(!h||!I(e.trapFocus)||n())return;const p=l();h.insertAdjacentElement("afterbegin",p);const m=l();h.insertAdjacentElement("beforeend",m);function v(x){const b=d(),C=f();x.relatedTarget===b?Ae(C):Ae(b)}p.addEventListener("focusin",v),m.addEventListener("focusin",v);const w=new MutationObserver(x=>{for(const b of x)b.previousSibling===m&&(m.remove(),h.insertAdjacentElement("beforeend",m)),b.nextSibling===p&&(p.remove(),h.insertAdjacentElement("afterbegin",p))});w.observe(h,{childList:!0,subtree:!1}),H(()=>{p.removeEventListener("focusin",v),m.removeEventListener("focusin",v),p.remove(),m.remove(),w.disconnect()})})}/*!
|
|
33
33
|
* Portions of this file are based on code from react-spectrum.
|
|
34
34
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
35
35
|
*
|
|
36
36
|
* Credits to the React Spectrum team:
|
|
37
37
|
* https://github.com/adobe/react-spectrum/blob/15e101b74966bd5eb719c6529ce71ce57eaed430/packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx
|
|
38
|
-
*/const
|
|
38
|
+
*/const Im="data-live-announcer";/*!
|
|
39
39
|
* This file is based on code from react-spectrum.
|
|
40
40
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
41
41
|
*
|
|
42
42
|
* Credits to the React Spectrum team:
|
|
43
43
|
* https://github.com/adobe/react-spectrum/blob/810579b671791f1593108f62cdc1893de3a220e3/packages/@react-aria/overlays/src/ariaHideOutside.ts
|
|
44
|
-
*/function
|
|
44
|
+
*/function _m(e){z(()=>{I(e.isDisabled)||H(Lm(I(e.targets),I(e.root)))})}const Pr=new WeakMap,We=[];function Lm(e,t=document.body){const n=new Set(e),r=new Set,o=c=>{for(const f of c.querySelectorAll(`[${Im}], [${wo}]`))n.add(f);const l=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(f.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT,{acceptNode:l}),d=l(c);if(d===NodeFilter.FILTER_ACCEPT&&i(c),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)i(f),f=u.nextNode()}},i=c=>{const l=Pr.get(c)??0;c.getAttribute("aria-hidden")==="true"&&l===0||(l===0&&c.setAttribute("aria-hidden","true"),r.add(c),Pr.set(c,l+1))};We.length&&We[We.length-1].disconnect(),o(t);const s=new MutationObserver(c=>{for(const l of c)if(!(l.type!=="childList"||l.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(l.target))){for(const u of l.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of l.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return We.push(a),()=>{s.disconnect();for(const c of r){const l=Pr.get(c);if(l==null)return;l===1?(c.removeAttribute("aria-hidden"),Pr.delete(c)):Pr.set(c,l-1)}a===We[We.length-1]?(We.pop(),We.length&&We[We.length-1].observe()):We.splice(We.indexOf(a),1)}}/*!
|
|
45
45
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
46
46
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
47
47
|
*
|
|
@@ -53,38 +53,38 @@
|
|
|
53
53
|
*
|
|
54
54
|
* Credits to the Chakra UI team:
|
|
55
55
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/interact-outside/src/index.ts
|
|
56
|
-
*/const
|
|
56
|
+
*/const $l="interactOutside.pointerDownOutside",Dl="interactOutside.focusOutside";function Nm(e,t){let n,r=ym;const o=()=>Ot(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),c=d=>{const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${wo}]`)||!lt(o(),f)||lt(t(),f)?!1:!e.shouldExcludeElement?.(f)},l=d=>{function f(){const g=t(),h=d.target;if(!g||!h||!c(d))return;const p=je([i,a]);h.addEventListener($l,p,{once:!0});const m=new CustomEvent($l,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||sm(d)&&d.button===0}});h.dispatchEvent(m)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),g=d.target;if(!f||!g||!c(d))return;const h=je([s,a]);g.addEventListener(Dl,h,{once:!0});const p=new CustomEvent(Dl,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});g.dispatchEvent(p)};z(()=>{I(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",l,!0)},0),o().addEventListener("focusin",u,!0),H(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",l,!0),o().removeEventListener("focusin",u,!0)}))})}/*!
|
|
57
57
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
58
58
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
59
59
|
*
|
|
60
60
|
* Credits to the Radix UI team:
|
|
61
61
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
|
|
62
62
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
|
|
63
|
-
*/function
|
|
63
|
+
*/function Fm(e){const[t,n]=L();let r={},o=e(),i="none";const[s,a]=Vm(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return z(dn(s,c=>{const l=bo(r);i=c==="mounted"?l:"none"})),z(dn(e,c=>{if(o===c)return;const l=bo(r);c?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==l?"ANIMATION_OUT":"UNMOUNT"),o=c})),z(dn(t,c=>{if(c){const l=d=>{const g=bo(r).includes(d.animationName);d.target===c&&g&&a("ANIMATION_END")},u=d=>{d.target===c&&(i=bo(r))};c.addEventListener("animationstart",u),c.addEventListener("animationcancel",l),c.addEventListener("animationend",l),H(()=>{c.removeEventListener("animationstart",u),c.removeEventListener("animationcancel",l),c.removeEventListener("animationend",l)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:c=>{c&&(r=getComputedStyle(c)),n(c)}}}function bo(e){return e?.animationName||"none"}function Vm(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=L(e);return[r,s=>{o(a=>n(a,s))}]}function xo(e){return t=>(e(t),()=>e(void 0))}/*!
|
|
64
64
|
* Portions of this file are based on code from ariakit.
|
|
65
65
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
66
66
|
*
|
|
67
67
|
* Credits to the ariakit team:
|
|
68
68
|
* https://github.com/ariakit/ariakit/blob/8a13899ff807bbf39f3d89d2d5964042ba4d5287/packages/ariakit-react-utils/src/hooks.ts
|
|
69
|
-
*/function
|
|
69
|
+
*/function Bm(e,t){const[n,r]=L(Rl(t?.()));return z(()=>{r(e()?.tagName.toLowerCase()||Rl(t?.()))}),n}function Rl(e){return In(e)?e:void 0}function So(e){const[t,n]=ee(e,["asChild","as","children"]);if(!t.asChild)return y(yr,B({get component(){return t.as}},n,{get children(){return t.children}}));const r=Wi(()=>t.children);if(Ml(r())){const o=Il(n,r()?.props??{});return y(yr,o)}if(em(r())){const o=r().find(Ml);if(o){const i=()=>y(Ht,{get each(){return r()},children:a=>y(Z,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Il(n,o?.props??{});return y(yr,B(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const zm=Symbol("$$KobalteAsComponent");function Ml(e){return e?.[zm]===!0}function Il(e,t){return Zp([e,t],{reverseEventHandlers:!0})}/*!
|
|
70
70
|
* Portions of this file are based on code from react-spectrum.
|
|
71
71
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
72
72
|
*
|
|
73
73
|
* Credits to the React Spectrum team:
|
|
74
74
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
|
|
75
|
-
*/const
|
|
75
|
+
*/const Km=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Um=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function jm(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Km.has(n)}const t=e.split("-")[0];return Um.has(t)}function Wm(e){return jm(e)?"rtl":"ltr"}/*!
|
|
76
76
|
* Portions of this file are based on code from react-spectrum.
|
|
77
77
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
78
78
|
*
|
|
79
79
|
* Credits to the React Spectrum team:
|
|
80
80
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
|
|
81
|
-
*/function
|
|
81
|
+
*/function _l(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Wm(e)}}let gs=_l();const kr=new Set;function Ll(){gs=_l();for(const e of kr)e(gs)}function Hm(){const[e,t]=L(gs),n=_(()=>e());return Wt(()=>{kr.size===0&&window.addEventListener("languagechange",Ll),kr.add(t),H(()=>{kr.delete(t),kr.size===0&&window.removeEventListener("languagechange",Ll)})}),{locale:()=>n().locale,direction:()=>n().direction}}const Ym=Se();function ps(){const e=Hm();return Te(Ym)||e}/*!
|
|
82
82
|
* Portions of this file are based on code from react-spectrum.
|
|
83
83
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
84
84
|
*
|
|
85
85
|
* Credits to the React Spectrum team:
|
|
86
86
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
|
|
87
|
-
*/const
|
|
87
|
+
*/const ms=new Map;function qm(e){const{locale:t}=ps(),n=_(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return _(()=>{const r=n();let o;return ms.has(r)&&(o=ms.get(r)),o||(o=new Intl.Collator(t(),e),ms.set(r,o)),o})}function Gm(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ys(e,t,n){Gm(e,t),t.set(e,n)}/*!
|
|
88
88
|
* Portions of this file are based on code from react-spectrum.
|
|
89
89
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
90
90
|
*
|
|
@@ -92,79 +92,79 @@
|
|
|
92
92
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
|
|
93
93
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
|
|
94
94
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
|
|
95
|
-
*/class
|
|
95
|
+
*/class et extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof et?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function Xm(e){const[t,n]=ls(e);return[()=>t()??new et,n]}/*!
|
|
96
96
|
* Portions of this file are based on code from react-spectrum.
|
|
97
97
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
98
98
|
*
|
|
99
99
|
* Credits to the React Spectrum team:
|
|
100
100
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
|
|
101
|
-
*/function
|
|
101
|
+
*/function Nl(e){return im()?e.altKey:e.ctrlKey}function _n(e){return yo()?e.metaKey:e.ctrlKey}function Fl(e){return new et(e)}function Zm(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
|
|
102
102
|
* Portions of this file are based on code from react-spectrum.
|
|
103
103
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
104
104
|
*
|
|
105
105
|
* Credits to the React Spectrum team:
|
|
106
106
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
|
|
107
|
-
*/function
|
|
107
|
+
*/function Jm(e){const t=ut({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=L(!1),[o,i]=L(),s=_(()=>{const p=I(t.selectedKeys);return p!=null?Fl(p):p}),a=_(()=>{const p=I(t.defaultSelectedKeys);return p!=null?Fl(p):new et}),[c,l]=Xm({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[u,d]=L(I(t.selectionBehavior)),f=()=>I(t.selectionMode),g=()=>I(t.disallowEmptySelection)??!1,h=p=>{(I(t.allowDuplicateSelectionEvents)||!Zm(p,c()))&&l(p)};return z(()=>{const p=c();I(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),z(()=>{d(I(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:g,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:c,setSelectedKeys:h}}/*!
|
|
108
108
|
* Portions of this file are based on code from react-spectrum.
|
|
109
109
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
110
110
|
*
|
|
111
111
|
* Credits to the React Spectrum team:
|
|
112
112
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
|
|
113
|
-
*/function
|
|
113
|
+
*/function Qm(e){const[t,n]=L(""),[r,o]=L(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(I(e.isDisabled))return;const a=I(e.keyboardDelegate),c=I(e.selectionManager);if(!a.getKeyForSearch)return;const l=ey(s.key);if(!l||s.ctrlKey||s.metaKey)return;l===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(f=>f+l),d=a.getKeyForSearch(u,c.focusedKey())??a.getKeyForSearch(u);d==null&&ty(u)&&(u=u[0],d=a.getKeyForSearch(u,c.focusedKey())??a.getKeyForSearch(u)),d!=null&&(c.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function ey(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function ty(e){return e.split("").every(t=>t===e[0])}/*!
|
|
114
114
|
* Portions of this file are based on code from react-spectrum.
|
|
115
115
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
116
116
|
*
|
|
117
117
|
* Credits to the React Spectrum team:
|
|
118
118
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
|
|
119
|
-
*/function
|
|
119
|
+
*/function ny(e,t,n){const o=B({selectOnFocus:()=>I(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=ps();let a={top:0,left:0};Yp(()=>I(o.isVirtualized)?void 0:i(),"scroll",()=>{const p=i();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:c}=Qm({isDisabled:()=>I(o.disallowTypeAhead),keyboardDelegate:()=>I(o.keyboardDelegate),selectionManager:()=>I(o.selectionManager)}),l=p=>{Ie(p,c.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const m=t();if(!m?.contains(p.target))return;const v=I(o.selectionManager),w=I(o.selectOnFocus),x=T=>{T!=null&&(v.setFocusedKey(T),p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(T):w&&!Nl(p)&&v.replaceSelection(T))},b=I(o.keyboardDelegate),C=I(o.shouldFocusWrap),E=v.focusedKey();switch(p.key){case"ArrowDown":{if(b.getKeyBelow){p.preventDefault();let T;E!=null?T=b.getKeyBelow(E):T=b.getFirstKey?.(),T==null&&C&&(T=b.getFirstKey?.(E)),x(T)}break}case"ArrowUp":{if(b.getKeyAbove){p.preventDefault();let T;E!=null?T=b.getKeyAbove(E):T=b.getLastKey?.(),T==null&&C&&(T=b.getLastKey?.(E)),x(T)}break}case"ArrowLeft":{if(b.getKeyLeftOf){p.preventDefault();const T=s()==="rtl";let D;E!=null?D=b.getKeyLeftOf(E):D=T?b.getFirstKey?.():b.getLastKey?.(),x(D)}break}case"ArrowRight":{if(b.getKeyRightOf){p.preventDefault();const T=s()==="rtl";let D;E!=null?D=b.getKeyRightOf(E):D=T?b.getLastKey?.():b.getFirstKey?.(),x(D)}break}case"Home":if(b.getFirstKey){p.preventDefault();const T=b.getFirstKey(E,_n(p));T!=null&&(v.setFocusedKey(T),_n(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(T):w&&v.replaceSelection(T))}break;case"End":if(b.getLastKey){p.preventDefault();const T=b.getLastKey(E,_n(p));T!=null&&(v.setFocusedKey(T),_n(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(T):w&&v.replaceSelection(T))}break;case"PageDown":if(b.getKeyPageBelow&&E!=null){p.preventDefault();const T=b.getKeyPageBelow(E);x(T)}break;case"PageUp":if(b.getKeyPageAbove&&E!=null){p.preventDefault();const T=b.getKeyPageAbove(E);x(T)}break;case"a":_n(p)&&v.selectionMode()==="multiple"&&I(o.disallowSelectAll)!==!0&&(p.preventDefault(),v.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),I(o.disallowEmptySelection)||v.clearSelection());break;case"Tab":if(!I(o.allowsTabNavigation)){if(p.shiftKey)m.focus();else{const T=pm(m,{tabbable:!0});let D,S;do S=T.lastChild(),S&&(D=S);while(S);D&&!D.contains(document.activeElement)&&Ae(D)}break}}},u=p=>{const m=I(o.selectionManager),v=I(o.keyboardDelegate),w=I(o.selectOnFocus);if(m.isFocused()){p.currentTarget.contains(p.target)||m.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(m.setFocused(!0),m.focusedKey()==null){const x=C=>{C!=null&&(m.setFocusedKey(C),w&&m.replaceSelection(C))},b=p.relatedTarget;b&&p.currentTarget.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?x(m.lastSelectedKey()??v.getLastKey?.()):x(m.firstSelectedKey()??v.getFirstKey?.())}else if(!I(o.isVirtualized)){const x=i();if(x){x.scrollTop=a.top,x.scrollLeft=a.left;const b=x.querySelector(`[data-key="${m.focusedKey()}"]`);b&&(Ae(b),as(x,b))}}}},d=p=>{const m=I(o.selectionManager);p.currentTarget.contains(p.relatedTarget)||m.setFocused(!1)},f=p=>{i()===p.target&&p.preventDefault()},g=()=>{const p=I(o.autoFocus);if(!p)return;const m=I(o.selectionManager),v=I(o.keyboardDelegate);let w;p==="first"&&(w=v.getFirstKey?.()),p==="last"&&(w=v.getLastKey?.());const x=m.selectedKeys();x.size&&(w=x.values().next().value),m.setFocused(!0),m.setFocusedKey(w);const b=t();b&&w==null&&!I(o.shouldUseVirtualFocus)&&Ae(b)};return Wt(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),z(dn([i,()=>I(o.isVirtualized),()=>I(o.selectionManager).focusedKey()],p=>{const[m,v,w]=p;if(v)w&&o.scrollToKey?.(w);else if(w&&m){const x=m.querySelector(`[data-key="${w}"]`);x&&as(m,x)}})),{tabIndex:_(()=>{if(!I(o.shouldUseVirtualFocus))return I(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:l,onMouseDown:f,onFocusIn:u,onFocusOut:d}}/*!
|
|
120
120
|
* Portions of this file are based on code from react-spectrum.
|
|
121
121
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
122
122
|
*
|
|
123
123
|
* Credits to the React Spectrum team:
|
|
124
124
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
|
|
125
|
-
*/function
|
|
125
|
+
*/function ry(e,t){const n=()=>I(e.selectionManager),r=()=>I(e.key),o=()=>I(e.shouldUseVirtualFocus),i=w=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):w?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||_n(w)||"pointerType"in w&&w.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>I(e.disabled)||n().isDisabled(r()),c=()=>!a()&&n().canSelectItem(r());let l=null;const u=w=>{c()&&(l=w.pointerType,w.pointerType==="mouse"&&w.button===0&&!I(e.shouldSelectOnPressUp)&&i(w))},d=w=>{c()&&w.pointerType==="mouse"&&w.button===0&&I(e.shouldSelectOnPressUp)&&I(e.allowsDifferentPressOrigin)&&i(w)},f=w=>{c()&&(I(e.shouldSelectOnPressUp)&&!I(e.allowsDifferentPressOrigin)||l!=="mouse")&&i(w)},g=w=>{!c()||!["Enter"," "].includes(w.key)||(Nl(w)?n().toggleSelection(r()):i(w))},h=w=>{a()&&w.preventDefault()},p=w=>{const x=t();o()||a()||!x||w.target===x&&n().setFocusedKey(r())},m=_(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),v=_(()=>I(e.virtualized)?void 0:r());return z(dn([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([w,x,b,C,E])=>{w&&x===C&&E&&!b&&document.activeElement!==w&&(e.focus?e.focus():Ae(w))})),{isSelected:s,isDisabled:a,allowsSelection:c,tabIndex:m,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:g,onMouseDown:h,onFocus:p}}/*!
|
|
126
126
|
* Portions of this file are based on code from react-spectrum.
|
|
127
127
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
128
128
|
*
|
|
129
129
|
* Credits to the React Spectrum team:
|
|
130
130
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
|
|
131
|
-
*/class
|
|
131
|
+
*/class oy{collection;state;constructor(t,n){this.collection=t,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}isFocused(){return this.state.isFocused()}setFocused(t){this.state.setFocused(t)}focusedKey(){return this.state.focusedKey()}setFocusedKey(t){(t==null||this.collection().getItem(t))&&this.state.setFocusedKey(t)}selectedKeys(){return this.state.selectedKeys()}isSelected(t){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(t);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const t=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>t.has(n))}firstSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index<t.index;(!t||o)&&(t=r)}return t?.key}lastSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index>t.index;(!t||o)&&(t=r)}return t?.key}extendSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=this.state.selectedKeys(),o=r.anchorKey||n,i=new et(r,o,n);for(const s of this.getKeyRange(o,r.currentKey||n))i.delete(s);for(const s of this.getKeyRange(n,o))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(t,n){const r=this.collection().getItem(t),o=this.collection().getItem(n);return r&&o?r.index!=null&&o.index!=null&&r.index<=o.index?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){const r=[];let o=t;for(;o!=null;){const i=this.collection().getItem(o);if(i&&i.type==="item"&&r.push(o),o===n)return r;o=this.collection().getKeyAfter(o)}return[]}getKey(t){const n=this.collection().getItem(t);return n?!n||n.type!=="item"?null:n.key:t}toggleSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=new et(this.state.selectedKeys());r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection()&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode()==="none")return;const n=this.getKey(t);if(n==null)return;const r=this.canSelectItem(n)?new et([n],n,n):new et;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new et;for(const r of t){const o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const t=this.state.selectedKeys();!this.disallowEmptySelection()&&t.size>0&&this.state.setSelectedKeys(new et)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
|
|
132
132
|
* Portions of this file are based on code from react-spectrum.
|
|
133
133
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
134
134
|
*
|
|
135
135
|
* Credits to the React Spectrum team:
|
|
136
136
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
|
|
137
|
-
*/class
|
|
137
|
+
*/class Vl{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
|
|
138
138
|
* Portions of this file are based on code from react-spectrum.
|
|
139
139
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
140
140
|
*
|
|
141
141
|
* Credits to the React Spectrum team:
|
|
142
142
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
|
|
143
|
-
*/function
|
|
143
|
+
*/function iy(e){const t=Jm(e),r=xm({dataSource:()=>I(e.dataSource),getKey:()=>I(e.getKey),getTextValue:()=>I(e.getTextValue),getDisabled:()=>I(e.getDisabled),getSectionChildren:()=>I(e.getSectionChildren),factory:i=>e.filter?new Vl(e.filter(i)):new Vl(i)},[()=>e.filter]),o=new oy(r,t);return Dc(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
|
|
144
144
|
* Portions of this file are based on code from react-spectrum.
|
|
145
145
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
146
146
|
*
|
|
147
147
|
* Credits to the React Spectrum team:
|
|
148
148
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
|
|
149
|
-
*/class
|
|
149
|
+
*/class sy{collection;ref;collator;constructor(t,n,r){this.collection=t,this.ref=n,this.collator=r}getKeyBelow(t){let n=this.collection().getKeyAfter(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(t){let n=this.collection().getKeyBefore(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let t=this.collection().getFirstKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getLastKey(){let t=this.collection().getLastKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getItem(t){return this.ref?.()?.querySelector(`[data-key="${t}"]`)??null}getKeyPageAbove(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=i!=null?this.getItem(i):null;return i}getKeyPageBelow(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=i!=null?this.getItem(i):null;return i}getKeyForSearch(t,n){const r=this.collator?.();if(!r)return;let o=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;o!=null;){const i=this.collection().getItem(o);if(i){const s=i.textValue.slice(0,t.length);if(i.textValue&&r.compare(s,t)===0)return o}o=this.getKeyBelow(o)}}}/*!
|
|
150
150
|
* Portions of this file are based on code from react-spectrum.
|
|
151
151
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
152
152
|
*
|
|
153
153
|
* Credits to the React Spectrum team:
|
|
154
154
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
|
|
155
|
-
*/function
|
|
155
|
+
*/function ay(e,t,n){const r=qm({usage:"search",sensitivity:"base"}),o=_(()=>{const i=I(e.keyboardDelegate);return i||new sy(e.collection,t,r)});return ny({selectionManager:()=>I(e.selectionManager),keyboardDelegate:o,autoFocus:()=>I(e.autoFocus),deferAutoFocus:()=>I(e.deferAutoFocus),shouldFocusWrap:()=>I(e.shouldFocusWrap),disallowEmptySelection:()=>I(e.disallowEmptySelection),selectOnFocus:()=>I(e.selectOnFocus),disallowTypeAhead:()=>I(e.disallowTypeAhead),shouldUseVirtualFocus:()=>I(e.shouldUseVirtualFocus),allowsTabNavigation:()=>I(e.allowsTabNavigation),isVirtualized:()=>I(e.isVirtualized),scrollToKey:i=>I(e.scrollToKey)?.(i)},t)}/*!
|
|
156
156
|
* Portions of this file are based on code from ariakit
|
|
157
157
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
158
158
|
*
|
|
159
159
|
* Credits to the ariakit team:
|
|
160
160
|
* https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
|
|
161
|
-
*/const
|
|
161
|
+
*/const cy=["button","color","file","image","reset","submit"];function ly(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?cy.indexOf(e.type)!==-1:!1}function uy(e){let t;const n=ut({type:"button"},e),[r,o]=ee(n,["ref","type","disabled"]),i=Bm(()=>t,()=>"button"),s=_(()=>{const l=i();return l==null?!1:ly({tagName:l,type:r.type})}),a=_(()=>i()==="input"),c=_(()=>i()==="a"&&t?.getAttribute("href")!=null);return y(So,B({as:"button",ref(l){var u=pn(d=>t=d,r.ref);typeof u=="function"&&u(l)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!c()?"button":void 0},get tabIndex(){return!s()&&!c()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const Bl=Se();function zl(){return Te(Bl)}function dy(){const e=zl();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
|
|
162
162
|
* Portions of this file are based on code from ariakit.
|
|
163
163
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
164
164
|
*
|
|
165
165
|
* Credits to the Ariakit team:
|
|
166
166
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
167
|
-
*/function
|
|
167
|
+
*/function Kl(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function fy(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&Kl(o,n))return r+1}return 0}function hy(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),c=s.ref();return a===c||!a||!c?0:Kl(a,c)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Ul(e,t){const n=hy(e);e!==n&&t(n)}function gy(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Ot(r).body}function py(e,t){z(()=>{const n=setTimeout(()=>{Ul(e(),t)});H(()=>clearTimeout(n))})}function my(e,t){if(typeof IntersectionObserver!="function"){py(e,t);return}let n=[];z(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Ul(e(),t)},o=gy(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}H(()=>i.disconnect())})}/*!
|
|
168
168
|
* Portions of this file are based on code from ariakit.
|
|
169
169
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
170
170
|
*
|
|
@@ -172,14 +172,14 @@
|
|
|
172
172
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
|
|
173
173
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
174
174
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
|
|
175
|
-
*/function ny(e={}){const[t,n]=cm({value:()=>M(e.items),onChange:i=>e.onItemsChange?.(i)});ty(t,n);const r=i=>(n(s=>{const a=Zm(s,i);return Np(s,i,a)}),()=>{n(s=>{const a=s.filter(c=>c.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>v(Pl.Provider,{value:{registerItem:r},get children(){return i.children}})}}function ry(e){const t=Xm(),n=ct({shouldRegisterItem:!0},e);V(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Y(r)})}var de=e=>typeof e=="function"?e():e,ls=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),us=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},yo=new Map,oy=e=>{V(()=>{const t=de(e.style)??{},n=de(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=yo.get(e.key);o?o.activeCount++:yo.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);Y(()=>{const i=yo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}yo.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?.()}})})},Tl=oy,iy=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},sy=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},ay=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=iy(o,t),d=u-c-r*l;(l!==0||d!==0)&&sy(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Al,$l]=L([]),cy=e=>Al().indexOf(e)===Al().length-1,ly=e=>{const t=N({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Be();let r=[0,0],o=null,i=null;V(()=>{de(t.enabled)&&($l(l=>[...l,n]),Y(()=>{$l(l=>l.filter(u=>u!==n))}))}),V(()=>{if(!de(t.enabled)||!de(t.hideScrollbar))return;const{body:l}=document,u=window.innerWidth-l.offsetWidth;if(de(t.preventScrollbarShift)){const d={overflow:"hidden"},h=[];u>0&&(de(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${u}px)`,h.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,f=window.scrollX;Tl({key:"prevent-scroll",element:l,style:d,properties:h,cleanup:()=>{de(t.restoreScrollPosition)&&u>0&&window.scrollTo(f,g)}})}else Tl({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),V(()=>{!cy(n)||!de(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",c,{passive:!1}),Y(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",c)}))});const s=l=>{r=Dl(l),o=null,i=null},a=l=>{const u=l.target,d=de(t.element),h=uy(l),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=g==="x"?h[0]:h[1],p=Rl(u,g,f,d);let m;d&&us(d,u)?m=!p:m=!0,m&&l.cancelable&&l.preventDefault()},c=l=>{const u=de(t.element),d=l.target;let h;if(l.touches.length===2)h=!de(t.allowPinchZoom);else{if(o==null||i===null){const g=Dl(l).map((p,m)=>r[m]-p),f=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=f,i=f==="x"?g[0]:g[1]}if(d.type==="range")h=!1;else{const g=Rl(d,o,i,u);u&&us(u,d)?h=!g:h=!0}}h&&l.cancelable&&l.preventDefault()}},uy=e=>[e.deltaX,e.deltaY],Dl=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Rl=(e,t,n,r)=>{const o=r!==null&&us(r,e),[i,s]=ay(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},dy=ly,Ml=dy;const Il=xe();function fy(){return Ce(Il)}function hy(e){let t;const n=fy(),[r,o]=J(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const h=n?.registerNestedLayer(d);return()=>{i.delete(d),h?.()}};Sm({shouldExcludeElement:d=>t?r.excludedElements?.some(h=>at(h(),d))||[...i].some(h=>at(h,d)):!1,onPointerDownOutside:d=>{!t||Re.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Re.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),lm({ownerDocument:()=>Ct(t),onEscapeKeyDown:d=>{!t||!Re.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),an(()=>{if(!t)return;Re.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);Re.assignPointerEventToLayers(),Re.disableBodyPointerEvents(t),Y(()=>{t&&(Re.removeLayer(t),d?.(),Re.assignPointerEventToLayers(),Re.restoreBodyPointerEvents(t))})}),V(sn([()=>t,()=>r.disableOutsidePointerEvents],([d,h])=>{if(!d)return;const g=Re.find(d);g&&g.isPointerBlocking!==h&&(g.isPointerBlocking=h,Re.assignPointerEventToLayers()),h&&Re.disableBodyPointerEvents(d),Y(()=>{Re.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return v(Il.Provider,{value:u,get children(){return v(mo,N({as:"div",ref(d){var h=fn(g=>t=g,r.ref);typeof h=="function"&&h(d)}},o))}})}const _l=xe();function gy(){const e=Ce(_l);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function py(e){const t=gy(),[n,r]=J(e,["ref","style"]);return v(mo,N({as:"div",ref(o){var i=fn(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const my=["top","right","bottom","left"],jt=Math.min,Me=Math.max,vo=Math.round,bo=Math.floor,lt=e=>({x:e,y:e}),yy={left:"right",right:"left",bottom:"top",top:"bottom"},vy={start:"end",end:"start"};function ds(e,t,n){return Me(e,jt(t,n))}function hn(e,t){return typeof e=="function"?e(t):e}function Wt(e){return e.split("-")[0]}function Mn(e){return e.split("-")[1]}function Ll(e){return e==="x"?"y":"x"}function fs(e){return e==="y"?"height":"width"}function gn(e){return["top","bottom"].includes(Wt(e))?"y":"x"}function hs(e){return Ll(gn(e))}function by(e,t,n){n===void 0&&(n=!1);const r=Mn(e),o=hs(e),i=fs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wo(s)),[s,wo(s)]}function wy(e){const t=wo(e);return[gs(e),t,gs(t)]}function gs(e){return e.replace(/start|end/g,t=>vy[t])}function xy(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Sy(e,t,n,r){const o=Mn(e);let i=xy(Wt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(gs)))),i}function wo(e){return e.replace(/left|right|bottom|top/g,t=>yy[t])}function Ey(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nl(e){return typeof e!="number"?Ey(e):{top:e,right:e,bottom:e,left:e}}function xo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Fl(e,t,n){let{reference:r,floating:o}=e;const i=gn(t),s=hs(t),a=fs(s),c=Wt(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Mn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}const Py=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fl(l,r,c),h=r,g={},f=0;for(let p=0;p<a.length;p++){const{name:m,fn:y}=a[p],{x:b,y:x,data:w,reset:C}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:l,platform:s,elements:{reference:e,floating:t}});u=b??u,d=x??d,g={...g,[m]:{...g[m],...w}},C&&f<=50&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=Fl(l,h,c)),p=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:g}};async function wr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=hn(t,e),f=Nl(g),m=a[h?d==="floating"?"reference":"floating":d],y=xo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=xo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-C.top+f.top)/w.y,bottom:(C.bottom-y.bottom+f.bottom)/w.y,left:(y.left-C.left+f.left)/w.x,right:(C.right-y.right+f.right)/w.x}}const Cy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=hn(e,t)||{};if(l==null)return{};const d=Nl(u),h={x:n,y:r},g=hs(o),f=fs(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",b=m?"bottom":"right",x=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=w/2-C/2,P=O/2-p[f]/2-1,T=jt(d[y],P),I=jt(d[b],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=ds($,U,K),F=!c.arrow&&Mn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,j=F?U<$?U-$:U-K:0;return{[g]:h[g]+j,data:{[g]:Q,centerOffset:U-Q-j,...F&&{alignmentOffset:j}},reset:F}}}),ky=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=hn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Wt(o),b=gn(a),x=Wt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[wo(a)]:wy(a)),S=f!=="none";!h&&S&&C.push(...Sy(a,p,f,w));const O=[a,...C],D=await wr(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&P.push(D[y]),d){const U=by(o,s,w);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q)return{data:{index:U,overflows:T},reset:{placement:Q}};let F=($=T.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(g){case"bestFit":{var K;const j=(K=T.filter(G=>{if(S){const q=gn(G.placement);return q===b||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];j&&(F=j);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Vl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bl(e){return my.some(t=>e[t]>=0)}const Oy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=hn(e,t);switch(r){case"referenceHidden":{const i=await wr(t,{...o,elementContext:"reference"}),s=Vl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Bl(s)}}}case"escaped":{const i=await wr(t,{...o,altBoundary:!0}),s=Vl(i,n.floating);return{data:{escapedOffsets:s,escaped:Bl(s)}}}default:return{}}}}};async function Ty(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Wt(n),a=Mn(n),c=gn(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,d=hn(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*u,y:h*l}:{x:h*l,y:g*u}}const Ay=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await Ty(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},$y=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:y,y:b}=m;return{x:y,y:b}}},...c}=hn(e,t),l={x:n,y:r},u=await wr(t,c),d=gn(Wt(o)),h=Ll(d);let g=l[h],f=l[d];if(i){const m=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=g+u[m],x=g-u[y];g=ds(b,g,x)}if(s){const m=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=f+u[m],x=f-u[y];f=ds(b,f,x)}const p=a.fn({...t,[h]:g,[d]:f});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:i,[d]:s}}}}}},Dy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=hn(e,t),u=await wr(t,l),d=Wt(o),h=Mn(o),g=gn(o)==="y",{width:f,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=h==="end"?"top":"bottom");const b=p-u.top-u.bottom,x=f-u.left-u.right,w=jt(p-u[m],b),C=jt(f-u[y],x),S=!t.middlewareData.shift;let O=w,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=b),S&&!h){const T=Me(u.left,0),I=Me(u.right,0),$=Me(u.top,0),K=Me(u.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Me(u.left,u.right)):O=p-2*($!==0||K!==0?$+K:Me(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function So(){return typeof window<"u"}function In(e){return Kl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ut(e){var t;return(t=(Kl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kl(e){return So()?e instanceof Node||e instanceof Ie(e).Node:!1}function et(e){return So()?e instanceof Element||e instanceof Ie(e).Element:!1}function dt(e){return So()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function zl(e){return!So()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}function xr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ry(e){return["table","td","th"].includes(In(e))}function Eo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ps(e){const t=ms(),n=et(e)?tt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function My(e){let t=Ht(e);for(;dt(t)&&!_n(t);){if(ps(t))return t;if(Eo(t))return null;t=Ht(t)}return null}function ms(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _n(e){return["html","body","#document"].includes(In(e))}function tt(e){return Ie(e).getComputedStyle(e)}function Po(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ht(e){if(In(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zl(e)&&e.host||ut(e);return zl(t)?t.host:t}function Ul(e){const t=Ht(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&xr(t)?t:Ul(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ul(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ie(o);if(i){const a=ys(s);return t.concat(s,s.visualViewport||[],xr(o)?o:[],a&&n?Sr(a):[])}return t.concat(o,Sr(o,[],n))}function ys(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jl(e){const t=tt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=dt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=vo(n)!==i||vo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function vs(e){return et(e)?e:e.contextElement}function Ln(e){const t=vs(e);if(!dt(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=jl(t);let s=(i?vo(n.width):n.width)/r,a=(i?vo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Iy=lt(0);function Wl(e){const t=Ie(e);return!ms()||!t.visualViewport?Iy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _y(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ie(e)?!1:t}function pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=vs(e);let s=lt(1);t&&(r?et(r)&&(s=Ln(r)):s=Ln(e));const a=_y(i,n,r)?Wl(i):lt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=Ie(i),g=r&&et(r)?Ie(r):r;let f=h,p=ys(f);for(;p&&r&&g!==f;){const m=Ln(p),y=p.getBoundingClientRect(),b=tt(p),x=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,w=y.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=w,f=Ie(p),p=ys(f)}}return xo({width:u,height:d,x:c,y:l})}function bs(e,t){const n=Po(e).scrollLeft;return t?t.left+n:pn(ut(e)).left+n}function Hl(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:bs(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Ly(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ut(r),a=t?Eo(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const u=lt(0),d=dt(r);if((d||!d&&!i)&&((In(r)!=="body"||xr(s))&&(c=Po(r)),dt(r))){const g=pn(r);l=Ln(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!i?Hl(s,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function Ny(e){return Array.from(e.getClientRects())}function Fy(e){const t=ut(e),n=Po(e),r=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+bs(e);const a=-n.scrollTop;return tt(r).direction==="rtl"&&(s+=Me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Vy(e,t){const n=Ie(e),r=ut(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=ms();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function By(e,t){const n=pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=dt(e)?Ln(e):lt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Yl(e,t,n){let r;if(t==="viewport")r=Vy(e,n);else if(t==="document")r=Fy(ut(e));else if(et(t))r=By(t,n);else{const o=Wl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return xo(r)}function ql(e,t){const n=Ht(e);return n===t||!et(n)||_n(n)?!1:tt(n).position==="fixed"||ql(n,t)}function Ky(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>et(a)&&In(a)!=="body"),o=null;const i=tt(e).position==="fixed";let s=i?Ht(e):e;for(;et(s)&&!_n(s);){const a=tt(s),c=ps(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xr(s)&&!c&&ql(e,s))?r=r.filter(u=>u!==s):o=a,s=Ht(s)}return t.set(e,r),r}function zy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Eo(t)?[]:Ky(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const d=Yl(t,u,o);return l.top=Me(d.top,l.top),l.right=jt(d.right,l.right),l.bottom=jt(d.bottom,l.bottom),l.left=Me(d.left,l.left),l},Yl(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uy(e){const{width:t,height:n}=jl(e);return{width:t,height:n}}function jy(e,t,n){const r=dt(t),o=ut(t),i=n==="fixed",s=pn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!i)if((In(t)!=="body"||xr(o))&&(a=Po(t)),r){const h=pn(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=bs(o));const l=o&&!r&&!i?Hl(o,a):lt(0),u=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:s.width,height:s.height}}function ws(e){return tt(e).position==="static"}function Gl(e,t){if(!dt(e)||tt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ut(e)===n&&(n=n.ownerDocument.body),n}function Xl(e,t){const n=Ie(e);if(Eo(e))return n;if(!dt(e)){let o=Ht(e);for(;o&&!_n(o);){if(et(o)&&!ws(o))return o;o=Ht(o)}return n}let r=Gl(e,t);for(;r&&Ry(r)&&ws(r);)r=Gl(r,t);return r&&_n(r)&&ws(r)&&!ps(r)?n:r||My(e)||n}const Wy=async function(e){const t=this.getOffsetParent||Xl,n=this.getDimensions,r=await n(e.floating);return{reference:jy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hy(e){return tt(e).direction==="rtl"}const Zl={convertOffsetParentRelativeRectToViewportRelativeRect:Ly,getDocumentElement:ut,getClippingRect:zy,getOffsetParent:Xl,getElementRects:Wy,getClientRects:Ny,getDimensions:Uy,getScale:Ln,isElement:et,isRTL:Hy};function Jl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yy(e,t){let n=null,r;const o=ut(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=bo(d),p=bo(o.clientWidth-(u+h)),m=bo(o.clientHeight-(d+g)),y=bo(u),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Me(0,jt(1,c))||1};let w=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Jl(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function qy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=vs(e),u=o||i?[...l?Sr(l):[],...Sr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?Yy(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let f,p=c?pn(e):null;c&&m();function m(){const y=pn(e);p&&!Jl(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const Gy=Ay,Xy=$y,Zy=ky,Jy=Dy,Qy=Oy,ev=Cy,tv=(e,t,n)=>{const r=new Map,o={platform:Zl,...n},i={...o.platform,_c:r};return Py(e,t,{...o,platform:i})};function Ql(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function nv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Ql(r):e?e.getBoundingClientRect():Ql()}}}function rv(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const ov={top:"bottom",right:"left",bottom:"top",left:"right"};function iv(e,t){const[n,r]=e.split("-"),o=ov[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function sv(e){const t=ct({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=L(),[o,i]=L(),[s,a]=L(t.placement),c=()=>nv(t.anchorRef(),t.getAnchorRect),{direction:l}=ss();async function u(){const h=c(),g=n(),f=o();if(!h||!g)return;const p=(f?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const y=[Gy(({placement:S})=>{const O=!!S.split("-")[1];return{mainAxis:m,crossAxis:O?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const S=typeof t.flip=="string"?t.flip.split(" "):void 0;if(S!==void 0&&!S.every(rv))throw new Error("`flip` expects a spaced-delimited list of placements");y.push(Zy({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&y.push(Xy({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),y.push(Jy({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:O,rects:D}){const P=Math.round(D.reference.width);S=Math.floor(S),O=Math.floor(O),g.style.setProperty("--kb-popper-anchor-width",`${P}px`),g.style.setProperty("--kb-popper-content-available-width",`${S}px`),g.style.setProperty("--kb-popper-content-available-height",`${O}px`),t.sameWidth&&(g.style.width=`${P}px`),t.fitViewport&&(g.style.maxWidth=`${S}px`,g.style.maxHeight=`${O}px`)}})),t.hideWhenDetached&&y.push(Qy({padding:t.detachedPadding})),f&&y.push(ev({element:f,padding:t.arrowPadding}));const b=await tv(h,g,{placement:t.placement,strategy:"absolute",middleware:y,platform:{...Zl,isRTL:()=>l()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",iv(b.placement,l()));const x=Math.round(b.x),w=Math.round(b.y);let C;if(t.hideWhenDetached&&(C=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${w}px, 0)`,visibility:C}),f&&b.middlewareData.arrow){const{x:S,y:O}=b.middlewareData.arrow,D=b.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:O!=null?`${O}px`:"",[D]:"100%"})}}V(()=>{const h=c(),g=n();if(!h||!g)return;const f=qy(h,g,u,{elementResize:typeof ResizeObserver=="function"});Y(f)}),V(()=>{const h=n(),g=t.contentRef();!h||!g||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(g).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return v(_l.Provider,{value:d,get children(){return t.children}})}const eu=xe();function tu(){return Ce(eu)}function Nn(){const e=tu();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const nu=xe();function Fn(){const e=Ce(nu);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
175
|
+
*/function yy(e={}){const[t,n]=Em({value:()=>I(e.items),onChange:i=>e.onItemsChange?.(i)});my(t,n);const r=i=>(n(s=>{const a=fy(s,i);return Jp(s,i,a)}),()=>{n(s=>{const a=s.filter(c=>c.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>y(Bl.Provider,{value:{registerItem:r},get children(){return i.children}})}}function vy(e){const t=dy(),n=ut({shouldRegisterItem:!0},e);z(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());H(r)})}var de=e=>typeof e=="function"?e():e,vs=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),ws=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Eo=new Map,wy=e=>{z(()=>{const t=de(e.style)??{},n=de(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Eo.get(e.key);o?o.activeCount++:Eo.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);H(()=>{const i=Eo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Eo.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?.()}})})},jl=wy,by=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},xy=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Sy=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=by(o,t),d=u-c-r*l;(l!==0||d!==0)&&xy(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Wl,Hl]=L([]),Ey=e=>Wl().indexOf(e)===Wl().length-1,Py=e=>{const t=B({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ke();let r=[0,0],o=null,i=null;z(()=>{de(t.enabled)&&(Hl(l=>[...l,n]),H(()=>{Hl(l=>l.filter(u=>u!==n))}))}),z(()=>{if(!de(t.enabled)||!de(t.hideScrollbar))return;const{body:l}=document,u=window.innerWidth-l.offsetWidth;if(de(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(de(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,h=window.scrollX;jl({key:"prevent-scroll",element:l,style:d,properties:f,cleanup:()=>{de(t.restoreScrollPosition)&&u>0&&window.scrollTo(h,g)}})}else jl({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),z(()=>{!Ey(n)||!de(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",c,{passive:!1}),H(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",c)}))});const s=l=>{r=Yl(l),o=null,i=null},a=l=>{const u=l.target,d=de(t.element),f=ky(l),g=Math.abs(f[0])>Math.abs(f[1])?"x":"y",h=g==="x"?f[0]:f[1],p=ql(u,g,h,d);let m;d&&ws(d,u)?m=!p:m=!0,m&&l.cancelable&&l.preventDefault()},c=l=>{const u=de(t.element),d=l.target;let f;if(l.touches.length===2)f=!de(t.allowPinchZoom);else{if(o==null||i===null){const g=Yl(l).map((p,m)=>r[m]-p),h=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=h,i=h==="x"?g[0]:g[1]}if(d.type==="range")f=!1;else{const g=ql(d,o,i,u);u&&ws(u,d)?f=!g:f=!0}}f&&l.cancelable&&l.preventDefault()}},ky=e=>[e.deltaX,e.deltaY],Yl=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ql=(e,t,n,r)=>{const o=r!==null&&ws(r,e),[i,s]=Sy(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Cy=Py,Gl=Cy;const Xl=Se();function Oy(){return Te(Xl)}function Ty(e){let t;const n=Oy(),[r,o]=ee(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const f=n?.registerNestedLayer(d);return()=>{i.delete(d),f?.()}};Nm({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>lt(f(),d))||[...i].some(f=>lt(f,d)):!1,onPointerDownOutside:d=>{!t||_e.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!_e.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),Pm({ownerDocument:()=>Ot(t),onEscapeKeyDown:d=>{!t||!_e.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Wt(()=>{if(!t)return;_e.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);_e.assignPointerEventToLayers(),_e.disableBodyPointerEvents(t),H(()=>{t&&(_e.removeLayer(t),d?.(),_e.assignPointerEventToLayers(),_e.restoreBodyPointerEvents(t))})}),z(dn([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const g=_e.find(d);g&&g.isPointerBlocking!==f&&(g.isPointerBlocking=f,_e.assignPointerEventToLayers()),f&&_e.disableBodyPointerEvents(d),H(()=>{_e.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return y(Xl.Provider,{value:u,get children(){return y(So,B({as:"div",ref(d){var f=pn(g=>t=g,r.ref);typeof f=="function"&&f(d)}},o))}})}const Zl=Se();function Ay(){const e=Te(Zl);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function $y(e){const t=Ay(),[n,r]=ee(e,["ref","style"]);return y(So,B({as:"div",ref(o){var i=pn(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const Dy=["top","right","bottom","left"],Gt=Math.min,Le=Math.max,Po=Math.round,ko=Math.floor,dt=e=>({x:e,y:e}),Ry={left:"right",right:"left",bottom:"top",top:"bottom"},My={start:"end",end:"start"};function bs(e,t,n){return Le(e,Gt(t,n))}function mn(e,t){return typeof e=="function"?e(t):e}function Xt(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function Jl(e){return e==="x"?"y":"x"}function xs(e){return e==="y"?"height":"width"}function yn(e){return["top","bottom"].includes(Xt(e))?"y":"x"}function Ss(e){return Jl(yn(e))}function Iy(e,t,n){n===void 0&&(n=!1);const r=Ln(e),o=Ss(e),i=xs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Co(s)),[s,Co(s)]}function _y(e){const t=Co(e);return[Es(e),t,Es(t)]}function Es(e){return e.replace(/start|end/g,t=>My[t])}function Ly(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Ny(e,t,n,r){const o=Ln(e);let i=Ly(Xt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Es)))),i}function Co(e){return e.replace(/left|right|bottom|top/g,t=>Ry[t])}function Fy(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ql(e){return typeof e!="number"?Fy(e):{top:e,right:e,bottom:e,left:e}}function Oo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function eu(e,t,n){let{reference:r,floating:o}=e;const i=yn(t),s=Ss(t),a=xs(s),c=Xt(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Ln(t)){case"start":g[s]-=f*(n&&l?-1:1);break;case"end":g[s]+=f*(n&&l?-1:1);break}return g}const Vy=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=eu(l,r,c),f=r,g={},h=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:w,y:x,data:b,reset:C}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:g,rects:l,platform:s,elements:{reference:e,floating:t}});u=w??u,d=x??d,g={...g,[m]:{...g[m],...b}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=eu(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:g}};async function Cr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=mn(t,e),h=Ql(g),m=a[f?d==="floating"?"reference":"floating":d],v=Oo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=Oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:c}):w);return{top:(v.top-C.top+h.top)/b.y,bottom:(C.bottom-v.bottom+h.bottom)/b.y,left:(v.left-C.left+h.left)/b.x,right:(C.right-v.right+h.right)/b.x}}const By=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=mn(e,t)||{};if(l==null)return{};const d=Ql(u),f={x:n,y:r},g=Ss(o),h=xs(g),p=await s.getDimensions(l),m=g==="y",v=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[g]-f[g]-i.floating[h],C=f[g]-i.reference[g],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=E?E[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=a.floating[x]||i.floating[h]);const D=b/2-C/2,S=T/2-p[h]/2-1,P=Gt(d[v],S),R=Gt(d[w],S),O=P,V=T-p[h]-R,K=T/2-p[h]/2+D,Y=bs(O,K,V),F=!c.arrow&&Ln(o)!=null&&K!==Y&&i.reference[h]/2-(K<O?P:R)-p[h]/2<0,W=F?K<O?K-O:K-V:0;return{[g]:f[g]+W,data:{[g]:Y,centerOffset:K-Y-W,...F&&{alignmentOffset:W}},reset:F}}}),zy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=mn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Xt(o),w=yn(a),x=Xt(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=f||(x||!p?[Co(a)]:_y(a)),E=h!=="none";!f&&E&&C.push(...Ny(a,p,h,b));const T=[a,...C],D=await Cr(t,m),S=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&S.push(D[v]),d){const K=Iy(o,s,b);S.push(D[K[0]],D[K[1]])}if(P=[...P,{placement:o,overflows:S}],!S.every(K=>K<=0)){var R,O;const K=(((R=i.flip)==null?void 0:R.index)||0)+1,Y=T[K];if(Y)return{data:{index:K,overflows:P},reset:{placement:Y}};let F=(O=P.filter(W=>W.overflows[0]<=0).sort((W,X)=>W.overflows[1]-X.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(g){case"bestFit":{var V;const W=(V=P.filter(X=>{if(E){const G=yn(X.placement);return G===w||G==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(G=>G>0).reduce((G,Xe)=>G+Xe,0)]).sort((X,G)=>X[1]-G[1])[0])==null?void 0:V[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function tu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nu(e){return Dy.some(t=>e[t]>=0)}const Ky=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=mn(e,t);switch(r){case"referenceHidden":{const i=await Cr(t,{...o,elementContext:"reference"}),s=tu(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:nu(s)}}}case"escaped":{const i=await Cr(t,{...o,altBoundary:!0}),s=tu(i,n.floating);return{data:{escapedOffsets:s,escaped:nu(s)}}}default:return{}}}}};async function Uy(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xt(n),a=Ln(n),c=yn(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,d=mn(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),c?{x:g*u,y:f*l}:{x:f*l,y:g*u}}const jy=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await Uy(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Wy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y:w}=m;return{x:v,y:w}}},...c}=mn(e,t),l={x:n,y:r},u=await Cr(t,c),d=yn(Xt(o)),f=Jl(d);let g=l[f],h=l[d];if(i){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=g+u[m],x=g-u[v];g=bs(w,g,x)}if(s){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=h+u[m],x=h-u[v];h=bs(w,h,x)}const p=a.fn({...t,[f]:g,[d]:h});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[d]:s}}}}}},Hy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=mn(e,t),u=await Cr(t,l),d=Xt(o),f=Ln(o),g=yn(o)==="y",{width:h,height:p}=i.floating;let m,v;d==="top"||d==="bottom"?(m=d,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=h-u.left-u.right,b=Gt(p-u[m],w),C=Gt(h-u[v],x),E=!t.middlewareData.shift;let T=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),E&&!f){const P=Le(u.left,0),R=Le(u.right,0),O=Le(u.top,0),V=Le(u.bottom,0);g?D=h-2*(P!==0||R!==0?P+R:Le(u.left,u.right)):T=p-2*(O!==0||V!==0?O+V:Le(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:T});const S=await s.getDimensions(a.floating);return h!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function To(){return typeof window<"u"}function Nn(e){return ru(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ft(e){var t;return(t=(ru(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ru(e){return To()?e instanceof Node||e instanceof Ne(e).Node:!1}function tt(e){return To()?e instanceof Element||e instanceof Ne(e).Element:!1}function ht(e){return To()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function ou(e){return!To()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}function Or(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Yy(e){return["table","td","th"].includes(Nn(e))}function Ao(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ps(e){const t=ks(),n=tt(e)?nt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function qy(e){let t=Zt(e);for(;ht(t)&&!Fn(t);){if(Ps(t))return t;if(Ao(t))return null;t=Zt(t)}return null}function ks(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fn(e){return["html","body","#document"].includes(Nn(e))}function nt(e){return Ne(e).getComputedStyle(e)}function $o(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Nn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ou(e)&&e.host||ft(e);return ou(t)?t.host:t}function iu(e){const t=Zt(e);return Fn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ht(t)&&Or(t)?t:iu(t)}function Tr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=iu(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Cs(s);return t.concat(s,s.visualViewport||[],Or(o)?o:[],a&&n?Tr(a):[])}return t.concat(o,Tr(o,[],n))}function Cs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function su(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ht(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Po(n)!==i||Po(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Os(e){return tt(e)?e:e.contextElement}function Vn(e){const t=Os(e);if(!ht(t))return dt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=su(t);let s=(i?Po(n.width):n.width)/r,a=(i?Po(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Gy=dt(0);function au(e){const t=Ne(e);return!ks()||!t.visualViewport?Gy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Os(e);let s=dt(1);t&&(r?tt(r)&&(s=Vn(r)):s=Vn(e));const a=Xy(i,n,r)?au(i):dt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Ne(i),g=r&&tt(r)?Ne(r):r;let h=f,p=Cs(h);for(;p&&r&&g!==h;){const m=Vn(p),v=p.getBoundingClientRect(),w=nt(p),x=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=b,h=Ne(p),p=Cs(h)}}return Oo({width:u,height:d,x:c,y:l})}function Ts(e,t){const n=$o(e).scrollLeft;return t?t.left+n:vn(ft(e)).left+n}function cu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ts(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Zy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ft(r),a=t?Ao(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=dt(1);const u=dt(0),d=ht(r);if((d||!d&&!i)&&((Nn(r)!=="body"||Or(s))&&(c=$o(r)),ht(r))){const g=vn(r);l=Vn(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=s&&!d&&!i?cu(s,c,!0):dt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Jy(e){return Array.from(e.getClientRects())}function Qy(e){const t=ft(e),n=$o(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ts(e);const a=-n.scrollTop;return nt(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function ev(e,t){const n=Ne(e),r=ft(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=ks();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function tv(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ht(e)?Vn(e):dt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function lu(e,t,n){let r;if(t==="viewport")r=ev(e,n);else if(t==="document")r=Qy(ft(e));else if(tt(t))r=tv(t,n);else{const o=au(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Oo(r)}function uu(e,t){const n=Zt(e);return n===t||!tt(n)||Fn(n)?!1:nt(n).position==="fixed"||uu(n,t)}function nv(e,t){const n=t.get(e);if(n)return n;let r=Tr(e,[],!1).filter(a=>tt(a)&&Nn(a)!=="body"),o=null;const i=nt(e).position==="fixed";let s=i?Zt(e):e;for(;tt(s)&&!Fn(s);){const a=nt(s),c=Ps(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Or(s)&&!c&&uu(e,s))?r=r.filter(u=>u!==s):o=a,s=Zt(s)}return t.set(e,r),r}function rv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ao(t)?[]:nv(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const d=lu(t,u,o);return l.top=Le(d.top,l.top),l.right=Gt(d.right,l.right),l.bottom=Gt(d.bottom,l.bottom),l.left=Le(d.left,l.left),l},lu(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ov(e){const{width:t,height:n}=su(e);return{width:t,height:n}}function iv(e,t,n){const r=ht(t),o=ft(t),i=n==="fixed",s=vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=dt(0);if(r||!r&&!i)if((Nn(t)!=="body"||Or(o))&&(a=$o(t)),r){const f=vn(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=Ts(o));const l=o&&!r&&!i?cu(o,a):dt(0),u=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:s.width,height:s.height}}function As(e){return nt(e).position==="static"}function du(e,t){if(!ht(e)||nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ft(e)===n&&(n=n.ownerDocument.body),n}function fu(e,t){const n=Ne(e);if(Ao(e))return n;if(!ht(e)){let o=Zt(e);for(;o&&!Fn(o);){if(tt(o)&&!As(o))return o;o=Zt(o)}return n}let r=du(e,t);for(;r&&Yy(r)&&As(r);)r=du(r,t);return r&&Fn(r)&&As(r)&&!Ps(r)?n:r||qy(e)||n}const sv=async function(e){const t=this.getOffsetParent||fu,n=this.getDimensions,r=await n(e.floating);return{reference:iv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function av(e){return nt(e).direction==="rtl"}const hu={convertOffsetParentRelativeRectToViewportRelativeRect:Zy,getDocumentElement:ft,getClippingRect:rv,getOffsetParent:fu,getElementRects:sv,getClientRects:Jy,getDimensions:ov,getScale:Vn,isElement:tt,isRTL:av};function gu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cv(e,t){let n=null,r;const o=ft(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:g}=l;if(a||t(),!f||!g)return;const h=ko(d),p=ko(o.clientWidth-(u+f)),m=ko(o.clientHeight-(d+g)),v=ko(u),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Le(0,Gt(1,c))||1};let b=!0;function C(E){const T=E[0].intersectionRatio;if(T!==c){if(!b)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!gu(l,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function lv(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Os(e),u=o||i?[...l?Tr(l):[],...Tr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&a?cv(l,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let h,p=c?vn(e):null;c&&m();function m(){const v=vn(e);p&&!gu(p,v)&&n(),p=v,h=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const uv=jy,dv=Wy,fv=zy,hv=Hy,gv=Ky,pv=By,mv=(e,t,n)=>{const r=new Map,o={platform:hu,...n},i={...o.platform,_c:r};return Vy(e,t,{...o,platform:i})};function pu(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function yv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?pu(r):e?e.getBoundingClientRect():pu()}}}function vv(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const wv={top:"bottom",right:"left",bottom:"top",left:"right"};function bv(e,t){const[n,r]=e.split("-"),o=wv[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function xv(e){const t=ut({getAnchorRect:f=>f?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=L(),[o,i]=L(),[s,a]=L(t.placement),c=()=>yv(t.anchorRef(),t.getAnchorRect),{direction:l}=ps();async function u(){const f=c(),g=n(),h=o();if(!f||!g)return;const p=(h?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[uv(({placement:E})=>{const T=!!E.split("-")[1];return{mainAxis:m,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const E=typeof t.flip=="string"?t.flip.split(" "):void 0;if(E!==void 0&&!E.every(vv))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(fv({padding:t.overflowPadding,fallbackPlacements:E}))}(t.slide||t.overlap)&&v.push(dv({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(hv({padding:t.overflowPadding,apply({availableWidth:E,availableHeight:T,rects:D}){const S=Math.round(D.reference.width);E=Math.floor(E),T=Math.floor(T),g.style.setProperty("--kb-popper-anchor-width",`${S}px`),g.style.setProperty("--kb-popper-content-available-width",`${E}px`),g.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(g.style.width=`${S}px`),t.fitViewport&&(g.style.maxWidth=`${E}px`,g.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&v.push(gv({padding:t.detachedPadding})),h&&v.push(pv({element:h,padding:t.arrowPadding}));const w=await mv(f,g,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...hu,isRTL:()=>l()==="rtl"}});if(a(w.placement),t.onCurrentPlacementChange?.(w.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",bv(w.placement,l()));const x=Math.round(w.x),b=Math.round(w.y);let C;if(t.hideWhenDetached&&(C=w.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${b}px, 0)`,visibility:C}),h&&w.middlewareData.arrow){const{x:E,y:T}=w.middlewareData.arrow,D=w.placement.split("-")[0];Object.assign(h.style,{left:E!=null?`${E}px`:"",top:T!=null?`${T}px`:"",[D]:"100%"})}}z(()=>{const f=c(),g=n();if(!f||!g)return;const h=lv(f,g,u,{elementResize:typeof ResizeObserver=="function"});H(h)}),z(()=>{const f=n(),g=t.contentRef();!f||!g||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(g).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return y(Zl.Provider,{value:d,get children(){return t.children}})}const mu=Se();function yu(){return Te(mu)}function Bn(){const e=yu();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const vu=Se();function zn(){const e=Te(vu);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
176
176
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
177
177
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
178
178
|
*
|
|
179
179
|
* Credits to the Radix UI team:
|
|
180
180
|
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
|
|
181
|
-
*/function av(e,t){return t?rm([e.clientX,e.clientY],t):!1}function cv(e){const t=Fn(),n=Cl(),r=tu(),o=ct({placement:"bottom-start"},e),[i,s]=J(o,["open","defaultOpen","onOpenChange"]);let a=0,c=null,l="right";const[u,d]=L(),[h,g]=L(),[f,p]=L(),[m,y]=L(),[b,x]=L(!0),[w,C]=L(s.placement),[S,O]=L([]),[D,P]=L([]),{DomCollectionProvider:T}=ny({items:D,onItemsChange:P}),I=cl({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:X=>i.onOpenChange?.(X)}),$=Em(()=>t.forceMount()||I.isOpen()),K=jm({selectionMode:"none",dataSource:D}),U=X=>{x(X),I.open()},Q=(X=!1)=>{I.close(),X&&r&&r.close(!0)},F=X=>{x(X),I.toggle()},j=()=>{const X=m();X&&(Oe(X),K.selectionManager().setFocused(!0),K.selectionManager().setFocusedKey(void 0))},G=X=>{O(tn=>[...tn,X]);const Vt=r?.registerNestedMenu(X);return()=>{O(tn=>qi(tn,X)),Vt?.()}},q=X=>l===c?.side&&av(X,c?.area),qe=X=>{q(X)&&X.preventDefault()},$e=X=>{q(X)||j()},ec=X=>{q(X)&&X.preventDefault()};wm({isDisabled:()=>!(r==null&&I.isOpen()&&t.isModal()),targets:()=>[m(),...S()].filter(Boolean)}),V(()=>{const X=m();if(!X||!r)return;const Vt=r.registerNestedMenu(X);Y(()=>{Vt()})});const Pi={dataset:_(()=>({"data-expanded":I.isOpen()?"":void 0,"data-closed":I.isOpen()?void 0:""})),isOpen:I.isOpen,contentPresence:$,nestedMenus:S,currentPlacement:w,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>K,parentMenuContext:()=>r,triggerRef:f,contentRef:m,triggerId:u,contentId:h,setTriggerRef:p,setContentRef:y,open:U,close:Q,toggle:F,focusContent:j,onItemEnter:qe,onItemLeave:$e,onTriggerLeave:ec,setPointerDir:X=>l=X,setPointerGraceTimeoutId:X=>a=X,setPointerGraceIntent:X=>c=X,registerNestedMenu:G,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:po(d),registerContentId:po(g)};return v(T,{get children(){return v(eu.Provider,{value:Pi,get children(){return v(sv,N({anchorRef:f,contentRef:m,onCurrentPlacementChange:C},s))}})}})}const lv=xe();function uv(e){let t;const n=Fn(),r=Nn(),o=ct({id:n.generateId(`item-${Be()}`)},e),[i,s]=J(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,c]=L(),[l,u]=L(),[d,h]=L(),g=()=>r.listState().selectionManager(),f=()=>s.id,p=()=>g().focusedKey()===f(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};ry({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const y=zm({key:f,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=P=>{De(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(Oe(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},x=P=>{De(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},w=P=>{De(P,i.onPointerUp),!i.disabled&&P.button===0&&m()},C=P=>{if(De(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":m();break}},S=_(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),O=_(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),D={isChecked:()=>i.checked,dataset:O,setLabelRef:h,generateId:Zc(()=>s.id),registerLabel:po(c),registerDescription:po(u)};return v(lv.Provider,{value:D,get children(){return v(mo,N({as:"div",ref(P){var T=fn(I=>t=I,i.ref);typeof T=="function"&&T(P)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return y.dataKey()},get onPointerDown(){return ze([i.onPointerDown,y.onPointerDown])},get onPointerUp(){return ze([w,y.onPointerUp])},get onClick(){return ze([i.onClick,y.onClick])},get onKeyDown(){return ze([C,y.onKeyDown])},get onMouseDown(){return ze([i.onMouseDown,y.onMouseDown])},get onFocus(){return ze([i.onFocus,y.onFocus])},onPointerMove:b,onPointerLeave:x},O,s))}})}const dv=xe();function ru(){return Ce(dv)}function fv(e){let t;const n=Fn(),r=Nn(),o=ru(),i=ct({id:n.generateId(`content-${Be()}`)},e),[s,a]=J(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const l=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=Hm({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);vm({trapFocus:()=>l()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=m=>{if(at(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=m=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},f=m=>{De(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(De(m,s.onPointerMove),m.pointerType!=="mouse")return;const y=m.target,b=c!==m.clientX;at(m.currentTarget,y)&&b&&(r.setPointerDir(m.clientX>c?"right":"left"),c=m.clientX)};return V(()=>Y(r.registerContentId(s.id))),v(ie,{get when(){return r.contentPresence.isPresent()},get children(){return v(py,{get children(){return v(hy,N({ref(m){var y=fn(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof y=="function"&&y(m)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return Ut(()=>!!l())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return ze([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return ze([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return ze([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return ze([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:p},()=>r.dataset(),a))}})}})}function hv(e){let t;const n=Fn(),r=Nn(),[o,i]=J(e,["ref"]);return Ml({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),v(fv,N({ref(s){var a=fn(c=>{t=c},o.ref);typeof a=="function"&&a(s)}},i))}function gv(e){return v(uv,N({role:"menuitem",closeOnSelect:!0},e))}function pv(e){const t=Nn();return v(ie,{get when(){return t.contentPresence.isPresent()},get children(){return v(Mc,e)}})}function mv(e){const t=`menu-${Be()}`,n=ct({id:t,modal:!0},e),[r,o]=J(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=cl({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:Zc(()=>r.id),value:()=>r.value};return v(nu.Provider,{value:s,get children(){return v(cv,N({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function yv(e){const t=Fn(),n=Nn(),r=ru(),o=ct({id:t.generateId("trigger")},e),[i,s]=J(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,V(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),V(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),V(()=>{n.isOpen()&&r.setValue(a)}),Y(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const c=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},l=f=>{De(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&c()},u=f=>{De(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&c()},d=f=>{if(De(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),om(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{De(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=f=>{De(f,i.onFocus),r!==void 0&&r.setValue(a)};return V(()=>Y(n.registerTriggerId(i.id))),v(Gm,N({ref(f){var p=fn(n.setTriggerRef,i.ref);typeof p=="function"&&p(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Ut(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:l,onMouseOver:h,onClick:u,onKeyDown:d,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function vv(e){const t=Fn(),n=Nn(),[r,o]=J(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return v(hv,N({onCloseAutoFocus:c=>{r.onCloseAutoFocus?.(c),i||Oe(n.triggerRef()),i=!1,c.preventDefault()},onInteractOutside:c=>{r.onInteractOutside?.(c),(!t.isModal()||c.detail.isContextMenu)&&(i=!0)}},o))}function bv(e){const t=`dropdownmenu-${Be()}`,n=ct({id:t},e);return v(mv,n)}function wv(e){return Ke({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function xv(e){return Ke({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function Sv(e){return Ke({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const Ev=e=>v(bv,N({gutter:4},e)),Pv=yv,Cv=e=>{const[,t]=J(e,["class"]);return v(pv,{get mount(){return Hr()},get children(){return v(vv,N({get class(){return zt("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))}})},kv=e=>{const[,t]=J(e,["class"]);return v(gv,N({get class(){return zt("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 Ov(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 Tv(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function Av(e,t,n){const r=`${On}/v1/messages`,o=co(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:Uc()})};await fetch(r,s)}async function $v(e){const t=`${On}/v1/messages`,n=co(),r={"Content-Type":"application/json"};n&&(r["x-session-id"]=n);const o={credentials:"include",method:"POST",headers:r,body:JSON.stringify({channelId:e,type:"open",metadata:Uc()})},i=await fetch(t,o);if(!i.ok)throw new Error(`open event rejected: ${i.status}`)}async function Dv(e,t,n){if(!e||!t||!n)return;const r=`${On}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const ft=Object.create(null);ft.open="0",ft.close="1",ft.ping="2",ft.pong="3",ft.message="4",ft.upgrade="5",ft.noop="6";const Co=Object.create(null);Object.keys(ft).forEach(e=>{Co[ft[e]]=e});const xs={type:"error",data:"parser error"},ou=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",iu=typeof ArrayBuffer=="function",su=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ss=({type:e,data:t},n,r)=>ou&&t instanceof Blob?n?r(t):au(t,r):iu&&(t instanceof ArrayBuffer||su(t))?n?r(t):au(new Blob([t]),r):r(ft[e]+(t||"")),au=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function cu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Es;function Rv(e,t){if(ou&&e.data instanceof Blob)return e.data.arrayBuffer().then(cu).then(t);if(iu&&(e.data instanceof ArrayBuffer||su(e.data)))return t(cu(e.data));Ss(e,!1,n=>{Es||(Es=new TextEncoder),t(Es.encode(n))})}const lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Er=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<lu.length;e++)Er[lu.charCodeAt(e)]=e;const Mv=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)i=Er[e.charCodeAt(r)],s=Er[e.charCodeAt(r+1)],a=Er[e.charCodeAt(r+2)],c=Er[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|c&63;return l},Iv=typeof ArrayBuffer=="function",Ps=(e,t)=>{if(typeof e!="string")return{type:"message",data:uu(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:_v(e.substring(1),t)}:Co[n]?e.length>1?{type:Co[n],data:e.substring(1)}:{type:Co[n]}:xs},_v=(e,t)=>{if(Iv){const n=Mv(e);return uu(n,t)}else return{base64:!0,data:e}},uu=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},du="",Lv=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Ss(i,!1,a=>{r[s]=a,++o===n&&t(r.join(du))})})},Nv=(e,t)=>{const n=e.split(du),r=[];for(let o=0;o<n.length;o++){const i=Ps(n[o],t);if(r.push(i),i.type==="error")break}return r};function Fv(){return new TransformStream({transform(e,t){Rv(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 Cs;function ko(e){return e.reduce((t,n)=>t+n.length,0)}function Oo(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 Vv(e,t){Cs||(Cs=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(ko(n)<1)break;const c=Oo(n,1);i=(c[0]&128)===128,o=c[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(ko(n)<2)break;const c=Oo(n,2);o=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(ko(n)<8)break;const c=Oo(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(xs);break}o=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(ko(n)<o)break;const c=Oo(n,o);a.enqueue(Ps(i?c:Cs.decode(c),t)),r=0}if(o===0||o>e){a.enqueue(xs);break}}}})}const fu=4;function me(e){if(e)return Bv(e)}function Bv(e){for(var t in me.prototype)e[t]=me.prototype[t];return e}me.prototype.on=me.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},me.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},me.prototype.off=me.prototype.removeListener=me.prototype.removeAllListeners=me.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},me.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},me.prototype.emitReserved=me.prototype.emit,me.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},me.prototype.hasListeners=function(e){return!!this.listeners(e).length};const To=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),je=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Kv="arraybuffer";function uk(){}function hu(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const zv=je.setTimeout,Uv=je.clearTimeout;function Ao(e,t){t.useNativeTimers?(e.setTimeoutFn=zv.bind(je),e.clearTimeoutFn=Uv.bind(je)):(e.setTimeoutFn=je.setTimeout.bind(je),e.clearTimeoutFn=je.clearTimeout.bind(je))}const jv=1.33;function Wv(e){return typeof e=="string"?Hv(e):Math.ceil((e.byteLength||e.size)*jv)}function Hv(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 gu(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Yv(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function qv(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 Gv extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class ks extends me{constructor(t){super(),this.writable=!1,Ao(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 Gv(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=Ps(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=Yv(t);return n.length?"?"+n:""}}class Xv extends ks{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)};Nv(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,Lv(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]=gu()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let pu=!1;try{pu=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Zv=pu;function Jv(){}class Qv extends Xv{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ht extends me{constructor(t,n,r){super(),this.createRequest=t,Ao(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=hu(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=ht.requestsCount++,ht.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Jv,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ht.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(ht.requestsCount=0,ht.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",mu);else if(typeof addEventListener=="function"){const e="onpagehide"in je?"pagehide":"unload";addEventListener(e,mu,!1)}}function mu(){for(let e in ht.requests)ht.requests.hasOwnProperty(e)&&ht.requests[e].abort()}const eb=(function(){const e=yu({xdomain:!1});return e&&e.responseType!==null})();class tb extends Qv{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=eb&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ht(yu,this.uri(),t)}}function yu(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Zv))return new XMLHttpRequest}catch{}if(!t)try{return new je[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const vu=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class nb extends ks{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=vu?{}:hu(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;Ss(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&To(()=>{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]=gu()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Os=je.WebSocket||je.MozWebSocket;class rb extends nb{createSocket(t,n,r){return vu?new Os(t,n,r):n?new Os(t,n):new Os(t)}doWrite(t,n){this.ws.send(n)}}class ob extends ks{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=Vv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Fv();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&To(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const ib={websocket:rb,webtransport:ob,polling:tb},sb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ab=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ts(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=sb.exec(e||""),i={},s=14;for(;s--;)i[ab[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=cb(i,i.path),i.queryKey=lb(i,i.query),i}function cb(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 lb(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const As=typeof addEventListener=="function"&&typeof removeEventListener=="function",$o=[];As&&addEventListener("offline",()=>{$o.forEach(e=>e())},!1);class Yt extends me{constructor(t,n){if(super(),this.binaryType=Kv,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=Ts(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=Ts(n.host).host);Ao(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=qv(this.opts.query)),As&&(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"})},$o.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=fu,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&&Yt.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",Yt.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+=Wv(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,To(()=>{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(Yt.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(),As&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=$o.indexOf(this._offlineEventListener);r!==-1&&$o.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Yt.protocol=fu;class ub extends Yt{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;Yt.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Yt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function c(){s("socket closed")}function l(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let db=class extends ub{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=>ib[o]).filter(o=>!!o)),super(t,r)}};function fb(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=Ts(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 hb=typeof ArrayBuffer=="function",gb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,bu=Object.prototype.toString,pb=typeof Blob=="function"||typeof Blob<"u"&&bu.call(Blob)==="[object BlobConstructor]",mb=typeof File=="function"||typeof File<"u"&&bu.call(File)==="[object FileConstructor]";function $s(e){return hb&&(e instanceof ArrayBuffer||gb(e))||pb&&e instanceof Blob||mb&&e instanceof File}function Do(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Do(e[n]))return!0;return!1}if($s(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Do(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Do(e[n]))return!0;return!1}function yb(e){const t=[],n=e.data,r=e;return r.data=Ds(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ds(e,t){if(!e)return e;if($s(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]=Ds(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]=Ds(e[r],t));return n}return e}function vb(e,t){return e.data=Rs(e.data,t),delete e.attachments,e}function Rs(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]=Rs(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Rs(e[n],t));return e}const bb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Z;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Z||(Z={}));class wb{constructor(t){this.replacer=t}encode(t){return(t.type===Z.EVENT||t.type===Z.ACK)&&Do(t)?this.encodeAsBinary({type:t.type===Z.EVENT?Z.BINARY_EVENT:Z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Z.BINARY_EVENT||t.type===Z.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=yb(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class Ms extends me{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Z.BINARY_EVENT;r||n.type===Z.BINARY_ACK?(n.type=r?Z.EVENT:Z.ACK,this.reconstructor=new xb(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if($s(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Z.BINARY_EVENT||r.type===Z.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(s);if(!Sb(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Ms.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Z.CONNECT:return wu(n);case Z.DISCONNECT:return n===void 0;case Z.CONNECT_ERROR:return typeof n=="string"||wu(n);case Z.EVENT:case Z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&bb.indexOf(n[0])===-1);case Z.ACK:case Z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class xb{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=vb(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Sb=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function wu(e){return Object.prototype.toString.call(e)==="[object Object]"}const Eb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ms,Encoder:wb,get PacketType(){return Z}},Symbol.toStringTag,{value:"Module"}));function nt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Pb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class xu extends me{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[nt(t,"open",this.onopen.bind(this)),nt(t,"packet",this.onpacket.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(Pb.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:Z.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,c=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Z.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Z.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Z.EVENT:case Z.BINARY_EVENT:this.onevent(t);break;case Z.ACK:case Z.BINARY_ACK:this.onack(t);break;case Z.DISCONNECT:this.ondisconnect();break;case Z.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:Z.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Z.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Vn(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}Vn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},Vn.prototype.reset=function(){this.attempts=0},Vn.prototype.setMin=function(e){this.ms=e},Vn.prototype.setMax=function(e){this.max=e},Vn.prototype.setJitter=function(e){this.jitter=e};class Is extends me{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,Ao(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 Vn({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||Eb;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 db(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=nt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=nt(n,"error",i);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(nt(t,"ping",this.onping.bind(this)),nt(t,"data",this.ondata.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(t,"close",this.onclose.bind(this)),nt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){To(()=>{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 xu(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Pr={};function Ro(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=fb(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Pr[o]&&i in Pr[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new Is(r,t):(Pr[o]||(Pr[o]=new Is(r,t)),c=Pr[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Ro,{Manager:Is,Socket:xu,io:Ro,connect:Ro});class gt{static instance;constructor(){}static init(t){if(!gt.instance){const n=co();gt.instance=Ro(eg,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),gt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",gt.instance.id)})}return gt.instance}static on(t,n,r){const o=gt.instance||this.init(n);o.off(t),o.on(t,r)}static waitForConnection(t){const n=gt.instance||this.init(t);return n.connected?Promise.resolve():new Promise(r=>{n.once("connect",()=>r())})}}const _s=1e3*60*60*24,[Mo,Su]=Wi("smarttalks-widget-messages",{},_s),Eu=()=>{const{widgetId:e}=ge();return Mo[e()]??[]},Cb=e=>{const{widgetId:t}=ge();Su({...Mo,[t()]:[...Mo[t()]??[],e]})},kb=()=>{const{widgetId:e}=ge();Su({...Mo,[e()]:[]})},[Pu,Ob]=Wi("smarttalks-widget-conversationinfo",{},_s),Ls=()=>{const{widgetId:e}=ge();return Pu[e()]??{}},Cu=e=>{const{widgetId:t}=ge();Ob({...Pu,[t()]:e})},[ku,Tb]=Wi("smarttalks-widget-autostarted",{},_s),Ab=()=>{const{widgetId:e}=ge();return ku[e()]??!1},Ou=e=>{const{widgetId:t}=ge();Tb({...ku,[t()]:e})},[$b,Ns]=L(!1),[Db,Tu]=L(!1),Au=[],$u=()=>{Au.forEach(e=>e())},Rb=e=>Au.push(e),Fs=e=>{const t=Ov(e);if(Cb(t),t.type==="media"){setTimeout($u,200);return}$u()},Du=()=>{const{widgetId:e}=ge(),t=Ls();gt.on("message",e(),n=>{(n.contactId!==t.contactId||n.interactionId!==t.interactionId)&&Cu({contactId:n.contactId,interactionId:n.interactionId});for(const r of n.messages)Fs(r),he("onAnswer",r);Ns(!1),Tv(n.debug)})},Mb=(e,t)=>{const{chatWidget:n}=ge();e.trim()&&(Fs({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),he("onInput",e),Du(),Ns(!0),Av(e,t,n()?._id).catch(r=>{console.error(r),Ns(!1)}))};let Vs=!1;const Ib=()=>{const{chatWidget:e,widgetId:t}=ge();Du(),Vs=!0,gt.waitForConnection(t()).then(()=>$v(e()?._id)).then(()=>Ou(!0)).catch(n=>console.error(n)).finally(()=>{Vs=!1})},Ru=()=>{Ls().interactionId||Ab()||Vs||Ib()},_b=()=>{const{chatWidget:e}=ge(),t=Ls();Tu(!0),kb(),Dv(e()?._id,t.contactId,t.interactionId).finally(()=>{Cu({}),Tu(!1),Mu(),Ou(!1),Ru()}),he("onReset")},Mu=()=>{const{chatWidget:e}=ge();if(Eu().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Fs({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},qt=()=>({getMessages:Eu,pushMessage:Mb,maybeAutostart:Ru,clearMessages:_b,addBalloonMessage:Mu,onMessage:Rb,typing:$b,loading:Db});var Lb=W("<span>");const Nb=()=>{const{clearMessages:e}=qt();L(!1);const[t,n]=L(!1);return v(Ev,{get open(){return t()},onOpenChange:n,get children(){return[v(Pv,{get children(){return v(Je,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return v(Cp,{size:20})}})}}),v(Cv,{get children(){return v(kv,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[v(Pp,{size:14}),(()=>{var r=Lb();return B(r,()=>kn("restart")),r})()]}})}})]}})};function Fb(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Vb(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function Bb(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function Kb(e){return Ke({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var zb=W('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Bs=()=>{const{chatWidget:e}=ge(),[t,n]=L(!1);let r=null;an(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&l()});const o=h=>{const g=h;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async h=>{const g=h;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=async()=>{const h=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(h.webkitExitFullscreen)return h.webkitExitFullscreen(),!0;if(h.msExitFullscreen)return h.msExitFullscreen(),!0}catch{}return!1},a=h=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",h.classList.add("st-fullscreen"),n(!0)},c=h=>{h.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},l=async()=>{try{const h=Hr();if(!h)return;if(!t())o(h)&&await i(h)||a(h);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||c(h)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},u=()=>{const h=document,g=!!(document.fullscreenElement||h.webkitFullscreenElement||h.msFullscreenElement);if(n(g),!g)try{const f=Hr();f.classList.contains("st-fullscreen")&&c(f)}catch{}};document.addEventListener("fullscreenchange",u),document.addEventListener("webkitfullscreenchange",u);const d=()=>{e()?.mode==="popup"&&he("close")};return pe("toggleFullscreen",()=>{l()}),(()=>{var h=zb(),g=h.firstChild;return B(h,v(Sp,{}),g),B(g,v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:l,get children(){return v(ie,{get when(){return t()},get fallback(){return v(Vb,{size:16})},get children(){return v(Fb,{size:16})}})}}),null),B(g,v(ie,{get when(){return e()?.showSettings},get children(){return v(Nb,{})}}),null),B(g,v(ie,{get when(){return e()?.mode==="popup"},get children(){return v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:d,get children(){return v(Kb,{size:16})}})}}),null),h})()};var Ub=W("<span>");const Iu=({createdAt:e,anchor:t="end"})=>(()=>{var n=Ub();return ln(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),B(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var jb=W('<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 Wb=({children:e,createdAt:t})=>(()=>{var n=jb(),r=n.firstChild;return B(r,e),B(n,v(Iu,{createdAt:t,anchor:"start"}),null),n})();var Hb=W("<span>");const Bn=e=>{const[,t]=J(e,["class","children"]);let n=e.children?.toString();return n&&(n=Zh(Jh(n))),(()=>{var r=Hb();return r.innerHTML=n,un(r,N({get class(){return zt("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Yb=W('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const qb=({options:e,text:t})=>{let n;const{pushMessage:r}=qt(),[o,i]=L(!1),s=(a,c)=>{i(!0),r(a,c)};return(()=>{var a=Yb(),c=a.firstChild,l=c.firstChild;B(a,v(Bn,{get children(){return t?.trim()}}),c);var u=n;return typeof u=="function"?Ki(u,l):n=l,B(l,v(cn,{each:e,children:d=>v(Je,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(d.label,d.value),get children(){return d.label?.trim()}})})),ye(()=>ln(c,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Gb=W('<div class="flex flex-col"><span>'),Xb=W("<a target=_blank><img><span></span><span>");const Zb=({options:e,text:t})=>(()=>{var n=Gb(),r=n.firstChild;return B(r,()=>t?.trim()),B(n,v(cn,{each:e,children:o=>(()=>{var i=Xb(),s=i.firstChild,a=s.nextSibling,c=a.nextSibling;return B(a,()=>o.title?.trim()),B(c,()=>o.description?.trim()),ye(l=>{var u=o.url,d=o.image;return u!==l.e&&ke(i,"href",l.e=u),d!==l.t&&ke(s,"src",l.t=d),l},{e:void 0,t:void 0}),i})()}),null),n})();var Jb=W("<a target=_blank>");const Qb=({url:e,text:t})=>(()=>{var n=Jb();return ke(n,"href",e),B(n,()=>t?.trim()),n})();var ce=e=>typeof e=="function"?e():e,_u=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),ew=e=>{const t=N({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[_(()=>{if(n())return ce(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Lu=ew,Cr=e=>typeof e=="function",tw=["button","color","file","image","reset","submit"],nw=(e,t)=>e==="button"?!0:e==="input"&&t?tw.indexOf(t)!==-1:!1;function rw(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>ne(()=>{let a;return Cr(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Ks=rw,Io=new Map,_o=(e,t)=>{if(Io.has(e))return Io.get(e);const n=xe(t);return Io.set(e,n),n},zs=e=>{const t=Io.get(e);if(t)return Ce(t)},Lo=new Map,ow=e=>{V(()=>{const t=ce(e.style)??{},n=ce(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Lo.get(e.key);o?o.activeCount++:Lo.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);Y(()=>{const i=Lo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Lo.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?.()}})})},iw=ow,sw=e=>{const t=N({enabled:!0},e);V(()=>{ce(t.enabled)&&(document.addEventListener("keydown",n),Y(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},aw=sw,cw=e=>{const t=N({enabled:!0},e);V(()=>{const{body:n}=document;ce(t.enabled)&&iw({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},lw=cw,uw=e=>{const t=N({enabled:!0,strategy:"pointerup"},e);V(()=>{if(!ce(t.enabled))return;const r=ce(t.strategy);document.addEventListener(r,n),Y(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=ce(t.element),i=ce(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},dw=uw,fw=e=>{const t=N({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);aw({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),dw({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}),lw({enabled:t.noOutsidePointerEvents})},hw=fw,Us=xe(),gw=e=>_(()=>{if(Ce(Us))return v(Nu,e);const r=Be(),[o,i]=L([r]),s=c=>{i(l=>[...l,c])},a=c=>{i(l=>l.filter(u=>u!==c))};return v(Us.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return v(Nu,e)}})}),Nu=e=>{const t=N({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=J(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=Ce(Us),i=Be();V(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;hw({dismissOnEscapeKeyDown:()=>ce(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>ce(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>ce(n.noOutsidePointerEvents)&&n.enabled,onDismiss:l=>{n.onDismiss(l)},...r});const a=_(()=>n.children),c=()=>{const l=a();return Cr(l)?l({get isLastLayer(){return s()}}):l};return ne(()=>c())},pw=gw,mw=()=>{const[e,t]=L(!1);return V(()=>t(!0)),e},yw=mw,vw=(e,t)=>(e&&(Cr(e)?e(t):e[0](e[1],t)),t.defaultPrevented),js=(...e)=>e.some(t=>!!t()),bw=e=>(...t)=>{for(const n of e)n&&n(...t)},No=(...e)=>bw(e),we=e=>e?"":void 0,ww="div",xw=e=>{const[t,n]=J(e,["as"]),r=_(()=>t.as??ww);return _(()=>{const i=r();switch(typeof i){case"function":return ne(()=>i(n));case"string":return v(dr,N({component:i},n))}})},Ws=xw,Sw=e=>{let t,n=!1;return()=>n?t:(n=!0,t=_(e))},Fu=Sw,Ew=e=>_(()=>ce(e.element)?.tagName.toLowerCase()||e.fallback),Pw=Ew,Vu="button",Cw=e=>{const[t,n]=L(null),[r,o]=J(e,["as","ref","type"]),i=Pw({element:t,fallback:Vu}),s=_(()=>nw(i(),r.type));return v(Ws,N({get as(){return r.as??Vu},ref(a){var c=No(n,r.ref);typeof c=="function"&&c(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},kw=Cw,Ow='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"])',Hs="focusTrap.initialFocus",Ys="focusTrap.finalFocus",Bu={bubbles:!1,cancelable:!0},Tw=e=>{const t=N({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=_(()=>{const f=n();return f?f[0]??null:null}),i=_(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{ls(()=>{c(de(t.element)),(document.activeElement===null||document.activeElement===document.body)&&l(de(t.element))})};V(()=>{const f=de(t.element);if(f&&de(t.enabled)){s=document.activeElement,ne(()=>{c(f),l(f)});const p=new MutationObserver(a);de(t.observeChanges)&&p.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),Y(()=>{de(t.observeChanges)&&p.disconnect(),r(null),g(f)})}}),V(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),Y(()=>{document.removeEventListener("keydown",h)}))}),V(()=>{const f=o();f&&(f.addEventListener("keydown",u),Y(()=>{f.removeEventListener("keydown",u)}))}),V(()=>{const f=i();f&&(f.addEventListener("keydown",d),Y(()=>{f.removeEventListener("keydown",d)}))});const c=f=>{const p=Array.from(f.querySelectorAll(Ow)).map((m,y)=>({element:m,domIndex:y,tabIndex:m.tabIndex})).sort((m,y)=>m.tabIndex===y.tabIndex?m.domIndex-y.domIndex:m.tabIndex-y.tabIndex);r(p.map(({element:m})=>m))},l=f=>{ls(()=>{const p=de(t.initialFocusElement)??o()??f,m=t.onInitialFocus;let y;m&&(y=new CustomEvent(Hs,Bu),f.addEventListener(Hs,m),f.dispatchEvent(y),f.removeEventListener(Hs,m)),y?.defaultPrevented!==!0&&p.focus()})},u=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},d=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},g=f=>{ls(()=>{if(!de(t.restoreFocus))return;const m=de(t.finalFocusElement)??s;if(!m)return;let y;const b=t.onFinalFocus;b&&(y=new CustomEvent(Ys,Bu),f.addEventListener(Ys,b),f.dispatchEvent(y),f.removeEventListener(Ys,b)),y?.defaultPrevented!==!0&&m.focus()})}},Aw=Tw,$w=Aw,Dw=e=>{const t=_(()=>{const s=de(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(de(e.show)?"present":"hidden");let i="none";return V(s=>{const a=de(e.show);return ne(()=>{if(s===a)return a;const c=i,l=n();a?o("present"):l==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&c!==l?"hiding":"hidden")}),a}),V(()=>{const s=de(e.element);if(!s)return;const a=l=>{l.target===s&&(i=n())},c=l=>{const d=n().includes(l.animationName);l.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c),Y(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",c),s.removeEventListener("animationend",c)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},Rw=Dw,Ku=Rw,Mw=xe(),Iw=e=>e?_o(`dialog-${e}`):Mw,zu=xe(),_w=e=>e?_o(`dialog-internal-${e}`):zu,Kn=e=>{if(!e){const n=Ce(zu);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=zs(`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},Lw="div",Nw=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().contentPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return v(pw,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ws,N({ref(c){var l=No(r().setContentRef,t.ref);typeof l=="function"&&l(c)},get as(){return t.as??Lw},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return we(r().open())},get"data-closed"(){return we(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},Fw=Nw,Vw="div",Bw=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().overlayPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return(()=>{const s=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ws,N({get as(){return t.as??Vw},ref(a){var c=No(r().setOverlayRef,t.ref);typeof c=="function"&&c(a)},"aria-hidden":"true",get"data-open"(){return we(r().open())},get"data-closed"(){return we(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return s()}}))}})})()}})},Kw=Bw,zw=e=>{const[t,n]=J(e,["forceMount","contextId","children"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=yw(),s=_(a=>a||o()&&i(),!1);return v(ie,{get when(){return s()},get children(){return(()=>{const a=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Mc,N(n,{get children(){return a()}}))}})})()}})},Uw=zw,qs=!0,jw=e=>{const t=N({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??qs),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??qs),preventScroll:()=>!!(e.modal??qs),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Be()},e),[n,r]=Ks({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Lu({value:()=>t.labelId??Be()}),[a,c,l]=Lu({value:()=>t.descriptionId??Be()}),[u,d]=L(null),[h,g]=L(null),[f,p]=L(null),{present:m}=Ku({show:n,element:h}),{present:y}=Ku({show:n,element:f});$w({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ml({element:h,enabled:()=>m()&&ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return ce(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return ce(t.noOutsidePointerEvents)},get preventScroll(){return ce(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return ce(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return m()},get contentRef(){return h()},get overlayPresent(){return y()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},x=Fu(()=>t.children),w=()=>{const S=x()();return Cr(S)?S(b):S};return _(()=>{const S=Iw(t.contextId),O=_w(t.contextId);return v(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return v(O.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:c,unregisterDescriptionId:l,setContentRef:g,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return ne(()=>w())}})}})})},Ww=jw,Hw="button",Yw=e=>{const[t,n]=J(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=_(()=>Kn(t.contextId));return v(kw,N({ref(i){var s=No(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Hw},onClick:i=>{!vw(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return we(r().open())},get"data-closed"(){return we(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},qw=Yw,Fo=e=>typeof e=="function"?e():e,Uu=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Gw(e){const t=N({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;V(()=>{const l=Fo(t.element),u=Fo(t.enabled);if(!l||!u)return;const d=new ResizeObserver(a);d.observe(l),l.addEventListener("transitionend",c),Y(()=>{d.disconnect(),l.removeEventListener("transitionend",c),c()})});const a=([l])=>{if(n())return;const u=l.target,d=[u.offsetWidth,u.offsetHeight],h=Fo(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Ze(()=>{i(s),r(!0)}),Uu(()=>{i(d),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d:s?Vo(h,s)!==Vo(h,d)&&(Ze(()=>{i(Vo(h,s)),r(!0)}),Uu(()=>{i(Vo(h,d)),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d},c=()=>{if(!n())return;const l=Fo(t.element);l?s=[l.offsetWidth,l.offsetHeight]:s=null,Ze(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Vo=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Xw=Gw,Zw=Xw;const Jw=(e,t)=>e.length>0?()=>e(ne(t)):e;function Qw(e,t){let n=0;const r=e.map((o,i)=>_(()=>(n=i,o()),void 0,Hi));return _(()=>r.map(o=>o())[n],void 0,t)}function ju(e,t,n){let r=()=>t;const[o,i]=L(t,Hi),s=_(Jw(e,()=>r()),t,Hi);return[r=Qw([o,s],n),(a=>i(()=>typeof a=="function"?a(ne(r)):a))]}var e0=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},t0=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},n0=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=e0(o,t),d=u-c-r*l;(l!==0||d!==0)&&t0(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},r0=e=>v(qw,N({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Wu=xe(),o0=e=>e?_o(`drawer-${e}`):Wu,i0=e=>{if(!e){const n=Ce(Wu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=zs(`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},Hu=xe(),s0=e=>e?_o(`drawer-internal-${e}`):Hu,Yu=e=>{if(!e){const n=Ce(Hu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=zs(`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},qu=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Bo(e,t)};const o=r[n-1]?Bo(r[n-1],t):void 0,i=r[n]?Bo(r[n],t):void 0;return{value:e,offset:Bo(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Bo=(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)},a0=(e,t,n,r)=>{const o=Gu("upper",e,r?n:t),i=Gu("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},Gu=(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),c0=(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},l0=void 0,u0=e=>{const t=N({initialOpen:!1,snapPoints:[0,1],breakPoints:[l0],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,j)=>{const G=F/j;return G<1&&G>-1?1:G},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=J(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=Ks({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Ks({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[c,l]=L(),{transitioning:u,transitionSize:d}=Zw({element:()=>c()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,g]=L(!1),[f,p]=ju(()=>u()?"resizing":null),m=_(()=>{const F=c()?.contentRef();if(F)return getComputedStyle(F)}),[y,b]=L(!1);V(()=>{const F=o();ne(()=>{y()!==F&&(F?(b(!0),_u(()=>{Ze(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(Ze(()=>{p("closing"),a(0)}),_u(()=>{parseFloat(m().transitionDuration)===0&&x()})))})});const x=()=>{Ze(()=>{b(!1),p(null)})},[w,C]=L(0);V(()=>{const F=c()?.contentRef();if(!F)return;O(F);const j=new ResizeObserver(S);j.observe(F),Y(()=>{j.disconnect()})});const S=F=>{for(const j of F)j.target===c()?.contentRef()&&O(j.target)},O=F=>{const j=ne(()=>w());switch(n.side){case"top":case"bottom":if(j===F.offsetHeight)return;C(F.offsetHeight);break;case"left":case"right":if(j===F.offsetWidth)return;C(F.offsetWidth);break}},D=_(()=>qu(s(),w())),[P,T]=ju(()=>D().offset),I=_(()=>w()?(w()-P())/w():0),$={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return I()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},K=Fu(()=>n.children),U=F=>{l(Kn(n.contextId));const j=K()();if(Cr(j)){const G=N(F,$);return j(G)}return j};return _(()=>{const F=o0(n.contextId),j=s0(n.contextId);return ne(()=>v(F.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return v(j.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:T,drawerSize:w,resolvedActiveSnapPoint:D,drawerStyles:m,setTransitionState:p,transitionSize:d,closeDrawer:x}},get children(){return v(Ww,N({get open(){return y()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:G=>U(G)}))}})}}))})},d0=u0,f0=e=>{const[t,n]=J(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const c=_(()=>Yu(t.contextId)),l=_(()=>Kn(t.contextId)),u=_(()=>c().snapPoints().map((x,w)=>qu(x,c().drawerSize(),w,c().breakPoints()))),d=_(()=>{switch(c().side()){case"top":return`translate3d(0, ${-c().translate()}px, 0)`;case"bottom":return`translate3d(0, ${c().translate()}px, 0)`;case"right":return`translate3d(${c().translate()}px, 0, 0)`;case"left":return`translate3d(${-c().translate()}px, 0, 0)`}}),h=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"top":case"bottom":return`${x}px`}}),g=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"left":case"right":return`${x}px`}});V(()=>{l().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),Y(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=x=>{c0(x.target,l().contentRef())&&c().transitionState()!=="closing"&&(r=!0,c().handleScrollableElements()&&(i=[x.clientX,x.clientY]))},p=x=>{y(x.target,x.clientX,x.clientY)},m=x=>{x.touches[0]&&y(x.target,x.touches[0].clientX,x.touches[0].clientY)},y=(x,w,C)=>{if(!r)return;if(!c().isDragging()||o===null){const D=window.getSelection();if(D&&D.toString().length>0){b();return}if(c().handleScrollableElements()){const P=[w,C].map((Q,F)=>i[F]-Q),T=Math.abs(P[0])>Math.abs(P[1])?"x":"y",I=T==="x"?P[0]:P[1];if(Math.abs(I)<.3)return;const $=l().contentRef(),[K,U]=n0(x,T,$);if(I>0&&Math.abs(K)>1||I<0&&Math.abs(U)>0){b();return}}switch(c().side()){case"top":case"bottom":o=C;break;case"right":case"left":o=w}s=new Date,a=c().translate(),Ze(()=>{c().setIsDragging(!0),c().setTransitionState(null)})}let S;switch(c().side()){case"top":S=-(o-C);break;case"bottom":S=o-C;break;case"right":S=o-w;break;case"left":S=-(o-w);break}S-=c().resolvedActiveSnapPoint().offset,S>0&&(S=c().dampFunction(S));const O=new Date;O.getTime()-s.getTime()>c().velocityCacheReset()&&(s=O,a=c().translate()),c().setTranslate(-S)},b=()=>{if(r=!1,!c().isDragging())return;const x=new Date,w=c().velocityFunction(-(a-c().translate()),x.getTime()-s.getTime()||1),C=c().translate()*w,S=a0(u(),c().translate(),C,c().allowSkippingSnapPoints());Ze(()=>{c().setTransitionState("snapping"),c().setIsDragging(!1)}),Ze(()=>{c().setActiveSnapPoint(S.value),S.offset===c().drawerSize()?l().setOpen(!1):(c().setTranslate(S.offset),parseFloat(c().drawerStyles().transitionDuration)===0&&c().setTransitionState(null))})};return v(Fw,N({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":c().isDragging()?"0ms":void 0,height:h(),width:g(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ze(()=>{c().transitionState()==="closing"&&c().closeDrawer(),c().transitionState()!=="resizing"&&c().setTransitionState(null)})},get"data-transitioning"(){return we(c().isTransitioning())},get"data-opening"(){return we(c().transitionState()==="opening")},get"data-closing"(){return we(c().transitionState()==="closing")},get"data-snapping"(){return we(c().transitionState()==="snapping")},get"data-resizing"(){return we(c().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},h0=f0,g0=e=>{const[t,n]=J(e,["contextId"]),r=_(()=>Yu(t.contextId));return v(Kw,N({get contextId(){return t.contextId},get"data-transitioning"(){return we(r().isTransitioning())},get"data-opening"(){return we(r().transitionState()==="opening")},get"data-closing"(){return we(r().transitionState()==="closing")},get"data-snapping"(){return we(r().transitionState()==="snapping")},get"data-resizing"(){return we(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},p0=g0,m0=W('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const y0=d0,v0=r0,b0=Uw,w0=e=>{const[,t]=J(e,["class"]),n=i0();return v(p0,N({get class(){return zt("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))},x0=e=>{const[,t]=J(e,["class","children"]);return v(b0,{get mount(){return Hr()},get children(){return[v(w0,{}),v(h0,N({id:"smarttalks-list-content",get class(){return zt("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[m0(),Ut(()=>e.children)]}}))]}})};var S0=W('<span class="font-semibold mt-2">'),E0=W('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),P0=W('<div class="flex flex-col space-y-2"><div>'),C0=W('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),k0=W('<div class="flex flex-col items-start"><span class=text-slate-500>');const O0=({options:e,text:t,title:n})=>{const{pushMessage:r}=qt(),[o,i]=L(!1),[s,a]=L(!1),[c,l]=L(),u=(h,g)=>{a(!1),i(!0),r(h,g)},d=h=>{const g=h.composedPath();for(const f of g)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=P0(),g=h.firstChild;return B(h,v(Bn,{get children(){return t?.trim()}}),g),B(g,v(y0,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[v(v0,{as:Je,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??kn("selectOption")}}),v(x0,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=S0();return B(f,()=>n?.trim()??kn("selectOption")),f})(),(()=>{var f=E0();return B(f,v(cn,{each:e,children:p=>(()=>{var m=C0(),y=m.firstChild;return B(y,()=>p.label?.trim()??""),B(m,v(cn,{get each(){return p.items},children:b=>v(Je,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${c()===b?"bg-slate-200":""}`},onClick:()=>l(b),get children(){return[(()=>{var x=k0(),w=x.firstChild;return B(x,()=>b.label?.trim(),w),B(w,()=>b.description?.trim()),x})(),v(ie,{get when(){return c()===b},get fallback(){return v(xv,{class:"size-4 text-slate-500"})},get children(){return v(wv,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),f})(),v(Je,{get disabled(){return o()||!c()},onClick:()=>u(c().label,c().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return kn("send")}})]}})]}})),ye(()=>ln(g,o()?"opacity-50":"")),h})()};var T0=W("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const A0=e=>(()=>{var t=T0(),n=t.firstChild,r=n.nextSibling;return ye(o=>{var i=e.link,s=e.link;return i!==o.e&&ke(n,"src",o.e=i),s!==o.t&&ke(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var $0=W('<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 D0=e=>(()=>{var t=$0(),n=t.firstChild,r=n.firstChild;return B(n,v(Sv,{class:"size-10"}),r),B(r,()=>e.filename?.trim()),B(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(()=>ke(n,"href",e.link)),t})();var R0=W('<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 M0=e=>(()=>{var t=R0(),n=t.firstChild,r=n.firstChild;return B(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ke(n,"href",o.e=i),s!==o.t&&ke(r,"src",o.t=s),a!==o.a&&ke(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var I0=W('<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 _0=e=>(()=>{var t=I0(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return B(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(i=>{var s=e.link,a=e.link;return s!==i.e&&ke(r,"src",i.e=s),a!==i.t&&ke(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var L0=W("<div>Media type not supported");const Xu=e=>e.type==="image"?v(M0,e):e.type==="audio"?v(A0,e):e.type==="document"?v(D0,e):e.type==="video"?v(_0,e):L0(),Gs=({text:e})=>v(Bn,{get children(){return e?.trim()}});var pt=()=>(e,t)=>J(e,t);function N0(e){return e==null?[]:Array.isArray(e)?e:[e]}var F0=e=>e[e.length-1],V0=e=>Array.from(new Set(e));function Zu(e,t){return e.reduce((n,r,o)=>(o%t===0?n.push([r]):F0(n)?.push(r),n),[])}var Ju=e=>e?.constructor.name==="Array",B0=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ko(e[n],t[n]))return!1;return!0},Ko=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Ju(e)&&Ju(t))return B0(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Ko(e[i],t[i]))return!1}return!0},K0=e=>Array.isArray(e),Qu=e=>e!=null&&typeof e=="object",z0=e=>Qu(e)&&!K0(e),U0=e=>typeof e=="number"&&!Number.isNaN(e),zn=e=>typeof e=="string",rt=e=>typeof e=="function",j0=e=>e==null,ed=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),W0=e=>Object.prototype.toString.call(e),td=Function.prototype.toString,H0=td.call(Object),Y0=e=>{if(!Qu(e)||W0(e)!="[object Object]"||X0(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=ed(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&td.call(n)==H0},q0=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,G0=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,X0=e=>q0(e)||G0(e),nd=()=>{},kr=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function Or(e,t,...n){if(e in t){const o=t[e];return rt(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,Or),r}var{min:Z0,max:J0}=Math,Q0=e=>Number.isNaN(e),rd=e=>Q0(e)?0:e,Xs=(e,t,n)=>{const r=rd(e),o=t==null||r>=t,i=n==null||r<=n;return o&&i},ex=(e,t,n)=>Z0(J0(rd(e),t),n);function Zs(e){if(!Y0(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Zs(o))}return n}function zo(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function od(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function Js(e,t){if(e==null)throw new Error(t())}function tx(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Gt(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=xe(i);function a(){const c=Ce(s);if(!c&&t){const l=new Error(o??tx(n,r));throw l.name="ContextError",ed(Error,"captureStackTrace")&&rt(Error.captureStackTrace)&&Error.captureStackTrace(l,a),l}return c}return[s.Provider,a,s]}Gt({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});var nx=e=>pt()(e,["lazyMount","unmountOnExit"]),rx=e=>typeof e=="function",id=(e,...t)=>rx(e)?e(...t):e;function ox(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var ix=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),sx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,sd=e=>{const t={};let n;for(;n=sx.exec(e);)t[n[1]]=n[2];return t},ax=(e,t)=>{if(zn(e)){if(zn(t))return`${e};${t}`;e=sd(e)}else zn(t)&&(t=sd(t));return Object.assign({},e??{},t??{})};function cx(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=kr(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=ix(t[o],n[o]);continue}if(o==="style"){t[o]=ax(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function lx(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((c,l)=>!Ko(r[l],c)))&&(r=s,o=t(s,i)),o}}var Xt=".",ad="#",cd=new WeakMap,ld=new WeakMap;function Qs(e){return e.join(Xt)}function ux(e){return e.includes(Xt)}function ud(e){return e.startsWith(ad)}function dx(e){return e.startsWith(Xt)}function fx(e){return ud(e)?e.slice(ad.length):e}function ea(e,t){return e?`${e}${Xt}${t}`:t}function hx(e){const t=new Map,n=new Map,r=(o,i)=>{t.set(o,i);const s=i.id;s&&(n.has(s)&&od(`[zag-js] Duplicate state id: "${s}"`),n.set(s,o));const a=i.states;if(a){Js(i.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),i.initial in a||od(`[zag-js] Compound state "${o}" has initial "${String(i.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const u=ea(o,c);r(u,l)}}};for(const[o,i]of Object.entries(e.states))i&&r(o,i);return{index:t,idIndex:n}}function Tr(e){const t=cd.get(e);if(t)return t;const{index:n,idIndex:r}=hx(e);return cd.set(e,n),ld.set(e,r),n}function gx(e,t){return Tr(e),ld.get(e)?.get(t)}function ta(e){return e?String(e).split(Xt).filter(Boolean):[]}function Uo(e,t){if(!t)return[];const n=Tr(e),r=ta(t),o=[],i=[];for(const s of r){i.push(s);const a=Qs(i),c=n.get(a);if(!c)break;o.push({path:a,state:c})}return o}function Ar(e,t){const n=Tr(e),r=ta(t);if(!r.length)return t;const o=[];for(const a of r){o.push(a);const c=Qs(o);if(!n.has(c))return t}let i=Qs(o),s=n.get(i);for(;s?.initial;){const a=`${i}${Xt}${s.initial}`,c=n.get(a);if(!c)break;i=a,s=c}return i}function dd(e,t){return Tr(e).has(t)}function fd(e,t,n){const r=String(t);if(ud(r)){const o=fx(r),i=gx(e,o);return Js(i,()=>`[zag-js] Unknown state id: "${o}"`),Ar(e,i)}if(dx(r)&&n){const o=ea(n,r.slice(1));return Ar(e,o)}if(!ux(r)&&n){const o=ta(n);for(let i=o.length-1;i>=1;i--){const s=o.slice(0,i).join(Xt),a=ea(s,r);if(dd(e,a))return Ar(e,a)}if(dd(e,r))return Ar(e,r)}return Ar(e,r)}function px(e,t,n){const r=Uo(e,t);for(let i=r.length-1;i>=0;i--){const a=r[i]?.state.on?.[n];if(a)return{transitions:a,source:r[i]?.path}}return{transitions:e.on?.[n],source:void 0}}function mx(e,t,n,r){const o=t?Uo(e,t):[],i=Uo(e,n);let s=0;for(;s<o.length&&s<i.length&&o[s]?.path===i[s]?.path;)s+=1;let a=o.slice(s).reverse(),c=i.slice(s);const l=o.at(-1)?.path===i.at(-1)?.path;return r&&l&&(a=o.slice().reverse(),c=i),{exiting:a,entering:c}}function yx(e,t){return e?e===t||e.startsWith(`${t}${Xt}`):!1}function vx(e,t,n){return Uo(e,t).some(r=>r.state.tags?.includes(n))}function bx(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function hd(e){return Tr(e),e}var Un=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Un||{}),jo="__init__",wx=Object.defineProperty,xx=(e,t,n)=>t in e?wx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,na=(e,t,n)=>xx(e,typeof t!="symbol"?t+"":t,n),gd=()=>{},Wo=e=>typeof e=="object"&&e!==null,z=e=>e?"":void 0,Se=e=>e?"true":void 0,Sx=1,Ex=9,Px=11,_e=e=>Wo(e)&&e.nodeType===Sx&&typeof e.nodeName=="string",ra=e=>Wo(e)&&e.nodeType===Ex,Cx=e=>Wo(e)&&e===e.window,pd=e=>_e(e)?e.localName||"":"#document";function kx(e){return["html","body","#document"].includes(pd(e))}var md=e=>Wo(e)&&e.nodeType!==void 0,jn=e=>md(e)&&e.nodeType===Px&&"host"in e,Ox=e=>_e(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Tx(e){if(!e)return!1;const t=e.getRootNode();return yd(t)===e}function Ho(e,t){if(!e||!t||!_e(e)||!md(t))return!1;if(_e(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&jn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function mn(e){return ra(e)?e:Cx(e)?e.document:e?.ownerDocument??document}function Ax(e){return mn(e).documentElement}function Ot(e){return jn(e)?Ot(e.host):ra(e)?e.defaultView??window:_e(e)?e.ownerDocument?.defaultView??window:window}function yd(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function $x(e){if(pd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jn(e)&&e.host||Ax(e);return jn(t)?t.host:t}function Dx(e){let t;try{if(t=e.getRootNode({composed:!0}),ra(t)||jn(t))return t}catch{}return e.ownerDocument??document}var oa=new WeakMap;function ia(e){return oa.has(e)||oa.set(e,Ot(e).getComputedStyle(e)),oa.get(e)}var Rx=new Set(["menu","listbox","dialog","grid","tree","region","application"]),Mx=e=>Rx.has(e),Ix=e=>e.getAttribute("aria-controls")?.split(" ")||[];function _x(e,t){const n=new Set,r=Dx(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const c=Ix(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const u=r.getElementById(l);if(u){const d=u.getAttribute("role"),h=u.getAttribute("aria-modal")==="true";if(d&&Mx(d)&&!h&&(u===t||u.contains(t)||o(u)))return!0}}}return!1};return o(e)}var vd=()=>typeof document<"u";function Lx(){return navigator.userAgentData?.platform??navigator.platform}var sa=e=>vd()&&e.test(Lx()),bd=()=>vd()&&!!navigator.maxTouchPoints,Nx=()=>sa(/^iPhone/i),Fx=()=>sa(/^iPad/i)||xd()&&navigator.maxTouchPoints>1,wd=()=>Nx()||Fx(),xd=()=>sa(/^Mac/i);function Vx(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Wn(e){return Vx(e)?.[0]??e.target}function Bx(e){return Ed(e).isComposing||e.keyCode===229}var Kx=e=>e.button===2||xd()&&e.ctrlKey&&e.button===0,zx={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Sd={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Ux(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=zx[o]??o,n==="rtl"&&r==="horizontal"&&o in Sd&&(o=Sd[o]),o}function Ed(e){return e.nativeEvent??e}var Yo=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function jx(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=Ot(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function Wx(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function qo(e,t,n="value"){if(!e)return;const r=Wx(e);r&&jx(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}var Hx="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Pd(e){return!_e(e)||e.closest("[inert]")?!1:e.matches(Hx)&&Ox(e)}var Yx=class vh{constructor(){na(this,"id",null),na(this,"fn_cleanup"),na(this,"cleanup",()=>{this.cancel()})}static create(){return new vh}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function Te(e){const t=Yx.create();return t.request(e),t.cleanup}function aa(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function ca(e){const t=$x(e);return kx(t)?mn(t).body:_e(t)&&Xx(t)?t:ca(t)}var qx=/auto|scroll|overlay|hidden|clip/,Gx=new Set(["inline","contents"]);function Xx(e){const t=Ot(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return qx.test(n+o+r)&&!Gx.has(i)}var Hn="default",la="",Go=new WeakMap;function Zx(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return wd()?(Hn==="default"&&(la=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Hn="disabled"):t&&(Go.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Cd({target:t,doc:r})}function Cd(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(wd()){if(Hn!=="disabled")return;Hn="restoring",setTimeout(()=>{aa(()=>{Hn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=la||""),la="",Hn="default")})},300)}else if(t&&Go.has(t)){const i=Go.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Go.delete(t)}}function Jx(e={}){const{defer:t,target:n,...r}=e,o=t?Te:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(Zx({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function Qx(e,t){return Array.from(e?.querySelectorAll(t)??[])}function e1(e,t){return e?.querySelector(t)??null}function kd(e,t){if(!e)return gd;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return t1(n,t)?gd:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function t1(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function n1(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{r.aborted||(clearTimeout(c),s(l))}).catch(l=>{r.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function r1(e,t){const{timeout:n,rootNode:r}=t,o=Ot(r),i=mn(r),s=new o.AbortController;return n1(new Promise(a=>{const c=e();if(c){a(c);return}const l=new o.MutationObserver(()=>{const u=e();u&&u.isConnected&&(l.disconnect(),a(u))});l.observe(i.body,{childList:!0,subtree:!0})}),s,n)}function o1(e){const t=()=>e.getRootNode?.()??document,n=()=>mn(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>yd(t()),isActiveElement:Tx,getById:s=>t().getElementById(s)}}var i1=hd({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e("onExitComplete")?.();const n=t.get("node");if(!n)return;const r=Ot(n),o=new r.CustomEvent("exitcomplete",{bubbles:!1});n.dispatchEvent(o)},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",ia(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Te(()=>{if(r("present"))return;const s=Xo(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{Te(()=>{e.set("prevAnimationName",Xo(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=l=>{(l.composedPath?.()?.[0]??l.target)===o&&e.set("prevAnimationName",Xo(t.get("styles")))},s=l=>{const u=Xo(t.get("styles"));Wn(l)===o&&u===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})},a=l=>{Wn(l)===o&&!r("present")&&n({type:"UNMOUNT",src:"animationcancel"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",s);const c=kd(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",s),aa(()=>c())}}}}});function Xo(e){return e?.animationName||"none"}function s1(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}function Zo(e){const t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=L(t),i=_(()=>e().value!=null),s={current:r()},a={current:void 0};V(()=>{const u=i()?e().value:r();a.current=u,s.current=u});const c=u=>{const d=a.current,h=rt(u)?u(s.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:h,prev:d}),i()||o(h),n(h,d)||e().onChange?.(h,d)};function l(){const u=i()?e().value:r;return rt(u)?u():u}return{initial:t,ref:s,get:l,set:c,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}Zo.cleanup=e=>{Y(()=>e())},Zo.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function a1(e){const t={current:e};return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}function ua(e){return rt(e)?e():e}var c1=(e,t)=>{let n=[],r=!0;V(()=>{if(r){n=e.map(i=>ua(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!Ko(n[i],ua(e[i]))){o=!0;break}o&&(n=e.map(i=>ua(i)),t())})};function Od(e,t={}){const n=_(()=>{const{id:D,ids:P,getRootNode:T}=da(t);return o1({id:D,ids:P,getRootNode:T})}),r=(...D)=>{e.debug&&console.log(...D)},o=_(()=>e.props?.({props:Zs(da(t)),scope:n()})??da(t)),i=l1(o),s=e.context?.({prop:i,bindable:Zo,get scope(){return n()},flush:Td,getContext(){return a},getComputed(){return w},getRefs(){return f},getEvent(){return h()}}),a={get(D){return s?.[D].get()},set(D,P){s?.[D].set(P)},initial(D){return s?.[D].initial},hash(D){const P=s?.[D].get();return s?.[D].hash(P)}},c={current:new Map},l={current:null},u={current:null},d={current:{type:""}},h=()=>N(d.current,{current(){return d.current},previous(){return u.current}}),g=()=>N(C,{matches(...D){const P=C.get();return D.some(T=>yx(P,T))},hasTag(D){const P=C.get();return vx(e,P,D)}}),f=a1(e.refs?.({prop:i,context:a})??{}),p=()=>({state:g(),context:a,event:h(),prop:i,send:O,action:m,guard:y,track:c1,refs:f,computed:w,flush:Td,get scope(){return n()},choose:x}),m=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map(I=>{const $=e.implementations?.actions?.[I];return $||zo(`[zag-js] No implementation found for action "${JSON.stringify(I)}"`),$});for(const I of T)I?.(p())},y=D=>{if(rt(D))return D(p());const P=e.implementations?.guards?.[D];return P||zo(`[zag-js] No implementation found for guard "${JSON.stringify(D)}"`),P?.(p())},b=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map($=>{const K=e.implementations?.effects?.[$];return K||zo(`[zag-js] No implementation found for effect "${JSON.stringify($)}"`),K}),I=[];for(const $ of T){const K=$?.(p());K&&I.push(K)}return()=>I.forEach($=>$?.())},x=D=>N0(D).find(P=>{let T=!P.guard;return zn(P.guard)?T=!!y(P.guard):rt(P.guard)&&(T=P.guard(p())),T}),w=D=>{Js(e.computed,()=>"[zag-js] No computed object found on machine");const P=e.computed[D];return P({context:a,event:d.current,prop:i,refs:f,scope:n(),computed:w})},C=Zo(()=>({defaultValue:fd(e,e.initialState({prop:i})),onChange(D,P){const{exiting:T,entering:I}=mx(e,P,D,l.current?.reenter);if(T.forEach($=>{c.current.get($.path)?.(),c.current.delete($.path)}),T.forEach($=>{m($.state?.exit)}),m(l.current?.actions),I.forEach($=>{const K=b($.state?.effects);if(K){const U=c.current.get($.path);c.current.set($.path,U?kr(U,K):K)}}),P===jo){m(e.entry);const $=b(e.effects);if($){const K=c.current.get(jo);c.current.set(jo,K?kr(K,$):$)}}I.forEach($=>{m($.state?.entry)})}}));let S=Un.NotStarted;an(()=>{const D=S===Un.Started;S=Un.Started,r(D?"rehydrating...":"initializing..."),C.invoke(C.initial,jo)}),Y(()=>{r("unmounting..."),S=Un.Stopped,c.current.forEach(P=>P?.()),c.current=new Map,l.current=null,m(e.exit)});const O=D=>{queueMicrotask(()=>{if(S!==Un.Started)return;u.current=d.current,d.current=D;let P=ne(()=>C.get());const{transitions:T,source:I}=px(e,P,D.type),$=x(T);if(!$)return;l.current=$;const K=fd(e,$.target??P,I);r("transition",D.type,$.target||P,`(${$.actions})`),K!==P?C.set(K):$.reenter?C.invoke(P,P):m($.actions)})};return e.watch?.(p()),{state:g(),send:O,context:a,prop:i,get scope(){return n()},refs:f,computed:w,event:h(),getStatus:()=>S}}function Td(e){e()}function da(e){return rt(e)?e():e}function l1(e){return function(n){return e()[n]}}function ee(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let c=e[a];typeof c=="function"&&(c=c()),s=cx(s,{[i]:(c||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let c,l=e[a];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}})}}return t}var Ad={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},u1=e=>e.startsWith("--")?e:y1(e);function d1(e){return e in Ad?Ad[e]:e}var f1=s1(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&z0(r)){t.style=h1(r);continue}if(n==="children"){zn(r)&&(t.textContent=r);continue}t[d1(n)]=r}}return t});function h1(e){let t={};for(const n in e){const r=e[n];!zn(r)&&!U0(r)||(t[u1(n)]=r)}return t}var g1=/[A-Z]/g,p1=/^ms-/;function m1(e){return"-"+e.toLowerCase()}var fa={};function y1(e){if(fa.hasOwnProperty(e))return fa[e];const t=e.replace(g1,m1);return fa[e]=p1.test(t)?"-"+t:t}var $d=e=>{const[t,n]=nx(id(e)),[r,o]=L(!1),i=Od(i1,e),s=_(()=>ox(i));V(()=>{s().present&&o(!0)});const a=c=>{c&&i.send({type:"NODE.SET",node:c})};return _(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,ref:a,presenceProps:{hidden:!s().present,"data-state":s().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))},v1=e=>typeof e=="function",Dd=(e,t)=>{for(const n of e)v1(n)&&n(t)};function b1(...e){let t=null;return V(()=>{Dd(e,t)}),n=>{t=n,Dd(e,n)}}var ha=e=>n=>{const[r,o]=J(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=J(o,["ref"]);return ee(a,s)};return r.asChild(i)}return v(dr,N({component:e},o))};function w1(){const e=new Map;return new Proxy(ha,{apply(t,n,r){return ha(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,ha(r)),e.get(r)}})}var re=w1(),Rd=e=>pt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),[Md,Id]=Gt({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),$r=(e,t=[])=>({parts:(...n)=>{if(x1(t))return $r(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>$r(e,[...t,...n]),omit:(...n)=>$r(e,t.filter(r=>!n.includes(r))),rename:n=>$r(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Yn(e)}"][data-part="${Yn(r)}"]`,`& [data-scope="${Yn(e)}"][data-part="${Yn(r)}"]`].join(", "),attrs:{"data-scope":Yn(e),"data-part":Yn(r)}}}),{})}),Yn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),x1=e=>e.length===0;const S1=["top","right","bottom","left"],Zt=Math.min,Le=Math.max,Jo=Math.round,Qo=Math.floor,mt=e=>({x:e,y:e}),E1={left:"right",right:"left",bottom:"top",top:"bottom"};function ga(e,t,n){return Le(e,Zt(t,n))}function Tt(e,t){return typeof e=="function"?e(t):e}function At(e){return e.split("-")[0]}function qn(e){return e.split("-")[1]}function pa(e){return e==="x"?"y":"x"}function ma(e){return e==="y"?"height":"width"}function yt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ya(e){return pa(yt(e))}function P1(e,t,n){n===void 0&&(n=!1);const r=qn(e),o=ya(e),i=ma(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ei(s)),[s,ei(s)]}function C1(e){const t=ei(e);return[va(e),t,va(t)]}function va(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _d=["left","right"],Ld=["right","left"],k1=["top","bottom"],O1=["bottom","top"];function T1(e,t,n){switch(e){case"top":case"bottom":return n?t?Ld:_d:t?_d:Ld;case"left":case"right":return t?k1:O1;default:return[]}}function A1(e,t,n,r){const o=qn(e);let i=T1(At(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(va)))),i}function ei(e){const t=At(e);return E1[t]+e.slice(t.length)}function $1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nd(e){return typeof e!="number"?$1(e):{top:e,right:e,bottom:e,left:e}}function ti(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Fd(e,t,n){let{reference:r,floating:o}=e;const i=yt(t),s=ya(t),a=ma(s),c=At(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(qn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}async function D1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=Tt(t,e),f=Nd(g),m=a[h?d==="floating"?"reference":"floating":d],y=ti(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=ti(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-C.top+f.top)/w.y,bottom:(C.bottom-y.bottom+f.bottom)/w.y,left:(y.left-C.left+f.left)/w.x,right:(C.right-y.right+f.right)/w.x}}const R1=50,M1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:D1},c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fd(l,r,c),h=r,g=0;const f={};for(let p=0;p<i.length;p++){const m=i[p];if(!m)continue;const{name:y,fn:b}=m,{x,y:w,data:C,reset:S}=await b({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:l,platform:a,elements:{reference:e,floating:t}});u=x??u,d=w??d,f[y]={...f[y],...C},S&&g<R1&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=Fd(l,h,c)),p=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}},I1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Tt(e,t)||{};if(l==null)return{};const d=Nd(u),h={x:n,y:r},g=ya(o),f=ma(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",b=m?"bottom":"right",x=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=w/2-C/2,P=O/2-p[f]/2-1,T=Zt(d[y],P),I=Zt(d[b],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=ga($,U,K),F=!c.arrow&&qn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,j=F?U<$?U-$:U-K:0;return{[g]:h[g]+j,data:{[g]:Q,centerOffset:U-Q-j,...F&&{alignmentOffset:j}},reset:F}}}),_1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=Tt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=At(o),b=yt(a),x=At(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[ei(a)]:C1(a)),S=f!=="none";!h&&S&&C.push(...A1(a,p,f,w));const O=[a,...C],D=await c.detectOverflow(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&P.push(D[y]),d){const U=P1(o,s,w);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q&&(!(d==="alignment"?b!==yt(Q):!1)||T.every(G=>yt(G.placement)===b?G.overflows[0]>0:!0)))return{data:{index:U,overflows:T},reset:{placement:Q}};let F=($=T.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(g){case"bestFit":{var K;const j=(K=T.filter(G=>{if(S){const q=yt(G.placement);return q===b||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];j&&(F=j);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Vd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bd(e){return S1.some(t=>e[t]>=0)}const L1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Tt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Vd(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Bd(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Vd(s,n.floating);return{data:{escapedOffsets:a,escaped:Bd(a)}}}default:return{}}}}},Kd=new Set(["left","top"]);async function N1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=At(n),a=qn(n),c=yt(n)==="y",l=Kd.has(s)?-1:1,u=i&&c?-1:1,d=Tt(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*u,y:h*l}:{x:h*l,y:g*u}}const F1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await N1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},V1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=Tt(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),h=yt(At(o)),g=pa(h);let f=u[g],p=u[h];if(s){const y=g==="y"?"top":"left",b=g==="y"?"bottom":"right",x=f+d[y],w=f-d[b];f=ga(x,f,w)}if(a){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[y],w=p-d[b];p=ga(x,p,w)}const m=c.fn({...t,[g]:f,[h]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:s,[h]:a}}}}}},B1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Tt(e,t),u={x:n,y:r},d=yt(o),h=pa(d);let g=u[h],f=u[d];const p=Tt(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=h==="y"?"height":"width",w=i.reference[h]-i.floating[x]+m.mainAxis,C=i.reference[h]+i.reference[x]-m.mainAxis;g<w?g=w:g>C&&(g=C)}if(l){var y,b;const x=h==="y"?"width":"height",w=Kd.has(At(o)),C=i.reference[d]-i.floating[x]+(w&&((y=s.offset)==null?void 0:y[d])||0)+(w?0:m.crossAxis),S=i.reference[d]+i.reference[x]+(w?0:((b=s.offset)==null?void 0:b[d])||0)-(w?m.crossAxis:0);f<C?f=C:f>S&&(f=S)}return{[h]:g,[d]:f}}}},K1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=Tt(e,t),u=await s.detectOverflow(t,l),d=At(o),h=qn(o),g=yt(o)==="y",{width:f,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=h==="end"?"top":"bottom");const b=p-u.top-u.bottom,x=f-u.left-u.right,w=Zt(p-u[m],b),C=Zt(f-u[y],x),S=!t.middlewareData.shift;let O=w,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=b),S&&!h){const T=Le(u.left,0),I=Le(u.right,0),$=Le(u.top,0),K=Le(u.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Le(u.left,u.right)):O=p-2*($!==0||K!==0?$+K:Le(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function ni(){return typeof window<"u"}function Gn(e){return zd(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vt(e){var t;return(t=(zd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zd(e){return ni()?e instanceof Node||e instanceof Ne(e).Node:!1}function ot(e){return ni()?e instanceof Element||e instanceof Ne(e).Element:!1}function $t(e){return ni()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function Ud(e){return!ni()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}function Dr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=it(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function z1(e){return/^(table|td|th)$/.test(Gn(e))}function ri(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const U1=/transform|translate|scale|rotate|perspective|filter/,j1=/paint|layout|strict|content/,yn=e=>!!e&&e!=="none";let ba;function wa(e){const t=ot(e)?it(e):e;return yn(t.transform)||yn(t.translate)||yn(t.scale)||yn(t.rotate)||yn(t.perspective)||!xa()&&(yn(t.backdropFilter)||yn(t.filter))||U1.test(t.willChange||"")||j1.test(t.contain||"")}function W1(e){let t=Jt(e);for(;$t(t)&&!Xn(t);){if(wa(t))return t;if(ri(t))return null;t=Jt(t)}return null}function xa(){return ba==null&&(ba=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ba}function Xn(e){return/^(html|body|#document)$/.test(Gn(e))}function it(e){return Ne(e).getComputedStyle(e)}function oi(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(Gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ud(e)&&e.host||vt(e);return Ud(t)?t.host:t}function jd(e){const t=Jt(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:$t(t)&&Dr(t)?t:jd(t)}function Rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=jd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Sa(s);return t.concat(s,s.visualViewport||[],Dr(o)?o:[],a&&n?Rr(a):[])}else return t.concat(o,Rr(o,[],n))}function Sa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wd(e){const t=it(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$t(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Jo(n)!==i||Jo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ea(e){return ot(e)?e:e.contextElement}function Zn(e){const t=Ea(e);if(!$t(t))return mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Wd(t);let s=(i?Jo(n.width):n.width)/r,a=(i?Jo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const H1=mt(0);function Hd(e){const t=Ne(e);return!xa()||!t.visualViewport?H1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Y1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ea(e);let s=mt(1);t&&(r?ot(r)&&(s=Zn(r)):s=Zn(e));const a=Y1(i,n,r)?Hd(i):mt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=Ne(i),g=r&&ot(r)?Ne(r):r;let f=h,p=Sa(f);for(;p&&r&&g!==f;){const m=Zn(p),y=p.getBoundingClientRect(),b=it(p),x=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,w=y.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=w,f=Ne(p),p=Sa(f)}}return ti({width:u,height:d,x:c,y:l})}function ii(e,t){const n=oi(e).scrollLeft;return t?t.left+n:vn(vt(e)).left+n}function Yd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ii(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function q1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=vt(r),a=t?ri(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=mt(1);const u=mt(0),d=$t(r);if((d||!d&&!i)&&((Gn(r)!=="body"||Dr(s))&&(c=oi(r)),d)){const g=vn(r);l=Zn(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!i?Yd(s,c):mt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function G1(e){return Array.from(e.getClientRects())}function X1(e){const t=vt(e),n=oi(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ii(e);const a=-n.scrollTop;return it(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const qd=25;function Z1(e,t){const n=Ne(e),r=vt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const u=xa();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=ii(r);if(l<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,f=Math.abs(r.clientWidth-d.clientWidth-g);f<=qd&&(i-=f)}else l<=qd&&(i+=l);return{width:i,height:s,x:a,y:c}}function J1(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$t(e)?Zn(e):mt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Gd(e,t,n){let r;if(t==="viewport")r=Z1(e,n);else if(t==="document")r=X1(vt(e));else if(ot(t))r=J1(t,n);else{const o=Hd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ti(r)}function Xd(e,t){const n=Jt(e);return n===t||!ot(n)||Xn(n)?!1:it(n).position==="fixed"||Xd(n,t)}function Q1(e,t){const n=t.get(e);if(n)return n;let r=Rr(e,[],!1).filter(a=>ot(a)&&Gn(a)!=="body"),o=null;const i=it(e).position==="fixed";let s=i?Jt(e):e;for(;ot(s)&&!Xn(s);){const a=it(s),c=wa(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Dr(s)&&!c&&Xd(e,s))?r=r.filter(u=>u!==s):o=a,s=Jt(s)}return t.set(e,r),r}function eS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ri(t)?[]:Q1(t,this._c):[].concat(n),r],a=Gd(t,s[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let h=1;h<s.length;h++){const g=Gd(t,s[h],o);c=Le(g.top,c),l=Zt(g.right,l),u=Zt(g.bottom,u),d=Le(g.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function tS(e){const{width:t,height:n}=Wd(e);return{width:t,height:n}}function nS(e,t,n){const r=$t(t),o=vt(t),i=n==="fixed",s=vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=mt(0);function l(){c.x=ii(o)}if(r||!r&&!i)if((Gn(t)!=="body"||Dr(o))&&(a=oi(t)),r){const g=vn(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=o&&!r&&!i?Yd(o,a):mt(0),d=s.left+a.scrollLeft-c.x-u.x,h=s.top+a.scrollTop-c.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function Pa(e){return it(e).position==="static"}function Zd(e,t){if(!$t(e)||it(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vt(e)===n&&(n=n.ownerDocument.body),n}function Jd(e,t){const n=Ne(e);if(ri(e))return n;if(!$t(e)){let o=Jt(e);for(;o&&!Xn(o);){if(ot(o)&&!Pa(o))return o;o=Jt(o)}return n}let r=Zd(e,t);for(;r&&z1(r)&&Pa(r);)r=Zd(r,t);return r&&Xn(r)&&Pa(r)&&!wa(r)?n:r||W1(e)||n}const rS=async function(e){const t=this.getOffsetParent||Jd,n=this.getDimensions,r=await n(e.floating);return{reference:nS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oS(e){return it(e).direction==="rtl"}const iS={convertOffsetParentRelativeRectToViewportRelativeRect:q1,getDocumentElement:vt,getClippingRect:eS,getOffsetParent:Jd,getElementRects:rS,getClientRects:G1,getDimensions:tS,getScale:Zn,isElement:ot,isRTL:oS};function Qd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sS(e,t){let n=null,r;const o=vt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=Qo(d),p=Qo(o.clientWidth-(u+h)),m=Qo(o.clientHeight-(d+g)),y=Qo(u),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Le(0,Zt(1,c))||1};let w=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Qd(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function aS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Ea(e),u=o||i?[...l?Rr(l):[],...t?Rr(t):[]]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?sS(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let f,p=c?vn(e):null;c&&m();function m(){const y=vn(e);p&&!Qd(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const cS=F1,lS=V1,uS=_1,dS=K1,fS=L1,hS=I1,gS=B1,pS=(e,t,n)=>{const r=new Map,o={platform:iS,...n},i={...o.platform,_c:r};return M1(e,t,{...o,platform:i})};function ef(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function mS(e){if(!e)return ef();const{x:t,y:n,width:r,height:o}=e;return ef(t,n,r,o)}function yS(e,t){return{contextElement:_e(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?mS(r):n.getBoundingClientRect()}}}var Mr=e=>({variable:e,reference:`var(${e})`}),Dt={arrowSize:Mr("--arrow-size"),arrowSizeHalf:Mr("--arrow-size-half"),arrowBg:Mr("--arrow-background"),transformOrigin:Mr("--transform-origin"),arrowOffset:Mr("--arrow-offset")},vS=e=>e==="top"||e==="bottom"?"y":"x";function bS(e,t){return{name:"transformOrigin",fn(n){const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,c=i.split("-")[0],l=vS(c),u=o.arrow?.x||0,d=o.arrow?.y||0,h=t?.clientWidth||0,g=t?.clientHeight||0,f=u+h/2,p=d+g/2,m=Math.abs(o.shift?.y||0),y=s.reference.height/2,b=g/2,x=e.offset?.mainAxis??e.gutter,w=typeof x=="number"?x+b:x??b,C=m>w,S={top:`${f}px calc(100% + ${w}px)`,bottom:`${f}px ${-w}px`,left:`calc(100% + ${w}px) ${p}px`,right:`${-w}px ${p}px`}[c],O=`${f}px ${s.reference.y+y-a}px`,D=!!e.overlap&&l==="y"&&C;return r.floating.style.setProperty(Dt.transformOrigin.variable,D?O:S),{data:{transformOrigin:D?O:S}}}}}var wS={name:"rects",fn({rects:e}){return{data:e}}},xS=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Dt.arrowOffset.reference})`}),{}}}};function SS(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function ES(e){return e.split("-")[0]}var PS={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function tf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Jn(e,t){return e!=null&&Math.abs(e-t)<.5}function si(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function CS(e,t,n){const r=e||t.createElement("div");return hS({element:r,padding:n.arrowPadding})}function kS(e,t){if(!j0(t.offset??t.gutter))return cS(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=SS(n),a=s?void 0:t.shift,c=t.offset?.crossAxis??a;return Zs({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function OS(e){if(e.flip)return uS(()=>{const t=si(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function TS(e){if(!(!e.slide&&!e.overlap))return lS(()=>{const t=si(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:gS()}})}function AS(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,o;return dS(()=>{const i=si(e.boundary);return{padding:e.overflowPadding,...i?{boundary:i}:void 0,apply({elements:s,rects:a,availableHeight:c,availableWidth:l}){const u=s.floating,d=Math.round(a.reference.width),h=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),Jn(t,d)||(u.style.setProperty("--reference-width",`${d}px`),t=d),Jn(n,h)||(u.style.setProperty("--reference-height",`${h}px`),n=h),Jn(r,l)||(u.style.setProperty("--available-width",`${l}px`),r=l),Jn(o,c)||(u.style.setProperty("--available-height",`${c}px`),o=c)}}})}function $S(e){if(e.hideWhenDetached)return fS(()=>({strategy:"referenceHidden",boundary:si(e.boundary)??"clippingAncestors"}))}function DS(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var RS=["transform","visibility","pointer-events","--x","--y","--z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],MS=["top","right","bottom","left"];function nf(e,t){if(!e)return nd;const n=new Map(t.map(r=>[r,e.style.getPropertyValue(r)]));return()=>{n.forEach((r,o)=>{r?e.style.setProperty(o,r):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function rf(e){return e==null?null:_e(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function IS(e,t,n={}){const r=()=>(typeof t=="function"?t():t)??null,o=()=>{const T=typeof e=="function"?e():e;return n.getAnchorElement?.()??T},i=()=>{const T=o();return!T&&!n.getAnchorRect?null:yS(T,n.getAnchorRect)},s=Object.assign({},PS,n);let a=[],c=null,l,u;function d(T){l?.(),u?.(),c=T,l=s.restoreStyles?nf(T,RS):void 0;const I=T.querySelector("[data-part=arrow]");u=s.restoreStyles?nf(I,MS):void 0,a=[kS(I,s),OS(s),TS(s),CS(I,T.ownerDocument,s),xS(I),bS({gutter:s.gutter,offset:s.offset,overlap:s.overlap},I),AS(s),$S(s),wS]}const{placement:h,strategy:g,onComplete:f,onPositioned:p}=s;let m,y,b=!1,x,w,C=nd;const S=DS(s.listeners);function O(){if(!s.listeners)return;const T=o(),I=i(),$=r();if(!I||!$)return;(rf(T)!==rf(x)||$!==w)&&(C(),x=T,w=$,C=aS(I,$,P,S))}async function D(){O();const T=r();if(!T)return;T!==c&&(d(T),b=!1);const I=i();if(!I)return;const $=await pS(I,T,{placement:h,middleware:a,strategy:g});f?.($);const K=Ot(T),U=tf(K,$.x),Q=tf(K,$.y);if(Jn(m,U)||(T.style.setProperty("--x",`${U}px`),m=U),Jn(y,Q)||(T.style.setProperty("--y",`${Q}px`),y=Q),s.hideWhenDetached&&($.middlewareData.hide?.referenceHidden?(T.style.setProperty("visibility","hidden"),T.style.setProperty("pointer-events","none")):(T.style.removeProperty("visibility"),T.style.removeProperty("pointer-events"))),!b){const F=T.firstElementChild;F&&(T.style.setProperty("--z-index",ia(F).zIndex),b=!0)}}async function P(){n.updatePosition?(await n.updatePosition({updatePosition:D,floatingElement:r()}),p?.({placed:!0})):await D()}return P(),()=>{C(),u?.(),l?.(),p?.({placed:!1})}}function _S(e,t,n={}){const{defer:r,...o}=n,i=r?Te:a=>a(),s=[];return s.push(i(()=>{s.push(IS(e,t,o))})),()=>{s.forEach(a=>a?.())}}var LS={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function NS(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Dt.arrowSize.reference,height:Dt.arrowSize.reference,[Dt.arrowSizeHalf.variable]:`calc(${Dt.arrowSize.reference} / 2)`,[Dt.arrowOffset.variable]:`calc(${Dt.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?LS[t.split("-")[0]]:void 0,background:Dt.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function FS(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function VS(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var of="pointerdown.outside",sf="focus.outside";function BS(e){for(const t of e)if(_e(t)&&Pd(t))return!0;return!1}var af=e=>"clientY"in e;function KS(e,t){if(!af(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function zS(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function cf(e,t){if(!t||!af(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return zS(s,a)?r||i:!1}function US(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const c=mn(e),l=Ot(e),u=FS(l),d=VS(l);function h(w,C){if(!_e(C)||!C.isConnected||Ho(e,C)||KS(e,w)||a&&_x(e,C))return!1;const S=c.querySelector(`[aria-controls="${e.id}"]`);if(S){const D=ca(S);if(cf(w,D))return!1}const O=ca(e);return cf(w,O)?!1:!n?.(C)}const g=new Set,f=jn(e?.getRootNode());let p=!1;function m(w){p=!0;const C=()=>{p=!1};c.addEventListener("pointerup",C,{once:!0}),l.addEventListener("pointerup",C,{once:!0});function S(O){const D=s&&!bd()?Te:I=>I(),P=O??w,T=P?.composedPath?.()??[P?.target];D(()=>{const I=f?T[0]:Wn(w);if(!(!e||!h(w,I))){if(o||i){const $=kr(o,i);e.addEventListener(of,$,{once:!0})}lf(e,of,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:Kx(P),focusable:BS(T),target:I}})}})}w.pointerType==="touch"?(g.forEach(O=>O()),g.add(Yo(c,"click",S,{once:!0})),g.add(d.addEventListener("click",S,{once:!0})),g.add(u.addEventListener("click",S,{once:!0}))):S()}const y=new Set,b=setTimeout(()=>{y.add(Yo(c,"pointerdown",m,!0)),y.add(d.addEventListener("pointerdown",m,!0)),y.add(u.addEventListener("pointerdown",m,!0))},0);function x(w){if(p)return;(s?Te:S=>S())(()=>{const S=w?.composedPath?.()??[w?.target],O=f?S[0]:Wn(w);if(!(!e||!h(w,O))){if(r||i){const D=kr(r,i);e.addEventListener(sf,D,{once:!0})}lf(e,sf,{bubbles:!1,cancelable:!0,detail:{originalEvent:w,contextmenu:!1,focusable:Pd(O),target:O}})}})}return bd()||(y.add(Yo(c,"focusin",x,!0)),y.add(d.addEventListener("focusin",x,!0)),y.add(u.addEventListener("focusin",x,!0))),()=>{clearTimeout(b),g.forEach(w=>w()),y.forEach(w=>w())}}function jS(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(US(i,t))})),()=>{o.forEach(i=>i?.())}}function lf(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function WS(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Yo(mn(e),"keydown",n,{capture:!0})}var uf="layer:request-dismiss",Ae={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(r=>Ho(r.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>Ho(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(r=>{const o=r();o&&HS(o)}),this.recentlyRemoved.add(e),aa(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>Ae.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{df(e,t,e.node),e.styleTargets?.forEach(n=>{const r=n();if(!r||r===e.node)return;df(e,t,r);const{zIndex:o}=ia(e.node);r.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];qS(e,uf,o=>{r.requestDismiss?.(o),o.defaultPrevented||r?.dismiss()}),YS(e,uf,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function df(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),Ae.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=Ae.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function HS(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.style.removeProperty("--z-index"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function YS(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function qS(e,t,n){e.addEventListener(t,n,{once:!0})}var Ca=new WeakMap,Ir=new WeakMap;function GS(e){return Ae.isBelowPointerBlockingLayer(e)?"none":"auto"}function ff(e){const t=GS(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function XS(e){if(Ir.has(e))return;const t=Ot(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{Ir.has(e)&&ff(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),Ir.set(e,n)}function hf(){Ae.layers.forEach(({node:e})=>{ff(e),XS(e)})}function ZS(e){const t=Ir.get(e);t&&(t.disconnect(),Ir.delete(e)),e.style.pointerEvents=""}function JS(e,t){const n=mn(e),r=[];return Ae.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Ca.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[i,s]=r1(()=>{const a=o();return _e(a)?a:null},{timeout:1e3});i.then(a=>r.push(kd(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{Ae.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const i=Ca.get(o);i!==void 0&&(o.style.pointerEvents=i,Ca.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),r.forEach(o=>o()))}}function QS(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){zo("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:c="dialog",layerStyleTargets:l}=t,u={dismiss:r,node:e,type:c,pointerBlocking:i,requestDismiss:o,styleTargets:l};Ae.add(u),hf();function d(m){const y=Wn(m.detail.originalEvent);Ae.isBelowPointerBlockingLayer(e)||Ae.isInBranch(y)||(t.onPointerDownOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),r?.()))}function h(m){const y=Wn(m.detail.originalEvent);Ae.isInBranch(y)||(t.onFocusOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),r?.()))}function g(m){Ae.isTopMost(e)&&(t.onEscapeKeyDown?.(m),!m.defaultPrevented&&r&&(m.preventDefault(),r()))}function f(m){if(!e)return!1;const y=typeof s=="function"?s():s,b=Array.isArray(y)?y:[y],x=t.persistentElements?.map(w=>w()).filter(_e);return x&&b.push(...x),b.some(w=>Ho(w,m))||Ae.isInNestedLayer(e,m)}const p=[i?JS(e,t.persistentElements):void 0,WS(e,g),jS(e,{exclude:f,onFocusOutside:h,onPointerDownOutside:d,defer:t.defer})];return()=>{Ae.remove(e),hf(),ZS(e),p.forEach(m=>m?.())}}function eE(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=rt(e)?e():e;o.push(QS(i,t))})),()=>{o.forEach(i=>i?.())}}var[dk,tE]=Gt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});function ka(e,t){return e-t*Math.floor(e/t)}const gf=1721426;function ai(e,t,n,r){t=Oa(e,t);let o=t-1,i=-2;return n<=2?i=0:ci(t)&&(i=-1),gf-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function ci(e){return e%4===0&&(e%100!==0||e%400===0)}function Oa(e,t){return e==="BC"?1-t:t}function nE(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const rE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Qn{fromJulianDay(t){let n=t,r=n-gf,o=Math.floor(r/146097),i=ka(r,146097),s=Math.floor(i/36524),a=ka(i,36524),c=Math.floor(a/1461),l=ka(a,1461),u=Math.floor(l/365),d=o*400+s*100+c*4+u+(s!==4&&u!==4?1:0),[h,g]=nE(d),f=n-ai(h,g,1,1),p=2;n<ai(h,g,3,1)?p=0:ci(g)&&(p=1);let m=Math.floor(((f+p)*12+373)/367),y=n-ai(h,g,m,1)+1;return new Lt(h,g,m,y)}toJulianDay(t){return ai(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return rE[ci(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ci(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const oE={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Fe(e,t){return t=ve(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function iE(e,t){return t=ve(t,e.calendar),e=Rt(e),t=Rt(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function sE(e,t){return t=ve(t,e.calendar),e=Nr(e),t=Nr(t),e.era===t.era&&e.year===t.year}function aE(e,t){return li(e.calendar,t.calendar)&&Fe(e,t)}function _r(e,t){return li(e.calendar,t.calendar)&&iE(e,t)}function Lr(e,t){return li(e.calendar,t.calendar)&&sE(e,t)}function li(e,t){var n,r,o,i;return(i=(o=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function cE(e,t){return Fe(e,ui(t))}const lE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function pf(e,t,n){let r=e.calendar.toJulianDay(e),o=n?lE[n]:hE(t),i=Math.ceil(r+1-o)%7;return i<0&&(i+=7),i}function mf(e){return It(Date.now(),e)}function ui(e){return bn(mf(e))}function yf(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function uE(e,t){return vf(e)-vf(t)}function vf(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ta=null,dE=!1;function Aa(){return Ta==null&&(Ta=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ta}function bf(){return dE}function Rt(e){return e.subtract({days:e.day-1})}function $a(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Nr(e){return Rt(e.subtract({months:e.month-1}))}function fE(e){return $a(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function Qt(e,t,n){let r=pf(e,t,n);return e.subtract({days:r})}function wf(e,t,n){return Qt(e,t,n).add({days:6})}const xf=new Map,Da=new Map;function Sf(e){if(Intl.Locale){let n=xf.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&xf.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function hE(e){let t=Da.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo(),t))return Da.set(e,t),t.firstDay}let n=Sf(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];r==="mon"?t={firstDay:1}:r==="tue"?t={firstDay:2}:r==="wed"?t={firstDay:3}:r==="thu"?t={firstDay:4}:r==="fri"?t={firstDay:5}:r==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&oE[n]||0};Da.set(e,t)}return t.firstDay}function gE(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((pf(Rt(e),t,n)+r)/7)}function Ef(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Pf(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const pE={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function mE(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Sf(t),[i,s]=pE[o]||[6,0];return r===i||r===s}function er(e){e=ve(e,new Qn);let t=Oa(e.era,e.year);return Cf(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Cf(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Ra(e,t){if(t==="UTC")return 0;if(e>0&&t===Aa()&&!bf())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=Of(e,t);return Cf(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const kf=new Map;function Of(e,t){let n=kf.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),kf.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const Tf=864e5;function yE(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>vE(e,t,i))}function vE(e,t,n){let r=Of(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Mt(e,t,n="compatible"){let r=We(e);if(t==="UTC")return er(r);if(t===Aa()&&n==="compatible"&&!bf()){r=ve(r,new Qn);let c=new Date,l=Oa(r.era,r.year);return c.setFullYear(l,r.month-1,r.day),c.setHours(r.hour,r.minute,r.second,r.millisecond),c.getTime()}let o=er(r),i=Ra(o-Tf,t),s=Ra(o+Tf,t),a=yE(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function Af(e,t,n="compatible"){return new Date(Mt(e,t,n))}function It(e,t){let n=Ra(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new Vr(o<1?"BC":"AD",o<1?-o+1:o,i,s,t,n,a,c,l,u)}function bn(e){return new Lt(e.calendar,e.era,e.year,e.month,e.day)}function We(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new gi(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function ve(e,t){if(li(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,wn(r),r}function $f(e,t,n){if(e instanceof Vr)return e.timeZone===t?e:wE(e,t);let r=Mt(e,t,n);return It(r,t)}function bE(e){let t=er(e)-e.offset;return new Date(t)}function wE(e,t){let n=er(e)-e.offset;return ve(It(n,t),e.calendar)}const Fr=36e5;function di(e,t){let n=e.copy(),r="hour"in n?PE(n,t):0;Ma(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Ia(n),Df(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,xE(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let c=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Ma(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function Ia(e){for(;e.month<1;)Ma(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Ma(e,1)}function xE(e){for(;e.day<1;)e.month--,Ia(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Ia(e)}function Df(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function wn(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Df(e)}function Rf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Mf(e,t){return di(e,Rf(t))}function _a(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),wn(n),n}function fi(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),EE(n),n}function SE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=hi(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=hi(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=hi(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=hi(e.hour,24),t}function EE(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function hi(e,t){let n=e%t;return n<0&&(n+=t),n}function PE(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,SE(e)}function La(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),c=a.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=_t(c,n,0,a.length-1,r?.round),o.era=a[c],wn(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=_t(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=_t(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=_t(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),wn(o),o}function If(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let c=i>=12;s=c?12:0,a=c?23:11}o.hour=_t(i,n,s,a,r?.round);break}case"minute":o.minute=_t(e.minute,n,0,59,r?.round);break;case"second":o.second=_t(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=_t(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function _t(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function _f(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=di(We(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Mt(o,e.timeZone)}else n=er(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=It(n,e.timeZone);return ve(r,e.calendar)}function CE(e,t){return _f(e,Rf(t))}function kE(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let f=e.hour>=12;o=f?12:0,i=f?23:11}let s=We(e),a=ve(fi(s,{hour:o}),new Qn),c=[Mt(a,e.timeZone,"earlier"),Mt(a,e.timeZone,"later")].filter(f=>It(f,e.timeZone).day===a.day)[0],l=ve(fi(s,{hour:i}),new Qn),u=[Mt(l,e.timeZone,"earlier"),Mt(l,e.timeZone,"later")].filter(f=>It(f,e.timeZone).day===l.day).pop(),d=er(e)-e.offset,h=Math.floor(d/Fr),g=d%Fr;return d=_t(h,n,Math.floor(c/Fr),Math.floor(u/Fr),r?.round)*Fr+g,ve(It(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return If(e,t,n,r);case"era":case"year":case"month":case"day":{let o=La(We(e),t,n,r),i=Mt(o,e.timeZone);return ve(It(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function OE(e,t,n){let r=We(e),o=fi(_a(r,t),t);if(o.compare(r)===0)return e;let i=Mt(o,e.timeZone,n);return ve(It(i,e.timeZone),e.calendar)}function TE(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Lf(e){let t=ve(e,new Qn),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Nf(e){return`${Lf(e)}T${TE(e)}`}function AE(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return o!==0&&(i+=`:${String(o).padStart(2,"0")}`),i}function $E(e){return`${Nf(e)}${AE(e.offset)}[${e.timeZone}]`}function Na(e){let t=typeof e[0]=="object"?e.shift():new Qn,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var DE=new WeakMap;class Lt{copy(){return this.era?new Lt(this.calendar,this.era,this.year,this.month,this.day):new Lt(this.calendar,this.year,this.month,this.day)}add(t){return di(this,t)}subtract(t){return Mf(this,t)}set(t){return _a(this,t)}cycle(t,n,r){return La(this,t,n,r)}toDate(t){return Af(this,t)}toString(){return Lf(this)}compare(t){return yf(this,t)}constructor(...t){cs(this,DE,{writable:!0,value:void 0});let[n,r,o,i,s]=Na(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,wn(this)}}var RE=new WeakMap;class gi{copy(){return this.era?new gi(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new gi(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return di(this,t)}subtract(t){return Mf(this,t)}set(t){return _a(fi(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return La(this,t,n,r);default:return If(this,t,n,r)}}toDate(t,n){return Af(this,t,n)}toString(){return Nf(this)}compare(t){let n=yf(this,t);return n===0?uE(this,We(t)):n}constructor(...t){cs(this,RE,{writable:!0,value:void 0});let[n,r,o,i,s]=Na(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,wn(this)}}var ME=new WeakMap;class Vr{copy(){return this.era?new Vr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Vr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return _f(this,t)}subtract(t){return CE(this,t)}set(t,n){return OE(this,t,n)}cycle(t,n,r){return kE(this,t,n,r)}toDate(){return bE(this)}toString(){return $E(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-$f(t,this.timeZone).toDate().getTime()}constructor(...t){cs(this,ME,{writable:!0,value:void 0});let[n,r,o,i,s]=Na(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,wn(this)}}let Fa=new Map;class He{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return LE()&&(this.resolvedHourCycle||(this.resolvedHourCycle=NE(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=Ff(t,n),this.options=n}}const IE={true:{ja:"h11"},false:{}};function Ff(e,t={}){if(typeof t.hour12=="boolean"&&_E()){t={...t};let o=IE[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Fa.has(n))return Fa.get(n);let r=new Intl.DateTimeFormat(e,t);return Fa.set(n,r),r}let Va=null;function _E(){return Va==null&&(Va=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Va}let Ba=null;function LE(){return Ba==null&&(Ba=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Ba}function NE(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=Ff(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}var[fk,FE]=Gt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),VE=Object.defineProperty,BE=(e,t)=>{for(var n in t)VE(e,n,{get:t[n],enumerable:!0})},pi="__live-region__",Ka="__live-region-debug__",KE="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;";function zE(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0,debug:i=!1}=e,s=n.defaultView??window,a=r??n.body;function c(){if(!i)return;let d=n.getElementById(Ka);return d||(d=n.createElement("div"),d.id=Ka,d.dataset.liveAnnouncerDebug="true",d.setAttribute("aria-hidden","true"),d.style.cssText=KE,a.appendChild(d),d)}function l(d,h){n.getElementById(pi)?.remove(),h=h??o;const f=n.createElement("span");f.id=pi,f.dataset.liveAnnouncer="true";const p=t!=="assertive"?"status":"alert";f.setAttribute("aria-live",t),f.setAttribute("role",p),Object.assign(f.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),a.appendChild(f),s.setTimeout(()=>{if(!f.isConnected)return;f.textContent=d;const m=c();m&&(m.textContent=d)},h)}function u(){n.getElementById(pi)?.remove(),n.getElementById(Ka)?.remove()}return{announce:l,destroy:u,toJSON(){return pi}}}function UE(e,t,n,r,o){const i={};for(let a in t){const c=a,l=t[c];l!=null&&(i[c]=Math.floor(l/2),i[c]>0&&l%2===0&&i[c]--)}const s=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function xn(e,t,n,r,o){let i=e;return t.years?i=Nr(e):t.months?i=Rt(e):t.weeks&&(i=Qt(e,n)),Br(e,i,t,n,r,o)}function za(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function Br(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=Pf(t,xn(bn(o),n,r))),i&&e.compare(i)<=0&&(t=Ef(t,za(bn(i),n,r))),t}function Ye(e,t,n){const r=bn(e),o=t?bn(t):void 0,i=n?bn(n):void 0;let s=r;return o&&(s=Pf(s,o)),i&&(s=Ef(s,i)),s.compare(r)===0?e:"hour"in e?e.set({year:s.year,month:s.month,day:s.day}):s}function Vf(e,t,n,r,o,i){switch(t){case"start":return xn(e,n,r,o,i);case"end":return za(e,n,r,o,i);case"center":default:return UE(e,n,r,o,i)}}function en(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?Fe(e,t):We(e).compare(We(t))===0}function Bf(e,t,n,r,o){return e?t?.(e,n)?!0:bt(e,r,o):!1}function bt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function jE(e,t,n){const r=e.subtract({days:1});return Fe(r,e)||bt(r,t,n)}function WE(e,t,n){const r=e.add({days:1});return Fe(r,e)||bt(r,t,n)}function Ua(e){let t={...e};for(let n in t)t[n]=1;return t}function Kf(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function zf(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function Uf(e,t,n){const r=n??We(ui(t));return new He(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:zf(r),calendar:r.calendar.identifier,timeZone:t})}function jf(e,t,n){const r=n??ui(t);return new He(e,{month:"long",year:"numeric",era:zf(r),calendar:r.calendar.identifier,timeZone:t})}function HE(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let l=0;l<i.length;l++){let u=i[l];if(u.source==="shared"&&u.type==="literal")s=l;else if(u.source==="endRange")break}let a="",c="";for(let l=0;l<i.length;l++)l<s?a+=i[l].value:l>s&&(c+=i[l].value);return r(a,c)}function mi(e,t,n,r){if(!e)return"";let o=e,i=t??e,s=Uf(n,r);return Fe(o,i)?s.format(o.toDate(r)):HE(o,i,s,(a,c)=>`${a} – ${c}`,r)}var YE=["sun","mon","tue","wed","thu","fri","sat"];function Wf(e){return e!=null?YE[e]:void 0}function Hf(e,t,n){const r=Wf(n);return Qt(e,t,r)}function Yf(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=Hf(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(Fe(s,a))break;s=a}return i}function qE(e,t,n,r){const o=Wf(r),i=n??gE(e,t,o);return[...new Array(i).keys()].map(a=>Yf(a,e,t,r))}function GE(e,t){const n=new He(e,{weekday:"long",timeZone:t}),r=new He(e,{weekday:"short",timeZone:t}),o=new He(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function XE(e,t,n,r){const o=Hf(e,r,t),i=[...new Array(7).keys()],s=GE(r,n);return i.map(a=>s(o.add({days:a})))}function ZE(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const s=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(s.toLocaleString(e,{month:t})),s.setMonth(s.getMonth()+1);return a}const r=n.calendar.getMonthsInYear(n),o=new He(e,{month:t,calendar:n.calendar.identifier}),i=[];for(let s=1;s<=r;s++){const a=n.set({month:s});i.push(o.format(a.toDate("UTC")))}return i}function qf(e,t){const n=Qt(e,t,"mon"),r=n.year,o=n.set({month:1,day:4}),i=Qt(o,t,"mon"),s=n.calendar.toJulianDay(n),a=i.calendar.toJulianDay(i);if(s>=a)return 1+Math.floor((s-a)/7);const c=n.set({year:r-1,month:1,day:4}),l=Qt(c,t,"mon"),u=l.calendar.toJulianDay(l);return 1+Math.floor((s-u)/7)}function JE(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var QE=1900,eP=2099;function tP(e,t,n){const r=e.calendar,o=t?.year??ve(new Lt(QE,1,1),r).year,i=n?.year??ve(new Lt(eP,12,31),r).year;return{from:o,to:i}}var nP=10;function rP(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,r=parseInt(e.slice(-2),10),o=n+r;return o>t+nP?(o-100).toString():o.toString()}return e}}function tr(e,t){const n=t?.strict?10:12,r=e-e%10,o=[];for(let i=0;i<n;i+=1){const s=r+i;o.push(s)}return o}function Kr(e,t){const n=ui(e??Aa());return t?ve(n,t):n}function zr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,c=Kf(s,e);return bt(a,n,r)?{startDate:s,focusedDate:Ye(a,n,r),endDate:c}:a.compare(s)<0?{startDate:za(a,e,t,n,r),focusedDate:Ye(a,n,r),endDate:c}:a.compare(c)>0?{startDate:xn(a,e,t,n,r),endDate:c,focusedDate:Ye(a,n,r)}:{startDate:s,endDate:c,focusedDate:Ye(a,n,r)}}}function Gf(e,t,n,r,o,i){const s=zr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function Xf(e,t,n,r,o,i){const s=zr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function oP(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(Ua(r)),startDate:t});if(r.days)return Gf(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function iP(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(Ua(r)),startDate:t});if(r.days)return Xf(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var Zf=(e,t)=>e?/\d/.test(e)||t.includes(e)||e.length!==1:!0,sP=(e,t)=>e.split("").filter(n=>Zf(n,t)).join(""),Jf=new Map;function aP(e){let t=Jf.get(e);if(t!=null)return t;const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=r?r.value:"/",Jf.set(e,t),t}var Qf=e=>e!=null&&e.length===4,cP=e=>e!=null&&parseFloat(e)<=12,lP=e=>e!=null&&parseFloat(e)<=31;function uP(e,t,n){const r=dP(t,n);let{year:o,month:i,day:s}=fP(r,e)??{};if(o!=null||i!=null||s!=null){const l=new Date;o||(o=l.getFullYear().toString()),i||(i=(l.getMonth()+1).toString()),s||(s=l.getDate().toString())}if(Qf(o)||(o=rP(o)),Qf(o)&&cP(i)&&lP(s))return new Lt(+o,+i,+s);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new Lt(l.getFullYear(),l.getMonth()+1,l.getDate())}}function dP(e,t){return new He(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function fP(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function eh(e,t,n){const r=bn(mf(n));switch(e){case"thisWeek":return[Qt(r,t),wf(r,t)];case"thisMonth":return[Rt(r),r];case"thisQuarter":return[Rt(r).add({months:-((r.month-1)%3)}),r];case"thisYear":return[Nr(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[Rt(r.add({months:-1})),$a(r.add({months:-1}))];case"lastQuarter":return[Rt(r.add({months:-((r.month-1)%3)-3})),$a(r.add({months:-((r.month-1)%3)-1}))];case"lastWeek":return[Qt(r,t).add({weeks:-1}),wf(r,t).add({weeks:-1})];case"lastYear":return[Nr(r.add({years:-1})),fE(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var th=$r("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),oe=th.build(),hP=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,gP=e=>e.ids?.root??`datepicker:${e.id}`,pP=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,ja=e=>e.ids?.content??`datepicker:${e.id}:content`,Wa=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,mP=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,yP=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,vP=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,nh=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,rh=e=>e.ids?.control??`datepicker:${e.id}:control`,oh=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,ih=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,sh=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,ah=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,ch=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,lh=(e,t)=>e1(vi(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),yi=e=>e.getById(ih(e)),vi=e=>e.getById(ja(e)),Ur=e=>Qx(dh(e),"[data-part=input]"),bP=e=>e.getById(ch(e)),wP=e=>e.getById(ah(e)),xP=e=>e.getById(nh(e)),uh=e=>e.getById(sh(e)),dh=e=>e.getById(rh(e));function Ha(e){const[t,n]=e;let r;return!t||!n?r=e:r=t.compare(n)<=0?e:[n,t],r}function nr(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function bi(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function SP(e){return Or(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var EP={day:"dd",month:"mm",year:"yyyy"};function PP(e){return new He(e).formatToParts(new Date).map(t=>EP[t.type]??t.value).join("")}var fh=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),CP={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return Or(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return Or(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return Or(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function Nt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Ya(e){return e===0?"day":e===1?"month":"year"}function qa(e,t,n){return Ya(ex(Nt(e,0),Nt(t,0),Nt(n,2)))}function kP(e,t){return Nt(e,0)>Nt(t,0)}function OP(e,t){return Nt(e,0)<Nt(t,0)}function TP(e,t,n){const r=Nt(e,0)+1;return qa(Ya(r),t,n)}function AP(e,t,n){const r=Nt(e,0)-1;return qa(Ya(r),t,n)}var $P=["day","month","year"];function DP(e){$P.forEach(t=>e(t))}var RP=lx(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale],([e],t)=>{const{startValue:n,endValue:r,locale:o,timeZone:i,selectionMode:s}=t;if(e==="year"){const d=tr(n.year,{strict:!0}),h=d.at(0).toString(),g=d.at(-1).toString();return{start:h,end:g,formatted:`${h} - ${g}`}}if(e==="month"){const d=new He(o,{year:"numeric",timeZone:i,calendar:n.calendar.identifier}),h=d.format(n.toDate(i)),g=d.format(r.toDate(i)),f=s==="range"?`${h} - ${g}`:h;return{start:h,end:g,formatted:f}}const a=new He(o,{month:"long",year:"numeric",timeZone:i,calendar:n.calendar.identifier}),c=a.format(n.toDate(i)),l=a.format(r.toDate(i)),u=s==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:u}});function MP(e,t){const{state:n,context:r,prop:o,send:i,computed:s,scope:a}=e,c=r.get("startValue"),l=s("endValue"),u=r.get("value"),d=r.get("focusedValue"),h=r.get("hoveredValue"),g=h?Ha([u[0],h]):[],f=!!o("disabled"),p=!!o("readOnly"),m=!!o("invalid"),y=s("isInteractive"),b=u.length===0,x=o("min"),w=o("max"),C=o("locale"),S=o("timeZone"),O=o("startOfWeek"),D=n.matches("focused"),P=n.matches("open"),T=o("selectionMode")==="range",I=o("selectionMode")==="multiple",$=o("isDateUnavailable"),K=o("maxSelectedDates"),U=I&&K!=null&&u.length>=K,Q=r.get("currentPlacement"),F=Q?ES(Q):void 0,j=NS({...o("positioning"),placement:Q}),G=aP(C),q={...CP,...o("translations")};function qe(A=c){const E=o("fixedWeeks")?6:void 0;return qE(A,C,E,O)}function $e(A={}){const{format:E}=A;return ZE(C,E,d).map((k,R)=>{const le=R+1,Ge=d.set({month:le}),Pe=bt(Ge,x,w);return{label:k,value:le,disabled:Pe}})}function ec(){const A=tP(d,x,w);return JE(A).map(k=>({label:k.toString(),value:k,disabled:!Xs(k,x?.year,w?.year)}))}function Ei(A){return Bf(A,$,C,x,w)}function Pi(A){const E=c??Kr(S,d.calendar);i({type:"FOCUS.SET",value:E.set({month:A})})}function X(A){const E=c??Kr(S,d.calendar);i({type:"FOCUS.SET",value:E.set({year:A})})}function Vt(A){const{value:E,disabled:k}=A,R=d.set({year:E}),Ge=!tr(c.year,{strict:!0}).includes(E),Pe=Xs(E,x?.year,w?.year),st=T&&nr(R,u),nn=T&&u[0]&&Lr(R,u[0]),rr=T&&u[1]&&Lr(R,u[1]),En=T&&g.length>0,or=En&&nr(R,g),rn=En&&g[0]&&Lr(R,g[0]),on=En&&g[1]&&Lr(R,g[1]),Ci={focused:d.year===A.value,selectable:!Ge&&Pe,outsideRange:Ge,selected:!!u.find(ki=>ki&&ki.year===E),valueText:E.toString(),inRange:st||or,firstInRange:!!nn,lastInRange:!!rr,inHoveredRange:!!or,firstInHoveredRange:!!rn,lastInHoveredRange:!!on,value:R,get disabled(){return k||!Ci.selectable}};return Ci}function tn(A){const{value:E,disabled:k}=A,R=d.set({month:E}),le=jf(C,S,d),Ge=T&&nr(R,u),Pe=T&&u[0]&&_r(R,u[0]),st=T&&u[1]&&_r(R,u[1]),nn=T&&g.length>0,rr=nn&&nr(R,g),En=nn&&g[0]&&_r(R,g[0]),or=nn&&g[1]&&_r(R,g[1]),rn={focused:d.month===A.value,selectable:!bt(R,x,w),selected:!!u.find(on=>on&&on.month===E&&on.year===d.year),valueText:le.format(R.toDate(S)),inRange:Ge||rr,firstInRange:!!Pe,lastInRange:!!st,inHoveredRange:!!rr,firstInHoveredRange:!!En,lastInHoveredRange:!!or,outsideRange:!1,value:R,get disabled(){return k||!rn.selectable}};return rn}function tc(A){const{value:E,disabled:k,visibleRange:R=s("visibleRange")}=A,le=Uf(C,S,d),Ge=Ua(s("visibleDuration")),Pe=o("outsideDaySelectable"),st=R.start.add(Ge).subtract({days:1}),nn=bt(E,R.start,st),rr=T&&nr(E,u),En=T&&u[0]&&Fe(E,u[0]),or=T&&u[1]&&Fe(E,u[1]),rn=T&&g.length>0,on=rn&&nr(E,g),Ci=rn&&g[0]&&Fe(E,g[0]),ki=rn&&g[1]&&Fe(E,g[1]),mh=u.some(yh=>yh!=null&&Fe(E,yh)),Oi={invalid:bt(E,x,w),disabled:k||!Pe&&nn||bt(E,x,w)||U&&!mh,selected:mh,unavailable:Bf(E,$,C,x,w)&&!k,outsideRange:nn,today:cE(E,S),weekend:mE(E,C),value:E,valueText:le.format(E.toDate(S)),get focused(){return d!=null&&Fe(E,d)&&(!Oi.outsideRange||Pe)},get selectable(){return!Oi.disabled&&!Oi.unavailable},inRange:rr||on,firstInRange:En,lastInRange:or,inHoveredRange:on,firstInHoveredRange:Ci,lastInHoveredRange:ki};return Oi}function sk(A){const{view:E="day",id:k}=A;return[E,k].filter(Boolean).join(" ")}return{focused:D,open:P,disabled:f,invalid:m,readOnly:p,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:K,isMaxSelected:U,view:r.get("view"),getRangePresetValue(A){return eh(A,C,S)},getWeekNumber(A){const E=A[0];return E?qf(E,C):0},getDaysInWeek(A,E=c){return Yf(A,E,C,O)},getOffset(A){const E=c.add(A),k=l.add(A),R=jf(C,S,d);return{visibleRange:{start:E,end:k},weeks:qe(E),visibleRangeText:{start:R.format(E.toDate(S)),end:R.format(k.toDate(S))}}},getMonthWeeks:qe,isUnavailable:Ei,weeks:qe(),weekDays:XE(c,O,S,C),visibleRangeText:s("visibleRangeText"),value:u,valueAsDate:u.filter(A=>A!=null).map(A=>A.toDate(S)),valueAsString:s("valueAsString"),focusedValue:d,focusedValueAsDate:d?.toDate(S),focusedValueAsString:o("format")(d,{locale:C,timeZone:S}),visibleRange:s("visibleRange"),selectToday(){const A=Ye(Kr(S,d.calendar),x,w);i({type:"VALUE.SET",value:[A]})},setValue(A){const E=A.map(k=>Ye(k,x,w));i({type:"VALUE.SET",value:E})},setTime(A,E=0){const k=Array.from(u);let R=k[E];R&&("hour"in R||(R=We(R)),R=R.set({hour:A.hour??("hour"in R?R.hour:0),minute:A.minute??("minute"in R?R.minute:0),second:A.second??("second"in R?R.second:0),millisecond:A.millisecond??("millisecond"in R?R.millisecond:0)}),k[E]=Ye(R,x,w),i({type:"VALUE.SET",value:k}))},clearValue(A={}){const{focus:E=!0}=A;i({type:"VALUE.CLEAR",focus:E})},setFocusedValue(A){i({type:"FOCUS.SET",value:A})},setOpen(A){o("inline")||n.matches("open")===A||i({type:A?"OPEN":"CLOSE"})},focusMonth:Pi,focusYear:X,getYears:ec,getMonths:$e,getYearsGrid(A={}){const{columns:E=1}=A,k=tr(c.year,{strict:!0}).map(R=>({label:R.toString(),value:R,disabled:!Xs(R,x?.year,w?.year)}));return Zu(k,E)},getDecade(){const A=tr(c.year,{strict:!0});return{start:A.at(0),end:A.at(-1)}},getMonthsGrid(A={}){const{columns:E=1,format:k}=A;return Zu($e({format:k}),E)},format(A,E={month:"long",year:"numeric"}){return new He(C,{...E,calendar:A.calendar.identifier}).format(A.toDate(S))},setView(A){i({type:"VIEW.SET",view:A})},goToNext(){i({type:"GOTO.NEXT",view:r.get("view")})},goToPrev(){i({type:"GOTO.PREV",view:r.get("view")})},getRootProps(){return t.element({...oe.root.attrs,dir:o("dir"),id:gP(a),"data-state":P?"open":"closed","data-disabled":z(f),"data-readonly":z(p),"data-empty":z(b)})},getLabelProps(A={}){const{index:E=0}=A;return t.label({...oe.label.attrs,id:hP(a,E),dir:o("dir"),htmlFor:oh(a,E),"data-state":P?"open":"closed","data-index":E,"data-disabled":z(f),"data-readonly":z(p)})},getControlProps(){return t.element({...oe.control.attrs,dir:o("dir"),id:rh(a),"data-disabled":z(f),"data-placeholder-shown":z(b)})},getRangeTextProps(){return t.element({...oe.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...oe.content.attrs,hidden:!P,dir:o("dir"),"data-state":P?"open":"closed","data-placement":Q,"data-side":F,"data-inline":z(o("inline")),id:ja(a),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":q.content})},getTableProps(A={}){const{view:E="day",columns:k=E==="day"?7:4}=A,R=sk(A);return t.element({...oe.table.attrs,role:"grid","data-columns":k,"aria-roledescription":SP(E),id:pP(a,R),"aria-readonly":Se(p),"aria-disabled":Se(f),"aria-multiselectable":Se(o("selectionMode")!=="single"),"data-view":E,dir:o("dir"),tabIndex:-1,onKeyDown(le){if(le.defaultPrevented)return;const Pe={Enter(){E==="day"&&Ei(d)||E==="month"&&!tn({value:d.month}).selectable||E==="year"&&!Vt({value:d.year}).selectable||i({type:"TABLE.ENTER",view:E,columns:k,focus:!0})},ArrowLeft(){i({type:"TABLE.ARROW_LEFT",view:E,columns:k,focus:!0})},ArrowRight(){i({type:"TABLE.ARROW_RIGHT",view:E,columns:k,focus:!0})},ArrowUp(){i({type:"TABLE.ARROW_UP",view:E,columns:k,focus:!0})},ArrowDown(){i({type:"TABLE.ARROW_DOWN",view:E,columns:k,focus:!0})},PageUp(st){i({type:"TABLE.PAGE_UP",larger:st.shiftKey,view:E,columns:k,focus:!0})},PageDown(st){i({type:"TABLE.PAGE_DOWN",larger:st.shiftKey,view:E,columns:k,focus:!0})},Home(){i({type:"TABLE.HOME",view:E,columns:k,focus:!0})},End(){i({type:"TABLE.END",view:E,columns:k,focus:!0})}}[Ux(le,{dir:o("dir")})];Pe&&(Pe(le),le.preventDefault(),le.stopPropagation())},onPointerLeave(){i({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){i({type:"TABLE.POINTER_DOWN",view:E})},onPointerUp(){i({type:"TABLE.POINTER_UP",view:E})}})},getTableHeadProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableHeaderProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHeader.attrs,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableBodyProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableBody.attrs,"data-view":E,"data-disabled":z(f)})},getTableRowProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableRow.attrs,"aria-disabled":Se(f),"data-disabled":z(f),"data-view":E})},getWeekNumberHeaderCellProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableCell.attrs,scope:"col","aria-label":q.weekColumnHeader,"data-view":E,"data-type":"week-number","data-disabled":z(f)})},getWeekNumberCellProps(A){const{weekIndex:E,week:k}=A,R=k[0]?qf(k[0],C):0;return t.element({...oe.tableCell.attrs,role:"rowheader","aria-label":q.weekNumberCell?.(R),"data-view":"day","data-week-index":E,"data-type":"week-number","data-disabled":z(f)})},getDayTableCellState:tc,getDayTableCellProps(A){const{value:E}=A,k=tc(A);return t.element({...oe.tableCell.attrs,role:"gridcell","aria-disabled":Se(!k.selectable),"aria-selected":k.selected||k.inRange,"aria-invalid":Se(k.invalid),"aria-current":k.today?"date":void 0,"data-value":E.toString()})},getDayTableCellTriggerProps(A){const{value:E}=A,k=tc(A);return t.element({...oe.tableCellTrigger.attrs,id:Wa(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":q.dayCell(k),"aria-disabled":Se(!k.selectable),"aria-invalid":Se(k.invalid),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E.toString(),"data-view":"day","data-today":z(k.today),"data-focus":z(k.focused),"data-unavailable":z(k.unavailable),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-outside-range":z(k.outsideRange),"data-weekend":z(k.weekend),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"day",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&aE(E,h)||i({type:"CELL.POINTER_MOVE",cell:"day",value:E,focus:le,outsideRange:k.outsideRange})}:void 0})},getMonthTableCellState:tn,getMonthTableCellProps(A){const{value:E,columns:k}=A,R=tn(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Se(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Se(!R.selectable),"data-value":E})},getMonthTableCellTriggerProps(A){const{value:E}=A,k=tn(A);return t.element({...oe.tableCellTrigger.attrs,id:Wa(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Se(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"month","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"month",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&_r(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"month",value:k.value,focus:le})}:void 0})},getYearTableCellState:Vt,getYearTableCellProps(A){const{value:E,columns:k}=A,R=Vt(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Se(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Se(!R.selectable),"data-value":E})},getYearTableCellTriggerProps(A){const{value:E}=A,k=Vt(A);return t.element({...oe.tableCellTrigger.attrs,id:Wa(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Se(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"year","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"year",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&Lr(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"year",value:k.value,focus:le})}:void 0})},getNextTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isNextVisibleRangeValid");return t.button({...oe.nextTrigger.attrs,dir:o("dir"),id:yP(a,E),type:"button","aria-label":q.nextTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.NEXT",view:E})}})},getPrevTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isPrevVisibleRangeValid");return t.button({...oe.prevTrigger.attrs,dir:o("dir"),id:mP(a,E),type:"button","aria-label":q.prevTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.PREV",view:E})}})},getClearTriggerProps(){return t.button({...oe.clearTrigger.attrs,id:nh(a),dir:o("dir"),type:"button","aria-label":q.clearTrigger,hidden:!u.length,onClick(A){A.defaultPrevented||i({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...oe.trigger.attrs,id:ih(a),dir:o("dir"),type:"button","data-placement":Q,"data-side":F,"aria-label":q.trigger(P),"aria-controls":ja(a),"aria-expanded":P,"data-state":P?"open":"closed","data-placeholder-shown":z(b),"aria-haspopup":"grid",disabled:f,onClick(A){A.defaultPrevented||y&&i({type:"TRIGGER.CLICK"})}})},getViewProps(A={}){const{view:E="day"}=A;return t.element({...oe.view.attrs,"data-view":E,hidden:r.get("view")!==E})},getViewTriggerProps(A={}){const{view:E="day"}=A;return t.button({...oe.viewTrigger.attrs,"data-view":E,dir:o("dir"),id:vP(a,E),type:"button",disabled:f,"aria-label":q.viewTrigger(E),onClick(k){k.defaultPrevented||y&&i({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(A={}){const{view:E="day"}=A;return t.element({...oe.viewControl.attrs,"data-view":E,dir:o("dir")})},getInputProps(A={}){const{index:E=0,fixOnBlur:k=!0}=A;return t.input({...oe.input.attrs,id:oh(a,E),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":E,"data-state":P?"open":"closed","data-placeholder-shown":z(b),readOnly:p,disabled:f,required:o("required"),"aria-invalid":Se(m),"data-invalid":z(m),placeholder:o("placeholder")||PP(C),defaultValue:s("valueAsString")[E],onBeforeInput(R){const{data:le}=Ed(R);Zf(le,G)||R.preventDefault()},onClick(R){R.defaultPrevented||o("openOnClick")&&y&&i({type:"OPEN",src:"input.click"})},onFocus(){i({type:"INPUT.FOCUS",index:E})},onBlur(R){const le=R.currentTarget.value.trim();i({type:"INPUT.BLUR",value:le,index:E,fixOnBlur:k})},onKeyDown(R){if(R.defaultPrevented||!y)return;const Ge={Enter(Pe){Bx(Pe)||Ei(d)||Pe.currentTarget.value.trim()!==""&&i({type:"INPUT.ENTER",value:Pe.currentTarget.value,index:E})}}[R.key];Ge&&(Ge(R),R.preventDefault())},onInput(R){const le=R.currentTarget.value;i({type:"INPUT.CHANGE",value:sP(le,G),index:E})}})},getMonthSelectProps(){return t.select({...oe.monthSelect.attrs,id:ah(a),"aria-label":q.monthSelect,disabled:f,dir:o("dir"),defaultValue:c.month,onChange(A){Pi(Number(A.currentTarget.value))}})},getYearSelectProps(){return t.select({...oe.yearSelect.attrs,id:ch(a),disabled:f,"aria-label":q.yearSelect,dir:o("dir"),defaultValue:c.year,onChange(A){X(Number(A.currentTarget.value))}})},getPositionerProps(){return t.element({id:sh(a),...oe.positioner.attrs,dir:o("dir"),style:j.floating})},getPresetTriggerProps(A){const E=Array.isArray(A.value)?A.value:eh(A.value,C,S),k=E.filter(R=>R!=null).map(R=>R.toDate(S).toDateString());return t.button({...oe.presetTrigger.attrs,"aria-label":q.presetTrigger(k),type:"button",onClick(R){R.defaultPrevented||i({type:"PRESET.CLICK",value:E})}})}}}var{and:Ee}=bx();function IP(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if(!en(e[r],t[r]))return!1;return!0}function wi(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var _P=hd({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1;let i;if(e.createCalendar){const f=new Intl.DateTimeFormat(t).resolvedOptions().calendar;f!=="gregory"&&f!=="iso8601"&&(i=e.createCalendar(f))}const s=g=>!i||g.calendar.identifier===i.identifier?g:ve(g,i),a=e.defaultValue?bi(e.defaultValue).map(g=>Ye(s(g),e.min,e.max)):void 0,c=e.value?bi(e.value).map(g=>Ye(s(g),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||Kr(n,i);l=Ye(s(l),e.min,e.max);const u="day",d="year",h=qa(e.view||u,u,d);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:r,defaultView:h,minView:u,maxView:d,outsideDaySelectable:!1,closeOnSelect:!0,format(g,{locale:f,timeZone:p}){return new He(f,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric",calendar:i?.identifier}).format(g.toDate(p))},parse(g,{locale:f,timeZone:p}){return uP(g,f,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")||e("inline")?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:en,hash:r=>r.toString(),sync:!0,onChange(r){const o=n(),i=o.get("view"),s=o.get("value"),a=wi(s,e);e("onFocusChange")?.({value:s,valueAsString:a,view:i,focusedValue:r})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:IP,hash:r=>r.map(o=>o?.toString()??"").join(","),onChange(r){const o=n(),i=wi(r,e);e("onValueChange")?.({value:r,valueAsString:i,view:o.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:en})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(r){e("onViewChange")?.({view:r})}})),startValue:t(()=>{const r=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:Vf(r,"start",{months:e("numOfMonths")},e("locale")),isEqual:en,hash:o=>o.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>Kf(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>RP({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!jE(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!WE(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>wi(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:r,computed:o}){e([()=>t("locale")],()=>{r(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{r(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{r(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{r(["syncInputValue"])}),e([()=>n.hash("value")],()=>{r(["syncInputElement"])}),e([()=>o("valueAsString").toString()],()=>{r(["announceValueText"])}),e([()=>n.get("view")],()=>{r(["focusActiveCell"])}),e([()=>t("open")],()=>{r(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:Ee("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:Ee("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>kP(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:({context:e,prop:t,event:n})=>{const r=t("maxSelectedDates");if(r==null)return!0;const o=e.get("value"),i=n.value??e.get("focusedValue");return o.some(a=>en(a,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const r=dh(n);return _S(r,()=>uh(n),{...t("positioning"),defer:!0,onComplete(i){e.set("currentPlacement",i.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",zE({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:r}){return r("inline")?void 0:eE(()=>vi(e),{type:"popover",defer:!0,layerStyleTargets:[()=>uh(e)],exclude:[...Ur(e),yi(e),xP(e)],onInteractOutside(i){n.set("restoreFocus",!i.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(i){i.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setNextView({context:e,prop:t}){const n=TP(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=AP(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const r=e.get("value"),o=t("locale"),i=t("timeZone");let s;if(t("selectionMode")==="range"){const[a,c]=r;a&&c?s=mi(a,c,o,i):a?s=mi(a,null,o,i):c?s=mi(c,null,o,i):s=""}else s=r.map(a=>mi(a,null,o,i)).filter(Boolean).join(",");n.get("announcer")?.announce(s,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){Jx({target:vi(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Cd({doc:e.getDoc(),target:vi(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&fe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){Te(()=>{Ur(e).forEach((r,o)=>{qo(r,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;fe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;fe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const r=t.value.map(o=>Ye(o,n("min"),n("max")));e.set("value",r)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,r=Array.from(t.get("value")),o=t.get("activeIndex"),i=r[o],s=xi(e,n.value??t.get("focusedValue"));r[o]=Ga(i,s),t.set("value",Ha(r))},resetSelection(e){const{context:t,event:n}=e,r=t.get("value")[0],o=xi(e,n.value??t.get("focusedValue"));t.set("value",[Ga(r,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,r=xi(e,n.value??t.get("focusedValue")),o=t.get("value"),i=o.findIndex(s=>en(s,r));if(i===-1){const s=[...o,r];t.set("value",bi(s))}else{const s=Array.from(o);s.splice(i,1),t.set("value",bi(s))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),r=e.get("activeIndex"),o=n[r],i=e.get("focusedValue").copy();n[r]=Ga(o,i),e.set("value",Ha(n));const s=t("valueAsString");e.set("inputValue",s[r])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});fe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});fe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});fe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});fe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:r}=e,o=Gf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Si(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:r}=e,o=Xf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Si(e,o)},focusSectionStart(e){const{context:t}=e;fe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;fe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=oP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Si(e,i)},focusPreviousSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=iP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Si(e,i)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});fe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});fe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});fe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});fe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,r=t.get("focusedValue").calendar;fe(e,Kr(n("timeZone"),r))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({months:n.columns});fe(e,r)},focusNextMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({months:n.columns});fe(e,r)},focusPreviousYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({years:n.columns});fe(e,r)},focusNextYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({years:n.columns});fe(e,r)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMinimumMonthInYear?.(n)??1;fe(e,n.set({month:r}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMonthsInYear(n);fe(e,n.set({month:r}))},focusFirstYear(e){const{context:t}=e,n=tr(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[0]});fe(e,r)},focusLastYear(e){const{context:t}=e,n=tr(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[n.length-1]});fe(e,r)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&Te(()=>{const r=t.get("view");lh(e,r)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&Te(()=>{const r=t.get("view");lh(e,r)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!t.type.startsWith("TABLE.ARROW")||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},focusTriggerElement({scope:e}){Te(()=>{yi(e)?.focus({preventScroll:!0})})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&Te(()=>{const[n]=Ur(e);(n??yi(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){Te(()=>{const t=Ur(e);if(t.length===0){yi(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(i=>i.value!==""),r=Math.max(n,0),o=t[r];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=wP(e);qo(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=bP(e);qo(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const r=Ur(e),o=n.index??t.get("activeIndex");qo(r[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!fh(o)||fe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!fh(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Ye(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const s=wi(i,n);e.set("inputValue",s[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const r=e.get("focusedValue");if(!bt(r,e.get("startValue"),t("endValue")))return;const i=Vf(r,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),xi=(e,t)=>{const{context:n,prop:r}=e,o=n.get("view");let i=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return DP(s=>{OP(s,r("minView"))&&(i=i.set({[s]:s==="day"?1:0}))}),i},Ga=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let r=t;return"hour"in t||(n?r=$f(We(t),e.timeZone):r=We(t)),r.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function fe(e,t){const{context:n,prop:r,computed:o}=e;if(!t)return;const i=xi(e,t);if(en(n.get("focusedValue"),i))return;const a=zr(o("visibleDuration"),r("locale"),r("min"),r("max"))({focusedDate:i,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Si(e,t){const{context:n}=e;n.set("startValue",t.startDate);const r=n.get("focusedValue");en(r,t.focusedDate)||n.set("focusedValue",t.focusedDate)}var hh=th.extendWith("view","valueText"),[gh,ae]=Gt({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),LP=e=>{const t=ae(),n=ee(()=>t().getClearTriggerProps(),e);return v(re.button,n)},NP=e=>{const t=ae(),n=Id(),r=ee(()=>t().getContentProps(),()=>n().presenceProps,e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,N(r,{ref(o){var i=b1(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},FP=e=>e.children(ae()),VP=e=>{const t=ae(),n=ee(()=>t().getControlProps(),e);return v(re.div,n)},BP=e=>{const[t,n]=pt()(e,["index","fixOnBlur"]),r=ae(),o=ee(()=>r().getInputProps(t),n);return v(re.input,o)},KP=e=>{const t=ae(),n=ee(()=>t().getLabelProps(),e);return v(re.label,n)},zP=e=>{const t=ae(),n=ee(()=>t().getMonthSelectProps(),e);return v(re.select,N(n,{get children(){return v(kc,{get each(){return t().getMonths()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},[UP,Sn]=Gt({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),jP=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getNextTriggerProps(n),e);return v(re.button,r)},WP=e=>{const t=ae(),n=Id(),r=ee(()=>t().getPositionerProps(),e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,r)}})},HP=e=>{const[t,n]=pt()(e,["value"]),r=ae(),o=ee(()=>r().getPresetTriggerProps(t),n);return v(re.button,o)},YP=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getPrevTriggerProps(n),e);return v(re.button,r)},qP=e=>{const t=ae(),n=ee(()=>t().getRangeTextProps(),e),r=_(()=>{const{start:o,end:i}=t().visibleRangeText;return V0([o,i]).filter(Boolean).join(" - ")});return v(re.div,N(n,{get children(){return r()}}))},GP=e=>{const t=ae(),n=()=>t().value.length>0;return v(ie,{get when(){return typeof e.children=="function"},get fallback(){return v(re.span,N(()=>hh.build().valueText.attrs,e,{get children(){return Ut(()=>!!n())()?t().valueAsString.join(e.separator??", "):e.placeholder}}))},get children(){return v(ie,{get when(){return n()},get fallback(){return e.placeholder},get children(){return v(cn,{get each(){return t().value},children:(r,o)=>Ut(()=>e.children({value:r,index:o(),valueAsString:t().valueAsString[o()],remove:()=>{t().setValue(t().value.filter((i,s)=>s!==o()))}}))})}})}})},XP=e=>{const t=Be(),n=FE(),r=tE(),o=_(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...id(e)})),i=Od(_P,o);return _(()=>MP(i,f1))},ZP=e=>{const[t,n]=Rd(e),[r,o]=pt()(n,["closeOnSelect","createCalendar","defaultFocusedValue","defaultOpen","defaultValue","defaultView","disabled","fixedWeeks","focusedValue","format","id","ids","inline","invalid","isDateUnavailable","locale","max","maxSelectedDates","maxView","min","minView","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","onVisibleRangeChange","open","openOnClick","outsideDaySelectable","parse","placeholder","positioning","readOnly","required","selectionMode","showWeekNumbers","startOfWeek","timeZone","translations","value","view"]),i=XP(r),s=$d(ee(t,()=>({present:i().open}))),a=ee(()=>i().getRootProps(),o);return v(gh,{value:i,get children(){return v(Md,{value:s,get children(){return v(re.div,a)}})}})},JP=e=>{const[t,n]=Rd(e),[{value:r},o]=pt()(n,["value"]),i=$d(ee(t,()=>({present:r().open}))),s=ee(()=>r().getRootProps(),o);return v(gh,{value:r,get children(){return v(Md,{value:i,get children(){return v(re.div,s)}})}})},[QP,jr]=Gt({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),eC=e=>{const[t,n]=pt()(e,["columns"]),r=ae(),o=Sn(),i=Be(),s=ee(()=>({columns:t.columns,id:i}),o),a=ee(()=>r().getTableProps(s),n);return v(QP,{value:s,get children(){return v(re.table,a)}})},tC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableBodyProps(n),e);return v(re.tbody,r)},[nC,rC]=Gt({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),oC=e=>{const[t,n]=pt()(e,["disabled","value","visibleRange","columns"]),r=ae(),o=Sn(),i=_(()=>{const c={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return c(t)}),s=ee(i,n);return v(nC,{value:t,get children(){return v(re.td,s)}})},iC=e=>{const t=ae(),n=rC(),r=Sn(),o=_(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=ee(o,e);return v(re.div,i)},sC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableHeadProps(n),e);return v(re.thead,r)},aC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableHeaderProps(n),e);return v(re.th,r)},cC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableRowProps(n),e);return v(re.tr,r)},lC=e=>{const t=ae(),n=ee(()=>t().getTriggerProps(),e);return v(re.button,n)},uC=e=>{const[t,n]=pt()(e,["view"]),r=ae(),o=ee(()=>hh.build().view.attrs,n);return v(UP,{value:t,get children(){return v(re.div,N(o,{get hidden(){return r().view!==t.view}}))}})},dC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewControlProps(n),e);return v(re.div,r)},fC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewTriggerProps(n),e);return v(re.button,r)},hC=pt(),gC=e=>{const[t,n]=hC(e,["weekIndex","week"]),r=ae(),o=ee(()=>r().getWeekNumberCellProps(t),n);return v(re.td,o)},pC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getWeekNumberHeaderCellProps(n),e);return v(re.th,r)},mC=e=>{const t=ae(),n=ee(()=>t().getYearSelectProps(),e);return v(re.select,N(n,{get children(){return v(kc,{get each(){return t().getYears()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},Ft={};BE(Ft,{ClearTrigger:()=>LP,Content:()=>NP,Context:()=>FP,Control:()=>VP,Input:()=>BP,Label:()=>KP,MonthSelect:()=>zP,NextTrigger:()=>jP,Positioner:()=>WP,PresetTrigger:()=>HP,PrevTrigger:()=>YP,RangeText:()=>qP,Root:()=>ZP,RootProvider:()=>JP,Table:()=>eC,TableBody:()=>tC,TableCell:()=>oC,TableCellTrigger:()=>iC,TableHead:()=>sC,TableHeader:()=>aC,TableRow:()=>cC,Trigger:()=>lC,ValueText:()=>GP,View:()=>uC,ViewControl:()=>dC,ViewTrigger:()=>fC,WeekNumberCell:()=>gC,WeekNumberHeaderCell:()=>pC,YearSelect:()=>mC}),Ft.Label,Ft.TableHead,Ft.TableBody,Ft.ClearTrigger,Ft.YearSelect,Ft.MonthSelect,Ft.Context,Ft.RootProvider;var yC=W("<div>Unknown bot message type");const vC=e=>v(Wb,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(Gs,{get text(){return e.text}}):e.type==="buttons"?v(qb,N(()=>e.buttons)):e.type==="list"?v(O0,N(()=>e.list)):e.type==="media"?v(Xu,N(()=>e.media)):e.type==="link"?v(Qb,N(()=>e.link)):e.type==="cards"?v(Zb,N(()=>e.cards)):e.type==="date"?v(Gs,{get text(){return e.text}}):yC()}});var bC=W('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const wC=e=>(()=>{var t=bC(),n=t.firstChild;return B(n,()=>e.text?.trim()),t})();var xC=W('<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 SC=({children:e,createdAt:t})=>(()=>{var n=xC(),r=n.firstChild;return B(r,e),B(n,v(Iu,{createdAt:t,anchor:"end"}),null),n})();var EC=W("<div>Unknown user message type");const PC=e=>v(SC,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(Gs,{get text(){return e.text}}):e.type==="media"?v(Xu,N(()=>e.media)):EC()}});var CC=W("<div>Unknown message origin");const kC=e=>e.origin==="bot"?v(vC,e):e.origin==="user"?v(PC,e):e.origin==="service"?v(wC,e):CC();function Xa(e){return Ke({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var OC=W('<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">'),TC=W("<div>");const Za=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o,maybeAutostart:i}=qt(),{onOpen:s}=Nc(),a=(c=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},c)};return pe("reset",()=>{r()}),an(()=>{o(),a(200),i()}),n(a),s(()=>a(200)),(()=>{var c=OC(),l=e;return typeof l=="function"?Ki(l,c):e=c,B(c,v(cn,{get each(){return t()},get fallback(){return(()=>{var u=TC();return B(u,()=>kn("emptyMessages")),u})()},children:u=>v(kC,u)})),c})()};var AC=W("<textarea>");const $C=e=>{const[,t]=J(e,["class"]);return(()=>{var n=AC();return un(n,N({get class(){return zt("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 DC=W('<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 RC=e=>(()=>{var t=DC();return un(t,e,!0,!0),t})();var MC=W('<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 IC=()=>(()=>{var e=MC(),t=e.firstChild;return B(e,v(RC,{height:15}),t),e})();var _C=W('<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 Ja=()=>{const{pushMessage:e}=qt(),[t,n]=L(""),r=()=>{t().trim()&&(e(t()),n(""))},o=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),r())};return pe("setInput",i=>{i&&n(i)}),(()=>{var i=_C(),s=i.firstChild,a=s.firstChild,c=a.nextSibling;return B(a,v($C,{id:"chat-input",get placeholder(){return kn("inputPlaceholder")},get value(){return t()},onInput:l=>n(l.currentTarget.value),onKeyDown:o,class:"focus-visible:ring-primary min-h-[44px] max-h-[120px] py-3 leading-tight resize-none"}),null),B(a,v(Je,{variant:"outline",class:"h-[44px] w-[44px] p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",onClick:r,get children(){return v(Op,{size:20})}}),null),B(c,v(IC,{})),i})()};var LC=W('<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">'),NC=W("<span class=sr-only>Close"),FC=W('<div><div class="flex justify-center gap-3 items-center">'),VC=W("<span class=sr-only>Open"),BC=W("<span class=font-bold>"),KC=W("<span>"),zC=W('<div class="animate-pulse flex p-1">');const UC=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Nc(),{chatWidget:s}=ge(),[a,c]=L(!0),[l,u]=L("");setTimeout(()=>c(!1),2e3),s()?.openDelay&&!s()?.hideWidget&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const d=()=>(s()?.style.margin??5)*4,h=()=>s()?.style.position==="left"?{left:`${d()}px`}:{right:`${d()}px`};return pe("open",()=>{o()}),pe("close",()=>{i()}),pe("toggle",()=>{r()}),pe("onAnswer",g=>{g.text&&u(g.text),o()}),(()=>{var g=FC(),f=g.firstChild;return B(g,v(ie,{get when(){return Ut(()=>!!n())()&&!s()?.hideWidget},get children(){var p=LC();return B(p,e),p}}),f),B(f,v(ie,{get when(){return s()?.whatsappBtn},get children(){return v(Je,{onclick:()=>window.open(s()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return v(Bb,{class:"size-9",color:"white"})}})}}),null),B(f,v(ie,{get when(){return!s()?.hideWidget},get children(){return v(ie,{get when(){return n()},get fallback(){return v(Je,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,VC(),v(ie,{get when(){return s()?.balloonMessage},get children(){var p=KC();return B(p,v(ie,{get when(){return l()},get fallback(){return v(ie,{get when(){return!a()},get fallback(){return(()=>{var m=zC();return B(m,v(Xa,{class:"size-2 animate-bounce"}),null),B(m,v(Xa,{class:"size-2 animate-bounce delay-150"}),null),B(m,v(Xa,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return Ut(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=BC();return B(m,(()=>{var y=Ut(()=>l().length>20);return()=>y()?l().substring(0,17)+"...":l()})()),m}})),ye(()=>ln(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return v(Je,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,NC()]}})}})}}),null),ye(p=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(s()?.style.position==="left"?" items-start":" items-end"),y=h();return m!==p.e&&ln(g,p.e=m),p.t=ro(g,y,p.t),p},{e:void 0,t:void 0}),g})()};var jC=W('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const WC=({children:e})=>{const{chatWidget:t}=ge(),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=jC();return ro(r,n),B(r,e),r})()};var HC=W("<div id=smarttalks-widget>");const YC=({children:e})=>{const{chatWidget:t}=ge(),[n,r]=L(!1),[o,i]=L(!1),[s,a]=L("100%"),c=()=>{typeof window<"u"&&i(window.innerWidth<768)},l=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};V(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),an(()=>{c(),window.addEventListener("resize",c),window.visualViewport&&(window.visualViewport.addEventListener("resize",l),window.visualViewport.addEventListener("scroll",l))}),Y(()=>{window.removeEventListener("resize",c),window.visualViewport&&(window.visualViewport.removeEventListener("resize",l),window.visualViewport.removeEventListener("scroll",l)),document.body.style.overflow="",document.body.style.position=""});const u=()=>(t()?.style.margin??5)*4,d=()=>{if(o())return{height:s(),top:"0px"};const h={};return t()?.fullscreen?(h.height="100%",h["max-height"]="100%",h.width="100%",h["max-width"]="100%",h.bottom=0,h.left=0):t()?.style.position&&(h[t()?.style.position||"right"]=`${u()}px`),h};return pe("open",()=>{r(!0),he("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),pe("close",()=>{r(!1),he("onClose")}),pe("toggle",()=>{r(!n()),he("onToggle")}),pe("onAnswer",()=>{r(!0),he("onOpen")}),setTimeout(()=>{r(!0),he("onOpen")},(t()?.openDelay||0)*1e3),v(ie,{get when(){return n()},get children(){var h=HC();return B(h,e),ye(g=>{var f=`
|
|
181
|
+
*/function Sv(e,t){return t?vm([e.clientX,e.clientY],t):!1}function Ev(e){const t=zn(),n=zl(),r=yu(),o=ut({placement:"bottom-start"},e),[i,s]=ee(o,["open","defaultOpen","onOpenChange"]);let a=0,c=null,l="right";const[u,d]=L(),[f,g]=L(),[h,p]=L(),[m,v]=L(),[w,x]=L(!0),[b,C]=L(s.placement),[E,T]=L([]),[D,S]=L([]),{DomCollectionProvider:P}=yy({items:D,onItemsChange:S}),R=Pl({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:J=>i.onOpenChange?.(J)}),O=Fm(()=>t.forceMount()||R.isOpen()),V=iy({selectionMode:"none",dataSource:D}),K=J=>{x(J),R.open()},Y=(J=!1)=>{R.close(),J&&r&&r.close(!0)},F=J=>{x(J),R.toggle()},W=()=>{const J=m();J&&(Ae(J),V.selectionManager().setFocused(!0),V.selectionManager().setFocusedKey(void 0))},X=J=>{T(an=>[...an,J]);const zt=r?.registerNestedMenu(J);return()=>{T(an=>rs(an,J)),zt?.()}},G=J=>l===c?.side&&Sv(J,c?.area),Xe=J=>{G(J)&&J.preventDefault()},Re=J=>{G(J)||W()},fc=J=>{G(J)&&J.preventDefault()};_m({isDisabled:()=>!(r==null&&R.isOpen()&&t.isModal()),targets:()=>[m(),...E()].filter(Boolean)}),z(()=>{const J=m();if(!J||!r)return;const zt=r.registerNestedMenu(J);H(()=>{zt()})});const Ii={dataset:_(()=>({"data-expanded":R.isOpen()?"":void 0,"data-closed":R.isOpen()?void 0:""})),isOpen:R.isOpen,contentPresence:O,nestedMenus:E,currentPlacement:b,pointerGraceTimeoutId:()=>a,autoFocus:w,listState:()=>V,parentMenuContext:()=>r,triggerRef:h,contentRef:m,triggerId:u,contentId:f,setTriggerRef:p,setContentRef:v,open:K,close:Y,toggle:F,focusContent:W,onItemEnter:Xe,onItemLeave:Re,onTriggerLeave:fc,setPointerDir:J=>l=J,setPointerGraceTimeoutId:J=>a=J,setPointerGraceIntent:J=>c=J,registerNestedMenu:X,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:xo(d),registerContentId:xo(g)};return y(P,{get children(){return y(mu.Provider,{value:Ii,get children(){return y(xv,B({anchorRef:h,contentRef:m,onCurrentPlacementChange:C},s))}})}})}const Pv=Se();function kv(e){let t;const n=zn(),r=Bn(),o=ut({id:n.generateId(`item-${Ke()}`)},e),[i,s]=ee(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,c]=L(),[l,u]=L(),[d,f]=L(),g=()=>r.listState().selectionManager(),h=()=>s.id,p=()=>g().focusedKey()===h(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};vy({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const v=ry({key:h,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),w=S=>{Ie(S,i.onPointerMove),S.pointerType==="mouse"&&(i.disabled?r.onItemLeave(S):(r.onItemEnter(S),S.defaultPrevented||(Ae(S.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},x=S=>{Ie(S,i.onPointerLeave),S.pointerType==="mouse"&&r.onItemLeave(S)},b=S=>{Ie(S,i.onPointerUp),!i.disabled&&S.button===0&&m()},C=S=>{if(Ie(S,i.onKeyDown),!S.repeat&&!i.disabled)switch(S.key){case"Enter":case" ":m();break}},E=_(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),T=_(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),D={isChecked:()=>i.checked,dataset:T,setLabelRef:f,generateId:hl(()=>s.id),registerLabel:xo(c),registerDescription:xo(u)};return y(Pv.Provider,{value:D,get children(){return y(So,B({as:"div",ref(S){var P=pn(R=>t=R,i.ref);typeof P=="function"&&P(S)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return E()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return v.dataKey()},get onPointerDown(){return je([i.onPointerDown,v.onPointerDown])},get onPointerUp(){return je([b,v.onPointerUp])},get onClick(){return je([i.onClick,v.onClick])},get onKeyDown(){return je([C,v.onKeyDown])},get onMouseDown(){return je([i.onMouseDown,v.onMouseDown])},get onFocus(){return je([i.onFocus,v.onFocus])},onPointerMove:w,onPointerLeave:x},T,s))}})}const Cv=Se();function wu(){return Te(Cv)}function Ov(e){let t;const n=zn(),r=Bn(),o=wu(),i=ut({id:n.generateId(`content-${Ke()}`)},e),[s,a]=ee(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const l=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=ay({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Mm({trapFocus:()=>l()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=m=>{if(lt(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=>{Ie(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(Ie(m,s.onPointerMove),m.pointerType!=="mouse")return;const v=m.target,w=c!==m.clientX;lt(m.currentTarget,v)&&w&&(r.setPointerDir(m.clientX>c?"right":"left"),c=m.clientX)};return z(()=>H(r.registerContentId(s.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y($y,{get children(){return y(Ty,B({ref(m){var v=pn(w=>{r.setContentRef(w),r.contentPresence.setRef(w),t=w},s.ref);typeof v=="function"&&v(m)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return Yt(()=>!!l())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:f,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return je([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return je([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return je([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return je([s.onFocusOut,u.onFocusOut])},onPointerEnter:h,onPointerMove:p},()=>r.dataset(),a))}})}})}function Tv(e){let t;const n=zn(),r=Bn(),[o,i]=ee(e,["ref"]);return Gl({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Ov,B({ref(s){var a=pn(c=>{t=c},o.ref);typeof a=="function"&&a(s)}},i))}function Av(e){return y(kv,B({role:"menuitem",closeOnSelect:!0},e))}function $v(e){const t=Bn();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(Hc,e)}})}function Dv(e){const t=`menu-${Ke()}`,n=ut({id:t,modal:!0},e),[r,o]=ee(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=Pl({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:hl(()=>r.id),value:()=>r.value};return y(vu.Provider,{value:s,get children(){return y(Ev,B({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Rv(e){const t=zn(),n=Bn(),r=wu(),o=ut({id:t.generateId("trigger")},e),[i,s]=ee(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,z(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),z(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),z(()=>{n.isOpen()&&r.setValue(a)}),H(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const c=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},l=h=>{Ie(h,i.onPointerDown),h.currentTarget.dataset.pointerType=h.pointerType,!i.disabled&&h.pointerType!=="touch"&&h.button===0&&c()},u=h=>{Ie(h,i.onClick),i.disabled||h.currentTarget.dataset.pointerType==="touch"&&c()},d=h=>{if(Ie(h,i.onKeyDown),!i.disabled)switch(h.key){case"Enter":case" ":case"ArrowDown":h.stopPropagation(),h.preventDefault(),wm(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=>{Ie(h,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=h=>{Ie(h,i.onFocus),r!==void 0&&r.setValue(a)};return z(()=>H(n.registerTriggerId(i.id))),y(uy,B({ref(h){var p=pn(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 Yt(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:l,onMouseOver:f,onClick:u,onKeyDown:d,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Mv(e){const t=zn(),n=Bn(),[r,o]=ee(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(Tv,B({onCloseAutoFocus:c=>{r.onCloseAutoFocus?.(c),i||Ae(n.triggerRef()),i=!1,c.preventDefault()},onInteractOutside:c=>{r.onInteractOutside?.(c),(!t.isModal()||c.detail.isContextMenu)&&(i=!0)}},o))}function Iv(e){const t=`dropdownmenu-${Ke()}`,n=ut({id:t},e);return y(Dv,n)}function _v(e){return Ee({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 Lv(e){return Ee({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 Nv(e){return Ee({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)}function Fv(e){return Ee({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file",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"/>'},e)}const Vv=e=>y(Iv,B({gutter:4},e)),Bv=Rv,zv=e=>{const[,t]=ee(e,["class"]);return y($v,{get mount(){return dr()},get children(){return y(Mv,B({get class(){return jt("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))}})},Kv=e=>{const[,t]=ee(e,["class"]);return y(Av,B({get class(){return jt("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 Uv(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 jv(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function Wv(e,t,n){const r=`${Et}/v1/messages`,o=br(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:es()})};await fetch(r,s)}async function Hv(e){const t=`${Et}/v1/messages`,n=br(),r={"Content-Type":"application/json"};n&&(r["x-session-id"]=n);const o={credentials:"include",method:"POST",headers:r,body:JSON.stringify({channelId:e,type:"open",metadata:es()})},i=await fetch(t,o);if(!i.ok)throw new Error(`open event rejected: ${i.status}`)}async function Yv(e,t,n){if(!e||!t||!n)return;const r=`${Et}/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 gt=Object.create(null);gt.open="0",gt.close="1",gt.ping="2",gt.pong="3",gt.message="4",gt.upgrade="5",gt.noop="6";const Do=Object.create(null);Object.keys(gt).forEach(e=>{Do[gt[e]]=e});const $s={type:"error",data:"parser error"},bu=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",xu=typeof ArrayBuffer=="function",Su=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ds=({type:e,data:t},n,r)=>bu&&t instanceof Blob?n?r(t):Eu(t,r):xu&&(t instanceof ArrayBuffer||Su(t))?n?r(t):Eu(new Blob([t]),r):r(gt[e]+(t||"")),Eu=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Pu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Rs;function qv(e,t){if(bu&&e.data instanceof Blob)return e.data.arrayBuffer().then(Pu).then(t);if(xu&&(e.data instanceof ArrayBuffer||Su(e.data)))return t(Pu(e.data));Ds(e,!1,n=>{Rs||(Rs=new TextEncoder),t(Rs.encode(n))})}const ku="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ar=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ku.length;e++)Ar[ku.charCodeAt(e)]=e;const Gv=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)i=Ar[e.charCodeAt(r)],s=Ar[e.charCodeAt(r+1)],a=Ar[e.charCodeAt(r+2)],c=Ar[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|c&63;return l},Xv=typeof ArrayBuffer=="function",Ms=(e,t)=>{if(typeof e!="string")return{type:"message",data:Cu(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Zv(e.substring(1),t)}:Do[n]?e.length>1?{type:Do[n],data:e.substring(1)}:{type:Do[n]}:$s},Zv=(e,t)=>{if(Xv){const n=Gv(e);return Cu(n,t)}else return{base64:!0,data:e}},Cu=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Ou="",Jv=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Ds(i,!1,a=>{r[s]=a,++o===n&&t(r.join(Ou))})})},Qv=(e,t)=>{const n=e.split(Ou),r=[];for(let o=0;o<n.length;o++){const i=Ms(n[o],t);if(r.push(i),i.type==="error")break}return r};function ew(){return new TransformStream({transform(e,t){qv(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 Is;function Ro(e){return e.reduce((t,n)=>t+n.length,0)}function Mo(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 tw(e,t){Is||(Is=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(Ro(n)<1)break;const c=Mo(n,1);i=(c[0]&128)===128,o=c[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Ro(n)<2)break;const c=Mo(n,2);o=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(Ro(n)<8)break;const c=Mo(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue($s);break}o=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(Ro(n)<o)break;const c=Mo(n,o);a.enqueue(Ms(i?c:Is.decode(c),t)),r=0}if(o===0||o>e){a.enqueue($s);break}}}})}const Tu=4;function ve(e){if(e)return nw(e)}function nw(e){for(var t in ve.prototype)e[t]=ve.prototype[t];return e}ve.prototype.on=ve.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},ve.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},ve.prototype.off=ve.prototype.removeListener=ve.prototype.removeAllListeners=ve.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},ve.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},ve.prototype.emitReserved=ve.prototype.emit,ve.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},ve.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Io=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),He=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),rw="arraybuffer";function JC(){}function Au(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const ow=He.setTimeout,iw=He.clearTimeout;function _o(e,t){t.useNativeTimers?(e.setTimeoutFn=ow.bind(He),e.clearTimeoutFn=iw.bind(He)):(e.setTimeoutFn=He.setTimeout.bind(He),e.clearTimeoutFn=He.clearTimeout.bind(He))}const sw=1.33;function aw(e){return typeof e=="string"?cw(e):Math.ceil((e.byteLength||e.size)*sw)}function cw(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 $u(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function lw(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function uw(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 dw extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class _s extends ve{constructor(t){super(),this.writable=!1,_o(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 dw(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=Ms(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=lw(t);return n.length?"?"+n:""}}class fw extends _s{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)};Qv(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,Jv(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]=$u()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Du=!1;try{Du=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hw=Du;function gw(){}class pw extends fw{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 pt extends ve{constructor(t,n,r){super(),this.createRequest=t,_o(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=Au(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=pt.requestsCount++,pt.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=gw,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete pt.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(pt.requestsCount=0,pt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ru);else if(typeof addEventListener=="function"){const e="onpagehide"in He?"pagehide":"unload";addEventListener(e,Ru,!1)}}function Ru(){for(let e in pt.requests)pt.requests.hasOwnProperty(e)&&pt.requests[e].abort()}const mw=(function(){const e=Mu({xdomain:!1});return e&&e.responseType!==null})();class yw extends pw{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=mw&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new pt(Mu,this.uri(),t)}}function Mu(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hw))return new XMLHttpRequest}catch{}if(!t)try{return new He[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Iu=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vw extends _s{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Iu?{}:Au(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;Ds(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Io(()=>{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]=$u()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ls=He.WebSocket||He.MozWebSocket;class ww extends vw{createSocket(t,n,r){return Iu?new Ls(t,n,r):n?new Ls(t,n):new Ls(t)}doWrite(t,n){this.ws.send(n)}}class bw extends _s{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=tw(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=ew();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&Io(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const xw={websocket:ww,webtransport:bw,polling:yw},Sw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ew=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ns(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=Sw.exec(e||""),i={},s=14;for(;s--;)i[Ew[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=Pw(i,i.path),i.queryKey=kw(i,i.query),i}function Pw(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 kw(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Fs=typeof addEventListener=="function"&&typeof removeEventListener=="function",Lo=[];Fs&&addEventListener("offline",()=>{Lo.forEach(e=>e())},!1);class Jt extends ve{constructor(t,n){if(super(),this.binaryType=rw,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=Ns(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=Ns(n.host).host);_o(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=uw(this.opts.query)),Fs&&(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"})},Lo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Tu,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&&Jt.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",Jt.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+=aw(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,Io(()=>{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(Jt.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(),Fs&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Lo.indexOf(this._offlineEventListener);r!==-1&&Lo.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Jt.protocol=Tu;class Cw extends Jt{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;Jt.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Jt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,i(),this.emitReserved("upgradeError",f)};function a(){s("transport closed")}function c(){s("socket closed")}function l(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Ow=class extends Cw{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=>xw[o]).filter(o=>!!o)),super(t,r)}};function Tw(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=Ns(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 Aw=typeof ArrayBuffer=="function",$w=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,_u=Object.prototype.toString,Dw=typeof Blob=="function"||typeof Blob<"u"&&_u.call(Blob)==="[object BlobConstructor]",Rw=typeof File=="function"||typeof File<"u"&&_u.call(File)==="[object FileConstructor]";function Vs(e){return Aw&&(e instanceof ArrayBuffer||$w(e))||Dw&&e instanceof Blob||Rw&&e instanceof File}function No(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(No(e[n]))return!0;return!1}if(Vs(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return No(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&No(e[n]))return!0;return!1}function Mw(e){const t=[],n=e.data,r=e;return r.data=Bs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Bs(e,t){if(!e)return e;if(Vs(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]=Bs(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]=Bs(e[r],t));return n}return e}function Iw(e,t){return e.data=zs(e.data,t),delete e.attachments,e}function zs(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]=zs(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=zs(e[n],t));return e}const _w=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Q;(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"})(Q||(Q={}));class Lw{constructor(t){this.replacer=t}encode(t){return(t.type===Q.EVENT||t.type===Q.ACK)&&No(t)?this.encodeAsBinary({type:t.type===Q.EVENT?Q.BINARY_EVENT:Q.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Q.BINARY_EVENT||t.type===Q.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=Mw(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class Ks extends ve{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Q.BINARY_EVENT;r||n.type===Q.BINARY_ACK?(n.type=r?Q.EVENT:Q.ACK,this.reconstructor=new Nw(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Vs(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(Q[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Q.BINARY_EVENT||r.type===Q.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(s);if(!Fw(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Ks.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Q.CONNECT:return Lu(n);case Q.DISCONNECT:return n===void 0;case Q.CONNECT_ERROR:return typeof n=="string"||Lu(n);case Q.EVENT:case Q.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&_w.indexOf(n[0])===-1);case Q.ACK:case Q.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Nw{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=Iw(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Fw=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Lu(e){return Object.prototype.toString.call(e)==="[object Object]"}const Vw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ks,Encoder:Lw,get PacketType(){return Q}},Symbol.toStringTag,{value:"Module"}));function rt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Bw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Nu extends ve{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=[rt(t,"open",this.onopen.bind(this)),rt(t,"packet",this.onpacket.bind(this)),rt(t,"error",this.onerror.bind(this)),rt(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(Bw.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:Q.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,c=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Q.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 Q.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 Q.EVENT:case Q.BINARY_EVENT:this.onevent(t);break;case Q.ACK:case Q.BINARY_ACK:this.onack(t);break;case Q.DISCONNECT:this.ondisconnect();break;case Q.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:Q.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:Q.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 Kn(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}Kn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},Kn.prototype.reset=function(){this.attempts=0},Kn.prototype.setMin=function(e){this.ms=e},Kn.prototype.setMax=function(e){this.max=e},Kn.prototype.setJitter=function(e){this.jitter=e};class Us extends ve{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,_o(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 Kn({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||Vw;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 Ow(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=rt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=rt(n,"error",i);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(rt(t,"ping",this.onping.bind(this)),rt(t,"data",this.ondata.bind(this)),rt(t,"error",this.onerror.bind(this)),rt(t,"close",this.onclose.bind(this)),rt(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){Io(()=>{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 Nu(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 $r={};function Fo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Tw(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=$r[o]&&i in $r[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new Us(r,t):($r[o]||($r[o]=new Us(r,t)),c=$r[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Fo,{Manager:Us,Socket:Nu,io:Fo,connect:Fo});class mt{static instance;constructor(){}static init(t){if(!mt.instance){const n=br();mt.instance=Fo(wg,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),mt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",mt.instance.id)})}return mt.instance}static on(t,n,r){const o=mt.instance||this.init(n);o.off(t),o.on(t,r)}static waitForConnection(t){const n=mt.instance||this.init(t);return n.connected?Promise.resolve():new Promise(r=>{n.once("connect",()=>r())})}}const js={image:["image/png","image/jpeg","image/webp","image/gif"],video:["video/mp4","video/webm","video/quicktime"],pdf:["application/pdf"]},zw={image:10*1024*1024,video:50*1024*1024,pdf:20*1024*1024},Kw=Object.values(js).flat().join(",");function Vo(e){for(const t of Object.keys(js))if(js[t].includes(e))return t;return null}function Uw(e){const t=Vo(e.type);return t?e.size===0?{reason:"size",category:t}:e.size>zw[t]?{reason:"size",category:t}:null:{reason:"type"}}function Ws(){const e=br();return e?{"x-session-id":e}:{}}async function jw(e,t){const n=await fetch(`${Et}/v1/uploads/${e}/presign`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Ws()},body:JSON.stringify({filename:t.name,contentType:t.type,size:t.size})});if(!n.ok)throw new Error(`presign failed (${n.status})`);return n.json()}function Ww(e,t,n){return new Promise((r,o)=>{const i=new XMLHttpRequest;i.open("PUT",e.uploadUrl,!0),i.setRequestHeader("Content-Type",e.headers["Content-Type"]),i.timeout=(e.expiresIn||300)*1e3,i.upload.onprogress=s=>{s.lengthComputable&&n&&n(s.loaded/s.total)},i.onload=()=>{i.status>=200&&i.status<300?r():o(new Error(`upload failed (${i.status})`))},i.onerror=()=>o(new Error("upload network error")),i.ontimeout=()=>o(new Error("upload timed out")),i.send(t)})}async function Hw(e,t,n){const r=await fetch(`${Et}/v1/uploads/${e}/complete`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Ws()},body:JSON.stringify({key:n,filename:t.name,contentType:t.type,size:t.size})});if(!r.ok)throw new Error(`complete failed (${r.status})`);const i=(await r.json())?.document?.url;if(typeof i!="string"||!i)throw new Error("complete: missing document url");return{key:n,url:i,contentType:t.type,filename:t.name}}async function Yw(e,t,n){const r=await fetch(`${Et}/v1/messages`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Ws()},body:JSON.stringify({type:"media",channelId:e,key:t.key,contentType:t.contentType,filename:t.filename,text:n,metadata:es()})});if(!r.ok)throw new Error(`send media message failed (${r.status})`)}async function qw(e,t,n){const r=await jw(e,t);return await Ww(r,t,n),Hw(e,t,r.key)}let Fu=0;const[Hs,Bo]=nl([]),[Gw,Vu]=L(null),Xw=e=>{for(const t of e){const n=Uw(t);if(n){Vu(n);continue}Fu+=1;const r=Vo(t.type)==="image"?URL.createObjectURL(t):"";Bo(ol(o=>{o.push({id:`att-${Fu}`,file:t,previewUrl:r,status:"pending",progress:0})}))}},Zw=(e,t)=>{Bo(n=>n.id===e,t)},Jw=e=>{const t=Hs.find(n=>n.id===e);t?.previewUrl&&URL.revokeObjectURL(t.previewUrl),Bo(ol(n=>{const r=n.findIndex(o=>o.id===e);r>=0&&n.splice(r,1)}))},Qw=()=>{for(const e of Hs)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);Bo([])},Dr=()=>({attachments:Hs,addFiles:Xw,updateAttachment:Zw,removeAttachment:Jw,clearAttachments:Qw,lastRejection:Gw,clearRejection:()=>Vu(null)}),Ys=1e3*60*60*24,[zo,Bu]=Qi("smarttalks-widget-messages",{},Ys),zu=()=>{const{widgetId:e}=he();return zo[e()]??[]},eb=e=>{const{widgetId:t}=he();Bu({...zo,[t()]:[...zo[t()]??[],e]})},tb=()=>{const{widgetId:e}=he();Bu({...zo,[e()]:[]})},[Ku,nb]=Qi("smarttalks-widget-conversationinfo",{},Ys),qs=()=>{const{widgetId:e}=he();return Ku[e()]??{}},Uu=e=>{const{widgetId:t}=he();nb({...Ku,[t()]:e})},[ju,rb]=Qi("smarttalks-widget-autostarted",{},Ys),ob=()=>{const{widgetId:e}=he();return ju[e()]??!1},Wu=e=>{const{widgetId:t}=he();rb({...ju,[t()]:e})},[ib,Rr]=L(!1),[sb,Hu]=L(!1),Yu=[],qu=()=>{Yu.forEach(e=>e())},ab=e=>Yu.push(e),Ko=e=>{const t=Uv(e);if(eb(t),t.type==="media"){setTimeout(qu,200);return}qu()},Gs=()=>{const{widgetId:e}=he(),t=qs();mt.on("message",e(),n=>{(n.contactId!==t.contactId||n.interactionId!==t.interactionId)&&Uu({contactId:n.contactId,interactionId:n.interactionId});for(const r of n.messages)Ko(r),ge("onAnswer",r);Rr(!1),jv(n.debug)})},cb=(e,t)=>{const{chatWidget:n}=he();e.trim()&&(Ko({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ge("onInput",e),Gs(),Rr(!0),Wv(e,t,n()?._id).catch(r=>{console.error(r),Rr(!1)}))},lb=(e,t)=>{const n=Vo(e.contentType);return n==="video"?{type:"video",link:e.url,text:t}:n==="pdf"?{type:"document",link:e.url,filename:e.filename,text:t}:{type:"image",link:e.url,text:t}},ub=(e,t)=>{const{chatWidget:n}=he();Ko({media:lb(e,t),type:"media",origin:"user",createdAt:new Date().toString()}),Gs(),Rr(!0),Yw(n()?._id??"",e,t).catch(r=>{console.error(r),Rr(!1)})};let Xs=!1;const db=()=>{const{chatWidget:e,widgetId:t}=he();Gs(),Xs=!0,mt.waitForConnection(t()).then(()=>Hv(e()?._id)).then(()=>Wu(!0)).catch(n=>console.error(n)).finally(()=>{Xs=!1})},Gu=()=>{qs().interactionId||ob()||Xs||db()},fb=()=>{const{chatWidget:e}=he(),t=qs();Hu(!0),tb(),Dr().clearAttachments(),Yv(e()?._id,t.contactId,t.interactionId).finally(()=>{Uu({}),Hu(!1),Xu(),Wu(!1),Gu()}),ge("onReset")},Xu=()=>{const{chatWidget:e}=he();if(zu().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Ko({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qt=()=>({getMessages:zu,pushMessage:cb,pushMedia:ub,maybeAutostart:Gu,clearMessages:fb,addBalloonMessage:Xu,onMessage:ab,typing:ib,loading:sb});var hb=U("<span>");const gb=()=>{const{clearMessages:e}=Qt();L(!1);const[t,n]=L(!1);return y(Vv,{get open(){return t()},onOpenChange:n,get children(){return[y(Bv,{get children(){return y(Ue,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(zp,{size:20})}})}}),y(zv,{get children(){return y(Kv,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(Bp,{size:14}),(()=>{var r=hb();return N(r,()=>Oe("restart")),r})()]}})}})]}})};function pb(e){return Ee({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 mb(e){return Ee({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 yb(e){return Ee({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 vb(e){return Ee({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 wb=U('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Zs=()=>{const{chatWidget:e}=he(),[t,n]=L(!1);let r=null;Wt(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&l()});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)},c=f=>{f.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},l=async()=>{try{const f=dr();if(!f)return;if(!t())o(f)&&await i(f)||a(f);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||c(f)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},u=()=>{const f=document,g=!!(document.fullscreenElement||f.webkitFullscreenElement||f.msFullscreenElement);if(n(g),!g)try{const h=dr();h.classList.contains("st-fullscreen")&&c(h)}catch{}};document.addEventListener("fullscreenchange",u),document.addEventListener("webkitfullscreenchange",u);const d=()=>{e()?.mode==="popup"&&ge("close")};return ye("toggleFullscreen",()=>{l()}),(()=>{var f=wb(),g=f.firstChild;return N(f,y(Fp,{}),g),N(g,y(Ue,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:l,get children(){return y(Z,{get when(){return t()},get fallback(){return y(mb,{size:16})},get children(){return y(pb,{size:16})}})}}),null),N(g,y(Z,{get when(){return e()?.showSettings},get children(){return y(gb,{})}}),null),N(g,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(Ue,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:d,get children(){return y(vb,{size:16})}})}}),null),f})()};var bb=U("<span>");const Zu=({createdAt:e,anchor:t="end"})=>(()=>{var n=bb();return qt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),N(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var xb=U('<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 Sb=({children:e,createdAt:t})=>(()=>{var n=xb(),r=n.firstChild;return N(r,e),N(n,y(Zu,{createdAt:t,anchor:"start"}),null),n})();var Eb=U("<span>");const Uo=e=>{const[t,n]=L(!1),r=o=>{const i=new ResizeObserver(()=>{n(o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)});i.observe(o),H(()=>i.disconnect())};return(()=>{var o=Eb();return pr(r,o),N(o,()=>e.text),pe(i=>{var s=e.class,a=t()?e.text:void 0;return s!==i.e&&qt(o,i.e=s),a!==i.t&&me(o,"title",i.t=a),i},{e:void 0,t:void 0}),o})()};var Pb=U("<span>");const Un=e=>{const[,t]=ee(e,["class","children"]);let n=e.children?.toString();return n&&(n=mg(yg(n))),(()=>{var r=Pb();return r.innerHTML=n,fn(r,B({get class(){return jt("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var kb=U('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Cb=({options:e,text:t})=>{let n;const{pushMessage:r}=Qt(),[o,i]=L(!1),s=(a,c)=>{i(!0),r(a,c)};return(()=>{var a=kb(),c=a.firstChild,l=c.firstChild;N(a,y(Un,{get children(){return t?.trim()}}),c);var u=n;return typeof u=="function"?pr(u,l):n=l,N(l,y(Ht,{each:e,children:d=>y(Ue,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 max-w-full min-w-0",onClick:()=>s(d.label,d.value),get children(){return y(Uo,{class:"min-w-0 truncate",get text(){return d.label?.trim()}})}})})),pe(()=>qt(c,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Ob=U('<div class="flex flex-col"><span>'),Tb=U("<a target=_blank><img><span></span><span>");const Ab=({options:e,text:t})=>(()=>{var n=Ob(),r=n.firstChild;return N(r,()=>t?.trim()),N(n,y(Ht,{each:e,children:o=>(()=>{var i=Tb(),s=i.firstChild,a=s.nextSibling,c=a.nextSibling;return N(a,()=>o.title?.trim()),N(c,()=>o.description?.trim()),pe(l=>{var u=o.url,d=o.image;return u!==l.e&&me(i,"href",l.e=u),d!==l.t&&me(s,"src",l.t=d),l},{e:void 0,t:void 0}),i})()}),null),n})();var $b=U("<a target=_blank>");const Db=({url:e,text:t})=>(()=>{var n=$b();return me(n,"href",e),N(n,()=>t?.trim()),n})();var ce=e=>typeof e=="function"?e():e,Ju=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Rb=e=>{const t=B({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[_(()=>{if(n())return ce(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Qu=Rb,Mr=e=>typeof e=="function",Mb=["button","color","file","image","reset","submit"],Ib=(e,t)=>e==="button"?!0:e==="input"&&t?Mb.indexOf(t)!==-1:!1;function _b(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>re(()=>{let a;return Mr(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Js=_b,jo=new Map,Wo=(e,t)=>{if(jo.has(e))return jo.get(e);const n=Se(t);return jo.set(e,n),n},Qs=e=>{const t=jo.get(e);if(t)return Te(t)},Ho=new Map,Lb=e=>{z(()=>{const t=ce(e.style)??{},n=ce(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Ho.get(e.key);o?o.activeCount++:Ho.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);H(()=>{const i=Ho.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Ho.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?.()}})})},Nb=Lb,Fb=e=>{const t=B({enabled:!0},e);z(()=>{ce(t.enabled)&&(document.addEventListener("keydown",n),H(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Vb=Fb,Bb=e=>{const t=B({enabled:!0},e);z(()=>{const{body:n}=document;ce(t.enabled)&&Nb({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},zb=Bb,Kb=e=>{const t=B({enabled:!0,strategy:"pointerup"},e);z(()=>{if(!ce(t.enabled))return;const r=ce(t.strategy);document.addEventListener(r,n),H(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=ce(t.element),i=ce(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Ub=Kb,jb=e=>{const t=B({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Vb({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Ub({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}),zb({enabled:t.noOutsidePointerEvents})},Wb=jb,ea=Se(),Hb=e=>_(()=>{if(Te(ea))return y(ed,e);const r=Ke(),[o,i]=L([r]),s=c=>{i(l=>[...l,c])},a=c=>{i(l=>l.filter(u=>u!==c))};return y(ea.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(ed,e)}})}),ed=e=>{const t=B({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=ee(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=Te(ea),i=Ke();z(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Wb({dismissOnEscapeKeyDown:()=>ce(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>ce(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>ce(n.noOutsidePointerEvents)&&n.enabled,onDismiss:l=>{n.onDismiss(l)},...r});const a=_(()=>n.children),c=()=>{const l=a();return Mr(l)?l({get isLastLayer(){return s()}}):l};return re(()=>c())},Yb=Hb,qb=()=>{const[e,t]=L(!1);return z(()=>t(!0)),e},Gb=qb,Xb=(e,t)=>(e&&(Mr(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ta=(...e)=>e.some(t=>!!t()),Zb=e=>(...t)=>{for(const n of e)n&&n(...t)},Yo=(...e)=>Zb(e),xe=e=>e?"":void 0,Jb="div",Qb=e=>{const[t,n]=ee(e,["as"]),r=_(()=>t.as??Jb);return _(()=>{const i=r();switch(typeof i){case"function":return re(()=>i(n));case"string":return y(yr,B({component:i},n))}})},na=Qb,e0=e=>{let t,n=!1;return()=>n?t:(n=!0,t=_(e))},td=e0,t0=e=>_(()=>ce(e.element)?.tagName.toLowerCase()||e.fallback),n0=t0,nd="button",r0=e=>{const[t,n]=L(null),[r,o]=ee(e,["as","ref","type"]),i=n0({element:t,fallback:nd}),s=_(()=>Ib(i(),r.type));return y(na,B({get as(){return r.as??nd},ref(a){var c=Yo(n,r.ref);typeof c=="function"&&c(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},o0=r0,i0='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"])',ra="focusTrap.initialFocus",oa="focusTrap.finalFocus",rd={bubbles:!1,cancelable:!0},s0=e=>{const t=B({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=_(()=>{const h=n();return h?h[0]??null:null}),i=_(()=>{const h=n();return h?h[h.length-1]??null:null});let s=null;const a=()=>{vs(()=>{c(de(t.element)),(document.activeElement===null||document.activeElement===document.body)&&l(de(t.element))})};z(()=>{const h=de(t.element);if(h&&de(t.enabled)){s=document.activeElement,re(()=>{c(h),l(h)});const p=new MutationObserver(a);de(t.observeChanges)&&p.observe(h,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),H(()=>{de(t.observeChanges)&&p.disconnect(),r(null),g(h)})}}),z(()=>{const h=n();h===null||h.length!==0||(document.addEventListener("keydown",f),H(()=>{document.removeEventListener("keydown",f)}))}),z(()=>{const h=o();h&&(h.addEventListener("keydown",u),H(()=>{h.removeEventListener("keydown",u)}))}),z(()=>{const h=i();h&&(h.addEventListener("keydown",d),H(()=>{h.removeEventListener("keydown",d)}))});const c=h=>{const p=Array.from(h.querySelectorAll(i0)).map((m,v)=>({element:m,domIndex:v,tabIndex:m.tabIndex})).sort((m,v)=>m.tabIndex===v.tabIndex?m.domIndex-v.domIndex:m.tabIndex-v.tabIndex);r(p.map(({element:m})=>m))},l=h=>{vs(()=>{const p=de(t.initialFocusElement)??o()??h,m=t.onInitialFocus;let v;m&&(v=new CustomEvent(ra,rd),h.addEventListener(ra,m),h.dispatchEvent(v),h.removeEventListener(ra,m)),v?.defaultPrevented!==!0&&p.focus()})},u=h=>{h.key==="Tab"&&h.shiftKey&&(h.preventDefault(),i().focus())},d=h=>{h.key==="Tab"&&!h.shiftKey&&(h.preventDefault(),o().focus())},f=h=>{h.key==="Tab"&&h.preventDefault()},g=h=>{vs(()=>{if(!de(t.restoreFocus))return;const m=de(t.finalFocusElement)??s;if(!m)return;let v;const w=t.onFinalFocus;w&&(v=new CustomEvent(oa,rd),h.addEventListener(oa,w),h.dispatchEvent(v),h.removeEventListener(oa,w)),v?.defaultPrevented!==!0&&m.focus()})}},a0=s0,c0=a0,l0=e=>{const t=_(()=>{const s=de(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(de(e.show)?"present":"hidden");let i="none";return z(s=>{const a=de(e.show);return re(()=>{if(s===a)return a;const c=i,l=n();a?o("present"):l==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&c!==l?"hiding":"hidden")}),a}),z(()=>{const s=de(e.element);if(!s)return;const a=l=>{l.target===s&&(i=n())},c=l=>{const d=n().includes(l.animationName);l.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c),H(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",c),s.removeEventListener("animationend",c)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},u0=l0,od=u0,d0=Se(),f0=e=>e?Wo(`dialog-${e}`):d0,id=Se(),h0=e=>e?Wo(`dialog-internal-${e}`):id,jn=e=>{if(!e){const n=Te(id);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=Qs(`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},g0="div",p0=e=>{const[t,n]=ee(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=_(()=>jn(t.contextId)),o=()=>ta(r().open,()=>t.forceMount,r().contentPresent),i=_(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return y(Yb,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=_(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(na,B({ref(c){var l=Yo(r().setContentRef,t.ref);typeof l=="function"&&l(c)},get as(){return t.as??g0},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 xe(r().open())},get"data-closed"(){return xe(!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()}}))}})}})}})},m0=p0,y0="div",v0=e=>{const[t,n]=ee(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=_(()=>jn(t.contextId)),o=()=>ta(r().open,()=>t.forceMount,r().overlayPresent),i=_(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const s=_(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(na,B({get as(){return t.as??y0},ref(a){var c=Yo(r().setOverlayRef,t.ref);typeof c=="function"&&c(a)},"aria-hidden":"true",get"data-open"(){return xe(r().open())},get"data-closed"(){return xe(!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()}}))}})})()}})},w0=v0,b0=e=>{const[t,n]=ee(e,["forceMount","contextId","children"]),r=_(()=>jn(t.contextId)),o=()=>ta(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=Gb(),s=_(a=>a||o()&&i(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const a=_(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(Hc,B(n,{get children(){return a()}}))}})})()}})},x0=b0,ia=!0,S0=e=>{const t=B({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??ia),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??ia),preventScroll:()=>!!(e.modal??ia),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ke()},e),[n,r]=Js({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Qu({value:()=>t.labelId??Ke()}),[a,c,l]=Qu({value:()=>t.descriptionId??Ke()}),[u,d]=L(null),[f,g]=L(null),[h,p]=L(null),{present:m}=od({show:n,element:f}),{present:v}=od({show:n,element:h});c0({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Gl({element:f,enabled:()=>m()&&ce(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 ce(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return ce(t.noOutsidePointerEvents)},get preventScroll(){return ce(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return ce(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return m()},get contentRef(){return f()},get overlayPresent(){return v()},get overlayRef(){return h()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},x=td(()=>t.children),b=()=>{const E=x()();return Mr(E)?E(w):E};return _(()=>{const E=f0(t.contextId),T=h0(t.contextId);return y(E.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:v,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(T.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:v,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:c,unregisterDescriptionId:l,setContentRef:g,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return re(()=>b())}})}})})},E0=S0,P0="button",k0=e=>{const[t,n]=ee(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=_(()=>jn(t.contextId));return y(o0,B({ref(i){var s=Yo(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??P0},onClick:i=>{!Xb(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 xe(r().open())},get"data-closed"(){return xe(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},C0=k0,qo=e=>typeof e=="function"?e():e,sd=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function O0(e){const t=B({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;z(()=>{const l=qo(t.element),u=qo(t.enabled);if(!l||!u)return;const d=new ResizeObserver(a);d.observe(l),l.addEventListener("transitionend",c),H(()=>{d.disconnect(),l.removeEventListener("transitionend",c),c()})});const a=([l])=>{if(n())return;const u=l.target,d=[u.offsetWidth,u.offsetHeight],f=qo(t.dimension);f==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Qe(()=>{i(s),r(!0)}),sd(()=>{i(d),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d:s?Go(f,s)!==Go(f,d)&&(Qe(()=>{i(Go(f,s)),r(!0)}),sd(()=>{i(Go(f,d)),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d},c=()=>{if(!n())return;const l=qo(t.element);l?s=[l.offsetWidth,l.offsetHeight]:s=null,Qe(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Go=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},T0=O0,A0=T0;const $0=(e,t)=>e.length>0?()=>e(re(t)):e;function D0(e,t){let n=0;const r=e.map((o,i)=>_(()=>(n=i,o()),void 0,ts));return _(()=>r.map(o=>o())[n],void 0,t)}function ad(e,t,n){let r=()=>t;const[o,i]=L(t,ts),s=_($0(e,()=>r()),t,ts);return[r=D0([o,s],n),(a=>i(()=>typeof a=="function"?a(re(r)):a))]}var R0=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},M0=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},I0=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=R0(o,t),d=u-c-r*l;(l!==0||d!==0)&&M0(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},_0=e=>y(C0,B({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),cd=Se(),L0=e=>e?Wo(`drawer-${e}`):cd,N0=e=>{if(!e){const n=Te(cd);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Qs(`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},ld=Se(),F0=e=>e?Wo(`drawer-internal-${e}`):ld,ud=e=>{if(!e){const n=Te(ld);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Qs(`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},dd=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Xo(e,t)};const o=r[n-1]?Xo(r[n-1],t):void 0,i=r[n]?Xo(r[n],t):void 0;return{value:e,offset:Xo(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Xo=(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)},V0=(e,t,n,r)=>{const o=fd("upper",e,r?n:t),i=fd("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},fd=(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),B0=(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},z0=void 0,K0=e=>{const t=B({initialOpen:!1,snapPoints:[0,1],breakPoints:[z0],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,W)=>{const X=F/W;return X<1&&X>-1?1:X},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=ee(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=Js({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Js({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[c,l]=L(),{transitioning:u,transitionSize:d}=A0({element:()=>c()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,g]=L(!1),[h,p]=ad(()=>u()?"resizing":null),m=_(()=>{const F=c()?.contentRef();if(F)return getComputedStyle(F)}),[v,w]=L(!1);z(()=>{const F=o();re(()=>{v()!==F&&(F?(w(!0),Ju(()=>{Qe(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(Qe(()=>{p("closing"),a(0)}),Ju(()=>{parseFloat(m().transitionDuration)===0&&x()})))})});const x=()=>{Qe(()=>{w(!1),p(null)})},[b,C]=L(0);z(()=>{const F=c()?.contentRef();if(!F)return;T(F);const W=new ResizeObserver(E);W.observe(F),H(()=>{W.disconnect()})});const E=F=>{for(const W of F)W.target===c()?.contentRef()&&T(W.target)},T=F=>{const W=re(()=>b());switch(n.side){case"top":case"bottom":if(W===F.offsetHeight)return;C(F.offsetHeight);break;case"left":case"right":if(W===F.offsetWidth)return;C(F.offsetWidth);break}},D=_(()=>dd(s(),b())),[S,P]=ad(()=>D().offset),R=_(()=>b()?(b()-S())/b():0),O={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 R()},get translate(){return S()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},V=td(()=>n.children),K=F=>{l(jn(n.contextId));const W=V()();if(Mr(W)){const X=B(F,O);return W(X)}return W};return _(()=>{const F=L0(n.contextId),W=F0(n.contextId);return re(()=>y(F.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:R,translate:S,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(W.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:R,translate:S,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:P,drawerSize:b,resolvedActiveSnapPoint:D,drawerStyles:m,setTransitionState:p,transitionSize:d,closeDrawer:x}},get children(){return y(E0,B({get open(){return v()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:X=>K(X)}))}})}}))})},U0=K0,j0=e=>{const[t,n]=ee(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const c=_(()=>ud(t.contextId)),l=_(()=>jn(t.contextId)),u=_(()=>c().snapPoints().map((x,b)=>dd(x,c().drawerSize(),b,c().breakPoints()))),d=_(()=>{switch(c().side()){case"top":return`translate3d(0, ${-c().translate()}px, 0)`;case"bottom":return`translate3d(0, ${c().translate()}px, 0)`;case"right":return`translate3d(${c().translate()}px, 0, 0)`;case"left":return`translate3d(${-c().translate()}px, 0, 0)`}}),f=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"top":case"bottom":return`${x}px`}}),g=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"left":case"right":return`${x}px`}});z(()=>{l().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",w),document.addEventListener("touchend",w),H(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)}))});const h=x=>{B0(x.target,l().contentRef())&&c().transitionState()!=="closing"&&(r=!0,c().handleScrollableElements()&&(i=[x.clientX,x.clientY]))},p=x=>{v(x.target,x.clientX,x.clientY)},m=x=>{x.touches[0]&&v(x.target,x.touches[0].clientX,x.touches[0].clientY)},v=(x,b,C)=>{if(!r)return;if(!c().isDragging()||o===null){const D=window.getSelection();if(D&&D.toString().length>0){w();return}if(c().handleScrollableElements()){const S=[b,C].map((Y,F)=>i[F]-Y),P=Math.abs(S[0])>Math.abs(S[1])?"x":"y",R=P==="x"?S[0]:S[1];if(Math.abs(R)<.3)return;const O=l().contentRef(),[V,K]=I0(x,P,O);if(R>0&&Math.abs(V)>1||R<0&&Math.abs(K)>0){w();return}}switch(c().side()){case"top":case"bottom":o=C;break;case"right":case"left":o=b}s=new Date,a=c().translate(),Qe(()=>{c().setIsDragging(!0),c().setTransitionState(null)})}let E;switch(c().side()){case"top":E=-(o-C);break;case"bottom":E=o-C;break;case"right":E=o-b;break;case"left":E=-(o-b);break}E-=c().resolvedActiveSnapPoint().offset,E>0&&(E=c().dampFunction(E));const T=new Date;T.getTime()-s.getTime()>c().velocityCacheReset()&&(s=T,a=c().translate()),c().setTranslate(-E)},w=()=>{if(r=!1,!c().isDragging())return;const x=new Date,b=c().velocityFunction(-(a-c().translate()),x.getTime()-s.getTime()||1),C=c().translate()*b,E=V0(u(),c().translate(),C,c().allowSkippingSnapPoints());Qe(()=>{c().setTransitionState("snapping"),c().setIsDragging(!1)}),Qe(()=>{c().setActiveSnapPoint(E.value),E.offset===c().drawerSize()?l().setOpen(!1):(c().setTranslate(E.offset),parseFloat(c().drawerStyles().transitionDuration)===0&&c().setTransitionState(null))})};return y(m0,B({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":c().isDragging()?"0ms":void 0,height:f(),width:g(),...t.style}},onPointerDown:h,onTransitionEnd:()=>{Qe(()=>{c().transitionState()==="closing"&&c().closeDrawer(),c().transitionState()!=="resizing"&&c().setTransitionState(null)})},get"data-transitioning"(){return xe(c().isTransitioning())},get"data-opening"(){return xe(c().transitionState()==="opening")},get"data-closing"(){return xe(c().transitionState()==="closing")},get"data-snapping"(){return xe(c().transitionState()==="snapping")},get"data-resizing"(){return xe(c().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},W0=j0,H0=e=>{const[t,n]=ee(e,["contextId"]),r=_(()=>ud(t.contextId));return y(w0,B({get contextId(){return t.contextId},get"data-transitioning"(){return xe(r().isTransitioning())},get"data-opening"(){return xe(r().transitionState()==="opening")},get"data-closing"(){return xe(r().transitionState()==="closing")},get"data-snapping"(){return xe(r().transitionState()==="snapping")},get"data-resizing"(){return xe(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Y0=H0,q0=U('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const G0=U0,X0=_0,Z0=x0,J0=e=>{const[,t]=ee(e,["class"]),n=N0();return y(Y0,B({get class(){return jt("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))},Q0=e=>{const[,t]=ee(e,["class","children"]);return y(Z0,{get mount(){return dr()},get children(){return[y(J0,{}),y(W0,B({id:"smarttalks-list-content",get class(){return jt("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[q0(),Yt(()=>e.children)]}}))]}})};var ex=U('<span class="font-semibold mt-2 max-w-full px-4 text-center break-words">'),tx=U('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),nx=U('<div class="flex flex-col space-y-2"><div>'),rx=U('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),ox=U('<div class="flex min-w-0 flex-col items-start text-left">');const ix=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qt(),[o,i]=L(!1),[s,a]=L(!1),[c,l]=L(),u=(f,g)=>{a(!1),i(!0),r(f,g)},d=f=>{const g=f.composedPath();for(const h of g)if(h.id==="smarttalks-list-content"){f.preventDefault();return}};return(()=>{var f=nx(),g=f.firstChild;return N(f,y(Un,{get children(){return t?.trim()}}),g),N(g,y(G0,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[y(X0,{as:Ue,variant:"outline",class:"w-full min-w-0",get children(){return y(Uo,{class:"min-w-0 truncate",get text(){return n?.trim()??Oe("selectOption")}})}}),y(Q0,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var h=ex();return N(h,()=>n?.trim()??Oe("selectOption")),h})(),(()=>{var h=tx();return N(h,y(Ht,{each:e,children:p=>(()=>{var m=rx(),v=m.firstChild;return N(v,()=>p.label?.trim()??""),N(m,y(Ht,{get each(){return p.items},children:w=>y(Ue,{variant:"outline",get disabled(){return o()},get class(){return`h-auto py-3 flex justify-between gap-2 hover:bg-slate-200 ${c()===w?"bg-slate-200":""}`},onClick:()=>l(w),get children(){return[(()=>{var x=ox();return N(x,y(Uo,{class:"max-w-full truncate",get text(){return w.label?.trim()}}),null),N(x,y(Uo,{class:"max-w-full line-clamp-2 text-slate-500",get text(){return w.description?.trim()}}),null),x})(),y(Z,{get when(){return c()===w},get fallback(){return y(Lv,{class:"size-4 shrink-0 text-slate-500"})},get children(){return y(_v,{class:"size-4 shrink-0 text-slate-500"})}})]}})}),null),m})()})),h})(),y(Ue,{get disabled(){return o()||!c()},onClick:()=>u(c().label,c().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return Oe("send")}})]}})]}})),pe(()=>qt(g,o()?"opacity-50":"")),f})()};var sx=U("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const ax=e=>(()=>{var t=sx(),n=t.firstChild,r=n.nextSibling;return pe(o=>{var i=e.link,s=e.link;return i!==o.e&&me(n,"src",o.e=i),s!==o.t&&me(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var cx=U('<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 lx=e=>(()=>{var t=cx(),n=t.firstChild,r=n.firstChild;return N(n,y(Nv,{class:"size-10"}),r),N(r,()=>e.filename?.trim()),N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(()=>me(n,"href",e.link)),t})();var ux=U('<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 max-w-[320px] rounded-md">');const dx=e=>(()=>{var t=ux(),n=t.firstChild,r=n.firstChild;return N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&me(n,"href",o.e=i),s!==o.t&&me(r,"src",o.t=s),a!==o.a&&me(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var fx=U('<div class="flex flex-col space-y-2"><video controls preload=auto class="w-full h-auto max-w-[320px] rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const hx=e=>(()=>{var t=fx(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(i=>{var s=e.link,a=e.link;return s!==i.e&&me(r,"src",i.e=s),a!==i.t&&me(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var gx=U("<div>Media type not supported");const hd=e=>e.type==="image"?y(dx,e):e.type==="audio"?y(ax,e):e.type==="document"?y(lx,e):e.type==="video"?y(hx,e):gx(),sa=({text:e})=>y(Un,{get children(){return e?.trim()}});var yt=()=>(e,t)=>ee(e,t);function px(e){return e==null?[]:Array.isArray(e)?e:[e]}var mx=e=>e[e.length-1],yx=e=>Array.from(new Set(e));function gd(e,t){return e.reduce((n,r,o)=>(o%t===0?n.push([r]):mx(n)?.push(r),n),[])}var pd=e=>e?.constructor.name==="Array",vx=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Zo(e[n],t[n]))return!1;return!0},Zo=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(pd(e)&&pd(t))return vx(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Zo(e[i],t[i]))return!1}return!0},wx=e=>Array.isArray(e),md=e=>e!=null&&typeof e=="object",bx=e=>md(e)&&!wx(e),xx=e=>typeof e=="number"&&!Number.isNaN(e),Wn=e=>typeof e=="string",ot=e=>typeof e=="function",Sx=e=>e==null,yd=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ex=e=>Object.prototype.toString.call(e),vd=Function.prototype.toString,Px=vd.call(Object),kx=e=>{if(!md(e)||Ex(e)!="[object Object]"||Tx(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=yd(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vd.call(n)==Px},Cx=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,Ox=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Tx=e=>Cx(e)||Ox(e),wd=()=>{},Ir=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function _r(e,t,...n){if(e in t){const o=t[e];return ot(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,_r),r}var{min:Ax,max:$x}=Math,Dx=e=>Number.isNaN(e),bd=e=>Dx(e)?0:e,aa=(e,t,n)=>{const r=bd(e),o=t==null||r>=t,i=n==null||r<=n;return o&&i},Rx=(e,t,n)=>Ax($x(bd(e),t),n);function ca(e){if(!kx(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=ca(o))}return n}function Jo(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function xd(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function la(e,t){if(e==null)throw new Error(t())}function Mx(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function en(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=Se(i);function a(){const c=Te(s);if(!c&&t){const l=new Error(o??Mx(n,r));throw l.name="ContextError",yd(Error,"captureStackTrace")&&ot(Error.captureStackTrace)&&Error.captureStackTrace(l,a),l}return c}return[s.Provider,a,s]}en({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});var Ix=e=>yt()(e,["lazyMount","unmountOnExit"]),_x=e=>typeof e=="function",Sd=(e,...t)=>_x(e)?e(...t):e;function Lx(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var Nx=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),Fx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ed=e=>{const t={};let n;for(;n=Fx.exec(e);)t[n[1]]=n[2];return t},Vx=(e,t)=>{if(Wn(e)){if(Wn(t))return`${e};${t}`;e=Ed(e)}else Wn(t)&&(t=Ed(t));return Object.assign({},e??{},t??{})};function Bx(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=Ir(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=Nx(t[o],n[o]);continue}if(o==="style"){t[o]=Vx(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function zx(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((c,l)=>!Zo(r[l],c)))&&(r=s,o=t(s,i)),o}}var tn=".",Pd="#",kd=new WeakMap,Cd=new WeakMap;function ua(e){return e.join(tn)}function Kx(e){return e.includes(tn)}function Od(e){return e.startsWith(Pd)}function Ux(e){return e.startsWith(tn)}function jx(e){return Od(e)?e.slice(Pd.length):e}function da(e,t){return e?`${e}${tn}${t}`:t}function Wx(e){const t=new Map,n=new Map,r=(o,i)=>{t.set(o,i);const s=i.id;s&&(n.has(s)&&xd(`[zag-js] Duplicate state id: "${s}"`),n.set(s,o));const a=i.states;if(a){la(i.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),i.initial in a||xd(`[zag-js] Compound state "${o}" has initial "${String(i.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const u=da(o,c);r(u,l)}}};for(const[o,i]of Object.entries(e.states))i&&r(o,i);return{index:t,idIndex:n}}function Lr(e){const t=kd.get(e);if(t)return t;const{index:n,idIndex:r}=Wx(e);return kd.set(e,n),Cd.set(e,r),n}function Hx(e,t){return Lr(e),Cd.get(e)?.get(t)}function fa(e){return e?String(e).split(tn).filter(Boolean):[]}function Qo(e,t){if(!t)return[];const n=Lr(e),r=fa(t),o=[],i=[];for(const s of r){i.push(s);const a=ua(i),c=n.get(a);if(!c)break;o.push({path:a,state:c})}return o}function Nr(e,t){const n=Lr(e),r=fa(t);if(!r.length)return t;const o=[];for(const a of r){o.push(a);const c=ua(o);if(!n.has(c))return t}let i=ua(o),s=n.get(i);for(;s?.initial;){const a=`${i}${tn}${s.initial}`,c=n.get(a);if(!c)break;i=a,s=c}return i}function Td(e,t){return Lr(e).has(t)}function Ad(e,t,n){const r=String(t);if(Od(r)){const o=jx(r),i=Hx(e,o);return la(i,()=>`[zag-js] Unknown state id: "${o}"`),Nr(e,i)}if(Ux(r)&&n){const o=da(n,r.slice(1));return Nr(e,o)}if(!Kx(r)&&n){const o=fa(n);for(let i=o.length-1;i>=1;i--){const s=o.slice(0,i).join(tn),a=da(s,r);if(Td(e,a))return Nr(e,a)}if(Td(e,r))return Nr(e,r)}return Nr(e,r)}function Yx(e,t,n){const r=Qo(e,t);for(let i=r.length-1;i>=0;i--){const a=r[i]?.state.on?.[n];if(a)return{transitions:a,source:r[i]?.path}}return{transitions:e.on?.[n],source:void 0}}function qx(e,t,n,r){const o=t?Qo(e,t):[],i=Qo(e,n);let s=0;for(;s<o.length&&s<i.length&&o[s]?.path===i[s]?.path;)s+=1;let a=o.slice(s).reverse(),c=i.slice(s);const l=o.at(-1)?.path===i.at(-1)?.path;return r&&l&&(a=o.slice().reverse(),c=i),{exiting:a,entering:c}}function Gx(e,t){return e?e===t||e.startsWith(`${t}${tn}`):!1}function Xx(e,t,n){return Qo(e,t).some(r=>r.state.tags?.includes(n))}function Zx(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function $d(e){return Lr(e),e}var Hn=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Hn||{}),ei="__init__",Jx=Object.defineProperty,Qx=(e,t,n)=>t in e?Jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ha=(e,t,n)=>Qx(e,typeof t!="symbol"?t+"":t,n),Dd=()=>{},ti=e=>typeof e=="object"&&e!==null,j=e=>e?"":void 0,Pe=e=>e?"true":void 0,e1=1,t1=9,n1=11,Fe=e=>ti(e)&&e.nodeType===e1&&typeof e.nodeName=="string",ga=e=>ti(e)&&e.nodeType===t1,r1=e=>ti(e)&&e===e.window,Rd=e=>Fe(e)?e.localName||"":"#document";function o1(e){return["html","body","#document"].includes(Rd(e))}var Md=e=>ti(e)&&e.nodeType!==void 0,Yn=e=>Md(e)&&e.nodeType===n1&&"host"in e,i1=e=>Fe(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function s1(e){if(!e)return!1;const t=e.getRootNode();return Id(t)===e}function ni(e,t){if(!e||!t||!Fe(e)||!Md(t))return!1;if(Fe(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&Yn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function wn(e){return ga(e)?e:r1(e)?e.document:e?.ownerDocument??document}function a1(e){return wn(e).documentElement}function At(e){return Yn(e)?At(e.host):ga(e)?e.defaultView??window:Fe(e)?e.ownerDocument?.defaultView??window:window}function Id(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function c1(e){if(Rd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yn(e)&&e.host||a1(e);return Yn(t)?t.host:t}function l1(e){let t;try{if(t=e.getRootNode({composed:!0}),ga(t)||Yn(t))return t}catch{}return e.ownerDocument??document}var pa=new WeakMap;function ma(e){return pa.has(e)||pa.set(e,At(e).getComputedStyle(e)),pa.get(e)}var u1=new Set(["menu","listbox","dialog","grid","tree","region","application"]),d1=e=>u1.has(e),f1=e=>e.getAttribute("aria-controls")?.split(" ")||[];function h1(e,t){const n=new Set,r=l1(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const c=f1(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const u=r.getElementById(l);if(u){const d=u.getAttribute("role"),f=u.getAttribute("aria-modal")==="true";if(d&&d1(d)&&!f&&(u===t||u.contains(t)||o(u)))return!0}}}return!1};return o(e)}var _d=()=>typeof document<"u";function g1(){return navigator.userAgentData?.platform??navigator.platform}var ya=e=>_d()&&e.test(g1()),Ld=()=>_d()&&!!navigator.maxTouchPoints,p1=()=>ya(/^iPhone/i),m1=()=>ya(/^iPad/i)||Fd()&&navigator.maxTouchPoints>1,Nd=()=>p1()||m1(),Fd=()=>ya(/^Mac/i);function y1(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function qn(e){return y1(e)?.[0]??e.target}function v1(e){return Bd(e).isComposing||e.keyCode===229}var w1=e=>e.button===2||Fd()&&e.ctrlKey&&e.button===0,b1={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Vd={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function x1(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=b1[o]??o,n==="rtl"&&r==="horizontal"&&o in Vd&&(o=Vd[o]),o}function Bd(e){return e.nativeEvent??e}var ri=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function S1(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=At(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function E1(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function oi(e,t,n="value"){if(!e)return;const r=E1(e);r&&S1(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}var P1="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function zd(e){return!Fe(e)||e.closest("[inert]")?!1:e.matches(P1)&&i1(e)}var k1=class Nh{constructor(){ha(this,"id",null),ha(this,"fn_cleanup"),ha(this,"cleanup",()=>{this.cancel()})}static create(){return new Nh}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function $e(e){const t=k1.create();return t.request(e),t.cleanup}function va(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function wa(e){const t=c1(e);return o1(t)?wn(t).body:Fe(t)&&T1(t)?t:wa(t)}var C1=/auto|scroll|overlay|hidden|clip/,O1=new Set(["inline","contents"]);function T1(e){const t=At(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return C1.test(n+o+r)&&!O1.has(i)}var Gn="default",ba="",ii=new WeakMap;function A1(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return Nd()?(Gn==="default"&&(ba=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Gn="disabled"):t&&(ii.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Kd({target:t,doc:r})}function Kd(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(Nd()){if(Gn!=="disabled")return;Gn="restoring",setTimeout(()=>{va(()=>{Gn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=ba||""),ba="",Gn="default")})},300)}else if(t&&ii.has(t)){const i=ii.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),ii.delete(t)}}function $1(e={}){const{defer:t,target:n,...r}=e,o=t?$e:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(A1({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function D1(e,t){return Array.from(e?.querySelectorAll(t)??[])}function R1(e,t){return e?.querySelector(t)??null}function Ud(e,t){if(!e)return Dd;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return M1(n,t)?Dd:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function M1(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function I1(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{r.aborted||(clearTimeout(c),s(l))}).catch(l=>{r.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function _1(e,t){const{timeout:n,rootNode:r}=t,o=At(r),i=wn(r),s=new o.AbortController;return I1(new Promise(a=>{const c=e();if(c){a(c);return}const l=new o.MutationObserver(()=>{const u=e();u&&u.isConnected&&(l.disconnect(),a(u))});l.observe(i.body,{childList:!0,subtree:!0})}),s,n)}function L1(e){const t=()=>e.getRootNode?.()??document,n=()=>wn(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>Id(t()),isActiveElement:s1,getById:s=>t().getElementById(s)}}var N1=$d({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e("onExitComplete")?.();const n=t.get("node");if(!n)return;const r=At(n),o=new r.CustomEvent("exitcomplete",{bubbles:!1});n.dispatchEvent(o)},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",ma(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});$e(()=>{if(r("present"))return;const s=si(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{$e(()=>{e.set("prevAnimationName",si(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=l=>{(l.composedPath?.()?.[0]??l.target)===o&&e.set("prevAnimationName",si(t.get("styles")))},s=l=>{const u=si(t.get("styles"));qn(l)===o&&u===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})},a=l=>{qn(l)===o&&!r("present")&&n({type:"UNMOUNT",src:"animationcancel"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",s);const c=Ud(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",s),va(()=>c())}}}}});function si(e){return e?.animationName||"none"}function F1(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}function ai(e){const t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=L(t),i=_(()=>e().value!=null),s={current:r()},a={current:void 0};z(()=>{const u=i()?e().value:r();a.current=u,s.current=u});const c=u=>{const d=a.current,f=ot(u)?u(s.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:f,prev:d}),i()||o(f),n(f,d)||e().onChange?.(f,d)};function l(){const u=i()?e().value:r;return ot(u)?u():u}return{initial:t,ref:s,get:l,set:c,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}ai.cleanup=e=>{H(()=>e())},ai.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function V1(e){const t={current:e};return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}function xa(e){return ot(e)?e():e}var B1=(e,t)=>{let n=[],r=!0;z(()=>{if(r){n=e.map(i=>xa(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!Zo(n[i],xa(e[i]))){o=!0;break}o&&(n=e.map(i=>xa(i)),t())})};function jd(e,t={}){const n=_(()=>{const{id:D,ids:S,getRootNode:P}=Sa(t);return L1({id:D,ids:S,getRootNode:P})}),r=(...D)=>{e.debug&&console.log(...D)},o=_(()=>e.props?.({props:ca(Sa(t)),scope:n()})??Sa(t)),i=z1(o),s=e.context?.({prop:i,bindable:ai,get scope(){return n()},flush:Wd,getContext(){return a},getComputed(){return b},getRefs(){return h},getEvent(){return f()}}),a={get(D){return s?.[D].get()},set(D,S){s?.[D].set(S)},initial(D){return s?.[D].initial},hash(D){const S=s?.[D].get();return s?.[D].hash(S)}},c={current:new Map},l={current:null},u={current:null},d={current:{type:""}},f=()=>B(d.current,{current(){return d.current},previous(){return u.current}}),g=()=>B(C,{matches(...D){const S=C.get();return D.some(P=>Gx(S,P))},hasTag(D){const S=C.get();return Xx(e,S,D)}}),h=V1(e.refs?.({prop:i,context:a})??{}),p=()=>({state:g(),context:a,event:f(),prop:i,send:T,action:m,guard:v,track:B1,refs:h,computed:b,flush:Wd,get scope(){return n()},choose:x}),m=D=>{const S=ot(D)?D(p()):D;if(!S)return;const P=S.map(R=>{const O=e.implementations?.actions?.[R];return O||Jo(`[zag-js] No implementation found for action "${JSON.stringify(R)}"`),O});for(const R of P)R?.(p())},v=D=>{if(ot(D))return D(p());const S=e.implementations?.guards?.[D];return S||Jo(`[zag-js] No implementation found for guard "${JSON.stringify(D)}"`),S?.(p())},w=D=>{const S=ot(D)?D(p()):D;if(!S)return;const P=S.map(O=>{const V=e.implementations?.effects?.[O];return V||Jo(`[zag-js] No implementation found for effect "${JSON.stringify(O)}"`),V}),R=[];for(const O of P){const V=O?.(p());V&&R.push(V)}return()=>R.forEach(O=>O?.())},x=D=>px(D).find(S=>{let P=!S.guard;return Wn(S.guard)?P=!!v(S.guard):ot(S.guard)&&(P=S.guard(p())),P}),b=D=>{la(e.computed,()=>"[zag-js] No computed object found on machine");const S=e.computed[D];return S({context:a,event:d.current,prop:i,refs:h,scope:n(),computed:b})},C=ai(()=>({defaultValue:Ad(e,e.initialState({prop:i})),onChange(D,S){const{exiting:P,entering:R}=qx(e,S,D,l.current?.reenter);if(P.forEach(O=>{c.current.get(O.path)?.(),c.current.delete(O.path)}),P.forEach(O=>{m(O.state?.exit)}),m(l.current?.actions),R.forEach(O=>{const V=w(O.state?.effects);if(V){const K=c.current.get(O.path);c.current.set(O.path,K?Ir(K,V):V)}}),S===ei){m(e.entry);const O=w(e.effects);if(O){const V=c.current.get(ei);c.current.set(ei,V?Ir(V,O):O)}}R.forEach(O=>{m(O.state?.entry)})}}));let E=Hn.NotStarted;Wt(()=>{const D=E===Hn.Started;E=Hn.Started,r(D?"rehydrating...":"initializing..."),C.invoke(C.initial,ei)}),H(()=>{r("unmounting..."),E=Hn.Stopped,c.current.forEach(S=>S?.()),c.current=new Map,l.current=null,m(e.exit)});const T=D=>{queueMicrotask(()=>{if(E!==Hn.Started)return;u.current=d.current,d.current=D;let S=re(()=>C.get());const{transitions:P,source:R}=Yx(e,S,D.type),O=x(P);if(!O)return;l.current=O;const V=Ad(e,O.target??S,R);r("transition",D.type,O.target||S,`(${O.actions})`),V!==S?C.set(V):O.reenter?C.invoke(S,S):m(O.actions)})};return e.watch?.(p()),{state:g(),send:T,context:a,prop:i,get scope(){return n()},refs:h,computed:b,event:f(),getStatus:()=>E}}function Wd(e){e()}function Sa(e){return ot(e)?e():e}function z1(e){return function(n){return e()[n]}}function te(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let c=e[a];typeof c=="function"&&(c=c()),s=Bx(s,{[i]:(c||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let c,l=e[a];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}})}}return t}var Hd={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},K1=e=>e.startsWith("--")?e:G1(e);function U1(e){return e in Hd?Hd[e]:e}var j1=F1(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&bx(r)){t.style=W1(r);continue}if(n==="children"){Wn(r)&&(t.textContent=r);continue}t[U1(n)]=r}}return t});function W1(e){let t={};for(const n in e){const r=e[n];!Wn(r)&&!xx(r)||(t[K1(n)]=r)}return t}var H1=/[A-Z]/g,Y1=/^ms-/;function q1(e){return"-"+e.toLowerCase()}var Ea={};function G1(e){if(Ea.hasOwnProperty(e))return Ea[e];const t=e.replace(H1,q1);return Ea[e]=Y1.test(t)?"-"+t:t}var Yd=e=>{const[t,n]=Ix(Sd(e)),[r,o]=L(!1),i=jd(N1,e),s=_(()=>Lx(i));z(()=>{s().present&&o(!0)});const a=c=>{c&&i.send({type:"NODE.SET",node:c})};return _(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,ref:a,presenceProps:{hidden:!s().present,"data-state":s().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))},X1=e=>typeof e=="function",qd=(e,t)=>{for(const n of e)X1(n)&&n(t)};function Z1(...e){let t=null;return z(()=>{qd(e,t)}),n=>{t=n,qd(e,n)}}var Pa=e=>n=>{const[r,o]=ee(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=ee(o,["ref"]);return te(a,s)};return r.asChild(i)}return y(yr,B({component:e},o))};function J1(){const e=new Map;return new Proxy(Pa,{apply(t,n,r){return Pa(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Pa(r)),e.get(r)}})}var oe=J1(),Gd=e=>yt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),[Xd,Zd]=en({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Fr=(e,t=[])=>({parts:(...n)=>{if(Q1(t))return Fr(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Fr(e,[...t,...n]),omit:(...n)=>Fr(e,t.filter(r=>!n.includes(r))),rename:n=>Fr(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Xn(e)}"][data-part="${Xn(r)}"]`,`& [data-scope="${Xn(e)}"][data-part="${Xn(r)}"]`].join(", "),attrs:{"data-scope":Xn(e),"data-part":Xn(r)}}}),{})}),Xn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Q1=e=>e.length===0;const eS=["top","right","bottom","left"],nn=Math.min,Ve=Math.max,ci=Math.round,li=Math.floor,vt=e=>({x:e,y:e}),tS={left:"right",right:"left",bottom:"top",top:"bottom"};function ka(e,t,n){return Ve(e,nn(t,n))}function $t(e,t){return typeof e=="function"?e(t):e}function Dt(e){return e.split("-")[0]}function Zn(e){return e.split("-")[1]}function Ca(e){return e==="x"?"y":"x"}function Oa(e){return e==="y"?"height":"width"}function wt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ta(e){return Ca(wt(e))}function nS(e,t,n){n===void 0&&(n=!1);const r=Zn(e),o=Ta(e),i=Oa(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ui(s)),[s,ui(s)]}function rS(e){const t=ui(e);return[Aa(e),t,Aa(t)]}function Aa(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Jd=["left","right"],Qd=["right","left"],oS=["top","bottom"],iS=["bottom","top"];function sS(e,t,n){switch(e){case"top":case"bottom":return n?t?Qd:Jd:t?Jd:Qd;case"left":case"right":return t?oS:iS;default:return[]}}function aS(e,t,n,r){const o=Zn(e);let i=sS(Dt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Aa)))),i}function ui(e){const t=Dt(e);return tS[t]+e.slice(t.length)}function cS(e){return{top:0,right:0,bottom:0,left:0,...e}}function ef(e){return typeof e!="number"?cS(e):{top:e,right:e,bottom:e,left:e}}function di(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function tf(e,t,n){let{reference:r,floating:o}=e;const i=wt(t),s=Ta(t),a=Oa(s),c=Dt(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Zn(t)){case"start":g[s]-=f*(n&&l?-1:1);break;case"end":g[s]+=f*(n&&l?-1:1);break}return g}async function lS(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=$t(t,e),h=ef(g),m=a[f?d==="floating"?"reference":"floating":d],v=di(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=di(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:c}):w);return{top:(v.top-C.top+h.top)/b.y,bottom:(C.bottom-v.bottom+h.bottom)/b.y,left:(v.left-C.left+h.left)/b.x,right:(C.right-v.right+h.right)/b.x}}const uS=50,dS=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:lS},c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=tf(l,r,c),f=r,g=0;const h={};for(let p=0;p<i.length;p++){const m=i[p];if(!m)continue;const{name:v,fn:w}=m,{x,y:b,data:C,reset:E}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});u=x??u,d=b??d,h[v]={...h[v],...C},E&&g<uS&&(g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(l=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=tf(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}},fS=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=$t(e,t)||{};if(l==null)return{};const d=ef(u),f={x:n,y:r},g=Ta(o),h=Oa(g),p=await s.getDimensions(l),m=g==="y",v=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[g]-f[g]-i.floating[h],C=f[g]-i.reference[g],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=E?E[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=a.floating[x]||i.floating[h]);const D=b/2-C/2,S=T/2-p[h]/2-1,P=nn(d[v],S),R=nn(d[w],S),O=P,V=T-p[h]-R,K=T/2-p[h]/2+D,Y=ka(O,K,V),F=!c.arrow&&Zn(o)!=null&&K!==Y&&i.reference[h]/2-(K<O?P:R)-p[h]/2<0,W=F?K<O?K-O:K-V:0;return{[g]:f[g]+W,data:{[g]:Y,centerOffset:K-Y-W,...F&&{alignmentOffset:W}},reset:F}}}),hS=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=$t(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Dt(o),w=wt(a),x=Dt(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=f||(x||!p?[ui(a)]:rS(a)),E=h!=="none";!f&&E&&C.push(...aS(a,p,h,b));const T=[a,...C],D=await c.detectOverflow(t,m),S=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&S.push(D[v]),d){const K=nS(o,s,b);S.push(D[K[0]],D[K[1]])}if(P=[...P,{placement:o,overflows:S}],!S.every(K=>K<=0)){var R,O;const K=(((R=i.flip)==null?void 0:R.index)||0)+1,Y=T[K];if(Y&&(!(d==="alignment"?w!==wt(Y):!1)||P.every(X=>wt(X.placement)===w?X.overflows[0]>0:!0)))return{data:{index:K,overflows:P},reset:{placement:Y}};let F=(O=P.filter(W=>W.overflows[0]<=0).sort((W,X)=>W.overflows[1]-X.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(g){case"bestFit":{var V;const W=(V=P.filter(X=>{if(E){const G=wt(X.placement);return G===w||G==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(G=>G>0).reduce((G,Xe)=>G+Xe,0)]).sort((X,G)=>X[1]-G[1])[0])==null?void 0:V[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function nf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rf(e){return eS.some(t=>e[t]>=0)}const gS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=$t(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=nf(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:rf(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=nf(s,n.floating);return{data:{escapedOffsets:a,escaped:rf(a)}}}default:return{}}}}},of=new Set(["left","top"]);async function pS(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Dt(n),a=Zn(n),c=wt(n)==="y",l=of.has(s)?-1:1,u=i&&c?-1:1,d=$t(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),c?{x:g*u,y:f*l}:{x:f*l,y:g*u}}const mS=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await pS(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},yS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:w,y:x}=v;return{x:w,y:x}}},...l}=$t(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),f=wt(Dt(o)),g=Ca(f);let h=u[g],p=u[f];if(s){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=h+d[v],b=h-d[w];h=ka(x,h,b)}if(a){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=p+d[v],b=p-d[w];p=ka(x,p,b)}const m=c.fn({...t,[g]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:s,[f]:a}}}}}},vS=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=$t(e,t),u={x:n,y:r},d=wt(o),f=Ca(d);let g=u[f],h=u[d];const p=$t(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=f==="y"?"height":"width",b=i.reference[f]-i.floating[x]+m.mainAxis,C=i.reference[f]+i.reference[x]-m.mainAxis;g<b?g=b:g>C&&(g=C)}if(l){var v,w;const x=f==="y"?"width":"height",b=of.has(Dt(o)),C=i.reference[d]-i.floating[x]+(b&&((v=s.offset)==null?void 0:v[d])||0)+(b?0:m.crossAxis),E=i.reference[d]+i.reference[x]+(b?0:((w=s.offset)==null?void 0:w[d])||0)-(b?m.crossAxis:0);h<C?h=C:h>E&&(h=E)}return{[f]:g,[d]:h}}}},wS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=$t(e,t),u=await s.detectOverflow(t,l),d=Dt(o),f=Zn(o),g=wt(o)==="y",{width:h,height:p}=i.floating;let m,v;d==="top"||d==="bottom"?(m=d,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=h-u.left-u.right,b=nn(p-u[m],w),C=nn(h-u[v],x),E=!t.middlewareData.shift;let T=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),E&&!f){const P=Ve(u.left,0),R=Ve(u.right,0),O=Ve(u.top,0),V=Ve(u.bottom,0);g?D=h-2*(P!==0||R!==0?P+R:Ve(u.left,u.right)):T=p-2*(O!==0||V!==0?O+V:Ve(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:T});const S=await s.getDimensions(a.floating);return h!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function fi(){return typeof window<"u"}function Jn(e){return sf(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bt(e){var t;return(t=(sf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sf(e){return fi()?e instanceof Node||e instanceof Be(e).Node:!1}function it(e){return fi()?e instanceof Element||e instanceof Be(e).Element:!1}function Rt(e){return fi()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function af(e){return!fi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}function Vr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function bS(e){return/^(table|td|th)$/.test(Jn(e))}function hi(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const xS=/transform|translate|scale|rotate|perspective|filter/,SS=/paint|layout|strict|content/,bn=e=>!!e&&e!=="none";let $a;function Da(e){const t=it(e)?st(e):e;return bn(t.transform)||bn(t.translate)||bn(t.scale)||bn(t.rotate)||bn(t.perspective)||!Ra()&&(bn(t.backdropFilter)||bn(t.filter))||xS.test(t.willChange||"")||SS.test(t.contain||"")}function ES(e){let t=rn(e);for(;Rt(t)&&!Qn(t);){if(Da(t))return t;if(hi(t))return null;t=rn(t)}return null}function Ra(){return $a==null&&($a=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$a}function Qn(e){return/^(html|body|#document)$/.test(Jn(e))}function st(e){return Be(e).getComputedStyle(e)}function gi(e){return it(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rn(e){if(Jn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||af(e)&&e.host||bt(e);return af(t)?t.host:t}function cf(e){const t=rn(e);return Qn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&Vr(t)?t:cf(t)}function Br(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=cf(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Be(o);if(i){const a=Ma(s);return t.concat(s,s.visualViewport||[],Vr(o)?o:[],a&&n?Br(a):[])}else return t.concat(o,Br(o,[],n))}function Ma(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lf(e){const t=st(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Rt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ci(n)!==i||ci(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ia(e){return it(e)?e:e.contextElement}function er(e){const t=Ia(e);if(!Rt(t))return vt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=lf(t);let s=(i?ci(n.width):n.width)/r,a=(i?ci(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const PS=vt(0);function uf(e){const t=Be(e);return!Ra()||!t.visualViewport?PS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kS(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Be(e)?!1:t}function xn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ia(e);let s=vt(1);t&&(r?it(r)&&(s=er(r)):s=er(e));const a=kS(i,n,r)?uf(i):vt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Be(i),g=r&&it(r)?Be(r):r;let h=f,p=Ma(h);for(;p&&r&&g!==h;){const m=er(p),v=p.getBoundingClientRect(),w=st(p),x=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=b,h=Be(p),p=Ma(h)}}return di({width:u,height:d,x:c,y:l})}function pi(e,t){const n=gi(e).scrollLeft;return t?t.left+n:xn(bt(e)).left+n}function df(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pi(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function CS(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=bt(r),a=t?hi(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1);const u=vt(0),d=Rt(r);if((d||!d&&!i)&&((Jn(r)!=="body"||Vr(s))&&(c=gi(r)),d)){const g=xn(r);l=er(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=s&&!d&&!i?df(s,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function OS(e){return Array.from(e.getClientRects())}function TS(e){const t=bt(e),n=gi(e),r=e.ownerDocument.body,o=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+pi(e);const a=-n.scrollTop;return st(r).direction==="rtl"&&(s+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ff=25;function AS(e,t){const n=Be(e),r=bt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const u=Ra();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=pi(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-g);h<=ff&&(i-=h)}else l<=ff&&(i+=l);return{width:i,height:s,x:a,y:c}}function $S(e,t){const n=xn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Rt(e)?er(e):vt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function hf(e,t,n){let r;if(t==="viewport")r=AS(e,n);else if(t==="document")r=TS(bt(e));else if(it(t))r=$S(t,n);else{const o=uf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return di(r)}function gf(e,t){const n=rn(e);return n===t||!it(n)||Qn(n)?!1:st(n).position==="fixed"||gf(n,t)}function DS(e,t){const n=t.get(e);if(n)return n;let r=Br(e,[],!1).filter(a=>it(a)&&Jn(a)!=="body"),o=null;const i=st(e).position==="fixed";let s=i?rn(e):e;for(;it(s)&&!Qn(s);){const a=st(s),c=Da(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Vr(s)&&!c&&gf(e,s))?r=r.filter(u=>u!==s):o=a,s=rn(s)}return t.set(e,r),r}function RS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?hi(t)?[]:DS(t,this._c):[].concat(n),r],a=hf(t,s[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let f=1;f<s.length;f++){const g=hf(t,s[f],o);c=Ve(g.top,c),l=nn(g.right,l),u=nn(g.bottom,u),d=Ve(g.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function MS(e){const{width:t,height:n}=lf(e);return{width:t,height:n}}function IS(e,t,n){const r=Rt(t),o=bt(t),i=n==="fixed",s=xn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=vt(0);function l(){c.x=pi(o)}if(r||!r&&!i)if((Jn(t)!=="body"||Vr(o))&&(a=gi(t)),r){const g=xn(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=o&&!r&&!i?df(o,a):vt(0),d=s.left+a.scrollLeft-c.x-u.x,f=s.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:s.width,height:s.height}}function _a(e){return st(e).position==="static"}function pf(e,t){if(!Rt(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bt(e)===n&&(n=n.ownerDocument.body),n}function mf(e,t){const n=Be(e);if(hi(e))return n;if(!Rt(e)){let o=rn(e);for(;o&&!Qn(o);){if(it(o)&&!_a(o))return o;o=rn(o)}return n}let r=pf(e,t);for(;r&&bS(r)&&_a(r);)r=pf(r,t);return r&&Qn(r)&&_a(r)&&!Da(r)?n:r||ES(e)||n}const _S=async function(e){const t=this.getOffsetParent||mf,n=this.getDimensions,r=await n(e.floating);return{reference:IS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function LS(e){return st(e).direction==="rtl"}const NS={convertOffsetParentRelativeRectToViewportRelativeRect:CS,getDocumentElement:bt,getClippingRect:RS,getOffsetParent:mf,getElementRects:_S,getClientRects:OS,getDimensions:MS,getScale:er,isElement:it,isRTL:LS};function yf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FS(e,t){let n=null,r;const o=bt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:g}=l;if(a||t(),!f||!g)return;const h=li(d),p=li(o.clientWidth-(u+f)),m=li(o.clientHeight-(d+g)),v=li(u),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Ve(0,nn(1,c))||1};let b=!0;function C(E){const T=E[0].intersectionRatio;if(T!==c){if(!b)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!yf(l,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function VS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Ia(e),u=o||i?[...l?Br(l):[],...t?Br(t):[]]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&a?FS(l,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let h,p=c?xn(e):null;c&&m();function m(){const v=xn(e);p&&!yf(p,v)&&n(),p=v,h=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const BS=mS,zS=yS,KS=hS,US=wS,jS=gS,WS=fS,HS=vS,YS=(e,t,n)=>{const r=new Map,o={platform:NS,...n},i={...o.platform,_c:r};return dS(e,t,{...o,platform:i})};function vf(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function qS(e){if(!e)return vf();const{x:t,y:n,width:r,height:o}=e;return vf(t,n,r,o)}function GS(e,t){return{contextElement:Fe(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?qS(r):n.getBoundingClientRect()}}}var zr=e=>({variable:e,reference:`var(${e})`}),Mt={arrowSize:zr("--arrow-size"),arrowSizeHalf:zr("--arrow-size-half"),arrowBg:zr("--arrow-background"),transformOrigin:zr("--transform-origin"),arrowOffset:zr("--arrow-offset")},XS=e=>e==="top"||e==="bottom"?"y":"x";function ZS(e,t){return{name:"transformOrigin",fn(n){const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,c=i.split("-")[0],l=XS(c),u=o.arrow?.x||0,d=o.arrow?.y||0,f=t?.clientWidth||0,g=t?.clientHeight||0,h=u+f/2,p=d+g/2,m=Math.abs(o.shift?.y||0),v=s.reference.height/2,w=g/2,x=e.offset?.mainAxis??e.gutter,b=typeof x=="number"?x+w:x??w,C=m>b,E={top:`${h}px calc(100% + ${b}px)`,bottom:`${h}px ${-b}px`,left:`calc(100% + ${b}px) ${p}px`,right:`${-b}px ${p}px`}[c],T=`${h}px ${s.reference.y+v-a}px`,D=!!e.overlap&&l==="y"&&C;return r.floating.style.setProperty(Mt.transformOrigin.variable,D?T:E),{data:{transformOrigin:D?T:E}}}}}var JS={name:"rects",fn({rects:e}){return{data:e}}},QS=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Mt.arrowOffset.reference})`}),{}}}};function eE(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function tE(e){return e.split("-")[0]}var nE={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function wf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function tr(e,t){return e!=null&&Math.abs(e-t)<.5}function mi(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function rE(e,t,n){const r=e||t.createElement("div");return WS({element:r,padding:n.arrowPadding})}function oE(e,t){if(!Sx(t.offset??t.gutter))return BS(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=eE(n),a=s?void 0:t.shift,c=t.offset?.crossAxis??a;return ca({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function iE(e){if(e.flip)return KS(()=>{const t=mi(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function sE(e){if(!(!e.slide&&!e.overlap))return zS(()=>{const t=mi(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:HS()}})}function aE(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,o;return US(()=>{const i=mi(e.boundary);return{padding:e.overflowPadding,...i?{boundary:i}:void 0,apply({elements:s,rects:a,availableHeight:c,availableWidth:l}){const u=s.floating,d=Math.round(a.reference.width),f=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),tr(t,d)||(u.style.setProperty("--reference-width",`${d}px`),t=d),tr(n,f)||(u.style.setProperty("--reference-height",`${f}px`),n=f),tr(r,l)||(u.style.setProperty("--available-width",`${l}px`),r=l),tr(o,c)||(u.style.setProperty("--available-height",`${c}px`),o=c)}}})}function cE(e){if(e.hideWhenDetached)return jS(()=>({strategy:"referenceHidden",boundary:mi(e.boundary)??"clippingAncestors"}))}function lE(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var uE=["transform","visibility","pointer-events","--x","--y","--z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],dE=["top","right","bottom","left"];function bf(e,t){if(!e)return wd;const n=new Map(t.map(r=>[r,e.style.getPropertyValue(r)]));return()=>{n.forEach((r,o)=>{r?e.style.setProperty(o,r):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function xf(e){return e==null?null:Fe(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function fE(e,t,n={}){const r=()=>(typeof t=="function"?t():t)??null,o=()=>{const P=typeof e=="function"?e():e;return n.getAnchorElement?.()??P},i=()=>{const P=o();return!P&&!n.getAnchorRect?null:GS(P,n.getAnchorRect)},s=Object.assign({},nE,n);let a=[],c=null,l,u;function d(P){l?.(),u?.(),c=P,l=s.restoreStyles?bf(P,uE):void 0;const R=P.querySelector("[data-part=arrow]");u=s.restoreStyles?bf(R,dE):void 0,a=[oE(R,s),iE(s),sE(s),rE(R,P.ownerDocument,s),QS(R),ZS({gutter:s.gutter,offset:s.offset,overlap:s.overlap},R),aE(s),cE(s),JS]}const{placement:f,strategy:g,onComplete:h,onPositioned:p}=s;let m,v,w=!1,x,b,C=wd;const E=lE(s.listeners);function T(){if(!s.listeners)return;const P=o(),R=i(),O=r();if(!R||!O)return;(xf(P)!==xf(x)||O!==b)&&(C(),x=P,b=O,C=VS(R,O,S,E))}async function D(){T();const P=r();if(!P)return;P!==c&&(d(P),w=!1);const R=i();if(!R)return;const O=await YS(R,P,{placement:f,middleware:a,strategy:g});h?.(O);const V=At(P),K=wf(V,O.x),Y=wf(V,O.y);if(tr(m,K)||(P.style.setProperty("--x",`${K}px`),m=K),tr(v,Y)||(P.style.setProperty("--y",`${Y}px`),v=Y),s.hideWhenDetached&&(O.middlewareData.hide?.referenceHidden?(P.style.setProperty("visibility","hidden"),P.style.setProperty("pointer-events","none")):(P.style.removeProperty("visibility"),P.style.removeProperty("pointer-events"))),!w){const F=P.firstElementChild;F&&(P.style.setProperty("--z-index",ma(F).zIndex),w=!0)}}async function S(){n.updatePosition?(await n.updatePosition({updatePosition:D,floatingElement:r()}),p?.({placed:!0})):await D()}return S(),()=>{C(),u?.(),l?.(),p?.({placed:!1})}}function hE(e,t,n={}){const{defer:r,...o}=n,i=r?$e:a=>a(),s=[];return s.push(i(()=>{s.push(fE(e,t,o))})),()=>{s.forEach(a=>a?.())}}var gE={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function pE(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Mt.arrowSize.reference,height:Mt.arrowSize.reference,[Mt.arrowSizeHalf.variable]:`calc(${Mt.arrowSize.reference} / 2)`,[Mt.arrowOffset.variable]:`calc(${Mt.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?gE[t.split("-")[0]]:void 0,background:Mt.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function mE(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function yE(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var Sf="pointerdown.outside",Ef="focus.outside";function vE(e){for(const t of e)if(Fe(t)&&zd(t))return!0;return!1}var Pf=e=>"clientY"in e;function wE(e,t){if(!Pf(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function bE(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function kf(e,t){if(!t||!Pf(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return bE(s,a)?r||i:!1}function xE(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const c=wn(e),l=At(e),u=mE(l),d=yE(l);function f(b,C){if(!Fe(C)||!C.isConnected||ni(e,C)||wE(e,b)||a&&h1(e,C))return!1;const E=c.querySelector(`[aria-controls="${e.id}"]`);if(E){const D=wa(E);if(kf(b,D))return!1}const T=wa(e);return kf(b,T)?!1:!n?.(C)}const g=new Set,h=Yn(e?.getRootNode());let p=!1;function m(b){p=!0;const C=()=>{p=!1};c.addEventListener("pointerup",C,{once:!0}),l.addEventListener("pointerup",C,{once:!0});function E(T){const D=s&&!Ld()?$e:R=>R(),S=T??b,P=S?.composedPath?.()??[S?.target];D(()=>{const R=h?P[0]:qn(b);if(!(!e||!f(b,R))){if(o||i){const O=Ir(o,i);e.addEventListener(Sf,O,{once:!0})}Cf(e,Sf,{bubbles:!1,cancelable:!0,detail:{originalEvent:S,contextmenu:w1(S),focusable:vE(P),target:R}})}})}b.pointerType==="touch"?(g.forEach(T=>T()),g.add(ri(c,"click",E,{once:!0})),g.add(d.addEventListener("click",E,{once:!0})),g.add(u.addEventListener("click",E,{once:!0}))):E()}const v=new Set,w=setTimeout(()=>{v.add(ri(c,"pointerdown",m,!0)),v.add(d.addEventListener("pointerdown",m,!0)),v.add(u.addEventListener("pointerdown",m,!0))},0);function x(b){if(p)return;(s?$e:E=>E())(()=>{const E=b?.composedPath?.()??[b?.target],T=h?E[0]:qn(b);if(!(!e||!f(b,T))){if(r||i){const D=Ir(r,i);e.addEventListener(Ef,D,{once:!0})}Cf(e,Ef,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:zd(T),target:T}})}})}return Ld()||(v.add(ri(c,"focusin",x,!0)),v.add(d.addEventListener("focusin",x,!0)),v.add(u.addEventListener("focusin",x,!0))),()=>{clearTimeout(w),g.forEach(b=>b()),v.forEach(b=>b())}}function SE(e,t){const{defer:n}=t,r=n?$e:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(xE(i,t))})),()=>{o.forEach(i=>i?.())}}function Cf(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function EE(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return ri(wn(e),"keydown",n,{capture:!0})}var Of="layer:request-dismiss",De={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(r=>ni(r.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>ni(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(r=>{const o=r();o&&PE(o)}),this.recentlyRemoved.add(e),va(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>De.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Tf(e,t,e.node),e.styleTargets?.forEach(n=>{const r=n();if(!r||r===e.node)return;Tf(e,t,r);const{zIndex:o}=ma(e.node);r.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];CE(e,Of,o=>{r.requestDismiss?.(o),o.defaultPrevented||r?.dismiss()}),kE(e,Of,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Tf(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),De.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=De.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function PE(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.style.removeProperty("--z-index"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function kE(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function CE(e,t,n){e.addEventListener(t,n,{once:!0})}var La=new WeakMap,Kr=new WeakMap;function OE(e){return De.isBelowPointerBlockingLayer(e)?"none":"auto"}function Af(e){const t=OE(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function TE(e){if(Kr.has(e))return;const t=At(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{Kr.has(e)&&Af(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),Kr.set(e,n)}function $f(){De.layers.forEach(({node:e})=>{Af(e),TE(e)})}function AE(e){const t=Kr.get(e);t&&(t.disconnect(),Kr.delete(e)),e.style.pointerEvents=""}function $E(e,t){const n=wn(e),r=[];return De.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(La.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[i,s]=_1(()=>{const a=o();return Fe(a)?a:null},{timeout:1e3});i.then(a=>r.push(Ud(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{De.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const i=La.get(o);i!==void 0&&(o.style.pointerEvents=i,La.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),r.forEach(o=>o()))}}function DE(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Jo("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:c="dialog",layerStyleTargets:l}=t,u={dismiss:r,node:e,type:c,pointerBlocking:i,requestDismiss:o,styleTargets:l};De.add(u),$f();function d(m){const v=qn(m.detail.originalEvent);De.isBelowPointerBlockingLayer(e)||De.isInBranch(v)||(t.onPointerDownOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),r?.()))}function f(m){const v=qn(m.detail.originalEvent);De.isInBranch(v)||(t.onFocusOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),r?.()))}function g(m){De.isTopMost(e)&&(t.onEscapeKeyDown?.(m),!m.defaultPrevented&&r&&(m.preventDefault(),r()))}function h(m){if(!e)return!1;const v=typeof s=="function"?s():s,w=Array.isArray(v)?v:[v],x=t.persistentElements?.map(b=>b()).filter(Fe);return x&&w.push(...x),w.some(b=>ni(b,m))||De.isInNestedLayer(e,m)}const p=[i?$E(e,t.persistentElements):void 0,EE(e,g),SE(e,{exclude:h,onFocusOutside:f,onPointerDownOutside:d,defer:t.defer})];return()=>{De.remove(e),$f(),AE(e),p.forEach(m=>m?.())}}function RE(e,t){const{defer:n}=t,r=n?$e:i=>i(),o=[];return o.push(r(()=>{const i=ot(e)?e():e;o.push(DE(i,t))})),()=>{o.forEach(i=>i?.())}}var[QC,ME]=en({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});function Na(e,t){return e-t*Math.floor(e/t)}const Df=1721426;function yi(e,t,n,r){t=Fa(e,t);let o=t-1,i=-2;return n<=2?i=0:vi(t)&&(i=-1),Df-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function vi(e){return e%4===0&&(e%100!==0||e%400===0)}function Fa(e,t){return e==="BC"?1-t:t}function IE(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const _E={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class nr{fromJulianDay(t){let n=t,r=n-Df,o=Math.floor(r/146097),i=Na(r,146097),s=Math.floor(i/36524),a=Na(i,36524),c=Math.floor(a/1461),l=Na(a,1461),u=Math.floor(l/365),d=o*400+s*100+c*4+u+(s!==4&&u!==4?1:0),[f,g]=IE(d),h=n-yi(f,g,1,1),p=2;n<yi(f,g,3,1)?p=0:vi(g)&&(p=1);let m=Math.floor(((h+p)*12+373)/367),v=n-yi(f,g,m,1)+1;return new Ft(f,g,m,v)}toJulianDay(t){return yi(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return _E[vi(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return vi(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const LE={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function ze(e,t){return t=we(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function NE(e,t){return t=we(t,e.calendar),e=It(e),t=It(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function FE(e,t){return t=we(t,e.calendar),e=Wr(e),t=Wr(t),e.era===t.era&&e.year===t.year}function VE(e,t){return wi(e.calendar,t.calendar)&&ze(e,t)}function Ur(e,t){return wi(e.calendar,t.calendar)&&NE(e,t)}function jr(e,t){return wi(e.calendar,t.calendar)&&FE(e,t)}function wi(e,t){var n,r,o,i;return(i=(o=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function BE(e,t){return ze(e,bi(t))}const zE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Rf(e,t,n){let r=e.calendar.toJulianDay(e),o=n?zE[n]:WE(t),i=Math.ceil(r+1-o)%7;return i<0&&(i+=7),i}function Mf(e){return Lt(Date.now(),e)}function bi(e){return Sn(Mf(e))}function If(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function KE(e,t){return _f(e)-_f(t)}function _f(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Va=null,UE=!1;function Ba(){return Va==null&&(Va=new Intl.DateTimeFormat().resolvedOptions().timeZone),Va}function Lf(){return UE}function It(e){return e.subtract({days:e.day-1})}function za(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Wr(e){return It(e.subtract({months:e.month-1}))}function jE(e){return za(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function on(e,t,n){let r=Rf(e,t,n);return e.subtract({days:r})}function Nf(e,t,n){return on(e,t,n).add({days:6})}const Ff=new Map,Ka=new Map;function Vf(e){if(Intl.Locale){let n=Ff.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Ff.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function WE(e){let t=Ka.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo(),t))return Ka.set(e,t),t.firstDay}let n=Vf(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];r==="mon"?t={firstDay:1}:r==="tue"?t={firstDay:2}:r==="wed"?t={firstDay:3}:r==="thu"?t={firstDay:4}:r==="fri"?t={firstDay:5}:r==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&LE[n]||0};Ka.set(e,t)}return t.firstDay}function HE(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((Rf(It(e),t,n)+r)/7)}function Bf(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function zf(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const YE={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function qE(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Vf(t),[i,s]=YE[o]||[6,0];return r===i||r===s}function rr(e){e=we(e,new nr);let t=Fa(e.era,e.year);return Kf(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Kf(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Ua(e,t){if(t==="UTC")return 0;if(e>0&&t===Ba()&&!Lf())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=jf(e,t);return Kf(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const Uf=new Map;function jf(e,t){let n=Uf.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Uf.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const Wf=864e5;function GE(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>XE(e,t,i))}function XE(e,t,n){let r=jf(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function _t(e,t,n="compatible"){let r=Ye(e);if(t==="UTC")return rr(r);if(t===Ba()&&n==="compatible"&&!Lf()){r=we(r,new nr);let c=new Date,l=Fa(r.era,r.year);return c.setFullYear(l,r.month-1,r.day),c.setHours(r.hour,r.minute,r.second,r.millisecond),c.getTime()}let o=rr(r),i=Ua(o-Wf,t),s=Ua(o+Wf,t),a=GE(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function Hf(e,t,n="compatible"){return new Date(_t(e,t,n))}function Lt(e,t){let n=Ua(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new Yr(o<1?"BC":"AD",o<1?-o+1:o,i,s,t,n,a,c,l,u)}function Sn(e){return new Ft(e.calendar,e.era,e.year,e.month,e.day)}function Ye(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new Pi(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function we(e,t){if(wi(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,En(r),r}function Yf(e,t,n){if(e instanceof Yr)return e.timeZone===t?e:JE(e,t);let r=_t(e,t,n);return Lt(r,t)}function ZE(e){let t=rr(e)-e.offset;return new Date(t)}function JE(e,t){let n=rr(e)-e.offset;return we(Lt(n,t),e.calendar)}const Hr=36e5;function xi(e,t){let n=e.copy(),r="hour"in n?nP(n,t):0;ja(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Wa(n),qf(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,QE(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let c=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function ja(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function Wa(e){for(;e.month<1;)ja(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,ja(e,1)}function QE(e){for(;e.day<1;)e.month--,Wa(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Wa(e)}function qf(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function En(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),qf(e)}function Gf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Xf(e,t){return xi(e,Gf(t))}function Ha(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),En(n),n}function Si(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),tP(n),n}function eP(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Ei(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Ei(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Ei(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Ei(e.hour,24),t}function tP(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Ei(e,t){let n=e%t;return n<0&&(n+=t),n}function nP(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,eP(e)}function Ya(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),c=a.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=Nt(c,n,0,a.length-1,r?.round),o.era=a[c],En(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=Nt(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=Nt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=Nt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),En(o),o}function Zf(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let c=i>=12;s=c?12:0,a=c?23:11}o.hour=Nt(i,n,s,a,r?.round);break}case"minute":o.minute=Nt(e.minute,n,0,59,r?.round);break;case"second":o.second=Nt(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=Nt(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function Nt(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function Jf(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=xi(Ye(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=_t(o,e.timeZone)}else n=rr(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=Lt(n,e.timeZone);return we(r,e.calendar)}function rP(e,t){return Jf(e,Gf(t))}function oP(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let h=e.hour>=12;o=h?12:0,i=h?23:11}let s=Ye(e),a=we(Si(s,{hour:o}),new nr),c=[_t(a,e.timeZone,"earlier"),_t(a,e.timeZone,"later")].filter(h=>Lt(h,e.timeZone).day===a.day)[0],l=we(Si(s,{hour:i}),new nr),u=[_t(l,e.timeZone,"earlier"),_t(l,e.timeZone,"later")].filter(h=>Lt(h,e.timeZone).day===l.day).pop(),d=rr(e)-e.offset,f=Math.floor(d/Hr),g=d%Hr;return d=Nt(f,n,Math.floor(c/Hr),Math.floor(u/Hr),r?.round)*Hr+g,we(Lt(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Zf(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Ya(Ye(e),t,n,r),i=_t(o,e.timeZone);return we(Lt(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function iP(e,t,n){let r=Ye(e),o=Si(Ha(r,t),t);if(o.compare(r)===0)return e;let i=_t(o,e.timeZone,n);return we(Lt(i,e.timeZone),e.calendar)}function sP(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Qf(e){let t=we(e,new nr),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function eh(e){return`${Qf(e)}T${sP(e)}`}function aP(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return o!==0&&(i+=`:${String(o).padStart(2,"0")}`),i}function cP(e){return`${eh(e)}${aP(e.offset)}[${e.timeZone}]`}function qa(e){let t=typeof e[0]=="object"?e.shift():new nr,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var lP=new WeakMap;class Ft{copy(){return this.era?new Ft(this.calendar,this.era,this.year,this.month,this.day):new Ft(this.calendar,this.year,this.month,this.day)}add(t){return xi(this,t)}subtract(t){return Xf(this,t)}set(t){return Ha(this,t)}cycle(t,n,r){return Ya(this,t,n,r)}toDate(t){return Hf(this,t)}toString(){return Qf(this)}compare(t){return If(this,t)}constructor(...t){ys(this,lP,{writable:!0,value:void 0});let[n,r,o,i,s]=qa(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,En(this)}}var uP=new WeakMap;class Pi{copy(){return this.era?new Pi(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Pi(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return xi(this,t)}subtract(t){return Xf(this,t)}set(t){return Ha(Si(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Ya(this,t,n,r);default:return Zf(this,t,n,r)}}toDate(t,n){return Hf(this,t,n)}toString(){return eh(this)}compare(t){let n=If(this,t);return n===0?KE(this,Ye(t)):n}constructor(...t){ys(this,uP,{writable:!0,value:void 0});let[n,r,o,i,s]=qa(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,En(this)}}var dP=new WeakMap;class Yr{copy(){return this.era?new Yr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Yr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Jf(this,t)}subtract(t){return rP(this,t)}set(t,n){return iP(this,t,n)}cycle(t,n,r){return oP(this,t,n,r)}toDate(){return ZE(this)}toString(){return cP(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Yf(t,this.timeZone).toDate().getTime()}constructor(...t){ys(this,dP,{writable:!0,value:void 0});let[n,r,o,i,s]=qa(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,En(this)}}let Ga=new Map;class qe{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return gP()&&(this.resolvedHourCycle||(this.resolvedHourCycle=pP(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=th(t,n),this.options=n}}const fP={true:{ja:"h11"},false:{}};function th(e,t={}){if(typeof t.hour12=="boolean"&&hP()){t={...t};let o=fP[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Ga.has(n))return Ga.get(n);let r=new Intl.DateTimeFormat(e,t);return Ga.set(n,r),r}let Xa=null;function hP(){return Xa==null&&(Xa=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Xa}let Za=null;function gP(){return Za==null&&(Za=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Za}function pP(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=th(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}var[eO,mP]=en({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),yP=Object.defineProperty,vP=(e,t)=>{for(var n in t)yP(e,n,{get:t[n],enumerable:!0})},ki="__live-region__",Ja="__live-region-debug__",wP="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;";function bP(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0,debug:i=!1}=e,s=n.defaultView??window,a=r??n.body;function c(){if(!i)return;let d=n.getElementById(Ja);return d||(d=n.createElement("div"),d.id=Ja,d.dataset.liveAnnouncerDebug="true",d.setAttribute("aria-hidden","true"),d.style.cssText=wP,a.appendChild(d),d)}function l(d,f){n.getElementById(ki)?.remove(),f=f??o;const h=n.createElement("span");h.id=ki,h.dataset.liveAnnouncer="true";const p=t!=="assertive"?"status":"alert";h.setAttribute("aria-live",t),h.setAttribute("role",p),Object.assign(h.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),a.appendChild(h),s.setTimeout(()=>{if(!h.isConnected)return;h.textContent=d;const m=c();m&&(m.textContent=d)},f)}function u(){n.getElementById(ki)?.remove(),n.getElementById(Ja)?.remove()}return{announce:l,destroy:u,toJSON(){return ki}}}function xP(e,t,n,r,o){const i={};for(let a in t){const c=a,l=t[c];l!=null&&(i[c]=Math.floor(l/2),i[c]>0&&l%2===0&&i[c]--)}const s=Pn(e,t,n).subtract(i);return qr(e,s,t,n,r,o)}function Pn(e,t,n,r,o){let i=e;return t.years?i=Wr(e):t.months?i=It(e):t.weeks&&(i=on(e,n)),qr(e,i,t,n,r,o)}function Qa(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=Pn(e,t,n).subtract(i);return qr(e,s,t,n,r,o)}function qr(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=zf(t,Pn(Sn(o),n,r))),i&&e.compare(i)<=0&&(t=Bf(t,Qa(Sn(i),n,r))),t}function Ge(e,t,n){const r=Sn(e),o=t?Sn(t):void 0,i=n?Sn(n):void 0;let s=r;return o&&(s=zf(s,o)),i&&(s=Bf(s,i)),s.compare(r)===0?e:"hour"in e?e.set({year:s.year,month:s.month,day:s.day}):s}function nh(e,t,n,r,o,i){switch(t){case"start":return Pn(e,n,r,o,i);case"end":return Qa(e,n,r,o,i);case"center":default:return xP(e,n,r,o,i)}}function sn(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?ze(e,t):Ye(e).compare(Ye(t))===0}function rh(e,t,n,r,o){return e?t?.(e,n)?!0:xt(e,r,o):!1}function xt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function SP(e,t,n){const r=e.subtract({days:1});return ze(r,e)||xt(r,t,n)}function EP(e,t,n){const r=e.add({days:1});return ze(r,e)||xt(r,t,n)}function ec(e){let t={...e};for(let n in t)t[n]=1;return t}function oh(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function ih(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function sh(e,t,n){const r=n??Ye(bi(t));return new qe(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:ih(r),calendar:r.calendar.identifier,timeZone:t})}function ah(e,t,n){const r=n??bi(t);return new qe(e,{month:"long",year:"numeric",era:ih(r),calendar:r.calendar.identifier,timeZone:t})}function PP(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let l=0;l<i.length;l++){let u=i[l];if(u.source==="shared"&&u.type==="literal")s=l;else if(u.source==="endRange")break}let a="",c="";for(let l=0;l<i.length;l++)l<s?a+=i[l].value:l>s&&(c+=i[l].value);return r(a,c)}function Ci(e,t,n,r){if(!e)return"";let o=e,i=t??e,s=sh(n,r);return ze(o,i)?s.format(o.toDate(r)):PP(o,i,s,(a,c)=>`${a} – ${c}`,r)}var kP=["sun","mon","tue","wed","thu","fri","sat"];function ch(e){return e!=null?kP[e]:void 0}function lh(e,t,n){const r=ch(n);return on(e,t,r)}function uh(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=lh(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(ze(s,a))break;s=a}return i}function CP(e,t,n,r){const o=ch(r),i=n??HE(e,t,o);return[...new Array(i).keys()].map(a=>uh(a,e,t,r))}function OP(e,t){const n=new qe(e,{weekday:"long",timeZone:t}),r=new qe(e,{weekday:"short",timeZone:t}),o=new qe(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function TP(e,t,n,r){const o=lh(e,r,t),i=[...new Array(7).keys()],s=OP(r,n);return i.map(a=>s(o.add({days:a})))}function AP(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const s=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(s.toLocaleString(e,{month:t})),s.setMonth(s.getMonth()+1);return a}const r=n.calendar.getMonthsInYear(n),o=new qe(e,{month:t,calendar:n.calendar.identifier}),i=[];for(let s=1;s<=r;s++){const a=n.set({month:s});i.push(o.format(a.toDate("UTC")))}return i}function dh(e,t){const n=on(e,t,"mon"),r=n.year,o=n.set({month:1,day:4}),i=on(o,t,"mon"),s=n.calendar.toJulianDay(n),a=i.calendar.toJulianDay(i);if(s>=a)return 1+Math.floor((s-a)/7);const c=n.set({year:r-1,month:1,day:4}),l=on(c,t,"mon"),u=l.calendar.toJulianDay(l);return 1+Math.floor((s-u)/7)}function $P(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var DP=1900,RP=2099;function MP(e,t,n){const r=e.calendar,o=t?.year??we(new Ft(DP,1,1),r).year,i=n?.year??we(new Ft(RP,12,31),r).year;return{from:o,to:i}}var IP=10;function _P(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,r=parseInt(e.slice(-2),10),o=n+r;return o>t+IP?(o-100).toString():o.toString()}return e}}function or(e,t){const n=t?.strict?10:12,r=e-e%10,o=[];for(let i=0;i<n;i+=1){const s=r+i;o.push(s)}return o}function Gr(e,t){const n=bi(e??Ba());return t?we(n,t):n}function Xr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,c=oh(s,e);return xt(a,n,r)?{startDate:s,focusedDate:Ge(a,n,r),endDate:c}:a.compare(s)<0?{startDate:Qa(a,e,t,n,r),focusedDate:Ge(a,n,r),endDate:c}:a.compare(c)>0?{startDate:Pn(a,e,t,n,r),endDate:c,focusedDate:Ge(a,n,r)}:{startDate:s,endDate:c,focusedDate:Ge(a,n,r)}}}function fh(e,t,n,r,o,i){const s=Xr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:Pn(qr(e,a,n,r,o,i),n,r)})}function hh(e,t,n,r,o,i){const s=Xr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:Pn(qr(e,a,n,r,o,i),n,r)})}function LP(e,t,n,r,o,i,s){const a=Xr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(ec(r)),startDate:t});if(r.days)return fh(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function NP(e,t,n,r,o,i,s){const a=Xr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(ec(r)),startDate:t});if(r.days)return hh(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var gh=(e,t)=>e?/\d/.test(e)||t.includes(e)||e.length!==1:!0,FP=(e,t)=>e.split("").filter(n=>gh(n,t)).join(""),ph=new Map;function VP(e){let t=ph.get(e);if(t!=null)return t;const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=r?r.value:"/",ph.set(e,t),t}var mh=e=>e!=null&&e.length===4,BP=e=>e!=null&&parseFloat(e)<=12,zP=e=>e!=null&&parseFloat(e)<=31;function KP(e,t,n){const r=UP(t,n);let{year:o,month:i,day:s}=jP(r,e)??{};if(o!=null||i!=null||s!=null){const l=new Date;o||(o=l.getFullYear().toString()),i||(i=(l.getMonth()+1).toString()),s||(s=l.getDate().toString())}if(mh(o)||(o=_P(o)),mh(o)&&BP(i)&&zP(s))return new Ft(+o,+i,+s);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new Ft(l.getFullYear(),l.getMonth()+1,l.getDate())}}function UP(e,t){return new qe(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function jP(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function yh(e,t,n){const r=Sn(Mf(n));switch(e){case"thisWeek":return[on(r,t),Nf(r,t)];case"thisMonth":return[It(r),r];case"thisQuarter":return[It(r).add({months:-((r.month-1)%3)}),r];case"thisYear":return[Wr(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[It(r.add({months:-1})),za(r.add({months:-1}))];case"lastQuarter":return[It(r.add({months:-((r.month-1)%3)-3})),za(r.add({months:-((r.month-1)%3)-1}))];case"lastWeek":return[on(r,t).add({weeks:-1}),Nf(r,t).add({weeks:-1})];case"lastYear":return[Wr(r.add({years:-1})),jE(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var vh=Fr("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),ie=vh.build(),WP=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,HP=e=>e.ids?.root??`datepicker:${e.id}`,YP=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,tc=e=>e.ids?.content??`datepicker:${e.id}:content`,nc=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,qP=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,GP=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,XP=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,wh=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,bh=e=>e.ids?.control??`datepicker:${e.id}:control`,xh=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,Sh=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,Eh=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,Ph=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,kh=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,Ch=(e,t)=>R1(Ti(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),Oi=e=>e.getById(Sh(e)),Ti=e=>e.getById(tc(e)),Zr=e=>D1(Th(e),"[data-part=input]"),ZP=e=>e.getById(kh(e)),JP=e=>e.getById(Ph(e)),QP=e=>e.getById(wh(e)),Oh=e=>e.getById(Eh(e)),Th=e=>e.getById(bh(e));function rc(e){const[t,n]=e;let r;return!t||!n?r=e:r=t.compare(n)<=0?e:[n,t],r}function ir(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function Ai(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function ek(e){return _r(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var tk={day:"dd",month:"mm",year:"yyyy"};function nk(e){return new qe(e).formatToParts(new Date).map(t=>tk[t.type]??t.value).join("")}var Ah=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),rk={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return _r(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return _r(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return _r(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function Vt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function oc(e){return e===0?"day":e===1?"month":"year"}function ic(e,t,n){return oc(Rx(Vt(e,0),Vt(t,0),Vt(n,2)))}function ok(e,t){return Vt(e,0)>Vt(t,0)}function ik(e,t){return Vt(e,0)<Vt(t,0)}function sk(e,t,n){const r=Vt(e,0)+1;return ic(oc(r),t,n)}function ak(e,t,n){const r=Vt(e,0)-1;return ic(oc(r),t,n)}var ck=["day","month","year"];function lk(e){ck.forEach(t=>e(t))}var uk=zx(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale],([e],t)=>{const{startValue:n,endValue:r,locale:o,timeZone:i,selectionMode:s}=t;if(e==="year"){const d=or(n.year,{strict:!0}),f=d.at(0).toString(),g=d.at(-1).toString();return{start:f,end:g,formatted:`${f} - ${g}`}}if(e==="month"){const d=new qe(o,{year:"numeric",timeZone:i,calendar:n.calendar.identifier}),f=d.format(n.toDate(i)),g=d.format(r.toDate(i)),h=s==="range"?`${f} - ${g}`:f;return{start:f,end:g,formatted:h}}const a=new qe(o,{month:"long",year:"numeric",timeZone:i,calendar:n.calendar.identifier}),c=a.format(n.toDate(i)),l=a.format(r.toDate(i)),u=s==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:u}});function dk(e,t){const{state:n,context:r,prop:o,send:i,computed:s,scope:a}=e,c=r.get("startValue"),l=s("endValue"),u=r.get("value"),d=r.get("focusedValue"),f=r.get("hoveredValue"),g=f?rc([u[0],f]):[],h=!!o("disabled"),p=!!o("readOnly"),m=!!o("invalid"),v=s("isInteractive"),w=u.length===0,x=o("min"),b=o("max"),C=o("locale"),E=o("timeZone"),T=o("startOfWeek"),D=n.matches("focused"),S=n.matches("open"),P=o("selectionMode")==="range",R=o("selectionMode")==="multiple",O=o("isDateUnavailable"),V=o("maxSelectedDates"),K=R&&V!=null&&u.length>=V,Y=r.get("currentPlacement"),F=Y?tE(Y):void 0,W=pE({...o("positioning"),placement:Y}),X=VP(C),G={...rk,...o("translations")};function Xe($=c){const k=o("fixedWeeks")?6:void 0;return CP($,C,k,T)}function Re($={}){const{format:k}=$;return AP(C,k,d).map((A,M)=>{const le=M+1,Ze=d.set({month:le}),Ce=xt(Ze,x,b);return{label:A,value:le,disabled:Ce}})}function fc(){const $=MP(d,x,b);return $P($).map(A=>({label:A.toString(),value:A,disabled:!aa(A,x?.year,b?.year)}))}function Mi($){return rh($,O,C,x,b)}function Ii($){const k=c??Gr(E,d.calendar);i({type:"FOCUS.SET",value:k.set({month:$})})}function J($){const k=c??Gr(E,d.calendar);i({type:"FOCUS.SET",value:k.set({year:$})})}function zt($){const{value:k,disabled:A}=$,M=d.set({year:k}),Ze=!or(c.year,{strict:!0}).includes(k),Ce=aa(k,x?.year,b?.year),at=P&&ir(M,u),cn=P&&u[0]&&jr(M,u[0]),sr=P&&u[1]&&jr(M,u[1]),Cn=P&&g.length>0,ar=Cn&&ir(M,g),ln=Cn&&g[0]&&jr(M,g[0]),un=Cn&&g[1]&&jr(M,g[1]),_i={focused:d.year===$.value,selectable:!Ze&&Ce,outsideRange:Ze,selected:!!u.find(Li=>Li&&Li.year===k),valueText:k.toString(),inRange:at||ar,firstInRange:!!cn,lastInRange:!!sr,inHoveredRange:!!ar,firstInHoveredRange:!!ln,lastInHoveredRange:!!un,value:M,get disabled(){return A||!_i.selectable}};return _i}function an($){const{value:k,disabled:A}=$,M=d.set({month:k}),le=ah(C,E,d),Ze=P&&ir(M,u),Ce=P&&u[0]&&Ur(M,u[0]),at=P&&u[1]&&Ur(M,u[1]),cn=P&&g.length>0,sr=cn&&ir(M,g),Cn=cn&&g[0]&&Ur(M,g[0]),ar=cn&&g[1]&&Ur(M,g[1]),ln={focused:d.month===$.value,selectable:!xt(M,x,b),selected:!!u.find(un=>un&&un.month===k&&un.year===d.year),valueText:le.format(M.toDate(E)),inRange:Ze||sr,firstInRange:!!Ce,lastInRange:!!at,inHoveredRange:!!sr,firstInHoveredRange:!!Cn,lastInHoveredRange:!!ar,outsideRange:!1,value:M,get disabled(){return A||!ln.selectable}};return ln}function hc($){const{value:k,disabled:A,visibleRange:M=s("visibleRange")}=$,le=sh(C,E,d),Ze=ec(s("visibleDuration")),Ce=o("outsideDaySelectable"),at=M.start.add(Ze).subtract({days:1}),cn=xt(k,M.start,at),sr=P&&ir(k,u),Cn=P&&u[0]&&ze(k,u[0]),ar=P&&u[1]&&ze(k,u[1]),ln=P&&g.length>0,un=ln&&ir(k,g),_i=ln&&g[0]&&ze(k,g[0]),Li=ln&&g[1]&&ze(k,g[1]),_h=u.some(Lh=>Lh!=null&&ze(k,Lh)),Ni={invalid:xt(k,x,b),disabled:A||!Ce&&cn||xt(k,x,b)||K&&!_h,selected:_h,unavailable:rh(k,O,C,x,b)&&!A,outsideRange:cn,today:BE(k,E),weekend:qE(k,C),value:k,valueText:le.format(k.toDate(E)),get focused(){return d!=null&&ze(k,d)&&(!Ni.outsideRange||Ce)},get selectable(){return!Ni.disabled&&!Ni.unavailable},inRange:sr||un,firstInRange:Cn,lastInRange:ar,inHoveredRange:un,firstInHoveredRange:_i,lastInHoveredRange:Li};return Ni}function qC($){const{view:k="day",id:A}=$;return[k,A].filter(Boolean).join(" ")}return{focused:D,open:S,disabled:h,invalid:m,readOnly:p,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:V,isMaxSelected:K,view:r.get("view"),getRangePresetValue($){return yh($,C,E)},getWeekNumber($){const k=$[0];return k?dh(k,C):0},getDaysInWeek($,k=c){return uh($,k,C,T)},getOffset($){const k=c.add($),A=l.add($),M=ah(C,E,d);return{visibleRange:{start:k,end:A},weeks:Xe(k),visibleRangeText:{start:M.format(k.toDate(E)),end:M.format(A.toDate(E))}}},getMonthWeeks:Xe,isUnavailable:Mi,weeks:Xe(),weekDays:TP(c,T,E,C),visibleRangeText:s("visibleRangeText"),value:u,valueAsDate:u.filter($=>$!=null).map($=>$.toDate(E)),valueAsString:s("valueAsString"),focusedValue:d,focusedValueAsDate:d?.toDate(E),focusedValueAsString:o("format")(d,{locale:C,timeZone:E}),visibleRange:s("visibleRange"),selectToday(){const $=Ge(Gr(E,d.calendar),x,b);i({type:"VALUE.SET",value:[$]})},setValue($){const k=$.map(A=>Ge(A,x,b));i({type:"VALUE.SET",value:k})},setTime($,k=0){const A=Array.from(u);let M=A[k];M&&("hour"in M||(M=Ye(M)),M=M.set({hour:$.hour??("hour"in M?M.hour:0),minute:$.minute??("minute"in M?M.minute:0),second:$.second??("second"in M?M.second:0),millisecond:$.millisecond??("millisecond"in M?M.millisecond:0)}),A[k]=Ge(M,x,b),i({type:"VALUE.SET",value:A}))},clearValue($={}){const{focus:k=!0}=$;i({type:"VALUE.CLEAR",focus:k})},setFocusedValue($){i({type:"FOCUS.SET",value:$})},setOpen($){o("inline")||n.matches("open")===$||i({type:$?"OPEN":"CLOSE"})},focusMonth:Ii,focusYear:J,getYears:fc,getMonths:Re,getYearsGrid($={}){const{columns:k=1}=$,A=or(c.year,{strict:!0}).map(M=>({label:M.toString(),value:M,disabled:!aa(M,x?.year,b?.year)}));return gd(A,k)},getDecade(){const $=or(c.year,{strict:!0});return{start:$.at(0),end:$.at(-1)}},getMonthsGrid($={}){const{columns:k=1,format:A}=$;return gd(Re({format:A}),k)},format($,k={month:"long",year:"numeric"}){return new qe(C,{...k,calendar:$.calendar.identifier}).format($.toDate(E))},setView($){i({type:"VIEW.SET",view:$})},goToNext(){i({type:"GOTO.NEXT",view:r.get("view")})},goToPrev(){i({type:"GOTO.PREV",view:r.get("view")})},getRootProps(){return t.element({...ie.root.attrs,dir:o("dir"),id:HP(a),"data-state":S?"open":"closed","data-disabled":j(h),"data-readonly":j(p),"data-empty":j(w)})},getLabelProps($={}){const{index:k=0}=$;return t.label({...ie.label.attrs,id:WP(a,k),dir:o("dir"),htmlFor:xh(a,k),"data-state":S?"open":"closed","data-index":k,"data-disabled":j(h),"data-readonly":j(p)})},getControlProps(){return t.element({...ie.control.attrs,dir:o("dir"),id:bh(a),"data-disabled":j(h),"data-placeholder-shown":j(w)})},getRangeTextProps(){return t.element({...ie.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...ie.content.attrs,hidden:!S,dir:o("dir"),"data-state":S?"open":"closed","data-placement":Y,"data-side":F,"data-inline":j(o("inline")),id:tc(a),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":G.content})},getTableProps($={}){const{view:k="day",columns:A=k==="day"?7:4}=$,M=qC($);return t.element({...ie.table.attrs,role:"grid","data-columns":A,"aria-roledescription":ek(k),id:YP(a,M),"aria-readonly":Pe(p),"aria-disabled":Pe(h),"aria-multiselectable":Pe(o("selectionMode")!=="single"),"data-view":k,dir:o("dir"),tabIndex:-1,onKeyDown(le){if(le.defaultPrevented)return;const Ce={Enter(){k==="day"&&Mi(d)||k==="month"&&!an({value:d.month}).selectable||k==="year"&&!zt({value:d.year}).selectable||i({type:"TABLE.ENTER",view:k,columns:A,focus:!0})},ArrowLeft(){i({type:"TABLE.ARROW_LEFT",view:k,columns:A,focus:!0})},ArrowRight(){i({type:"TABLE.ARROW_RIGHT",view:k,columns:A,focus:!0})},ArrowUp(){i({type:"TABLE.ARROW_UP",view:k,columns:A,focus:!0})},ArrowDown(){i({type:"TABLE.ARROW_DOWN",view:k,columns:A,focus:!0})},PageUp(at){i({type:"TABLE.PAGE_UP",larger:at.shiftKey,view:k,columns:A,focus:!0})},PageDown(at){i({type:"TABLE.PAGE_DOWN",larger:at.shiftKey,view:k,columns:A,focus:!0})},Home(){i({type:"TABLE.HOME",view:k,columns:A,focus:!0})},End(){i({type:"TABLE.END",view:k,columns:A,focus:!0})}}[x1(le,{dir:o("dir")})];Ce&&(Ce(le),le.preventDefault(),le.stopPropagation())},onPointerLeave(){i({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){i({type:"TABLE.POINTER_DOWN",view:k})},onPointerUp(){i({type:"TABLE.POINTER_UP",view:k})}})},getTableHeadProps($={}){const{view:k="day"}=$;return t.element({...ie.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":k,"data-disabled":j(h)})},getTableHeaderProps($={}){const{view:k="day"}=$;return t.element({...ie.tableHeader.attrs,dir:o("dir"),"data-view":k,"data-disabled":j(h)})},getTableBodyProps($={}){const{view:k="day"}=$;return t.element({...ie.tableBody.attrs,"data-view":k,"data-disabled":j(h)})},getTableRowProps($={}){const{view:k="day"}=$;return t.element({...ie.tableRow.attrs,"aria-disabled":Pe(h),"data-disabled":j(h),"data-view":k})},getWeekNumberHeaderCellProps($={}){const{view:k="day"}=$;return t.element({...ie.tableCell.attrs,scope:"col","aria-label":G.weekColumnHeader,"data-view":k,"data-type":"week-number","data-disabled":j(h)})},getWeekNumberCellProps($){const{weekIndex:k,week:A}=$,M=A[0]?dh(A[0],C):0;return t.element({...ie.tableCell.attrs,role:"rowheader","aria-label":G.weekNumberCell?.(M),"data-view":"day","data-week-index":k,"data-type":"week-number","data-disabled":j(h)})},getDayTableCellState:hc,getDayTableCellProps($){const{value:k}=$,A=hc($);return t.element({...ie.tableCell.attrs,role:"gridcell","aria-disabled":Pe(!A.selectable),"aria-selected":A.selected||A.inRange,"aria-invalid":Pe(A.invalid),"aria-current":A.today?"date":void 0,"data-value":k.toString()})},getDayTableCellTriggerProps($){const{value:k}=$,A=hc($);return t.element({...ie.tableCellTrigger.attrs,id:nc(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":G.dayCell(A),"aria-disabled":Pe(!A.selectable),"aria-invalid":Pe(A.invalid),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k.toString(),"data-view":"day","data-today":j(A.today),"data-focus":j(A.focused),"data-unavailable":j(A.unavailable),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-outside-range":j(A.outsideRange),"data-weekend":j(A.weekend),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"day",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const le=!a.isActiveElement(M.currentTarget);f&&VE(k,f)||i({type:"CELL.POINTER_MOVE",cell:"day",value:k,focus:le,outsideRange:A.outsideRange})}:void 0})},getMonthTableCellState:an,getMonthTableCellProps($){const{value:k,columns:A}=$,M=an($);return t.element({...ie.tableCell.attrs,dir:o("dir"),colSpan:A,role:"gridcell","aria-selected":Pe(M.selected||M.inRange),"data-selected":j(M.selected),"aria-disabled":Pe(!M.selectable),"data-value":k})},getMonthTableCellTriggerProps($){const{value:k}=$,A=an($);return t.element({...ie.tableCellTrigger.attrs,id:nc(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":A.valueText,"aria-disabled":Pe(!A.selectable),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k,"data-view":"month","data-focus":j(A.focused),"data-outside-range":j(A.outsideRange),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"month",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const le=!a.isActiveElement(M.currentTarget);f&&A.value&&Ur(A.value,f)||i({type:"CELL.POINTER_MOVE",cell:"month",value:A.value,focus:le})}:void 0})},getYearTableCellState:zt,getYearTableCellProps($){const{value:k,columns:A}=$,M=zt($);return t.element({...ie.tableCell.attrs,dir:o("dir"),colSpan:A,role:"gridcell","aria-selected":Pe(M.selected||M.inRange),"data-selected":j(M.selected),"aria-disabled":Pe(!M.selectable),"data-value":k})},getYearTableCellTriggerProps($){const{value:k}=$,A=zt($);return t.element({...ie.tableCellTrigger.attrs,id:nc(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":A.valueText,"aria-disabled":Pe(!A.selectable),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k,"data-view":"year","data-focus":j(A.focused),"data-outside-range":j(A.outsideRange),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"year",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const le=!a.isActiveElement(M.currentTarget);f&&A.value&&jr(A.value,f)||i({type:"CELL.POINTER_MOVE",cell:"year",value:A.value,focus:le})}:void 0})},getNextTriggerProps($={}){const{view:k="day"}=$,A=h||!s("isNextVisibleRangeValid");return t.button({...ie.nextTrigger.attrs,dir:o("dir"),id:GP(a,k),type:"button","aria-label":G.nextTrigger(k),disabled:A,"data-disabled":j(A),onClick(M){M.defaultPrevented||i({type:"GOTO.NEXT",view:k})}})},getPrevTriggerProps($={}){const{view:k="day"}=$,A=h||!s("isPrevVisibleRangeValid");return t.button({...ie.prevTrigger.attrs,dir:o("dir"),id:qP(a,k),type:"button","aria-label":G.prevTrigger(k),disabled:A,"data-disabled":j(A),onClick(M){M.defaultPrevented||i({type:"GOTO.PREV",view:k})}})},getClearTriggerProps(){return t.button({...ie.clearTrigger.attrs,id:wh(a),dir:o("dir"),type:"button","aria-label":G.clearTrigger,hidden:!u.length,onClick($){$.defaultPrevented||i({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ie.trigger.attrs,id:Sh(a),dir:o("dir"),type:"button","data-placement":Y,"data-side":F,"aria-label":G.trigger(S),"aria-controls":tc(a),"aria-expanded":S,"data-state":S?"open":"closed","data-placeholder-shown":j(w),"aria-haspopup":"grid",disabled:h,onClick($){$.defaultPrevented||v&&i({type:"TRIGGER.CLICK"})}})},getViewProps($={}){const{view:k="day"}=$;return t.element({...ie.view.attrs,"data-view":k,hidden:r.get("view")!==k})},getViewTriggerProps($={}){const{view:k="day"}=$;return t.button({...ie.viewTrigger.attrs,"data-view":k,dir:o("dir"),id:XP(a,k),type:"button",disabled:h,"aria-label":G.viewTrigger(k),onClick(A){A.defaultPrevented||v&&i({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps($={}){const{view:k="day"}=$;return t.element({...ie.viewControl.attrs,"data-view":k,dir:o("dir")})},getInputProps($={}){const{index:k=0,fixOnBlur:A=!0}=$;return t.input({...ie.input.attrs,id:xh(a,k),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":k,"data-state":S?"open":"closed","data-placeholder-shown":j(w),readOnly:p,disabled:h,required:o("required"),"aria-invalid":Pe(m),"data-invalid":j(m),placeholder:o("placeholder")||nk(C),defaultValue:s("valueAsString")[k],onBeforeInput(M){const{data:le}=Bd(M);gh(le,X)||M.preventDefault()},onClick(M){M.defaultPrevented||o("openOnClick")&&v&&i({type:"OPEN",src:"input.click"})},onFocus(){i({type:"INPUT.FOCUS",index:k})},onBlur(M){const le=M.currentTarget.value.trim();i({type:"INPUT.BLUR",value:le,index:k,fixOnBlur:A})},onKeyDown(M){if(M.defaultPrevented||!v)return;const Ze={Enter(Ce){v1(Ce)||Mi(d)||Ce.currentTarget.value.trim()!==""&&i({type:"INPUT.ENTER",value:Ce.currentTarget.value,index:k})}}[M.key];Ze&&(Ze(M),M.preventDefault())},onInput(M){const le=M.currentTarget.value;i({type:"INPUT.CHANGE",value:FP(le,X),index:k})}})},getMonthSelectProps(){return t.select({...ie.monthSelect.attrs,id:Ph(a),"aria-label":G.monthSelect,disabled:h,dir:o("dir"),defaultValue:c.month,onChange($){Ii(Number($.currentTarget.value))}})},getYearSelectProps(){return t.select({...ie.yearSelect.attrs,id:kh(a),disabled:h,"aria-label":G.yearSelect,dir:o("dir"),defaultValue:c.year,onChange($){J(Number($.currentTarget.value))}})},getPositionerProps(){return t.element({id:Eh(a),...ie.positioner.attrs,dir:o("dir"),style:W.floating})},getPresetTriggerProps($){const k=Array.isArray($.value)?$.value:yh($.value,C,E),A=k.filter(M=>M!=null).map(M=>M.toDate(E).toDateString());return t.button({...ie.presetTrigger.attrs,"aria-label":G.presetTrigger(A),type:"button",onClick(M){M.defaultPrevented||i({type:"PRESET.CLICK",value:k})}})}}}var{and:ke}=Zx();function fk(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if(!sn(e[r],t[r]))return!1;return!0}function $i(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var hk=$d({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1;let i;if(e.createCalendar){const h=new Intl.DateTimeFormat(t).resolvedOptions().calendar;h!=="gregory"&&h!=="iso8601"&&(i=e.createCalendar(h))}const s=g=>!i||g.calendar.identifier===i.identifier?g:we(g,i),a=e.defaultValue?Ai(e.defaultValue).map(g=>Ge(s(g),e.min,e.max)):void 0,c=e.value?Ai(e.value).map(g=>Ge(s(g),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||Gr(n,i);l=Ge(s(l),e.min,e.max);const u="day",d="year",f=ic(e.view||u,u,d);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:r,defaultView:f,minView:u,maxView:d,outsideDaySelectable:!1,closeOnSelect:!0,format(g,{locale:h,timeZone:p}){return new qe(h,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric",calendar:i?.identifier}).format(g.toDate(p))},parse(g,{locale:h,timeZone:p}){return KP(g,h,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")||e("inline")?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:sn,hash:r=>r.toString(),sync:!0,onChange(r){const o=n(),i=o.get("view"),s=o.get("value"),a=$i(s,e);e("onFocusChange")?.({value:s,valueAsString:a,view:i,focusedValue:r})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:fk,hash:r=>r.map(o=>o?.toString()??"").join(","),onChange(r){const o=n(),i=$i(r,e);e("onValueChange")?.({value:r,valueAsString:i,view:o.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:sn})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(r){e("onViewChange")?.({view:r})}})),startValue:t(()=>{const r=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:nh(r,"start",{months:e("numOfMonths")},e("locale")),isEqual:sn,hash:o=>o.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>oh(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>uk({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!SP(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!EP(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>$i(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:r,computed:o}){e([()=>t("locale")],()=>{r(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{r(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{r(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{r(["syncInputValue"])}),e([()=>n.hash("value")],()=>{r(["syncInputElement"])}),e([()=>o("valueAsString").toString()],()=>{r(["announceValueText"])}),e([()=>n.get("view")],()=>{r(["focusActiveCell"])}),e([()=>t("open")],()=>{r(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:ke("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:ke("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:ke("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:ke("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:ke("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:ke("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>ok(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:({context:e,prop:t,event:n})=>{const r=t("maxSelectedDates");if(r==null)return!0;const o=e.get("value"),i=n.value??e.get("focusedValue");return o.some(a=>sn(a,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const r=Th(n);return hE(r,()=>Oh(n),{...t("positioning"),defer:!0,onComplete(i){e.set("currentPlacement",i.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",bP({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:r}){return r("inline")?void 0:RE(()=>Ti(e),{type:"popover",defer:!0,layerStyleTargets:[()=>Oh(e)],exclude:[...Zr(e),Oi(e),QP(e)],onInteractOutside(i){n.set("restoreFocus",!i.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(i){i.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setNextView({context:e,prop:t}){const n=sk(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=ak(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const r=e.get("value"),o=t("locale"),i=t("timeZone");let s;if(t("selectionMode")==="range"){const[a,c]=r;a&&c?s=Ci(a,c,o,i):a?s=Ci(a,null,o,i):c?s=Ci(c,null,o,i):s=""}else s=r.map(a=>Ci(a,null,o,i)).filter(Boolean).join(",");n.get("announcer")?.announce(s,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){$1({target:Ti(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Kd({doc:e.getDoc(),target:Ti(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&fe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){$e(()=>{Zr(e).forEach((r,o)=>{oi(r,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;fe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;fe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const r=t.value.map(o=>Ge(o,n("min"),n("max")));e.set("value",r)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,r=Array.from(t.get("value")),o=t.get("activeIndex"),i=r[o],s=Di(e,n.value??t.get("focusedValue"));r[o]=sc(i,s),t.set("value",rc(r))},resetSelection(e){const{context:t,event:n}=e,r=t.get("value")[0],o=Di(e,n.value??t.get("focusedValue"));t.set("value",[sc(r,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,r=Di(e,n.value??t.get("focusedValue")),o=t.get("value"),i=o.findIndex(s=>sn(s,r));if(i===-1){const s=[...o,r];t.set("value",Ai(s))}else{const s=Array.from(o);s.splice(i,1),t.set("value",Ai(s))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),r=e.get("activeIndex"),o=n[r],i=e.get("focusedValue").copy();n[r]=sc(o,i),e.set("value",rc(n));const s=t("valueAsString");e.set("inputValue",s[r])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});fe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});fe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});fe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});fe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:r}=e,o=fh(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Ri(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:r}=e,o=hh(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Ri(e,o)},focusSectionStart(e){const{context:t}=e;fe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;fe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=LP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Ri(e,i)},focusPreviousSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=NP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Ri(e,i)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});fe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});fe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});fe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});fe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,r=t.get("focusedValue").calendar;fe(e,Gr(n("timeZone"),r))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({months:n.columns});fe(e,r)},focusNextMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({months:n.columns});fe(e,r)},focusPreviousYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({years:n.columns});fe(e,r)},focusNextYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({years:n.columns});fe(e,r)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMinimumMonthInYear?.(n)??1;fe(e,n.set({month:r}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMonthsInYear(n);fe(e,n.set({month:r}))},focusFirstYear(e){const{context:t}=e,n=or(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[0]});fe(e,r)},focusLastYear(e){const{context:t}=e,n=or(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[n.length-1]});fe(e,r)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&$e(()=>{const r=t.get("view");Ch(e,r)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&$e(()=>{const r=t.get("view");Ch(e,r)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!t.type.startsWith("TABLE.ARROW")||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},focusTriggerElement({scope:e}){$e(()=>{Oi(e)?.focus({preventScroll:!0})})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&$e(()=>{const[n]=Zr(e);(n??Oi(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){$e(()=>{const t=Zr(e);if(t.length===0){Oi(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(i=>i.value!==""),r=Math.max(n,0),o=t[r];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=JP(e);oi(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=ZP(e);oi(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const r=Zr(e),o=n.index??t.get("activeIndex");oi(r[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!Ah(o)||fe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!Ah(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Ge(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const s=$i(i,n);e.set("inputValue",s[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const r=e.get("focusedValue");if(!xt(r,e.get("startValue"),t("endValue")))return;const i=nh(r,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),Di=(e,t)=>{const{context:n,prop:r}=e,o=n.get("view");let i=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return lk(s=>{ik(s,r("minView"))&&(i=i.set({[s]:s==="day"?1:0}))}),i},sc=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let r=t;return"hour"in t||(n?r=Yf(Ye(t),e.timeZone):r=Ye(t)),r.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function fe(e,t){const{context:n,prop:r,computed:o}=e;if(!t)return;const i=Di(e,t);if(sn(n.get("focusedValue"),i))return;const a=Xr(o("visibleDuration"),r("locale"),r("min"),r("max"))({focusedDate:i,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Ri(e,t){const{context:n}=e;n.set("startValue",t.startDate);const r=n.get("focusedValue");sn(r,t.focusedDate)||n.set("focusedValue",t.focusedDate)}var $h=vh.extendWith("view","valueText"),[Dh,ae]=en({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),gk=e=>{const t=ae(),n=te(()=>t().getClearTriggerProps(),e);return y(oe.button,n)},pk=e=>{const t=ae(),n=Zd(),r=te(()=>t().getContentProps(),()=>n().presenceProps,e);return y(Z,{get when(){return!n().unmounted},get children(){return y(oe.div,B(r,{ref(o){var i=Z1(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},mk=e=>e.children(ae()),yk=e=>{const t=ae(),n=te(()=>t().getControlProps(),e);return y(oe.div,n)},vk=e=>{const[t,n]=yt()(e,["index","fixOnBlur"]),r=ae(),o=te(()=>r().getInputProps(t),n);return y(oe.input,o)},wk=e=>{const t=ae(),n=te(()=>t().getLabelProps(),e);return y(oe.label,n)},bk=e=>{const t=ae(),n=te(()=>t().getMonthSelectProps(),e);return y(oe.select,B(n,{get children(){return y(Fc,{get each(){return t().getMonths()},children:r=>y(oe.option,{get value(){return r().value},get children(){return r().label}})})}}))},[xk,kn]=en({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),Sk=e=>{const t=ae(),n=kn(),r=te(()=>t().getNextTriggerProps(n),e);return y(oe.button,r)},Ek=e=>{const t=ae(),n=Zd(),r=te(()=>t().getPositionerProps(),e);return y(Z,{get when(){return!n().unmounted},get children(){return y(oe.div,r)}})},Pk=e=>{const[t,n]=yt()(e,["value"]),r=ae(),o=te(()=>r().getPresetTriggerProps(t),n);return y(oe.button,o)},kk=e=>{const t=ae(),n=kn(),r=te(()=>t().getPrevTriggerProps(n),e);return y(oe.button,r)},Ck=e=>{const t=ae(),n=te(()=>t().getRangeTextProps(),e),r=_(()=>{const{start:o,end:i}=t().visibleRangeText;return yx([o,i]).filter(Boolean).join(" - ")});return y(oe.div,B(n,{get children(){return r()}}))},Ok=e=>{const t=ae(),n=()=>t().value.length>0;return y(Z,{get when(){return typeof e.children=="function"},get fallback(){return y(oe.span,B(()=>$h.build().valueText.attrs,e,{get children(){return Yt(()=>!!n())()?t().valueAsString.join(e.separator??", "):e.placeholder}}))},get children(){return y(Z,{get when(){return n()},get fallback(){return e.placeholder},get children(){return y(Ht,{get each(){return t().value},children:(r,o)=>Yt(()=>e.children({value:r,index:o(),valueAsString:t().valueAsString[o()],remove:()=>{t().setValue(t().value.filter((i,s)=>s!==o()))}}))})}})}})},Tk=e=>{const t=Ke(),n=mP(),r=ME(),o=_(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...Sd(e)})),i=jd(hk,o);return _(()=>dk(i,j1))},Ak=e=>{const[t,n]=Gd(e),[r,o]=yt()(n,["closeOnSelect","createCalendar","defaultFocusedValue","defaultOpen","defaultValue","defaultView","disabled","fixedWeeks","focusedValue","format","id","ids","inline","invalid","isDateUnavailable","locale","max","maxSelectedDates","maxView","min","minView","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","onVisibleRangeChange","open","openOnClick","outsideDaySelectable","parse","placeholder","positioning","readOnly","required","selectionMode","showWeekNumbers","startOfWeek","timeZone","translations","value","view"]),i=Tk(r),s=Yd(te(t,()=>({present:i().open}))),a=te(()=>i().getRootProps(),o);return y(Dh,{value:i,get children(){return y(Xd,{value:s,get children(){return y(oe.div,a)}})}})},$k=e=>{const[t,n]=Gd(e),[{value:r},o]=yt()(n,["value"]),i=Yd(te(t,()=>({present:r().open}))),s=te(()=>r().getRootProps(),o);return y(Dh,{value:r,get children(){return y(Xd,{value:i,get children(){return y(oe.div,s)}})}})},[Dk,Jr]=en({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),Rk=e=>{const[t,n]=yt()(e,["columns"]),r=ae(),o=kn(),i=Ke(),s=te(()=>({columns:t.columns,id:i}),o),a=te(()=>r().getTableProps(s),n);return y(Dk,{value:s,get children(){return y(oe.table,a)}})},Mk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableBodyProps(n),e);return y(oe.tbody,r)},[Ik,_k]=en({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),Lk=e=>{const[t,n]=yt()(e,["disabled","value","visibleRange","columns"]),r=ae(),o=kn(),i=_(()=>{const c={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return c(t)}),s=te(i,n);return y(Ik,{value:t,get children(){return y(oe.td,s)}})},Nk=e=>{const t=ae(),n=_k(),r=kn(),o=_(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=te(o,e);return y(oe.div,i)},Fk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableHeadProps(n),e);return y(oe.thead,r)},Vk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableHeaderProps(n),e);return y(oe.th,r)},Bk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableRowProps(n),e);return y(oe.tr,r)},zk=e=>{const t=ae(),n=te(()=>t().getTriggerProps(),e);return y(oe.button,n)},Kk=e=>{const[t,n]=yt()(e,["view"]),r=ae(),o=te(()=>$h.build().view.attrs,n);return y(xk,{value:t,get children(){return y(oe.div,B(o,{get hidden(){return r().view!==t.view}}))}})},Uk=e=>{const t=ae(),n=kn(),r=te(()=>t().getViewControlProps(n),e);return y(oe.div,r)},jk=e=>{const t=ae(),n=kn(),r=te(()=>t().getViewTriggerProps(n),e);return y(oe.button,r)},Wk=yt(),Hk=e=>{const[t,n]=Wk(e,["weekIndex","week"]),r=ae(),o=te(()=>r().getWeekNumberCellProps(t),n);return y(oe.td,o)},Yk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getWeekNumberHeaderCellProps(n),e);return y(oe.th,r)},qk=e=>{const t=ae(),n=te(()=>t().getYearSelectProps(),e);return y(oe.select,B(n,{get children(){return y(Fc,{get each(){return t().getYears()},children:r=>y(oe.option,{get value(){return r().value},get children(){return r().label}})})}}))},Bt={};vP(Bt,{ClearTrigger:()=>gk,Content:()=>pk,Context:()=>mk,Control:()=>yk,Input:()=>vk,Label:()=>wk,MonthSelect:()=>bk,NextTrigger:()=>Sk,Positioner:()=>Ek,PresetTrigger:()=>Pk,PrevTrigger:()=>kk,RangeText:()=>Ck,Root:()=>Ak,RootProvider:()=>$k,Table:()=>Rk,TableBody:()=>Mk,TableCell:()=>Lk,TableCellTrigger:()=>Nk,TableHead:()=>Fk,TableHeader:()=>Vk,TableRow:()=>Bk,Trigger:()=>zk,ValueText:()=>Ok,View:()=>Kk,ViewControl:()=>Uk,ViewTrigger:()=>jk,WeekNumberCell:()=>Hk,WeekNumberHeaderCell:()=>Yk,YearSelect:()=>qk}),Bt.Label,Bt.TableHead,Bt.TableBody,Bt.ClearTrigger,Bt.YearSelect,Bt.MonthSelect,Bt.Context,Bt.RootProvider;var Gk=U("<div>Unknown bot message type");const Xk=e=>y(Sb,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(sa,{get text(){return e.text}}):e.type==="buttons"?y(Cb,B(()=>e.buttons)):e.type==="list"?y(ix,B(()=>e.list)):e.type==="media"?y(hd,B(()=>e.media)):e.type==="link"?y(Db,B(()=>e.link)):e.type==="cards"?y(Ab,B(()=>e.cards)):e.type==="date"?y(sa,{get text(){return e.text}}):Gk()}});var Zk=U('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Jk=e=>(()=>{var t=Zk(),n=t.firstChild;return N(n,()=>e.text?.trim()),t})();var Qk=U('<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 eC=({children:e,createdAt:t})=>(()=>{var n=Qk(),r=n.firstChild;return N(r,e),N(n,y(Zu,{createdAt:t,anchor:"end"}),null),n})();var tC=U("<div>Unknown user message type");const nC=e=>y(eC,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(sa,{get text(){return e.text}}):e.type==="media"?y(hd,B(()=>e.media)):tC()}});var rC=U("<div>Unknown message origin");const oC=e=>e.origin==="bot"?y(Xk,e):e.origin==="user"?y(nC,e):e.origin==="service"?y(Jk,e):rC();function Rh(e){return Ee({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function ac(e){return Ee({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 iC=U('<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">'),sC=U("<div>");const cc=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o,maybeAutostart:i}=Qt(),{onOpen:s}=Xc(),a=(c=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},c)};return ye("reset",()=>{r()}),Wt(()=>{o(),a(200),i()}),n(a),s(()=>a(200)),(()=>{var c=iC(),l=e;return typeof l=="function"?pr(l,c):e=c,N(c,y(Ht,{get each(){return t()},get fallback(){return(()=>{var u=sC();return N(u,()=>Oe("emptyMessages")),u})()},children:u=>y(oC,u)})),c})()};function Mh(e){return Ee({a:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"},c:'<path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/>'},e)}var aC=U("<textarea>");const cC=e=>{const[,t]=ee(e,["class"]);return(()=>{var n=aC();return fn(n,B({get class(){return jt("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 lC=U('<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 uC=e=>(()=>{var t=lC();return fn(t,e,!0,!0),t})();var dC=U('<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 fC=()=>(()=>{var e=dC(),t=e.firstChild;return N(e,y(uC,{height:15}),t),e})();var hC=U('<div class="flex items-center justify-between gap-2 rounded-md bg-destructive/10 text-destructive text-xs px-2 py-1.5"><span></span><button type=button aria-label=Dismiss class=shrink-0>'),gC=U('<div class="flex gap-2 flex-wrap">'),pC=U('<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"><input type=file multiple class=hidden></div><div class="flex justify-center opacity-70 scale-95">'),mC=U('<img class="w-full h-full object-cover">'),yC=U('<div class="absolute inset-0 bg-black/50 flex items-center justify-center"><span class="text-white text-xs font-medium">%'),vC=U('<button type=button class="absolute inset-0 bg-destructive/70 flex items-center justify-center text-white text-[10px] leading-tight px-1 text-center">'),wC=U('<button type=button class="absolute top-0.5 right-0.5 bg-black/60 text-white rounded-full p-0.5"aria-label=Remove>'),bC=U('<div class="relative w-16 h-16 rounded-md overflow-hidden border border-gray-200 bg-gray-50 flex items-center justify-center shrink-0">');const lc=()=>{const{pushMessage:e,pushMedia:t}=Qt(),{chatWidget:n}=he(),{attachments:r,addFiles:o,updateAttachment:i,removeAttachment:s,lastRejection:a,clearRejection:c}=Dr(),[l,u]=L(""),[d,f]=L(!1);let g,h;const p=()=>g?.click(),m=2,v=()=>{const S=h;if(!S)return;const P=getComputedStyle(S),R=parseFloat(P.lineHeight)||20,O=parseFloat(P.paddingTop)+parseFloat(P.paddingBottom)+parseFloat(P.borderTopWidth)+parseFloat(P.borderBottomWidth),V=R*m+O;S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,V)}px`,S.style.overflowY=S.scrollHeight>V?"auto":"hidden"};z(()=>{l(),v()});const w=S=>{c();const P=Array.from(S.currentTarget.files??[]);P.length&&o(P),S.currentTarget.value=""},x=()=>{const S=a();return S?S.reason==="size"?Oe("fileTooLarge"):Oe("fileTypeNotAllowed"):""},b=async S=>{const P=n()?._id??"";i(S.id,{status:"uploading",progress:0,error:void 0});const R=await qw(P,S.file,O=>i(S.id,{progress:O}));return i(S.id,{status:"uploaded",progress:1}),R},C=async()=>{if(d())return;const S=l().trim(),P=[...r];if(P.length===0){if(!S)return;e(S),u("");return}f(!0),u("");let R=!1;for(const O of P)try{const V=await b(O),K=R?"":S;R=!0,t(V,K),s(O.id)}catch(V){console.error(V),i(O.id,{status:"failed",error:String(V)})}f(!1)},E=async S=>{if(!(d()||S.status==="uploading"))try{const P=await b(S);t(P,""),s(S.id)}catch(P){console.error(P),i(S.id,{status:"failed",error:String(P)})}},T=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),C())};ye("setInput",S=>{S&&u(S)});const D=()=>!d()&&(l().trim().length>0||r.length>0);return(()=>{var S=pC(),P=S.firstChild,R=P.firstChild,O=R.firstChild,V=R.nextSibling;N(P,y(Z,{get when(){return a()},get children(){var Y=hC(),F=Y.firstChild,W=F.nextSibling;return N(F,x),lo(W,"click",c,!0),N(W,y(Rh,{size:14})),Y}}),R),N(P,y(Z,{get when(){return r.length>0},get children(){var Y=gC();return N(Y,y(Ht,{each:r,children:F=>y(xC,{att:F,onRemove:()=>s(F.id),onRetry:()=>E(F)})})),Y}}),R),N(R,y(Ue,{variant:"outline",class:"h-9 w-9 p-0 shrink-0 flex items-center justify-center text-gray-400",get"aria-label"(){return Oe("attachFile")},get title(){return Oe("attachFile")},type:"button",onClick:p,get children(){return y(Mh,{size:18})}}),O),O.addEventListener("change",w);var K=g;return typeof K=="function"?pr(K,O):g=O,me(O,"accept",Kw),N(R,y(cC,{ref(Y){var F=h;typeof F=="function"?F(Y):h=Y},id:"chat-input",rows:1,get placeholder(){return Oe("inputPlaceholder")},get value(){return l()},onInput:Y=>u(Y.currentTarget.value),onKeyDown:T,class:"focus-visible:ring-primary min-h-[36px] py-2 leading-tight resize-none overflow-y-hidden"}),null),N(R,y(Ue,{variant:"outline",class:"h-9 w-9 p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",get disabled(){return!D()},onClick:C,get children(){return y(Z,{get when(){return!d()},get fallback(){return y(ll,{size:18,class:"animate-spin"})},get children(){return y(Kp,{size:18})}})}}),null),N(V,y(fC,{})),S})()},xC=e=>{const t=()=>Vo(e.att.file.type)==="image";return(()=>{var n=bC();return N(n,y(Z,{get when(){return t()},get fallback(){return y(Fv,{class:"size-7 text-gray-400"})},get children(){var r=mC();return pe(o=>{var i=e.att.previewUrl,s=e.att.file.name;return i!==o.e&&me(r,"src",o.e=i),s!==o.t&&me(r,"alt",o.t=s),o},{e:void 0,t:void 0}),r}}),null),N(n,y(Z,{get when(){return e.att.status==="uploading"},get children(){var r=yC(),o=r.firstChild,i=o.firstChild;return N(o,()=>Math.round(e.att.progress*100),i),r}}),null),N(n,y(Z,{get when(){return e.att.status==="failed"},get children(){var r=vC();return lo(r,"click",e.onRetry,!0),N(r,()=>Oe("uploadFailed")),pe(o=>{var i=Oe("uploadFailed"),s=Oe("uploadFailed");return i!==o.e&&me(r,"aria-label",o.e=i),s!==o.t&&me(r,"title",o.t=s),o},{e:void 0,t:void 0}),r}}),null),N(n,y(Z,{get when(){return e.att.status==="pending"||e.att.status==="failed"},get children(){var r=wC();return lo(r,"click",e.onRemove,!0),N(r,y(Rh,{size:12})),r}}),null),pe(()=>me(n,"title",e.att.file.name)),n})()};zc(["click"]);var SC=U('<div class="absolute inset-0 z-40 flex items-center justify-center bg-background/85 backdrop-blur-sm pointer-events-none"><div class="m-3 flex flex-1 flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-primary p-6 text-primary"><span class=font-medium>'),EC=U("<div>");const uc=e=>{const[t,n]=L(!1);let r=0;const o=i=>Array.from(i.dataTransfer?.types??[]).includes("Files");return Wt(()=>{let i=null;try{i=dr()}catch{i=null}if(!i)return;const s=i,a=f=>{o(f)&&f.preventDefault()};document.addEventListener("dragover",a),document.addEventListener("drop",a),H(()=>{document.removeEventListener("dragover",a),document.removeEventListener("drop",a)}),getComputedStyle(s).position==="static"&&(s.style.position="relative");const c=f=>{o(f)&&(f.preventDefault(),r+=1,n(!0))},l=f=>{o(f)&&f.preventDefault()},u=()=>{r=Math.max(0,r-1),r===0&&n(!1)},d=f=>{if(!o(f))return;f.preventDefault(),r=0,n(!1);const g=Array.from(f.dataTransfer?.files??[]);g.length&&e.onFiles(g)};s.addEventListener("dragenter",c),s.addEventListener("dragover",l),s.addEventListener("dragleave",u),s.addEventListener("drop",d),H(()=>{s.removeEventListener("dragenter",c),s.removeEventListener("dragover",l),s.removeEventListener("dragleave",u),s.removeEventListener("drop",d)})}),(()=>{var i=EC();return i.style.setProperty("display","contents"),N(i,y(Z,{get when(){return t()},get children(){var s=SC(),a=s.firstChild,c=a.firstChild;return N(a,y(Mh,{class:"size-8"}),c),N(c,()=>Oe("dropToUpload")),s}})),i})()};var PC=U('<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">'),kC=U("<span class=sr-only>Close"),CC=U('<div><div class="flex justify-center gap-3 items-center">'),OC=U("<span class=sr-only>Open"),TC=U("<span class=font-bold>"),AC=U("<span>"),$C=U('<div class="animate-pulse flex p-1">');const DC=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Xc(),{chatWidget:s}=he(),[a,c]=L(!0),[l,u]=L("");setTimeout(()=>c(!1),2e3),s()?.openDelay&&!s()?.hideWidget&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const d=()=>(s()?.style.margin??5)*4,f=()=>s()?.style.position==="left"?{left:`${d()}px`}:{right:`${d()}px`};return ye("open",()=>{o()}),ye("close",()=>{i()}),ye("toggle",()=>{r()}),ye("onAnswer",g=>{g.text&&u(g.text),o()}),(()=>{var g=CC(),h=g.firstChild;return N(g,y(Z,{get when(){return Yt(()=>!!n())()&&!s()?.hideWidget},get children(){var p=PC();return N(p,e),p}}),h),N(h,y(Z,{get when(){return s()?.whatsappBtn},get children(){return y(Ue,{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(yb,{class:"size-9",color:"white"})}})}}),null),N(h,y(Z,{get when(){return!s()?.hideWidget},get children(){return y(Z,{get when(){return n()},get fallback(){return y(Ue,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,OC(),y(Z,{get when(){return s()?.balloonMessage},get children(){var p=AC();return N(p,y(Z,{get when(){return l()},get fallback(){return y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=$C();return N(m,y(ac,{class:"size-2 animate-bounce"}),null),N(m,y(ac,{class:"size-2 animate-bounce delay-150"}),null),N(m,y(ac,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return Yt(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=TC();return N(m,(()=>{var v=Yt(()=>l().length>20);return()=>v()?l().substring(0,17)+"...":l()})()),m}})),pe(()=>qt(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(Ue,{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,kC()]}})}})}}),null),pe(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"),v=f();return m!==p.e&&qt(g,p.e=m),p.t=uo(g,v,p.t),p},{e:void 0,t:void 0}),g})()};var RC=U('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const MC=({children:e})=>{const{chatWidget:t}=he(),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=RC();return uo(r,n),N(r,e),r})()};var IC=U("<div id=smarttalks-widget>");const _C=({children:e})=>{const{chatWidget:t}=he(),[n,r]=L(!1),[o,i]=L(!1),[s,a]=L("100%"),c=()=>{typeof window<"u"&&i(window.innerWidth<768)},l=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};z(()=>{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=""))}),Wt(()=>{c(),window.addEventListener("resize",c),window.visualViewport&&(window.visualViewport.addEventListener("resize",l),window.visualViewport.addEventListener("scroll",l))}),H(()=>{window.removeEventListener("resize",c),window.visualViewport&&(window.visualViewport.removeEventListener("resize",l),window.visualViewport.removeEventListener("scroll",l)),document.body.style.overflow="",document.body.style.position=""});const u=()=>(t()?.style.margin??5)*4,d=()=>{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"]=`${u()}px`),f};return ye("open",()=>{r(!0),ge("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),ye("close",()=>{r(!1),ge("onClose")}),ye("toggle",()=>{r(!n()),ge("onToggle")}),ye("onAnswer",()=>{r(!0),ge("onOpen")}),setTimeout(()=>{r(!0),ge("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var f=IC();return N(f,e),pe(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"}
|
|
185
|
-
`,p=d();return
|
|
185
|
+
`,p=d();return h!==g.e&&qt(f,g.e=h),g.t=uo(f,p,g.t),g},{e:void 0,t:void 0}),f}})};var LC=U('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const dc=()=>(()=>{var e=LC();return N(e,y(ll,{size:45,class:"animate-spin"})),e})(),NC=()=>{const{chatWidget:e}=he(),{loading:t}=Qt(),{addFiles:n}=Dr();return y(DC,{get openIcon(){return y(cl,{get src(){return e()?.avatar}})},get children(){return[y(Z,{get when(){return t()},get children(){return y(dc,{})}}),y(Zs,{}),y(cc,{}),y(lc,{}),y(uc,{onFiles:n})]}})},FC=()=>{const{loading:e}=Qt(),{addFiles:t}=Dr();return y(_C,{get children(){return[y(Z,{get when(){return e()},get children(){return y(dc,{})}}),y(Zs,{}),y(cc,{}),y(lc,{}),y(uc,{onFiles:t})]}})},VC=()=>{const{loading:e}=Qt(),{addFiles:t}=Dr();return y(MC,{get children(){return[y(Z,{get when(){return e()},get children(){return y(dc,{})}}),y(Zs,{}),y(cc,{}),y(lc,{}),y(uc,{onFiles:t})]}})},BC=()=>{const{chatWidget:e}=he();return y(Vc,{get children(){return[y(gr,{get when(){return e()?.mode==="standard"},get children(){return y(NC,{})}}),y(gr,{get when(){return e()?.mode==="popup"},get children(){return y(FC,{})}}),y(gr,{get when(){return e()?.mode==="static"},get children(){return y(VC,{})}})]}})};var zC=U("<div><div>Form");const KC=()=>{const{formWidget:e}=he();return(()=>{var t=zC();return t.firstChild,N(t,()=>e()?._id,null),t})()};function UC(){const{widget:e}=he();return y(Vc,{get children(){return[y(gr,{get when(){return e()?.type==="chat"},get children(){return y(BC,{})}}),y(gr,{get when(){return e()?.type==="form"},get children(){return y(KC,{})}})]}})}var jC=U("<style>"),WC=U("<div>");let Ih=!1;const HC=({id:e,settings:t,side:n,margin:r,mode:o})=>{if(Ih)return console.warn("SmartTalks.ai Widget: duplicate instance blocked"),[];Ih=!0;const{setWidgetId:i}=he(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=jC();return N(a,gp),a})(),(()=>{var a=WC();return N(a,y(UC,{})),a})()]},YC={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||hp("smarttalks-widget",YC,HC)})(),bg()}));
|