@atlanhq/app-playground 1.7.0 → 1.7.2
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/.output/nitro.json +1 -1
- package/.output/public/200.html +1 -1
- package/.output/public/404.html +1 -1
- package/.output/public/_nuxt/{BwW6kAkc.js → BuGrzvCz.js} +3 -3
- package/.output/public/_nuxt/{KFzeyBuA.js → CM90ZS03.js} +3 -3
- package/.output/public/_nuxt/{pAoJL8bg.js → KMyRb67w.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/35ecb3cc-2837-498f-b3c8-1a4bd2427593.json +1 -0
- package/.output/public/_nuxt/{entry.Ce-hbEbP.css → entry.BGouYrak.css} +1 -1
- package/.output/public/_nuxt/{C487XLF3.js → wy1CSZ6z.js} +1 -1
- package/.output/public/index.html +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/builds/meta/33d2a36e-7e6c-4416-821e-36641b4f714f.json +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as Vr,G as Tw,H as Ov,I as Tv,k as T,J as ju,K as st,L as Re,r as he,d as E,M as Iw,N as we,h as at,O as te,P as S,Q as v,z as w,D as _,R as D,S as F,T as Ke,U as Qe,o as Dr,e as Pw,V as po,s as El,W as Ae,X as Wu,Y as vt,Z as jt,y as H,A as U,C as z,$ as Mr,a0 as R,a1 as Oe,B as oe,E as Te,a2 as Vw,a3 as Iv,a4 as gt,a5 as Dw,a6 as Mw,a7 as Ad,a8 as mr,a9 as Rw,aa as Fd,a as Aw,ab as Fw,ac as Nw,ad as Lw,ae as Bw,af as zw,ag as Hw,ah as jw,ai as Rr,aj as xo,ak as wo,al as Pv,am as Ww,an as Uw,ao as Gw,ap as Vv,x as qw}from"./KFzeyBuA.js";function Nd(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}var Yw=e=>typeof e=="object"&&e!==null;function Uu(e){return Object.fromEntries(Object.entries(e??{}).filter(([t,n])=>n!==void 0))}var Kw=e=>e==="base";function Xw(e){return e.slice().filter(t=>!Kw(t))}function up(e){return String.fromCharCode(e+(e>25?39:97))}function Zw(e){let t="",n;for(n=Math.abs(e);n>52;n=n/52|0)t=up(n%52)+t;return up(n%52)+t}function Jw(e,t){let n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e}function Qw(e){return Zw(Jw(5381,e)>>>0)}var Dv=/\s*!(important)?/i;function e1(e){return typeof e=="string"?Dv.test(e):!1}function t1(e){return typeof e=="string"?e.replace(Dv,"").trim():e}function Mv(e){return typeof e=="string"?e.replaceAll(" ","_"):e}var Ar=e=>{const t=new Map;return(...n)=>{const o=JSON.stringify(n);if(t.has(o))return t.get(o);const i=e(...n);return t.set(o,i),i}};function Gu(...e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(o=>{const i=t[o],a=n[o];Nd(i)&&Nd(a)?t[o]=Gu(i,a):t[o]=a}),t),{})}var n1=e=>e!=null;function Rv(e,t,n={}){const{stop:o,getKey:i}=n;function a(r,s=[]){if(Yw(r)){const l={};for(const[c,d]of Object.entries(r)){const u=i?.(c,d)??c,h=[...s,u];if(o!=null&&o(r,h))return t(r,s);const p=a(d,h);n1(p)&&(l[u]=p)}return l}return t(r,s)}return a(e)}function o1(e,t){return e.reduce((n,o,i)=>{const a=t[i];return o!=null&&(n[a]=o),n},{})}function Av(e,t,n=!0){const{utility:o,conditions:i}=t,{hasShorthand:a,resolveShorthand:r}=o;return Rv(e,s=>Array.isArray(s)?o1(s,i.breakpoints.keys):s,{stop:s=>Array.isArray(s),getKey:n?s=>a?r(s):s:void 0})}var i1={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},a1=e=>typeof e=="string"?e.replaceAll(/[\n\s]+/g," "):e;function r1(e){const{utility:t,hash:n,conditions:o=i1}=e,i=r=>[t.prefix,r].filter(Boolean).join("-"),a=(r,s)=>{let l;if(n){const c=[...o.finalize(r),s];l=i(t.toHash(c,Qw))}else l=[...o.finalize(r),i(s)].join(":");return l};return Ar(({base:r,...s}={})=>{const l=Object.assign(s,r),c=Av(l,e),d=new Set;return Rv(c,(u,h)=>{if(u==null)return;const p=e1(u),[m,...f]=o.shift(h),b=Xw(f),g=t.transform(m,t1(a1(u)));let y=a(b,g.className);p&&(y=`${y}!`),d.add(y)}),Array.from(d).join(" ")})}function s1(...e){return e.flat().filter(t=>Nd(t)&&Object.keys(Uu(t)).length>0)}function l1(e){function t(i){const a=s1(...i);return a.length===1?a:a.map(r=>Av(r,e))}function n(...i){return Gu(...t(i))}function o(...i){return Object.assign({},...t(i))}return{mergeCss:Ar(n),assignCss:o}}var c1=/([A-Z])/g,d1=/^ms-/,u1=Ar(e=>e.startsWith("--")?e:e.replace(c1,"-$1").replace(d1,"-ms-").toLowerCase()),h1="cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";`${h1.split(",").join("|")}`;var p1=(e={})=>{const t=o=>{var i;return{className:[e.className,o].filter(Boolean).join("__"),base:((i=e.base)==null?void 0:i[o])??{},variants:{},defaultVariants:e.defaultVariants??{},compoundVariants:e.compoundVariants?f1(e.compoundVariants,o):[]}},n=(e.slots??[]).map(o=>[o,t(o)]);for(const[o,i]of Object.entries(e.variants??{}))for(const[a,r]of Object.entries(i))n.forEach(([s,l])=>{var c;(c=l.variants)[o]??(c[o]={}),l.variants[o][a]=r[s]??{}});return Object.fromEntries(n)},f1=(e,t)=>e.filter(n=>n.css[t]).map(n=>({...n,css:n.css[t]}));function Fv(e,...t){const n=Object.getOwnPropertyDescriptors(e),o=Object.keys(n),i=r=>{const s={};for(let l=0;l<r.length;l++){const c=r[l];n[c]&&(Object.defineProperty(s,c,n[c]),delete n[c])}return s},a=r=>i(Array.isArray(r)?r:o.filter(r));return t.map(a).concat(i(o))}var g1=(...e)=>{const t=e.reduce((n,o)=>(o&&o.forEach(i=>n.add(i)),n),new Set([]));return Array.from(t)};const m1="_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,_complete,_incomplete,_collapsed,_current,_hidden,_off,_on,_today,_underValue,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base",Nv=new Set(m1.split(",")),v1=/^@|&|&$/;function hp(e){return Nv.has(e)||v1.test(e)}const b1=/^_/,y1=/&|@/;function x1(e){return e.map(t=>Nv.has(t)?t.replace(b1,""):y1.test(t)?`[${Mv(t.trim())}]`:t)}function w1(e){return e.sort((t,n)=>{const o=hp(t),i=hp(n);return o&&!i?1:!o&&i?-1:0})}const C1="aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,textStyle:textStyle",Lv=new Map,Bv=new Map;C1.split(",").forEach(e=>{const[t,n]=e.split(":"),[o,...i]=n.split("/");Lv.set(t,o),i.length&&i.forEach(a=>{Bv.set(a==="1"?o:a,t)})});const pp=e=>Bv.get(e)||e,zv={conditions:{shift:w1,finalize:x1,breakpoints:{keys:["base","sm","md","lg","xl","2xl"]}},utility:{transform:(e,t)=>{const n=pp(e);return{className:`${Lv.get(n)||u1(n)}_${Mv(t)}`}},hasShorthand:!0,toHash:(e,t)=>t(e.join(":")),resolveShorthand:pp}},_1=r1(zv),dt=(...e)=>_1(No(...e));dt.raw=(...e)=>No(...e);const{mergeCss:No}=l1(zv),fp=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function ri(e){const{base:t,variants:n,defaultVariants:o,compoundVariants:i}=fp(e),a=h=>({...o,...Uu(h)});function r(h={}){var p;const m=a(h);let f={...t};for(const[g,y]of Object.entries(m))(p=n[g])!=null&&p[y]&&(f=No(f,n[g][y]));const b=$1(i,m);return No(f,b)}function s(h){const p=fp(h.config),m=g1(h.variantKeys,Object.keys(n));return ri({base:No(t,p.base),variants:Object.fromEntries(m.map(f=>[f,No(n[f],p.variants[f])])),defaultVariants:Gu(o,p.defaultVariants),compoundVariants:[...i,...p.compoundVariants]})}function l(h){return dt(r(h))}const c=Object.keys(n);function d(h){return Fv(h,c)}const u=Object.fromEntries(Object.entries(n).map(([h,p])=>[h,Object.keys(p)]));return Object.assign(Ar(l),{__cva__:!0,variantMap:u,variantKeys:c,raw:r,config:e,merge:s,splitVariantProps:d,getVariantProps:a})}function $1(e,t){let n={};return e.forEach(o=>{Object.entries(o).every(([i,a])=>i==="css"?!0:(Array.isArray(a)?a:[a]).some(r=>t[i]===r))&&(n=No(n,o.css))}),n}function k1(){let e="",t=0,n;for(;t<arguments.length;)(n=arguments[t++])&&typeof n=="string"&&(e&&(e+=" "),e+=n);return e}const S1=(e,t)=>e+"__"+t;function se(e){const t=Object.entries(p1(e)).map(([d,u])=>[d,ri(u)]),n=e.defaultVariants??{};function o(d){const u=t.map(([h,p])=>[h,k1(p(d),e.className&&S1(e.className,h))]);return Object.fromEntries(u)}function i(d){const u=t.map(([h,p])=>[h,p.raw(d)]);return Object.fromEntries(u)}const a=e.variants??{},r=Object.keys(a);function s(d){return Fv(d,r)}const l=d=>({...n||{},...Uu(d)}),c=Object.fromEntries(Object.entries(a).map(([d,u])=>[d,Object.keys(u)]));return Object.assign(Ar(o),{__cva__:!1,raw:i,variantMap:c,variantKeys:r,splitVariantProps:s,getVariantProps:l})}var le=(e,t=[])=>({parts:(...n)=>{if(E1(t))return le(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>le(e,[...t,...n]),omit:(...n)=>le(e,t.filter(o=>!n.includes(o))),rename:n=>le(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,o)=>Object.assign(n,{[o]:{selector:[`&[data-scope="${fi(e)}"][data-part="${fi(o)}"]`,`& [data-scope="${fi(e)}"][data-part="${fi(o)}"]`].join(", "),attrs:{"data-scope":fi(e),"data-part":fi(o)}}}),{})}),fi=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),E1=e=>e.length===0,O1=Object.defineProperty,T1=(e,t,n)=>t in e?O1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bc=(e,t,n)=>T1(e,typeof t!="symbol"?t+"":t,n);function I1(e){if(!e)return!1;try{return e.selectionStart===0&&e.selectionEnd===0}catch{return e.value===""}}function P1(e){if(!e)return;const t=e.selectionStart??0,n=e.selectionEnd??0;Math.abs(n-t)===0&&t===0&&e.setSelectionRange(e.value.length,e.value.length)}var gp=e=>Math.max(0,Math.min(1,e)),V1=(e,t)=>e.map((n,o)=>e[(Math.max(t,0)+o)%e.length]),zc=(...e)=>t=>e.reduce((n,o)=>o(n),t),qa=()=>{},rc=e=>typeof e=="object"&&e!==null,Hv=2147483647,V=e=>e?"":void 0,Ne=e=>e?"true":void 0,D1=1,M1=9,R1=11,Be=e=>rc(e)&&e.nodeType===D1&&typeof e.nodeName=="string",sc=e=>rc(e)&&e.nodeType===M1,A1=e=>rc(e)&&e===e.window,jv=e=>Be(e)?e.localName||"":"#document";function F1(e){return["html","body","#document"].includes(jv(e))}var N1=e=>rc(e)&&e.nodeType!==void 0,Ui=e=>N1(e)&&e.nodeType===R1&&"host"in e,L1=e=>Be(e)&&e.localName==="input",Si=e=>!!(e!=null&&e.matches("a[href]")),B1=e=>Be(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Ol(e){if(!e)return!1;const t=e.getRootNode();return or(t)===e}var z1=/(textarea|select)/;function lc(e){if(e==null||!Be(e))return!1;try{return L1(e)&&e.selectionStart!=null||z1.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function rt(e,t){var n;if(!e||!t||!Be(e)||!Be(t))return!1;const o=(n=t.getRootNode)==null?void 0:n.call(t);if(e===t||e.contains(t))return!0;if(o&&Ui(o)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Ot(e){return sc(e)?e:A1(e)?e.document:e?.ownerDocument??document}function H1(e){return Ot(e).documentElement}function Fe(e){var t;return Ui(e)?Fe(e.host):sc(e)?e.defaultView??window:Be(e)?((t=e.ownerDocument)==null?void 0:t.defaultView)??window:window}function or(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function j1(e){if(jv(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ui(e)&&e.host||H1(e);return Ui(t)?t.host:t}function qu(e){let t;try{if(t=e.getRootNode({composed:!0}),sc(t)||Ui(t))return t}catch{}return e.ownerDocument??document}var Hc=new WeakMap;function Gi(e){return Hc.has(e)||Hc.set(e,Fe(e).getComputedStyle(e)),Hc.get(e)}var Yu=new Set(["menu","listbox","dialog","grid","tree","region"]),W1=e=>Yu.has(e),Wv=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function Uv(e,t){const n=new Set,o=qu(e),i=a=>{const r=a.querySelectorAll("[aria-controls]");for(const s of r){if(s.getAttribute("aria-expanded")!=="true")continue;const l=Wv(s);for(const c of l){if(!c||n.has(c))continue;n.add(c);const d=o.getElementById(c);if(d){const u=d.getAttribute("role"),h=d.getAttribute("aria-modal")==="true";if(u&&W1(u)&&!h&&(d===t||d.contains(t)||i(d)))return!0}}}return!1};return i(e)}function Gv(e,t){const n=qu(e),o=new Set,i=a=>{const r=a.querySelectorAll("[aria-controls]");for(const s of r){if(s.getAttribute("aria-expanded")!=="true")continue;const l=Wv(s);for(const c of l){if(!c||o.has(c))continue;o.add(c);const d=n.getElementById(c);if(d){const u=d.getAttribute("role"),h=d.getAttribute("aria-modal")==="true";u&&Yu.has(u)&&!h&&(t(d),i(d))}}}};i(e)}function U1(e){const t=new Set;return Gv(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function G1(e){const t=e.getAttribute("role");return!!(t&&Yu.has(t))}function q1(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function Y1(e){var t;return q1(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function K1(e){if(!e.id)return!1;const t=qu(e),n=CSS.escape(e.id),o=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(o)&&G1(e))}var cc=()=>typeof document<"u";function X1(){const e=navigator.userAgentData;return e?.platform??navigator.platform}function Z1(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var Ku=e=>cc()&&e.test(X1()),qv=e=>cc()&&e.test(Z1()),J1=e=>cc()&&e.test(navigator.vendor),mp=()=>cc()&&!!navigator.maxTouchPoints,Q1=()=>Ku(/^iPhone/i),eC=()=>Ku(/^iPad/i)||dc()&&navigator.maxTouchPoints>1,Xu=()=>Q1()||eC(),tC=()=>dc()||Xu(),dc=()=>Ku(/^Mac/i),uc=()=>tC()&&J1(/apple/i),nC=()=>qv(/Firefox/i),oC=()=>qv(/Android/i);function iC(e){var t,n,o;return((t=e.composedPath)==null?void 0:t.call(e))??((o=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:o.call(n))}function Pe(e){const t=iC(e);return t?.[0]??e.target}function vr(e){return Yv(e).isComposing||e.keyCode===229}function aC(e){return e.pointerType===""&&e.isTrusted?!0:oC()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var Go=e=>e.button===0,rC=e=>e.button===2||dc()&&e.ctrlKey&&e.button===0,un=e=>e.ctrlKey||e.altKey||e.metaKey,sC=e=>"touches"in e&&e.touches.length>0,lC={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},vp={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function br(e,t={}){const{dir:n="ltr",orientation:o="horizontal"}=t;let i=e.key;return i=lC[i]??i,n==="rtl"&&o==="horizontal"&&i in vp&&(i=vp[i]),i}function Yv(e){return e.nativeEvent??e}var cC=new Set(["PageUp","PageDown"]),dC=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function uC(e){return e.ctrlKey||e.metaKey?.1:cC.has(e.key)||e.shiftKey&&dC.has(e.key)?10:1}function Tl(e,t="client"){const n=sC(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var ge=(e,t,n,o)=>{const i=typeof e=="function"?e():e;return i?.addEventListener(t,n,o),()=>{i?.removeEventListener(t,n,o)}};function Kv(e,t){const{type:n="HTMLInputElement",property:o="value"}=t,i=Fe(e)[n].prototype;return Object.getOwnPropertyDescriptor(i,o)??{}}function hC(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Jt(e,t,n="value"){var o;if(!e)return;const i=hC(e);i&&((o=Kv(e,{type:i,property:n}).set)==null||o.call(e,t)),e.setAttribute(n,t)}function Zu(e,t){var n;e&&((n=Kv(e,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(e,t),t?e.setAttribute("checked",""):e.removeAttribute("checked"))}function Xv(e,t){const{value:n,bubbles:o=!0}=t;if(!e)return;const i=Fe(e);e instanceof i.HTMLInputElement&&(Jt(e,`${n}`),e.dispatchEvent(new i.Event("input",{bubbles:o})))}function Zv(e,t){const{checked:n,bubbles:o=!0}=t;if(!e)return;const i=Fe(e);e instanceof i.HTMLInputElement&&(Zu(e,n),e.dispatchEvent(new i.Event("click",{bubbles:o})))}function pC(e){return fC(e)?e.form:e.closest("form")}function fC(e){return e.matches("textarea, input, select, button")}function gC(e,t){if(!e)return;const n=pC(e),o=i=>{i.defaultPrevented||t()};return n?.addEventListener("reset",o,{passive:!0}),()=>n?.removeEventListener("reset",o)}function mC(e,t){const n=e?.closest("fieldset");if(!n)return;t(n.disabled);const o=Fe(n),i=new o.MutationObserver(()=>t(n.disabled));return i.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function oa(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:o}=t,i=[gC(e,o),mC(e,n)];return()=>i.forEach(a=>a?.())}var Jv=e=>Be(e)&&e.tagName==="IFRAME",vC=/^(audio|video|details)$/;function Qv(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var bC=e=>!Number.isNaN(Qv(e)),yC=e=>Qv(e)<0;function xC(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function eb(e,t,n){const o=[...e],i=[...e],a=new Set,r=new Map;e.forEach((l,c)=>r.set(l,c));let s=0;for(;s<i.length;){const l=i[s++];if(!l||a.has(l))continue;a.add(l);const c=xC(l,t);if(c){const d=Array.from(c.querySelectorAll(hc)).filter(n),u=r.get(l);if(u!==void 0){const h=u+1;o.splice(h,0,...d),d.forEach((p,m)=>{r.set(p,h+m)});for(let p=h+d.length;p<o.length;p++)r.set(o[p],p)}else{const h=o.length;o.push(...d),d.forEach((p,m)=>{r.set(p,h+m)})}i.push(...d)}}return o}var hc="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",tb=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:o}=t,i=Array.from(e.querySelectorAll(hc));(n==!0||n=="if-empty"&&i.length===0)&&Be(e)&&Bn(e)&&i.unshift(e);const a=[];for(const r of i)if(Bn(r)){if(Jv(r)&&r.contentDocument){const s=r.contentDocument.body;a.push(...tb(s,{getShadowRoot:o}));continue}a.push(r)}return o?eb(a,o,Bn):a};function Bn(e){return!Be(e)||e.closest("[inert]")?!1:e.matches(hc)&&B1(e)}function Fr(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:o}=t,i=Array.from(e.querySelectorAll(hc));n&&Lo(e)&&i.unshift(e);const a=[];for(const r of i)if(Lo(r)){if(Jv(r)&&r.contentDocument){const s=r.contentDocument.body;a.push(...Fr(s,{getShadowRoot:o}));continue}a.push(r)}if(o){const r=eb(a,o,Lo);return!r.length&&n?i:r}return!a.length&&n?i:a}function Lo(e){return Be(e)&&e.tabIndex>0?!0:Bn(e)&&!yC(e)}function wC(e,t={}){const n=Fr(e,t),o=n[0]||null,i=n[n.length-1]||null;return[o,i]}function ga(e){return e.tabIndex<0&&(vC.test(e.localName)||lc(e))&&!bC(e)?0:e.tabIndex}function Ju(e){const{root:t,getInitialEl:n,filter:o,enabled:i=!0}=e;if(!i)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t?.querySelector("[data-autofocus],[autofocus]")),!a){const r=Fr(t);a=o?r.filter(o)[0]:r[0]}return a||t||void 0}function CC(e){const t=e.currentTarget;if(!t)return!1;const[n,o]=wC(t);return!(Ol(n)&&e.shiftKey||Ol(o)&&!e.shiftKey||!n&&!o)}var nb=class ob{constructor(){Bc(this,"id",null),Bc(this,"fn_cleanup"),Bc(this,"cleanup",()=>{this.cancel()})}static create(){return new ob}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function ae(e){const t=nb.create();return t.request(e),t.cleanup}function pc(e){const t=new Set;function n(o){const i=globalThis.requestAnimationFrame(o);t.add(()=>globalThis.cancelAnimationFrame(i))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function _C(e,t,n){const o=ae(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function $C(e,t){if(!e)return;const{attributes:n,callback:o}=t,i=e.ownerDocument.defaultView||window,a=new i.MutationObserver(r=>{for(const s of r)s.type==="attributes"&&s.attributeName&&n.includes(s.attributeName)&&o(s)});return a.observe(e,{attributes:!0,attributeFilter:n}),()=>a.disconnect()}function Nr(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=typeof e=="function"?e():e;i.push($C(a,t))})),()=>{i.forEach(a=>a?.())}}function kC(e,t){const{callback:n}=t;if(!e)return;const o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(n);return i.observe(e,{childList:!0,subtree:!0}),()=>i.disconnect()}function SC(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=typeof e=="function"?e():e;i.push(kC(a,t))})),()=>{i.forEach(a=>a?.())}}function ib(e){const t=()=>{const n=Fe(e);e.dispatchEvent(new n.MouseEvent("click"))};nC()?_C(e,"keyup",t):queueMicrotask(t)}function Il(e){const t=j1(e);return F1(t)?Ot(t).body:Be(t)&&Qu(t)?t:Il(t)}function ab(e,t=[]){const n=Il(e),o=n===e.ownerDocument.body,i=Fe(n);return o?t.concat(i,i.visualViewport||[],Qu(n)?n:[]):t.concat(n,ab(n,[]))}var EC=/auto|scroll|overlay|hidden|clip/,OC=new Set(["inline","contents"]);function Qu(e){const t=Fe(e),{overflow:n,overflowX:o,overflowY:i,display:a}=t.getComputedStyle(e);return EC.test(n+i+o)&&!OC.has(a)}function TC(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function yr(e,t){const{rootEl:n,...o}=t||{};!e||!n||!Qu(n)||!TC(n)||e.scrollIntoView(o)}function rb(e,t){const{left:n,top:o,width:i,height:a}=t.getBoundingClientRect(),r={x:e.x-n,y:e.y-o},s={x:gp(r.x/i),y:gp(r.y/a)};function l(c={}){const{dir:d="ltr",orientation:u="horizontal",inverted:h}=c,p=typeof h=="object"?h.x:h,m=typeof h=="object"?h.y:h;return u==="horizontal"?d==="rtl"||p?1-s.x:s.x:m?1-s.y:s.y}return{offset:r,percent:s,getPercentValue:l}}function IC(e,t){const n=e.body,o="pointerLockElement"in e||"mozPointerLockElement"in e,i=()=>!!e.pointerLockElement;function a(){}function r(l){i(),console.error("PointerLock error occurred:",l),e.exitPointerLock()}if(!o)return;try{n.requestPointerLock()}catch{}const s=[ge(e,"pointerlockchange",a,!1),ge(e,"pointerlockerror",r,!1)];return()=>{s.forEach(l=>l()),e.exitPointerLock()}}var Mi="default",Ld="",Zs=new WeakMap;function PC(e={}){const{target:t,doc:n}=e,o=n??document,i=o.documentElement;return Xu()?(Mi==="default"&&(Ld=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),Mi="disabled"):t&&(Zs.set(t,t.style.userSelect),t.style.userSelect="none"),()=>sb({target:t,doc:o})}function sb(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(Xu()){if(Mi!=="disabled")return;Mi="restoring",setTimeout(()=>{pc(()=>{Mi==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Ld||""),Ld="",Mi="default")})},300)}else if(t&&Zs.has(t)){const i=Zs.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Zs.delete(t)}}function eh(e={}){const{defer:t,target:n,...o}=e,i=t?ae:r=>r(),a=[];return a.push(i(()=>{const r=typeof n=="function"?n():n;a.push(PC({...o,target:r}))})),()=>{a.forEach(r=>r?.())}}function lb(e,t){const{onPointerMove:n,onPointerUp:o}=t,i=s=>{const l=Tl(s),c=Math.sqrt(l.x**2+l.y**2),d=s.pointerType==="touch"?10:5;if(!(c<d)){if(s.pointerType==="mouse"&&s.button===0){a(s);return}n({point:l,event:s})}},a=s=>{const l=Tl(s);o({point:l,event:s})},r=[ge(e,"pointermove",i,!1),ge(e,"pointerup",a,!1),ge(e,"pointercancel",a,!1),ge(e,"contextmenu",a,!1),eh({doc:e})];return()=>{r.forEach(s=>s())}}function cb(e){const{pointerNode:t,keyboardNode:n=t,onPress:o,onPressStart:i,onPressEnd:a,isValidKey:r=g=>g.key==="Enter"}=e;if(!t)return qa;const s=Fe(t);let l=qa,c=qa,d=qa;const u=g=>({point:Tl(g),event:g});function h(g){i?.(u(g))}function p(g){a?.(u(g))}const m=ge(t,"pointerdown",g=>{c();const y=ge(s,"pointerup",C=>{const k=Pe(C);rt(t,k)?o?.(u(C)):a?.(u(C))},{passive:!o,once:!0}),x=ge(s,"pointercancel",p,{passive:!a,once:!0});c=zc(y,x),Ol(n)&&g.pointerType==="mouse"&&g.preventDefault(),h(g)},{passive:!i}),f=ge(n,"focus",b);l=zc(m,f);function b(){const g=k=>{if(!r(k))return;const O=$=>{if(!r($))return;const I=new s.PointerEvent("pointerup"),A=u(I);o?.(A),a?.(A)};c(),c=ge(n,"keyup",O);const P=new s.PointerEvent("pointerdown");h(P)},y=()=>{const k=new s.PointerEvent("pointercancel");p(k)},x=ge(n,"keydown",g),C=ge(n,"blur",y);d=zc(x,C)}return()=>{l(),c(),d()}}function fo(e,t){return Array.from(e?.querySelectorAll(t)??[])}function db(e,t){return e?.querySelector(t)??null}var th=e=>e.id;function VC(e,t,n=th){return e.find(o=>n(o)===t)}function fc(e,t,n=th){const o=VC(e,t,n);return o?e.indexOf(o):-1}function nh(e,t,n=!0){let o=fc(e,t);return o=n?(o+1)%e.length:Math.min(o+1,e.length-1),e[o]}function oh(e,t,n=!0){let o=fc(e,t);return o===-1?n?e[e.length-1]:null:(o=n?(o-1+e.length)%e.length:Math.max(0,o-1),e[o])}var DC=e=>e.split("").map(t=>{const n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),MC=e=>{var t;return DC(((t=e.dataset)==null?void 0:t.valuetext)??e.textContent??"")},RC=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function AC(e,t,n,o=th){const i=n?fc(e,n,o):-1;let a=n?V1(e,i):e;return t.length===1&&(a=a.filter(r=>o(r)!==n)),a.find(r=>RC(MC(r),t))}function FC(e,t,n){const o=e.getAttribute(t),i=o!=null;return e.setAttribute(t,n),()=>{i?e.setAttribute(t,o):e.removeAttribute(t)}}function ih(e,t){if(!e)return qa;const n=Object.keys(t).reduce((o,i)=>(o[i]=e.style.getPropertyValue(i),o),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function NC(e,t){const{state:n,activeId:o,key:i,timeout:a=350,itemToId:r}=t,s=n.keysSoFar+i,l=s.length>1&&Array.from(s).every(p=>p===s[0])?s[0]:s;let c=e.slice();const d=AC(c,l,o,r);function u(){clearTimeout(n.timer),n.timer=-1}function h(p){n.keysSoFar=p,u(),p!==""&&(n.timer=+setTimeout(()=>{h(""),u()},a))}return h(s),d}var jn=Object.assign(NC,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:LC});function LC(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var gc={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function BC(e,t,n){const{signal:o}=t;return[new Promise((i,a)=>{const r=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);o.addEventListener("abort",()=>{clearTimeout(r),a(new Error("Promise aborted"))}),e.then(s=>{o.aborted||(clearTimeout(r),i(s))}).catch(s=>{o.aborted||(clearTimeout(r),a(s))})}),()=>t.abort()]}function zC(e,t){const{timeout:n,rootNode:o}=t,i=Fe(o),a=Ot(o),r=new i.AbortController;return BC(new Promise(s=>{const l=e();if(l){s(l);return}const c=new i.MutationObserver(()=>{const d=e();d&&d.isConnected&&(c.disconnect(),s(d))});c.observe(a.body,{childList:!0,subtree:!0})}),r,n)}var HC=Object.defineProperty,ub=e=>{throw TypeError(e)},jC=(e,t,n)=>t in e?HC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yn=(e,t,n)=>jC(e,typeof t!="symbol"?t+"":t,n),WC=(e,t,n)=>t.has(e)||ub("Cannot "+n),bp=(e,t,n)=>(WC(e,t,"read from private field"),t.get(e)),UC=(e,t,n)=>t.has(e)?ub("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);function Js(e){return e==null?[]:Array.isArray(e)?e:[e]}var GC=e=>Array.from(Array(e).keys()),Bi=e=>e[0],Lr=e=>e[e.length-1],qC=(e,t)=>e.indexOf(t)!==-1,Mn=(e,...t)=>e.concat(t),qo=(e,...t)=>e.filter(n=>!t.includes(n)),yp=(e,t)=>e.filter((n,o)=>o!==t),Qt=e=>Array.from(new Set(e)),jc=(e,t)=>{const n=new Set(t);return e.filter(o=>!n.has(o))},Zo=(e,t)=>qC(e,t)?qo(e,t):Mn(e,t);function Pl(e,t,n={}){const{step:o=1,loop:i=!0}=n,a=t+o,r=e.length,s=r-1;return t===-1?o>0?0:s:a<0?i?s:0:a>=r?i?0:t>r?r:t:a}function YC(e,t,n={}){return e[Pl(e,t,n)]}function hb(e,t,n={}){const{step:o=1,loop:i=!0}=n;return Pl(e,t,{step:-o,loop:i})}function KC(e,t,n={}){return e[hb(e,t,n)]}function xp(e,t){return e.reduce((n,o,i)=>{var a;return i%t===0?n.push([o]):(a=Lr(n))==null||a.push(o),n},[])}function pb(e){return e.reduce((t,n)=>Array.isArray(n)?t.concat(pb(n)):t.concat(n),[])}function wp(e,t){return e.reduce(([n,o],i)=>(t(i)?n.push(i):o.push(i),[n,o]),[[],[]])}var Cp=e=>e?.constructor.name==="Array",XC=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Je(e[n],t[n]))return!1;return!0},Je=(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(Cp(e)&&Cp(t))return XC(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),o=n.length;for(let i=0;i<o;i++)if(!Reflect.has(e,n[i]))return!1;for(let i=0;i<o;i++){const a=n[i];if(!Je(e[a],t[a]))return!1}return!0},Ri=e=>Array.isArray(e),ZC=e=>e===!0||e===!1,fb=e=>e!=null&&typeof e=="object",Bo=e=>fb(e)&&!Ri(e),ir=e=>typeof e=="string",ao=e=>typeof e=="function",JC=e=>e==null,ro=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),QC=e=>Object.prototype.toString.call(e),gb=Function.prototype.toString,e_=gb.call(Object),t_=e=>{if(!fb(e)||QC(e)!="[object Object]"||i_(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=ro(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&gb.call(n)==e_},n_=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,o_=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,i_=e=>n_(e)||o_(e),ns=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,a_=()=>{},xr=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},mb=(()=>{let e=0;return()=>(e++,e.toString(36))})();function ut(e,t,...n){var o;if(e in t){const a=t[e];return ao(a)?a(...n):a}const i=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw(o=Error.captureStackTrace)==null||o.call(Error,i,ut),i}var vb=(e,t)=>{var n;try{return e()}catch(o){return o instanceof Error&&((n=Error.captureStackTrace)==null||n.call(Error,o,vb)),t?.()}},{floor:bb,abs:_p,round:mc,min:r_,max:s_,pow:l_,sign:c_}=Math,Bd=e=>Number.isNaN(e),Co=e=>Bd(e)?0:e,yb=(e,t)=>(e%t+t)%t,d_=(e,t)=>(e%t+t)%t,u_=(e,t)=>Co(e)>=t,h_=(e,t)=>Co(e)<=t,ar=(e,t,n)=>{const o=Co(e),i=t==null||o>=t,a=n==null||o<=n;return i&&a},p_=(e,t,n)=>mc((Co(e)-t)/n)*n+t,Ze=(e,t,n)=>r_(s_(Co(e),t),n),f_=(e,t,n)=>(Co(e)-t)/(n-t),g_=(e,t,n,o)=>Ze(p_(e*(n-t)+t,t,o),t,n),$p=(e,t)=>{let n=e,o=t.toString(),i=o.indexOf("."),a=i>=0?o.length-i:0;if(a>0){let r=l_(10,a);n=mc(n*r)/r}return n},rr=(e,t)=>typeof t=="number"?bb(e*t+.5)/t:mc(e),kp=(e,t,n,o)=>{const i=t!=null?Number(t):0,a=Number(n),r=(e-i)%o;let s=_p(r)*2>=o?e+c_(r)*(o-_p(r)):e-r;if(s=$p(s,o),!Bd(i)&&s<i)s=i;else if(!Bd(a)&&s>a){const l=bb((a-i)/o),c=i+l*o;s=l<=0||c<i?a:c}return $p(s,o)},Ee=(e,t=0,n=10)=>{const o=Math.pow(n,t);return mc(e*o)/o},Sp=e=>{if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n},xb=(e,t,n)=>{let o=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const i=10**Math.max(Sp(e),Sp(n));e=Math.round(e*i),n=Math.round(n*i),o=t==="+"?e+n:e-n,o/=i}return o},m_=(e,t)=>xb(Co(e),"+",t),v_=(e,t)=>xb(Co(e),"-",t),Kn=e=>typeof e=="number"?`${e}px`:e;function vc(e){if(!t_(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(o=>typeof o=="string"),n={};for(const o of t){const i=e[o];i!==void 0&&(n[o]=vc(i))}return n}function oo(e,t){const n={};for(const o of t){const i=e[o];i!==void 0&&(n[o]=i)}return n}function b_(e,t=Object.is){let n={...e};const o=new Set,i=r=>(o.add(r),()=>o.delete(r)),a=()=>{o.forEach(r=>r())};return{subscribe:i,get:r=>n[r],set:(r,s)=>{t(n[r],s)||(n[r]=s,a())},update:r=>{let s=!1;for(const l in r){const c=r[l];c!==void 0&&!t(n[l],c)&&(n[l]=c,s=!0)}s&&a()},snapshot:()=>({...n})}}var os=()=>performance.now(),Qs,y_=class{constructor(t){this.onTick=t,Yn(this,"frameId",null),Yn(this,"pausedAtMs",null),Yn(this,"context"),Yn(this,"cancelFrame",()=>{this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}),Yn(this,"setStartMs",n=>{this.context.startMs=n}),Yn(this,"start",()=>{if(this.frameId!==null)return;const n=os();this.pausedAtMs!==null?(this.context.startMs+=n-this.pausedAtMs,this.pausedAtMs=null):this.context.startMs=n,this.frameId=requestAnimationFrame(bp(this,Qs))}),Yn(this,"pause",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=os())}),Yn(this,"stop",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=null)}),UC(this,Qs,n=>{if(this.context.now=n,this.context.deltaMs=n-this.context.startMs,this.onTick(this.context)===!1){this.stop();return}this.frameId=requestAnimationFrame(bp(this,Qs))}),this.context={now:0,startMs:os(),deltaMs:0}}get elapsedMs(){return this.pausedAtMs!==null?this.pausedAtMs-this.context.startMs:os()-this.context.startMs}};Qs=new WeakMap;function Wc(e,t){const n=new y_(({deltaMs:o})=>{if(o>=t)return e(),!1});return n.start(),()=>n.stop()}function Wn(...e){e.length===1?e[0]:e[1],e.length!==2||e[0]}function x_(...e){e.length===1?e[0]:e[1],e.length!==2||e[0]}function ah(e,t){if(e==null)throw new Error(t())}function rh(e,t,n){let o=[];for(const i of t)e[i]==null&&o.push(i);if(o.length>0)throw new Error(`[zag-js${n?` > ${n}`:""}] missing required props: ${o.join(", ")}`)}var w_=(...e)=>e.map(t=>{var n;return(n=t?.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),C_=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ep=e=>{const t={};let n;for(;n=C_.exec(e);)t[n[1]]=n[2];return t},__=(e,t)=>{if(ir(e)){if(ir(t))return`${e};${t}`;e=Ep(e)}else ir(t)&&(t=Ep(t));return Object.assign({},e??{},t??{})};function Br(...e){let t={};for(let n of e){if(!n)continue;for(let i in t){if(i.startsWith("on")&&typeof t[i]=="function"&&typeof n[i]=="function"){t[i]=xr(n[i],t[i]);continue}if(i==="className"||i==="class"){t[i]=w_(t[i],n[i]);continue}if(i==="style"){t[i]=__(t[i],n[i]);continue}t[i]=n[i]!==void 0?n[i]:t[i]}for(let i in n)t[i]===void 0&&(t[i]=n[i]);const o=Object.getOwnPropertySymbols(n);for(let i of o)t[i]=n[i]}return t}function zd(e,t,n){let o=[],i;return a=>{const r=e(a);return(r.length!==o.length||r.some((s,l)=>!Je(o[l],s)))&&(o=r,i=t(r,a)),i}}function et(){return{and:(...e)=>function(t){return e.every(n=>t.guard(n))},or:(...e)=>function(t){return e.some(n=>t.guard(n))},not:e=>function(t){return!t.guard(e)}}}function bc(){return{guards:et(),createMachine:e=>e,choose:e=>function({choose:t}){var n;return(n=t(e))==null?void 0:n.actions}}}var Ei=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Ei||{}),Uc="__init__";function $_(e){const t=()=>{var o;return((o=e.getRootNode)==null?void 0:o.call(e))??document},n=()=>Ot(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>or(t()),isActiveElement:Ol,getById:o=>t().getElementById(o)}}function k_(e){return new Proxy({},{get(t,n){return n==="style"?o=>e({style:o}).style:e}})}var ee=()=>e=>Array.from(new Set(e)),wb=le("accordion").parts("root","item","itemTrigger","itemContent","itemIndicator"),ma=wb.build(),Vl=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`accordion:${e.id}`},S_=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.item)==null?void 0:o.call(n,t))??`accordion:${e.id}:item:${t}`},Op=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemContent)==null?void 0:o.call(n,t))??`accordion:${e.id}:content:${t}`},Dl=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemTrigger)==null?void 0:o.call(n,t))??`accordion:${e.id}:trigger:${t}`},E_=e=>e.getById(Vl(e)),yc=e=>{const t=`[aria-controls][data-ownedby='${CSS.escape(Vl(e))}']:not([disabled])`;return fo(E_(e),t)},O_=e=>Bi(yc(e)),T_=e=>Lr(yc(e)),I_=(e,t)=>nh(yc(e),Dl(e,t)),P_=(e,t)=>oh(yc(e),Dl(e,t));function V_(e,t){const{send:n,context:o,prop:i,scope:a,computed:r}=e,s=o.get("focusedValue"),l=o.get("value"),c=i("multiple");function d(h){let p=h;!c&&p.length>1&&(p=[p[0]]),n({type:"VALUE.SET",value:p})}function u(h){return{expanded:l.includes(h.value),focused:s===h.value,disabled:!!(h.disabled??i("disabled"))}}return{focusedValue:s,value:l,setValue:d,getItemState:u,getRootProps(){return t.element({...ma.root.attrs,dir:i("dir"),id:Vl(a),"data-orientation":i("orientation")})},getItemProps(h){const p=u(h);return t.element({...ma.item.attrs,dir:i("dir"),id:S_(a,h.value),"data-state":p.expanded?"open":"closed","data-focus":V(p.focused),"data-disabled":V(p.disabled),"data-orientation":i("orientation")})},getItemContentProps(h){const p=u(h);return t.element({...ma.itemContent.attrs,dir:i("dir"),role:"region",id:Op(a,h.value),"aria-labelledby":Dl(a,h.value),hidden:!p.expanded,"data-state":p.expanded?"open":"closed","data-disabled":V(p.disabled),"data-focus":V(p.focused),"data-orientation":i("orientation")})},getItemIndicatorProps(h){const p=u(h);return t.element({...ma.itemIndicator.attrs,dir:i("dir"),"aria-hidden":!0,"data-state":p.expanded?"open":"closed","data-disabled":V(p.disabled),"data-focus":V(p.focused),"data-orientation":i("orientation")})},getItemTriggerProps(h){const{value:p}=h,m=u(h);return t.button({...ma.itemTrigger.attrs,type:"button",dir:i("dir"),id:Dl(a,p),"aria-controls":Op(a,p),"aria-expanded":m.expanded,disabled:m.disabled,"data-orientation":i("orientation"),"aria-disabled":m.disabled,"data-state":m.expanded?"open":"closed","data-ownedby":Vl(a),onFocus(){m.disabled||n({type:"TRIGGER.FOCUS",value:p})},onBlur(){m.disabled||n({type:"TRIGGER.BLUR"})},onClick(f){m.disabled||(uc()&&f.currentTarget.focus(),n({type:"TRIGGER.CLICK",value:p}))},onKeyDown(f){if(f.defaultPrevented||m.disabled)return;const b={ArrowDown(){r("isHorizontal")||n({type:"GOTO.NEXT",value:p})},ArrowUp(){r("isHorizontal")||n({type:"GOTO.PREV",value:p})},ArrowRight(){r("isHorizontal")&&n({type:"GOTO.NEXT",value:p})},ArrowLeft(){r("isHorizontal")&&n({type:"GOTO.PREV",value:p})},Home(){n({type:"GOTO.FIRST",value:p})},End(){n({type:"GOTO.LAST",value:p})}},g=br(f,{dir:i("dir"),orientation:i("orientation")}),y=b[g];y&&(y(f),f.preventDefault())}})}}}var{and:D_,not:M_}=et(),R_={props({props:e}){return{collapsible:!1,multiple:!1,orientation:"vertical",defaultValue:[],...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{focusedValue:t(()=>({defaultValue:null,sync:!0,onChange(n){var o;(o=e("onFocusChange"))==null||o({value:n})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){var o;(o=e("onValueChange"))==null||o({value:n})}}))}},computed:{isHorizontal:({prop:e})=>e("orientation")==="horizontal"},on:{"VALUE.SET":{actions:["setValue"]}},states:{idle:{on:{"TRIGGER.FOCUS":{target:"focused",actions:["setFocusedValue"]}}},focused:{on:{"GOTO.NEXT":{actions:["focusNextTrigger"]},"GOTO.PREV":{actions:["focusPrevTrigger"]},"TRIGGER.CLICK":[{guard:D_("isExpanded","canToggle"),actions:["collapse"]},{guard:M_("isExpanded"),actions:["expand"]}],"GOTO.FIRST":{actions:["focusFirstTrigger"]},"GOTO.LAST":{actions:["focusLastTrigger"]},"TRIGGER.BLUR":{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{canToggle:({prop:e})=>!!e("collapsible")||!!e("multiple"),isExpanded:({context:e,event:t})=>e.get("value").includes(t.value)},actions:{collapse({context:e,prop:t,event:n}){const o=t("multiple")?qo(e.get("value"),n.value):[];e.set("value",o)},expand({context:e,prop:t,event:n}){const o=t("multiple")?Mn(e.get("value"),n.value):[n.value];e.set("value",o)},focusFirstTrigger({scope:e}){var t;(t=O_(e))==null||t.focus()},focusLastTrigger({scope:e}){var t;(t=T_(e))==null||t.focus()},focusNextTrigger({context:e,scope:t}){const n=e.get("focusedValue");if(!n)return;const o=I_(t,n);o?.focus()},focusPrevTrigger({context:e,scope:t}){const n=e.get("focusedValue");if(!n)return;const o=P_(t,n);o?.focus()},setFocusedValue({context:e,event:t}){e.set("focusedValue",t.value)},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t}){e.set("value",t.value)},coarseValue({context:e,prop:t}){!t("multiple")&&e.get("value").length>1&&(Wn("The value of accordion should be a single value when multiple is false."),e.set("value",[e.get("value")[0]]))}}}};ee()(["collapsible","dir","disabled","getRootNode","id","ids","multiple","onFocusChange","onValueChange","orientation","value","defaultValue"]);ee()(["value","disabled"]);const A_={default:{},floating:{root:{gap:"12","& > div[data-part='item']":{boxShadow:"stroke-bordered-interactive",borderBottom:"none"}}}},zr=se({slots:[...wb.keys(),"itemTriggerPrefix","itemTriggerContent"],base:{root:{width:"100%",display:"flex",flexDirection:"column",fontFamily:"sans"},item:{borderBottom:"1px solid {colors.border.muted}",borderRadius:"lg",backgroundColor:"background.default",_hover:{backgroundColor:"background.hover"}},itemTrigger:{width:"100%",paddingX:"8",paddingY:"8",cursor:"pointer",display:"flex",gap:"8",alignItems:"center",textAlign:"left",border:"none",outline:"none",backgroundColor:"transparent",color:"text.normal",fontSize:"base",fontWeight:"medium",lineHeight:"lg",fontStyle:"normal",letterSpacing:"normal"},itemTriggerPrefix:{padding:"2","& > svg":{display:"block"}},itemTriggerContent:{flex:"1",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8"},itemContent:{backgroundColor:"transparent",color:"text.subtle",fontSize:"small",fontWeight:"normal",fontStyle:"normal",lineHeight:"150%",letterSpacing:"0%",padding:"8",paddingTop:"4",animation:"collapse-in",_closed:{animation:"collapse-out"}},itemIndicator:{width:"24",height:"24",display:"flex",alignItems:"center",justifyContent:"center",transformOrigin:"center",transitionDuration:"200ms",transitionProperty:"transform",transitionTimingFunction:"{easings.default}",_open:{transform:"rotate(180deg)"}}},variants:{variant:A_},defaultVariants:{variant:"default"}});function F_(e){const t=Vr(),n=t?.type.emits,o={};n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`);for(const i of n)o[Tw(Ov(i))]=(...a)=>e(i,...a);return o}function N_(e){const t=Vr(),n=Object.keys(t?.type.props??{}).reduce((i,a)=>{const r=(t?.type.props[a]).default;return r!==void 0&&(i[a]=r),i},{}),o=Tv(e);return T(()=>{const i={},a=t?.vnode.props??{};return Object.keys(a).forEach(r=>{i[Ov(r)]=a[r]}),Object.keys({...n,...i}).reduce((r,s)=>(o.value[s]!==void 0&&(r[s]=o.value[s]),r),{})})}function We(e,t){const n=N_(e),o=t?F_(t):{};return T(()=>({...n.value,...o}))}const xe=e=>{const t=Symbol(e);return[n=>ju(t,n),n=>st(t,n),t]},[xn,Hr]=xe("RenderStrategyProps");function L_(e){const t=Re(e);return t?.$el??t}const B_=e=>Object.prototype.hasOwnProperty.call(e,"nodeName")&&typeof e.nodeName=="string";function q(){const e=Vr(),t=he(),n=T(()=>{var r,s;return["#text","#comment"].includes((r=t.value)==null?void 0:r.$el.nodeName)?(s=t.value)==null?void 0:s.$el.nextElementSibling:L_(t)}),o=Object.assign({},e.exposed),i={};for(const r in e.props)Object.defineProperty(i,r,{enumerable:!0,configurable:!0,get:()=>e.props[r]});if(Object.keys(o).length>0)for(const r in o)Object.defineProperty(i,r,{enumerable:!0,configurable:!0,get:()=>o[r]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function a(r){t.value=r,!(B_(r)||!r)&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>r.$el}),e.exposed=i)}return{forwardRef:a,currentRef:t,currentElement:n}}const z_=E({name:"Dynamic",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o;if(!n.default)return null;const i=Cb(n.default()),[a,...r]=i;if(Object.keys(t).length>0){(o=a.props)==null||delete o.ref;const s=Br(t,a.props??{}),l=Iw(a,s);for(const c in s)c.startsWith("on")&&(l.props||(l.props={}),l.props[c]=s[c]);return i.length===1?l:[l,...r]}return i}}});function Cb(e){return e?e.flatMap(t=>t.type===we?Cb(t.children):[t]):[]}const H_="br, hr, img, input, area, textarea".split(", "),j_=e=>typeof e=="string"&&H_.includes(e),Gc=e=>E({name:"Polymorphic",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1}},setup(t,{attrs:n,slots:o}){return t.asChild?()=>at(z_,n,o):()=>{var i;return at(e,n,j_(e)||(i=o.default)==null?void 0:i.call(o))}}});function W_(){const e=new Map;return new Proxy(Gc,{apply(t,n,o){return Gc(o[0])},get(t,n){return e.has(n)||e.set(n,Gc(n)),e.get(n)}})}const Y=W_(),[_b,jr]=xe("CollapsibleContext"),U_=E({__name:"collapsible-content",props:{asChild:{type:Boolean}},setup(e){const t=jr();return q(),(n,o)=>v(t).unmounted?te("",!0):(w(),S(v(Y).div,F({key:0},v(t).getContentProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),G_=E({__name:"collapsible-context",setup(e){const t=jr();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),q_=E({__name:"collapsible-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return _b(n),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}});var Y_=le("collapsible").parts("root","trigger","content","indicator"),is=Y_.build(),K_=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`collapsible:${e.id}`},Hd=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`collapsible:${e.id}:content`},X_=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`collapsible:${e.id}:trigger`},va=e=>e.getById(Hd(e));function Z_(e,t){const{state:n,send:o,context:i,scope:a,prop:r}=e,s=n.matches("open")||n.matches("closing"),l=n.matches("open"),c=n.matches("closed"),{width:d,height:u}=i.get("size"),h=!!r("disabled"),p=r("collapsedHeight"),m=r("collapsedWidth"),f=p!=null,b=m!=null,g=f||b,y=!i.get("initial")&&l;return{disabled:h,visible:s,open:l,measureSize(){o({type:"size.measure"})},setOpen(x){n.matches("open")!==x&&o({type:x?"open":"close"})},getRootProps(){return t.element({...is.root.attrs,"data-state":l?"open":"closed",dir:r("dir"),id:K_(a)})},getContentProps(){return t.element({...is.content.attrs,id:Hd(a),"data-collapsible":"","data-state":y?void 0:l?"open":"closed","data-disabled":V(h),"data-has-collapsed-size":V(g),hidden:!s&&!g,dir:r("dir"),style:{"--height":Kn(u),"--width":Kn(d),"--collapsed-height":Kn(p),"--collapsed-width":Kn(m),...c&&f&&{overflow:"hidden",minHeight:Kn(p),maxHeight:Kn(p)},...c&&b&&{overflow:"hidden",minWidth:Kn(m),maxWidth:Kn(m)}}})},getTriggerProps(){return t.element({...is.trigger.attrs,id:X_(a),dir:r("dir"),type:"button","data-state":l?"open":"closed","data-disabled":V(h),"aria-controls":Hd(a),"aria-expanded":s||!1,onClick(x){x.defaultPrevented||h||o({type:l?"close":"open"})}})},getIndicatorProps(){return t.element({...is.indicator.attrs,dir:r("dir"),"data-state":l?"open":"closed","data-disabled":V(h)})}}}var J_={initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{size:e(()=>({defaultValue:{height:0,width:0},sync:!0})),initial:e(()=>({defaultValue:!1}))}},refs(){return{cleanup:void 0,stylesRef:void 0}},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["setInitial","computeSize","toggleVisibility"])})},exit:["clearInitial","cleanupNode"],states:{closed:{effects:["trackTabbableElements"],on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","computeSize","invokeOnOpen"]}]}},closing:{effects:["trackExitAnimation"],on:{"controlled.close":{target:"closed"},"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","invokeOnOpen"]}],close:[{guard:"isOpenControlled",actions:["invokeOnExitComplete"]},{target:"closed",actions:["setInitial","computeSize","invokeOnExitComplete"]}],"animation.end":{target:"closed",actions:["invokeOnExitComplete","clearInitial"]}}},open:{effects:["trackEnterAnimation"],on:{"controlled.close":{target:"closing"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closing",actions:["setInitial","computeSize","invokeOnClose"]}],"size.measure":{actions:["measureSize"]},"animation.end":{actions:["clearInitial"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackEnterAnimation:({send:e,scope:t})=>{let n;const o=ae(()=>{const i=va(t);if(!i)return;const a=Gi(i).animationName;if(!a||a==="none"){e({type:"animation.end"});return}const r=s=>{Pe(s)===i&&e({type:"animation.end"})};i.addEventListener("animationend",r),n=()=>{i.removeEventListener("animationend",r)}});return()=>{o(),n?.()}},trackExitAnimation:({send:e,scope:t})=>{let n;const o=ae(()=>{const i=va(t);if(!i)return;const a=Gi(i).animationName;if(!a||a==="none"){e({type:"animation.end"});return}const r=l=>{Pe(l)===i&&e({type:"animation.end"})};i.addEventListener("animationend",r);const s=ih(i,{animationFillMode:"forwards"});n=()=>{i.removeEventListener("animationend",r),pc(()=>s())}});return()=>{o(),n?.()}},trackTabbableElements:({scope:e,prop:t})=>{if(!t("collapsedHeight")&&!t("collapsedWidth"))return;const n=va(e);if(!n)return;const o=()=>{const r=Fr(n).map(s=>FC(s,"inert",""));return()=>{r.forEach(s=>s())}};let i=o();const a=SC(n,{callback(){i(),i=o()}});return()=>{i(),a()}}},actions:{setInitial:({context:e,flush:t})=>{t(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("stylesRef",null)},measureSize:({context:e,scope:t})=>{const n=va(t);if(!n)return;const{height:o,width:i}=n.getBoundingClientRect();e.set("size",{height:o,width:i})},computeSize:({refs:e,scope:t,context:n})=>{var o;(o=e.get("cleanup"))==null||o();const i=ae(()=>{const a=va(t);if(!a)return;const r=a.hidden;a.style.animationName="none",a.style.animationDuration="0s",a.hidden=!1;const s=a.getBoundingClientRect();n.set("size",{height:s.height,width:s.width}),n.get("initial")&&(a.style.animationName="",a.style.animationDuration=""),a.hidden=r});e.set("cleanup",i)},invokeOnOpen:({prop:e})=>{var t;(t=e("onOpenChange"))==null||t({open:!0})},invokeOnClose:({prop:e})=>{var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},toggleVisibility:({prop:e,send:t})=>{t({type:e("open")?"controlled.open":"controlled.close"})}}}};ee()(["dir","disabled","getRootNode","id","ids","collapsedHeight","collapsedWidth","onExitComplete","onOpenChange","defaultOpen","open"]);function Q_(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}var Tp={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"},e$="viewBox,className,preserveAspectRatio,fillRule,clipPath,clipRule,strokeWidth,strokeLinecap,strokeLinejoin,strokeDasharray,strokeDashoffset,strokeMiterlimit".split(",");function t$(e){return e in Tp?Tp[e]:e.startsWith("on")?`on${Q_(e.substr(2))}`:e$.includes(e)?e:e.toLowerCase()}var Tt=k_(e=>{const t={};for(const n in e){const o=e[n];n==="children"?typeof o=="string"&&(t.innerHTML=o):t[t$(n)]=e[n]}return t});function Ml(e){const t=e().defaultValue??e().value,n=e().isEqual??Object.is,o=El(t),i=T(()=>e().value!==void 0),a=El(i.value?e().value:o.value);return{initial:t,ref:a,get(){return i.value?e().value:o.value},set(r){var s,l;const c=i.value?e().value:o.value,d=ao(r)?r(c):r;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:d,prev:c}),i.value||(o.value=d),n(d,c)||(l=(s=e()).onChange)==null||l.call(s,d,c)},invoke(r,s){var l,c;(c=(l=e()).onChange)==null||c.call(l,r,s)},hash(r){var s,l;return((l=(s=e()).hash)==null?void 0:l.call(s,r))??String(r)}}}Ml.cleanup=e=>{Wu(()=>e())};Ml.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function n$(e){const t={current:e};return{get(n){return t.current[n]},set(n,o){t.current[n]=o}}}var o$=(e,t)=>{Ae(()=>[...e.map(n=>n())],(n,o)=>{let i=!1;for(let a=0;a<n.length;a++)if(!Je(o[a],Re(n[a]))){i=!0;break}i&&t()})};function bt(e,t={}){var n,o,i;const a=T(()=>{const{id:M,ids:j,getRootNode:Q}=Re(t);return $_({id:M,ids:j,getRootNode:Q})}),r=(...M)=>{e.debug&&console.log(...M)},s=T(()=>{var M;return((M=e.props)==null?void 0:M.call(e,{props:vc(Re(t)),get scope(){return a.value}}))??Re(t)}),l=i$(s),c=(n=e.context)==null?void 0:n.call(e,{prop:l,bindable:Ml,get scope(){return a.value},flush:Ip,getContext(){return d},getComputed(){return P},getRefs(){return g},getEvent(){return f()}}),d={get(M){var j;return(j=c[M])==null?void 0:j.get()},set(M,j){var Q;(Q=c[M])==null||Q.set(j)},initial(M){var j;return(j=c[M])==null?void 0:j.initial},hash(M){var j,Q;const N=(j=c[M])==null?void 0:j.get();return(Q=c[M])==null?void 0:Q.hash(N)}};let u=new Map,h=null,p={current:null},m={current:{type:""}};const f=()=>({...m.current,current(){return m.current},previous(){return p.current}}),b=()=>({...$,matches(...M){const j=$.get();return M.includes(j)},hasTag(M){var j,Q;const N=$.get();return!!((Q=(j=e.states[N])==null?void 0:j.tags)!=null&&Q.includes(M))}}),g=n$(((o=e.refs)==null?void 0:o.call(e,{prop:l,context:d}))??{}),y=()=>({state:b(),context:d,event:f(),prop:l,send:A,action:x,guard:C,track:o$,refs:g,computed:P,flush:Ip,get scope(){return a.value},choose:O}),x=M=>{const j=ao(M)?M(y()):M;if(!j)return;const Q=j.map(N=>{var B,G;const J=(G=(B=e.implementations)==null?void 0:B.actions)==null?void 0:G[N];return J||Wn(`[zag-js] No implementation found for action "${JSON.stringify(N)}"`),J});for(const N of Q)N?.(y())},C=M=>{var j,Q;return ao(M)?M(y()):(Q=(j=e.implementations)==null?void 0:j.guards)==null?void 0:Q[M](y())},k=M=>{const j=ao(M)?M(y()):M;if(!j)return;const Q=j.map(B=>{var G,J;const Z=(J=(G=e.implementations)==null?void 0:G.effects)==null?void 0:J[B];return Z||Wn(`[zag-js] No implementation found for effect "${JSON.stringify(B)}"`),Z}),N=[];for(const B of Q){const G=B?.(y());G&&N.push(G)}return()=>N.forEach(B=>B?.())},O=M=>Js(M).find(j=>{let Q=!j.guard;return ir(j.guard)?Q=!!C(j.guard):ao(j.guard)&&(Q=j.guard(y())),Q}),P=M=>{ah(e.computed,()=>"[zag-js] No computed object found on machine");const j=e.computed[M];return j({context:d,event:f(),prop:l,refs:g,get scope(){return a.value},computed:P})},$=Ml(()=>({defaultValue:e.initialState({prop:l}),onChange(M,j){var Q,N,B;if(j){const J=u.get(j);J?.(),u.delete(j)}j&&x((Q=e.states[j])==null?void 0:Q.exit),x(h?.actions);const G=k((N=e.states[M])==null?void 0:N.effects);if(G&&u.set(M,G),j===Uc){x(e.entry);const J=k(e.effects);J&&u.set(Uc,J)}x((B=e.states[M])==null?void 0:B.entry)}}));let I=Ei.NotStarted;Dr(()=>{const M=I===Ei.Started;I=Ei.Started,r(M?"rehydrating...":"initializing..."),$.invoke($.initial,Uc)}),Pw(()=>{I=Ei.Stopped,r("unmounting...");const M=u.values();for(const j of M)j?.();u=new Map,x(e.exit)});const A=M=>{var j,Q;if(I!==Ei.Started)return;p.current=m.current,m.current=M;let N=$.get();const B=((j=e.states[N].on)==null?void 0:j[M.type])??((Q=e.on)==null?void 0:Q[M.type]),G=O(B);if(!G)return;h=G;const J=G.target??N;r("transition",M.type,G.target||N,`(${G.actions})`);const Z=J!==N;Z?$.set(J):G.reenter&&!Z?$.invoke(N,N):x(G.actions)};return(i=e.watch)==null||i.call(e,y()),{state:b(),send:A,context:d,prop:l,get scope(){return a.value},refs:g,computed:P,event:f(),getStatus:()=>I}}function i$(e){return function(t){return e.value[t]}}var Ip=e=>{po().then(()=>{e()})};const[vz,It]=xe("EnvironmentContext"),Pt=T(()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})),Wt=T(()=>({dir:"ltr",locale:"en-US"})),[bz,Ut]=xe("LocaleContext"),an=e=>{const t={};for(const[n,o]of Object.entries(e))o!==void 0&&(t[n]=o);return t},a$=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=T(()=>{const c=Re(e);return{id:n,dir:i.value.dir,getRootNode:o?.value.getRootNode,...an(c),onExitComplete:()=>{var d;t?.("exitComplete"),(d=c.onExitComplete)==null||d.call(c)},onOpenChange:d=>{var u;t?.("openChange",d),t?.("update:open",d.open),(u=c.onOpenChange)==null||u.call(c,d)}}}),r=bt(J_,a),s=T(()=>Z_(r,Tt)),l=he(!1);return Ae(()=>s.value.visible,()=>{s.value.visible&&(l.value=!0)}),T(()=>{const c=Re(e);return{...s.value,unmounted:!s.value.visible&&!l.value&&c.lazyMount||c.unmountOnExit&&!s.value.visible&&l.value}})},r$=E({__name:"collapsible-root",props:jt({collapsedHeight:{},collapsedWidth:{},defaultOpen:{type:Boolean},disabled:{type:Boolean},id:{},ids:{},lazyMount:{type:Boolean},open:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{defaultOpen:void 0,disabled:void 0,lazyMount:void 0,open:void 0,unmountOnExit:void 0}),emits:["exitComplete","openChange","update:open"],setup(e,{emit:t}){const n=a$(e,t);return _b(n),q(),(o,i)=>(w(),S(v(Y).div,F(v(n).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),s$=E({__name:"collapsible-trigger",props:{asChild:{type:Boolean}},setup(e){const t=jr();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),l$=E({__name:"collapsible-indicator",props:{asChild:{type:Boolean}},setup(e){const t=jr();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getIndicatorProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),xc=Object.freeze(Object.defineProperty({__proto__:null,Content:U_,Context:G_,Indicator:l$,Root:r$,RootProvider:q_,Trigger:s$},Symbol.toStringTag,{value:"Module"})),[$b,Wr]=xe("AccordionContext"),[c$,d$]=xe("AccordionItemContext"),[u$,sh]=xe("AccordionItemPropsContext"),kb=E({__name:"accordion-item",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=Wr(),n=e,o=T(()=>t.value.getItemState(n)),i=Hr(),a=T(()=>t.value.getItemContentProps(n));return c$(o),u$(n),q(),(r,s)=>(w(),S(v(xc).Root,F(v(t).getItemProps(n),{open:o.value.expanded,"lazy-mount":v(i).lazyMount,"unmount-on-exit":v(i).unmountOnExit,ids:{content:a.value.id}}),{default:_(()=>[D(r.$slots,"default")]),_:3},16,["open","lazy-mount","unmount-on-exit","ids"]))}}),h$=E({__name:"AccordionItem",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=We(e),n=T(()=>zr());return(o,i)=>(w(),S(v(kb),F(v(t),{class:[n.value.item],"data-testid":"atlantis-accordion-item"}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["class"]))}}),Sb=()=>(e,t)=>t.reduce((n,o)=>{const[i,a]=n,r=o;return a[r]!==void 0&&(i[r]=a[r]),delete a[r],[i,a]},[{},{...e}]),Eb=E({__name:"accordion-item-content",props:{asChild:{type:Boolean}},setup(e){const t=Sb(),n=Wr(),o=sh(),i=T(()=>{const a=n.value.getItemContentProps(o),[,r]=t(a,["hidden","data-state"]);return r});return q(),(a,r)=>(w(),S(v(xc).Content,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),p$=E({__name:"AccordionItemContent",props:{asChild:{type:Boolean}},setup(e){const t=We(e),n=T(()=>zr());return(o,i)=>(w(),S(v(Eb),F(v(t),{class:[n.value.itemContent],"data-testid":"atlantis-accordion-item-content"}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["class"]))}}),f$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",preserveAspectRatio:"none"};function g$(e,t){return w(),H("svg",f$,[...t[0]||(t[0]=[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5531 5.90623L10.089 6.37027L7.6187 8.84055C7.27698 9.18232 6.72297 9.18232 6.38126 8.84055L3.91094 6.37027L3.4469 5.90623L4.37498 4.97815L4.83902 5.44219L6.99998 7.60315L9.16097 5.44219L9.62499 4.97815L10.5531 5.90623Z",fill:"currentColor"},null,-1)])])}const Ob={render:g$},Tb=E({__name:"accordion-item-indicator",props:{asChild:{type:Boolean}},setup(e){const t=Wr(),n=sh();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getItemIndicatorProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),m$=E({__name:"AccordionItemIndicator",props:{asChild:{type:Boolean}},setup(e){const t=We(e),n=T(()=>zr());return(o,i)=>(w(),S(v(Tb),F(v(t),{class:[n.value.itemIndicator],"data-testid":"atlantis-accordion-item-indicator"}),{default:_(()=>[D(o.$slots,"default",{},()=>[z(v(Ob))])]),_:3},16,["class"]))}}),Ib=E({__name:"accordion-item-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Wr(),n=sh(),o=jr(),i=T(()=>{const{"aria-controls":a,...r}=t.value.getItemTriggerProps(n);return{...r,...o.value.unmounted?{}:{"aria-controls":a}}});return q(),(a,r)=>(w(),S(v(Y).button,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),v$=E({__name:"AccordionItemTrigger",props:{asChild:{type:Boolean}},setup(e){const t=We(e),n=Mr(),o=T(()=>zr());return(i,a)=>(w(),S(v(Ib),F(v(t),{class:[o.value.itemTrigger],"data-testid":"atlantis-accordion-item-trigger"}),{default:_(()=>[v(n).prefix?(w(),H("div",{key:0,class:R(o.value.itemTriggerPrefix)},[D(i.$slots,"prefix")],2)):te("",!0),U("div",{class:R([o.value.itemTriggerContent])},[D(i.$slots,"default")],2)]),_:3},16,["class"]))}}),b$=E({__name:"accordion-context",setup(e){const t=Wr();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),y$=E({__name:"accordion-item-context",setup(e){const t=d$();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),x$=E({__name:"accordion-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return $b(n),xn(T(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),w$=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=T(()=>{const s=Re(e);return{id:n,dir:i.value.dir,getRootNode:o?.value.getRootNode,onFocusChange:l=>t?.("focusChange",l),value:s.modelValue,...an(s),onValueChange:l=>{var c;t?.("valueChange",l),t?.("update:modelValue",l.value),(c=s?.onValueChange)==null||c.call(s,l)}}}),r=bt(R_,a);return T(()=>V_(r,Tt))},C$=E({__name:"accordion-root",props:jt({collapsible:{type:Boolean},defaultValue:{},disabled:{type:Boolean},id:{},ids:{},modelValue:{},multiple:{type:Boolean},orientation:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{collapsible:void 0,disabled:void 0,multiple:void 0}),emits:["focusChange","valueChange","update:modelValue"],setup(e,{emit:t}){const n=e,o=w$(n,t);return $b(o),xn(T(()=>({lazyMount:n.lazyMount,unmountOnExit:n.unmountOnExit}))),q(),(i,a)=>(w(),S(v(Y).div,F(v(o).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),_$=Object.freeze(Object.defineProperty({__proto__:null,Context:b$,Item:kb,ItemContent:Eb,ItemContext:y$,ItemIndicator:Tb,ItemTrigger:Ib,Root:C$,RootProvider:x$},Symbol.toStringTag,{value:"Module"})),$$=E({__name:"AccordionRoot",props:{collapsible:{type:Boolean},defaultValue:{},disabled:{type:Boolean},id:{},ids:{},modelValue:{},multiple:{type:Boolean},orientation:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean},variant:{default:"default"}},emits:["focusChange","valueChange","update:modelValue"],setup(e,{emit:t}){const n=e,o=We(n,t),i=T(()=>zr({variant:n.variant}));return(a,r)=>(w(),S(v(_$).Root,F(v(o),{class:[i.value.root],"data-testid":"atlantis-accordion-root"}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["class"]))}}),k$=le("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator");k$.build();const[yz,wn]=xe("FieldContext");function S$(e){if(!e)return;const t=Gi(e);return"box-sizing:"+t.boxSizing+";border-left:"+t.borderLeftWidth+" solid red;border-right:"+t.borderRightWidth+" solid red;font-family:"+t.fontFamily+";font-feature-settings:"+t.fontFeatureSettings+";font-kerning:"+t.fontKerning+";font-size:"+t.fontSize+";font-stretch:"+t.fontStretch+";font-style:"+t.fontStyle+";font-variant:"+t.fontVariant+";font-variant-caps:"+t.fontVariantCaps+";font-variant-ligatures:"+t.fontVariantLigatures+";font-variant-numeric:"+t.fontVariantNumeric+";font-weight:"+t.fontWeight+";letter-spacing:"+t.letterSpacing+";margin-left:"+t.marginLeft+";margin-right:"+t.marginRight+";padding-left:"+t.paddingLeft+";padding-right:"+t.paddingRight+";text-indent:"+t.textIndent+";text-transform:"+t.textTransform}function E$(e){var t=e.createElement("div");return t.id="ghost",t.style.cssText="display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;",e.body.appendChild(t),t}function O$(e){if(!e)return;const t=Ot(e),n=Fe(e),o=E$(t),i=S$(e);i&&(o.style.cssText+=i);function a(){n.requestAnimationFrame(()=>{o.innerHTML=e.value;const r=n.getComputedStyle(o);e?.style.setProperty("width",r.width)})}return a(),e?.addEventListener("input",a),e?.addEventListener("change",a),()=>{t.body.removeChild(o),e?.removeEventListener("input",a),e?.removeEventListener("change",a)}}var Pb=(e=>(e.ArrowUp="↑",e.ArrowDown="↓",e.ArrowLeft="←",e.ArrowRight="→",e.Enter="↵",e.Tab="⇥",e.Escape="Esc",e.Space="␣",e.Backspace="⌫",e.Delete="Del",e.PageUp="PgUp",e.PageDown="PgDn",e.Command="⌘",e.Control="CTRL",e))(Pb||{});const T$={default:{},inverted:{color:"text.inverse",background:"background.neutral-default",boxShadow:"inner-highlighted-ring"}},I$=ri({base:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",paddingX:"2",height:"14",textAlign:"center",fontFamily:"mono",fontSize:"xs",fontStyle:"normal",fontWeight:"regular",lineHeight:"sm",letterSpacing:"tight",textTransform:"uppercase",color:"text.subtle",background:"background.neutral-default",boxShadow:"inner-highlighted-ring"},defaultVariants:{type:"default"},variants:{type:T$}}),Rl=E({__name:"KeyboardKey",props:{type:{default:"default"},keys:{default:()=>[]},macKeys:{default:()=>[]},windowsKeys:{default:()=>[]},forcePlatform:{default:"mac"}},setup(e){const t=e,n=r=>r==="Ctrl"?"Control":r==="Meta"?"Command":r,o=r=>{const s=n(r);return Pb[s]||r},i=he("windows");Ae(()=>t.forcePlatform,r=>{r&&(i.value=r)}),Dr(()=>{t.forcePlatform?i.value=t.forcePlatform:typeof navigator<"u"&&(i.value=navigator.userAgent.toLowerCase().includes("mac")?"mac":"windows")});const a=T(()=>t.macKeys||t.windowsKeys?i.value==="mac"?t.macKeys??[]:t.windowsKeys??[]:t.keys??[]);return(r,s)=>(w(),H("div",{class:R(v(dt)({display:"flex",columnGap:"3"}))},[(w(!0),H(we,null,Oe(a.value,l=>(w(),H("div",{key:l,class:R(v(I$)({type:e.type}))},oe(o(l)),3))),128))],2))}}),P$=se({className:"spinner",slots:["root","spinner","background","rotationWrapper"],base:{root:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center"},spinner:{width:"100%",height:"100%"},background:{position:"absolute",top:"0",left:"0"},rotationWrapper:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",animation:"spin 1s linear infinite"}},variants:{variant:{default:{},inverted:{}},size:{sm:{root:{width:"16",height:"16"}},md:{root:{width:"24",height:"24"}},lg:{root:{width:"32",height:"32"}}}},defaultVariants:{variant:"default",size:"md"}}),V$=["aria-label"],D$=["fill"],M$=["fill"],Vb=E({__name:"Spinner",props:{variant:{default:"default"},size:{default:"md"},ariaLabel:{default:"Loading"}},setup(e){const t=e,n=T(()=>P$({variant:t.variant,size:t.size})),o=T(()=>t.variant==="default"?"var(--colors-icon-selected)":"var(--colors-icon-inverse)");return(i,a)=>(w(),H("div",{class:R(n.value.root),"aria-label":t.ariaLabel,role:"status","data-testid":"spinner"},[(w(),H("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:R([n.value.spinner,n.value.background])},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",fill:o.value,opacity:"0.3",d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12Z"},null,8,D$)],2)),U("div",{class:R([n.value.rotationWrapper,"spinner-rotate"])},[(w(),H("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:R(n.value.spinner)},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",fill:o.value,d:"M12 4C9.38441 4 7.06204 5.25316 5.59909 7.20034C4.9356 8.08342 3.68185 8.26146 2.79876 7.59798C1.91568 6.93449 1.73764 5.68074 2.40113 4.79765C4.58709 1.88817 8.07337 0 12 0C18.6274 0 24 5.37257 24 12C24 18.6274 18.6274 24 12 24C10.8954 24 10 23.1046 10 22C10 20.8954 10.8954 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z"},null,8,M$)],2))],2)],10,V$))}}),R$=se({slots:["root"],base:{root:{}},defaultVariants:{variant:"primary"},variants:{variant:{primary:{root:{color:"inherit"}},critical:{root:{color:"inherit"}},default:{root:{color:"inherit"}},subtle:{root:{color:"inherit"}},plainPrimary:{root:{color:"inherit"}},plainCritical:{root:{color:"inherit"}},dashed:{root:{color:"inherit"}},validation:{root:{color:"inherit"}},link:{root:{color:"inherit",textStyle:"body_small_medium"}}}}}),A$=E({__name:"ButtonText",props:{text:{},variant:{default:"primary"}},setup(e){const t=e,n=T(()=>R$({variant:t.variant}));return(o,i)=>(w(),H("span",{class:R(n.value.root)},[D(o.$slots,"default",{},()=>[Te(oe(t.text),1)])],2))}}),qe={primary:{_active:{background:"background.brand-bold-pressed !important"},color:"whitealpha.1000",background:"background.brand-bold-default",boxShadow:"stroke-bordered-interactive",_hover:{background:"background.brand-bold-hover"},_focus:{background:"background.brand-bold-default",boxShadow:"state-focus-primary"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},critical:{background:"colorPalette.700",color:"whitealpha.1000",boxShadow:"stroke-bordered-interactive",colorPalette:"red",_active:{background:"background.error-bold-pressed !important"},_hover:{background:"colorPalette.800"},_focus:{background:"background.error-bold-default",boxShadow:"state-focus-critical"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},default:{background:"whitealpha.1000",color:"graycool.1000",colorPalette:"whitealpha",boxShadow:"stroke-bordered-interactive",_hover:{background:"graycoolalpha.10"},_active:{background:"background.pressed !important"},_focus:{boxShadow:"state-focus-primary",zIndex:"100000"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},subtle:{background:"whitealpha.1000",color:"text.subtle",_active:{background:"background.pressed !important"},_disabled:{background:"background.pressed"},_hover:{background:"background.hover"},_focus:{boxShadow:"state-focus-primary"}},plainPrimary:{background:"whitealpha.1000",color:"colorPalette.800",colorPalette:"seed",_active:{background:"background.brand-selected-pressed !important",color:"text.brand-pressed"},_hover:{backgroundColor:"colorPalette.200"},_selected:{background:"colorPalette.a3"},_disabled:{color:"text.disabled",background:"whitealpha.1000",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"whitealpha.1000"}},_focus:{boxShadow:"state-focus-primary",color:"text.brand-default"}},plainCritical:{background:"whitealpha.1000",color:"colorPalette.800",colorPalette:"red",_active:{background:"background.error-pressed !important",color:"text.error-pressed"},_hover:{backgroundColor:"colorPalette.200"},_selected:{background:"colorPalette.a3"},_disabled:{color:"text.disabled",background:"whitealpha.1000",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"whitealpha.1000"}},_focus:{boxShadow:"state-focus-critical",color:"text.error-default"}},dashed:{'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"},boxShadow:"stroke-bordered-interactive",background:"whitealpha.1000",color:"graycool.900",colorPalette:"whitealpha",border:"1px dashed",borderColor:"graycoolalpha.75",_active:{background:"background.hover !important",color:"text.normal"},_hover:{background:"graycoolalpha.10"},_focus:{boxShadow:"state-focus-primary"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}}},validation:{background:"colorPalette.700",color:"whitealpha.1000",colorPalette:"green",boxShadow:"stroke-bordered-interactive",_active:{background:"background.success-bold-pressed !important"},_hover:{background:"colorPalette.800"},_focus:{background:"background.success-bold-default",boxShadow:"state-focus-success"},_disabled:{color:"graycoolalpha.75",background:"graycoolalpha.20",cursor:"not-allowed",_hover:{color:"graycoolalpha.75",background:"graycoolalpha.20"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},link:{background:"transparent",color:"text.brand-default",textStyle:"body_small_medium",padding:"0",height:"auto",_hover:{},_focus:{},_disabled:{color:"text.disabled",cursor:"not-allowed"}}},Pp={default:{width:"32",height:"32"},small:{width:"24",height:"24"}},F$=se({slots:["root","content","spinner","label","slots"],base:{root:{alignItems:"center",appearance:"none",cursor:"pointer",display:"inline-flex",isolation:"isolate",minWidth:"0",justifyContent:"center",outline:"none",position:"relative",transitionDuration:"normal",transitionProperty:"background, border-color, color, box-shadow",transitionTimingFunction:"default",userSelect:"none",verticalAlign:"middle",borderRadius:"md",border:"none",fontSize:"base",fontWeight:"medium",fontFamily:"sans",lineHeight:"lg",whiteSpace:"nowrap",_hidden:{display:"none"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}}},content:{display:"flex",alignItems:"center",gap:"6"},spinner:{width:"16",height:"16","&[data-loading]":{opacity:"0.7"}},label:{"&[data-loading]":{opacity:"0.7"}},slots:{display:"flex",alignItems:"center",justifyContent:"center"}},defaultVariants:{type:"primary",size:"default"},variants:{type:{primary:{root:qe.primary,spinner:{}},critical:{root:qe.critical},default:{root:qe.default},subtle:{root:qe.subtle},plainPrimary:{root:qe.plainPrimary},plainCritical:{root:qe.plainCritical},dashed:{root:qe.dashed},validation:{root:qe.validation},link:{root:qe.link}},size:{default:{root:{px:"12",py:"6",gap:"6"}},small:{root:{px:"8",py:"2",gap:"6"}}}}}),N$=["disabled","data-loading","data-selected","aria-busy"],Xt=E({__name:"Button",props:{type:{default:"primary"},size:{default:"default"},isLoading:{type:Boolean},isDisabled:{type:Boolean},label:{},isSelected:{type:Boolean,default:!1},shortcutKeys:{}},setup(e){const t=Mr(),n=e,o=T(()=>F$({type:n.type,size:n.size})),i=T(()=>n.type==="primary"||n.type==="validation"||n.type==="critical"?"inverted":"default"),a=T(()=>t.prefix),r=T(()=>t.suffix);return(s,l)=>(w(),H("button",{disabled:n.isDisabled,"data-loading":n.isLoading||null,"data-selected":n.isSelected||null,"aria-busy":n.isLoading||void 0,class:R([o.value.root,v(dt)(n.isSelected?{background:"background.brand-selected !important",color:"text.selected !important"}:{})])},[U("div",{class:R([o.value.content,n.isLoading?v(dt)({position:"relative"}):""])},[a.value?(w(),H("div",{key:0,class:R([o.value.slots,n.isLoading?v(dt)({visibility:"hidden"}):""])},[D(s.$slots,"prefix")],2)):te("",!0),n.isLoading?(w(),S(Vb,{key:1,class:R([o.value.spinner,n.isLoading?v(dt)({position:"absolute",transform:"translate(-50%, -50%)",top:"50%",left:"50%"}):""]),variant:i.value,"data-loading":n.isLoading||null},null,8,["class","variant","data-loading"])):te("",!0),U("div",{class:R([a.value?v(dt)({paddingRight:"2",display:"inline-flex"}):"",r.value?v(dt)({paddingLeft:"2",display:"inline-flex"}):"",o.value.label,n.isLoading?v(dt)({visibility:"hidden"}):""])},[D(s.$slots,"default",{},()=>[n.label?(w(),S(A$,{key:0,text:n.label,variant:n.type},null,8,["text","variant"])):te("",!0)])],2),r.value?(w(),H("div",{key:2,class:R([o.value.slots,n.isLoading?v(dt)({visibility:"hidden"}):""])},[D(s.$slots,"suffix")],2)):te("",!0),n.shortcutKeys?(w(),H("div",{key:3,class:R([n.isLoading?v(dt)({visibility:"hidden"}):""])},[z(Rl,{type:"default",keys:n.shortcutKeys},null,8,["keys"])],2)):te("",!0)],2)],10,N$))}}),L$={default:{},error:{root:{boxShadow:"state-focus-critical",_focusWithin:{boxShadow:"state-focus-critical"},_focus:{boxShadow:"state-focus-critical"}}}},B$={default:{},chat:{root:{borderBottomRadius:"none"}}};se({slots:["root","input","inputContainer","suffixButton","footer"],base:{root:{padding:"8",display:"flex",flexDirection:"column",gap:"8",background:"background.gray-subtlest-default",boxShadow:"stroke-container",transitionDuration:"normal",transitionProperty:"background, border-color, color, box-shadow",transitionTimingFunction:"default",borderRadius:"md",_hover:{backgroundColor:"background.gray-subtlest-hover"},_focus:{boxShadow:"state-focus-primary"},_focusWithin:{boxShadow:"state-focus-primary"}},inputContainer:{display:"flex",gap:"12"},input:{resize:"none",width:"100%",textAlign:"left",outline:"none",display:"flex",padding:"0",borderRadius:"none",borderTopLeftRadius:"md",border:"none",backgroundColor:"transparent",fontFamily:"sans",fontSize:"base",fontWeight:"regular",lineHeight:"lg",letterSpacing:"normal",_placeholder:{color:"text.placeholder"},_disabled:{backgroundColor:"background.disabled",color:"text.disabled",cursor:"not-allowed",_hover:{backgroundColor:"background.disabled"}}},suffixButton:{width:"fit-content",height:"fit-content",paddingX:"4 !important",paddingY:"4 !important"}},variants:{variant:B$,state:L$,disabled:{true:{root:{cursor:"not-allowed",backgroundColor:"background.disabled",color:"text.subtle",boxShadow:"none",_hover:{backgroundColor:"background.disabled"},_focusWithin:{boxShadow:"none"},_focus:{boxShadow:"none"}},input:{cursor:"not-allowed",backgroundColor:"transparent",color:"text.subtle","&::placeholder":{color:"text.placeholder"}}},false:{}}},defaultVariants:{variant:"default",state:"default",disabled:!1}});const z$=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},H$=se({slots:["root","content"],base:{root:{alignItems:"center",appearance:"none",cursor:"pointer",display:"inline-flex",isolation:"isolate",minWidth:"0",justifyContent:"center",outline:"none",userSelect:"none",verticalAlign:"middle",borderRadius:"md",border:"none",_hidden:{display:"none"}},content:{display:"flex",alignItems:"center",justifyContent:"center"}},defaultVariants:{type:"primary",size:"default"},variants:{type:{primary:{root:qe.primary},critical:{root:qe.critical},default:{root:qe.default},subtle:{root:qe.subtle},dashed:{root:qe.dashed},plain:{root:{background:"none",_focusVisible:{boxShadow:"state-focus-primary"},_disabled:{padding:0,boxShadow:"none",background:"graycoolalpha.20",borderColor:"border.disabled",color:"graycoolalpha.75",cursor:"not-allowed",_hover:{background:"graycoolalpha.20",borderColor:"border.disabled",color:"graycoolalpha.75"}}}}},size:{default:{root:Pp.default},small:{root:Pp.small}}},compoundVariants:[{type:"plain",size:"default",css:{root:{width:"16 !important",height:"16 !important"}}},{type:"plain",size:"small",css:{root:{width:"16 !important",height:"16 !important"}}}]}),j$=["disabled","data-selected"],gi=E({__name:"IconButton",props:{type:{},size:{},isDisabled:{type:Boolean},isSelected:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=e,o=t,i=r=>{n.isDisabled||o("click",r)},a=T(()=>H$({type:n.type,size:n.size}));return(r,s)=>(w(),H("button",{disabled:n.isDisabled,"data-selected":n.isSelected||null,"aria-label":"Icon button",onClick:i,class:R([a.value.root,v(dt)(n.isSelected?{background:"background.brand-selected !important",color:"text.selected !important"}:{})])},[U("div",{class:R(a.value.content)},[D(r.$slots,"prefixIcon")],2)],10,j$))}});se({slots:["container","indicator","message","icon","title"],base:{indicator:{minHeight:"3.85rem",borderTopLeftRadius:"md",borderBottomLeftRadius:"md",position:"absolute",left:"-0.0625rem",top:"0",width:"0.25rem",height:"100%"},container:{display:"flex",borderRadius:"md",boxShadow:"inner-highlighted-ring",position:"relative",minHeight:"3.75rem",padding:"8",fontSize:"md",fontWeight:"medium"},title:{fontSize:"base",fontWeight:"regular",color:"text.normal",fontFamily:"sans",lineHeight:"lg",letterSpacing:"normal"}},variants:{type:{info:{indicator:{backgroundColor:"blue.800"},icon:{color:"blue.800"}},warning:{indicator:{backgroundColor:"orange.800"},icon:{color:"orange.800"}},issue:{indicator:{backgroundColor:"red.800"},icon:{color:"red.800"}}}},defaultVariants:{type:"info"}});var W$=le("avatar").parts("root","image","fallback");W$.build();ee()(["dir","id","ids","onStatusChange","getRootNode"]);se({slots:["root","image","fallback"],base:{root:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",overflow:"hidden",userSelect:"none",boxShadow:"stroke-bordered-interactive",background:"background.default"},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"inherit"},fallback:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#F2F2F5",color:"text.subtle",textAlign:"center",borderRadius:"inherit"}},variants:{size:{xs:{root:{width:"16",height:"16"},fallback:{textStyle:"body_xsmall_caps_medium"}},sm:{root:{width:"20",height:"20"},fallback:{textStyle:"body_xsmall_caps_medium"}},md:{root:{width:"24",height:"24"},fallback:{textStyle:"body_xsmall_caps_medium"}},lg:{root:{width:"32",height:"32",padding:"2"},fallback:{textStyle:"body_small_semibold"}},xl:{root:{width:"40",height:"40",padding:"2"},fallback:{textStyle:"body_base_semibold"}}},shape:{rounded:{root:{borderRadius:"full"}},square:{root:{borderRadius:"md"}}}},defaultVariants:{size:"md",shape:"rounded"}});var U$=Object.defineProperty,G$=(e,t,n)=>t in e?U$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_n=(e,t,n)=>G$(e,typeof t!="symbol"?t+"":t,n),Vp=class Ge{constructor([t,n,o,i,a,r]=[0,0,0,0,0,0]){_n(this,"m00"),_n(this,"m01"),_n(this,"m02"),_n(this,"m10"),_n(this,"m11"),_n(this,"m12"),_n(this,"rotate",(...s)=>this.prepend(Ge.rotate(...s))),_n(this,"scale",(...s)=>this.prepend(Ge.scale(...s))),_n(this,"translate",(...s)=>this.prepend(Ge.translate(...s))),this.m00=t,this.m01=n,this.m02=o,this.m10=i,this.m11=a,this.m12=r}applyTo(t){const{x:n,y:o}=t,{m00:i,m01:a,m02:r,m10:s,m11:l,m12:c}=this;return{x:i*n+a*o+r,y:s*n+l*o+c}}prepend(t){return new Ge([this.m00*t.m00+this.m01*t.m10,this.m00*t.m01+this.m01*t.m11,this.m00*t.m02+this.m01*t.m12+this.m02,this.m10*t.m00+this.m11*t.m10,this.m10*t.m01+this.m11*t.m11,this.m10*t.m02+this.m11*t.m12+this.m12])}append(t){return new Ge([t.m00*this.m00+t.m01*this.m10,t.m00*this.m01+t.m01*this.m11,t.m00*this.m02+t.m01*this.m12+t.m02,t.m10*this.m00+t.m11*this.m10,t.m10*this.m01+t.m11*this.m11,t.m10*this.m02+t.m11*this.m12+t.m12])}get determinant(){return this.m00*this.m11-this.m01*this.m10}get isInvertible(){const t=this.determinant;return isFinite(t)&&isFinite(this.m02)&&isFinite(this.m12)&&t!==0}invert(){const t=this.determinant;return new Ge([this.m11/t,-this.m01/t,(this.m01*this.m12-this.m11*this.m02)/t,-this.m10/t,this.m00/t,(this.m10*this.m02-this.m00*this.m12)/t])}get array(){return[this.m00,this.m01,this.m02,this.m10,this.m11,this.m12,0,0,1]}get float32Array(){return new Float32Array(this.array)}static get identity(){return new Ge([1,0,0,0,1,0])}static rotate(t,n){const o=new Ge([Math.cos(t),-Math.sin(t),0,Math.sin(t),Math.cos(t),0]);return n&&(n.x!==0||n.y!==0)?Ge.multiply(Ge.translate(n.x,n.y),o,Ge.translate(-n.x,-n.y)):o}static scale(t,n=t,o={x:0,y:0}){const i=new Ge([t,0,0,0,n,0]);return o.x!==0||o.y!==0?Ge.multiply(Ge.translate(o.x,o.y),i,Ge.translate(-o.x,-o.y)):i}static translate(t,n){return new Ge([1,0,t,0,1,n])}static multiply(...[t,...n]){return t?n.reduce((o,i)=>o.prepend(i),t):Ge.identity}get a(){return this.m00}get b(){return this.m10}get c(){return this.m01}get d(){return this.m11}get tx(){return this.m02}get ty(){return this.m12}get scaleComponents(){return{x:this.a,y:this.d}}get translationComponents(){return{x:this.tx,y:this.ty}}get skewComponents(){return{x:this.c,y:this.b}}toString(){return`matrix(${this.a}, ${this.b}, ${this.c}, ${this.d}, ${this.tx}, ${this.ty})`}},Dp=(e,t,n)=>Math.min(Math.max(e,t),n),as=(e,t,n)=>{const o=Dp(e.x,n.x,n.x+n.width-t.width),i=Dp(e.y,n.y,n.y+n.height-t.height);return{x:o,y:i}},q$={width:0,height:0},Y$={width:1/0,height:1/0},rs=(e,t=q$,n=Y$)=>({width:Math.min(Math.max(e.width,t.width),n.width),height:Math.min(Math.max(e.height,t.height),n.height)}),zo=(e,t)=>({x:e,y:t}),Mp=(e,t)=>t?zo(e.x-t.x,e.y-t.y):e,K$=(e,t)=>zo(e.x+t.x,e.y+t.y);function Ur(e){const{x:t,y:n,width:o,height:i}=e,a=t+o/2,r=n+i/2;return{x:t,y:n,width:o,height:i,minX:t,minY:n,maxX:t+o,maxY:n+i,midX:a,midY:r,center:zo(a,r)}}function X$(e){const t=zo(e.minX,e.minY),n=zo(e.maxX,e.minY),o=zo(e.maxX,e.maxY),i=zo(e.minX,e.maxY);return{top:t,right:n,bottom:o,left:i}}var Z$=(e,t)=>{const n=Math.max(t.x,Math.min(e.x,t.x+t.width-e.width)),o=Math.max(t.y,Math.min(e.y,t.y+t.height-e.height));return{x:n,y:o,width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}},J$=(e,t)=>e.width===t?.width&&e.height===t?.height,Q$=(e,t)=>e.x===t?.x&&e.y===t?.y,qc=new WeakMap;function ek(e){if(!qc.has(e)){const t=e.ownerDocument.defaultView||window;qc.set(e,t.getComputedStyle(e))}return qc.get(e)}function Db(e,t={}){return Ur(tk(e,t))}function tk(e,t={}){const{excludeScrollbar:n=!1,excludeBorders:o=!1}=t,{x:i,y:a,width:r,height:s}=e.getBoundingClientRect(),l={x:i,y:a,width:r,height:s},c=ek(e),{borderLeftWidth:d,borderTopWidth:u,borderRightWidth:h,borderBottomWidth:p}=c,m=Rp(d,h),f=Rp(u,p);if(o&&(l.width-=m,l.height-=f,l.x+=jd(d),l.y+=jd(u)),n){const b=e.offsetWidth-e.clientWidth-m,g=e.offsetHeight-e.clientHeight-f;l.width-=b,l.height-=g}return l}var jd=e=>parseFloat(e.replace("px","")),Rp=(...e)=>e.reduce((t,n)=>t+(n?jd(n):0),0);function nk(e,t={}){return Ur(ok(e,t))}function ok(e,t){const{excludeScrollbar:n=!1}=t,{innerWidth:o,innerHeight:i,document:a,visualViewport:r}=e,s=r?.width||o,l=r?.height||i,c={x:0,y:0,width:s,height:l};if(n){const d=o-a.documentElement.clientWidth,u=i-a.documentElement.clientHeight;c.width-=d,c.height-=u}return c}function ik(e,t){const n=Ur(e),{top:o,right:i,left:a,bottom:r}=X$(n),[s]=t.split("-");return{top:[a,o,i,r],right:[o,i,r,a],bottom:[o,a,r,i],left:[i,o,a,r]}[s]}function ak(e,t){const{x:n,y:o}=t;let i=!1;for(let a=0,r=e.length-1;a<e.length;r=a++){const s=e[a].x,l=e[a].y,c=e[r].x,d=e[r].y;l>o!=d>o&&n<(c-s)*(o-l)/(d-l)+s&&(i=!i)}return i}var Ap={n:{x:.5,y:0},ne:{x:1,y:0},e:{x:1,y:.5},se:{x:1,y:1},s:{x:.5,y:1},sw:{x:0,y:1},w:{x:0,y:.5},nw:{x:0,y:0}},rk={n:"s",ne:"sw",e:"w",se:"nw",s:"n",sw:"ne",w:"e",nw:"se"},{sign:ss,abs:Ai,min:Fp}=Math;function Np(e,t){const{minX:n,minY:o,maxX:i,maxY:a,midX:r,midY:s}=e,l=t.includes("w")?n:t.includes("e")?i:r,c=t.includes("n")?o:t.includes("s")?a:s;return{x:l,y:c}}function sk(e){return rk[e]}function lk(e,t,n,o){const{scalingOriginMode:i,lockAspectRatio:a}=o,r=Np(e,n),s=sk(n),l=Np(e,s);i==="center"&&(t={x:t.x*2,y:t.y*2});const c={x:r.x+t.x,y:r.y+t.y},d={x:Ap[n].x*2-1,y:Ap[n].y*2-1},u={width:c.x-l.x,height:c.y-l.y},h=d.x*u.width/e.width,p=d.y*u.height/e.height,m=Ai(h)>Ai(p)?h:p,f=a?{x:m,y:m}:{x:r.x===l.x?1:h,y:r.y===l.y?1:p};switch(r.y===l.y?f.y=Ai(f.y):ss(f.y)!==ss(p)&&(f.y*=-1),r.x===l.x?f.x=Ai(f.x):ss(f.x)!==ss(h)&&(f.x*=-1),i){case"extent":return Lp(e,Vp.scale(f.x,f.y,l),!1);case"center":return Lp(e,Vp.scale(f.x,f.y,{x:e.midX,y:e.midY}),!1)}}function ck(e,t,n=!0){return n?{x:Fp(t.x,e.x),y:Fp(t.y,e.y),width:Ai(t.x-e.x),height:Ai(t.y-e.y)}:{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}}function Lp(e,t,n=!0){const o=t.applyTo({x:e.minX,y:e.minY}),i=t.applyTo({x:e.maxX,y:e.maxY});return ck(o,i,n)}var dk=le("angle-slider").parts("root","label","thumb","valueText","control","track","markerGroup","marker");dk.build();ee()(["aria-label","aria-labelledby","dir","disabled","getRootNode","id","ids","invalid","name","onValueChange","onValueChangeEnd","readOnly","step","value","defaultValue"]);function uk(e,t){const{state:n,send:o,context:i}=e,a=n.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:a,setNode(r){r&&o({type:"NODE.SET",node:r})},unmount(){o({type:"UNMOUNT"})}}}var hk={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:["clearInitial","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)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",Gi(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:o})=>{const i=o("present");if(i)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!i&&a?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});ae(()=>{var r,s;const l=ls(t.get("styles"));e.set("unmountAnimationName",l),l==="none"||l===e.get("prevAnimationName")||((r=t.get("styles"))==null?void 0:r.display)==="none"||((s=t.get("styles"))==null?void 0:s.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{ae(()=>{e.set("prevAnimationName",ls(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:o})=>{const i=t.get("node");if(!i)return;const a=l=>{var c,d;(((d=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:d[0])??l.target)===i&&e.set("prevAnimationName",ls(t.get("styles")))},r=l=>{const c=ls(t.get("styles"));Pe(l)===i&&c===e.get("unmountAnimationName")&&!o("present")&&n({type:"UNMOUNT",src:"animationend"})};i.addEventListener("animationstart",a),i.addEventListener("animationcancel",r),i.addEventListener("animationend",r);const s=ih(i,{animationFillMode:"forwards"});return()=>{i.removeEventListener("animationstart",a),i.removeEventListener("animationcancel",r),i.removeEventListener("animationend",r),pc(()=>s())}}}}};function ls(e){return e?.animationName||"none"}ee()(["onExitComplete","present","immediate"]);const lh=(e,t)=>{const n=he(!1),o=he(null),i=T(()=>({present:Re(e).present,onExitComplete:()=>{}})),a=bt(hk,i),r=T(()=>uk(a));return Ae(()=>r.value.present,()=>{r.value.present&&(n.value=!0)}),Ae(o,()=>{if(o.value){const s=o.value.$el?o.value.$el:o.value;s&&r.value.setNode(s)}}),T(()=>{var s;const l=Re(e);return{present:r.value.present,unmounted:!r.value.present&&!n.value&&l.lazyMount||l?.unmountOnExit&&!((s=r.value)!=null&&s.present)&&n.value,presenceProps:{ref:o,hidden:!r.value.present,"data-state":r.value.skip&&l.skipAnimationOnMount?void 0:l!=null&&l.present?"open":"closed"}}})},[ch,dh]=xe("PresenceContext");var mi=new WeakMap,cs=new WeakMap,ds={},Yc=0,Mb=e=>e&&(e.host||Mb(e.parentNode)),pk=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Mb(n);return o&&e.contains(o)?o:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),fk=new Set(["script","output","status","next-route-announcer"]),gk=e=>fk.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),mk=(e,t)=>{const{parentNode:n,markerName:o,controlAttribute:i,followControlledElements:a=!0}=t,r=pk(n,Array.isArray(e)?e:[e]);ds[o]||(ds[o]=new WeakMap);const s=ds[o],l=[],c=new Set,d=new Set(r),u=p=>{!p||c.has(p)||(c.add(p),u(p.parentNode))};r.forEach(p=>{u(p),a&&Be(p)&&Gv(p,m=>{u(m)})});const h=p=>{!p||d.has(p)||Array.prototype.forEach.call(p.children,m=>{if(c.has(m))h(m);else try{if(gk(m))return;const f=m.getAttribute(i)==="true",b=(mi.get(m)||0)+1,g=(s.get(m)||0)+1;mi.set(m,b),s.set(m,g),l.push(m),b===1&&f&&cs.set(m,!0),g===1&&m.setAttribute(o,""),f||m.setAttribute(i,"true")}catch(f){console.error("[zag-js > ariaHidden] cannot operate on ",m,f)}})};return h(n),c.clear(),Yc++,()=>{l.forEach(p=>{const m=mi.get(p)-1,f=s.get(p)-1;mi.set(p,m),s.set(p,f),m||(cs.has(p)||p.removeAttribute(i),cs.delete(p)),f||p.removeAttribute(o)}),Yc--,Yc||(mi=new WeakMap,mi=new WeakMap,cs=new WeakMap,ds={})}},vk=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,bk=(e,t=vk(e),n="data-aria-hidden",o=!0)=>{if(t)return mk(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:o})},yk=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function xk(e,t={}){const{defer:n=!0}=t,o=n?yk:a=>a(),i=[];return i.push(o(()=>{const a=(typeof e=="function"?e():e).filter(Boolean);a.length!==0&&i.push(bk(a))})),()=>{i.forEach(a=>a?.())}}function wk(e){const t={each(n){var o;for(let i=0;i<((o=e.frames)==null?void 0:o.length);i+=1){const a=e.frames[i];a&&n(a)}},addEventListener(n,o,i){return t.each(a=>{try{a.document.addEventListener(n,o,i)}catch{}}),()=>{try{t.removeEventListener(n,o,i)}catch{}}},removeEventListener(n,o,i){t.each(a=>{try{a.document.removeEventListener(n,o,i)}catch{}})}};return t}function Ck(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,o,i)=>{try{t?.addEventListener(n,o,i)}catch{}return()=>{try{t?.removeEventListener(n,o,i)}catch{}}},removeEventListener:(n,o,i)=>{try{t?.removeEventListener(n,o,i)}catch{}}}}var Bp="pointerdown.outside",zp="focus.outside";function _k(e){for(const t of e)if(Be(t)&&Bn(t))return!0;return!1}var Rb=e=>"clientY"in e;function $k(e,t){if(!Rb(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 kk(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function Hp(e,t){if(!t||!Rb(e))return!1;const n=t.scrollHeight>t.clientHeight,o=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,a=i&&e.clientY>t.offsetTop+t.clientHeight,r={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},s={x:e.clientX,y:e.clientY};return kk(r,s)?o||a:!1}function Sk(e,t){const{exclude:n,onFocusOutside:o,onPointerDownOutside:i,onInteractOutside:a,defer:r,followControlledElements:s=!0}=t;if(!e)return;const l=Ot(e),c=Fe(e),d=wk(c),u=Ck(c);function h(x,C){if(!Be(C)||!C.isConnected||rt(e,C)||$k(e,x)||s&&Uv(e,C))return!1;const k=l.querySelector(`[aria-controls="${e.id}"]`);if(k){const P=Il(k);if(Hp(x,P))return!1}const O=Il(e);return Hp(x,O)?!1:!(n!=null&&n(C))}const p=new Set,m=Ui(e?.getRootNode());function f(x){function C(k){var O;const P=r&&!mp()?ae:A=>A(),$=k??x,I=((O=$?.composedPath)==null?void 0:O.call($))??[$?.target];P(()=>{const A=m?I[0]:Pe(x);if(!(!e||!h(x,A))){if(i||a){const M=xr(i,a);e.addEventListener(Bp,M,{once:!0})}jp(e,Bp,{bubbles:!1,cancelable:!0,detail:{originalEvent:$,contextmenu:rC($),focusable:_k(I),target:A}})}})}x.pointerType==="touch"?(p.forEach(k=>k()),p.add(ge(l,"click",C,{once:!0})),p.add(u.addEventListener("click",C,{once:!0})),p.add(d.addEventListener("click",C,{once:!0}))):C()}const b=new Set,g=setTimeout(()=>{b.add(ge(l,"pointerdown",f,!0)),b.add(u.addEventListener("pointerdown",f,!0)),b.add(d.addEventListener("pointerdown",f,!0))},0);function y(x){(r?ae:C=>C())(()=>{var C;const k=((C=x?.composedPath)==null?void 0:C.call(x))??[x?.target],O=m?k[0]:Pe(x);if(!(!e||!h(x,O))){if(o||a){const P=xr(o,a);e.addEventListener(zp,P,{once:!0})}jp(e,zp,{bubbles:!1,cancelable:!0,detail:{originalEvent:x,contextmenu:!1,focusable:Bn(O),target:O}})}})}return mp()||(b.add(ge(l,"focusin",y,!0)),b.add(u.addEventListener("focusin",y,!0)),b.add(d.addEventListener("focusin",y,!0))),()=>{clearTimeout(g),p.forEach(x=>x()),b.forEach(x=>x())}}function uh(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=typeof e=="function"?e():e;i.push(Sk(a,t))})),()=>{i.forEach(a=>a?.())}}function jp(e,t,n){const o=e.ownerDocument.defaultView||window,i=new o.CustomEvent(t,n);return e.dispatchEvent(i)}function Ek(e,t){const n=o=>{o.key==="Escape"&&(o.isComposing||t==null||t(o))};return ge(Ot(e),"keydown",n,{capture:!0})}var Wp="layer:request-dismiss",pt={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var t;const n=this.indexOf(e),o=this.topMostPointerBlockingLayer()?this.indexOf((t=this.topMostPointerBlockingLayer())==null?void 0:t.node):-1;return n<o},isTopMost(e){const t=this.layers[this.count()-1];return t?.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(o=>o.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(o=>o.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>rt(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>rt(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(n=>pt.dismiss(n.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)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const n=this.countNestedLayersOfType(e.node,e.type);n>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${n}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const o=this.layers[n];Tk(e,Wp,i=>{var a;(a=o.requestDismiss)==null||a.call(o,i),i.defaultPrevented||o==null||o.dismiss()}),Ok(e,Wp,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Ok(e,t,n){const o=e.ownerDocument.defaultView||window,i=new o.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(i)}function Tk(e,t,n){e.addEventListener(t,n,{once:!0})}var Up;function Gp(){pt.layers.forEach(({node:e})=>{e.style.pointerEvents=pt.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Ik(e){e.style.pointerEvents=""}function Pk(e,t){const n=Ot(e),o=[];return pt.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Up=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t?.forEach(i=>{const[a,r]=zC(()=>{const s=i();return Be(s)?s:null},{timeout:1e3});a.then(s=>o.push(ih(s,{pointerEvents:"auto"}))),o.push(r)}),()=>{pt.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=Up,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),o.forEach(i=>i()))}}function Vk(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Wn("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:o,onRequestDismiss:i,pointerBlocking:a,exclude:r,debug:s,type:l="dialog"}=t,c={dismiss:o,node:e,type:l,pointerBlocking:a,requestDismiss:i};pt.add(c),Gp();function d(f){var b,g;const y=Pe(f.detail.originalEvent);pt.isBelowPointerBlockingLayer(e)||pt.isInBranch(y)||((b=t.onPointerDownOutside)==null||b.call(t,f),(g=t.onInteractOutside)==null||g.call(t,f),!f.defaultPrevented&&(s&&console.log("onPointerDownOutside:",f.detail.originalEvent),o?.()))}function u(f){var b,g;const y=Pe(f.detail.originalEvent);pt.isInBranch(y)||((b=t.onFocusOutside)==null||b.call(t,f),(g=t.onInteractOutside)==null||g.call(t,f),!f.defaultPrevented&&(s&&console.log("onFocusOutside:",f.detail.originalEvent),o?.()))}function h(f){var b;pt.isTopMost(e)&&((b=t.onEscapeKeyDown)==null||b.call(t,f),!f.defaultPrevented&&o&&(f.preventDefault(),o()))}function p(f){var b;if(!e)return!1;const g=typeof r=="function"?r():r,y=Array.isArray(g)?g:[g],x=(b=t.persistentElements)==null?void 0:b.map(C=>C()).filter(Be);return x&&y.push(...x),y.some(C=>rt(C,f))||pt.isInNestedLayer(e,f)}const m=[a?Pk(e,t.persistentElements):void 0,Ek(e,h),uh(e,{exclude:p,onFocusOutside:u,onPointerDownOutside:d,defer:t.defer})];return()=>{pt.remove(e),Gp(),Ik(e),m.forEach(f=>f?.())}}function ia(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=ao(e)?e():e;i.push(Vk(a,t))})),()=>{i.forEach(a=>a?.())}}function Ab(e,t={}){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=ao(e)?e():e;if(!a){Wn("[@zag-js/dismissable] branch node is `null` or `undefined`");return}pt.addBranch(a),i.push(()=>{pt.removeBranch(a)})})),()=>{i.forEach(a=>a?.())}}var Dk=Object.defineProperty,Mk=(e,t,n)=>t in e?Dk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ve=(e,t,n)=>Mk(e,typeof t!="symbol"?t+"":t,n),qp={activateTrap(e,t){if(e.length>0){const o=e[e.length-1];o!==t&&o.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Rk=[],Ak=class{constructor(t,n){Ve(this,"trapStack"),Ve(this,"config"),Ve(this,"doc"),Ve(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ve(this,"portalContainers",new Set),Ve(this,"listenerCleanups",[]),Ve(this,"handleFocus",i=>{const a=Pe(i),r=this.findContainerIndex(a,i)>=0;if(r||sc(a))r&&(this.state.mostRecentlyFocusedNode=a);else{i.stopImmediatePropagation();let s,l=!0;if(this.state.mostRecentlyFocusedNode)if(ga(this.state.mostRecentlyFocusedNode)>0){const c=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:d}=this.state.containerGroups[c];if(d.length>0){const u=d.findIndex(h=>h===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<d.length&&(s=d[u+1],l=!1):u-1>=0&&(s=d[u-1],l=!1))}}else this.state.containerGroups.some(c=>c.tabbableNodes.some(d=>ga(d)>0))||(l=!1);else l=!1;l&&(s=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),s?this.tryFocus(s):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ve(this,"handlePointerDown",i=>{const a=Pe(i);if(!(this.findContainerIndex(a,i)>=0)){if(ya(this.config.clickOutsideDeactivates,i)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ya(this.config.allowOutsideClick,i)||i.preventDefault()}}),Ve(this,"handleClick",i=>{const a=Pe(i);this.findContainerIndex(a,i)>=0||ya(this.config.clickOutsideDeactivates,i)||ya(this.config.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())}),Ve(this,"handleTabKey",i=>{if(this.config.isKeyForward(i)||this.config.isKeyBackward(i)){this.state.recentNavEvent=i;const a=this.config.isKeyBackward(i),r=this.findNextNavNode({event:i,isBackward:a});if(!r)return;ba(i)&&i.preventDefault(),this.tryFocus(r)}}),Ve(this,"handleEscapeKey",i=>{Fk(i)&&ya(this.config.escapeDeactivates,i)!==!1&&(i.preventDefault(),this.deactivate())}),Ve(this,"_mutationObserver"),Ve(this,"setupMutationObserver",()=>{const i=this.doc.defaultView||window;this._mutationObserver=new i.MutationObserver(a=>{a.some(r=>Array.from(r.removedNodes).some(s=>s===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),a.some(r=>r.type==="attributes"&&(r.attributeName==="aria-controls"||r.attributeName==="aria-expanded")?!0:r.type==="childList"&&r.addedNodes.length>0?Array.from(r.addedNodes).some(s=>{if(s.nodeType!==Node.ELEMENT_NODE)return!1;const l=s;return Y1(l)?!0:l.id&&!this.state.containers.some(c=>c.contains(l))?K1(l):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Ve(this,"updateObservedNodes",()=>{var i;(i=this._mutationObserver)==null||i.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(a=>{var r;(r=this._mutationObserver)==null||r.observe(a,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(a=>{this.observePortalContainer(a)}))}),Ve(this,"getInitialFocusNode",()=>{let i=this.getNodeForOption("initialFocus",{hasFallback:!0});if(i===!1)return!1;if(i===void 0||i&&!Bn(i)){const a=or(this.doc);if(a&&this.findContainerIndex(a)>=0)i=a;else{const r=this.state.tabbableGroups[0];i=r&&r.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else i===null&&(i=this.getNodeForOption("fallbackFocus"));if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i.isConnected||(i=this.getNodeForOption("fallbackFocus")),i}),Ve(this,"tryFocus",i=>{if(i!==!1&&i!==or(this.doc)){if(!i||!i.focus){this.tryFocus(this.getInitialFocusNode());return}i.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=i,Nk(i)&&i.select()}}),Ve(this,"deactivate",i=>{if(!this.state.active)return this;const a={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...i};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),qp.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const r=this.getOption(a,"onDeactivate"),s=this.getOption(a,"onPostDeactivate"),l=this.getOption(a,"checkCanReturnFocus"),c=this.getOption(a,"returnFocus","returnFocusOnDeactivate");r?.();const d=()=>{Yp(()=>{if(c){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}s?.()})};if(c&&l){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return l(u).then(d,d),this}return d(),this}),Ve(this,"pause",i=>{if(this.state.paused||!this.state.active)return this;const a=this.getOption(i,"onPause"),r=this.getOption(i,"onPostPause");return this.state.paused=!0,a?.(),this.removeListeners(),this.updateObservedNodes(),r?.(),this}),Ve(this,"unpause",i=>{if(!this.state.paused||!this.state.active)return this;const a=this.getOption(i,"onUnpause"),r=this.getOption(i,"onPostUnpause");return this.state.paused=!1,a?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r?.(),this}),Ve(this,"updateContainerElements",i=>(this.state.containers=Array.isArray(i)?i.filter(Boolean):[i].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ve(this,"getReturnFocusNode",i=>{const a=this.getNodeForOption("setReturnFocus",{params:[i]});return a||(a===!1?!1:i)}),Ve(this,"getOption",(i,a,r)=>i&&i[a]!==void 0?i[a]:this.config[r||a]),Ve(this,"getNodeForOption",(i,{hasFallback:a=!1,params:r=[]}={})=>{let s=this.config[i];if(typeof s=="function"&&(s=s(...r)),s===!0&&(s=void 0),!s){if(s===void 0||s===!1)return s;throw new Error(`\`${i}\` was specified but was not a node, or did not return a node`)}let l=s;if(typeof s=="string"){try{l=this.doc.querySelector(s)}catch(c){throw new Error(`\`${i}\` appears to be an invalid selector; error="${c.message}"`)}if(!l&&!a)throw new Error(`\`${i}\` as selector refers to no known node`)}return l}),Ve(this,"findNextNavNode",i=>{const{event:a,isBackward:r=!1}=i,s=i.target||Pe(a);this.updateTabbableNodes();let l=null;if(this.state.tabbableGroups.length>0){const c=this.findContainerIndex(s,a),d=c>=0?this.state.containerGroups[c]:void 0;if(c<0)r?l=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:l=this.state.tabbableGroups[0].firstTabbableNode;else if(r){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:h})=>s===h);if(u<0&&(d?.container===s||Bn(s)&&!Lo(s)&&!(d!=null&&d.nextTabbableNode(s,!1)))&&(u=c),u>=0){const h=u===0?this.state.tabbableGroups.length-1:u-1,p=this.state.tabbableGroups[h];l=ga(s)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else ba(a)||(l=d?.nextTabbableNode(s,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:h})=>s===h);if(u<0&&(d?.container===s||Bn(s)&&!Lo(s)&&!(d!=null&&d.nextTabbableNode(s)))&&(u=c),u>=0){const h=u===this.state.tabbableGroups.length-1?0:u+1,p=this.state.tabbableGroups[h];l=ga(s)>=0?p.firstTabbableNode:p.firstDomTabbableNode}else ba(a)||(l=d?.nextTabbableNode(s))}}else l=this.getNodeForOption("fallbackFocus");return l}),this.trapStack=n.trapStack||Rk;const o={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(i){return ba(i)&&!i.shiftKey},isKeyBackward(i){return ba(i)&&i.shiftKey},...n};this.doc=o.document||Ot(Array.isArray(t)?t[0]:t),this.config=o,this.updateContainerElements(t),this.setupMutationObserver()}addPortalContainer(t){const n=t.parentElement;n&&!this.portalContainers.has(n)&&(this.portalContainers.add(n),this.state.active&&!this.state.paused&&this.observePortalContainer(n))}observePortalContainer(t){var n;(n=this._mutationObserver)==null||n.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(t=>{U1(t).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(t,n){const o=typeof n?.composedPath=="function"?n.composedPath():void 0;return this.state.containerGroups.findIndex(({container:i,tabbableNodes:a})=>i.contains(t)||o?.includes(i)||a.find(r=>r===t)||this.isControlledElement(i,t))}isControlledElement(t,n){return this.config.followControlledElements?Uv(t,n):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(t=>{const n=Fr(t,{getShadowRoot:this.config.getShadowRoot}),o=tb(t,{getShadowRoot:this.config.getShadowRoot}),i=n[0],a=n[n.length-1],r=i,s=a;let l=!1;for(let d=0;d<n.length;d++)if(ga(n[d])>0){l=!0;break}function c(d,u=!0){const h=n.indexOf(d);if(h>=0)return n[h+(u?1:-1)];const p=o.indexOf(d);if(!(p<0)){if(u){for(let m=p+1;m<o.length;m++)if(Lo(o[m]))return o[m]}else for(let m=p-1;m>=0;m--)if(Lo(o[m]))return o[m]}}return{container:t,tabbableNodes:n,focusableNodes:o,posTabIndexesFound:l,firstTabbableNode:i,lastTabbableNode:a,firstDomTabbableNode:r,lastDomTabbableNode:s,nextTabbableNode:c}}),this.state.tabbableGroups=this.state.containerGroups.filter(t=>t.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(t=>t.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return qp.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Yp(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(ge(this.doc,"focusin",this.handleFocus,!0),ge(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),ge(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),ge(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),ge(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),ge(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(t=>t()),this.listenerCleanups=[],this}activate(t){if(this.state.active)return this;const n=this.getOption(t,"onActivate"),o=this.getOption(t,"onPostActivate"),i=this.getOption(t,"checkCanFocusTrap");i||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=or(this.doc),n?.();const a=()=>{i&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),o?.()};return i?(i(this.state.containers.concat()).then(a,a),this):(a(),this)}},ba=e=>e.key==="Tab",ya=(e,...t)=>typeof e=="function"?e(...t):e,Fk=e=>!e.isComposing&&e.key==="Escape",Yp=e=>setTimeout(e,0),Nk=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function Lk(e,t={}){let n;const o=ae(()=>{const i=typeof e=="function"?e():e;if(i){n=new Ak(i,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...t,document:Ot(i)});try{n.activate()}catch{}}});return function(){n?.deactivate(),o()}}var Bk=le("bottom-sheet").parts("content","title","trigger","backdrop","grabber","grabberIndicator","closeTrigger");Bk.build();ee()(["id","ids","dir","modal","initialFocusEl","finalFocusEl","open","defaultOpen","getRootNode","snapPoints","swipeVelocityThreshold","closeThreshold","preventDragOnScroll","closeOnEscape","closeOnInteractOutside","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","preventScroll","restoreFocus","role","trapFocus","defaultActiveSnapPoint","activeSnapPoint","onActiveSnapPointChange"]);var zk=le("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger");zk.build();ee()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]);ee()(["index","readOnly"]);ee()(["index","snapAlign"]);const[Fb,Gr]=xe("CheckboxContext"),Hk=E({__name:"checkbox-context",setup(e){const t=Gr();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),jk=E({__name:"checkbox-control",props:{asChild:{type:Boolean}},setup(e){const t=Gr();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getControlProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}});function Wk(e){return!(e.metaKey||!dc()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var Uk=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Gk(e,t,n){const o=n?Pe(n):null,i=Fe(o);return e=e||o instanceof i.HTMLInputElement&&!Uk.has(o?.type)||o instanceof i.HTMLTextAreaElement||o instanceof i.HTMLElement&&o.isContentEditable,!(e&&t==="keyboard"&&n instanceof i.KeyboardEvent&&!Reflect.has(qk,n.key))}var _o=null,Wd=new Set,Al=new Map,Jo=!1,Ud=!1,qk={Tab:!0,Escape:!0};function wc(e,t){for(let n of Wd)n(e,t)}function Fl(e){Jo=!0,Wk(e)&&(_o="keyboard",wc("keyboard",e))}function Bt(e){_o="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Jo=!0,wc("pointer",e))}function Nb(e){aC(e)&&(Jo=!0,_o="virtual")}function Lb(e){const t=Pe(e);t===Fe(t)||t===Ot(t)||(!Jo&&!Ud&&(_o="virtual",wc("virtual",e)),Jo=!1,Ud=!1)}function Bb(){Jo=!1,Ud=!0}function Yk(e){if(typeof window>"u"||Al.get(Fe(e)))return;const t=Fe(e),n=Ot(e);let o=t.HTMLElement.prototype.focus;function i(){_o="virtual",wc("virtual",null),Jo=!0,o.apply(this,arguments)}try{Object.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}n.addEventListener("keydown",Fl,!0),n.addEventListener("keyup",Fl,!0),n.addEventListener("click",Nb,!0),t.addEventListener("focus",Lb,!0),t.addEventListener("blur",Bb,!1),typeof t.PointerEvent<"u"?(n.addEventListener("pointerdown",Bt,!0),n.addEventListener("pointermove",Bt,!0),n.addEventListener("pointerup",Bt,!0)):(n.addEventListener("mousedown",Bt,!0),n.addEventListener("mousemove",Bt,!0),n.addEventListener("mouseup",Bt,!0)),t.addEventListener("beforeunload",()=>{Kk(e)},{once:!0}),Al.set(t,{focus:o})}var Kk=(e,t)=>{const n=Fe(e),o=Ot(e),i=Al.get(n);if(i){try{Object.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}o.removeEventListener("keydown",Fl,!0),o.removeEventListener("keyup",Fl,!0),o.removeEventListener("click",Nb,!0),n.removeEventListener("focus",Lb,!0),n.removeEventListener("blur",Bb,!1),typeof n.PointerEvent<"u"?(o.removeEventListener("pointerdown",Bt,!0),o.removeEventListener("pointermove",Bt,!0),o.removeEventListener("pointerup",Bt,!0)):(o.removeEventListener("mousedown",Bt,!0),o.removeEventListener("mousemove",Bt,!0),o.removeEventListener("mouseup",Bt,!0)),Al.delete(n)}};function Xk(){return _o}function wr(){return _o==="keyboard"}function Cc(e={}){const{isTextInput:t,autoFocus:n,onChange:o,root:i}=e;Yk(i),o?.({isFocusVisible:n||wr(),modality:_o});const a=(r,s)=>{Gk(!!t,r,s)&&o?.({isFocusVisible:wr(),modality:r})};return Wd.add(a),()=>{Wd.delete(a)}}var zb=le("checkbox").parts("root","label","control","indicator"),us=zb.build(),Hb=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`checkbox:${e.id}`},Kp=e=>{var t;return((t=e.ids)==null?void 0:t.label)??`checkbox:${e.id}:label`},Zk=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`checkbox:${e.id}:control`},Gd=e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`checkbox:${e.id}:input`},Jk=e=>e.getById(Hb(e)),Ya=e=>e.getById(Gd(e));function Qk(e,t){const{send:n,context:o,prop:i,computed:a,scope:r}=e,s=!!i("disabled"),l=!!i("readOnly"),c=!!i("required"),d=!!i("invalid"),u=!s&&o.get("focused"),h=!s&&o.get("focusVisible"),p=a("checked"),m=a("indeterminate"),f=o.get("checked"),b={"data-active":V(o.get("active")),"data-focus":V(u),"data-focus-visible":V(h),"data-readonly":V(l),"data-hover":V(o.get("hovered")),"data-disabled":V(s),"data-state":m?"indeterminate":p?"checked":"unchecked","data-invalid":V(d),"data-required":V(c)};return{checked:p,disabled:s,indeterminate:m,focused:u,checkedState:f,setChecked(g){n({type:"CHECKED.SET",checked:g,isTrusted:!1})},toggleChecked(){n({type:"CHECKED.TOGGLE",checked:p,isTrusted:!1})},getRootProps(){return t.label({...us.root.attrs,...b,dir:i("dir"),id:Hb(r),htmlFor:Gd(r),onPointerMove(){s||n({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){s||n({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(g){Pe(g)===Ya(r)&&g.stopPropagation()}})},getLabelProps(){return t.element({...us.label.attrs,...b,dir:i("dir"),id:Kp(r)})},getControlProps(){return t.element({...us.control.attrs,...b,dir:i("dir"),id:Zk(r),"aria-hidden":!0})},getIndicatorProps(){return t.element({...us.indicator.attrs,...b,dir:i("dir"),hidden:!m&&!p})},getHiddenInputProps(){return t.input({id:Gd(r),type:"checkbox",required:i("required"),defaultChecked:p,disabled:s,"aria-labelledby":Kp(r),"aria-invalid":d,name:i("name"),form:i("form"),value:i("value"),style:gc,onFocus(){const g=wr();n({type:"CONTEXT.SET",context:{focused:!0,focusVisible:g}})},onBlur(){n({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(g){if(l){g.preventDefault();return}const y=g.currentTarget.checked;n({type:"CHECKED.SET",checked:y,isTrusted:!0})}})}}}var{not:Xp}=et(),eS={props({props:e}){return{value:"on",...e,defaultChecked:e.defaultChecked??!1}},initialState(){return"ready"},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e("defaultChecked"),value:e("checked"),onChange(n){var o;(o=e("onCheckedChange"))==null||o({checked:n})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:o}){e([()=>n("disabled")],()=>{o(["removeFocusIfNeeded"])}),e([()=>t.get("checked")],()=>{o(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:Xp("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Xp("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:e})=>el(e.get("checked")),checked:({context:e})=>tS(e.get("checked")),disabled:({context:e,prop:t})=>!!t("disabled")||e.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t("disabled"))return cb({pointerNode:Jk(n),keyboardNode:Ya(n),isValidKey:o=>o.key===" ",onPress:()=>e.set("active",!1),onPressStart:()=>e.set("active",!0),onPressEnd:()=>e.set("active",!1)})},trackFocusVisible({computed:e,scope:t}){var n;if(!e("disabled"))return Cc({root:(n=t.getRootNode)==null?void 0:n.call(t)})},trackFormControlState({context:e,scope:t}){return oa(Ya(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("checked",e.initial("checked"))}})}},actions:{setContext({context:e,event:t}){for(const n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){const o=Ya(n);o&&(Zu(o,t("checked")),o.indeterminate=el(e.get("checked")))},removeFocusIfNeeded({context:e,prop:t}){t("disabled")&&e.get("focused")&&(e.set("focused",!1),e.set("focusVisible",!1))},setChecked({context:e,event:t}){e.set("checked",t.checked)},toggleChecked({context:e,computed:t}){const n=el(t("checked"))?!0:!t("checked");e.set("checked",n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{const n=Ya(t);Zv(n,{checked:e("checked")})})}}}};function el(e){return e==="indeterminate"}function tS(e){return el(e)?!1:!!e}ee()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);const hh=zb.extendWith("group");function nS(e,t,n,o={}){var i,a,r;const{passive:s=!1,eventName:l,defaultValue:c}=o,d=Vr(),u=n||d?.emit||((i=d?.$emit)==null?void 0:i.bind(d))||((r=(a=d?.proxy)==null?void 0:a.$emit)==null?void 0:r.bind(d?.proxy)),h=t,p=()=>e[h]??c,m=f=>{if(!l)u(l||`update:${h.toString()}`,f);else for(const b of l)u(b,f)};if(s){const f=p(),b=he(f);let g=!1;return Ae(()=>e[h],y=>{g||(g=!0,b.value=y,po(()=>{g=!1}))}),Ae(b,y=>{!g&&y!==e[h]&&m(y)}),b}return T({get(){return p()},set(f){m(f)}})}function oS(e,t){const n=T(()=>!(e.disabled||e.readOnly)),{defaultValue:o}=Vw(e),i=nS(e,"modelValue",t,{defaultValue:o?.value??[],passive:e.modelValue===void 0,eventName:["valueChange","update:modelValue"]}),a=u=>i.value.some(h=>String(h)===String(u)),r=u=>{a(u)?l(u):s(u)},s=u=>{n.value&&(a(u)||(i.value=i.value.concat(u)))},l=u=>{n.value&&(i.value=i.value.filter(h=>String(h)!==String(u)))},c=u=>({checked:u.value!=null?a(u.value):void 0,onCheckedChange(){u.value!=null&&r(u.value)},name:e.name,disabled:e.disabled,readOnly:e.readOnly,invalid:e.invalid}),d=u=>{i.value=u};return T(()=>({isChecked:a,value:i.value,name:e.name,disabled:e.disabled,readOnly:e.readOnly,invalid:e.invalid,addValue:s,setValue:d,toggleValue:r,getItemProps:c}))}const[jb,iS]=xe("CheckboxGroupContext"),aS=E({__name:"checkbox-group",props:jt({defaultValue:{},modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},name:{},invalid:{type:Boolean},asChild:{type:Boolean}},{disabled:void 0,readOnly:void 0,invalid:void 0}),emits:["valueChange","update:modelValue"],setup(e,{emit:t}){const n=oS(e,t);return jb(n),q(),(o,i)=>(w(),S(v(Y).div,F({role:"group"},{...v(hh).build().group.attrs},{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),rS=E({__name:"checkbox-group-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return jb(n),q(),(o,i)=>(w(),S(v(Y).div,F({role:"group"},v(hh).build().group.attrs,{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),sS=E({__name:"checkbox-hidden-input",props:{asChild:{type:Boolean}},setup(e){const t=Gr(),n=wn();return q(),(o,i)=>{var a;return w(),S(v(Y).input,F({"aria-describedby":(a=v(n))==null?void 0:a.ariaDescribedby},v(t).getHiddenInputProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["aria-describedby","as-child"])}}}),lS=E({__name:"checkbox-indicator",props:{indeterminate:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=Gr(),o=T(()=>t.indeterminate?n.value.indeterminate:n.value.checked);return q(),(i,a)=>(w(),S(v(Y).div,F(v(n).getIndicatorProps(),{hidden:!o.value,"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["hidden","as-child"]))}}),cS=E({__name:"checkbox-label",props:{asChild:{type:Boolean}},setup(e){const t=Gr();return q(),(n,o)=>(w(),S(v(Y).span,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),dS=E({__name:"checkbox-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return Fb(n),q(),(o,i)=>(w(),S(v(Y).label,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),uS=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=wn(),r=iS(),s=T(()=>{const d=Re(e);return Br(d,r?.value.getItemProps({value:d.value})??{})}),l=T(()=>{const d=Re(s);return{id:n,ids:{label:a?.value.ids.label,hiddenInput:a?.value.ids.control},disabled:a?.value.disabled,readOnly:a?.value.readOnly,invalid:a?.value.invalid,required:a?.value.required,dir:i.value.dir,getRootNode:o?.value.getRootNode,...an(d),onCheckedChange(u){var h;t?.("checkedChange",u),t?.("update:checked",u.checked),(h=d.onCheckedChange)==null||h.call(d,u)}}}),c=bt(eS,l);return T(()=>Qk(c,Tt))},hS=E({__name:"checkbox-root",props:jt({checked:{},defaultChecked:{},disabled:{type:Boolean},form:{},id:{},ids:{},invalid:{type:Boolean},name:{},readOnly:{type:Boolean},required:{type:Boolean},value:{},asChild:{type:Boolean}},{checked:void 0,defaultChecked:void 0,disabled:void 0,invalid:void 0,readOnly:void 0,required:void 0}),emits:["checkedChange","update:checked"],setup(e,{emit:t}){const n=uS(e,t);return Fb(n),q(),(o,i)=>(w(),S(v(Y).label,F(v(n).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),vi=Object.freeze(Object.defineProperty({__proto__:null,Context:Hk,Control:jk,Group:aS,GroupProvider:rS,HiddenInput:sS,Indicator:lS,Label:cS,Root:hS,RootProvider:dS},Symbol.toStringTag,{value:"Module"}));var pS=le("clipboard").parts("root","control","trigger","indicator","input","label");pS.build();ee()(["getRootNode","id","ids","value","defaultValue","timeout","onStatusChange","onValueChange"]);ee()(["copied"]);var fS=Object.defineProperty,gS=(e,t,n)=>t in e?fS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t,n)=>gS(e,typeof t!="symbol"?t+"":t,n),tl={itemToValue(e){return typeof e=="string"?e:Bo(e)&&ro(e,"value")?e.value:""},itemToString(e){return typeof e=="string"?e:Bo(e)&&ro(e,"label")?e.label:tl.itemToValue(e)},isItemDisabled(e){return Bo(e)&&ro(e,"disabled")?!!e.disabled:!1}},si=class Wb{constructor(t){this.options=t,K(this,"items"),K(this,"indexMap",null),K(this,"copy",n=>new Wb({...this.options,items:n??[...this.items]})),K(this,"isEqual",n=>Je(this.items,n.items)),K(this,"setItems",n=>this.copy(n)),K(this,"getValues",(n=this.items)=>{const o=[];for(const i of n){const a=this.getItemValue(i);a!=null&&o.push(a)}return o}),K(this,"find",n=>{if(n==null)return null;const o=this.indexOf(n);return o!==-1?this.at(o):null}),K(this,"findMany",n=>{const o=[];for(const i of n){const a=this.find(i);a!=null&&o.push(a)}return o}),K(this,"at",n=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[n]??null;let o=0;const i=this.group();for(const[,a]of i)for(const r of a){if(o===n)return r;o++}return null}),K(this,"sortFn",(n,o)=>{const i=this.indexOf(n),a=this.indexOf(o);return(i??0)-(a??0)}),K(this,"sort",n=>[...n].sort(this.sortFn.bind(this))),K(this,"getItemValue",n=>{var o,i;return n==null?null:((i=(o=this.options).itemToValue)==null?void 0:i.call(o,n))??tl.itemToValue(n)}),K(this,"getItemDisabled",n=>{var o,i;return n==null?!1:((i=(o=this.options).isItemDisabled)==null?void 0:i.call(o,n))??tl.isItemDisabled(n)}),K(this,"stringifyItem",n=>{var o,i;return n==null?null:((i=(o=this.options).itemToString)==null?void 0:i.call(o,n))??tl.itemToString(n)}),K(this,"stringify",n=>n==null?null:this.stringifyItem(this.find(n))),K(this,"stringifyItems",(n,o=", ")=>{const i=[];for(const a of n){const r=this.stringifyItem(a);r!=null&&i.push(r)}return i.join(o)}),K(this,"stringifyMany",(n,o)=>this.stringifyItems(this.findMany(n),o)),K(this,"has",n=>this.indexOf(n)!==-1),K(this,"hasItem",n=>n==null?!1:this.has(this.getItemValue(n))),K(this,"group",()=>{const{groupBy:n,groupSort:o}=this.options;if(!n)return[["",[...this.items]]];const i=new Map;this.items.forEach((r,s)=>{const l=n(r,s);i.has(l)||i.set(l,[]),i.get(l).push(r)});let a=Array.from(i.entries());return o&&a.sort(([r],[s])=>{if(typeof o=="function")return o(r,s);if(Array.isArray(o)){const l=o.indexOf(r),c=o.indexOf(s);return l===-1?1:c===-1?-1:l-c}return o==="asc"?r.localeCompare(s):o==="desc"?s.localeCompare(r):0}),a}),K(this,"getNextValue",(n,o=1,i=!1)=>{let a=this.indexOf(n);if(a===-1)return null;for(a=i?Math.min(a+o,this.size-1):a+o;a<=this.size&&this.getItemDisabled(this.at(a));)a++;return this.getItemValue(this.at(a))}),K(this,"getPreviousValue",(n,o=1,i=!1)=>{let a=this.indexOf(n);if(a===-1)return null;for(a=i?Math.max(a-o,0):a-o;a>=0&&this.getItemDisabled(this.at(a));)a--;return this.getItemValue(this.at(a))}),K(this,"indexOf",n=>{if(n==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(o=>this.getItemValue(o)===n);if(!this.indexMap){this.indexMap=new Map;let o=0;const i=this.group();for(const[,a]of i)for(const r of a){const s=this.getItemValue(r);s!=null&&this.indexMap.set(s,o),o++}}return this.indexMap.get(n)??-1}),K(this,"getByText",(n,o)=>{const i=o!=null?this.indexOf(o):-1,a=n.length===1;for(let r=0;r<this.items.length;r++){const s=this.items[(i+r+1)%this.items.length];if(!(a&&this.getItemValue(s)===o)&&!this.getItemDisabled(s)&&mS(this.stringifyItem(s),n))return s}}),K(this,"search",(n,o)=>{const{state:i,currentValue:a,timeout:r=350}=o,s=i.keysSoFar+n,l=s.length>1&&Array.from(s).every(p=>p===s[0])?s[0]:s,c=this.getByText(l,a),d=this.getItemValue(c);function u(){clearTimeout(i.timer),i.timer=-1}function h(p){i.keysSoFar=p,u(),p!==""&&(i.timer=+setTimeout(()=>{h(""),u()},r))}return h(s),d}),K(this,"update",(n,o)=>{let i=this.indexOf(n);return i===-1?this:this.copy([...this.items.slice(0,i),o,...this.items.slice(i+1)])}),K(this,"upsert",(n,o,i="append")=>{let a=this.indexOf(n);return a===-1?(i==="append"?this.append:this.prepend)(o):this.copy([...this.items.slice(0,a),o,...this.items.slice(a+1)])}),K(this,"insert",(n,...o)=>this.copy(xa(this.items,n,...o))),K(this,"insertBefore",(n,...o)=>{let i=this.indexOf(n);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(xa(this.items,i,...o))}),K(this,"insertAfter",(n,...o)=>{let i=this.indexOf(n);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(xa(this.items,i+1,...o))}),K(this,"prepend",(...n)=>this.copy(xa(this.items,0,...n))),K(this,"append",(...n)=>this.copy(xa(this.items,this.items.length,...n))),K(this,"filter",n=>{const o=this.items.filter((i,a)=>n(this.stringifyItem(i),a,i));return this.copy(o)}),K(this,"remove",(...n)=>{const o=n.map(i=>typeof i=="string"?i:this.getItemValue(i));return this.copy(this.items.filter(i=>{const a=this.getItemValue(i);return a==null?!1:!o.includes(a)}))}),K(this,"move",(n,o)=>{const i=this.indexOf(n);return i===-1?this:this.copy(hs(this.items,[i],o))}),K(this,"moveBefore",(n,...o)=>{let i=this.items.findIndex(r=>this.getItemValue(r)===n);if(i===-1)return this;let a=o.map(r=>this.items.findIndex(s=>this.getItemValue(s)===r)).sort((r,s)=>r-s);return this.copy(hs(this.items,a,i))}),K(this,"moveAfter",(n,...o)=>{let i=this.items.findIndex(r=>this.getItemValue(r)===n);if(i===-1)return this;let a=o.map(r=>this.items.findIndex(s=>this.getItemValue(s)===r)).sort((r,s)=>r-s);return this.copy(hs(this.items,a,i+1))}),K(this,"reorder",(n,o)=>this.copy(hs(this.items,[n],o))),K(this,"compareValue",(n,o)=>{const i=this.indexOf(n),a=this.indexOf(o);return i<a?-1:i>a?1:0}),K(this,"range",(n,o)=>{let i=[],a=n;for(;a!=null;){if(this.find(a)&&i.push(a),a===o)return i;a=this.getNextValue(a)}return[]}),K(this,"getValueRange",(n,o)=>n&&o?this.compareValue(n,o)<=0?this.range(n,o):this.range(o,n):[]),K(this,"toString",()=>{let n="";for(const o of this.items){const i=this.getItemValue(o),a=this.stringifyItem(o),r=this.getItemDisabled(o),s=[i,a,r].filter(Boolean).join(":");n+=s+","}return n}),K(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let t=0;for(;this.getItemDisabled(this.at(t));)t++;return this.getItemValue(this.at(t))}get lastValue(){let t=this.size-1;for(;this.getItemDisabled(this.at(t));)t--;return this.getItemValue(this.at(t))}*[Symbol.iterator](){yield*this.items}},mS=(e,t)=>!!(e!=null&&e.toLowerCase().startsWith(t.toLowerCase()));function xa(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function hs(e,t,n){t=[...t].sort((i,a)=>i-a);const o=t.map(i=>e[i]);for(let i=t.length-1;i>=0;i--)e=[...e.slice(0,t[i]),...e.slice(t[i]+1)];return n=Math.max(0,n-t.filter(i=>i<n).length),[...e.slice(0,n),...o,...e.slice(n)]}var vS=class nl extends Set{constructor(t=[]){super(t),K(this,"selectionMode","single"),K(this,"deselectable",!0),K(this,"copy",()=>{const n=new nl([...this]);return this.sync(n)}),K(this,"sync",n=>(n.selectionMode=this.selectionMode,n.deselectable=this.deselectable,n)),K(this,"isEmpty",()=>this.size===0),K(this,"isSelected",n=>this.selectionMode==="none"||n==null?!1:this.has(n)),K(this,"canSelect",(n,o)=>this.selectionMode!=="none"||!n.getItemDisabled(n.find(o))),K(this,"firstSelectedValue",n=>{let o=null;for(let i of this)(!o||n.compareValue(i,o)<0)&&(o=i);return o}),K(this,"lastSelectedValue",n=>{let o=null;for(let i of this)(!o||n.compareValue(i,o)>0)&&(o=i);return o}),K(this,"extendSelection",(n,o,i)=>{if(this.selectionMode==="none")return this;if(this.selectionMode==="single")return this.replaceSelection(n,i);const a=this.copy(),r=Array.from(this).pop();for(let s of n.getValueRange(o,r??i))a.delete(s);for(let s of n.getValueRange(i,o))this.canSelect(n,s)&&a.add(s);return a}),K(this,"toggleSelection",(n,o)=>{if(this.selectionMode==="none")return this;if(this.selectionMode==="single"&&!this.isSelected(o))return this.replaceSelection(n,o);const i=this.copy();return i.has(o)?i.delete(o):i.canSelect(n,o)&&i.add(o),i}),K(this,"replaceSelection",(n,o)=>{if(this.selectionMode==="none")return this;if(o==null)return this;if(!this.canSelect(n,o))return this;const i=new nl([o]);return this.sync(i)}),K(this,"setSelection",n=>{if(this.selectionMode==="none")return this;let o=new nl;for(let i of n)if(i!=null&&(o.add(i),this.selectionMode==="single"))break;return this.sync(o)}),K(this,"clearSelection",()=>{const n=this.copy();return n.deselectable&&n.size>0&&n.clear(),n}),K(this,"select",(n,o,i)=>this.selectionMode==="none"?this:this.selectionMode==="single"?this.isSelected(o)&&this.deselectable?this.toggleSelection(n,o):this.replaceSelection(n,o):this.selectionMode==="multiple"||i?this.toggleSelection(n,o):this.replaceSelection(n,o)),K(this,"deselect",n=>{const o=this.copy();return o.delete(n),o}),K(this,"isEqual",n=>Je(Array.from(this),Array.from(n)))}};function Ub(e,t,n){for(let o=0;o<t.length;o++)e=n.getChildren(e,t.slice(o+1))[t[o]];return e}function bS(e){const t=yS(e),n=[],o=new Set;for(const i of t){const a=i.join();o.has(a)||(o.add(a),n.push(i))}return n}function Gb(e,t){for(let n=0;n<Math.min(e.length,t.length);n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return e.length-t.length}function yS(e){return e.sort(Gb)}function xS(e,t){let n;return wt(e,{...t,onEnter:(o,i)=>{if(t.predicate(o,i))return n=o,"stop"}}),n}function wS(e,t){const n=[];return wt(e,{onEnter:(o,i)=>{t.predicate(o,i)&&n.push(o)},getChildren:t.getChildren}),n}function Zp(e,t){let n;return wt(e,{onEnter:(o,i)=>{if(t.predicate(o,i))return n=[...i],"stop"},getChildren:t.getChildren}),n}function CS(e,t){let n=t.initialResult;return wt(e,{...t,onEnter:(o,i)=>{n=t.nextResult(n,o,i)}}),n}function _S(e,t){return CS(e,{...t,initialResult:[],nextResult:(n,o,i)=>(n.push(...t.transform(o,i)),n)})}function $S(e,t){const{predicate:n,create:o,getChildren:i}=t,a=(r,s)=>{const l=i(r,s),c=[];l.forEach((p,m)=>{const f=[...s,m],b=a(p,f);b&&c.push(b)});const d=s.length===0,u=n(r,s),h=c.length>0;return d||u||h?o(r,c,s):null};return a(e,[])||o(e,[],[])}function kS(e,t){const n=[];let o=0;const i=new Map,a=new Map;return wt(e,{getChildren:t.getChildren,onEnter:(r,s)=>{i.has(r)||i.set(r,o++);const l=t.getChildren(r,s);l.forEach(p=>{a.has(p)||a.set(p,r),i.has(p)||i.set(p,o++)});const c=l.length>0?l.map(p=>i.get(p)):void 0,d=a.get(r),u=d?i.get(d):void 0,h=i.get(r);n.push({...r,_children:c,_parent:u,_index:h})}}),n}function SS(e,t){return{type:"insert",index:e,nodes:t}}function ES(e){return{type:"remove",indexes:e}}function ph(){return{type:"replace"}}function qb(e){return[e.slice(0,-1),e[e.length-1]]}function Yb(e,t,n=new Map){var o;const[i,a]=qb(e);for(let s=i.length-1;s>=0;s--){const l=i.slice(0,s).join();switch((o=n.get(l))==null?void 0:o.type){case"remove":continue}n.set(l,ph())}const r=n.get(i.join());switch(r?.type){case"remove":n.set(i.join(),{type:"removeThenInsert",removeIndexes:r.indexes,insertIndex:a,insertNodes:t});break;default:n.set(i.join(),SS(a,t))}return n}function Kb(e){const t=new Map,n=new Map;for(const o of e){const i=o.slice(0,-1).join(),a=n.get(i)??[];a.push(o[o.length-1]),n.set(i,a.sort((r,s)=>r-s))}for(const o of e)for(let i=o.length-2;i>=0;i--){const a=o.slice(0,i).join();t.has(a)||t.set(a,ph())}for(const[o,i]of n)t.set(o,ES(i));return t}function OS(e,t){const n=new Map,[o,i]=qb(e);for(let a=o.length-1;a>=0;a--){const r=o.slice(0,a).join();n.set(r,ph())}return n.set(o.join(),{type:"removeThenInsert",removeIndexes:[i],insertIndex:i,insertNodes:[t]}),n}function _c(e,t,n){return TS(e,{...n,getChildren:(o,i)=>{const a=i.join(),r=t.get(a);switch(r?.type){case"replace":case"remove":case"removeThenInsert":case"insert":return n.getChildren(o,i);default:return[]}},transform:(o,i,a)=>{const r=a.join(),s=t.get(r);switch(s?.type){case"remove":return n.create(o,i.filter((d,u)=>!s.indexes.includes(u)),a);case"removeThenInsert":const l=i.filter((d,u)=>!s.removeIndexes.includes(u)),c=s.removeIndexes.reduce((d,u)=>u<d?d-1:d,s.insertIndex);return n.create(o,Jp(l,c,0,...s.insertNodes),a);case"insert":return n.create(o,Jp(i,s.index,0,...s.nodes),a);case"replace":return n.create(o,i,a);default:return o}}})}function Jp(e,t,n,...o){return[...e.slice(0,t),...o,...e.slice(t+n)]}function TS(e,t){const n={};return wt(e,{...t,onLeave:(o,i)=>{const a=[0,...i],r=a.join(),s=t.transform(o,n[r]??[],i),l=a.slice(0,-1).join(),c=n[l]??[];c.push(s),n[l]=c}}),n[""][0]}function IS(e,t){const{nodes:n,at:o}=t;if(o.length===0)throw new Error("Can't insert nodes at the root");const i=Yb(o,n);return _c(e,i,t)}function PS(e,t){if(t.at.length===0)return t.node;const n=OS(t.at,t.node);return _c(e,n,t)}function VS(e,t){if(t.indexPaths.length===0)return e;for(const o of t.indexPaths)if(o.length===0)throw new Error("Can't remove the root node");const n=Kb(t.indexPaths);return _c(e,n,t)}function DS(e,t){if(t.indexPaths.length===0)return e;for(const a of t.indexPaths)if(a.length===0)throw new Error("Can't move the root node");if(t.to.length===0)throw new Error("Can't move nodes to the root");const n=bS(t.indexPaths),o=n.map(a=>Ub(e,a,t)),i=Yb(t.to,o,Kb(n));return _c(e,i,t)}function wt(e,t){const{onEnter:n,onLeave:o,getChildren:i}=t;let a=[],r=[{node:e}];const s=t.reuseIndexPath?()=>a:()=>a.slice();for(;r.length>0;){let l=r[r.length-1];if(l.state===void 0){const d=n?.(l.node,s());if(d==="stop")return;l.state=d==="skip"?-1:0}const c=l.children||i(l.node,s());if(l.children||(l.children=c),l.state!==-1){if(l.state<c.length){let d=l.state;a.push(d),r.push({node:c[d]}),l.state=d+1;continue}if(o?.(l.node,s())==="stop")return}a.pop(),r.pop()}}var fh=class Xb{constructor(t){this.options=t,K(this,"rootNode"),K(this,"isEqual",n=>Je(this.rootNode,n.rootNode)),K(this,"getNodeChildren",n=>{var o,i;return((i=(o=this.options).nodeToChildren)==null?void 0:i.call(o,n))??Oi.nodeToChildren(n)??[]}),K(this,"resolveIndexPath",n=>typeof n=="string"?this.getIndexPath(n):n),K(this,"resolveNode",n=>{const o=this.resolveIndexPath(n);return o?this.at(o):void 0}),K(this,"getNodeChildrenCount",n=>{var o,i;return((i=(o=this.options).nodeToChildrenCount)==null?void 0:i.call(o,n))??Oi.nodeToChildrenCount(n)}),K(this,"getNodeValue",n=>{var o,i;return((i=(o=this.options).nodeToValue)==null?void 0:i.call(o,n))??Oi.nodeToValue(n)}),K(this,"getNodeDisabled",n=>{var o,i;return((i=(o=this.options).isNodeDisabled)==null?void 0:i.call(o,n))??Oi.isNodeDisabled(n)}),K(this,"stringify",n=>{const o=this.findNode(n);return o?this.stringifyNode(o):null}),K(this,"stringifyNode",n=>{var o,i;return((i=(o=this.options).nodeToString)==null?void 0:i.call(o,n))??Oi.nodeToString(n)}),K(this,"getFirstNode",(n=this.rootNode)=>{let o;return wt(n,{getChildren:this.getNodeChildren,onEnter:(i,a)=>{if(!o&&a.length>0&&!this.getNodeDisabled(i))return o=i,"stop"}}),o}),K(this,"getLastNode",(n=this.rootNode,o={})=>{let i;return wt(n,{getChildren:this.getNodeChildren,onEnter:(a,r)=>{var s;if(!this.isSameNode(a,n)){if((s=o.skip)!=null&&s.call(o,{value:this.getNodeValue(a),node:a,indexPath:r}))return"skip";r.length>0&&!this.getNodeDisabled(a)&&(i=a)}}}),i}),K(this,"at",n=>Ub(this.rootNode,n,{getChildren:this.getNodeChildren})),K(this,"findNode",(n,o=this.rootNode)=>xS(o,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===n})),K(this,"findNodes",(n,o=this.rootNode)=>{const i=new Set(n.filter(a=>a!=null));return wS(o,{getChildren:this.getNodeChildren,predicate:a=>i.has(this.getNodeValue(a))})}),K(this,"sort",n=>n.reduce((o,i)=>{const a=this.getIndexPath(i);return a&&o.push({value:i,indexPath:a}),o},[]).sort((o,i)=>Gb(o.indexPath,i.indexPath)).map(({value:o})=>o)),K(this,"getIndexPath",n=>Zp(this.rootNode,{getChildren:this.getNodeChildren,predicate:o=>this.getNodeValue(o)===n})),K(this,"getValue",n=>{const o=this.at(n);return o?this.getNodeValue(o):void 0}),K(this,"getValuePath",n=>{if(!n)return[];const o=[];let i=[...n];for(;i.length>0;){const a=this.at(i);a&&o.unshift(this.getNodeValue(a)),i.pop()}return o}),K(this,"getDepth",n=>{const o=Zp(this.rootNode,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===n});return o?.length??0}),K(this,"isSameNode",(n,o)=>this.getNodeValue(n)===this.getNodeValue(o)),K(this,"isRootNode",n=>this.isSameNode(n,this.rootNode)),K(this,"contains",(n,o)=>!n||!o?!1:o.slice(0,n.length).every((i,a)=>n[a]===o[a])),K(this,"getNextNode",(n,o={})=>{let i=!1,a;return wt(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(r,s)=>{var l;if(this.isRootNode(r))return;const c=this.getNodeValue(r);if((l=o.skip)!=null&&l.call(o,{value:c,node:r,indexPath:s}))return c===n&&(i=!0),"skip";if(i&&!this.getNodeDisabled(r))return a=r,"stop";c===n&&(i=!0)}}),a}),K(this,"getPreviousNode",(n,o={})=>{let i,a=!1;return wt(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(r,s)=>{var l;if(this.isRootNode(r))return;const c=this.getNodeValue(r);if((l=o.skip)!=null&&l.call(o,{value:c,node:r,indexPath:s}))return"skip";if(c===n)return a=!0,"stop";this.getNodeDisabled(r)||(i=r)}}),a?i:void 0}),K(this,"getParentNodes",n=>{var o;const i=(o=this.resolveIndexPath(n))==null?void 0:o.slice();if(!i)return[];const a=[];for(;i.length>0;){i.pop();const r=this.at(i);r&&!this.isRootNode(r)&&a.unshift(r)}return a}),K(this,"getDescendantNodes",(n,o)=>{const i=this.resolveNode(n);if(!i)return[];const a=[];return wt(i,{getChildren:this.getNodeChildren,onEnter:(r,s)=>{s.length!==0&&(!(o!=null&&o.withBranch)&&this.isBranchNode(r)||a.push(r))}}),a}),K(this,"getDescendantValues",(n,o)=>this.getDescendantNodes(n,o).map(i=>this.getNodeValue(i))),K(this,"getParentIndexPath",n=>n.slice(0,-1)),K(this,"getParentNode",n=>{const o=this.resolveIndexPath(n);return o?this.at(this.getParentIndexPath(o)):void 0}),K(this,"visit",n=>{const{skip:o,...i}=n;wt(this.rootNode,{...i,getChildren:this.getNodeChildren,onEnter:(a,r)=>{var s;if(!this.isRootNode(a))return o!=null&&o({value:this.getNodeValue(a),node:a,indexPath:r})?"skip":(s=i.onEnter)==null?void 0:s.call(i,a,r)}})}),K(this,"getPreviousSibling",n=>{const o=this.getParentNode(n);if(!o)return;const i=this.getNodeChildren(o);let a=n[n.length-1];for(;--a>=0;){const r=i[a];if(!this.getNodeDisabled(r))return r}}),K(this,"getNextSibling",n=>{const o=this.getParentNode(n);if(!o)return;const i=this.getNodeChildren(o);let a=n[n.length-1];for(;++a<i.length;){const r=i[a];if(!this.getNodeDisabled(r))return r}}),K(this,"getSiblingNodes",n=>{const o=this.getParentNode(n);return o?this.getNodeChildren(o):[]}),K(this,"getValues",(n=this.rootNode)=>_S(n,{getChildren:this.getNodeChildren,transform:o=>[this.getNodeValue(o)]}).slice(1)),K(this,"isValidDepth",(n,o)=>o==null?!0:typeof o=="function"?o(n.length):n.length===o),K(this,"isBranchNode",n=>this.getNodeChildren(n).length>0||this.getNodeChildrenCount(n)!=null),K(this,"getBranchValues",(n=this.rootNode,o={})=>{let i=[];return wt(n,{getChildren:this.getNodeChildren,onEnter:(a,r)=>{var s;if(r.length===0)return;const l=this.getNodeValue(a);if((s=o.skip)!=null&&s.call(o,{value:l,node:a,indexPath:r}))return"skip";this.isBranchNode(a)&&this.isValidDepth(r,o.depth)&&i.push(this.getNodeValue(a))}}),i}),K(this,"flatten",(n=this.rootNode)=>kS(n,{getChildren:this.getNodeChildren})),K(this,"_create",(n,o)=>this.getNodeChildren(n).length>0||o.length>0?{...n,children:o}:{...n}),K(this,"_insert",(n,o,i)=>this.copy(IS(n,{at:o,nodes:i,getChildren:this.getNodeChildren,create:this._create}))),K(this,"copy",n=>new Xb({...this.options,rootNode:n})),K(this,"_replace",(n,o,i)=>this.copy(PS(n,{at:o,node:i,getChildren:this.getNodeChildren,create:this._create}))),K(this,"_move",(n,o,i)=>this.copy(DS(n,{indexPaths:o,to:i,getChildren:this.getNodeChildren,create:this._create}))),K(this,"_remove",(n,o)=>this.copy(VS(n,{indexPaths:o,getChildren:this.getNodeChildren,create:this._create}))),K(this,"replace",(n,o)=>this._replace(this.rootNode,n,o)),K(this,"remove",n=>this._remove(this.rootNode,n)),K(this,"insertBefore",(n,o)=>this.getParentNode(n)?this._insert(this.rootNode,n,o):void 0),K(this,"insertAfter",(n,o)=>{if(!this.getParentNode(n))return;const i=[...n.slice(0,-1),n[n.length-1]+1];return this._insert(this.rootNode,i,o)}),K(this,"move",(n,o)=>this._move(this.rootNode,n,o)),K(this,"filter",n=>{const o=$S(this.rootNode,{predicate:n,getChildren:this.getNodeChildren,create:this._create});return this.copy(o)}),K(this,"toJSON",()=>this.getValues(this.rootNode)),this.rootNode=t.rootNode}},Oi={nodeToValue(e){return typeof e=="string"?e:Bo(e)&&ro(e,"value")?e.value:""},nodeToString(e){return typeof e=="string"?e:Bo(e)&&ro(e,"label")?e.label:Oi.nodeToValue(e)},isNodeDisabled(e){return Bo(e)&&ro(e,"disabled")?!!e.disabled:!1},nodeToChildren(e){return e.children},nodeToChildrenCount(e){if(Bo(e)&&ro(e,"childrenCount"))return e.childrenCount}};const MS=e=>new si(e),Qp=e=>new fh(e);var RS=Object.defineProperty,AS=(e,t,n)=>t in e?RS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gh=(e,t,n)=>AS(e,t+"",n),FS=(e,t)=>{if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0},mh=class{toHexInt(){return this.toFormat("rgba").toHexInt()}getChannelValue(t){if(t in this)return this[t];throw new Error("Unsupported color channel: "+t)}getChannelValuePercent(t,n){const o=n??this.getChannelValue(t),{minValue:i,maxValue:a}=this.getChannelRange(t);return f_(o,i,a)}getChannelPercentValue(t,n){const{minValue:o,maxValue:i,step:a}=this.getChannelRange(t),r=g_(n,o,i,a);return kp(r,o,i,a)}withChannelValue(t,n){const{minValue:o,maxValue:i}=this.getChannelRange(t);if(t in this){let a=this.clone();return a[t]=Ze(n,o,i),a}throw new Error("Unsupported color channel: "+t)}getColorAxes(t){let{xChannel:n,yChannel:o}=t,i=n||this.getChannels().find(s=>s!==o),a=o||this.getChannels().find(s=>s!==i),r=this.getChannels().find(s=>s!==i&&s!==a);return{xChannel:i,yChannel:a,zChannel:r}}incrementChannel(t,n){const{minValue:o,maxValue:i,step:a}=this.getChannelRange(t),r=kp(Ze(this.getChannelValue(t)+n,o,i),o,i,a);return this.withChannelValue(t,r)}decrementChannel(t,n){return this.incrementChannel(t,-n)}isEqual(t){return FS(this.toJSON(),t.toJSON())&&this.getChannelValue("alpha")===t.getChannelValue("alpha")}},NS=/^#[\da-f]+$/i,LS=/^rgba?\((.*)\)$/,BS=/[^#]/gi,Zb=class ol extends mh{constructor(t,n,o,i){super(),this.red=t,this.green=n,this.blue=o,this.alpha=i}static parse(t){let n=[];if(NS.test(t)&&[4,5,7,9].includes(t.length)){const i=(t.length<6?t.replace(BS,"$&$&"):t).slice(1).split("");for(;i.length>0;)n.push(parseInt(i.splice(0,2).join(""),16));n[3]=n[3]!==void 0?n[3]/255:void 0}const o=t.match(LS);return o!=null&&o[1]&&(n=o[1].split(",").map(i=>Number(i.trim())).map((i,a)=>Ze(i,0,a<3?255:1))),n.length<3?void 0:new ol(n[0],n[1],n[2],n[3]??1)}toString(t){switch(t){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(this.alpha*255).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"hsb":return this.toHSB().toString("hsb");default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"rgba":return this;case"hsba":return this.toHSB();case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+t)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const t=this.red/255,n=this.green/255,o=this.blue/255,i=Math.min(t,n,o),a=Math.max(t,n,o),r=a-i,s=a===0?0:r/a;let l=0;if(r!==0){switch(a){case t:l=(n-o)/r+(n<o?6:0);break;case n:l=(o-t)/r+2;break;case o:l=(t-n)/r+4;break}l/=6}return new yh(Ee(l*360,2),Ee(s*100,2),Ee(a*100,2),Ee(this.alpha,2))}toHSL(){const t=this.red/255,n=this.green/255,o=this.blue/255,i=Math.min(t,n,o),a=Math.max(t,n,o),r=(a+i)/2,s=a-i;let l=-1,c=-1;if(s===0)l=c=0;else{switch(c=s/(r<.5?a+i:2-a-i),a){case t:l=(n-o)/s+(n<o?6:0);break;case n:l=(o-t)/s+2;break;case o:l=(t-n)/s+4;break}l/=6}return new bh(Ee(l*360,2),Ee(c*100,2),Ee(r*100,2),Ee(this.alpha,2))}clone(){return new ol(this.red,this.green,this.blue,this.alpha)}getChannelFormatOptions(t){switch(t){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,n){let o=this.getChannelFormatOptions(t),i=this.getChannelValue(t);return new Intl.NumberFormat(n,o).format(i)}getChannelRange(t){switch(t){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}toJSON(){return{r:this.red,g:this.green,b:this.blue,a:this.alpha}}getFormat(){return"rgba"}getChannels(){return ol.colorChannels}};gh(Zb,"colorChannels",["red","green","blue"]);var vh=Zb,zS=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,Jb=class il extends mh{constructor(t,n,o,i){super(),this.hue=t,this.saturation=n,this.lightness=o,this.alpha=i}static parse(t){let n;if(n=t.match(zS)){const[o,i,a,r]=(n[1]??n[2]).split(",").map(s=>Number(s.trim().replace("%","")));return new il(yb(o,360),Ze(i,0,100),Ze(a,0,100),Ze(r??1,0,1))}}toString(t){switch(t){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.lightness,2)}%, ${this.alpha})`;case"hsb":return this.toHSB().toString("hsb");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"hsla":return this;case"hsba":return this.toHSB();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+t)}}toHSB(){let t=this.saturation/100,n=this.lightness/100,o=n+t*Math.min(n,1-n);return t=o===0?0:2*(1-n/o),new yh(Ee(this.hue,2),Ee(t*100,2),Ee(o*100,2),Ee(this.alpha,2))}toRGB(){let t=this.hue,n=this.saturation/100,o=this.lightness/100,i=n*Math.min(o,1-o),a=(r,s=(r+t/30)%12)=>o-i*Math.max(Math.min(s-3,9-s,1),-1);return new vh(Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255),Ee(this.alpha,2))}clone(){return new il(this.hue,this.saturation,this.lightness,this.alpha)}getChannelFormatOptions(t){switch(t){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,n){let o=this.getChannelFormatOptions(t),i=this.getChannelValue(t);return(t==="saturation"||t==="lightness")&&(i/=100),new Intl.NumberFormat(n,o).format(i)}getChannelRange(t){switch(t){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}toJSON(){return{h:this.hue,s:this.saturation,l:this.lightness,a:this.alpha}}getFormat(){return"hsla"}getChannels(){return il.colorChannels}};gh(Jb,"colorChannels",["hue","saturation","lightness"]);var bh=Jb,HS=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,Qb=class al extends mh{constructor(t,n,o,i){super(),this.hue=t,this.saturation=n,this.brightness=o,this.alpha=i}static parse(t){let n;if(n=t.match(HS)){const[o,i,a,r]=(n[1]??n[2]).split(",").map(s=>Number(s.trim().replace("%","")));return new al(yb(o,360),Ze(i,0,100),Ze(a,0,100),Ze(r??1,0,1))}}toString(t){switch(t){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.brightness,2)}%, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"hsba":return this;case"hsla":return this.toHSL();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+t)}}toHSL(){let t=this.saturation/100,n=this.brightness/100,o=n*(1-t/2);return t=o===0||o===1?0:(n-o)/Math.min(o,1-o),new bh(Ee(this.hue,2),Ee(t*100,2),Ee(o*100,2),Ee(this.alpha,2))}toRGB(){let t=this.hue,n=this.saturation/100,o=this.brightness/100,i=(a,r=(a+t/60)%6)=>o-n*o*Math.max(Math.min(r,4-r,1),0);return new vh(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),Ee(this.alpha,2))}clone(){return new al(this.hue,this.saturation,this.brightness,this.alpha)}getChannelFormatOptions(t){switch(t){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,n){let o=this.getChannelFormatOptions(t),i=this.getChannelValue(t);return(t==="saturation"||t==="brightness")&&(i/=100),new Intl.NumberFormat(n,o).format(i)}getChannelRange(t){switch(t){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}toJSON(){return{h:this.hue,s:this.saturation,b:this.brightness,a:this.alpha}}getFormat(){return"hsba"}getChannels(){return al.colorChannels}};gh(Qb,"colorChannels",["hue","saturation","brightness"]);var yh=Qb,jS="aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32",WS=e=>{const t=new Map,n=e.split(",");for(let o=0;o<n.length;o++){const[i,a]=n[o].split(":");t.set(i,`#${a}`),i.includes("gray")&&t.set(i.replace("gray","grey"),`#${a}`)}return t},ef=WS(jS),Nl=e=>{var t;if(ef.has(e))return Nl(ef.get(e));const n=vh.parse(e)||yh.parse(e)||bh.parse(e);if(!n){const o=new Error("Invalid color value: "+e);throw(t=Error.captureStackTrace)==null||t.call(Error,o,Nl),o}return n};const US=["top","right","bottom","left"],go=Math.min,Ct=Math.max,Ll=Math.round,ps=Math.floor,vn=e=>({x:e,y:e}),GS={left:"right",right:"left",bottom:"top",top:"bottom"},qS={start:"end",end:"start"};function qd(e,t,n){return Ct(e,go(t,n))}function Un(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function aa(e){return e.split("-")[1]}function xh(e){return e==="x"?"y":"x"}function wh(e){return e==="y"?"height":"width"}const YS=new Set(["top","bottom"]);function fn(e){return YS.has(Gn(e))?"y":"x"}function Ch(e){return xh(fn(e))}function KS(e,t,n){n===void 0&&(n=!1);const o=aa(e),i=Ch(e),a=wh(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(r=Bl(r)),[r,Bl(r)]}function XS(e){const t=Bl(e);return[Yd(e),t,Yd(t)]}function Yd(e){return e.replace(/start|end/g,t=>qS[t])}const tf=["left","right"],nf=["right","left"],ZS=["top","bottom"],JS=["bottom","top"];function QS(e,t,n){switch(e){case"top":case"bottom":return n?t?nf:tf:t?tf:nf;case"left":case"right":return t?ZS:JS;default:return[]}}function eE(e,t,n,o){const i=aa(e);let a=QS(Gn(e),n==="start",o);return i&&(a=a.map(r=>r+"-"+i),t&&(a=a.concat(a.map(Yd)))),a}function Bl(e){return e.replace(/left|right|bottom|top/g,t=>GS[t])}function tE(e){return{top:0,right:0,bottom:0,left:0,...e}}function ey(e){return typeof e!="number"?tE(e):{top:e,right:e,bottom:e,left:e}}function zl(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function of(e,t,n){let{reference:o,floating:i}=e;const a=fn(t),r=Ch(t),s=wh(r),l=Gn(t),c=a==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let p;switch(l){case"top":p={x:d,y:o.y-i.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y}}switch(aa(t)){case"start":p[r]-=h*(n&&c?-1:1);break;case"end":p[r]+=h*(n&&c?-1:1);break}return p}const nE=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:a=[],platform:r}=n,s=a.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=of(c,o,l),h=o,p={},m=0;for(let f=0;f<s.length;f++){const{name:b,fn:g}=s[f],{x:y,y:x,data:C,reset:k}=await g({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:c,platform:r,elements:{reference:e,floating:t}});d=y??d,u=x??u,p={...p,[b]:{...p[b],...C}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(c=k.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:d,y:u}=of(c,h,l)),f=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:p}};async function Cr(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:a,rects:r,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Un(t,e),m=ey(p),f=s[h?u==="floating"?"reference":"floating":u],b=zl(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(f)))==null||n?f:f.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),g=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),x=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},C=zl(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(b.top-C.top+m.top)/x.y,bottom:(C.bottom-b.bottom+m.bottom)/x.y,left:(b.left-C.left+m.left)/x.x,right:(C.right-b.right+m.right)/x.x}}const oE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:a,platform:r,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Un(e,t)||{};if(c==null)return{};const u=ey(d),h={x:n,y:o},p=Ch(i),m=wh(p),f=await r.getDimensions(c),b=p==="y",g=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",C=a.reference[m]+a.reference[p]-h[p]-a.floating[m],k=h[p]-a.reference[p],O=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let P=O?O[x]:0;(!P||!await(r.isElement==null?void 0:r.isElement(O)))&&(P=s.floating[x]||a.floating[m]);const $=C/2-k/2,I=P/2-f[m]/2-1,A=go(u[g],I),M=go(u[y],I),j=A,Q=P-f[m]-M,N=P/2-f[m]/2+$,B=qd(j,N,Q),G=!l.arrow&&aa(i)!=null&&N!==B&&a.reference[m]/2-(N<j?A:M)-f[m]/2<0,J=G?N<j?N-j:N-Q:0;return{[p]:h[p]+J,data:{[p]:B,centerOffset:N-B-J,...G&&{alignmentOffset:J}},reset:G}}}),iE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:a,rects:r,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...b}=Un(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const g=Gn(i),y=fn(s),x=Gn(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=h||(x||!f?[Bl(s)]:XS(s)),O=m!=="none";!h&&O&&k.push(...eE(s,f,m,C));const P=[s,...k],$=await Cr(t,b),I=[];let A=((o=a.flip)==null?void 0:o.overflows)||[];if(d&&I.push($[g]),u){const N=KS(i,r,C);I.push($[N[0]],$[N[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(N=>N<=0)){var M,j;const N=(((M=a.flip)==null?void 0:M.index)||0)+1,B=P[N];if(B&&(!(u==="alignment"&&y!==fn(B))||A.every(J=>fn(J.placement)===y?J.overflows[0]>0:!0)))return{data:{index:N,overflows:A},reset:{placement:B}};let G=(j=A.filter(J=>J.overflows[0]<=0).sort((J,Z)=>J.overflows[1]-Z.overflows[1])[0])==null?void 0:j.placement;if(!G)switch(p){case"bestFit":{var Q;const J=(Q=A.filter(Z=>{if(O){const ie=fn(Z.placement);return ie===y||ie==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ie=>ie>0).reduce((ie,re)=>ie+re,0)]).sort((Z,ie)=>Z[1]-ie[1])[0])==null?void 0:Q[0];J&&(G=J);break}case"initialPlacement":G=s;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function af(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 US.some(t=>e[t]>=0)}const aE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=Un(e,t);switch(o){case"referenceHidden":{const a=await Cr(t,{...i,elementContext:"reference"}),r=af(a,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:rf(r)}}}case"escaped":{const a=await Cr(t,{...i,altBoundary:!0}),r=af(a,n.floating);return{data:{escapedOffsets:r,escaped:rf(r)}}}default:return{}}}}},ty=new Set(["left","top"]);async function rE(e,t){const{placement:n,platform:o,elements:i}=e,a=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=Gn(n),s=aa(n),l=fn(n)==="y",c=ty.has(r)?-1:1,d=a&&l?-1:1,u=Un(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const sE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:a,placement:r,middlewareData:s}=t,l=await rE(t,e);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:r}}}}},lE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:a=!0,crossAxis:r=!1,limiter:s={fn:b=>{let{x:g,y}=b;return{x:g,y}}},...l}=Un(e,t),c={x:n,y:o},d=await Cr(t,l),u=fn(Gn(i)),h=xh(u);let p=c[h],m=c[u];if(a){const b=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=p+d[b],x=p-d[g];p=qd(y,p,x)}if(r){const b=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=m+d[b],x=m-d[g];m=qd(y,m,x)}const f=s.fn({...t,[h]:p,[u]:m});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[h]:a,[u]:r}}}}}},cE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:a,middlewareData:r}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Un(e,t),d={x:n,y:o},u=fn(i),h=xh(u);let p=d[h],m=d[u];const f=Un(s,t),b=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const x=h==="y"?"height":"width",C=a.reference[h]-a.floating[x]+b.mainAxis,k=a.reference[h]+a.reference[x]-b.mainAxis;p<C?p=C:p>k&&(p=k)}if(c){var g,y;const x=h==="y"?"width":"height",C=ty.has(Gn(i)),k=a.reference[u]-a.floating[x]+(C&&((g=r.offset)==null?void 0:g[u])||0)+(C?0:b.crossAxis),O=a.reference[u]+a.reference[x]+(C?0:((y=r.offset)==null?void 0:y[u])||0)-(C?b.crossAxis:0);m<k?m=k:m>O&&(m=O)}return{[h]:p,[u]:m}}}},dE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:a,platform:r,elements:s}=t,{apply:l=()=>{},...c}=Un(e,t),d=await Cr(t,c),u=Gn(i),h=aa(i),p=fn(i)==="y",{width:m,height:f}=a.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=h===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,b=h==="end"?"top":"bottom");const y=f-d.top-d.bottom,x=m-d.left-d.right,C=go(f-d[b],y),k=go(m-d[g],x),O=!t.middlewareData.shift;let P=C,$=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(P=y),O&&!h){const A=Ct(d.left,0),M=Ct(d.right,0),j=Ct(d.top,0),Q=Ct(d.bottom,0);p?$=m-2*(A!==0||M!==0?A+M:Ct(d.left,d.right)):P=f-2*(j!==0||Q!==0?j+Q:Ct(d.top,d.bottom))}await l({...t,availableWidth:$,availableHeight:P});const I=await r.getDimensions(s.floating);return m!==I.width||f!==I.height?{reset:{rects:!0}}:{}}}};function $c(){return typeof window<"u"}function ra(e){return ny(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cn(e){var t;return(t=(ny(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ny(e){return $c()?e instanceof Node||e instanceof St(e).Node:!1}function nn(e){return $c()?e instanceof Element||e instanceof St(e).Element:!1}function yn(e){return $c()?e instanceof HTMLElement||e instanceof St(e).HTMLElement:!1}function sf(e){return!$c()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}const uE=new Set(["inline","contents"]);function qr(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=on(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!uE.has(i)}const hE=new Set(["table","td","th"]);function pE(e){return hE.has(ra(e))}const fE=[":popover-open",":modal"];function kc(e){return fE.some(t=>{try{return e.matches(t)}catch{return!1}})}const gE=["transform","translate","scale","rotate","perspective"],mE=["transform","translate","scale","rotate","perspective","filter"],vE=["paint","layout","strict","content"];function _h(e){const t=$h(),n=nn(e)?on(e):e;return gE.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mE.some(o=>(n.willChange||"").includes(o))||vE.some(o=>(n.contain||"").includes(o))}function bE(e){let t=mo(e);for(;yn(t)&&!qi(t);){if(_h(t))return t;if(kc(t))return null;t=mo(t)}return null}function $h(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yE=new Set(["html","body","#document"]);function qi(e){return yE.has(ra(e))}function on(e){return St(e).getComputedStyle(e)}function Sc(e){return nn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mo(e){if(ra(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sf(e)&&e.host||Cn(e);return sf(t)?t.host:t}function oy(e){const t=mo(e);return qi(t)?e.ownerDocument?e.ownerDocument.body:e.body:yn(t)&&qr(t)?t:oy(t)}function _r(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=oy(e),a=i===((o=e.ownerDocument)==null?void 0:o.body),r=St(i);if(a){const s=Kd(r);return t.concat(r,r.visualViewport||[],qr(i)?i:[],s&&n?_r(s):[])}return t.concat(i,_r(i,[],n))}function Kd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function iy(e){const t=on(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=yn(e),a=i?e.offsetWidth:n,r=i?e.offsetHeight:o,s=Ll(n)!==a||Ll(o)!==r;return s&&(n=a,o=r),{width:n,height:o,$:s}}function kh(e){return nn(e)?e:e.contextElement}function zi(e){const t=kh(e);if(!yn(t))return vn(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:a}=iy(t);let r=(a?Ll(n.width):n.width)/o,s=(a?Ll(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const xE=vn(0);function ay(e){const t=St(e);return!$h()||!t.visualViewport?xE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==St(e)?!1:t}function Qo(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=kh(e);let r=vn(1);t&&(o?nn(o)&&(r=zi(o)):r=zi(e));const s=wE(a,n,o)?ay(a):vn(0);let l=(i.left+s.x)/r.x,c=(i.top+s.y)/r.y,d=i.width/r.x,u=i.height/r.y;if(a){const h=St(a),p=o&&nn(o)?St(o):o;let m=h,f=Kd(m);for(;f&&o&&p!==m;){const b=zi(f),g=f.getBoundingClientRect(),y=on(f),x=g.left+(f.clientLeft+parseFloat(y.paddingLeft))*b.x,C=g.top+(f.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,u*=b.y,l+=x,c+=C,m=St(f),f=Kd(m)}}return zl({width:d,height:u,x:l,y:c})}function Ec(e,t){const n=Sc(e).scrollLeft;return t?t.left+n:Qo(Cn(e)).left+n}function ry(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ec(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function CE(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const a=i==="fixed",r=Cn(o),s=t?kc(t.floating):!1;if(o===r||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=vn(1);const d=vn(0),u=yn(o);if((u||!u&&!a)&&((ra(o)!=="body"||qr(r))&&(l=Sc(o)),yn(o))){const p=Qo(o);c=zi(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const h=r&&!u&&!a?ry(r,l):vn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function _E(e){return Array.from(e.getClientRects())}function $E(e){const t=Cn(e),n=Sc(e),o=e.ownerDocument.body,i=Ct(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Ct(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ec(e);const s=-n.scrollTop;return on(o).direction==="rtl"&&(r+=Ct(t.clientWidth,o.clientWidth)-i),{width:i,height:a,x:r,y:s}}const lf=25;function kE(e,t){const n=St(e),o=Cn(e),i=n.visualViewport;let a=o.clientWidth,r=o.clientHeight,s=0,l=0;if(i){a=i.width,r=i.height;const d=$h();(!d||d&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Ec(o);if(c<=0){const d=o.ownerDocument,u=d.body,h=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(o.clientWidth-u.clientWidth-p);m<=lf&&(a-=m)}else c<=lf&&(a+=c);return{width:a,height:r,x:s,y:l}}const SE=new Set(["absolute","fixed"]);function EE(e,t){const n=Qo(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,a=yn(e)?zi(e):vn(1),r=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=o*a.y;return{width:r,height:s,x:l,y:c}}function cf(e,t,n){let o;if(t==="viewport")o=kE(e,n);else if(t==="document")o=$E(Cn(e));else if(nn(t))o=EE(t,n);else{const i=ay(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zl(o)}function sy(e,t){const n=mo(e);return n===t||!nn(n)||qi(n)?!1:on(n).position==="fixed"||sy(n,t)}function OE(e,t){const n=t.get(e);if(n)return n;let o=_r(e,[],!1).filter(s=>nn(s)&&ra(s)!=="body"),i=null;const a=on(e).position==="fixed";let r=a?mo(e):e;for(;nn(r)&&!qi(r);){const s=on(r),l=_h(r);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&i&&SE.has(i.position)||qr(r)&&!l&&sy(e,r))?o=o.filter(c=>c!==r):i=s,r=mo(r)}return t.set(e,o),o}function TE(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const a=[...n==="clippingAncestors"?kc(t)?[]:OE(t,this._c):[].concat(n),o],r=a[0],s=a.reduce((l,c)=>{const d=cf(t,c,i);return l.top=Ct(d.top,l.top),l.right=go(d.right,l.right),l.bottom=go(d.bottom,l.bottom),l.left=Ct(d.left,l.left),l},cf(t,r,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function IE(e){const{width:t,height:n}=iy(e);return{width:t,height:n}}function PE(e,t,n){const o=yn(t),i=Cn(t),a=n==="fixed",r=Qo(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=vn(0);function c(){l.x=Ec(i)}if(o||!o&&!a)if((ra(t)!=="body"||qr(i))&&(s=Sc(t)),o){const p=Qo(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&c();a&&!o&&i&&c();const d=i&&!o&&!a?ry(i,s):vn(0),u=r.left+s.scrollLeft-l.x-d.x,h=r.top+s.scrollTop-l.y-d.y;return{x:u,y:h,width:r.width,height:r.height}}function Kc(e){return on(e).position==="static"}function df(e,t){if(!yn(e)||on(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function ly(e,t){const n=St(e);if(kc(e))return n;if(!yn(e)){let i=mo(e);for(;i&&!qi(i);){if(nn(i)&&!Kc(i))return i;i=mo(i)}return n}let o=df(e,t);for(;o&&pE(o)&&Kc(o);)o=df(o,t);return o&&qi(o)&&Kc(o)&&!_h(o)?n:o||bE(e)||n}const VE=async function(e){const t=this.getOffsetParent||ly,n=this.getDimensions,o=await n(e.floating);return{reference:PE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function DE(e){return on(e).direction==="rtl"}const ME={convertOffsetParentRelativeRectToViewportRelativeRect:CE,getDocumentElement:Cn,getClippingRect:TE,getOffsetParent:ly,getElementRects:VE,getClientRects:_E,getDimensions:IE,getScale:zi,isElement:nn,isRTL:DE};function cy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function RE(e,t){let n=null,o;const i=Cn(e);function a(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(s||t(),!h||!p)return;const m=ps(u),f=ps(i.clientWidth-(d+h)),b=ps(i.clientHeight-(u+p)),g=ps(d),y={rootMargin:-m+"px "+-f+"px "+-b+"px "+-g+"px",threshold:Ct(0,go(1,l))||1};let x=!0;function C(k){const O=k[0].intersectionRatio;if(O!==l){if(!x)return r();O?r(!1,O):o=setTimeout(()=>{r(!1,1e-7)},1e3)}O===1&&!cy(c,e.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(C,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return r(!0),a}function AE(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=kh(e),d=i||a?[...c?_r(c):[],..._r(t)]:[];d.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),a&&g.addEventListener("resize",n)});const u=c&&s?RE(c,n):null;let h=-1,p=null;r&&(p=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let m,f=l?Qo(e):null;l&&b();function b(){const g=Qo(e);f&&!cy(f,g)&&n(),f=g,m=requestAnimationFrame(b)}return n(),()=>{var g;d.forEach(y=>{i&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),u?.(),(g=p)==null||g.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const FE=sE,NE=lE,LE=iE,BE=dE,zE=aE,HE=oE,jE=cE,WE=(e,t,n)=>{const o=new Map,i={platform:ME,...n},a={...i.platform,_c:o};return nE(e,t,{...i,platform:a})};function uf(e=0,t=0,n=0,o=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,o);const i={x:e,y:t,width:n,height:o,top:t,right:e+n,bottom:t+o,left:e};return{...i,toJSON:()=>i}}function UE(e){if(!e)return uf();const{x:t,y:n,width:o,height:i}=e;return uf(t,n,o,i)}function GE(e,t){return{contextElement:Be(e)?e:void 0,getBoundingClientRect:()=>{const n=e,o=t?.(n);return o||!n?UE(o):n.getBoundingClientRect()}}}var wa=e=>({variable:e,reference:`var(${e})`}),Tn={arrowSize:wa("--arrow-size"),arrowSizeHalf:wa("--arrow-size-half"),arrowBg:wa("--arrow-background"),transformOrigin:wa("--transform-origin"),arrowOffset:wa("--arrow-offset")},qE=e=>e==="top"||e==="bottom"?"y":"x";function YE(e,t){return{name:"transformOrigin",fn(n){var o,i,a,r;const{elements:s,middlewareData:l,placement:c,rects:d,y:u}=n,h=c.split("-")[0],p=qE(h),m=((o=l.arrow)==null?void 0:o.x)||0,f=((i=l.arrow)==null?void 0:i.y)||0,b=t?.clientWidth||0,g=t?.clientHeight||0,y=m+b/2,x=f+g/2,C=Math.abs(((a=l.shift)==null?void 0:a.y)||0),k=d.reference.height/2,O=g/2,P=((r=e.offset)==null?void 0:r.mainAxis)??e.gutter,$=typeof P=="number"?P+O:P??O,I=C>$,A={top:`${y}px calc(100% + ${$}px)`,bottom:`${y}px ${-$}px`,left:`calc(100% + ${$}px) ${x}px`,right:`${-$}px ${x}px`}[h],M=`${y}px ${d.reference.y+k-u}px`,j=!!e.overlap&&p==="y"&&I;return s.floating.style.setProperty(Tn.transformOrigin.variable,j?M:A),{data:{transformOrigin:j?M:A}}}}}var KE={name:"rects",fn({rects:e}){return{data:e}}},XE=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:o,y:i}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:o!=null?`${o}px`:"",top:i!=null?`${i}px`:"",[a]:`calc(100% + ${Tn.arrowOffset.reference})`}),{}}}};function ZE(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function JE(e){return e.split("-")[0]}var QE={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function hf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Sh(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function eO(e,t,n){const o=e||t.createElement("div");return HE({element:o,padding:n.arrowPadding})}function tO(e,t){if(!JC(t.offset??t.gutter))return FE(({placement:n})=>{var o,i;const a=(e?.clientHeight||0)/2,r=((o=t.offset)==null?void 0:o.mainAxis)??t.gutter,s=typeof r=="number"?r+a:r??a,{hasAlign:l}=ZE(n),c=l?void 0:t.shift,d=((i=t.offset)==null?void 0:i.crossAxis)??c;return vc({crossAxis:d,mainAxis:s,alignmentAxis:t.shift})})}function nO(e){if(!e.flip)return;const t=Sh(e.boundary);return LE({...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function oO(e){if(!e.slide&&!e.overlap)return;const t=Sh(e.boundary);return NE({...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:jE()})}function iO(e){return BE({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:o,availableWidth:i}){const a=t.floating,r=Math.round(n.reference.width),s=Math.round(n.reference.height);i=Math.floor(i),o=Math.floor(o),a.style.setProperty("--reference-width",`${r}px`),a.style.setProperty("--reference-height",`${s}px`),a.style.setProperty("--available-width",`${i}px`),a.style.setProperty("--available-height",`${o}px`)}})}function aO(e){if(e.hideWhenDetached)return zE({strategy:"referenceHidden",boundary:Sh(e.boundary)??"clippingAncestors"})}function rO(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function sO(e,t,n={}){const o=GE(e,n.getAnchorRect);if(!t||!o)return;const i=Object.assign({},QE,n),a=t.querySelector("[data-part=arrow]"),r=[tO(a,i),nO(i),oO(i),eO(a,t.ownerDocument,i),XE(a),YE({gutter:i.gutter,offset:i.offset,overlap:i.overlap},a),iO(i),aO(i),KE],{placement:s,strategy:l,onComplete:c,onPositioned:d}=i,u=async()=>{var f;if(!o||!t)return;const b=await WE(o,t,{placement:s,middleware:r,strategy:l});c?.(b),d?.({placed:!0});const g=Fe(t),y=hf(g,b.x),x=hf(g,b.y);t.style.setProperty("--x",`${y}px`),t.style.setProperty("--y",`${x}px`),i.hideWhenDetached&&((f=b.middlewareData.hide)!=null&&f.referenceHidden?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const C=t.firstElementChild;if(C){const k=Gi(C);t.style.setProperty("--z-index",k.zIndex)}},h=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:u,floatingElement:t}),d?.({placed:!0})):await u()},p=rO(i.listeners),m=i.listeners?AE(o,t,h,p):a_;return h(),()=>{m?.(),d?.({placed:!1})}}function Et(e,t,n={}){const{defer:o,...i}=n,a=o?ae:s=>s(),r=[];return r.push(a(()=>{const s=typeof e=="function"?e():e,l=typeof t=="function"?t():t;r.push(sO(s,l,i))})),()=>{r.forEach(s=>s?.())}}var lO={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Eh(e={}){const{placement:t,sameWidth:n,fitViewport:o,strategy:i="absolute"}=e;return{arrow:{position:"absolute",width:Tn.arrowSize.reference,height:Tn.arrowSize.reference,[Tn.arrowSizeHalf.variable]:`calc(${Tn.arrowSize.reference} / 2)`,[Tn.arrowOffset.variable]:`calc(${Tn.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?lO[t.split("-")[0]]:void 0,background:Tn.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:o?"var(--available-width)":void 0,maxHeight:o?"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)"}}}var dy=le("color-picker",["root","label","control","trigger","positioner","content","area","areaThumb","valueText","areaBackground","channelSlider","channelSliderLabel","channelSliderTrack","channelSliderThumb","channelSliderValueText","channelInput","transparencyGrid","swatchGroup","swatchTrigger","swatchIndicator","swatch","eyeDropperTrigger","formatTrigger","formatSelect"]);dy.build();var cO=e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`color-picker:${e.id}:hidden-input`},dO=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`color-picker:${e.id}:control`},uO=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`color-picker:${e.id}:trigger`},hO=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`color-picker:${e.id}:content`},pO=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`color-picker:${e.id}:positioner`},fO=e=>{var t;return((t=e.ids)==null?void 0:t.formatSelect)??`color-picker:${e.id}:format-select`},gO=e=>{var t;return((t=e.ids)==null?void 0:t.area)??`color-picker:${e.id}:area`},mO=e=>{var t;return((t=e.ids)==null?void 0:t.areaThumb)??`color-picker:${e.id}:area-thumb`},vO=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.channelSliderTrack)==null?void 0:o.call(n,t))??`color-picker:${e.id}:slider-track:${t}`},bO=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.channelSliderThumb)==null?void 0:o.call(n,t))??`color-picker:${e.id}:slider-thumb:${t}`},rl=e=>e.getById(hO(e)),yO=e=>e.getById(mO(e)),xO=(e,t)=>e.getById(bO(e,t)),wO=e=>e.getById(fO(e)),pf=e=>e.getById(cO(e)),CO=e=>e.getById(gO(e)),_O=(e,t,n)=>{const o=CO(e);if(!o)return;const{getPercentValue:i}=rb(t,o);return{x:i({dir:n,orientation:"horizontal"}),y:i({orientation:"vertical"})}},$O=e=>e.getById(dO(e)),Xc=e=>e.getById(uO(e)),kO=e=>e.getById(pO(e)),SO=(e,t)=>e.getById(vO(e,t)),EO=(e,t,n,o)=>{const i=SO(e,n);if(!i)return;const{getPercentValue:a}=rb(t,i);return{x:a({dir:o,orientation:"horizontal"}),y:a({orientation:"vertical"})}},OO=e=>[...fo(rl(e),"input[data-channel]"),...fo($O(e),"input[data-channel]")];function TO(e,t){if(t==null)return"";if(t==="hex")return e.toString("hex");if(t==="css")return e.toString("css");if(t in e)return e.getChannelValue(t).toString();const n=e.getFormat()==="hsla";switch(t){case"hue":return n?e.toFormat("hsla").getChannelValue("hue").toString():e.toFormat("hsba").getChannelValue("hue").toString();case"saturation":return n?e.toFormat("hsla").getChannelValue("saturation").toString():e.toFormat("hsba").getChannelValue("saturation").toString();case"lightness":return e.toFormat("hsla").getChannelValue("lightness").toString();case"brightness":return e.toFormat("hsba").getChannelValue("brightness").toString();case"red":case"green":case"blue":return e.toFormat("rgba").getChannelValue(t).toString();default:return e.getChannelValue(t).toString()}}var ff=e=>Nl(e),IO=/^[0-9a-fA-F]{3,8}$/;function PO(e){return IO.test(e)}function VO(e){return e.startsWith("#")?e:PO(e)?`#${e}`:e}var{and:DO}=et();DO("isOpenControlled","closeOnSelect");function gf(e,t,n){const o=OO(e);ae(()=>{o.forEach(i=>{const a=i.dataset.channel;Jt(i,TO(n||t,a))})})}function MO(e,t){const n=wO(e);n&&ae(()=>Jt(n,t))}ee()(["closeOnSelect","dir","disabled","format","defaultFormat","getRootNode","id","ids","initialFocusEl","inline","name","positioning","onFocusOutside","onFormatChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","onValueChangeEnd","defaultOpen","open","positioning","required","readOnly","value","defaultValue","invalid","openAutoFocus"]);ee()(["xChannel","yChannel"]);ee()(["channel","orientation"]);ee()(["value","disabled"]);ee()(["value","respectAlpha"]);ee()(["size"]);dy.extendWith("view");var uy=le("combobox").parts("root","clearTrigger","content","control","input","item","itemGroup","itemGroupLabel","itemIndicator","itemText","label","list","positioner","trigger");uy.build();var hy=e=>new si(e);hy.empty=()=>new si({items:[]});var RO=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`combobox:${e.id}:control`},AO=e=>{var t;return((t=e.ids)==null?void 0:t.input)??`combobox:${e.id}:input`},FO=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`combobox:${e.id}:content`},NO=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`combobox:${e.id}:popper`},LO=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`combobox:${e.id}:toggle-btn`},BO=e=>{var t;return((t=e.ids)==null?void 0:t.clearTrigger)??`combobox:${e.id}:clear-btn`},to=e=>e.getById(FO(e)),Ti=e=>e.getById(AO(e)),mf=e=>e.getById(NO(e)),vf=e=>e.getById(RO(e)),Ka=e=>e.getById(LO(e)),bf=e=>e.getById(BO(e)),Ca=(e,t)=>{if(t==null)return null;const n=`[role=option][data-value="${CSS.escape(t)}"]`;return db(to(e),n)},yf=e=>{const t=Ti(e);e.isActiveElement(t)||t==null||t.focus({preventScroll:!0})},zO=e=>{const t=Ka(e);e.isActiveElement(t)||t==null||t.focus({preventScroll:!0})},{guards:HO,createMachine:jO,choose:WO}=bc(),{and:Ue,not:yt}=HO;jO({props({props:e}){return{loopFocus:!0,openOnClick:!1,defaultValue:[],defaultInputValue:"",closeOnSelect:!e.multiple,allowCustomValue:!1,alwaysSubmitOnEnter:!1,inputBehavior:"none",selectionBehavior:e.multiple?"clear":"replace",openOnKeyPress:!0,openOnChange:!0,composite:!0,navigate({node:t}){ib(t)},collection:hy.empty(),...e,positioning:{placement:"bottom",sameWidth:!0,...e.positioning},translations:{triggerLabel:"Toggle suggestions",clearTriggerLabel:"Clear value",...e.translations}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"suggesting":"idle"},context({prop:e,bindable:t,getContext:n,getEvent:o}){return{currentPlacement:t(()=>({defaultValue:void 0})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:Je,hash(i){return i.join(",")},onChange(i){var a;const r=n(),s=r.get("selectedItems"),l=e("collection"),c=i.map(d=>s.find(u=>l.getItemValue(u)===d)||l.find(d));r.set("selectedItems",c),(a=e("onValueChange"))==null||a({value:i,items:c})}})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(i){var a;const r=e("collection").find(i);(a=e("onHighlightChange"))==null||a({highlightedValue:i,highlightedItem:r})}})),inputValue:t(()=>{let i=e("inputValue")||e("defaultInputValue");const a=e("value")||e("defaultValue");if(!i.trim()&&!e("multiple")){const r=e("collection").stringifyMany(a);i=ut(e("selectionBehavior"),{preserve:i||r,replace:r,clear:""})}return{defaultValue:i,value:e("inputValue"),onChange(r){var s;const l=o(),c=(l.previousEvent||l).src;(s=e("onInputValueChange"))==null||s({inputValue:r,reason:c})}}}),highlightedItem:t(()=>{const i=e("highlightedValue");return{defaultValue:e("collection").find(i)}}),selectedItems:t(()=>{const i=e("value")||e("defaultValue")||[];return{defaultValue:e("collection").findMany(i)}})}},computed:{isInputValueEmpty:({context:e})=>e.get("inputValue").length===0,isInteractive:({prop:e})=>!(e("readOnly")||e("disabled")),autoComplete:({prop:e})=>e("inputBehavior")==="autocomplete",autoHighlight:({prop:e})=>e("inputBehavior")==="autohighlight",hasSelectedItems:({context:e})=>e.get("value").length>0,valueAsString:({context:e,prop:t})=>t("collection").stringifyItems(e.get("selectedItems")),isCustomValue:({context:e,computed:t})=>e.get("inputValue")!==t("valueAsString")},watch({context:e,prop:t,track:n,action:o,send:i}){n([()=>e.hash("value")],()=>{o(["syncSelectedItems"])}),n([()=>e.get("inputValue")],()=>{o(["syncInputValue"])}),n([()=>e.get("highlightedValue")],()=>{o(["syncHighlightedItem","autofillInputValue"])}),n([()=>t("open")],()=>{o(["toggleVisibility"])}),n([()=>t("collection").toString()],()=>{i({type:"CHILDREN_CHANGE"})})},on:{"SELECTED_ITEMS.SYNC":{actions:["syncSelectedItems"]},"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedValue"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedValue"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setValue"]},"INPUT_VALUE.SET":{actions:["setInputValue"]},"POSITIONING.SET":{actions:["reposition"]}},entry:WO([{guard:"autoFocus",actions:["setInitialFocus"]}]),states:{idle:{tags:["idle","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":{target:"interacting"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{target:"focused",actions:["clearInputValue","clearSelectedItems","setInitialFocus"]}}},focused:{tags:["focused","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":[{guard:"isChangeEvent",target:"suggesting"},{target:"interacting"}],"INPUT.CHANGE":[{guard:Ue("isOpenControlled","openOnChange"),actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{guard:"openOnChange",target:"suggesting",actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{actions:["setInputValue"]}],"LAYER.INTERACT_OUTSIDE":{target:"idle"},"INPUT.ESCAPE":{guard:Ue("isCustomValue",yt("allowCustomValue")),actions:["revertInputValue"]},"INPUT.BLUR":{target:"idle"},"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_DOWN":[{guard:Ue("isOpenControlled","autoComplete"),actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"isOpenControlled",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_UP":[{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems"]}}},interacting:{tags:["open","focused"],entry:["setInitialFocus"],effects:["scrollToHighlightedItem","trackDismissableLayer","trackPlacement","hideOtherElements"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]},{actions:["scrollToHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"]},"INPUT.END":{actions:["highlightLastItem"]},"INPUT.ARROW_DOWN":[{guard:Ue("autoComplete","isLastItemHighlighted"),actions:["clearHighlightedValue","scrollContentToTop"]},{actions:["highlightNextItem"]}],"INPUT.ARROW_UP":[{guard:Ue("autoComplete","isFirstItemHighlighted"),actions:["clearHighlightedValue"]},{actions:["highlightPrevItem"]}],"INPUT.ENTER":[{guard:Ue("isOpenControlled","isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":[{guard:"autoComplete",target:"suggesting",actions:["setInputValue"]},{target:"suggesting",actions:["clearHighlightedValue","setInputValue"]}],"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.CLICK":[{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],"LAYER.ESCAPE":[{guard:Ue("isOpenControlled","autoComplete"),actions:["syncInputValue","invokeOnClose"]},{guard:"autoComplete",target:"focused",actions:["syncInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"LAYER.INTERACT_OUTSIDE":[{guard:Ue("isOpenControlled","isCustomValue",yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}},suggesting:{tags:["open","focused"],effects:["trackDismissableLayer","scrollToHighlightedItem","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"autoHighlight",actions:["highlightFirstItem"]},{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]}],"INPUT.ARROW_DOWN":{target:"interacting",actions:["highlightNextItem"]},"INPUT.ARROW_UP":{target:"interacting",actions:["highlightPrevItem"]},"INPUT.HOME":{target:"interacting",actions:["highlightFirstItem"]},"INPUT.END":{target:"interacting",actions:["highlightLastItem"]},"INPUT.ENTER":[{guard:Ue("isOpenControlled","isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":{actions:["setInputValue"]},"LAYER.ESCAPE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.POINTER_MOVE":{target:"interacting",actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"LAYER.INTERACT_OUTSIDE":[{guard:Ue("isOpenControlled","isCustomValue",yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.CLICK":[{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}}},implementations:{guards:{isInputValueEmpty:({computed:e})=>e("isInputValueEmpty"),autoComplete:({computed:e,prop:t})=>e("autoComplete")&&!t("multiple"),autoHighlight:({computed:e})=>e("autoHighlight"),isFirstItemHighlighted:({prop:e,context:t})=>e("collection").firstValue===t.get("highlightedValue"),isLastItemHighlighted:({prop:e,context:t})=>e("collection").lastValue===t.get("highlightedValue"),isCustomValue:({computed:e})=>e("isCustomValue"),allowCustomValue:({prop:e})=>!!e("allowCustomValue"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null,openOnChange:({prop:e,context:t})=>{const n=e("openOnChange");return ZC(n)?n:!!(n!=null&&n({inputValue:t.get("inputValue")}))},restoreFocus:({event:e})=>e.restoreFocus==null?!0:!!e.restoreFocus,isChangeEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="INPUT.CHANGE"},autoFocus:({prop:e})=>!!e("autoFocus"),isHighlightedItemRemoved:({prop:e,context:t})=>!e("collection").has(t.get("highlightedValue"))},effects:{trackDismissableLayer({send:e,prop:t,scope:n}){return t("disableLayer")?void 0:ia(()=>to(n),{type:"listbox",defer:!0,exclude:()=>[Ti(n),Ka(n),bf(n)],onFocusOutside:t("onFocusOutside"),onPointerDownOutside:t("onPointerDownOutside"),onInteractOutside:t("onInteractOutside"),onEscapeKeyDown(o){o.preventDefault(),o.stopPropagation(),e({type:"LAYER.ESCAPE",src:"escape-key"})},onDismiss(){e({type:"LAYER.INTERACT_OUTSIDE",src:"interact-outside",restoreFocus:!1})}})},hideOtherElements({scope:e}){return xk([Ti(e),to(e),Ka(e),bf(e)])},trackPlacement({context:e,prop:t,scope:n}){const o=()=>vf(n)||Ka(n),i=()=>mf(n);return e.set("currentPlacement",t("positioning").placement),Et(o,i,{...t("positioning"),defer:!0,onComplete(a){e.set("currentPlacement",a.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n,event:o}){const i=Ti(n);let a=[];const r=c=>{const d=o.current().type.includes("POINTER"),u=e.get("highlightedValue");if(d||!u)return;const h=to(n),p=t("scrollToIndexFn");if(p){const b=t("collection").indexOf(u);p({index:b,immediate:c,getElement:()=>Ca(n,u)});return}const m=Ca(n,u),f=ae(()=>{yr(m,{rootEl:h,block:"nearest"})});a.push(f)},s=ae(()=>r(!0));a.push(s);const l=Nr(i,{attributes:["aria-activedescendant"],callback:()=>r(!1)});return a.push(l),()=>{a.forEach(c=>c())}}},actions:{reposition({context:e,prop:t,scope:n,event:o}){Et(()=>vf(n),()=>mf(n),{...t("positioning"),...o.options,defer:!0,listeners:!1,onComplete(i){e.set("currentPlacement",i.placement)}})},setHighlightedValue({context:e,event:t}){t.value!=null&&e.set("highlightedValue",t.value)},clearHighlightedValue({context:e}){e.set("highlightedValue",null)},selectHighlightedItem(e){var t;const{context:n,prop:o}=e,i=o("collection"),a=n.get("highlightedValue");if(!a||!i.has(a))return;const r=o("multiple")?Zo(n.get("value"),a):[a];(t=o("onSelect"))==null||t({value:r,itemValue:a}),n.set("value",r);const s=ut(o("selectionBehavior"),{preserve:n.get("inputValue"),replace:i.stringifyMany(r),clear:""});n.set("inputValue",s)},scrollToHighlightedItem({context:e,prop:t,scope:n}){pc(()=>{const o=e.get("highlightedValue");if(o==null)return;const i=Ca(n,o),a=to(n),r=t("scrollToIndexFn");if(r){const s=t("collection").indexOf(o);r({index:s,immediate:!0,getElement:()=>Ca(n,o)});return}yr(i,{rootEl:a,block:"nearest"})})},selectItem(e){const{context:t,event:n,flush:o,prop:i}=e;n.value!=null&&o(()=>{var a;const r=i("multiple")?Zo(t.get("value"),n.value):[n.value];(a=i("onSelect"))==null||a({value:r,itemValue:n.value}),t.set("value",r);const s=ut(i("selectionBehavior"),{preserve:t.get("inputValue"),replace:i("collection").stringifyMany(r),clear:""});t.set("inputValue",s)})},clearItem(e){const{context:t,event:n,flush:o,prop:i}=e;n.value!=null&&o(()=>{const a=qo(t.get("value"),n.value);t.set("value",a);const r=ut(i("selectionBehavior"),{preserve:t.get("inputValue"),replace:i("collection").stringifyMany(a),clear:""});t.set("inputValue",r)})},setInitialFocus({scope:e}){ae(()=>{yf(e)})},setFinalFocus({scope:e}){ae(()=>{const t=Ka(e);t?.dataset.focusable==null?yf(e):zO(e)})},syncInputValue({context:e,scope:t,event:n}){const o=Ti(t);o&&(o.value=e.get("inputValue"),queueMicrotask(()=>{n.current().type!=="INPUT.CHANGE"&&P1(o)}))},setInputValue({context:e,event:t}){e.set("inputValue",t.value)},clearInputValue({context:e}){e.set("inputValue","")},revertInputValue({context:e,prop:t,computed:n}){const o=t("selectionBehavior"),i=ut(o,{replace:n("hasSelectedItems")?n("valueAsString"):"",preserve:e.get("inputValue"),clear:""});e.set("inputValue",i)},setValue(e){const{context:t,flush:n,event:o,prop:i}=e;n(()=>{t.set("value",o.value);const a=ut(i("selectionBehavior"),{preserve:t.get("inputValue"),replace:i("collection").stringifyMany(o.value),clear:""});t.set("inputValue",a)})},clearSelectedItems(e){const{context:t,flush:n,prop:o}=e;n(()=>{t.set("value",[]);const i=ut(o("selectionBehavior"),{preserve:t.get("inputValue"),replace:o("collection").stringifyMany([]),clear:""});t.set("inputValue",i)})},scrollContentToTop({prop:e,scope:t}){const n=e("scrollToIndexFn");if(n){const o=e("collection").firstValue;n({index:0,immediate:!0,getElement:()=>Ca(t,o)})}else{const o=to(t);if(!o)return;o.scrollTop=0}},invokeOnOpen({prop:e,event:t}){var n;const o=xf(t);(n=e("onOpenChange"))==null||n({open:!0,reason:o})},invokeOnClose({prop:e,event:t}){var n;const o=xf(t);(n=e("onOpenChange"))==null||n({open:!1,reason:o})},highlightFirstItem({context:e,prop:t,scope:n}){(to(n)?queueMicrotask:ae)(()=>{const o=t("collection").firstValue;o&&e.set("highlightedValue",o)})},highlightFirstItemIfNeeded({computed:e,action:t}){e("autoHighlight")&&t(["highlightFirstItem"])},highlightLastItem({context:e,prop:t,scope:n}){(to(n)?queueMicrotask:ae)(()=>{const o=t("collection").lastValue;o&&e.set("highlightedValue",o)})},highlightNextItem({context:e,prop:t}){let n=null;const o=e.get("highlightedValue"),i=t("collection");o?(n=i.getNextValue(o),!n&&t("loopFocus")&&(n=i.firstValue)):n=i.firstValue,n&&e.set("highlightedValue",n)},highlightPrevItem({context:e,prop:t}){let n=null;const o=e.get("highlightedValue"),i=t("collection");o?(n=i.getPreviousValue(o),!n&&t("loopFocus")&&(n=i.lastValue)):n=i.lastValue,n&&e.set("highlightedValue",n)},highlightFirstSelectedItem({context:e,prop:t}){ae(()=>{const[n]=t("collection").sort(e.get("value"));n&&e.set("highlightedValue",n)})},highlightFirstOrSelectedItem({context:e,prop:t,computed:n}){ae(()=>{let o=null;n("hasSelectedItems")?o=t("collection").sort(e.get("value"))[0]:o=t("collection").firstValue,o&&e.set("highlightedValue",o)})},highlightLastOrSelectedItem({context:e,prop:t,computed:n}){ae(()=>{const o=t("collection");let i=null;n("hasSelectedItems")?i=o.sort(e.get("value"))[0]:i=o.lastValue,i&&e.set("highlightedValue",i)})},autofillInputValue({context:e,computed:t,prop:n,event:o,scope:i}){const a=Ti(i),r=n("collection");if(!t("autoComplete")||!a||!o.keypress)return;const s=r.stringify(e.get("highlightedValue"));ae(()=>{a.value=s||e.get("inputValue")})},syncSelectedItems(e){queueMicrotask(()=>{const{context:t,prop:n}=e,o=n("collection"),i=t.get("value"),a=i.map(s=>t.get("selectedItems").find(l=>o.getItemValue(l)===s)||o.find(s));t.set("selectedItems",a);const r=ut(n("selectionBehavior"),{preserve:t.get("inputValue"),replace:o.stringifyMany(i),clear:""});t.set("inputValue",r)})},syncHighlightedItem({context:e,prop:t}){const n=t("collection").find(e.get("highlightedValue"));e.set("highlightedItem",n)},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}});function xf(e){return(e.previousEvent||e).src}ee()(["allowCustomValue","autoFocus","closeOnSelect","collection","composite","defaultHighlightedValue","defaultInputValue","defaultOpen","defaultValue","dir","disabled","disableLayer","form","getRootNode","highlightedValue","id","ids","inputBehavior","inputValue","invalid","loopFocus","multiple","name","navigate","onFocusOutside","onHighlightChange","onInputValueChange","onInteractOutside","onOpenChange","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","openOnChange","openOnClick","openOnKeyPress","placeholder","positioning","readOnly","required","scrollToIndexFn","selectionBehavior","translations","value","alwaysSubmitOnEnter"]);ee()(["htmlFor"]);ee()(["id"]);ee()(["item","persistFocus"]);uy.extendWith("empty");function Zc(e,t){return e-t*Math.floor(e/t)}const py=1721426;function fs(e,t,n,o){t=Oh(e,t);let i=t-1,a=-2;return n<=2?a=0:sl(t)&&(a=-1),py-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+o)}function sl(e){return e%4===0&&(e%100!==0||e%400===0)}function Oh(e,t){return e==="BC"?1-t:t}function UO(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const GO={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]};let Yi=class{fromJulianDay(t){let n=t,o=n-py,i=Math.floor(o/146097),a=Zc(o,146097),r=Math.floor(a/36524),s=Zc(a,36524),l=Math.floor(s/1461),c=Zc(s,1461),d=Math.floor(c/365),u=i*400+r*100+l*4+d+(r!==4&&d!==4?1:0),[h,p]=UO(u),m=n-fs(h,p,1,1),f=2;n<fs(h,p,3,1)?f=0:sl(p)&&(f=1);let b=Math.floor(((m+f)*12+373)/367),g=n-fs(h,p,b,1)+1;return new jl(h,p,b,g)}toJulianDay(t){return fs(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return GO[sl(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return sl(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}};const qO={"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 li(e,t){return t=$t(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function YO(e,t){return t=$t(t,e.calendar),e=Rn(e),t=Rn(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function KO(e,t){return t=$t(t,e.calendar),e=$r(e),t=$r(t),e.era===t.era&&e.year===t.year}function XO(e,t){return Oc(e.calendar,t.calendar)&&li(e,t)}function ZO(e,t){return Oc(e.calendar,t.calendar)&&YO(e,t)}function JO(e,t){return Oc(e.calendar,t.calendar)&&KO(e,t)}function Oc(e,t){var n,o,i,a;return(a=(i=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&i!==void 0?i:(o=t.isEqual)===null||o===void 0?void 0:o.call(t,e))!==null&&a!==void 0?a:e.identifier===t.identifier}function QO(e,t){return li(e,Tc(t))}const eT={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function fy(e,t,n){let o=e.calendar.toJulianDay(e),i=n?eT[n]:oT(t),a=Math.ceil(o+1-i)%7;return a<0&&(a+=7),a}function gy(e){return An(Date.now(),e)}function Tc(e){return Yo(gy(e))}function my(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function tT(e,t){return wf(e)-wf(t)}function wf(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Jc=null;function Th(){return Jc==null&&(Jc=new Intl.DateTimeFormat().resolvedOptions().timeZone),Jc}function Rn(e){return e.subtract({days:e.day-1})}function Xd(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function $r(e){return Rn(e.subtract({months:e.month-1}))}function nT(e){return Xd(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function kr(e,t,n){let o=fy(e,t,n);return e.subtract({days:o})}function Cf(e,t,n){return kr(e,t,n).add({days:6})}const _f=new Map,Qc=new Map;function vy(e){if(Intl.Locale){let n=_f.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&_f.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function oT(e){let t=Qc.get(e);if(!t){if(Intl.Locale){let o=new Intl.Locale(e);if("getWeekInfo"in o&&(t=o.getWeekInfo(),t))return Qc.set(e,t),t.firstDay}let n=vy(e);if(e.includes("-fw-")){let o=e.split("-fw-")[1].split("-")[0];o==="mon"?t={firstDay:1}:o==="tue"?t={firstDay:2}:o==="wed"?t={firstDay:3}:o==="thu"?t={firstDay:4}:o==="fri"?t={firstDay:5}:o==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&qO[n]||0};Qc.set(e,t)}return t.firstDay}function iT(e,t,n){let o=e.calendar.getDaysInMonth(e);return Math.ceil((fy(Rn(e),t,n)+o)/7)}function by(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function yy(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const aT={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 rT(e,t){let n=e.calendar.toJulianDay(e),o=Math.ceil(n+1)%7;o<0&&(o+=7);let i=vy(t),[a,r]=aT[i]||[6,0];return o===a||o===r}function Ki(e){e=$t(e,new Yi);let t=Oh(e.era,e.year);return xy(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function xy(e,t,n,o,i,a,r){let s=new Date;return s.setUTCHours(o,i,a,r),s.setUTCFullYear(e,t-1,n),s.getTime()}function Zd(e,t){if(t==="UTC")return 0;if(e>0&&t===Th())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:o,day:i,hour:a,minute:r,second:s}=wy(e,t);return xy(n,o,i,a,r,s,0)-Math.floor(e/1e3)*1e3}const $f=new Map;function wy(e,t){let n=$f.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"}),$f.set(t,n));let o=n.formatToParts(new Date(e)),i={};for(let a of o)a.type!=="literal"&&(i[a.type]=a.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const kf=864e5;function sT(e,t,n,o){return(n===o?[n]:[n,o]).filter(i=>lT(e,t,i))}function lT(e,t,n){let o=wy(n,t);return e.year===o.year&&e.month===o.month&&e.day===o.day&&e.hour===o.hour&&e.minute===o.minute&&e.second===o.second}function Vn(e,t,n="compatible"){let o=ei(e);if(t==="UTC")return Ki(o);if(t===Th()&&n==="compatible"){o=$t(o,new Yi);let l=new Date,c=Oh(o.era,o.year);return l.setFullYear(c,o.month-1,o.day),l.setHours(o.hour,o.minute,o.second,o.millisecond),l.getTime()}let i=Ki(o),a=Zd(i-kf,t),r=Zd(i+kf,t),s=sT(o,t,i-a,i-r);if(s.length===1)return s[0];if(s.length>1)switch(n){case"compatible":case"earlier":return s[0];case"later":return s[s.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-a,i-r);case"compatible":case"later":return Math.max(i-a,i-r);case"reject":throw new RangeError("No such absolute time found")}}function Cy(e,t,n="compatible"){return new Date(Vn(e,t,n))}function An(e,t){let n=Zd(e,t),o=new Date(e+n),i=o.getUTCFullYear(),a=o.getUTCMonth()+1,r=o.getUTCDate(),s=o.getUTCHours(),l=o.getUTCMinutes(),c=o.getUTCSeconds(),d=o.getUTCMilliseconds();return new Iy(i<1?"BC":"AD",i<1?-i+1:i,a,r,t,n,s,l,c,d)}function Yo(e){return new jl(e.calendar,e.era,e.year,e.month,e.day)}function ei(e,t){let n=0,o=0,i=0,a=0;if("timeZone"in e)({hour:n,minute:o,second:i,millisecond:a}=e);else if("hour"in e)return e;return new kT(e.calendar,e.era,e.year,e.month,e.day,n,o,i,a)}function $t(e,t){if(Oc(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),o=e.copy();return o.calendar=t,o.era=n.era,o.year=n.year,o.month=n.month,o.day=n.day,ti(o),o}function cT(e,t,n){if(e instanceof Iy)return e.timeZone===t?e:uT(e,t);let o=Vn(e,t,n);return An(o,t)}function dT(e){let t=Ki(e)-e.offset;return new Date(t)}function uT(e,t){let n=Ki(e)-e.offset;return $t(An(n,t),e.calendar)}const _a=36e5;function Ic(e,t){let n=e.copy(),o="hour"in n?gT(n,t):0;Jd(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Qd(n),_y(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=o,hT(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,r;let l=(a=(r=n.calendar).isInverseEra)===null||a===void 0?void 0:a.call(r,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Jd(e,t){var n,o;!((n=(o=e.calendar).isInverseEra)===null||n===void 0)&&n.call(o,e)&&(t=-t),e.year+=t}function Qd(e){for(;e.month<1;)Jd(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Jd(e,1)}function hT(e){for(;e.day<1;)e.month--,Qd(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Qd(e)}function _y(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 ti(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),_y(e)}function $y(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function ky(e,t){return Ic(e,$y(t))}function Ih(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),ti(n),n}function Hl(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),fT(n),n}function pT(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=gs(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=gs(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=gs(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=gs(e.hour,24),t}function fT(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 gs(e,t){let n=e%t;return n<0&&(n+=t),n}function gT(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,pT(e)}function Ph(e,t,n,o){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),l=s.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=Fn(l,n,0,s.length-1,o?.round),i.era=s[l],ti(i);break}case"year":var a,r;!((a=(r=i.calendar).isInverseEra)===null||a===void 0)&&a.call(r,i)&&(n=-n),i.year=Fn(e.year,n,-1/0,9999,o?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=Fn(e.month,n,1,e.calendar.getMonthsInYear(e),o?.round);break;case"day":i.day=Fn(e.day,n,1,e.calendar.getDaysInMonth(e),o?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),ti(i),i}function Sy(e,t,n,o){let i=e.copy();switch(t){case"hour":{let a=e.hour,r=0,s=23;if(o?.hourCycle===12){let l=a>=12;r=l?12:0,s=l?23:11}i.hour=Fn(a,n,r,s,o?.round);break}case"minute":i.minute=Fn(e.minute,n,0,59,o?.round);break;case"second":i.second=Fn(e.second,n,0,59,o?.round);break;case"millisecond":i.millisecond=Fn(e.millisecond,n,0,999,o?.round);break;default:throw new Error("Unsupported field "+t)}return i}function Fn(e,t,n,o,i=!1){if(i){e+=Math.sign(t),e<n&&(e=o);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>o&&(e=n)}else e+=t,e<n?e=o-(n-e-1):e>o&&(e=n+(e-o-1));return e}function Ey(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 i=Ic(ei(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Vn(i,e.timeZone)}else n=Ki(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let o=An(n,e.timeZone);return $t(o,e.calendar)}function mT(e,t){return Ey(e,$y(t))}function vT(e,t,n,o){switch(t){case"hour":{let i=0,a=23;if(o?.hourCycle===12){let m=e.hour>=12;i=m?12:0,a=m?23:11}let r=ei(e),s=$t(Hl(r,{hour:i}),new Yi),l=[Vn(s,e.timeZone,"earlier"),Vn(s,e.timeZone,"later")].filter(m=>An(m,e.timeZone).day===s.day)[0],c=$t(Hl(r,{hour:a}),new Yi),d=[Vn(c,e.timeZone,"earlier"),Vn(c,e.timeZone,"later")].filter(m=>An(m,e.timeZone).day===c.day).pop(),u=Ki(e)-e.offset,h=Math.floor(u/_a),p=u%_a;return u=Fn(h,n,Math.floor(l/_a),Math.floor(d/_a),o?.round)*_a+p,$t(An(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Sy(e,t,n,o);case"era":case"year":case"month":case"day":{let i=Ph(ei(e),t,n,o),a=Vn(i,e.timeZone);return $t(An(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function bT(e,t,n){let o=ei(e),i=Hl(Ih(o,t),t);if(i.compare(o)===0)return e;let a=Vn(i,e.timeZone,n);return $t(An(a,e.timeZone),e.calendar)}function yT(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 Oy(e){let t=$t(e,new Yi),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 Ty(e){return`${Oy(e)}T${yT(e)}`}function xT(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),o=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return i!==0&&(a+=`:${String(i).padStart(2,"0")}`),a}function wT(e){return`${Ty(e)}${xT(e.offset)}[${e.timeZone}]`}function CT(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vh(e,t,n){CT(e,t),t.set(e,n)}function Dh(e){let t=typeof e[0]=="object"?e.shift():new Yi,n;if(typeof e[0]=="string")n=e.shift();else{let r=t.getEras();n=r[r.length-1]}let o=e.shift(),i=e.shift(),a=e.shift();return[t,n,o,i,a]}var _T=new WeakMap;let jl=class eu{copy(){return this.era?new eu(this.calendar,this.era,this.year,this.month,this.day):new eu(this.calendar,this.year,this.month,this.day)}add(t){return Ic(this,t)}subtract(t){return ky(this,t)}set(t){return Ih(this,t)}cycle(t,n,o){return Ph(this,t,n,o)}toDate(t){return Cy(this,t)}toString(){return Oy(this)}compare(t){return my(this,t)}constructor(...t){Vh(this,_T,{writable:!0,value:void 0});let[n,o,i,a,r]=Dh(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,ti(this)}};var $T=new WeakMap;let kT=class tu{copy(){return this.era?new tu(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new tu(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Ic(this,t)}subtract(t){return ky(this,t)}set(t){return Ih(Hl(this,t),t)}cycle(t,n,o){switch(t){case"era":case"year":case"month":case"day":return Ph(this,t,n,o);default:return Sy(this,t,n,o)}}toDate(t,n){return Cy(this,t,n)}toString(){return Ty(this)}compare(t){let n=my(this,t);return n===0?tT(this,ei(t)):n}constructor(...t){Vh(this,$T,{writable:!0,value:void 0});let[n,o,i,a,r]=Dh(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ti(this)}};var ST=new WeakMap;let Iy=class nu{copy(){return this.era?new nu(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new nu(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Ey(this,t)}subtract(t){return mT(this,t)}set(t,n){return bT(this,t,n)}cycle(t,n,o){return vT(this,t,n,o)}toDate(){return dT(this)}toString(){return wT(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-cT(t,this.timeZone).toDate().getTime()}constructor(...t){Vh(this,ST,{writable:!0,value:void 0});let[n,o,i,a,r]=Dh(t),s=t.shift(),l=t.shift();this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.timeZone=s,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ti(this)}},ed=new Map,bn=class{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 o=this.formatter.formatToParts(t),i=this.formatter.formatToParts(n);return[...o.map(a=>({...a,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(a=>({...a,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return TT()&&(this.resolvedHourCycle||(this.resolvedHourCycle=IT(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=Py(t,n),this.options=n}};const ET={true:{ja:"h11"},false:{}};function Py(e,t={}){if(typeof t.hour12=="boolean"&&OT()){t={...t};let i=ET[String(t.hour12)][e.split("-")[0]],a=t.hour12?"h12":"h23";t.hourCycle=i??a,delete t.hour12}let n=e+(t?Object.entries(t).sort((i,a)=>i[0]<a[0]?-1:1).join():"");if(ed.has(n))return ed.get(n);let o=new Intl.DateTimeFormat(e,t);return ed.set(n,o),o}let td=null;function OT(){return td==null&&(td=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),td}let nd=null;function TT(){return nd==null&&(nd=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),nd}function IT(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=Py(e,{...t,timeZone:void 0}),o=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(a=>a.type==="hour").value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(a=>a.type==="hour").value,10);if(o===0&&i===23)return"h23";if(o===24&&i===23)return"h24";if(o===0&&i===11)return"h11";if(o===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function PT(e,t,n,o,i){const a={};for(let s in t){const l=s,c=t[l];c!=null&&(a[l]=Math.floor(c/2),a[l]>0&&c%2===0&&a[l]--)}const r=ci(e,t,n).subtract(a);return Yr(e,r,t,n,o,i)}function ci(e,t,n,o,i){let a=e;return t.years?a=$r(e):t.months?a=Rn(e):t.weeks&&(a=kr(e,n)),Yr(e,a,t,n,o,i)}function Mh(e,t,n,o,i){let a={...t};a.days?a.days--:a.weeks?a.weeks--:a.months?a.months--:a.years&&a.years--;let r=ci(e,t,n).subtract(a);return Yr(e,r,t,n,o,i)}function Yr(e,t,n,o,i,a){return i&&e.compare(i)>=0&&(t=yy(t,ci(Yo(i),n,o))),a&&e.compare(a)<=0&&(t=by(t,Mh(Yo(a),n,o))),t}function Zt(e,t,n){let o=Yo(e);return t&&(o=yy(o,Yo(t))),n&&(o=by(o,Yo(n))),o}function Sf(e,t,n,o,i,a){switch(t){case"start":return ci(e,n,o,i,a);case"end":return Mh(e,n,o,i,a);case"center":default:return PT(e,n,o,i,a)}}function _t(e,t){return t!=null&&li(e,t)}function Ef(e,t,n,o,i){return e?t!=null&&t(e,n)?!0:pn(e,o,i):!1}function pn(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function VT(e,t,n){const o=e.subtract({days:1});return li(o,e)||pn(o,t,n)}function DT(e,t,n){const o=e.add({days:1});return li(o,e)||pn(o,t,n)}function Rh(e){let t={...e};for(let n in t)t[n]=1;return t}function Vy(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Dy(e){return e?.calendar.identifier==="gregory"&&e.era==="BC"?"short":void 0}function My(e,t){const n=ei(Tc(t));return new bn(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Dy(n),timeZone:t})}function Of(e,t){const n=Tc(t);return new bn(e,{month:"long",year:"numeric",era:Dy(n),calendar:n?.calendar.identifier,timeZone:t})}function MT(e,t,n,o,i){let a=n.formatRangeToParts(e.toDate(i),t.toDate(i)),r=-1;for(let c=0;c<a.length;c++){let d=a[c];if(d.source==="shared"&&d.type==="literal")r=c;else if(d.source==="endRange")break}let s="",l="";for(let c=0;c<a.length;c++)c<r?s+=a[c].value:c>r&&(l+=a[c].value);return o(s,l)}function RT(e,t,n,o){let i=e,a=e,r=My(n,o);return li(i,a)?r.format(i.toDate(o)):MT(i,a,r,(s,l)=>`${s} – ${l}`,o)}var AT=["sun","mon","tue","wed","thu","fri","sat"];function Ry(e){return e!=null?AT[e]:void 0}function Ay(e,t,n){const o=Ry(n);return kr(e,t,o)}function Fy(e,t,n,o){const i=t.add({weeks:e}),a=[];let r=Ay(i,n,o);for(;a.length<7;){a.push(r);let s=r.add({days:1});if(li(r,s))break;r=s}return a}function FT(e,t,n,o){const i=Ry(o),a=n??iT(e,t,i);return[...new Array(a).keys()].map(r=>Fy(r,e,t,o))}function NT(e,t){const n=new bn(e,{weekday:"long",timeZone:t}),o=new bn(e,{weekday:"short",timeZone:t}),i=new bn(e,{weekday:"narrow",timeZone:t});return a=>{const r=a instanceof Date?a:a.toDate(t);return{value:a,short:o.format(r),long:n.format(r),narrow:i.format(r)}}}function LT(e,t,n,o){const i=Ay(e,o,t),a=[...new Array(7).keys()],r=NT(o,n);return a.map(s=>r(i.add({days:s})))}function BT(e,t="long"){const n=new Date(2021,0,1),o=[];for(let i=0;i<12;i++)o.push(n.toLocaleString(e,{month:t})),n.setMonth(n.getMonth()+1);return o}function zT(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var HT=10;function jT(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,o=parseInt(e.slice(-2),10),i=n+o;return i>t+HT?(i-100).toString():i.toString()}return e}}function sr(e,t){const n=t!=null&&t.strict?10:12,o=e-e%10,i=[];for(let a=0;a<n;a+=1){const r=o+a;i.push(r)}return i}function Fi(e){return Tc(e??Th())}function Kr(e,t,n,o){return function(i){const{startDate:a,focusedDate:r}=i,s=Vy(a,e);return pn(r,n,o)?{startDate:a,focusedDate:Zt(r,n,o),endDate:s}:r.compare(a)<0?{startDate:Mh(r,e,t,n,o),focusedDate:Zt(r,n,o),endDate:s}:r.compare(s)>0?{startDate:ci(r,e,t,n,o),endDate:s,focusedDate:Zt(r,n,o)}:{startDate:a,endDate:s,focusedDate:Zt(r,n,o)}}}function Ny(e,t,n,o,i,a){const r=Kr(n,o,i,a),s=t.add(n);return r({focusedDate:e.add(n),startDate:ci(Yr(e,s,n,o,i,a),n,o)})}function Ly(e,t,n,o,i,a){const r=Kr(n,o,i,a);let s=t.subtract(n);return r({focusedDate:e.subtract(n),startDate:ci(Yr(e,s,n,o,i,a),n,o)})}function WT(e,t,n,o,i,a,r){const s=Kr(o,i,a,r);if(!n&&!o.days)return s({focusedDate:e.add(Rh(o)),startDate:t});if(o.days)return Ny(e,t,o,i,a,r);if(o.weeks)return s({focusedDate:e.add({months:1}),startDate:t});if(o.months||o.years)return s({focusedDate:e.add({years:1}),startDate:t})}function UT(e,t,n,o,i,a,r){const s=Kr(o,i,a,r);if(!n&&!o.days)return s({focusedDate:e.subtract(Rh(o)),startDate:t});if(o.days)return Ly(e,t,o,i,a,r);if(o.weeks)return s({focusedDate:e.subtract({months:1}),startDate:t});if(o.months||o.years)return s({focusedDate:e.subtract({years:1}),startDate:t})}var Tf=e=>e!=null&&e.length===4,GT=e=>e!=null&&parseFloat(e)<=12,qT=e=>e!=null&&parseFloat(e)<=31;function YT(e,t,n){const o=KT(t,n);let{year:i,month:a,day:r}=XT(o,e)??{};if(i!=null||a!=null||r!=null){const l=new Date;i||(i=l.getFullYear().toString()),a||(a=(l.getMonth()+1).toString()),r||(r=l.getDate().toString())}if(Tf(i)||(i=jT(i)),Tf(i)&>(a)&&qT(r))return new jl(+i,+a,+r);const s=Date.parse(e);if(!isNaN(s)){const l=new Date(s);return new jl(l.getFullYear(),l.getMonth()+1,l.getDate())}}function KT(e,t){return new bn(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:n,value:o})=>n==="literal"?`${o}?`:`((?!=<${n}>)\\d+)?`).join("")}function XT(e,t){var n;const o=t.match(e);return(n=e.toString().match(/<(.+?)>/g))==null?void 0:n.map(i=>{var a;const r=i.match(/<(.+)>/);return!r||r.length<=0?null:(a=i.match(/<(.+)>/))==null?void 0:a[1]}).reduce((i,a,r)=>(a&&(o&&o.length>r?i[a]=o[r+1]:i[a]=null),i),{})}function If(e,t,n){const o=Yo(gy(n));switch(e){case"thisWeek":return[kr(o,t),Cf(o,t)];case"thisMonth":return[Rn(o),o];case"thisQuarter":return[Rn(o).add({months:-((o.month-1)%3)}),o];case"thisYear":return[$r(o),o];case"last3Days":return[o.add({days:-2}),o];case"last7Days":return[o.add({days:-6}),o];case"last14Days":return[o.add({days:-13}),o];case"last30Days":return[o.add({days:-29}),o];case"last90Days":return[o.add({days:-89}),o];case"lastMonth":return[Rn(o.add({months:-1})),Xd(o.add({months:-1}))];case"lastQuarter":return[Rn(o.add({months:-((o.month-1)%3)-3})),Xd(o.add({months:-((o.month-1)%3)-1}))];case"lastWeek":return[kr(o,t).add({weeks:-1}),Cf(o,t).add({weeks:-1})];case"lastYear":return[$r(o.add({years:-1})),nT(o.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var ms="__live-region__";function By(e={}){const{level:t="polite",document:n=document,root:o,delay:i=0}=e,a=n.defaultView??window,r=o??n.body;function s(c,d){const u=n.getElementById(ms);u?.remove(),d=d??i;const h=n.createElement("span");h.id=ms,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"}),r.appendChild(h),a.setTimeout(()=>{h.textContent=c},d)}function l(){const c=n.getElementById(ms);c?.remove()}return{announce:s,destroy:l,toJSON(){return ms}}}var zy=le("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"),ke=zy.build(),ZT=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.label)==null?void 0:o.call(n,t))??`datepicker:${e.id}:label:${t}`},JT=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`datepicker:${e.id}`},QT=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.table)==null?void 0:o.call(n,t))??`datepicker:${e.id}:table:${t}`},ou=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`datepicker:${e.id}:content`},od=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.cellTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:cell-trigger:${t}`},eI=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.prevTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:prev:${t}`},tI=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.nextTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:next:${t}`},nI=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.viewTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:view:${t}`},Hy=e=>{var t;return((t=e.ids)==null?void 0:t.clearTrigger)??`datepicker:${e.id}:clear`},jy=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`datepicker:${e.id}:control`},Pf=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.input)==null?void 0:o.call(n,t))??`datepicker:${e.id}:input:${t}`},Wy=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`datepicker:${e.id}:trigger`},Uy=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`datepicker:${e.id}:positioner`},Gy=e=>{var t;return((t=e.ids)==null?void 0:t.monthSelect)??`datepicker:${e.id}:month-select`},qy=e=>{var t;return((t=e.ids)==null?void 0:t.yearSelect)??`datepicker:${e.id}:year-select`},Vf=(e,t)=>db(ll(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),Df=e=>e.getById(Wy(e)),ll=e=>e.getById(ou(e)),$a=e=>fo(Yy(e),"[data-part=input]"),oI=e=>e.getById(qy(e)),iI=e=>e.getById(Gy(e)),aI=e=>e.getById(Hy(e)),rI=e=>e.getById(Uy(e)),Yy=e=>e.getById(jy(e));function iu(e){const[t,n]=e;return!t||!n||t.compare(n)<=0?e:[n,t]}function bi(e,t){const[n,o]=t;return!n||!o?!1:n.compare(e)<=0&&o.compare(e)>=0}function vs(e){return e.slice().sort((t,n)=>t.compare(n))}function sI(e){return ut(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var lI={day:"dd",month:"mm",year:"yyyy"};function cI(e){return new bn(e).formatToParts(new Date).map(t=>lI[t.type]??t.value).join("")}var Ky=(e,t)=>e?/\d/.test(e)||e===t||e.length!==1:!0,Mf=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),dI=(e,t)=>e.split("").filter(n=>Ky(n,t)).join("");function uI(e){const t=new Intl.DateTimeFormat(e).formatToParts(new Date).find(n=>n.type==="literal");return t?t.value:"/"}var hI={dayCell(e){return e.unavailable?`Not available. ${e.formattedDate}`:e.selected?`Selected date. ${e.formattedDate}`:`Choose ${e.formattedDate}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return ut(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 ut(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return ut(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"};function zn(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Ah(e){return e===0?"day":e===1?"month":"year"}function Fh(e,t,n){return Ah(Ze(zn(e,0),zn(t,0),zn(n,2)))}function pI(e,t){return zn(e,0)>zn(t,0)}function fI(e,t){return zn(e,0)<zn(t,0)}function gI(e,t,n){const o=zn(e,0)+1;return Fh(Ah(o),t,n)}function mI(e,t,n){const o=zn(e,0)-1;return Fh(Ah(o),t,n)}var vI=["day","month","year"];function bI(e){vI.forEach(t=>e(t))}function yI(e,t){const{state:n,context:o,prop:i,send:a,computed:r,scope:s}=e,l=o.get("startValue"),c=r("endValue"),d=o.get("value"),u=o.get("focusedValue"),h=o.get("hoveredValue"),p=h?iu([d[0],h]):[],m=i("disabled"),f=i("readOnly"),b=r("isInteractive"),g=i("min"),y=i("max"),x=i("locale"),C=i("timeZone"),k=i("startOfWeek"),O=n.matches("focused"),P=n.matches("open"),$=i("selectionMode")==="range",I=i("isDateUnavailable"),A=o.get("currentPlacement"),M=Eh({...i("positioning"),placement:A}),j=uI(x),Q={...hI,...i("translations")};function N(W=l){const L=i("fixedWeeks")?6:void 0;return FT(W,x,L,k)}function B(W={}){const{format:L}=W;return BT(x,L).map((X,ne)=>{const ue=ne+1,ve=u.set({month:ue}),$e=pn(ve,g,y);return{label:X,value:ue,disabled:$e}})}function G(){return zT({from:g?.year??1900,to:y?.year??2100}).map(W=>({label:W.toString(),value:W,disabled:!ar(W,g?.year,y?.year)}))}function J(W){return sr(l.year).map(L=>({label:L.toString(),value:L,disabled:!ar(L,g?.year,y?.year)}))}function Z(W){return Ef(W,I,x,g,y)}function ie(W){const L=l??Fi(C);a({type:"FOCUS.SET",value:L.set({month:W})})}function re(W){const L=l??Fi(C);a({type:"FOCUS.SET",value:L.set({year:W})})}function ce(W){const{value:L,disabled:X}=W,ne=u.set({year:L}),ue=!sr(l.year,{strict:!0}).includes(L),ve=ar(L,g?.year,y?.year),$e={focused:u.year===W.value,selectable:ue||ve,outsideRange:ue,selected:!!d.find(lt=>lt&<.year===L),valueText:L.toString(),inRange:$&&(bi(ne,d)||bi(ne,p)),value:ne,get disabled(){return X||!$e.selectable}};return $e}function pe(W){const{value:L,disabled:X}=W,ne=u.set({month:L}),ue=Of(x,C),ve={focused:u.month===W.value,selectable:!pn(ne,g,y),selected:!!d.find($e=>$e&&$e.month===L&&$e.year===u.year),valueText:ue.format(ne.toDate(C)),inRange:$&&(bi(ne,d)||bi(ne,p)),value:ne,get disabled(){return X||!ve.selectable}};return ve}function me(W){const{value:L,disabled:X,visibleRange:ne=r("visibleRange")}=W,ue=My(x,C),ve=Rh(r("visibleDuration")),$e=i("outsideDaySelectable"),lt=ne.start.add(ve).subtract({days:1}),Yt=pn(L,ne.start,lt),ui=$&&bi(L,d),hi=$&&_t(L,d[0]),ha=$&&_t(L,d[1]),So=$&&p.length>0,pi=So&&bi(L,p),pa=So&&_t(L,p[0]),Ew=So&&_t(L,p[1]),fa={invalid:pn(L,g,y),disabled:X||!$e&&Yt||pn(L,g,y),selected:d.some(Ow=>_t(L,Ow)),unavailable:Ef(L,I,x,g,y)&&!X,outsideRange:Yt,today:QO(L,C),weekend:rT(L,x),formattedDate:ue.format(L.toDate(C)),get focused(){return _t(L,u)&&(!fa.outsideRange||$e)},get ariaLabel(){return Q.dayCell(fa)},get selectable(){return!fa.disabled&&!fa.unavailable},inRange:ui||pi,firstInRange:hi,lastInRange:ha,inHoveredRange:pi,firstInHoveredRange:pa,lastInHoveredRange:Ew};return fa}function _e(W){const{view:L="day",id:X}=W;return[L,X].filter(Boolean).join(" ")}return{focused:O,open:P,inline:!!i("inline"),view:o.get("view"),getRangePresetValue(W){return If(W,x,C)},getDaysInWeek(W,L=l){return Fy(W,L,x,k)},getOffset(W){const L=l.add(W),X=c.add(W),ne=Of(x,C);return{visibleRange:{start:L,end:X},weeks:N(L),visibleRangeText:{start:ne.format(L.toDate(C)),end:ne.format(X.toDate(C))}}},getMonthWeeks:N,isUnavailable:Z,weeks:N(),weekDays:LT(Fi(C),k,C,x),visibleRangeText:r("visibleRangeText"),value:d,valueAsDate:d.filter(W=>W!=null).map(W=>W.toDate(C)),valueAsString:r("valueAsString"),focusedValue:u,focusedValueAsDate:u?.toDate(C),focusedValueAsString:i("format")(u,{locale:x,timeZone:C}),visibleRange:r("visibleRange"),selectToday(){const W=Zt(Fi(C),g,y);a({type:"VALUE.SET",value:W})},setValue(W){const L=W.map(X=>Zt(X,g,y));a({type:"VALUE.SET",value:L})},clearValue(){a({type:"VALUE.CLEAR"})},setFocusedValue(W){a({type:"FOCUS.SET",value:W})},setOpen(W){i("inline")||n.matches("open")===W||a({type:W?"OPEN":"CLOSE"})},focusMonth:ie,focusYear:re,getYears:G,getMonths:B,getYearsGrid(W={}){const{columns:L=1}=W;return xp(J(),L)},getDecade(){const W=sr(u.year);return{start:W.at(0),end:W.at(-1)}},getMonthsGrid(W={}){const{columns:L=1,format:X}=W;return xp(B({format:X}),L)},format(W,L={month:"long",year:"numeric"}){return new bn(x,L).format(W.toDate(C))},setView(W){a({type:"VIEW.SET",view:W})},goToNext(){a({type:"GOTO.NEXT",view:o.get("view")})},goToPrev(){a({type:"GOTO.PREV",view:o.get("view")})},getRootProps(){return t.element({...ke.root.attrs,dir:i("dir"),id:JT(s),"data-state":P?"open":"closed","data-disabled":V(m),"data-readonly":V(f)})},getLabelProps(W={}){const{index:L=0}=W;return t.label({...ke.label.attrs,id:ZT(s,L),dir:i("dir"),htmlFor:Pf(s,L),"data-state":P?"open":"closed","data-index":L,"data-disabled":V(m),"data-readonly":V(f)})},getControlProps(){return t.element({...ke.control.attrs,dir:i("dir"),id:jy(s),"data-disabled":V(m)})},getRangeTextProps(){return t.element({...ke.rangeText.attrs,dir:i("dir")})},getContentProps(){return t.element({...ke.content.attrs,hidden:!P,dir:i("dir"),"data-state":P?"open":"closed","data-placement":A,"data-inline":V(i("inline")),id:ou(s),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":Q.content})},getTableProps(W={}){const{view:L="day",columns:X=L==="day"?7:4}=W,ne=_e(W);return t.element({...ke.table.attrs,role:"grid","data-columns":X,"aria-roledescription":sI(L),id:QT(s,ne),"aria-readonly":Ne(f),"aria-disabled":Ne(m),"aria-multiselectable":Ne(i("selectionMode")!=="single"),"data-view":L,dir:i("dir"),tabIndex:-1,onKeyDown(ue){if(ue.defaultPrevented)return;const ve={Enter(){L==="day"&&Z(u)||L==="month"&&!pe({value:u.month}).selectable||L==="year"&&!ce({value:u.year}).selectable||a({type:"TABLE.ENTER",view:L,columns:X,focus:!0})},ArrowLeft(){a({type:"TABLE.ARROW_LEFT",view:L,columns:X,focus:!0})},ArrowRight(){a({type:"TABLE.ARROW_RIGHT",view:L,columns:X,focus:!0})},ArrowUp(){a({type:"TABLE.ARROW_UP",view:L,columns:X,focus:!0})},ArrowDown(){a({type:"TABLE.ARROW_DOWN",view:L,columns:X,focus:!0})},PageUp($e){a({type:"TABLE.PAGE_UP",larger:$e.shiftKey,view:L,columns:X,focus:!0})},PageDown($e){a({type:"TABLE.PAGE_DOWN",larger:$e.shiftKey,view:L,columns:X,focus:!0})},Home(){a({type:"TABLE.HOME",view:L,columns:X,focus:!0})},End(){a({type:"TABLE.END",view:L,columns:X,focus:!0})}}[br(ue,{dir:i("dir")})];ve&&(ve(ue),ue.preventDefault(),ue.stopPropagation())},onPointerLeave(){a({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){a({type:"TABLE.POINTER_DOWN",view:L})},onPointerUp(){a({type:"TABLE.POINTER_UP",view:L})}})},getTableHeadProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableHead.attrs,"aria-hidden":!0,dir:i("dir"),"data-view":L,"data-disabled":V(m)})},getTableHeaderProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableHeader.attrs,dir:i("dir"),"data-view":L,"data-disabled":V(m)})},getTableBodyProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableBody.attrs,"data-view":L,"data-disabled":V(m)})},getTableRowProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableRow.attrs,"aria-disabled":Ne(m),"data-disabled":V(m),"data-view":L})},getDayTableCellState:me,getDayTableCellProps(W){const{value:L}=W,X=me(W);return t.element({...ke.tableCell.attrs,role:"gridcell","aria-disabled":Ne(!X.selectable),"aria-selected":X.selected||X.inRange,"aria-invalid":Ne(X.invalid),"aria-current":X.today?"date":void 0,"data-value":L.toString()})},getDayTableCellTriggerProps(W){const{value:L}=W,X=me(W);return t.element({...ke.tableCellTrigger.attrs,id:od(s,L.toString()),role:"button",dir:i("dir"),tabIndex:X.focused?0:-1,"aria-label":X.ariaLabel,"aria-disabled":Ne(!X.selectable),"aria-invalid":Ne(X.invalid),"data-disabled":V(!X.selectable),"data-selected":V(X.selected),"data-value":L.toString(),"data-view":"day","data-today":V(X.today),"data-focus":V(X.focused),"data-unavailable":V(X.unavailable),"data-range-start":V(X.firstInRange),"data-range-end":V(X.lastInRange),"data-in-range":V(X.inRange),"data-outside-range":V(X.outsideRange),"data-weekend":V(X.weekend),"data-in-hover-range":V(X.inHoveredRange),"data-hover-range-start":V(X.firstInHoveredRange),"data-hover-range-end":V(X.lastInHoveredRange),onClick(ne){ne.defaultPrevented||X.selectable&&a({type:"CELL.CLICK",cell:"day",value:L})},onPointerMove:$?ne=>{if(ne.pointerType==="touch"||!X.selectable)return;const ue=!s.isActiveElement(ne.currentTarget);h&&XO(L,h)||a({type:"CELL.POINTER_MOVE",cell:"day",value:L,focus:ue})}:void 0})},getMonthTableCellState:pe,getMonthTableCellProps(W){const{value:L,columns:X}=W,ne=pe(W);return t.element({...ke.tableCell.attrs,dir:i("dir"),colSpan:X,role:"gridcell","aria-selected":Ne(ne.selected||ne.inRange),"data-selected":V(ne.selected),"aria-disabled":Ne(!ne.selectable),"data-value":L})},getMonthTableCellTriggerProps(W){const{value:L}=W,X=pe(W);return t.element({...ke.tableCellTrigger.attrs,dir:i("dir"),role:"button",id:od(s,L.toString()),"data-selected":V(X.selected),"aria-disabled":Ne(!X.selectable),"data-disabled":V(!X.selectable),"data-focus":V(X.focused),"data-in-range":V(X.inRange),"data-outside-range":V(X.outsideRange),"aria-label":X.valueText,"data-view":"month","data-value":L,tabIndex:X.focused?0:-1,onClick(ne){ne.defaultPrevented||X.selectable&&a({type:"CELL.CLICK",cell:"month",value:L})},onPointerMove:$?ne=>{if(ne.pointerType==="touch"||!X.selectable)return;const ue=!s.isActiveElement(ne.currentTarget);h&&X.value&&ZO(X.value,h)||a({type:"CELL.POINTER_MOVE",cell:"month",value:X.value,focus:ue})}:void 0})},getYearTableCellState:ce,getYearTableCellProps(W){const{value:L,columns:X}=W,ne=ce(W);return t.element({...ke.tableCell.attrs,dir:i("dir"),colSpan:X,role:"gridcell","aria-selected":Ne(ne.selected),"data-selected":V(ne.selected),"aria-disabled":Ne(!ne.selectable),"data-value":L})},getYearTableCellTriggerProps(W){const{value:L}=W,X=ce(W);return t.element({...ke.tableCellTrigger.attrs,dir:i("dir"),role:"button",id:od(s,L.toString()),"data-selected":V(X.selected),"data-focus":V(X.focused),"data-in-range":V(X.inRange),"aria-disabled":Ne(!X.selectable),"data-disabled":V(!X.selectable),"aria-label":X.valueText,"data-outside-range":V(X.outsideRange),"data-value":L,"data-view":"year",tabIndex:X.focused?0:-1,onClick(ne){ne.defaultPrevented||X.selectable&&a({type:"CELL.CLICK",cell:"year",value:L})},onPointerMove:$?ne=>{if(ne.pointerType==="touch"||!X.selectable)return;const ue=!s.isActiveElement(ne.currentTarget);h&&X.value&&JO(X.value,h)||a({type:"CELL.POINTER_MOVE",cell:"year",value:X.value,focus:ue})}:void 0})},getNextTriggerProps(W={}){const{view:L="day"}=W,X=m||!r("isNextVisibleRangeValid");return t.button({...ke.nextTrigger.attrs,dir:i("dir"),id:tI(s,L),type:"button","aria-label":Q.nextTrigger(L),disabled:X,"data-disabled":V(X),onClick(ne){ne.defaultPrevented||a({type:"GOTO.NEXT",view:L})}})},getPrevTriggerProps(W={}){const{view:L="day"}=W,X=m||!r("isPrevVisibleRangeValid");return t.button({...ke.prevTrigger.attrs,dir:i("dir"),id:eI(s,L),type:"button","aria-label":Q.prevTrigger(L),disabled:X,"data-disabled":V(X),onClick(ne){ne.defaultPrevented||a({type:"GOTO.PREV",view:L})}})},getClearTriggerProps(){return t.button({...ke.clearTrigger.attrs,id:Hy(s),dir:i("dir"),type:"button","aria-label":Q.clearTrigger,hidden:!d.length,onClick(W){W.defaultPrevented||a({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ke.trigger.attrs,id:Wy(s),dir:i("dir"),type:"button","data-placement":A,"aria-label":Q.trigger(P),"aria-controls":ou(s),"data-state":P?"open":"closed","aria-haspopup":"grid",disabled:m,onClick(W){W.defaultPrevented||b&&a({type:"TRIGGER.CLICK"})}})},getViewProps(W={}){const{view:L="day"}=W;return t.element({...ke.view.attrs,"data-view":L,hidden:o.get("view")!==L})},getViewTriggerProps(W={}){const{view:L="day"}=W;return t.button({...ke.viewTrigger.attrs,"data-view":L,dir:i("dir"),id:nI(s,L),type:"button",disabled:m,"aria-label":Q.viewTrigger(L),onClick(X){X.defaultPrevented||b&&a({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(W={}){const{view:L="day"}=W;return t.element({...ke.viewControl.attrs,"data-view":L,dir:i("dir")})},getInputProps(W={}){const{index:L=0,fixOnBlur:X=!0}=W;return t.input({...ke.input.attrs,id:Pf(s,L),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:i("dir"),name:i("name"),"data-index":L,"data-state":P?"open":"closed",readOnly:f,disabled:m,placeholder:i("placeholder")||cI(x),defaultValue:r("valueAsString")[L],onBeforeInput(ne){const{data:ue}=Yv(ne);Ky(ue,j)||ne.preventDefault()},onFocus(){a({type:"INPUT.FOCUS",index:L})},onBlur(ne){const ue=ne.currentTarget.value.trim();a({type:"INPUT.BLUR",value:ue,index:L,fixOnBlur:X})},onKeyDown(ne){if(ne.defaultPrevented||!b)return;const ue={Enter(ve){vr(ve)||Z(u)||ve.currentTarget.value.trim()!==""&&a({type:"INPUT.ENTER",value:ve.currentTarget.value,index:L})}}[ne.key];ue&&(ue(ne),ne.preventDefault())},onInput(ne){const ue=ne.currentTarget.value;a({type:"INPUT.CHANGE",value:dI(ue,j),index:L})}})},getMonthSelectProps(){return t.select({...ke.monthSelect.attrs,id:Gy(s),"aria-label":Q.monthSelect,disabled:m,dir:i("dir"),defaultValue:l.month,onChange(W){ie(Number(W.currentTarget.value))}})},getYearSelectProps(){return t.select({...ke.yearSelect.attrs,id:qy(s),disabled:m,"aria-label":Q.yearSelect,dir:i("dir"),defaultValue:l.year,onChange(W){re(Number(W.currentTarget.value))}})},getPositionerProps(){return t.element({id:Uy(s),...ke.positioner.attrs,dir:i("dir"),style:M.floating})},getPresetTriggerProps(W){const L=Array.isArray(W.value)?W.value:If(W.value,x,C),X=L.filter(ne=>ne!=null).map(ne=>ne.toDate(C).toDateString());return t.button({...ke.presetTrigger.attrs,"aria-label":Q.presetTrigger(X),type:"button",onClick(ne){ne.defaultPrevented||a({type:"PRESET.CLICK",value:L})}})}}}var{and:Mt}=et();function xI(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let o=0;o<n;o++)if(!_t(e[o],t[o]))return!1;return!0}function bs(e,t){return e.map(n=>t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var wI={props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",o=e.selectionMode||"single",i=e.numOfMonths||1,a=e.defaultValue?vs(e.defaultValue).map(u=>Zt(u,e.min,e.max)):void 0,r=e.value?vs(e.value).map(u=>Zt(u,e.min,e.max)):void 0;let s=e.focusedValue||e.defaultFocusedValue||r?.[0]||a?.[0]||Fi(n);s=Zt(s,e.min,e.max);const l="day",c="year",d=Fh(e.view||l,l,c);return{locale:t,numOfMonths:i,timeZone:n,selectionMode:o,defaultView:d,minView:l,maxView:c,outsideDaySelectable:!1,closeOnSelect:!0,format(u,{locale:h,timeZone:p}){return new bn(h,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric"}).format(u.toDate(p))},parse(u,{locale:h,timeZone:p}){return YT(u,h,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:s,defaultFocusedValue:s,value:r,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:_t,hash:o=>o.toString(),sync:!0,onChange(o){var i;const a=n(),r=a.get("view"),s=a.get("value"),l=bs(s,e);(i=e("onFocusChange"))==null||i({value:s,valueAsString:l,view:r,focusedValue:o})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:xI,hash:o=>o.map(i=>i.toString()).join(","),onChange(o){var i;const a=n(),r=bs(o,e);(i=e("onValueChange"))==null||i({value:o,valueAsString:r,view:a.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:(o,i)=>i!==null&&o!==null&&_t(o,i)})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(o){var i;(i=e("onViewChange"))==null||i({view:o})}})),startValue:t(()=>{const o=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:Sf(o,"start",{months:e("numOfMonths")},e("locale")),isEqual:_t,hash:i=>i.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})=>Vy(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText({context:e,prop:t,computed:n}){const o=t("timeZone"),i=new bn(t("locale"),{month:"long",year:"numeric",timeZone:o}),a=i.format(e.get("startValue").toDate(o)),r=i.format(n("endValue").toDate(o)),s=t("selectionMode")==="range"?`${a} - ${r}`:a;return{start:a,end:r,formatted:s}},isPrevVisibleRangeValid:({context:e,prop:t})=>!VT(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!DT(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>bs(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:o,computed:i}){e([()=>t("locale")],()=>{o(["setStartValue"])}),e([()=>n.hash("focusedValue")],()=>{o(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{o(["syncMonthSelectElement","syncYearSelectElement"])}),e([()=>n.get("inputValue")],()=>{o(["syncInputValue"])}),e([()=>n.hash("value")],()=>{o(["syncInputElement"])}),e([()=>i("valueAsString").toString()],()=>{o(["announceValueText"])}),e([()=>n.get("view")],()=>{o(["focusActiveCell"])}),e([()=>t("open")],()=>{o(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","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:Mt("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Mt("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Mt("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:"isMultiPicker",actions:["setFocusedDate","toggleSelectedDate"]},{guard:Mt("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":{guard:Mt("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:Mt("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Mt("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:"isMultiPicker",actions:["toggleSelectedDate"]},{guard:Mt("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})=>pI(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",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})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="INTERACT_OUTSIDE"},isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const o=Yy(n);return Et(o,()=>rI(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",By({level:"assertive",document:n})),()=>{var o,i;return(i=(o=t.get("announcer"))==null?void 0:o.destroy)==null?void 0:i.call(o)}},trackDismissableElement({scope:e,send:t,context:n,prop:o}){return o("inline")?void 0:ia(()=>ll(e),{type:"popover",defer:!0,exclude:[...$a(e),Df(e),aI(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=gI(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=mI(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}){var o;const i=e.get("value").map(a=>RT(a,null,t("locale"),t("timeZone")));(o=n.get("announcer"))==null||o.announce(i.join(","),3e3)},announceVisibleRange({computed:e,refs:t}){var n;const{formatted:o}=e("visibleRangeText");(n=t.get("announcer"))==null||n.announce(o)},disableTextSelection({scope:e}){eh({target:ll(e),doc:e.getDoc()})},enableTextSelection({scope:e}){sb({doc:e.getDoc(),target:ll(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&Ie(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){ae(()=>{$a(e).forEach((n,o)=>{Jt(n,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;Ie(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;Ie(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;Ie(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;Ie(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const o=t.value.map(i=>Zt(i,n("min"),n("max")));e.set("value",o)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,o=Array.from(t.get("value"));o[t.get("activeIndex")]=cl(e,n.value??t.get("focusedValue")),t.set("value",iu(o))},resetSelection(e){const{context:t,event:n}=e,o=cl(e,n.value??t.get("focusedValue"));t.set("value",[o])},toggleSelectedDate(e){const{context:t,event:n}=e,o=cl(e,n.value??t.get("focusedValue")),i=t.get("value").findIndex(a=>_t(a,o));if(i===-1){const a=[...t.get("value"),o];t.set("value",vs(a))}else{const a=Array.from(t.get("value"));a.splice(i,1),t.set("value",vs(a))}},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")),o=e.get("activeIndex");n[o]=e.get("focusedValue").copy(),e.set("value",iu(n));const i=t("valueAsString");e.set("inputValue",i[o])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});Ie(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});Ie(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});Ie(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});Ie(e,n)},focusNextPage(e){const{context:t,computed:n,prop:o}=e,i=Ny(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),o("locale"),o("min"),o("max"));ys(e,i)},focusPreviousPage(e){const{context:t,computed:n,prop:o}=e,i=Ly(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),o("locale"),o("min"),o("max"));ys(e,i)},focusSectionStart(e){const{context:t}=e;Ie(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;Ie(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:o,prop:i}=e,a=WT(t.get("focusedValue"),t.get("startValue"),n.larger,o("visibleDuration"),i("locale"),i("min"),i("max"));a&&ys(e,a)},focusPreviousSection(e){const{context:t,event:n,computed:o,prop:i}=e,a=UT(t.get("focusedValue"),t.get("startValue"),n.larger,o("visibleDuration"),i("locale"),i("min"),i("max"));a&&ys(e,a)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});Ie(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});Ie(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});Ie(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});Ie(e,n)},clearFocusedDate(e){const{prop:t}=e;Ie(e,Fi(t("timeZone")))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").subtract({months:n.columns});Ie(e,o)},focusNextMonthColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").add({months:n.columns});Ie(e,o)},focusPreviousYearColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").subtract({years:n.columns});Ie(e,o)},focusNextYearColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").add({years:n.columns});Ie(e,o)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue").set({month:1});Ie(e,n)},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue").set({month:12});Ie(e,n)},focusFirstYear(e){const{context:t}=e,n=sr(t.get("focusedValue").year),o=t.get("focusedValue").set({year:n[0]});Ie(e,o)},focusLastYear(e){const{context:t}=e,n=sr(t.get("focusedValue").year),o=t.get("focusedValue").set({year:n[n.length-1]});Ie(e,o)},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}){ae(()=>{var n;const o=t.get("view");(n=Vf(e,o))==null||n.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&ae(()=>{var o;const i=t.get("view");(o=Vf(e,i))==null||o.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}){ae(()=>{var t;(t=Df(e))==null||t.focus({preventScroll:!0})})},focusFirstInputElement({scope:e}){ae(()=>{const[t]=$a(e);t?.focus({preventScroll:!0})})},focusInputElement({scope:e}){ae(()=>{const t=$a(e),n=t.findLastIndex(a=>a.value!==""),o=Math.max(n,0),i=t[o];i?.focus({preventScroll:!0}),i?.setSelectionRange(i.value.length,i.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=iI(e);Jt(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=oI(e);Jt(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 o=$a(e),i=n.index??t.get("activeIndex");Jt(o[i],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||!Mf(o)||Ie(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||!Mf(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Zt(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const a=bs(i,n);e.set("inputValue",a[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const o=e.get("focusedValue");if(!pn(o,e.get("startValue"),t("endValue")))return;const i=Sf(o,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e}){var t;e("inline")||(t=e("onOpenChange"))==null||t({open:!0})},invokeOnClose({prop:e}){var t;e("inline")||(t=e("onOpenChange"))==null||t({open:!1})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}},cl=(e,t)=>{const{context:n,prop:o}=e,i=n.get("view");let a=typeof t=="number"?n.get("focusedValue").set({[i]:t}):t;return bI(r=>{fI(r,o("minView"))&&(a=a.set({[r]:r==="day"?1:0}))}),a};function Ie(e,t){const{context:n,prop:o,computed:i}=e;if(!t)return;const a=cl(e,t);if(_t(n.get("focusedValue"),a))return;const r=Kr(i("visibleDuration"),o("locale"),o("min"),o("max"))({focusedDate:a,startDate:n.get("startValue")});n.set("startValue",r.startDate),n.set("focusedValue",r.focusedDate)}function ys(e,t){const{context:n}=e;n.set("startValue",t.startDate);const o=n.get("focusedValue");_t(o,t.focusedDate)||n.set("focusedValue",t.focusedDate)}ee()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","parse","placeholder","getRootNode","id","ids","inline","isDateUnavailable","locale","max","min","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","defaultOpen","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","defaultView","defaultValue","view","defaultFocusedValue","outsideDaySelectable","minView","maxView"]);ee()(["index","fixOnBlur"]);ee()(["value"]);ee()(["columns","id","view"]);ee()(["disabled","value","columns"]);ee()(["view"]);const[Xy,Me]=xe("DatePickerContext"),CI=E({__name:"date-picker-clear-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getClearTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),_I=E({__name:"date-picker-content",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=dh(),o=T(()=>Br(t.value.getContentProps(),n.value.presenceProps));return q(),(i,a)=>v(n).unmounted?te("",!0):(w(),S(v(Y).div,F({key:0},o.value,{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),$I=E({__name:"date-picker-context",setup(e){const t=Me();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),kI=E({__name:"date-picker-control",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getControlProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),SI=E({__name:"date-picker-input",props:{index:{},fixOnBlur:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=Me();return q(),(o,i)=>(w(),S(v(Y).input,F(v(n).getInputProps(t),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),EI=E({__name:"date-picker-label",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).label,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),OI=["value"],TI=E({__name:"date-picker-month-select",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).select,F(v(t).getMonthSelectProps(),{"as-child":e.asChild}),{default:_(()=>[(w(!0),H(we,null,Oe(v(t).getMonths(),i=>(w(),H("option",{key:i.value,value:i.value},oe(i.label),9,OI))),128))]),_:1},16,["as-child"]))}}),[II,di]=xe("DatePickerViewPropsContext"),PI=E({__name:"date-picker-next-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getNextTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),VI=E({__name:"date-picker-positioner",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Hr(),o=lh(T(()=>({...n.value,present:t.value.open})));return ch(o),q(),(i,a)=>v(o).unmounted?te("",!0):(w(),S(v(Y).div,F({key:0},v(t).getPositionerProps(),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),DI=E({__name:"date-picker-preset-trigger",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me();return q(),(o,i)=>(w(),S(v(Y).button,F(v(n).getPresetTriggerProps(t),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),MI=E({__name:"date-picker-prev-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getPrevTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),RI=E({__name:"date-picker-range-text",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=T(()=>{const{start:o,end:i}=t.value.visibleRangeText;return Qt([o,i]).filter(Boolean).join(" - ")});return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getRangeTextProps(),{"as-child":e.asChild}),{default:_(()=>[Te(oe(n.value),1)]),_:1},16,["as-child"]))}}),AI=E({__name:"date-picker-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return Xy(n),xn(T(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),FI=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=T(()=>{const s=Re(e);return{id:n,dir:i.value.dir,locale:i.value.locale,value:s.modelValue,getRootNode:o?.value.getRootNode,...an(s),onFocusChange:l=>{var c;t?.("focusChange",l),t?.("update:focusedValue",l.focusedValue),(c=s.onFocusChange)==null||c.call(s,l)},onViewChange:l=>{var c;t?.("viewChange",l),t?.("update:view",l.view),(c=s.onViewChange)==null||c.call(s,l)},onOpenChange:l=>{var c;t?.("openChange",l),t?.("update:open",l.open),(c=s.onOpenChange)==null||c.call(s,l)},onValueChange:l=>{var c;t?.("valueChange",l),t?.("update:modelValue",l.value),(c=s.onValueChange)==null||c.call(s,l)}}}),r=bt(wI,a);return T(()=>yI(r,Tt))},NI=E({__name:"date-picker-root",props:jt({closeOnSelect:{type:Boolean},defaultFocusedValue:{},defaultOpen:{type:Boolean},defaultValue:{},defaultView:{},disabled:{type:Boolean},fixedWeeks:{type:Boolean},focusedValue:{},format:{type:Function},id:{},ids:{},isDateUnavailable:{type:Function},locale:{},max:{},maxView:{},min:{},minView:{},modelValue:{},name:{},numOfMonths:{},open:{type:Boolean},outsideDaySelectable:{type:Boolean},parse:{type:Function},placeholder:{},positioning:{},readOnly:{type:Boolean},selectionMode:{},startOfWeek:{},timeZone:{},translations:{},view:{},inline:{type:Boolean},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{closeOnSelect:void 0,defaultOpen:void 0,disabled:void 0,fixedWeeks:void 0,open:void 0,readOnly:void 0,outsideDaySelectable:void 0,inline:void 0}),emits:["focusChange","openChange","valueChange","viewChange","update:modelValue","update:open","update:view","update:focusedValue"],setup(e,{emit:t}){const n=e,o=FI(n,t);return Xy(o),xn(T(()=>({lazyMount:n.lazyMount,unmountOnExit:n.unmountOnExit}))),q(),(i,a)=>(w(),S(v(Y).div,F(v(o).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),[LI,Pc]=xe("DatePickerTablePropsContext"),BI=E({__name:"date-picker-table-body",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).tbody,F(v(t).getTableBodyProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),[zI,HI]=xe("DatePickerTableCellPropsContext"),jI=E({__name:"date-picker-table-cell-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=HI(),o=di(),i=T(()=>{const a={day:t.value.getDayTableCellTriggerProps,month:t.value.getMonthTableCellTriggerProps,year:t.value.getYearTableCellTriggerProps}[o.view];return a(n)});return q(),(a,r)=>(w(),S(v(Y).div,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),WI=E({__name:"date-picker-table-cell",props:{value:{},disabled:{type:Boolean},columns:{},visibleRange:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me(),o=di();zI(t);const i=T(()=>({day:n.value.getDayTableCellProps,month:n.value.getMonthTableCellProps,year:n.value.getYearTableCellProps})[o.view??"day"](t));return q(),(a,r)=>(w(),S(v(Y).td,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),UI=E({__name:"date-picker-table-head",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).thead,F(v(t).getTableHeadProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),GI=E({__name:"date-picker-table-header",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).th,F(v(t).getTableHeaderProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),qI=E({__name:"date-picker-table-row",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).tr,F(v(t).getTableRowProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),YI=E({__name:"date-picker-table",props:{view:{},columns:{},id:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me(),o=di(),i=vt(),a=t.id??i;return LI({...t,id:a,...o}),q(),(r,s)=>(w(),S(v(Y).table,F(v(n).getTableProps(t),{"as-child":e.asChild}),{default:_(()=>[D(r.$slots,"default")]),_:3},16,["as-child"]))}}),KI=E({__name:"date-picker-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),XI=E({__name:"date-picker-view-control",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getViewControlProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),ZI=E({__name:"date-picker-view-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getViewTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),Zy=zy.extendWith("view"),JI=E({__name:"date-picker-view",props:{view:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me();return II(t),q(),(o,i)=>(w(),S(v(Y).div,F(v(Zy).build().view.attrs,{hidden:v(n).view!==e.view,"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["hidden","as-child"]))}}),QI=["value"],eP=E({__name:"date-picker-year-select",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).select,F(v(t).getYearSelectProps(),{"as-child":e.asChild}),{default:_(()=>[(w(!0),H(we,null,Oe(v(t).getYears(),i=>(w(),H("option",{key:i.value,value:i.value},oe(i.label),9,QI))),128))]),_:1},16,["as-child"]))}}),de=Object.freeze(Object.defineProperty({__proto__:null,ClearTrigger:CI,Content:_I,Context:$I,Control:kI,Input:SI,Label:EI,MonthSelect:TI,NextTrigger:PI,Positioner:VI,PresetTrigger:DI,PrevTrigger:MI,RangeText:RI,Root:NI,RootProvider:AI,Table:YI,TableBody:BI,TableCell:WI,TableCellTrigger:jI,TableHead:UI,TableHeader:GI,TableRow:qI,Trigger:KI,View:JI,ViewControl:XI,ViewTrigger:ZI,YearSelect:eP},Symbol.toStringTag,{value:"Module"}));var Jy=le("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger");Jy.build();ee()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var tP=e=>typeof e.getAsEntry=="function"?e.getAsEntry():typeof e.webkitGetAsEntry=="function"?e.webkitGetAsEntry():null,Qy=e=>e.isDirectory,au=e=>e.isFile,ru=(e,t)=>(Object.defineProperty(e,"relativePath",{value:t?`${t}/${e.name}`:e.name}),e),nP=(e,t)=>Promise.all(Array.from(e).filter(n=>n.kind==="file").map(n=>{const o=tP(n);if(!o)return null;if(Qy(o)&&t)return e0(o.createReader(),`${o.name}`);if(au(o)&&typeof n.getAsFile=="function"){const i=n.getAsFile();return Promise.resolve(i?ru(i,""):null)}if(au(o))return new Promise(i=>{o.file(a=>{i(ru(a,""))})})}).filter(n=>n)),e0=(e,t="")=>new Promise(n=>{const o=[],i=()=>{e.readEntries(a=>{if(a.length===0){n(Promise.all(o).then(s=>s.flat()));return}const r=a.map(s=>{if(!s)return null;if(Qy(s))return e0(s.createReader(),`${t}${s.name}`);if(au(s))return new Promise(l=>{s.file(c=>{l(ru(c,t))})})}).filter(s=>s);o.push(Promise.all(r)),i()})};i()});function oP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function iP(e){return/^.*\.[\w]+$/.test(e)}var Rf=e=>oP(e)||iP(e);function aP(e){if(e!=null)return typeof e=="string"?e:Array.isArray(e)?e.filter(Rf).join(","):Object.entries(e).reduce((t,[n,o])=>[...t,n,...o],[]).filter(Rf).join(",")}var xs=(e,t)=>e.name===t.name&&e.size===t.size&&e.type===t.type,ka=e=>e!=null;function rP(e,t,n){if(ka(e.size))if(ka(t)&&ka(n)){if(e.size>n)return[!1,"FILE_TOO_LARGE"];if(e.size<t)return[!1,"FILE_TOO_SMALL"]}else{if(ka(t)&&e.size<t)return[!1,"FILE_TOO_SMALL"];if(ka(n)&&e.size>n)return[!1,"FILE_TOO_LARGE"]}return[!0,null]}var sP="3g2_video/3gpp2[3gp,3gpp_video/3gpp[3mf_model/3mf[7z_application/x-7z-compressed[aac_audio/aac[ac_application/pkix-attr-cert[adp_audio/adpcm[adts_audio/aac[ai_application/postscript[aml_application/automationml-aml+xml[amlx_application/automationml-amlx+zip[amr_audio/amr[apk_application/vnd.android.package-archive[apng_image/apng[appcache,manifest_text/cache-manifest[appinstaller_application/appinstaller[appx_application/appx[appxbundle_application/appxbundle[asc_application/pgp-keys[atom_application/atom+xml[atomcat_application/atomcat+xml[atomdeleted_application/atomdeleted+xml[atomsvc_application/atomsvc+xml[au,snd_audio/basic[avi_video/x-msvideo[avci_image/avci[avcs_image/avcs[avif_image/avif[aw_application/applixware[bdoc_application/bdoc[bin,bpk,buffer,deb,deploy,dist,distz,dll,dmg,dms,dump,elc,exe,img,iso,lrf,mar,msi,msm,msp,pkg,so_application/octet-stream[bmp,dib_image/bmp[btf,btif_image/prs.btif[bz2_application/x-bzip2[c_text/x-c[ccxml_application/ccxml+xml[cdfx_application/cdfx+xml[cdmia_application/cdmi-capability[cdmic_application/cdmi-container[cdmid_application/cdmi-domain[cdmio_application/cdmi-object[cdmiq_application/cdmi-queue[cer_application/pkix-cert[cgm_image/cgm[cjs_application/node[class_application/java-vm[coffee,litcoffee_text/coffeescript[conf,def,in,ini,list,log,text,txt_text/plain[cpp,cxx,cc_text/x-c++src[cpl_application/cpl+xml[cpt_application/mac-compactpro[crl_application/pkix-crl[css_text/css[csv_text/csv[cu_application/cu-seeme[cwl_application/cwl[cww_application/prs.cww[davmount_application/davmount+xml[dbk_application/docbook+xml[doc_application/msword[docx_application/vnd.openxmlformats-officedocument.wordprocessingml.document[dsc_text/prs.lines.tag[dssc_application/dssc+der[dtd_application/xml-dtd[dwd_application/atsc-dwd+xml[ear,jar,war_application/java-archive[ecma_application/ecmascript[emf_image/emf[eml,mime_message/rfc822[emma_application/emma+xml[emotionml_application/emotionml+xml[eot_application/vnd.ms-fontobject[eps,ps_application/postscript[epub_application/epub+zip[exi_application/exi[exp_application/express[exr_image/aces[ez_application/andrew-inset[fdf_application/fdf[fdt_application/fdt+xml[fits_image/fits[flac_audio/flac[flv_video/x-flv[g3_image/g3fax[geojson_application/geo+json[gif_image/gif[glb_model/gltf-binary[gltf_model/gltf+json[gml_application/gml+xml[go_text/x-go[gpx_application/gpx+xml[gz_application/gzip[h_text/x-h[h261_video/h261[h263_video/h263[h264_video/h264[heic_image/heic[heics_image/heic-sequence[heif_image/heif[heifs_image/heif-sequence[htm,html,shtml_text/html[ico_image/x-icon[icns_image/x-icns[ics,ifb_text/calendar[iges,igs_model/iges[ink,inkml_application/inkml+xml[ipa_application/octet-stream[java_text/x-java-source[jp2,jpg2_image/jp2[jpeg,jpe,jpg_image/jpeg[jpf,jpx_image/jpx[jpm,jpgm_image/jpm[jpgv_video/jpeg[jph_image/jph[js,mjs_text/javascript[json_application/json[json5_application/json5[jsonld_application/ld+json[jsx_text/jsx[jxl_image/jxl[jxr_image/jxr[ktx_image/ktx[ktx2_image/ktx2[less_text/less[m1v,m2v,mpe,mpeg,mpg_video/mpeg[m4a_audio/mp4[m4v_video/x-m4v[md,markdown_text/markdown[mid,midi,kar,rmi_audio/midi[mkv_video/x-matroska[mp2,mp2a,mp3,mpga,m3a,m2a_audio/mpeg[mp4,mp4v,mpg4_video/mp4[mp4a_audio/mp4[mp4s,m4p_application/mp4[odp_application/vnd.oasis.opendocument.presentation[oda_application/oda[ods_application/vnd.oasis.opendocument.spreadsheet[odt_application/vnd.oasis.opendocument.text[oga,ogg,opus,spx_audio/ogg[ogv_video/ogg[ogx_application/ogg[otf_font/otf[p12,pfx_application/x-pkcs12[pdf_application/pdf[pem_application/x-pem-file[php_text/x-php[png_image/png[ppt_application/vnd.ms-powerpoint[pptx_application/vnd.openxmlformats-officedocument.presentationml.presentation[pskcxml_application/pskc+xml[psd_image/vnd.adobe.photoshop[py_text/x-python[qt,mov_video/quicktime[rar_application/vnd.rar[rdf_application/rdf+xml[rtf_text/rtf[sass_text/x-sass[scss_text/x-scss[sgm,sgml_text/sgml[sh_application/x-sh[svg,svgz_image/svg+xml[swf_application/x-shockwave-flash[tar_application/x-tar[tif,tiff_image/tiff[toml_application/toml[ts_video/mp2t[tsx_text/tsx[tsv_text/tab-separated-values[ttc_font/collection[ttf_font/ttf[vtt_text/vtt[wasm_application/wasm[wav_audio/wav[weba_audio/webm[webm_video/webm[webmanifest_application/manifest+json[webp_image/webp[wma_audio/x-ms-wma[wmv_video/x-ms-wmv[woff_font/woff[woff2_font/woff2[xls_application/vnd.ms-excel[xlsx_application/vnd.openxmlformats-officedocument.spreadsheetml.sheet[xml_application/xml[xz_application/x-xz[yaml,yml_text/yaml[zip_application/zip",lP=new Map(sP.split("[").flatMap(e=>{const[t,n]=e.split("_");return t.split(",").map(o=>[o,n])}));function cP(e){const t=e.split(".").pop();return t&&lP.get(t)||null}function dP(e,t){if(e&&t){const n=Array.isArray(t)?t:typeof t=="string"?t.split(","):[];if(n.length===0)return!0;const o=e.name||"",i=(e.type||cP(o)||"").toLowerCase(),a=i.replace(/\/.*$/,"");return n.some(r=>{const s=r.trim().toLowerCase();return s.charAt(0)==="."?o.toLowerCase().endsWith(s):s.endsWith("/*")?a===s.replace(/\/.*$/,""):i===s})}return!0}function uP(e,t){const n=e.type==="application/x-moz-file"||dP(e,t);return[n,n?null:"FILE_INVALID_TYPE"]}var hP=le("editable").parts("root","area","label","preview","input","editTrigger","submitTrigger","cancelTrigger","control");hP.build();ee()(["activationMode","autoResize","dir","disabled","finalFocusEl","form","getRootNode","id","ids","invalid","maxLength","name","onEditChange","onFocusOutside","onInteractOutside","onPointerDownOutside","onValueChange","onValueCommit","onValueRevert","placeholder","readOnly","required","selectOnFocus","edit","defaultEdit","submitMode","translations","defaultValue","value"]);const pP=le("fieldset").parts("root","errorText","helperText","legend");pP.build();const[t0,Vt]=xe("FileUploadContext"),fP=E({__name:"file-upload-clear-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Vt();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getClearTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),gP=E({__name:"file-upload-context",setup(e){const t=Vt();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),mP=E({__name:"file-upload-dropzone",props:jt({asChild:{type:Boolean},disableClick:{type:Boolean}},{disableClick:void 0}),setup(e){const t=e,n=Vt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(n).getDropzoneProps(t),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),vP=E({__name:"file-upload-hidden-input",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=wn();return q(),(o,i)=>{var a;return w(),S(v(Y).input,F({"aria-describedby":(a=v(n))==null?void 0:a.ariaDescribedby},v(t).getHiddenInputProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["aria-describedby","as-child"])}}}),[bP,Xr]=xe("FileUploadItemPropsContext"),yP=E({__name:"file-upload-item-delete-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getItemDeleteTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),[xP,wP]=xe("FileUploadItemGroupPropsContext"),CP=E({__name:"file-upload-item-group",props:{asChild:{type:Boolean},type:{}},setup(e){const t=e,n=T(()=>oo(t,["type"])),o=Vt();return xP(n),q(),(i,a)=>(w(),S(v(Y).ul,F(v(o).getItemGroupProps(n.value),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),_P=E({__name:"file-upload-item-name",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr(),o=Mr();return q(),(i,a)=>(w(),S(v(Y).div,F(v(t).getItemNameProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default",{},()=>{var r;return[Te(oe(((r=o.default)==null?void 0:r.call(o))||v(n).file.name),1)]})]),_:3},16,["as-child"]))}}),$P=E({__name:"file-upload-item-preview-image",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr(),o=he("");return Iv(i=>{const a=t.value.createFileUrl(n.value.file,r=>o.value=r);i(a)}),q(),(i,a)=>o.value?(w(),S(v(Y).img,Ke(F({key:0},v(t).getItemPreviewImageProps({...v(n),url:o.value}))),null,16)):te("",!0)}}),kP=E({__name:"file-upload-item-preview",props:{type:{default:".*"},asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr();return q(),(o,i)=>v(n).file.type.match(e.type??".*")?(w(),S(v(Y).div,F({key:0},v(t).getItemPreviewProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"])):te("",!0)}}),SP=E({__name:"file-upload-item-size-text",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr(),o=Mr();return q(),(i,a)=>(w(),S(v(Y).div,F(v(t).getItemSizeTextProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default",{},()=>{var r;return[Te(oe(((r=o.default)==null?void 0:r.call(o))||v(t).getFileSize(v(n).file)),1)]})]),_:3},16,["as-child"]))}}),EP=E({__name:"file-upload-item",props:{file:{},type:{},asChild:{type:Boolean}},setup(e){const t=e,n=Vt(),o=wP(),i=T(()=>({...t,type:o.value.type}));return bP(i),q(),(a,r)=>(w(),S(v(Y).li,F(v(n).getItemProps(i.value),{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),OP=E({__name:"file-upload-label",props:{asChild:{type:Boolean}},setup(e){const t=Vt();return q(),(n,o)=>(w(),S(v(Y).label,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),TP=E({__name:"file-upload-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return t0(n),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}});function IP(e){const t=new Map;return function(n,o){const i=n+(o?Object.entries(o).sort((r,s)=>r[0]<s[0]?-1:1).join():"");if(t.has(i))return t.get(i);let a=new e(n,o);return t.set(i,a),a}}var PP=IP(Intl.NumberFormat);function VP(e,t,n={}){return PP(t,n).format(e)}var DP=["","kilo","mega","giga","tera"],MP=["","kilo","mega","giga","tera","peta"],RP=(e,t="en-US",n={})=>{if(Number.isNaN(e))return"";if(e===0)return"0 B";const{unitSystem:o="decimal",precision:i=3,unit:a="byte",unitDisplay:r="short"}=n,s=o==="binary"?1024:1e3,l=a==="bit"?DP:MP,c=e<0;let d=Math.abs(e),u=0;for(;d>=s&&u<l.length-1;)d/=s,u++;const h=parseFloat(d.toPrecision(i)),p=c?-h:h;return VP(p,t,{style:"unit",unit:l[u]+a,unitDisplay:r})},n0=le("file-upload").parts("root","dropzone","item","itemDeleteTrigger","itemGroup","itemName","itemPreview","itemPreviewImage","itemSizeText","label","trigger","clearTrigger"),Rt=n0.build(),o0=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`file:${e.id}`},i0=e=>{var t;return((t=e.ids)==null?void 0:t.dropzone)??`file:${e.id}:dropzone`},su=e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`file:${e.id}:input`},AP=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`file:${e.id}:trigger`},FP=e=>{var t;return((t=e.ids)==null?void 0:t.label)??`file:${e.id}:label`},NP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.item)==null?void 0:o.call(n,t))??`file:${e.id}:item:${t}`},LP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemName)==null?void 0:o.call(n,t))??`file:${e.id}:item-name:${t}`},BP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemSizeText)==null?void 0:o.call(n,t))??`file:${e.id}:item-size:${t}`},zP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemPreview)==null?void 0:o.call(n,t))??`file:${e.id}:item-preview:${t}`},HP=e=>e.getById(o0(e)),Af=e=>e.getById(su(e)),jP=e=>e.getById(i0(e));function Ff(e){const t=Pe(e);return e.dataTransfer?e.dataTransfer.types.some(n=>n==="Files"||n==="application/x-moz-file"):!!t&&"files"in t}function WP(e,t,n){const{prop:o,computed:i}=e;return!i("multiple")&&t>1?!1:!i("multiple")&&t+n.length===2?!0:!(t+n.length>o("maxFiles"))}function Nf(e,t,n=[],o=[]){const{prop:i,computed:a}=e,r=[],s=[],l={acceptedFiles:n,rejectedFiles:o};return t.forEach(c=>{var d;const[u,h]=uP(c,a("acceptAttr")),[p,m]=rP(c,i("minFileSize"),i("maxFileSize")),f=(d=i("validate"))==null?void 0:d(c,l),b=f?f.length===0:!0;if(u&&p&&b)r.push(c);else{const g=[h,m];b||g.push(...f??[]),s.push({file:c,errors:g.filter(Boolean)})}}),WP(e,r.length,n)||(r.forEach(c=>{s.push({file:c,errors:["TOO_MANY_FILES"]})}),r.splice(0)),{acceptedFiles:r,rejectedFiles:s}}function UP(e,t){const n=Fe(e);try{if("DataTransfer"in n){const o=new n.DataTransfer;t.forEach(i=>{o.items.add(i)}),e.files=o.files}}catch{}}var Xn="accepted";function GP(e,t){const{state:n,send:o,prop:i,computed:a,scope:r,context:s}=e,l=!!i("disabled"),c=!!i("required"),d=i("allowDrop"),u=i("translations"),h=n.matches("dragging"),p=n.matches("focused")&&!l;return{dragging:h,focused:p,disabled:!!l,transforming:s.get("transforming"),openFilePicker(){l||o({type:"OPEN"})},deleteFile(m,f=Xn){o({type:"FILE.DELETE",file:m,itemType:f})},acceptedFiles:s.get("acceptedFiles"),rejectedFiles:s.get("rejectedFiles"),setFiles(m){o({type:"FILES.SET",files:m,count:m.length})},clearRejectedFiles(){o({type:"REJECTED_FILES.CLEAR"})},clearFiles(){o({type:"FILES.CLEAR"})},getFileSize(m){return RP(m.size,i("locale"))},createFileUrl(m,f){const b=r.getWin(),g=b.URL.createObjectURL(m);return f(g),()=>b.URL.revokeObjectURL(g)},setClipboardFiles(m){if(l)return!1;const f=Array.from(m?.items??[]).reduce((b,g)=>{if(g.kind!=="file")return b;const y=g.getAsFile();return y?[...b,y]:b},[]);return f.length?(o({type:"FILES.SET",files:f}),!0):!1},getRootProps(){return t.element({...Rt.root.attrs,dir:i("dir"),id:o0(r),"data-disabled":V(l),"data-dragging":V(h)})},getDropzoneProps(m={}){return t.element({...Rt.dropzone.attrs,dir:i("dir"),id:i0(r),tabIndex:l||m.disableClick?void 0:0,role:m.disableClick?"application":"button","aria-label":u.dropzone,"aria-disabled":l,"data-invalid":V(i("invalid")),"data-disabled":V(l),"data-dragging":V(h),onKeyDown(f){l||f.defaultPrevented||f.currentTarget===Pe(f)&&(m.disableClick||f.key!=="Enter"&&f.key!==" "||o({type:"DROPZONE.CLICK",src:"keydown"}))},onClick(f){l||f.defaultPrevented||m.disableClick||f.currentTarget===Pe(f)&&(f.currentTarget.localName==="label"&&f.preventDefault(),o({type:"DROPZONE.CLICK"}))},onDragOver(f){if(l||!d)return;f.preventDefault(),f.stopPropagation();try{f.dataTransfer.dropEffect="copy"}catch{}if(!Ff(f))return;const b=f.dataTransfer.items.length;o({type:"DROPZONE.DRAG_OVER",count:b})},onDragLeave(f){l||d&&(rt(f.currentTarget,f.relatedTarget)||o({type:"DROPZONE.DRAG_LEAVE"}))},onDrop(f){if(l)return;d&&(f.preventDefault(),f.stopPropagation());const b=Ff(f);l||!b||nP(f.dataTransfer.items,i("directory")).then(g=>{o({type:"DROPZONE.DROP",files:pb(g)})})},onFocus(){l||o({type:"DROPZONE.FOCUS"})},onBlur(){l||o({type:"DROPZONE.BLUR"})}})},getTriggerProps(){return t.button({...Rt.trigger.attrs,dir:i("dir"),id:AP(r),disabled:l,"data-disabled":V(l),"data-invalid":V(i("invalid")),type:"button",onClick(m){l||(rt(jP(r),m.currentTarget)&&m.stopPropagation(),o({type:"OPEN"}))}})},getHiddenInputProps(){return t.input({id:su(r),tabIndex:-1,disabled:l,type:"file",required:i("required"),capture:i("capture"),name:i("name"),accept:a("acceptAttr"),webkitdirectory:i("directory")?"":void 0,multiple:a("multiple")||i("maxFiles")>1,onClick(m){m.stopPropagation(),m.currentTarget.value=""},onInput(m){if(l)return;const{files:f}=m.currentTarget;o({type:"FILE.SELECT",files:f?Array.from(f):[]})},style:gc})},getItemGroupProps(m={}){const{type:f=Xn}=m;return t.element({...Rt.itemGroup.attrs,dir:i("dir"),"data-disabled":V(l),"data-type":f})},getItemProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.item.attrs,dir:i("dir"),id:NP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemNameProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.itemName.attrs,dir:i("dir"),id:LP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemSizeTextProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.itemSizeText.attrs,dir:i("dir"),id:BP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemPreviewProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.itemPreview.attrs,dir:i("dir"),id:zP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemPreviewImageProps(m){var f;const{file:b,url:g,type:y=Xn}=m;if(!b.type.startsWith("image/"))throw new Error("Preview Image is only supported for image files");return t.img({...Rt.itemPreviewImage.attrs,alt:(f=u.itemPreview)==null?void 0:f.call(u,b),src:g,"data-disabled":V(l),"data-type":y})},getItemDeleteTriggerProps(m){var f;const{file:b,type:g=Xn}=m;return t.button({...Rt.itemDeleteTrigger.attrs,dir:i("dir"),type:"button",disabled:l,"data-disabled":V(l),"data-type":g,"aria-label":(f=u.deleteFile)==null?void 0:f.call(u,b),onClick(){l||o({type:"FILE.DELETE",file:b,itemType:g})}})},getLabelProps(){return t.label({...Rt.label.attrs,dir:i("dir"),id:FP(r),htmlFor:su(r),"data-disabled":V(l),"data-required":V(c)})},getClearTriggerProps(){return t.button({...Rt.clearTrigger.attrs,dir:i("dir"),type:"button",disabled:l,hidden:s.get("acceptedFiles").length===0,"data-disabled":V(l),onClick(m){m.defaultPrevented||l||o({type:"FILES.CLEAR"})}})}}}var qP={props({props:e}){return{minFileSize:0,maxFileSize:Number.POSITIVE_INFINITY,maxFiles:1,allowDrop:!0,preventDocumentDrop:!0,defaultAcceptedFiles:[],...e,translations:{dropzone:"dropzone",itemPreview:t=>`preview of ${t.name}`,deleteFile:t=>`delete file ${t.name}`,...e.translations}}},initialState(){return"idle"},context({prop:e,bindable:t,getContext:n}){return{acceptedFiles:t(()=>({defaultValue:e("defaultAcceptedFiles"),value:e("acceptedFiles"),isEqual:(o,i)=>o.length===i?.length&&o.every((a,r)=>xs(a,i[r])),hash(o){return o.map(i=>`${i.name}-${i.size}`).join(",")},onChange(o){var i,a;const r=n();(i=e("onFileAccept"))==null||i({files:o}),(a=e("onFileChange"))==null||a({acceptedFiles:o,rejectedFiles:r.get("rejectedFiles")})}})),rejectedFiles:t(()=>({defaultValue:[],isEqual:(o,i)=>o.length===i?.length&&o.every((a,r)=>xs(a.file,i[r].file)),onChange(o){var i,a;const r=n();(i=e("onFileReject"))==null||i({files:o}),(a=e("onFileChange"))==null||a({acceptedFiles:r.get("acceptedFiles"),rejectedFiles:o})}})),transforming:t(()=>({defaultValue:!1}))}},computed:{acceptAttr:({prop:e})=>aP(e("accept")),multiple:({prop:e})=>e("maxFiles")>1},watch({track:e,context:t,action:n}){e([()=>t.hash("acceptedFiles")],()=>{n(["syncInputElement"])})},on:{"FILES.SET":{actions:["setFiles"]},"FILE.SELECT":{actions:["setEventFiles"]},"FILE.DELETE":{actions:["removeFile"]},"FILES.CLEAR":{actions:["clearFiles"]},"REJECTED_FILES.CLEAR":{actions:["clearRejectedFiles"]}},effects:["preventDocumentDrop"],states:{idle:{on:{OPEN:{actions:["openFilePicker"]},"DROPZONE.CLICK":{actions:["openFilePicker"]},"DROPZONE.FOCUS":{target:"focused"},"DROPZONE.DRAG_OVER":{target:"dragging"}}},focused:{on:{"DROPZONE.BLUR":{target:"idle"},OPEN:{actions:["openFilePicker"]},"DROPZONE.CLICK":{actions:["openFilePicker"]},"DROPZONE.DRAG_OVER":{target:"dragging"}}},dragging:{on:{"DROPZONE.DROP":{target:"idle",actions:["setEventFiles"]},"DROPZONE.DRAG_LEAVE":{target:"idle"}}}},implementations:{effects:{preventDocumentDrop({prop:e,scope:t}){if(!e("preventDocumentDrop")||!e("allowDrop")||e("disabled"))return;const n=t.getDoc(),o=a=>{a?.preventDefault()},i=a=>{rt(HP(t),Pe(a))||a.preventDefault()};return xr(ge(n,"dragover",o,!1),ge(n,"drop",i,!1))}},actions:{syncInputElement({scope:e,context:t}){queueMicrotask(()=>{const n=Af(e);if(!n)return;UP(n,t.get("acceptedFiles"));const o=e.getWin();n.dispatchEvent(new o.Event("change",{bubbles:!0}))})},openFilePicker({scope:e}){ae(()=>{var t;(t=Af(e))==null||t.click()})},setFiles(e){const{computed:t,context:n,event:o}=e,{acceptedFiles:i,rejectedFiles:a}=Nf(e,o.files);n.set("acceptedFiles",t("multiple")?i:i.length>0?[i[0]]:[]),n.set("rejectedFiles",a)},setEventFiles(e){const{computed:t,context:n,event:o,prop:i}=e,a=n.get("acceptedFiles"),r=n.get("rejectedFiles"),{acceptedFiles:s,rejectedFiles:l}=Nf(e,o.files,a,r),c=u=>{if(t("multiple")){n.set("acceptedFiles",h=>[...h,...u]),n.set("rejectedFiles",l);return}if(u.length){n.set("acceptedFiles",[u[0]]),n.set("rejectedFiles",l);return}l.length&&(n.set("acceptedFiles",n.get("acceptedFiles")),n.set("rejectedFiles",l))},d=i("transformFiles");d?(n.set("transforming",!0),d(s).then(c).catch(u=>{Wn(`[zag-js/file-upload] error transforming files
|
|
1
|
+
import{F as Vr,G as Tw,H as Ov,I as Tv,k as T,J as ju,K as st,L as Re,r as he,d as E,M as Iw,N as we,h as at,O as te,P as S,Q as v,z as w,D as _,R as D,S as F,T as Ke,U as Qe,o as Dr,e as Pw,V as po,s as El,W as Ae,X as Wu,Y as vt,Z as jt,y as H,A as U,C as z,$ as Mr,a0 as R,a1 as Oe,B as oe,E as Te,a2 as Vw,a3 as Iv,a4 as gt,a5 as Dw,a6 as Mw,a7 as Ad,a8 as mr,a9 as Rw,aa as Fd,a as Aw,ab as Fw,ac as Nw,ad as Lw,ae as Bw,af as zw,ag as Hw,ah as jw,ai as Rr,aj as xo,ak as wo,al as Pv,am as Ww,an as Uw,ao as Gw,ap as Vv,x as qw}from"./CM90ZS03.js";function Nd(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}var Yw=e=>typeof e=="object"&&e!==null;function Uu(e){return Object.fromEntries(Object.entries(e??{}).filter(([t,n])=>n!==void 0))}var Kw=e=>e==="base";function Xw(e){return e.slice().filter(t=>!Kw(t))}function up(e){return String.fromCharCode(e+(e>25?39:97))}function Zw(e){let t="",n;for(n=Math.abs(e);n>52;n=n/52|0)t=up(n%52)+t;return up(n%52)+t}function Jw(e,t){let n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e}function Qw(e){return Zw(Jw(5381,e)>>>0)}var Dv=/\s*!(important)?/i;function e1(e){return typeof e=="string"?Dv.test(e):!1}function t1(e){return typeof e=="string"?e.replace(Dv,"").trim():e}function Mv(e){return typeof e=="string"?e.replaceAll(" ","_"):e}var Ar=e=>{const t=new Map;return(...n)=>{const o=JSON.stringify(n);if(t.has(o))return t.get(o);const i=e(...n);return t.set(o,i),i}};function Gu(...e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(o=>{const i=t[o],a=n[o];Nd(i)&&Nd(a)?t[o]=Gu(i,a):t[o]=a}),t),{})}var n1=e=>e!=null;function Rv(e,t,n={}){const{stop:o,getKey:i}=n;function a(r,s=[]){if(Yw(r)){const l={};for(const[c,d]of Object.entries(r)){const u=i?.(c,d)??c,h=[...s,u];if(o!=null&&o(r,h))return t(r,s);const p=a(d,h);n1(p)&&(l[u]=p)}return l}return t(r,s)}return a(e)}function o1(e,t){return e.reduce((n,o,i)=>{const a=t[i];return o!=null&&(n[a]=o),n},{})}function Av(e,t,n=!0){const{utility:o,conditions:i}=t,{hasShorthand:a,resolveShorthand:r}=o;return Rv(e,s=>Array.isArray(s)?o1(s,i.breakpoints.keys):s,{stop:s=>Array.isArray(s),getKey:n?s=>a?r(s):s:void 0})}var i1={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},a1=e=>typeof e=="string"?e.replaceAll(/[\n\s]+/g," "):e;function r1(e){const{utility:t,hash:n,conditions:o=i1}=e,i=r=>[t.prefix,r].filter(Boolean).join("-"),a=(r,s)=>{let l;if(n){const c=[...o.finalize(r),s];l=i(t.toHash(c,Qw))}else l=[...o.finalize(r),i(s)].join(":");return l};return Ar(({base:r,...s}={})=>{const l=Object.assign(s,r),c=Av(l,e),d=new Set;return Rv(c,(u,h)=>{if(u==null)return;const p=e1(u),[m,...f]=o.shift(h),b=Xw(f),g=t.transform(m,t1(a1(u)));let y=a(b,g.className);p&&(y=`${y}!`),d.add(y)}),Array.from(d).join(" ")})}function s1(...e){return e.flat().filter(t=>Nd(t)&&Object.keys(Uu(t)).length>0)}function l1(e){function t(i){const a=s1(...i);return a.length===1?a:a.map(r=>Av(r,e))}function n(...i){return Gu(...t(i))}function o(...i){return Object.assign({},...t(i))}return{mergeCss:Ar(n),assignCss:o}}var c1=/([A-Z])/g,d1=/^ms-/,u1=Ar(e=>e.startsWith("--")?e:e.replace(c1,"-$1").replace(d1,"-ms-").toLowerCase()),h1="cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";`${h1.split(",").join("|")}`;var p1=(e={})=>{const t=o=>{var i;return{className:[e.className,o].filter(Boolean).join("__"),base:((i=e.base)==null?void 0:i[o])??{},variants:{},defaultVariants:e.defaultVariants??{},compoundVariants:e.compoundVariants?f1(e.compoundVariants,o):[]}},n=(e.slots??[]).map(o=>[o,t(o)]);for(const[o,i]of Object.entries(e.variants??{}))for(const[a,r]of Object.entries(i))n.forEach(([s,l])=>{var c;(c=l.variants)[o]??(c[o]={}),l.variants[o][a]=r[s]??{}});return Object.fromEntries(n)},f1=(e,t)=>e.filter(n=>n.css[t]).map(n=>({...n,css:n.css[t]}));function Fv(e,...t){const n=Object.getOwnPropertyDescriptors(e),o=Object.keys(n),i=r=>{const s={};for(let l=0;l<r.length;l++){const c=r[l];n[c]&&(Object.defineProperty(s,c,n[c]),delete n[c])}return s},a=r=>i(Array.isArray(r)?r:o.filter(r));return t.map(a).concat(i(o))}var g1=(...e)=>{const t=e.reduce((n,o)=>(o&&o.forEach(i=>n.add(i)),n),new Set([]));return Array.from(t)};const m1="_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,_complete,_incomplete,_collapsed,_current,_hidden,_off,_on,_today,_underValue,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base",Nv=new Set(m1.split(",")),v1=/^@|&|&$/;function hp(e){return Nv.has(e)||v1.test(e)}const b1=/^_/,y1=/&|@/;function x1(e){return e.map(t=>Nv.has(t)?t.replace(b1,""):y1.test(t)?`[${Mv(t.trim())}]`:t)}function w1(e){return e.sort((t,n)=>{const o=hp(t),i=hp(n);return o&&!i?1:!o&&i?-1:0})}const C1="aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,textStyle:textStyle",Lv=new Map,Bv=new Map;C1.split(",").forEach(e=>{const[t,n]=e.split(":"),[o,...i]=n.split("/");Lv.set(t,o),i.length&&i.forEach(a=>{Bv.set(a==="1"?o:a,t)})});const pp=e=>Bv.get(e)||e,zv={conditions:{shift:w1,finalize:x1,breakpoints:{keys:["base","sm","md","lg","xl","2xl"]}},utility:{transform:(e,t)=>{const n=pp(e);return{className:`${Lv.get(n)||u1(n)}_${Mv(t)}`}},hasShorthand:!0,toHash:(e,t)=>t(e.join(":")),resolveShorthand:pp}},_1=r1(zv),dt=(...e)=>_1(No(...e));dt.raw=(...e)=>No(...e);const{mergeCss:No}=l1(zv),fp=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function ri(e){const{base:t,variants:n,defaultVariants:o,compoundVariants:i}=fp(e),a=h=>({...o,...Uu(h)});function r(h={}){var p;const m=a(h);let f={...t};for(const[g,y]of Object.entries(m))(p=n[g])!=null&&p[y]&&(f=No(f,n[g][y]));const b=$1(i,m);return No(f,b)}function s(h){const p=fp(h.config),m=g1(h.variantKeys,Object.keys(n));return ri({base:No(t,p.base),variants:Object.fromEntries(m.map(f=>[f,No(n[f],p.variants[f])])),defaultVariants:Gu(o,p.defaultVariants),compoundVariants:[...i,...p.compoundVariants]})}function l(h){return dt(r(h))}const c=Object.keys(n);function d(h){return Fv(h,c)}const u=Object.fromEntries(Object.entries(n).map(([h,p])=>[h,Object.keys(p)]));return Object.assign(Ar(l),{__cva__:!0,variantMap:u,variantKeys:c,raw:r,config:e,merge:s,splitVariantProps:d,getVariantProps:a})}function $1(e,t){let n={};return e.forEach(o=>{Object.entries(o).every(([i,a])=>i==="css"?!0:(Array.isArray(a)?a:[a]).some(r=>t[i]===r))&&(n=No(n,o.css))}),n}function k1(){let e="",t=0,n;for(;t<arguments.length;)(n=arguments[t++])&&typeof n=="string"&&(e&&(e+=" "),e+=n);return e}const S1=(e,t)=>e+"__"+t;function se(e){const t=Object.entries(p1(e)).map(([d,u])=>[d,ri(u)]),n=e.defaultVariants??{};function o(d){const u=t.map(([h,p])=>[h,k1(p(d),e.className&&S1(e.className,h))]);return Object.fromEntries(u)}function i(d){const u=t.map(([h,p])=>[h,p.raw(d)]);return Object.fromEntries(u)}const a=e.variants??{},r=Object.keys(a);function s(d){return Fv(d,r)}const l=d=>({...n||{},...Uu(d)}),c=Object.fromEntries(Object.entries(a).map(([d,u])=>[d,Object.keys(u)]));return Object.assign(Ar(o),{__cva__:!1,raw:i,variantMap:c,variantKeys:r,splitVariantProps:s,getVariantProps:l})}var le=(e,t=[])=>({parts:(...n)=>{if(E1(t))return le(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>le(e,[...t,...n]),omit:(...n)=>le(e,t.filter(o=>!n.includes(o))),rename:n=>le(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,o)=>Object.assign(n,{[o]:{selector:[`&[data-scope="${fi(e)}"][data-part="${fi(o)}"]`,`& [data-scope="${fi(e)}"][data-part="${fi(o)}"]`].join(", "),attrs:{"data-scope":fi(e),"data-part":fi(o)}}}),{})}),fi=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),E1=e=>e.length===0,O1=Object.defineProperty,T1=(e,t,n)=>t in e?O1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bc=(e,t,n)=>T1(e,typeof t!="symbol"?t+"":t,n);function I1(e){if(!e)return!1;try{return e.selectionStart===0&&e.selectionEnd===0}catch{return e.value===""}}function P1(e){if(!e)return;const t=e.selectionStart??0,n=e.selectionEnd??0;Math.abs(n-t)===0&&t===0&&e.setSelectionRange(e.value.length,e.value.length)}var gp=e=>Math.max(0,Math.min(1,e)),V1=(e,t)=>e.map((n,o)=>e[(Math.max(t,0)+o)%e.length]),zc=(...e)=>t=>e.reduce((n,o)=>o(n),t),qa=()=>{},rc=e=>typeof e=="object"&&e!==null,Hv=2147483647,V=e=>e?"":void 0,Ne=e=>e?"true":void 0,D1=1,M1=9,R1=11,Be=e=>rc(e)&&e.nodeType===D1&&typeof e.nodeName=="string",sc=e=>rc(e)&&e.nodeType===M1,A1=e=>rc(e)&&e===e.window,jv=e=>Be(e)?e.localName||"":"#document";function F1(e){return["html","body","#document"].includes(jv(e))}var N1=e=>rc(e)&&e.nodeType!==void 0,Ui=e=>N1(e)&&e.nodeType===R1&&"host"in e,L1=e=>Be(e)&&e.localName==="input",Si=e=>!!(e!=null&&e.matches("a[href]")),B1=e=>Be(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Ol(e){if(!e)return!1;const t=e.getRootNode();return or(t)===e}var z1=/(textarea|select)/;function lc(e){if(e==null||!Be(e))return!1;try{return L1(e)&&e.selectionStart!=null||z1.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function rt(e,t){var n;if(!e||!t||!Be(e)||!Be(t))return!1;const o=(n=t.getRootNode)==null?void 0:n.call(t);if(e===t||e.contains(t))return!0;if(o&&Ui(o)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Ot(e){return sc(e)?e:A1(e)?e.document:e?.ownerDocument??document}function H1(e){return Ot(e).documentElement}function Fe(e){var t;return Ui(e)?Fe(e.host):sc(e)?e.defaultView??window:Be(e)?((t=e.ownerDocument)==null?void 0:t.defaultView)??window:window}function or(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function j1(e){if(jv(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ui(e)&&e.host||H1(e);return Ui(t)?t.host:t}function qu(e){let t;try{if(t=e.getRootNode({composed:!0}),sc(t)||Ui(t))return t}catch{}return e.ownerDocument??document}var Hc=new WeakMap;function Gi(e){return Hc.has(e)||Hc.set(e,Fe(e).getComputedStyle(e)),Hc.get(e)}var Yu=new Set(["menu","listbox","dialog","grid","tree","region"]),W1=e=>Yu.has(e),Wv=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function Uv(e,t){const n=new Set,o=qu(e),i=a=>{const r=a.querySelectorAll("[aria-controls]");for(const s of r){if(s.getAttribute("aria-expanded")!=="true")continue;const l=Wv(s);for(const c of l){if(!c||n.has(c))continue;n.add(c);const d=o.getElementById(c);if(d){const u=d.getAttribute("role"),h=d.getAttribute("aria-modal")==="true";if(u&&W1(u)&&!h&&(d===t||d.contains(t)||i(d)))return!0}}}return!1};return i(e)}function Gv(e,t){const n=qu(e),o=new Set,i=a=>{const r=a.querySelectorAll("[aria-controls]");for(const s of r){if(s.getAttribute("aria-expanded")!=="true")continue;const l=Wv(s);for(const c of l){if(!c||o.has(c))continue;o.add(c);const d=n.getElementById(c);if(d){const u=d.getAttribute("role"),h=d.getAttribute("aria-modal")==="true";u&&Yu.has(u)&&!h&&(t(d),i(d))}}}};i(e)}function U1(e){const t=new Set;return Gv(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function G1(e){const t=e.getAttribute("role");return!!(t&&Yu.has(t))}function q1(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function Y1(e){var t;return q1(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function K1(e){if(!e.id)return!1;const t=qu(e),n=CSS.escape(e.id),o=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(o)&&G1(e))}var cc=()=>typeof document<"u";function X1(){const e=navigator.userAgentData;return e?.platform??navigator.platform}function Z1(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var Ku=e=>cc()&&e.test(X1()),qv=e=>cc()&&e.test(Z1()),J1=e=>cc()&&e.test(navigator.vendor),mp=()=>cc()&&!!navigator.maxTouchPoints,Q1=()=>Ku(/^iPhone/i),eC=()=>Ku(/^iPad/i)||dc()&&navigator.maxTouchPoints>1,Xu=()=>Q1()||eC(),tC=()=>dc()||Xu(),dc=()=>Ku(/^Mac/i),uc=()=>tC()&&J1(/apple/i),nC=()=>qv(/Firefox/i),oC=()=>qv(/Android/i);function iC(e){var t,n,o;return((t=e.composedPath)==null?void 0:t.call(e))??((o=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:o.call(n))}function Pe(e){const t=iC(e);return t?.[0]??e.target}function vr(e){return Yv(e).isComposing||e.keyCode===229}function aC(e){return e.pointerType===""&&e.isTrusted?!0:oC()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var Go=e=>e.button===0,rC=e=>e.button===2||dc()&&e.ctrlKey&&e.button===0,un=e=>e.ctrlKey||e.altKey||e.metaKey,sC=e=>"touches"in e&&e.touches.length>0,lC={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},vp={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function br(e,t={}){const{dir:n="ltr",orientation:o="horizontal"}=t;let i=e.key;return i=lC[i]??i,n==="rtl"&&o==="horizontal"&&i in vp&&(i=vp[i]),i}function Yv(e){return e.nativeEvent??e}var cC=new Set(["PageUp","PageDown"]),dC=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function uC(e){return e.ctrlKey||e.metaKey?.1:cC.has(e.key)||e.shiftKey&&dC.has(e.key)?10:1}function Tl(e,t="client"){const n=sC(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var ge=(e,t,n,o)=>{const i=typeof e=="function"?e():e;return i?.addEventListener(t,n,o),()=>{i?.removeEventListener(t,n,o)}};function Kv(e,t){const{type:n="HTMLInputElement",property:o="value"}=t,i=Fe(e)[n].prototype;return Object.getOwnPropertyDescriptor(i,o)??{}}function hC(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Jt(e,t,n="value"){var o;if(!e)return;const i=hC(e);i&&((o=Kv(e,{type:i,property:n}).set)==null||o.call(e,t)),e.setAttribute(n,t)}function Zu(e,t){var n;e&&((n=Kv(e,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(e,t),t?e.setAttribute("checked",""):e.removeAttribute("checked"))}function Xv(e,t){const{value:n,bubbles:o=!0}=t;if(!e)return;const i=Fe(e);e instanceof i.HTMLInputElement&&(Jt(e,`${n}`),e.dispatchEvent(new i.Event("input",{bubbles:o})))}function Zv(e,t){const{checked:n,bubbles:o=!0}=t;if(!e)return;const i=Fe(e);e instanceof i.HTMLInputElement&&(Zu(e,n),e.dispatchEvent(new i.Event("click",{bubbles:o})))}function pC(e){return fC(e)?e.form:e.closest("form")}function fC(e){return e.matches("textarea, input, select, button")}function gC(e,t){if(!e)return;const n=pC(e),o=i=>{i.defaultPrevented||t()};return n?.addEventListener("reset",o,{passive:!0}),()=>n?.removeEventListener("reset",o)}function mC(e,t){const n=e?.closest("fieldset");if(!n)return;t(n.disabled);const o=Fe(n),i=new o.MutationObserver(()=>t(n.disabled));return i.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function oa(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:o}=t,i=[gC(e,o),mC(e,n)];return()=>i.forEach(a=>a?.())}var Jv=e=>Be(e)&&e.tagName==="IFRAME",vC=/^(audio|video|details)$/;function Qv(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var bC=e=>!Number.isNaN(Qv(e)),yC=e=>Qv(e)<0;function xC(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function eb(e,t,n){const o=[...e],i=[...e],a=new Set,r=new Map;e.forEach((l,c)=>r.set(l,c));let s=0;for(;s<i.length;){const l=i[s++];if(!l||a.has(l))continue;a.add(l);const c=xC(l,t);if(c){const d=Array.from(c.querySelectorAll(hc)).filter(n),u=r.get(l);if(u!==void 0){const h=u+1;o.splice(h,0,...d),d.forEach((p,m)=>{r.set(p,h+m)});for(let p=h+d.length;p<o.length;p++)r.set(o[p],p)}else{const h=o.length;o.push(...d),d.forEach((p,m)=>{r.set(p,h+m)})}i.push(...d)}}return o}var hc="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",tb=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:o}=t,i=Array.from(e.querySelectorAll(hc));(n==!0||n=="if-empty"&&i.length===0)&&Be(e)&&Bn(e)&&i.unshift(e);const a=[];for(const r of i)if(Bn(r)){if(Jv(r)&&r.contentDocument){const s=r.contentDocument.body;a.push(...tb(s,{getShadowRoot:o}));continue}a.push(r)}return o?eb(a,o,Bn):a};function Bn(e){return!Be(e)||e.closest("[inert]")?!1:e.matches(hc)&&B1(e)}function Fr(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:o}=t,i=Array.from(e.querySelectorAll(hc));n&&Lo(e)&&i.unshift(e);const a=[];for(const r of i)if(Lo(r)){if(Jv(r)&&r.contentDocument){const s=r.contentDocument.body;a.push(...Fr(s,{getShadowRoot:o}));continue}a.push(r)}if(o){const r=eb(a,o,Lo);return!r.length&&n?i:r}return!a.length&&n?i:a}function Lo(e){return Be(e)&&e.tabIndex>0?!0:Bn(e)&&!yC(e)}function wC(e,t={}){const n=Fr(e,t),o=n[0]||null,i=n[n.length-1]||null;return[o,i]}function ga(e){return e.tabIndex<0&&(vC.test(e.localName)||lc(e))&&!bC(e)?0:e.tabIndex}function Ju(e){const{root:t,getInitialEl:n,filter:o,enabled:i=!0}=e;if(!i)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t?.querySelector("[data-autofocus],[autofocus]")),!a){const r=Fr(t);a=o?r.filter(o)[0]:r[0]}return a||t||void 0}function CC(e){const t=e.currentTarget;if(!t)return!1;const[n,o]=wC(t);return!(Ol(n)&&e.shiftKey||Ol(o)&&!e.shiftKey||!n&&!o)}var nb=class ob{constructor(){Bc(this,"id",null),Bc(this,"fn_cleanup"),Bc(this,"cleanup",()=>{this.cancel()})}static create(){return new ob}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function ae(e){const t=nb.create();return t.request(e),t.cleanup}function pc(e){const t=new Set;function n(o){const i=globalThis.requestAnimationFrame(o);t.add(()=>globalThis.cancelAnimationFrame(i))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function _C(e,t,n){const o=ae(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function $C(e,t){if(!e)return;const{attributes:n,callback:o}=t,i=e.ownerDocument.defaultView||window,a=new i.MutationObserver(r=>{for(const s of r)s.type==="attributes"&&s.attributeName&&n.includes(s.attributeName)&&o(s)});return a.observe(e,{attributes:!0,attributeFilter:n}),()=>a.disconnect()}function Nr(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=typeof e=="function"?e():e;i.push($C(a,t))})),()=>{i.forEach(a=>a?.())}}function kC(e,t){const{callback:n}=t;if(!e)return;const o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(n);return i.observe(e,{childList:!0,subtree:!0}),()=>i.disconnect()}function SC(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=typeof e=="function"?e():e;i.push(kC(a,t))})),()=>{i.forEach(a=>a?.())}}function ib(e){const t=()=>{const n=Fe(e);e.dispatchEvent(new n.MouseEvent("click"))};nC()?_C(e,"keyup",t):queueMicrotask(t)}function Il(e){const t=j1(e);return F1(t)?Ot(t).body:Be(t)&&Qu(t)?t:Il(t)}function ab(e,t=[]){const n=Il(e),o=n===e.ownerDocument.body,i=Fe(n);return o?t.concat(i,i.visualViewport||[],Qu(n)?n:[]):t.concat(n,ab(n,[]))}var EC=/auto|scroll|overlay|hidden|clip/,OC=new Set(["inline","contents"]);function Qu(e){const t=Fe(e),{overflow:n,overflowX:o,overflowY:i,display:a}=t.getComputedStyle(e);return EC.test(n+i+o)&&!OC.has(a)}function TC(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function yr(e,t){const{rootEl:n,...o}=t||{};!e||!n||!Qu(n)||!TC(n)||e.scrollIntoView(o)}function rb(e,t){const{left:n,top:o,width:i,height:a}=t.getBoundingClientRect(),r={x:e.x-n,y:e.y-o},s={x:gp(r.x/i),y:gp(r.y/a)};function l(c={}){const{dir:d="ltr",orientation:u="horizontal",inverted:h}=c,p=typeof h=="object"?h.x:h,m=typeof h=="object"?h.y:h;return u==="horizontal"?d==="rtl"||p?1-s.x:s.x:m?1-s.y:s.y}return{offset:r,percent:s,getPercentValue:l}}function IC(e,t){const n=e.body,o="pointerLockElement"in e||"mozPointerLockElement"in e,i=()=>!!e.pointerLockElement;function a(){}function r(l){i(),console.error("PointerLock error occurred:",l),e.exitPointerLock()}if(!o)return;try{n.requestPointerLock()}catch{}const s=[ge(e,"pointerlockchange",a,!1),ge(e,"pointerlockerror",r,!1)];return()=>{s.forEach(l=>l()),e.exitPointerLock()}}var Mi="default",Ld="",Zs=new WeakMap;function PC(e={}){const{target:t,doc:n}=e,o=n??document,i=o.documentElement;return Xu()?(Mi==="default"&&(Ld=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),Mi="disabled"):t&&(Zs.set(t,t.style.userSelect),t.style.userSelect="none"),()=>sb({target:t,doc:o})}function sb(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(Xu()){if(Mi!=="disabled")return;Mi="restoring",setTimeout(()=>{pc(()=>{Mi==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Ld||""),Ld="",Mi="default")})},300)}else if(t&&Zs.has(t)){const i=Zs.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Zs.delete(t)}}function eh(e={}){const{defer:t,target:n,...o}=e,i=t?ae:r=>r(),a=[];return a.push(i(()=>{const r=typeof n=="function"?n():n;a.push(PC({...o,target:r}))})),()=>{a.forEach(r=>r?.())}}function lb(e,t){const{onPointerMove:n,onPointerUp:o}=t,i=s=>{const l=Tl(s),c=Math.sqrt(l.x**2+l.y**2),d=s.pointerType==="touch"?10:5;if(!(c<d)){if(s.pointerType==="mouse"&&s.button===0){a(s);return}n({point:l,event:s})}},a=s=>{const l=Tl(s);o({point:l,event:s})},r=[ge(e,"pointermove",i,!1),ge(e,"pointerup",a,!1),ge(e,"pointercancel",a,!1),ge(e,"contextmenu",a,!1),eh({doc:e})];return()=>{r.forEach(s=>s())}}function cb(e){const{pointerNode:t,keyboardNode:n=t,onPress:o,onPressStart:i,onPressEnd:a,isValidKey:r=g=>g.key==="Enter"}=e;if(!t)return qa;const s=Fe(t);let l=qa,c=qa,d=qa;const u=g=>({point:Tl(g),event:g});function h(g){i?.(u(g))}function p(g){a?.(u(g))}const m=ge(t,"pointerdown",g=>{c();const y=ge(s,"pointerup",C=>{const k=Pe(C);rt(t,k)?o?.(u(C)):a?.(u(C))},{passive:!o,once:!0}),x=ge(s,"pointercancel",p,{passive:!a,once:!0});c=zc(y,x),Ol(n)&&g.pointerType==="mouse"&&g.preventDefault(),h(g)},{passive:!i}),f=ge(n,"focus",b);l=zc(m,f);function b(){const g=k=>{if(!r(k))return;const O=$=>{if(!r($))return;const I=new s.PointerEvent("pointerup"),A=u(I);o?.(A),a?.(A)};c(),c=ge(n,"keyup",O);const P=new s.PointerEvent("pointerdown");h(P)},y=()=>{const k=new s.PointerEvent("pointercancel");p(k)},x=ge(n,"keydown",g),C=ge(n,"blur",y);d=zc(x,C)}return()=>{l(),c(),d()}}function fo(e,t){return Array.from(e?.querySelectorAll(t)??[])}function db(e,t){return e?.querySelector(t)??null}var th=e=>e.id;function VC(e,t,n=th){return e.find(o=>n(o)===t)}function fc(e,t,n=th){const o=VC(e,t,n);return o?e.indexOf(o):-1}function nh(e,t,n=!0){let o=fc(e,t);return o=n?(o+1)%e.length:Math.min(o+1,e.length-1),e[o]}function oh(e,t,n=!0){let o=fc(e,t);return o===-1?n?e[e.length-1]:null:(o=n?(o-1+e.length)%e.length:Math.max(0,o-1),e[o])}var DC=e=>e.split("").map(t=>{const n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),MC=e=>{var t;return DC(((t=e.dataset)==null?void 0:t.valuetext)??e.textContent??"")},RC=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function AC(e,t,n,o=th){const i=n?fc(e,n,o):-1;let a=n?V1(e,i):e;return t.length===1&&(a=a.filter(r=>o(r)!==n)),a.find(r=>RC(MC(r),t))}function FC(e,t,n){const o=e.getAttribute(t),i=o!=null;return e.setAttribute(t,n),()=>{i?e.setAttribute(t,o):e.removeAttribute(t)}}function ih(e,t){if(!e)return qa;const n=Object.keys(t).reduce((o,i)=>(o[i]=e.style.getPropertyValue(i),o),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function NC(e,t){const{state:n,activeId:o,key:i,timeout:a=350,itemToId:r}=t,s=n.keysSoFar+i,l=s.length>1&&Array.from(s).every(p=>p===s[0])?s[0]:s;let c=e.slice();const d=AC(c,l,o,r);function u(){clearTimeout(n.timer),n.timer=-1}function h(p){n.keysSoFar=p,u(),p!==""&&(n.timer=+setTimeout(()=>{h(""),u()},a))}return h(s),d}var jn=Object.assign(NC,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:LC});function LC(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var gc={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function BC(e,t,n){const{signal:o}=t;return[new Promise((i,a)=>{const r=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);o.addEventListener("abort",()=>{clearTimeout(r),a(new Error("Promise aborted"))}),e.then(s=>{o.aborted||(clearTimeout(r),i(s))}).catch(s=>{o.aborted||(clearTimeout(r),a(s))})}),()=>t.abort()]}function zC(e,t){const{timeout:n,rootNode:o}=t,i=Fe(o),a=Ot(o),r=new i.AbortController;return BC(new Promise(s=>{const l=e();if(l){s(l);return}const c=new i.MutationObserver(()=>{const d=e();d&&d.isConnected&&(c.disconnect(),s(d))});c.observe(a.body,{childList:!0,subtree:!0})}),r,n)}var HC=Object.defineProperty,ub=e=>{throw TypeError(e)},jC=(e,t,n)=>t in e?HC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yn=(e,t,n)=>jC(e,typeof t!="symbol"?t+"":t,n),WC=(e,t,n)=>t.has(e)||ub("Cannot "+n),bp=(e,t,n)=>(WC(e,t,"read from private field"),t.get(e)),UC=(e,t,n)=>t.has(e)?ub("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);function Js(e){return e==null?[]:Array.isArray(e)?e:[e]}var GC=e=>Array.from(Array(e).keys()),Bi=e=>e[0],Lr=e=>e[e.length-1],qC=(e,t)=>e.indexOf(t)!==-1,Mn=(e,...t)=>e.concat(t),qo=(e,...t)=>e.filter(n=>!t.includes(n)),yp=(e,t)=>e.filter((n,o)=>o!==t),Qt=e=>Array.from(new Set(e)),jc=(e,t)=>{const n=new Set(t);return e.filter(o=>!n.has(o))},Zo=(e,t)=>qC(e,t)?qo(e,t):Mn(e,t);function Pl(e,t,n={}){const{step:o=1,loop:i=!0}=n,a=t+o,r=e.length,s=r-1;return t===-1?o>0?0:s:a<0?i?s:0:a>=r?i?0:t>r?r:t:a}function YC(e,t,n={}){return e[Pl(e,t,n)]}function hb(e,t,n={}){const{step:o=1,loop:i=!0}=n;return Pl(e,t,{step:-o,loop:i})}function KC(e,t,n={}){return e[hb(e,t,n)]}function xp(e,t){return e.reduce((n,o,i)=>{var a;return i%t===0?n.push([o]):(a=Lr(n))==null||a.push(o),n},[])}function pb(e){return e.reduce((t,n)=>Array.isArray(n)?t.concat(pb(n)):t.concat(n),[])}function wp(e,t){return e.reduce(([n,o],i)=>(t(i)?n.push(i):o.push(i),[n,o]),[[],[]])}var Cp=e=>e?.constructor.name==="Array",XC=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Je(e[n],t[n]))return!1;return!0},Je=(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(Cp(e)&&Cp(t))return XC(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),o=n.length;for(let i=0;i<o;i++)if(!Reflect.has(e,n[i]))return!1;for(let i=0;i<o;i++){const a=n[i];if(!Je(e[a],t[a]))return!1}return!0},Ri=e=>Array.isArray(e),ZC=e=>e===!0||e===!1,fb=e=>e!=null&&typeof e=="object",Bo=e=>fb(e)&&!Ri(e),ir=e=>typeof e=="string",ao=e=>typeof e=="function",JC=e=>e==null,ro=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),QC=e=>Object.prototype.toString.call(e),gb=Function.prototype.toString,e_=gb.call(Object),t_=e=>{if(!fb(e)||QC(e)!="[object Object]"||i_(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=ro(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&gb.call(n)==e_},n_=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,o_=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,i_=e=>n_(e)||o_(e),ns=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,a_=()=>{},xr=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},mb=(()=>{let e=0;return()=>(e++,e.toString(36))})();function ut(e,t,...n){var o;if(e in t){const a=t[e];return ao(a)?a(...n):a}const i=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw(o=Error.captureStackTrace)==null||o.call(Error,i,ut),i}var vb=(e,t)=>{var n;try{return e()}catch(o){return o instanceof Error&&((n=Error.captureStackTrace)==null||n.call(Error,o,vb)),t?.()}},{floor:bb,abs:_p,round:mc,min:r_,max:s_,pow:l_,sign:c_}=Math,Bd=e=>Number.isNaN(e),Co=e=>Bd(e)?0:e,yb=(e,t)=>(e%t+t)%t,d_=(e,t)=>(e%t+t)%t,u_=(e,t)=>Co(e)>=t,h_=(e,t)=>Co(e)<=t,ar=(e,t,n)=>{const o=Co(e),i=t==null||o>=t,a=n==null||o<=n;return i&&a},p_=(e,t,n)=>mc((Co(e)-t)/n)*n+t,Ze=(e,t,n)=>r_(s_(Co(e),t),n),f_=(e,t,n)=>(Co(e)-t)/(n-t),g_=(e,t,n,o)=>Ze(p_(e*(n-t)+t,t,o),t,n),$p=(e,t)=>{let n=e,o=t.toString(),i=o.indexOf("."),a=i>=0?o.length-i:0;if(a>0){let r=l_(10,a);n=mc(n*r)/r}return n},rr=(e,t)=>typeof t=="number"?bb(e*t+.5)/t:mc(e),kp=(e,t,n,o)=>{const i=t!=null?Number(t):0,a=Number(n),r=(e-i)%o;let s=_p(r)*2>=o?e+c_(r)*(o-_p(r)):e-r;if(s=$p(s,o),!Bd(i)&&s<i)s=i;else if(!Bd(a)&&s>a){const l=bb((a-i)/o),c=i+l*o;s=l<=0||c<i?a:c}return $p(s,o)},Ee=(e,t=0,n=10)=>{const o=Math.pow(n,t);return mc(e*o)/o},Sp=e=>{if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n},xb=(e,t,n)=>{let o=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const i=10**Math.max(Sp(e),Sp(n));e=Math.round(e*i),n=Math.round(n*i),o=t==="+"?e+n:e-n,o/=i}return o},m_=(e,t)=>xb(Co(e),"+",t),v_=(e,t)=>xb(Co(e),"-",t),Kn=e=>typeof e=="number"?`${e}px`:e;function vc(e){if(!t_(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(o=>typeof o=="string"),n={};for(const o of t){const i=e[o];i!==void 0&&(n[o]=vc(i))}return n}function oo(e,t){const n={};for(const o of t){const i=e[o];i!==void 0&&(n[o]=i)}return n}function b_(e,t=Object.is){let n={...e};const o=new Set,i=r=>(o.add(r),()=>o.delete(r)),a=()=>{o.forEach(r=>r())};return{subscribe:i,get:r=>n[r],set:(r,s)=>{t(n[r],s)||(n[r]=s,a())},update:r=>{let s=!1;for(const l in r){const c=r[l];c!==void 0&&!t(n[l],c)&&(n[l]=c,s=!0)}s&&a()},snapshot:()=>({...n})}}var os=()=>performance.now(),Qs,y_=class{constructor(t){this.onTick=t,Yn(this,"frameId",null),Yn(this,"pausedAtMs",null),Yn(this,"context"),Yn(this,"cancelFrame",()=>{this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}),Yn(this,"setStartMs",n=>{this.context.startMs=n}),Yn(this,"start",()=>{if(this.frameId!==null)return;const n=os();this.pausedAtMs!==null?(this.context.startMs+=n-this.pausedAtMs,this.pausedAtMs=null):this.context.startMs=n,this.frameId=requestAnimationFrame(bp(this,Qs))}),Yn(this,"pause",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=os())}),Yn(this,"stop",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=null)}),UC(this,Qs,n=>{if(this.context.now=n,this.context.deltaMs=n-this.context.startMs,this.onTick(this.context)===!1){this.stop();return}this.frameId=requestAnimationFrame(bp(this,Qs))}),this.context={now:0,startMs:os(),deltaMs:0}}get elapsedMs(){return this.pausedAtMs!==null?this.pausedAtMs-this.context.startMs:os()-this.context.startMs}};Qs=new WeakMap;function Wc(e,t){const n=new y_(({deltaMs:o})=>{if(o>=t)return e(),!1});return n.start(),()=>n.stop()}function Wn(...e){e.length===1?e[0]:e[1],e.length!==2||e[0]}function x_(...e){e.length===1?e[0]:e[1],e.length!==2||e[0]}function ah(e,t){if(e==null)throw new Error(t())}function rh(e,t,n){let o=[];for(const i of t)e[i]==null&&o.push(i);if(o.length>0)throw new Error(`[zag-js${n?` > ${n}`:""}] missing required props: ${o.join(", ")}`)}var w_=(...e)=>e.map(t=>{var n;return(n=t?.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),C_=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ep=e=>{const t={};let n;for(;n=C_.exec(e);)t[n[1]]=n[2];return t},__=(e,t)=>{if(ir(e)){if(ir(t))return`${e};${t}`;e=Ep(e)}else ir(t)&&(t=Ep(t));return Object.assign({},e??{},t??{})};function Br(...e){let t={};for(let n of e){if(!n)continue;for(let i in t){if(i.startsWith("on")&&typeof t[i]=="function"&&typeof n[i]=="function"){t[i]=xr(n[i],t[i]);continue}if(i==="className"||i==="class"){t[i]=w_(t[i],n[i]);continue}if(i==="style"){t[i]=__(t[i],n[i]);continue}t[i]=n[i]!==void 0?n[i]:t[i]}for(let i in n)t[i]===void 0&&(t[i]=n[i]);const o=Object.getOwnPropertySymbols(n);for(let i of o)t[i]=n[i]}return t}function zd(e,t,n){let o=[],i;return a=>{const r=e(a);return(r.length!==o.length||r.some((s,l)=>!Je(o[l],s)))&&(o=r,i=t(r,a)),i}}function et(){return{and:(...e)=>function(t){return e.every(n=>t.guard(n))},or:(...e)=>function(t){return e.some(n=>t.guard(n))},not:e=>function(t){return!t.guard(e)}}}function bc(){return{guards:et(),createMachine:e=>e,choose:e=>function({choose:t}){var n;return(n=t(e))==null?void 0:n.actions}}}var Ei=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Ei||{}),Uc="__init__";function $_(e){const t=()=>{var o;return((o=e.getRootNode)==null?void 0:o.call(e))??document},n=()=>Ot(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>or(t()),isActiveElement:Ol,getById:o=>t().getElementById(o)}}function k_(e){return new Proxy({},{get(t,n){return n==="style"?o=>e({style:o}).style:e}})}var ee=()=>e=>Array.from(new Set(e)),wb=le("accordion").parts("root","item","itemTrigger","itemContent","itemIndicator"),ma=wb.build(),Vl=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`accordion:${e.id}`},S_=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.item)==null?void 0:o.call(n,t))??`accordion:${e.id}:item:${t}`},Op=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemContent)==null?void 0:o.call(n,t))??`accordion:${e.id}:content:${t}`},Dl=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemTrigger)==null?void 0:o.call(n,t))??`accordion:${e.id}:trigger:${t}`},E_=e=>e.getById(Vl(e)),yc=e=>{const t=`[aria-controls][data-ownedby='${CSS.escape(Vl(e))}']:not([disabled])`;return fo(E_(e),t)},O_=e=>Bi(yc(e)),T_=e=>Lr(yc(e)),I_=(e,t)=>nh(yc(e),Dl(e,t)),P_=(e,t)=>oh(yc(e),Dl(e,t));function V_(e,t){const{send:n,context:o,prop:i,scope:a,computed:r}=e,s=o.get("focusedValue"),l=o.get("value"),c=i("multiple");function d(h){let p=h;!c&&p.length>1&&(p=[p[0]]),n({type:"VALUE.SET",value:p})}function u(h){return{expanded:l.includes(h.value),focused:s===h.value,disabled:!!(h.disabled??i("disabled"))}}return{focusedValue:s,value:l,setValue:d,getItemState:u,getRootProps(){return t.element({...ma.root.attrs,dir:i("dir"),id:Vl(a),"data-orientation":i("orientation")})},getItemProps(h){const p=u(h);return t.element({...ma.item.attrs,dir:i("dir"),id:S_(a,h.value),"data-state":p.expanded?"open":"closed","data-focus":V(p.focused),"data-disabled":V(p.disabled),"data-orientation":i("orientation")})},getItemContentProps(h){const p=u(h);return t.element({...ma.itemContent.attrs,dir:i("dir"),role:"region",id:Op(a,h.value),"aria-labelledby":Dl(a,h.value),hidden:!p.expanded,"data-state":p.expanded?"open":"closed","data-disabled":V(p.disabled),"data-focus":V(p.focused),"data-orientation":i("orientation")})},getItemIndicatorProps(h){const p=u(h);return t.element({...ma.itemIndicator.attrs,dir:i("dir"),"aria-hidden":!0,"data-state":p.expanded?"open":"closed","data-disabled":V(p.disabled),"data-focus":V(p.focused),"data-orientation":i("orientation")})},getItemTriggerProps(h){const{value:p}=h,m=u(h);return t.button({...ma.itemTrigger.attrs,type:"button",dir:i("dir"),id:Dl(a,p),"aria-controls":Op(a,p),"aria-expanded":m.expanded,disabled:m.disabled,"data-orientation":i("orientation"),"aria-disabled":m.disabled,"data-state":m.expanded?"open":"closed","data-ownedby":Vl(a),onFocus(){m.disabled||n({type:"TRIGGER.FOCUS",value:p})},onBlur(){m.disabled||n({type:"TRIGGER.BLUR"})},onClick(f){m.disabled||(uc()&&f.currentTarget.focus(),n({type:"TRIGGER.CLICK",value:p}))},onKeyDown(f){if(f.defaultPrevented||m.disabled)return;const b={ArrowDown(){r("isHorizontal")||n({type:"GOTO.NEXT",value:p})},ArrowUp(){r("isHorizontal")||n({type:"GOTO.PREV",value:p})},ArrowRight(){r("isHorizontal")&&n({type:"GOTO.NEXT",value:p})},ArrowLeft(){r("isHorizontal")&&n({type:"GOTO.PREV",value:p})},Home(){n({type:"GOTO.FIRST",value:p})},End(){n({type:"GOTO.LAST",value:p})}},g=br(f,{dir:i("dir"),orientation:i("orientation")}),y=b[g];y&&(y(f),f.preventDefault())}})}}}var{and:D_,not:M_}=et(),R_={props({props:e}){return{collapsible:!1,multiple:!1,orientation:"vertical",defaultValue:[],...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{focusedValue:t(()=>({defaultValue:null,sync:!0,onChange(n){var o;(o=e("onFocusChange"))==null||o({value:n})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){var o;(o=e("onValueChange"))==null||o({value:n})}}))}},computed:{isHorizontal:({prop:e})=>e("orientation")==="horizontal"},on:{"VALUE.SET":{actions:["setValue"]}},states:{idle:{on:{"TRIGGER.FOCUS":{target:"focused",actions:["setFocusedValue"]}}},focused:{on:{"GOTO.NEXT":{actions:["focusNextTrigger"]},"GOTO.PREV":{actions:["focusPrevTrigger"]},"TRIGGER.CLICK":[{guard:D_("isExpanded","canToggle"),actions:["collapse"]},{guard:M_("isExpanded"),actions:["expand"]}],"GOTO.FIRST":{actions:["focusFirstTrigger"]},"GOTO.LAST":{actions:["focusLastTrigger"]},"TRIGGER.BLUR":{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{canToggle:({prop:e})=>!!e("collapsible")||!!e("multiple"),isExpanded:({context:e,event:t})=>e.get("value").includes(t.value)},actions:{collapse({context:e,prop:t,event:n}){const o=t("multiple")?qo(e.get("value"),n.value):[];e.set("value",o)},expand({context:e,prop:t,event:n}){const o=t("multiple")?Mn(e.get("value"),n.value):[n.value];e.set("value",o)},focusFirstTrigger({scope:e}){var t;(t=O_(e))==null||t.focus()},focusLastTrigger({scope:e}){var t;(t=T_(e))==null||t.focus()},focusNextTrigger({context:e,scope:t}){const n=e.get("focusedValue");if(!n)return;const o=I_(t,n);o?.focus()},focusPrevTrigger({context:e,scope:t}){const n=e.get("focusedValue");if(!n)return;const o=P_(t,n);o?.focus()},setFocusedValue({context:e,event:t}){e.set("focusedValue",t.value)},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t}){e.set("value",t.value)},coarseValue({context:e,prop:t}){!t("multiple")&&e.get("value").length>1&&(Wn("The value of accordion should be a single value when multiple is false."),e.set("value",[e.get("value")[0]]))}}}};ee()(["collapsible","dir","disabled","getRootNode","id","ids","multiple","onFocusChange","onValueChange","orientation","value","defaultValue"]);ee()(["value","disabled"]);const A_={default:{},floating:{root:{gap:"12","& > div[data-part='item']":{boxShadow:"stroke-bordered-interactive",borderBottom:"none"}}}},zr=se({slots:[...wb.keys(),"itemTriggerPrefix","itemTriggerContent"],base:{root:{width:"100%",display:"flex",flexDirection:"column",fontFamily:"sans"},item:{borderBottom:"1px solid {colors.border.muted}",borderRadius:"lg",backgroundColor:"background.default",_hover:{backgroundColor:"background.hover"}},itemTrigger:{width:"100%",paddingX:"8",paddingY:"8",cursor:"pointer",display:"flex",gap:"8",alignItems:"center",textAlign:"left",border:"none",outline:"none",backgroundColor:"transparent",color:"text.normal",fontSize:"base",fontWeight:"medium",lineHeight:"lg",fontStyle:"normal",letterSpacing:"normal"},itemTriggerPrefix:{padding:"2","& > svg":{display:"block"}},itemTriggerContent:{flex:"1",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8"},itemContent:{backgroundColor:"transparent",color:"text.subtle",fontSize:"small",fontWeight:"normal",fontStyle:"normal",lineHeight:"150%",letterSpacing:"0%",padding:"8",paddingTop:"4",animation:"collapse-in",_closed:{animation:"collapse-out"}},itemIndicator:{width:"24",height:"24",display:"flex",alignItems:"center",justifyContent:"center",transformOrigin:"center",transitionDuration:"200ms",transitionProperty:"transform",transitionTimingFunction:"{easings.default}",_open:{transform:"rotate(180deg)"}}},variants:{variant:A_},defaultVariants:{variant:"default"}});function F_(e){const t=Vr(),n=t?.type.emits,o={};n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`);for(const i of n)o[Tw(Ov(i))]=(...a)=>e(i,...a);return o}function N_(e){const t=Vr(),n=Object.keys(t?.type.props??{}).reduce((i,a)=>{const r=(t?.type.props[a]).default;return r!==void 0&&(i[a]=r),i},{}),o=Tv(e);return T(()=>{const i={},a=t?.vnode.props??{};return Object.keys(a).forEach(r=>{i[Ov(r)]=a[r]}),Object.keys({...n,...i}).reduce((r,s)=>(o.value[s]!==void 0&&(r[s]=o.value[s]),r),{})})}function We(e,t){const n=N_(e),o=t?F_(t):{};return T(()=>({...n.value,...o}))}const xe=e=>{const t=Symbol(e);return[n=>ju(t,n),n=>st(t,n),t]},[xn,Hr]=xe("RenderStrategyProps");function L_(e){const t=Re(e);return t?.$el??t}const B_=e=>Object.prototype.hasOwnProperty.call(e,"nodeName")&&typeof e.nodeName=="string";function q(){const e=Vr(),t=he(),n=T(()=>{var r,s;return["#text","#comment"].includes((r=t.value)==null?void 0:r.$el.nodeName)?(s=t.value)==null?void 0:s.$el.nextElementSibling:L_(t)}),o=Object.assign({},e.exposed),i={};for(const r in e.props)Object.defineProperty(i,r,{enumerable:!0,configurable:!0,get:()=>e.props[r]});if(Object.keys(o).length>0)for(const r in o)Object.defineProperty(i,r,{enumerable:!0,configurable:!0,get:()=>o[r]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function a(r){t.value=r,!(B_(r)||!r)&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>r.$el}),e.exposed=i)}return{forwardRef:a,currentRef:t,currentElement:n}}const z_=E({name:"Dynamic",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o;if(!n.default)return null;const i=Cb(n.default()),[a,...r]=i;if(Object.keys(t).length>0){(o=a.props)==null||delete o.ref;const s=Br(t,a.props??{}),l=Iw(a,s);for(const c in s)c.startsWith("on")&&(l.props||(l.props={}),l.props[c]=s[c]);return i.length===1?l:[l,...r]}return i}}});function Cb(e){return e?e.flatMap(t=>t.type===we?Cb(t.children):[t]):[]}const H_="br, hr, img, input, area, textarea".split(", "),j_=e=>typeof e=="string"&&H_.includes(e),Gc=e=>E({name:"Polymorphic",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1}},setup(t,{attrs:n,slots:o}){return t.asChild?()=>at(z_,n,o):()=>{var i;return at(e,n,j_(e)||(i=o.default)==null?void 0:i.call(o))}}});function W_(){const e=new Map;return new Proxy(Gc,{apply(t,n,o){return Gc(o[0])},get(t,n){return e.has(n)||e.set(n,Gc(n)),e.get(n)}})}const Y=W_(),[_b,jr]=xe("CollapsibleContext"),U_=E({__name:"collapsible-content",props:{asChild:{type:Boolean}},setup(e){const t=jr();return q(),(n,o)=>v(t).unmounted?te("",!0):(w(),S(v(Y).div,F({key:0},v(t).getContentProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),G_=E({__name:"collapsible-context",setup(e){const t=jr();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),q_=E({__name:"collapsible-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return _b(n),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}});var Y_=le("collapsible").parts("root","trigger","content","indicator"),is=Y_.build(),K_=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`collapsible:${e.id}`},Hd=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`collapsible:${e.id}:content`},X_=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`collapsible:${e.id}:trigger`},va=e=>e.getById(Hd(e));function Z_(e,t){const{state:n,send:o,context:i,scope:a,prop:r}=e,s=n.matches("open")||n.matches("closing"),l=n.matches("open"),c=n.matches("closed"),{width:d,height:u}=i.get("size"),h=!!r("disabled"),p=r("collapsedHeight"),m=r("collapsedWidth"),f=p!=null,b=m!=null,g=f||b,y=!i.get("initial")&&l;return{disabled:h,visible:s,open:l,measureSize(){o({type:"size.measure"})},setOpen(x){n.matches("open")!==x&&o({type:x?"open":"close"})},getRootProps(){return t.element({...is.root.attrs,"data-state":l?"open":"closed",dir:r("dir"),id:K_(a)})},getContentProps(){return t.element({...is.content.attrs,id:Hd(a),"data-collapsible":"","data-state":y?void 0:l?"open":"closed","data-disabled":V(h),"data-has-collapsed-size":V(g),hidden:!s&&!g,dir:r("dir"),style:{"--height":Kn(u),"--width":Kn(d),"--collapsed-height":Kn(p),"--collapsed-width":Kn(m),...c&&f&&{overflow:"hidden",minHeight:Kn(p),maxHeight:Kn(p)},...c&&b&&{overflow:"hidden",minWidth:Kn(m),maxWidth:Kn(m)}}})},getTriggerProps(){return t.element({...is.trigger.attrs,id:X_(a),dir:r("dir"),type:"button","data-state":l?"open":"closed","data-disabled":V(h),"aria-controls":Hd(a),"aria-expanded":s||!1,onClick(x){x.defaultPrevented||h||o({type:l?"close":"open"})}})},getIndicatorProps(){return t.element({...is.indicator.attrs,dir:r("dir"),"data-state":l?"open":"closed","data-disabled":V(h)})}}}var J_={initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{size:e(()=>({defaultValue:{height:0,width:0},sync:!0})),initial:e(()=>({defaultValue:!1}))}},refs(){return{cleanup:void 0,stylesRef:void 0}},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["setInitial","computeSize","toggleVisibility"])})},exit:["clearInitial","cleanupNode"],states:{closed:{effects:["trackTabbableElements"],on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","computeSize","invokeOnOpen"]}]}},closing:{effects:["trackExitAnimation"],on:{"controlled.close":{target:"closed"},"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","invokeOnOpen"]}],close:[{guard:"isOpenControlled",actions:["invokeOnExitComplete"]},{target:"closed",actions:["setInitial","computeSize","invokeOnExitComplete"]}],"animation.end":{target:"closed",actions:["invokeOnExitComplete","clearInitial"]}}},open:{effects:["trackEnterAnimation"],on:{"controlled.close":{target:"closing"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closing",actions:["setInitial","computeSize","invokeOnClose"]}],"size.measure":{actions:["measureSize"]},"animation.end":{actions:["clearInitial"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackEnterAnimation:({send:e,scope:t})=>{let n;const o=ae(()=>{const i=va(t);if(!i)return;const a=Gi(i).animationName;if(!a||a==="none"){e({type:"animation.end"});return}const r=s=>{Pe(s)===i&&e({type:"animation.end"})};i.addEventListener("animationend",r),n=()=>{i.removeEventListener("animationend",r)}});return()=>{o(),n?.()}},trackExitAnimation:({send:e,scope:t})=>{let n;const o=ae(()=>{const i=va(t);if(!i)return;const a=Gi(i).animationName;if(!a||a==="none"){e({type:"animation.end"});return}const r=l=>{Pe(l)===i&&e({type:"animation.end"})};i.addEventListener("animationend",r);const s=ih(i,{animationFillMode:"forwards"});n=()=>{i.removeEventListener("animationend",r),pc(()=>s())}});return()=>{o(),n?.()}},trackTabbableElements:({scope:e,prop:t})=>{if(!t("collapsedHeight")&&!t("collapsedWidth"))return;const n=va(e);if(!n)return;const o=()=>{const r=Fr(n).map(s=>FC(s,"inert",""));return()=>{r.forEach(s=>s())}};let i=o();const a=SC(n,{callback(){i(),i=o()}});return()=>{i(),a()}}},actions:{setInitial:({context:e,flush:t})=>{t(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("stylesRef",null)},measureSize:({context:e,scope:t})=>{const n=va(t);if(!n)return;const{height:o,width:i}=n.getBoundingClientRect();e.set("size",{height:o,width:i})},computeSize:({refs:e,scope:t,context:n})=>{var o;(o=e.get("cleanup"))==null||o();const i=ae(()=>{const a=va(t);if(!a)return;const r=a.hidden;a.style.animationName="none",a.style.animationDuration="0s",a.hidden=!1;const s=a.getBoundingClientRect();n.set("size",{height:s.height,width:s.width}),n.get("initial")&&(a.style.animationName="",a.style.animationDuration=""),a.hidden=r});e.set("cleanup",i)},invokeOnOpen:({prop:e})=>{var t;(t=e("onOpenChange"))==null||t({open:!0})},invokeOnClose:({prop:e})=>{var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},toggleVisibility:({prop:e,send:t})=>{t({type:e("open")?"controlled.open":"controlled.close"})}}}};ee()(["dir","disabled","getRootNode","id","ids","collapsedHeight","collapsedWidth","onExitComplete","onOpenChange","defaultOpen","open"]);function Q_(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}var Tp={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"},e$="viewBox,className,preserveAspectRatio,fillRule,clipPath,clipRule,strokeWidth,strokeLinecap,strokeLinejoin,strokeDasharray,strokeDashoffset,strokeMiterlimit".split(",");function t$(e){return e in Tp?Tp[e]:e.startsWith("on")?`on${Q_(e.substr(2))}`:e$.includes(e)?e:e.toLowerCase()}var Tt=k_(e=>{const t={};for(const n in e){const o=e[n];n==="children"?typeof o=="string"&&(t.innerHTML=o):t[t$(n)]=e[n]}return t});function Ml(e){const t=e().defaultValue??e().value,n=e().isEqual??Object.is,o=El(t),i=T(()=>e().value!==void 0),a=El(i.value?e().value:o.value);return{initial:t,ref:a,get(){return i.value?e().value:o.value},set(r){var s,l;const c=i.value?e().value:o.value,d=ao(r)?r(c):r;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:d,prev:c}),i.value||(o.value=d),n(d,c)||(l=(s=e()).onChange)==null||l.call(s,d,c)},invoke(r,s){var l,c;(c=(l=e()).onChange)==null||c.call(l,r,s)},hash(r){var s,l;return((l=(s=e()).hash)==null?void 0:l.call(s,r))??String(r)}}}Ml.cleanup=e=>{Wu(()=>e())};Ml.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function n$(e){const t={current:e};return{get(n){return t.current[n]},set(n,o){t.current[n]=o}}}var o$=(e,t)=>{Ae(()=>[...e.map(n=>n())],(n,o)=>{let i=!1;for(let a=0;a<n.length;a++)if(!Je(o[a],Re(n[a]))){i=!0;break}i&&t()})};function bt(e,t={}){var n,o,i;const a=T(()=>{const{id:M,ids:j,getRootNode:Q}=Re(t);return $_({id:M,ids:j,getRootNode:Q})}),r=(...M)=>{e.debug&&console.log(...M)},s=T(()=>{var M;return((M=e.props)==null?void 0:M.call(e,{props:vc(Re(t)),get scope(){return a.value}}))??Re(t)}),l=i$(s),c=(n=e.context)==null?void 0:n.call(e,{prop:l,bindable:Ml,get scope(){return a.value},flush:Ip,getContext(){return d},getComputed(){return P},getRefs(){return g},getEvent(){return f()}}),d={get(M){var j;return(j=c[M])==null?void 0:j.get()},set(M,j){var Q;(Q=c[M])==null||Q.set(j)},initial(M){var j;return(j=c[M])==null?void 0:j.initial},hash(M){var j,Q;const N=(j=c[M])==null?void 0:j.get();return(Q=c[M])==null?void 0:Q.hash(N)}};let u=new Map,h=null,p={current:null},m={current:{type:""}};const f=()=>({...m.current,current(){return m.current},previous(){return p.current}}),b=()=>({...$,matches(...M){const j=$.get();return M.includes(j)},hasTag(M){var j,Q;const N=$.get();return!!((Q=(j=e.states[N])==null?void 0:j.tags)!=null&&Q.includes(M))}}),g=n$(((o=e.refs)==null?void 0:o.call(e,{prop:l,context:d}))??{}),y=()=>({state:b(),context:d,event:f(),prop:l,send:A,action:x,guard:C,track:o$,refs:g,computed:P,flush:Ip,get scope(){return a.value},choose:O}),x=M=>{const j=ao(M)?M(y()):M;if(!j)return;const Q=j.map(N=>{var B,G;const J=(G=(B=e.implementations)==null?void 0:B.actions)==null?void 0:G[N];return J||Wn(`[zag-js] No implementation found for action "${JSON.stringify(N)}"`),J});for(const N of Q)N?.(y())},C=M=>{var j,Q;return ao(M)?M(y()):(Q=(j=e.implementations)==null?void 0:j.guards)==null?void 0:Q[M](y())},k=M=>{const j=ao(M)?M(y()):M;if(!j)return;const Q=j.map(B=>{var G,J;const Z=(J=(G=e.implementations)==null?void 0:G.effects)==null?void 0:J[B];return Z||Wn(`[zag-js] No implementation found for effect "${JSON.stringify(B)}"`),Z}),N=[];for(const B of Q){const G=B?.(y());G&&N.push(G)}return()=>N.forEach(B=>B?.())},O=M=>Js(M).find(j=>{let Q=!j.guard;return ir(j.guard)?Q=!!C(j.guard):ao(j.guard)&&(Q=j.guard(y())),Q}),P=M=>{ah(e.computed,()=>"[zag-js] No computed object found on machine");const j=e.computed[M];return j({context:d,event:f(),prop:l,refs:g,get scope(){return a.value},computed:P})},$=Ml(()=>({defaultValue:e.initialState({prop:l}),onChange(M,j){var Q,N,B;if(j){const J=u.get(j);J?.(),u.delete(j)}j&&x((Q=e.states[j])==null?void 0:Q.exit),x(h?.actions);const G=k((N=e.states[M])==null?void 0:N.effects);if(G&&u.set(M,G),j===Uc){x(e.entry);const J=k(e.effects);J&&u.set(Uc,J)}x((B=e.states[M])==null?void 0:B.entry)}}));let I=Ei.NotStarted;Dr(()=>{const M=I===Ei.Started;I=Ei.Started,r(M?"rehydrating...":"initializing..."),$.invoke($.initial,Uc)}),Pw(()=>{I=Ei.Stopped,r("unmounting...");const M=u.values();for(const j of M)j?.();u=new Map,x(e.exit)});const A=M=>{var j,Q;if(I!==Ei.Started)return;p.current=m.current,m.current=M;let N=$.get();const B=((j=e.states[N].on)==null?void 0:j[M.type])??((Q=e.on)==null?void 0:Q[M.type]),G=O(B);if(!G)return;h=G;const J=G.target??N;r("transition",M.type,G.target||N,`(${G.actions})`);const Z=J!==N;Z?$.set(J):G.reenter&&!Z?$.invoke(N,N):x(G.actions)};return(i=e.watch)==null||i.call(e,y()),{state:b(),send:A,context:d,prop:l,get scope(){return a.value},refs:g,computed:P,event:f(),getStatus:()=>I}}function i$(e){return function(t){return e.value[t]}}var Ip=e=>{po().then(()=>{e()})};const[vz,It]=xe("EnvironmentContext"),Pt=T(()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})),Wt=T(()=>({dir:"ltr",locale:"en-US"})),[bz,Ut]=xe("LocaleContext"),an=e=>{const t={};for(const[n,o]of Object.entries(e))o!==void 0&&(t[n]=o);return t},a$=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=T(()=>{const c=Re(e);return{id:n,dir:i.value.dir,getRootNode:o?.value.getRootNode,...an(c),onExitComplete:()=>{var d;t?.("exitComplete"),(d=c.onExitComplete)==null||d.call(c)},onOpenChange:d=>{var u;t?.("openChange",d),t?.("update:open",d.open),(u=c.onOpenChange)==null||u.call(c,d)}}}),r=bt(J_,a),s=T(()=>Z_(r,Tt)),l=he(!1);return Ae(()=>s.value.visible,()=>{s.value.visible&&(l.value=!0)}),T(()=>{const c=Re(e);return{...s.value,unmounted:!s.value.visible&&!l.value&&c.lazyMount||c.unmountOnExit&&!s.value.visible&&l.value}})},r$=E({__name:"collapsible-root",props:jt({collapsedHeight:{},collapsedWidth:{},defaultOpen:{type:Boolean},disabled:{type:Boolean},id:{},ids:{},lazyMount:{type:Boolean},open:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{defaultOpen:void 0,disabled:void 0,lazyMount:void 0,open:void 0,unmountOnExit:void 0}),emits:["exitComplete","openChange","update:open"],setup(e,{emit:t}){const n=a$(e,t);return _b(n),q(),(o,i)=>(w(),S(v(Y).div,F(v(n).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),s$=E({__name:"collapsible-trigger",props:{asChild:{type:Boolean}},setup(e){const t=jr();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),l$=E({__name:"collapsible-indicator",props:{asChild:{type:Boolean}},setup(e){const t=jr();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getIndicatorProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),xc=Object.freeze(Object.defineProperty({__proto__:null,Content:U_,Context:G_,Indicator:l$,Root:r$,RootProvider:q_,Trigger:s$},Symbol.toStringTag,{value:"Module"})),[$b,Wr]=xe("AccordionContext"),[c$,d$]=xe("AccordionItemContext"),[u$,sh]=xe("AccordionItemPropsContext"),kb=E({__name:"accordion-item",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=Wr(),n=e,o=T(()=>t.value.getItemState(n)),i=Hr(),a=T(()=>t.value.getItemContentProps(n));return c$(o),u$(n),q(),(r,s)=>(w(),S(v(xc).Root,F(v(t).getItemProps(n),{open:o.value.expanded,"lazy-mount":v(i).lazyMount,"unmount-on-exit":v(i).unmountOnExit,ids:{content:a.value.id}}),{default:_(()=>[D(r.$slots,"default")]),_:3},16,["open","lazy-mount","unmount-on-exit","ids"]))}}),h$=E({__name:"AccordionItem",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=We(e),n=T(()=>zr());return(o,i)=>(w(),S(v(kb),F(v(t),{class:[n.value.item],"data-testid":"atlantis-accordion-item"}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["class"]))}}),Sb=()=>(e,t)=>t.reduce((n,o)=>{const[i,a]=n,r=o;return a[r]!==void 0&&(i[r]=a[r]),delete a[r],[i,a]},[{},{...e}]),Eb=E({__name:"accordion-item-content",props:{asChild:{type:Boolean}},setup(e){const t=Sb(),n=Wr(),o=sh(),i=T(()=>{const a=n.value.getItemContentProps(o),[,r]=t(a,["hidden","data-state"]);return r});return q(),(a,r)=>(w(),S(v(xc).Content,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),p$=E({__name:"AccordionItemContent",props:{asChild:{type:Boolean}},setup(e){const t=We(e),n=T(()=>zr());return(o,i)=>(w(),S(v(Eb),F(v(t),{class:[n.value.itemContent],"data-testid":"atlantis-accordion-item-content"}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["class"]))}}),f$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",preserveAspectRatio:"none"};function g$(e,t){return w(),H("svg",f$,[...t[0]||(t[0]=[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5531 5.90623L10.089 6.37027L7.6187 8.84055C7.27698 9.18232 6.72297 9.18232 6.38126 8.84055L3.91094 6.37027L3.4469 5.90623L4.37498 4.97815L4.83902 5.44219L6.99998 7.60315L9.16097 5.44219L9.62499 4.97815L10.5531 5.90623Z",fill:"currentColor"},null,-1)])])}const Ob={render:g$},Tb=E({__name:"accordion-item-indicator",props:{asChild:{type:Boolean}},setup(e){const t=Wr(),n=sh();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getItemIndicatorProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),m$=E({__name:"AccordionItemIndicator",props:{asChild:{type:Boolean}},setup(e){const t=We(e),n=T(()=>zr());return(o,i)=>(w(),S(v(Tb),F(v(t),{class:[n.value.itemIndicator],"data-testid":"atlantis-accordion-item-indicator"}),{default:_(()=>[D(o.$slots,"default",{},()=>[z(v(Ob))])]),_:3},16,["class"]))}}),Ib=E({__name:"accordion-item-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Wr(),n=sh(),o=jr(),i=T(()=>{const{"aria-controls":a,...r}=t.value.getItemTriggerProps(n);return{...r,...o.value.unmounted?{}:{"aria-controls":a}}});return q(),(a,r)=>(w(),S(v(Y).button,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),v$=E({__name:"AccordionItemTrigger",props:{asChild:{type:Boolean}},setup(e){const t=We(e),n=Mr(),o=T(()=>zr());return(i,a)=>(w(),S(v(Ib),F(v(t),{class:[o.value.itemTrigger],"data-testid":"atlantis-accordion-item-trigger"}),{default:_(()=>[v(n).prefix?(w(),H("div",{key:0,class:R(o.value.itemTriggerPrefix)},[D(i.$slots,"prefix")],2)):te("",!0),U("div",{class:R([o.value.itemTriggerContent])},[D(i.$slots,"default")],2)]),_:3},16,["class"]))}}),b$=E({__name:"accordion-context",setup(e){const t=Wr();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),y$=E({__name:"accordion-item-context",setup(e){const t=d$();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),x$=E({__name:"accordion-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return $b(n),xn(T(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),w$=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=T(()=>{const s=Re(e);return{id:n,dir:i.value.dir,getRootNode:o?.value.getRootNode,onFocusChange:l=>t?.("focusChange",l),value:s.modelValue,...an(s),onValueChange:l=>{var c;t?.("valueChange",l),t?.("update:modelValue",l.value),(c=s?.onValueChange)==null||c.call(s,l)}}}),r=bt(R_,a);return T(()=>V_(r,Tt))},C$=E({__name:"accordion-root",props:jt({collapsible:{type:Boolean},defaultValue:{},disabled:{type:Boolean},id:{},ids:{},modelValue:{},multiple:{type:Boolean},orientation:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{collapsible:void 0,disabled:void 0,multiple:void 0}),emits:["focusChange","valueChange","update:modelValue"],setup(e,{emit:t}){const n=e,o=w$(n,t);return $b(o),xn(T(()=>({lazyMount:n.lazyMount,unmountOnExit:n.unmountOnExit}))),q(),(i,a)=>(w(),S(v(Y).div,F(v(o).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),_$=Object.freeze(Object.defineProperty({__proto__:null,Context:b$,Item:kb,ItemContent:Eb,ItemContext:y$,ItemIndicator:Tb,ItemTrigger:Ib,Root:C$,RootProvider:x$},Symbol.toStringTag,{value:"Module"})),$$=E({__name:"AccordionRoot",props:{collapsible:{type:Boolean},defaultValue:{},disabled:{type:Boolean},id:{},ids:{},modelValue:{},multiple:{type:Boolean},orientation:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean},variant:{default:"default"}},emits:["focusChange","valueChange","update:modelValue"],setup(e,{emit:t}){const n=e,o=We(n,t),i=T(()=>zr({variant:n.variant}));return(a,r)=>(w(),S(v(_$).Root,F(v(o),{class:[i.value.root],"data-testid":"atlantis-accordion-root"}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["class"]))}}),k$=le("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator");k$.build();const[yz,wn]=xe("FieldContext");function S$(e){if(!e)return;const t=Gi(e);return"box-sizing:"+t.boxSizing+";border-left:"+t.borderLeftWidth+" solid red;border-right:"+t.borderRightWidth+" solid red;font-family:"+t.fontFamily+";font-feature-settings:"+t.fontFeatureSettings+";font-kerning:"+t.fontKerning+";font-size:"+t.fontSize+";font-stretch:"+t.fontStretch+";font-style:"+t.fontStyle+";font-variant:"+t.fontVariant+";font-variant-caps:"+t.fontVariantCaps+";font-variant-ligatures:"+t.fontVariantLigatures+";font-variant-numeric:"+t.fontVariantNumeric+";font-weight:"+t.fontWeight+";letter-spacing:"+t.letterSpacing+";margin-left:"+t.marginLeft+";margin-right:"+t.marginRight+";padding-left:"+t.paddingLeft+";padding-right:"+t.paddingRight+";text-indent:"+t.textIndent+";text-transform:"+t.textTransform}function E$(e){var t=e.createElement("div");return t.id="ghost",t.style.cssText="display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;",e.body.appendChild(t),t}function O$(e){if(!e)return;const t=Ot(e),n=Fe(e),o=E$(t),i=S$(e);i&&(o.style.cssText+=i);function a(){n.requestAnimationFrame(()=>{o.innerHTML=e.value;const r=n.getComputedStyle(o);e?.style.setProperty("width",r.width)})}return a(),e?.addEventListener("input",a),e?.addEventListener("change",a),()=>{t.body.removeChild(o),e?.removeEventListener("input",a),e?.removeEventListener("change",a)}}var Pb=(e=>(e.ArrowUp="↑",e.ArrowDown="↓",e.ArrowLeft="←",e.ArrowRight="→",e.Enter="↵",e.Tab="⇥",e.Escape="Esc",e.Space="␣",e.Backspace="⌫",e.Delete="Del",e.PageUp="PgUp",e.PageDown="PgDn",e.Command="⌘",e.Control="CTRL",e))(Pb||{});const T$={default:{},inverted:{color:"text.inverse",background:"background.neutral-default",boxShadow:"inner-highlighted-ring"}},I$=ri({base:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",paddingX:"2",height:"14",textAlign:"center",fontFamily:"mono",fontSize:"xs",fontStyle:"normal",fontWeight:"regular",lineHeight:"sm",letterSpacing:"tight",textTransform:"uppercase",color:"text.subtle",background:"background.neutral-default",boxShadow:"inner-highlighted-ring"},defaultVariants:{type:"default"},variants:{type:T$}}),Rl=E({__name:"KeyboardKey",props:{type:{default:"default"},keys:{default:()=>[]},macKeys:{default:()=>[]},windowsKeys:{default:()=>[]},forcePlatform:{default:"mac"}},setup(e){const t=e,n=r=>r==="Ctrl"?"Control":r==="Meta"?"Command":r,o=r=>{const s=n(r);return Pb[s]||r},i=he("windows");Ae(()=>t.forcePlatform,r=>{r&&(i.value=r)}),Dr(()=>{t.forcePlatform?i.value=t.forcePlatform:typeof navigator<"u"&&(i.value=navigator.userAgent.toLowerCase().includes("mac")?"mac":"windows")});const a=T(()=>t.macKeys||t.windowsKeys?i.value==="mac"?t.macKeys??[]:t.windowsKeys??[]:t.keys??[]);return(r,s)=>(w(),H("div",{class:R(v(dt)({display:"flex",columnGap:"3"}))},[(w(!0),H(we,null,Oe(a.value,l=>(w(),H("div",{key:l,class:R(v(I$)({type:e.type}))},oe(o(l)),3))),128))],2))}}),P$=se({className:"spinner",slots:["root","spinner","background","rotationWrapper"],base:{root:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center"},spinner:{width:"100%",height:"100%"},background:{position:"absolute",top:"0",left:"0"},rotationWrapper:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",animation:"spin 1s linear infinite"}},variants:{variant:{default:{},inverted:{}},size:{sm:{root:{width:"16",height:"16"}},md:{root:{width:"24",height:"24"}},lg:{root:{width:"32",height:"32"}}}},defaultVariants:{variant:"default",size:"md"}}),V$=["aria-label"],D$=["fill"],M$=["fill"],Vb=E({__name:"Spinner",props:{variant:{default:"default"},size:{default:"md"},ariaLabel:{default:"Loading"}},setup(e){const t=e,n=T(()=>P$({variant:t.variant,size:t.size})),o=T(()=>t.variant==="default"?"var(--colors-icon-selected)":"var(--colors-icon-inverse)");return(i,a)=>(w(),H("div",{class:R(n.value.root),"aria-label":t.ariaLabel,role:"status","data-testid":"spinner"},[(w(),H("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:R([n.value.spinner,n.value.background])},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",fill:o.value,opacity:"0.3",d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12Z"},null,8,D$)],2)),U("div",{class:R([n.value.rotationWrapper,"spinner-rotate"])},[(w(),H("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:R(n.value.spinner)},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",fill:o.value,d:"M12 4C9.38441 4 7.06204 5.25316 5.59909 7.20034C4.9356 8.08342 3.68185 8.26146 2.79876 7.59798C1.91568 6.93449 1.73764 5.68074 2.40113 4.79765C4.58709 1.88817 8.07337 0 12 0C18.6274 0 24 5.37257 24 12C24 18.6274 18.6274 24 12 24C10.8954 24 10 23.1046 10 22C10 20.8954 10.8954 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z"},null,8,M$)],2))],2)],10,V$))}}),R$=se({slots:["root"],base:{root:{}},defaultVariants:{variant:"primary"},variants:{variant:{primary:{root:{color:"inherit"}},critical:{root:{color:"inherit"}},default:{root:{color:"inherit"}},subtle:{root:{color:"inherit"}},plainPrimary:{root:{color:"inherit"}},plainCritical:{root:{color:"inherit"}},dashed:{root:{color:"inherit"}},validation:{root:{color:"inherit"}},link:{root:{color:"inherit",textStyle:"body_small_medium"}}}}}),A$=E({__name:"ButtonText",props:{text:{},variant:{default:"primary"}},setup(e){const t=e,n=T(()=>R$({variant:t.variant}));return(o,i)=>(w(),H("span",{class:R(n.value.root)},[D(o.$slots,"default",{},()=>[Te(oe(t.text),1)])],2))}}),qe={primary:{_active:{background:"background.brand-bold-pressed !important"},color:"whitealpha.1000",background:"background.brand-bold-default",boxShadow:"stroke-bordered-interactive",_hover:{background:"background.brand-bold-hover"},_focus:{background:"background.brand-bold-default",boxShadow:"state-focus-primary"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},critical:{background:"colorPalette.700",color:"whitealpha.1000",boxShadow:"stroke-bordered-interactive",colorPalette:"red",_active:{background:"background.error-bold-pressed !important"},_hover:{background:"colorPalette.800"},_focus:{background:"background.error-bold-default",boxShadow:"state-focus-critical"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},default:{background:"whitealpha.1000",color:"graycool.1000",colorPalette:"whitealpha",boxShadow:"stroke-bordered-interactive",_hover:{background:"graycoolalpha.10"},_active:{background:"background.pressed !important"},_focus:{boxShadow:"state-focus-primary",zIndex:"100000"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},subtle:{background:"whitealpha.1000",color:"text.subtle",_active:{background:"background.pressed !important"},_disabled:{background:"background.pressed"},_hover:{background:"background.hover"},_focus:{boxShadow:"state-focus-primary"}},plainPrimary:{background:"whitealpha.1000",color:"colorPalette.800",colorPalette:"seed",_active:{background:"background.brand-selected-pressed !important",color:"text.brand-pressed"},_hover:{backgroundColor:"colorPalette.200"},_selected:{background:"colorPalette.a3"},_disabled:{color:"text.disabled",background:"whitealpha.1000",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"whitealpha.1000"}},_focus:{boxShadow:"state-focus-primary",color:"text.brand-default"}},plainCritical:{background:"whitealpha.1000",color:"colorPalette.800",colorPalette:"red",_active:{background:"background.error-pressed !important",color:"text.error-pressed"},_hover:{backgroundColor:"colorPalette.200"},_selected:{background:"colorPalette.a3"},_disabled:{color:"text.disabled",background:"whitealpha.1000",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"whitealpha.1000"}},_focus:{boxShadow:"state-focus-critical",color:"text.error-default"}},dashed:{'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"},boxShadow:"stroke-bordered-interactive",background:"whitealpha.1000",color:"graycool.900",colorPalette:"whitealpha",border:"1px dashed",borderColor:"graycoolalpha.75",_active:{background:"background.hover !important",color:"text.normal"},_hover:{background:"graycoolalpha.10"},_focus:{boxShadow:"state-focus-primary"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}}},validation:{background:"colorPalette.700",color:"whitealpha.1000",colorPalette:"green",boxShadow:"stroke-bordered-interactive",_active:{background:"background.success-bold-pressed !important"},_hover:{background:"colorPalette.800"},_focus:{background:"background.success-bold-default",boxShadow:"state-focus-success"},_disabled:{color:"graycoolalpha.75",background:"graycoolalpha.20",cursor:"not-allowed",_hover:{color:"graycoolalpha.75",background:"graycoolalpha.20"}},'&[data-selected="true"]':{boxShadow:"stroke-bordered-interactive"}},link:{background:"transparent",color:"text.brand-default",textStyle:"body_small_medium",padding:"0",height:"auto",_hover:{},_focus:{},_disabled:{color:"text.disabled",cursor:"not-allowed"}}},Pp={default:{width:"32",height:"32"},small:{width:"24",height:"24"}},F$=se({slots:["root","content","spinner","label","slots"],base:{root:{alignItems:"center",appearance:"none",cursor:"pointer",display:"inline-flex",isolation:"isolate",minWidth:"0",justifyContent:"center",outline:"none",position:"relative",transitionDuration:"normal",transitionProperty:"background, border-color, color, box-shadow",transitionTimingFunction:"default",userSelect:"none",verticalAlign:"middle",borderRadius:"md",border:"none",fontSize:"base",fontWeight:"medium",fontFamily:"sans",lineHeight:"lg",whiteSpace:"nowrap",_hidden:{display:"none"},_disabled:{color:"text.disabled",background:"background.gray-subtler-default",cursor:"not-allowed",boxShadow:"none",_hover:{color:"text.disabled",background:"background.gray-subtler-default"},_active:{background:"background.gray-subtler-default !important"}}},content:{display:"flex",alignItems:"center",gap:"6"},spinner:{width:"16",height:"16","&[data-loading]":{opacity:"0.7"}},label:{"&[data-loading]":{opacity:"0.7"}},slots:{display:"flex",alignItems:"center",justifyContent:"center"}},defaultVariants:{type:"primary",size:"default"},variants:{type:{primary:{root:qe.primary,spinner:{}},critical:{root:qe.critical},default:{root:qe.default},subtle:{root:qe.subtle},plainPrimary:{root:qe.plainPrimary},plainCritical:{root:qe.plainCritical},dashed:{root:qe.dashed},validation:{root:qe.validation},link:{root:qe.link}},size:{default:{root:{px:"12",py:"6",gap:"6"}},small:{root:{px:"8",py:"2",gap:"6"}}}}}),N$=["disabled","data-loading","data-selected","aria-busy"],Xt=E({__name:"Button",props:{type:{default:"primary"},size:{default:"default"},isLoading:{type:Boolean},isDisabled:{type:Boolean},label:{},isSelected:{type:Boolean,default:!1},shortcutKeys:{}},setup(e){const t=Mr(),n=e,o=T(()=>F$({type:n.type,size:n.size})),i=T(()=>n.type==="primary"||n.type==="validation"||n.type==="critical"?"inverted":"default"),a=T(()=>t.prefix),r=T(()=>t.suffix);return(s,l)=>(w(),H("button",{disabled:n.isDisabled,"data-loading":n.isLoading||null,"data-selected":n.isSelected||null,"aria-busy":n.isLoading||void 0,class:R([o.value.root,v(dt)(n.isSelected?{background:"background.brand-selected !important",color:"text.selected !important"}:{})])},[U("div",{class:R([o.value.content,n.isLoading?v(dt)({position:"relative"}):""])},[a.value?(w(),H("div",{key:0,class:R([o.value.slots,n.isLoading?v(dt)({visibility:"hidden"}):""])},[D(s.$slots,"prefix")],2)):te("",!0),n.isLoading?(w(),S(Vb,{key:1,class:R([o.value.spinner,n.isLoading?v(dt)({position:"absolute",transform:"translate(-50%, -50%)",top:"50%",left:"50%"}):""]),variant:i.value,"data-loading":n.isLoading||null},null,8,["class","variant","data-loading"])):te("",!0),U("div",{class:R([a.value?v(dt)({paddingRight:"2",display:"inline-flex"}):"",r.value?v(dt)({paddingLeft:"2",display:"inline-flex"}):"",o.value.label,n.isLoading?v(dt)({visibility:"hidden"}):""])},[D(s.$slots,"default",{},()=>[n.label?(w(),S(A$,{key:0,text:n.label,variant:n.type},null,8,["text","variant"])):te("",!0)])],2),r.value?(w(),H("div",{key:2,class:R([o.value.slots,n.isLoading?v(dt)({visibility:"hidden"}):""])},[D(s.$slots,"suffix")],2)):te("",!0),n.shortcutKeys?(w(),H("div",{key:3,class:R([n.isLoading?v(dt)({visibility:"hidden"}):""])},[z(Rl,{type:"default",keys:n.shortcutKeys},null,8,["keys"])],2)):te("",!0)],2)],10,N$))}}),L$={default:{},error:{root:{boxShadow:"state-focus-critical",_focusWithin:{boxShadow:"state-focus-critical"},_focus:{boxShadow:"state-focus-critical"}}}},B$={default:{},chat:{root:{borderBottomRadius:"none"}}};se({slots:["root","input","inputContainer","suffixButton","footer"],base:{root:{padding:"8",display:"flex",flexDirection:"column",gap:"8",background:"background.gray-subtlest-default",boxShadow:"stroke-container",transitionDuration:"normal",transitionProperty:"background, border-color, color, box-shadow",transitionTimingFunction:"default",borderRadius:"md",_hover:{backgroundColor:"background.gray-subtlest-hover"},_focus:{boxShadow:"state-focus-primary"},_focusWithin:{boxShadow:"state-focus-primary"}},inputContainer:{display:"flex",gap:"12"},input:{resize:"none",width:"100%",textAlign:"left",outline:"none",display:"flex",padding:"0",borderRadius:"none",borderTopLeftRadius:"md",border:"none",backgroundColor:"transparent",fontFamily:"sans",fontSize:"base",fontWeight:"regular",lineHeight:"lg",letterSpacing:"normal",_placeholder:{color:"text.placeholder"},_disabled:{backgroundColor:"background.disabled",color:"text.disabled",cursor:"not-allowed",_hover:{backgroundColor:"background.disabled"}}},suffixButton:{width:"fit-content",height:"fit-content",paddingX:"4 !important",paddingY:"4 !important"}},variants:{variant:B$,state:L$,disabled:{true:{root:{cursor:"not-allowed",backgroundColor:"background.disabled",color:"text.subtle",boxShadow:"none",_hover:{backgroundColor:"background.disabled"},_focusWithin:{boxShadow:"none"},_focus:{boxShadow:"none"}},input:{cursor:"not-allowed",backgroundColor:"transparent",color:"text.subtle","&::placeholder":{color:"text.placeholder"}}},false:{}}},defaultVariants:{variant:"default",state:"default",disabled:!1}});const z$=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},H$=se({slots:["root","content"],base:{root:{alignItems:"center",appearance:"none",cursor:"pointer",display:"inline-flex",isolation:"isolate",minWidth:"0",justifyContent:"center",outline:"none",userSelect:"none",verticalAlign:"middle",borderRadius:"md",border:"none",_hidden:{display:"none"}},content:{display:"flex",alignItems:"center",justifyContent:"center"}},defaultVariants:{type:"primary",size:"default"},variants:{type:{primary:{root:qe.primary},critical:{root:qe.critical},default:{root:qe.default},subtle:{root:qe.subtle},dashed:{root:qe.dashed},plain:{root:{background:"none",_focusVisible:{boxShadow:"state-focus-primary"},_disabled:{padding:0,boxShadow:"none",background:"graycoolalpha.20",borderColor:"border.disabled",color:"graycoolalpha.75",cursor:"not-allowed",_hover:{background:"graycoolalpha.20",borderColor:"border.disabled",color:"graycoolalpha.75"}}}}},size:{default:{root:Pp.default},small:{root:Pp.small}}},compoundVariants:[{type:"plain",size:"default",css:{root:{width:"16 !important",height:"16 !important"}}},{type:"plain",size:"small",css:{root:{width:"16 !important",height:"16 !important"}}}]}),j$=["disabled","data-selected"],gi=E({__name:"IconButton",props:{type:{},size:{},isDisabled:{type:Boolean},isSelected:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=e,o=t,i=r=>{n.isDisabled||o("click",r)},a=T(()=>H$({type:n.type,size:n.size}));return(r,s)=>(w(),H("button",{disabled:n.isDisabled,"data-selected":n.isSelected||null,"aria-label":"Icon button",onClick:i,class:R([a.value.root,v(dt)(n.isSelected?{background:"background.brand-selected !important",color:"text.selected !important"}:{})])},[U("div",{class:R(a.value.content)},[D(r.$slots,"prefixIcon")],2)],10,j$))}});se({slots:["container","indicator","message","icon","title"],base:{indicator:{minHeight:"3.85rem",borderTopLeftRadius:"md",borderBottomLeftRadius:"md",position:"absolute",left:"-0.0625rem",top:"0",width:"0.25rem",height:"100%"},container:{display:"flex",borderRadius:"md",boxShadow:"inner-highlighted-ring",position:"relative",minHeight:"3.75rem",padding:"8",fontSize:"md",fontWeight:"medium"},title:{fontSize:"base",fontWeight:"regular",color:"text.normal",fontFamily:"sans",lineHeight:"lg",letterSpacing:"normal"}},variants:{type:{info:{indicator:{backgroundColor:"blue.800"},icon:{color:"blue.800"}},warning:{indicator:{backgroundColor:"orange.800"},icon:{color:"orange.800"}},issue:{indicator:{backgroundColor:"red.800"},icon:{color:"red.800"}}}},defaultVariants:{type:"info"}});var W$=le("avatar").parts("root","image","fallback");W$.build();ee()(["dir","id","ids","onStatusChange","getRootNode"]);se({slots:["root","image","fallback"],base:{root:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",overflow:"hidden",userSelect:"none",boxShadow:"stroke-bordered-interactive",background:"background.default"},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"inherit"},fallback:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#F2F2F5",color:"text.subtle",textAlign:"center",borderRadius:"inherit"}},variants:{size:{xs:{root:{width:"16",height:"16"},fallback:{textStyle:"body_xsmall_caps_medium"}},sm:{root:{width:"20",height:"20"},fallback:{textStyle:"body_xsmall_caps_medium"}},md:{root:{width:"24",height:"24"},fallback:{textStyle:"body_xsmall_caps_medium"}},lg:{root:{width:"32",height:"32",padding:"2"},fallback:{textStyle:"body_small_semibold"}},xl:{root:{width:"40",height:"40",padding:"2"},fallback:{textStyle:"body_base_semibold"}}},shape:{rounded:{root:{borderRadius:"full"}},square:{root:{borderRadius:"md"}}}},defaultVariants:{size:"md",shape:"rounded"}});var U$=Object.defineProperty,G$=(e,t,n)=>t in e?U$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_n=(e,t,n)=>G$(e,typeof t!="symbol"?t+"":t,n),Vp=class Ge{constructor([t,n,o,i,a,r]=[0,0,0,0,0,0]){_n(this,"m00"),_n(this,"m01"),_n(this,"m02"),_n(this,"m10"),_n(this,"m11"),_n(this,"m12"),_n(this,"rotate",(...s)=>this.prepend(Ge.rotate(...s))),_n(this,"scale",(...s)=>this.prepend(Ge.scale(...s))),_n(this,"translate",(...s)=>this.prepend(Ge.translate(...s))),this.m00=t,this.m01=n,this.m02=o,this.m10=i,this.m11=a,this.m12=r}applyTo(t){const{x:n,y:o}=t,{m00:i,m01:a,m02:r,m10:s,m11:l,m12:c}=this;return{x:i*n+a*o+r,y:s*n+l*o+c}}prepend(t){return new Ge([this.m00*t.m00+this.m01*t.m10,this.m00*t.m01+this.m01*t.m11,this.m00*t.m02+this.m01*t.m12+this.m02,this.m10*t.m00+this.m11*t.m10,this.m10*t.m01+this.m11*t.m11,this.m10*t.m02+this.m11*t.m12+this.m12])}append(t){return new Ge([t.m00*this.m00+t.m01*this.m10,t.m00*this.m01+t.m01*this.m11,t.m00*this.m02+t.m01*this.m12+t.m02,t.m10*this.m00+t.m11*this.m10,t.m10*this.m01+t.m11*this.m11,t.m10*this.m02+t.m11*this.m12+t.m12])}get determinant(){return this.m00*this.m11-this.m01*this.m10}get isInvertible(){const t=this.determinant;return isFinite(t)&&isFinite(this.m02)&&isFinite(this.m12)&&t!==0}invert(){const t=this.determinant;return new Ge([this.m11/t,-this.m01/t,(this.m01*this.m12-this.m11*this.m02)/t,-this.m10/t,this.m00/t,(this.m10*this.m02-this.m00*this.m12)/t])}get array(){return[this.m00,this.m01,this.m02,this.m10,this.m11,this.m12,0,0,1]}get float32Array(){return new Float32Array(this.array)}static get identity(){return new Ge([1,0,0,0,1,0])}static rotate(t,n){const o=new Ge([Math.cos(t),-Math.sin(t),0,Math.sin(t),Math.cos(t),0]);return n&&(n.x!==0||n.y!==0)?Ge.multiply(Ge.translate(n.x,n.y),o,Ge.translate(-n.x,-n.y)):o}static scale(t,n=t,o={x:0,y:0}){const i=new Ge([t,0,0,0,n,0]);return o.x!==0||o.y!==0?Ge.multiply(Ge.translate(o.x,o.y),i,Ge.translate(-o.x,-o.y)):i}static translate(t,n){return new Ge([1,0,t,0,1,n])}static multiply(...[t,...n]){return t?n.reduce((o,i)=>o.prepend(i),t):Ge.identity}get a(){return this.m00}get b(){return this.m10}get c(){return this.m01}get d(){return this.m11}get tx(){return this.m02}get ty(){return this.m12}get scaleComponents(){return{x:this.a,y:this.d}}get translationComponents(){return{x:this.tx,y:this.ty}}get skewComponents(){return{x:this.c,y:this.b}}toString(){return`matrix(${this.a}, ${this.b}, ${this.c}, ${this.d}, ${this.tx}, ${this.ty})`}},Dp=(e,t,n)=>Math.min(Math.max(e,t),n),as=(e,t,n)=>{const o=Dp(e.x,n.x,n.x+n.width-t.width),i=Dp(e.y,n.y,n.y+n.height-t.height);return{x:o,y:i}},q$={width:0,height:0},Y$={width:1/0,height:1/0},rs=(e,t=q$,n=Y$)=>({width:Math.min(Math.max(e.width,t.width),n.width),height:Math.min(Math.max(e.height,t.height),n.height)}),zo=(e,t)=>({x:e,y:t}),Mp=(e,t)=>t?zo(e.x-t.x,e.y-t.y):e,K$=(e,t)=>zo(e.x+t.x,e.y+t.y);function Ur(e){const{x:t,y:n,width:o,height:i}=e,a=t+o/2,r=n+i/2;return{x:t,y:n,width:o,height:i,minX:t,minY:n,maxX:t+o,maxY:n+i,midX:a,midY:r,center:zo(a,r)}}function X$(e){const t=zo(e.minX,e.minY),n=zo(e.maxX,e.minY),o=zo(e.maxX,e.maxY),i=zo(e.minX,e.maxY);return{top:t,right:n,bottom:o,left:i}}var Z$=(e,t)=>{const n=Math.max(t.x,Math.min(e.x,t.x+t.width-e.width)),o=Math.max(t.y,Math.min(e.y,t.y+t.height-e.height));return{x:n,y:o,width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}},J$=(e,t)=>e.width===t?.width&&e.height===t?.height,Q$=(e,t)=>e.x===t?.x&&e.y===t?.y,qc=new WeakMap;function ek(e){if(!qc.has(e)){const t=e.ownerDocument.defaultView||window;qc.set(e,t.getComputedStyle(e))}return qc.get(e)}function Db(e,t={}){return Ur(tk(e,t))}function tk(e,t={}){const{excludeScrollbar:n=!1,excludeBorders:o=!1}=t,{x:i,y:a,width:r,height:s}=e.getBoundingClientRect(),l={x:i,y:a,width:r,height:s},c=ek(e),{borderLeftWidth:d,borderTopWidth:u,borderRightWidth:h,borderBottomWidth:p}=c,m=Rp(d,h),f=Rp(u,p);if(o&&(l.width-=m,l.height-=f,l.x+=jd(d),l.y+=jd(u)),n){const b=e.offsetWidth-e.clientWidth-m,g=e.offsetHeight-e.clientHeight-f;l.width-=b,l.height-=g}return l}var jd=e=>parseFloat(e.replace("px","")),Rp=(...e)=>e.reduce((t,n)=>t+(n?jd(n):0),0);function nk(e,t={}){return Ur(ok(e,t))}function ok(e,t){const{excludeScrollbar:n=!1}=t,{innerWidth:o,innerHeight:i,document:a,visualViewport:r}=e,s=r?.width||o,l=r?.height||i,c={x:0,y:0,width:s,height:l};if(n){const d=o-a.documentElement.clientWidth,u=i-a.documentElement.clientHeight;c.width-=d,c.height-=u}return c}function ik(e,t){const n=Ur(e),{top:o,right:i,left:a,bottom:r}=X$(n),[s]=t.split("-");return{top:[a,o,i,r],right:[o,i,r,a],bottom:[o,a,r,i],left:[i,o,a,r]}[s]}function ak(e,t){const{x:n,y:o}=t;let i=!1;for(let a=0,r=e.length-1;a<e.length;r=a++){const s=e[a].x,l=e[a].y,c=e[r].x,d=e[r].y;l>o!=d>o&&n<(c-s)*(o-l)/(d-l)+s&&(i=!i)}return i}var Ap={n:{x:.5,y:0},ne:{x:1,y:0},e:{x:1,y:.5},se:{x:1,y:1},s:{x:.5,y:1},sw:{x:0,y:1},w:{x:0,y:.5},nw:{x:0,y:0}},rk={n:"s",ne:"sw",e:"w",se:"nw",s:"n",sw:"ne",w:"e",nw:"se"},{sign:ss,abs:Ai,min:Fp}=Math;function Np(e,t){const{minX:n,minY:o,maxX:i,maxY:a,midX:r,midY:s}=e,l=t.includes("w")?n:t.includes("e")?i:r,c=t.includes("n")?o:t.includes("s")?a:s;return{x:l,y:c}}function sk(e){return rk[e]}function lk(e,t,n,o){const{scalingOriginMode:i,lockAspectRatio:a}=o,r=Np(e,n),s=sk(n),l=Np(e,s);i==="center"&&(t={x:t.x*2,y:t.y*2});const c={x:r.x+t.x,y:r.y+t.y},d={x:Ap[n].x*2-1,y:Ap[n].y*2-1},u={width:c.x-l.x,height:c.y-l.y},h=d.x*u.width/e.width,p=d.y*u.height/e.height,m=Ai(h)>Ai(p)?h:p,f=a?{x:m,y:m}:{x:r.x===l.x?1:h,y:r.y===l.y?1:p};switch(r.y===l.y?f.y=Ai(f.y):ss(f.y)!==ss(p)&&(f.y*=-1),r.x===l.x?f.x=Ai(f.x):ss(f.x)!==ss(h)&&(f.x*=-1),i){case"extent":return Lp(e,Vp.scale(f.x,f.y,l),!1);case"center":return Lp(e,Vp.scale(f.x,f.y,{x:e.midX,y:e.midY}),!1)}}function ck(e,t,n=!0){return n?{x:Fp(t.x,e.x),y:Fp(t.y,e.y),width:Ai(t.x-e.x),height:Ai(t.y-e.y)}:{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}}function Lp(e,t,n=!0){const o=t.applyTo({x:e.minX,y:e.minY}),i=t.applyTo({x:e.maxX,y:e.maxY});return ck(o,i,n)}var dk=le("angle-slider").parts("root","label","thumb","valueText","control","track","markerGroup","marker");dk.build();ee()(["aria-label","aria-labelledby","dir","disabled","getRootNode","id","ids","invalid","name","onValueChange","onValueChangeEnd","readOnly","step","value","defaultValue"]);function uk(e,t){const{state:n,send:o,context:i}=e,a=n.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:a,setNode(r){r&&o({type:"NODE.SET",node:r})},unmount(){o({type:"UNMOUNT"})}}}var hk={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:["clearInitial","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)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",Gi(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:o})=>{const i=o("present");if(i)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!i&&a?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});ae(()=>{var r,s;const l=ls(t.get("styles"));e.set("unmountAnimationName",l),l==="none"||l===e.get("prevAnimationName")||((r=t.get("styles"))==null?void 0:r.display)==="none"||((s=t.get("styles"))==null?void 0:s.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{ae(()=>{e.set("prevAnimationName",ls(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:o})=>{const i=t.get("node");if(!i)return;const a=l=>{var c,d;(((d=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:d[0])??l.target)===i&&e.set("prevAnimationName",ls(t.get("styles")))},r=l=>{const c=ls(t.get("styles"));Pe(l)===i&&c===e.get("unmountAnimationName")&&!o("present")&&n({type:"UNMOUNT",src:"animationend"})};i.addEventListener("animationstart",a),i.addEventListener("animationcancel",r),i.addEventListener("animationend",r);const s=ih(i,{animationFillMode:"forwards"});return()=>{i.removeEventListener("animationstart",a),i.removeEventListener("animationcancel",r),i.removeEventListener("animationend",r),pc(()=>s())}}}}};function ls(e){return e?.animationName||"none"}ee()(["onExitComplete","present","immediate"]);const lh=(e,t)=>{const n=he(!1),o=he(null),i=T(()=>({present:Re(e).present,onExitComplete:()=>{}})),a=bt(hk,i),r=T(()=>uk(a));return Ae(()=>r.value.present,()=>{r.value.present&&(n.value=!0)}),Ae(o,()=>{if(o.value){const s=o.value.$el?o.value.$el:o.value;s&&r.value.setNode(s)}}),T(()=>{var s;const l=Re(e);return{present:r.value.present,unmounted:!r.value.present&&!n.value&&l.lazyMount||l?.unmountOnExit&&!((s=r.value)!=null&&s.present)&&n.value,presenceProps:{ref:o,hidden:!r.value.present,"data-state":r.value.skip&&l.skipAnimationOnMount?void 0:l!=null&&l.present?"open":"closed"}}})},[ch,dh]=xe("PresenceContext");var mi=new WeakMap,cs=new WeakMap,ds={},Yc=0,Mb=e=>e&&(e.host||Mb(e.parentNode)),pk=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Mb(n);return o&&e.contains(o)?o:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),fk=new Set(["script","output","status","next-route-announcer"]),gk=e=>fk.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),mk=(e,t)=>{const{parentNode:n,markerName:o,controlAttribute:i,followControlledElements:a=!0}=t,r=pk(n,Array.isArray(e)?e:[e]);ds[o]||(ds[o]=new WeakMap);const s=ds[o],l=[],c=new Set,d=new Set(r),u=p=>{!p||c.has(p)||(c.add(p),u(p.parentNode))};r.forEach(p=>{u(p),a&&Be(p)&&Gv(p,m=>{u(m)})});const h=p=>{!p||d.has(p)||Array.prototype.forEach.call(p.children,m=>{if(c.has(m))h(m);else try{if(gk(m))return;const f=m.getAttribute(i)==="true",b=(mi.get(m)||0)+1,g=(s.get(m)||0)+1;mi.set(m,b),s.set(m,g),l.push(m),b===1&&f&&cs.set(m,!0),g===1&&m.setAttribute(o,""),f||m.setAttribute(i,"true")}catch(f){console.error("[zag-js > ariaHidden] cannot operate on ",m,f)}})};return h(n),c.clear(),Yc++,()=>{l.forEach(p=>{const m=mi.get(p)-1,f=s.get(p)-1;mi.set(p,m),s.set(p,f),m||(cs.has(p)||p.removeAttribute(i),cs.delete(p)),f||p.removeAttribute(o)}),Yc--,Yc||(mi=new WeakMap,mi=new WeakMap,cs=new WeakMap,ds={})}},vk=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,bk=(e,t=vk(e),n="data-aria-hidden",o=!0)=>{if(t)return mk(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:o})},yk=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function xk(e,t={}){const{defer:n=!0}=t,o=n?yk:a=>a(),i=[];return i.push(o(()=>{const a=(typeof e=="function"?e():e).filter(Boolean);a.length!==0&&i.push(bk(a))})),()=>{i.forEach(a=>a?.())}}function wk(e){const t={each(n){var o;for(let i=0;i<((o=e.frames)==null?void 0:o.length);i+=1){const a=e.frames[i];a&&n(a)}},addEventListener(n,o,i){return t.each(a=>{try{a.document.addEventListener(n,o,i)}catch{}}),()=>{try{t.removeEventListener(n,o,i)}catch{}}},removeEventListener(n,o,i){t.each(a=>{try{a.document.removeEventListener(n,o,i)}catch{}})}};return t}function Ck(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,o,i)=>{try{t?.addEventListener(n,o,i)}catch{}return()=>{try{t?.removeEventListener(n,o,i)}catch{}}},removeEventListener:(n,o,i)=>{try{t?.removeEventListener(n,o,i)}catch{}}}}var Bp="pointerdown.outside",zp="focus.outside";function _k(e){for(const t of e)if(Be(t)&&Bn(t))return!0;return!1}var Rb=e=>"clientY"in e;function $k(e,t){if(!Rb(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 kk(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function Hp(e,t){if(!t||!Rb(e))return!1;const n=t.scrollHeight>t.clientHeight,o=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,a=i&&e.clientY>t.offsetTop+t.clientHeight,r={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},s={x:e.clientX,y:e.clientY};return kk(r,s)?o||a:!1}function Sk(e,t){const{exclude:n,onFocusOutside:o,onPointerDownOutside:i,onInteractOutside:a,defer:r,followControlledElements:s=!0}=t;if(!e)return;const l=Ot(e),c=Fe(e),d=wk(c),u=Ck(c);function h(x,C){if(!Be(C)||!C.isConnected||rt(e,C)||$k(e,x)||s&&Uv(e,C))return!1;const k=l.querySelector(`[aria-controls="${e.id}"]`);if(k){const P=Il(k);if(Hp(x,P))return!1}const O=Il(e);return Hp(x,O)?!1:!(n!=null&&n(C))}const p=new Set,m=Ui(e?.getRootNode());function f(x){function C(k){var O;const P=r&&!mp()?ae:A=>A(),$=k??x,I=((O=$?.composedPath)==null?void 0:O.call($))??[$?.target];P(()=>{const A=m?I[0]:Pe(x);if(!(!e||!h(x,A))){if(i||a){const M=xr(i,a);e.addEventListener(Bp,M,{once:!0})}jp(e,Bp,{bubbles:!1,cancelable:!0,detail:{originalEvent:$,contextmenu:rC($),focusable:_k(I),target:A}})}})}x.pointerType==="touch"?(p.forEach(k=>k()),p.add(ge(l,"click",C,{once:!0})),p.add(u.addEventListener("click",C,{once:!0})),p.add(d.addEventListener("click",C,{once:!0}))):C()}const b=new Set,g=setTimeout(()=>{b.add(ge(l,"pointerdown",f,!0)),b.add(u.addEventListener("pointerdown",f,!0)),b.add(d.addEventListener("pointerdown",f,!0))},0);function y(x){(r?ae:C=>C())(()=>{var C;const k=((C=x?.composedPath)==null?void 0:C.call(x))??[x?.target],O=m?k[0]:Pe(x);if(!(!e||!h(x,O))){if(o||a){const P=xr(o,a);e.addEventListener(zp,P,{once:!0})}jp(e,zp,{bubbles:!1,cancelable:!0,detail:{originalEvent:x,contextmenu:!1,focusable:Bn(O),target:O}})}})}return mp()||(b.add(ge(l,"focusin",y,!0)),b.add(u.addEventListener("focusin",y,!0)),b.add(d.addEventListener("focusin",y,!0))),()=>{clearTimeout(g),p.forEach(x=>x()),b.forEach(x=>x())}}function uh(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=typeof e=="function"?e():e;i.push(Sk(a,t))})),()=>{i.forEach(a=>a?.())}}function jp(e,t,n){const o=e.ownerDocument.defaultView||window,i=new o.CustomEvent(t,n);return e.dispatchEvent(i)}function Ek(e,t){const n=o=>{o.key==="Escape"&&(o.isComposing||t==null||t(o))};return ge(Ot(e),"keydown",n,{capture:!0})}var Wp="layer:request-dismiss",pt={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var t;const n=this.indexOf(e),o=this.topMostPointerBlockingLayer()?this.indexOf((t=this.topMostPointerBlockingLayer())==null?void 0:t.node):-1;return n<o},isTopMost(e){const t=this.layers[this.count()-1];return t?.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(o=>o.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(o=>o.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>rt(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>rt(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(n=>pt.dismiss(n.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)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const n=this.countNestedLayersOfType(e.node,e.type);n>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${n}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const o=this.layers[n];Tk(e,Wp,i=>{var a;(a=o.requestDismiss)==null||a.call(o,i),i.defaultPrevented||o==null||o.dismiss()}),Ok(e,Wp,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Ok(e,t,n){const o=e.ownerDocument.defaultView||window,i=new o.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(i)}function Tk(e,t,n){e.addEventListener(t,n,{once:!0})}var Up;function Gp(){pt.layers.forEach(({node:e})=>{e.style.pointerEvents=pt.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Ik(e){e.style.pointerEvents=""}function Pk(e,t){const n=Ot(e),o=[];return pt.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Up=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t?.forEach(i=>{const[a,r]=zC(()=>{const s=i();return Be(s)?s:null},{timeout:1e3});a.then(s=>o.push(ih(s,{pointerEvents:"auto"}))),o.push(r)}),()=>{pt.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=Up,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),o.forEach(i=>i()))}}function Vk(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Wn("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:o,onRequestDismiss:i,pointerBlocking:a,exclude:r,debug:s,type:l="dialog"}=t,c={dismiss:o,node:e,type:l,pointerBlocking:a,requestDismiss:i};pt.add(c),Gp();function d(f){var b,g;const y=Pe(f.detail.originalEvent);pt.isBelowPointerBlockingLayer(e)||pt.isInBranch(y)||((b=t.onPointerDownOutside)==null||b.call(t,f),(g=t.onInteractOutside)==null||g.call(t,f),!f.defaultPrevented&&(s&&console.log("onPointerDownOutside:",f.detail.originalEvent),o?.()))}function u(f){var b,g;const y=Pe(f.detail.originalEvent);pt.isInBranch(y)||((b=t.onFocusOutside)==null||b.call(t,f),(g=t.onInteractOutside)==null||g.call(t,f),!f.defaultPrevented&&(s&&console.log("onFocusOutside:",f.detail.originalEvent),o?.()))}function h(f){var b;pt.isTopMost(e)&&((b=t.onEscapeKeyDown)==null||b.call(t,f),!f.defaultPrevented&&o&&(f.preventDefault(),o()))}function p(f){var b;if(!e)return!1;const g=typeof r=="function"?r():r,y=Array.isArray(g)?g:[g],x=(b=t.persistentElements)==null?void 0:b.map(C=>C()).filter(Be);return x&&y.push(...x),y.some(C=>rt(C,f))||pt.isInNestedLayer(e,f)}const m=[a?Pk(e,t.persistentElements):void 0,Ek(e,h),uh(e,{exclude:p,onFocusOutside:u,onPointerDownOutside:d,defer:t.defer})];return()=>{pt.remove(e),Gp(),Ik(e),m.forEach(f=>f?.())}}function ia(e,t){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=ao(e)?e():e;i.push(Vk(a,t))})),()=>{i.forEach(a=>a?.())}}function Ab(e,t={}){const{defer:n}=t,o=n?ae:a=>a(),i=[];return i.push(o(()=>{const a=ao(e)?e():e;if(!a){Wn("[@zag-js/dismissable] branch node is `null` or `undefined`");return}pt.addBranch(a),i.push(()=>{pt.removeBranch(a)})})),()=>{i.forEach(a=>a?.())}}var Dk=Object.defineProperty,Mk=(e,t,n)=>t in e?Dk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ve=(e,t,n)=>Mk(e,typeof t!="symbol"?t+"":t,n),qp={activateTrap(e,t){if(e.length>0){const o=e[e.length-1];o!==t&&o.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Rk=[],Ak=class{constructor(t,n){Ve(this,"trapStack"),Ve(this,"config"),Ve(this,"doc"),Ve(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ve(this,"portalContainers",new Set),Ve(this,"listenerCleanups",[]),Ve(this,"handleFocus",i=>{const a=Pe(i),r=this.findContainerIndex(a,i)>=0;if(r||sc(a))r&&(this.state.mostRecentlyFocusedNode=a);else{i.stopImmediatePropagation();let s,l=!0;if(this.state.mostRecentlyFocusedNode)if(ga(this.state.mostRecentlyFocusedNode)>0){const c=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:d}=this.state.containerGroups[c];if(d.length>0){const u=d.findIndex(h=>h===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<d.length&&(s=d[u+1],l=!1):u-1>=0&&(s=d[u-1],l=!1))}}else this.state.containerGroups.some(c=>c.tabbableNodes.some(d=>ga(d)>0))||(l=!1);else l=!1;l&&(s=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),s?this.tryFocus(s):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ve(this,"handlePointerDown",i=>{const a=Pe(i);if(!(this.findContainerIndex(a,i)>=0)){if(ya(this.config.clickOutsideDeactivates,i)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ya(this.config.allowOutsideClick,i)||i.preventDefault()}}),Ve(this,"handleClick",i=>{const a=Pe(i);this.findContainerIndex(a,i)>=0||ya(this.config.clickOutsideDeactivates,i)||ya(this.config.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())}),Ve(this,"handleTabKey",i=>{if(this.config.isKeyForward(i)||this.config.isKeyBackward(i)){this.state.recentNavEvent=i;const a=this.config.isKeyBackward(i),r=this.findNextNavNode({event:i,isBackward:a});if(!r)return;ba(i)&&i.preventDefault(),this.tryFocus(r)}}),Ve(this,"handleEscapeKey",i=>{Fk(i)&&ya(this.config.escapeDeactivates,i)!==!1&&(i.preventDefault(),this.deactivate())}),Ve(this,"_mutationObserver"),Ve(this,"setupMutationObserver",()=>{const i=this.doc.defaultView||window;this._mutationObserver=new i.MutationObserver(a=>{a.some(r=>Array.from(r.removedNodes).some(s=>s===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),a.some(r=>r.type==="attributes"&&(r.attributeName==="aria-controls"||r.attributeName==="aria-expanded")?!0:r.type==="childList"&&r.addedNodes.length>0?Array.from(r.addedNodes).some(s=>{if(s.nodeType!==Node.ELEMENT_NODE)return!1;const l=s;return Y1(l)?!0:l.id&&!this.state.containers.some(c=>c.contains(l))?K1(l):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Ve(this,"updateObservedNodes",()=>{var i;(i=this._mutationObserver)==null||i.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(a=>{var r;(r=this._mutationObserver)==null||r.observe(a,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(a=>{this.observePortalContainer(a)}))}),Ve(this,"getInitialFocusNode",()=>{let i=this.getNodeForOption("initialFocus",{hasFallback:!0});if(i===!1)return!1;if(i===void 0||i&&!Bn(i)){const a=or(this.doc);if(a&&this.findContainerIndex(a)>=0)i=a;else{const r=this.state.tabbableGroups[0];i=r&&r.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else i===null&&(i=this.getNodeForOption("fallbackFocus"));if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i.isConnected||(i=this.getNodeForOption("fallbackFocus")),i}),Ve(this,"tryFocus",i=>{if(i!==!1&&i!==or(this.doc)){if(!i||!i.focus){this.tryFocus(this.getInitialFocusNode());return}i.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=i,Nk(i)&&i.select()}}),Ve(this,"deactivate",i=>{if(!this.state.active)return this;const a={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...i};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),qp.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const r=this.getOption(a,"onDeactivate"),s=this.getOption(a,"onPostDeactivate"),l=this.getOption(a,"checkCanReturnFocus"),c=this.getOption(a,"returnFocus","returnFocusOnDeactivate");r?.();const d=()=>{Yp(()=>{if(c){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}s?.()})};if(c&&l){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return l(u).then(d,d),this}return d(),this}),Ve(this,"pause",i=>{if(this.state.paused||!this.state.active)return this;const a=this.getOption(i,"onPause"),r=this.getOption(i,"onPostPause");return this.state.paused=!0,a?.(),this.removeListeners(),this.updateObservedNodes(),r?.(),this}),Ve(this,"unpause",i=>{if(!this.state.paused||!this.state.active)return this;const a=this.getOption(i,"onUnpause"),r=this.getOption(i,"onPostUnpause");return this.state.paused=!1,a?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r?.(),this}),Ve(this,"updateContainerElements",i=>(this.state.containers=Array.isArray(i)?i.filter(Boolean):[i].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ve(this,"getReturnFocusNode",i=>{const a=this.getNodeForOption("setReturnFocus",{params:[i]});return a||(a===!1?!1:i)}),Ve(this,"getOption",(i,a,r)=>i&&i[a]!==void 0?i[a]:this.config[r||a]),Ve(this,"getNodeForOption",(i,{hasFallback:a=!1,params:r=[]}={})=>{let s=this.config[i];if(typeof s=="function"&&(s=s(...r)),s===!0&&(s=void 0),!s){if(s===void 0||s===!1)return s;throw new Error(`\`${i}\` was specified but was not a node, or did not return a node`)}let l=s;if(typeof s=="string"){try{l=this.doc.querySelector(s)}catch(c){throw new Error(`\`${i}\` appears to be an invalid selector; error="${c.message}"`)}if(!l&&!a)throw new Error(`\`${i}\` as selector refers to no known node`)}return l}),Ve(this,"findNextNavNode",i=>{const{event:a,isBackward:r=!1}=i,s=i.target||Pe(a);this.updateTabbableNodes();let l=null;if(this.state.tabbableGroups.length>0){const c=this.findContainerIndex(s,a),d=c>=0?this.state.containerGroups[c]:void 0;if(c<0)r?l=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:l=this.state.tabbableGroups[0].firstTabbableNode;else if(r){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:h})=>s===h);if(u<0&&(d?.container===s||Bn(s)&&!Lo(s)&&!(d!=null&&d.nextTabbableNode(s,!1)))&&(u=c),u>=0){const h=u===0?this.state.tabbableGroups.length-1:u-1,p=this.state.tabbableGroups[h];l=ga(s)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else ba(a)||(l=d?.nextTabbableNode(s,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:h})=>s===h);if(u<0&&(d?.container===s||Bn(s)&&!Lo(s)&&!(d!=null&&d.nextTabbableNode(s)))&&(u=c),u>=0){const h=u===this.state.tabbableGroups.length-1?0:u+1,p=this.state.tabbableGroups[h];l=ga(s)>=0?p.firstTabbableNode:p.firstDomTabbableNode}else ba(a)||(l=d?.nextTabbableNode(s))}}else l=this.getNodeForOption("fallbackFocus");return l}),this.trapStack=n.trapStack||Rk;const o={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(i){return ba(i)&&!i.shiftKey},isKeyBackward(i){return ba(i)&&i.shiftKey},...n};this.doc=o.document||Ot(Array.isArray(t)?t[0]:t),this.config=o,this.updateContainerElements(t),this.setupMutationObserver()}addPortalContainer(t){const n=t.parentElement;n&&!this.portalContainers.has(n)&&(this.portalContainers.add(n),this.state.active&&!this.state.paused&&this.observePortalContainer(n))}observePortalContainer(t){var n;(n=this._mutationObserver)==null||n.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(t=>{U1(t).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(t,n){const o=typeof n?.composedPath=="function"?n.composedPath():void 0;return this.state.containerGroups.findIndex(({container:i,tabbableNodes:a})=>i.contains(t)||o?.includes(i)||a.find(r=>r===t)||this.isControlledElement(i,t))}isControlledElement(t,n){return this.config.followControlledElements?Uv(t,n):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(t=>{const n=Fr(t,{getShadowRoot:this.config.getShadowRoot}),o=tb(t,{getShadowRoot:this.config.getShadowRoot}),i=n[0],a=n[n.length-1],r=i,s=a;let l=!1;for(let d=0;d<n.length;d++)if(ga(n[d])>0){l=!0;break}function c(d,u=!0){const h=n.indexOf(d);if(h>=0)return n[h+(u?1:-1)];const p=o.indexOf(d);if(!(p<0)){if(u){for(let m=p+1;m<o.length;m++)if(Lo(o[m]))return o[m]}else for(let m=p-1;m>=0;m--)if(Lo(o[m]))return o[m]}}return{container:t,tabbableNodes:n,focusableNodes:o,posTabIndexesFound:l,firstTabbableNode:i,lastTabbableNode:a,firstDomTabbableNode:r,lastDomTabbableNode:s,nextTabbableNode:c}}),this.state.tabbableGroups=this.state.containerGroups.filter(t=>t.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(t=>t.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return qp.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Yp(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(ge(this.doc,"focusin",this.handleFocus,!0),ge(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),ge(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),ge(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),ge(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),ge(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(t=>t()),this.listenerCleanups=[],this}activate(t){if(this.state.active)return this;const n=this.getOption(t,"onActivate"),o=this.getOption(t,"onPostActivate"),i=this.getOption(t,"checkCanFocusTrap");i||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=or(this.doc),n?.();const a=()=>{i&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),o?.()};return i?(i(this.state.containers.concat()).then(a,a),this):(a(),this)}},ba=e=>e.key==="Tab",ya=(e,...t)=>typeof e=="function"?e(...t):e,Fk=e=>!e.isComposing&&e.key==="Escape",Yp=e=>setTimeout(e,0),Nk=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function Lk(e,t={}){let n;const o=ae(()=>{const i=typeof e=="function"?e():e;if(i){n=new Ak(i,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...t,document:Ot(i)});try{n.activate()}catch{}}});return function(){n?.deactivate(),o()}}var Bk=le("bottom-sheet").parts("content","title","trigger","backdrop","grabber","grabberIndicator","closeTrigger");Bk.build();ee()(["id","ids","dir","modal","initialFocusEl","finalFocusEl","open","defaultOpen","getRootNode","snapPoints","swipeVelocityThreshold","closeThreshold","preventDragOnScroll","closeOnEscape","closeOnInteractOutside","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","preventScroll","restoreFocus","role","trapFocus","defaultActiveSnapPoint","activeSnapPoint","onActiveSnapPointChange"]);var zk=le("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger");zk.build();ee()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]);ee()(["index","readOnly"]);ee()(["index","snapAlign"]);const[Fb,Gr]=xe("CheckboxContext"),Hk=E({__name:"checkbox-context",setup(e){const t=Gr();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),jk=E({__name:"checkbox-control",props:{asChild:{type:Boolean}},setup(e){const t=Gr();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getControlProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}});function Wk(e){return!(e.metaKey||!dc()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var Uk=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Gk(e,t,n){const o=n?Pe(n):null,i=Fe(o);return e=e||o instanceof i.HTMLInputElement&&!Uk.has(o?.type)||o instanceof i.HTMLTextAreaElement||o instanceof i.HTMLElement&&o.isContentEditable,!(e&&t==="keyboard"&&n instanceof i.KeyboardEvent&&!Reflect.has(qk,n.key))}var _o=null,Wd=new Set,Al=new Map,Jo=!1,Ud=!1,qk={Tab:!0,Escape:!0};function wc(e,t){for(let n of Wd)n(e,t)}function Fl(e){Jo=!0,Wk(e)&&(_o="keyboard",wc("keyboard",e))}function Bt(e){_o="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Jo=!0,wc("pointer",e))}function Nb(e){aC(e)&&(Jo=!0,_o="virtual")}function Lb(e){const t=Pe(e);t===Fe(t)||t===Ot(t)||(!Jo&&!Ud&&(_o="virtual",wc("virtual",e)),Jo=!1,Ud=!1)}function Bb(){Jo=!1,Ud=!0}function Yk(e){if(typeof window>"u"||Al.get(Fe(e)))return;const t=Fe(e),n=Ot(e);let o=t.HTMLElement.prototype.focus;function i(){_o="virtual",wc("virtual",null),Jo=!0,o.apply(this,arguments)}try{Object.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}n.addEventListener("keydown",Fl,!0),n.addEventListener("keyup",Fl,!0),n.addEventListener("click",Nb,!0),t.addEventListener("focus",Lb,!0),t.addEventListener("blur",Bb,!1),typeof t.PointerEvent<"u"?(n.addEventListener("pointerdown",Bt,!0),n.addEventListener("pointermove",Bt,!0),n.addEventListener("pointerup",Bt,!0)):(n.addEventListener("mousedown",Bt,!0),n.addEventListener("mousemove",Bt,!0),n.addEventListener("mouseup",Bt,!0)),t.addEventListener("beforeunload",()=>{Kk(e)},{once:!0}),Al.set(t,{focus:o})}var Kk=(e,t)=>{const n=Fe(e),o=Ot(e),i=Al.get(n);if(i){try{Object.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}o.removeEventListener("keydown",Fl,!0),o.removeEventListener("keyup",Fl,!0),o.removeEventListener("click",Nb,!0),n.removeEventListener("focus",Lb,!0),n.removeEventListener("blur",Bb,!1),typeof n.PointerEvent<"u"?(o.removeEventListener("pointerdown",Bt,!0),o.removeEventListener("pointermove",Bt,!0),o.removeEventListener("pointerup",Bt,!0)):(o.removeEventListener("mousedown",Bt,!0),o.removeEventListener("mousemove",Bt,!0),o.removeEventListener("mouseup",Bt,!0)),Al.delete(n)}};function Xk(){return _o}function wr(){return _o==="keyboard"}function Cc(e={}){const{isTextInput:t,autoFocus:n,onChange:o,root:i}=e;Yk(i),o?.({isFocusVisible:n||wr(),modality:_o});const a=(r,s)=>{Gk(!!t,r,s)&&o?.({isFocusVisible:wr(),modality:r})};return Wd.add(a),()=>{Wd.delete(a)}}var zb=le("checkbox").parts("root","label","control","indicator"),us=zb.build(),Hb=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`checkbox:${e.id}`},Kp=e=>{var t;return((t=e.ids)==null?void 0:t.label)??`checkbox:${e.id}:label`},Zk=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`checkbox:${e.id}:control`},Gd=e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`checkbox:${e.id}:input`},Jk=e=>e.getById(Hb(e)),Ya=e=>e.getById(Gd(e));function Qk(e,t){const{send:n,context:o,prop:i,computed:a,scope:r}=e,s=!!i("disabled"),l=!!i("readOnly"),c=!!i("required"),d=!!i("invalid"),u=!s&&o.get("focused"),h=!s&&o.get("focusVisible"),p=a("checked"),m=a("indeterminate"),f=o.get("checked"),b={"data-active":V(o.get("active")),"data-focus":V(u),"data-focus-visible":V(h),"data-readonly":V(l),"data-hover":V(o.get("hovered")),"data-disabled":V(s),"data-state":m?"indeterminate":p?"checked":"unchecked","data-invalid":V(d),"data-required":V(c)};return{checked:p,disabled:s,indeterminate:m,focused:u,checkedState:f,setChecked(g){n({type:"CHECKED.SET",checked:g,isTrusted:!1})},toggleChecked(){n({type:"CHECKED.TOGGLE",checked:p,isTrusted:!1})},getRootProps(){return t.label({...us.root.attrs,...b,dir:i("dir"),id:Hb(r),htmlFor:Gd(r),onPointerMove(){s||n({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){s||n({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(g){Pe(g)===Ya(r)&&g.stopPropagation()}})},getLabelProps(){return t.element({...us.label.attrs,...b,dir:i("dir"),id:Kp(r)})},getControlProps(){return t.element({...us.control.attrs,...b,dir:i("dir"),id:Zk(r),"aria-hidden":!0})},getIndicatorProps(){return t.element({...us.indicator.attrs,...b,dir:i("dir"),hidden:!m&&!p})},getHiddenInputProps(){return t.input({id:Gd(r),type:"checkbox",required:i("required"),defaultChecked:p,disabled:s,"aria-labelledby":Kp(r),"aria-invalid":d,name:i("name"),form:i("form"),value:i("value"),style:gc,onFocus(){const g=wr();n({type:"CONTEXT.SET",context:{focused:!0,focusVisible:g}})},onBlur(){n({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(g){if(l){g.preventDefault();return}const y=g.currentTarget.checked;n({type:"CHECKED.SET",checked:y,isTrusted:!0})}})}}}var{not:Xp}=et(),eS={props({props:e}){return{value:"on",...e,defaultChecked:e.defaultChecked??!1}},initialState(){return"ready"},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e("defaultChecked"),value:e("checked"),onChange(n){var o;(o=e("onCheckedChange"))==null||o({checked:n})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:o}){e([()=>n("disabled")],()=>{o(["removeFocusIfNeeded"])}),e([()=>t.get("checked")],()=>{o(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:Xp("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Xp("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:e})=>el(e.get("checked")),checked:({context:e})=>tS(e.get("checked")),disabled:({context:e,prop:t})=>!!t("disabled")||e.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t("disabled"))return cb({pointerNode:Jk(n),keyboardNode:Ya(n),isValidKey:o=>o.key===" ",onPress:()=>e.set("active",!1),onPressStart:()=>e.set("active",!0),onPressEnd:()=>e.set("active",!1)})},trackFocusVisible({computed:e,scope:t}){var n;if(!e("disabled"))return Cc({root:(n=t.getRootNode)==null?void 0:n.call(t)})},trackFormControlState({context:e,scope:t}){return oa(Ya(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("checked",e.initial("checked"))}})}},actions:{setContext({context:e,event:t}){for(const n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){const o=Ya(n);o&&(Zu(o,t("checked")),o.indeterminate=el(e.get("checked")))},removeFocusIfNeeded({context:e,prop:t}){t("disabled")&&e.get("focused")&&(e.set("focused",!1),e.set("focusVisible",!1))},setChecked({context:e,event:t}){e.set("checked",t.checked)},toggleChecked({context:e,computed:t}){const n=el(t("checked"))?!0:!t("checked");e.set("checked",n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{const n=Ya(t);Zv(n,{checked:e("checked")})})}}}};function el(e){return e==="indeterminate"}function tS(e){return el(e)?!1:!!e}ee()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);const hh=zb.extendWith("group");function nS(e,t,n,o={}){var i,a,r;const{passive:s=!1,eventName:l,defaultValue:c}=o,d=Vr(),u=n||d?.emit||((i=d?.$emit)==null?void 0:i.bind(d))||((r=(a=d?.proxy)==null?void 0:a.$emit)==null?void 0:r.bind(d?.proxy)),h=t,p=()=>e[h]??c,m=f=>{if(!l)u(l||`update:${h.toString()}`,f);else for(const b of l)u(b,f)};if(s){const f=p(),b=he(f);let g=!1;return Ae(()=>e[h],y=>{g||(g=!0,b.value=y,po(()=>{g=!1}))}),Ae(b,y=>{!g&&y!==e[h]&&m(y)}),b}return T({get(){return p()},set(f){m(f)}})}function oS(e,t){const n=T(()=>!(e.disabled||e.readOnly)),{defaultValue:o}=Vw(e),i=nS(e,"modelValue",t,{defaultValue:o?.value??[],passive:e.modelValue===void 0,eventName:["valueChange","update:modelValue"]}),a=u=>i.value.some(h=>String(h)===String(u)),r=u=>{a(u)?l(u):s(u)},s=u=>{n.value&&(a(u)||(i.value=i.value.concat(u)))},l=u=>{n.value&&(i.value=i.value.filter(h=>String(h)!==String(u)))},c=u=>({checked:u.value!=null?a(u.value):void 0,onCheckedChange(){u.value!=null&&r(u.value)},name:e.name,disabled:e.disabled,readOnly:e.readOnly,invalid:e.invalid}),d=u=>{i.value=u};return T(()=>({isChecked:a,value:i.value,name:e.name,disabled:e.disabled,readOnly:e.readOnly,invalid:e.invalid,addValue:s,setValue:d,toggleValue:r,getItemProps:c}))}const[jb,iS]=xe("CheckboxGroupContext"),aS=E({__name:"checkbox-group",props:jt({defaultValue:{},modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},name:{},invalid:{type:Boolean},asChild:{type:Boolean}},{disabled:void 0,readOnly:void 0,invalid:void 0}),emits:["valueChange","update:modelValue"],setup(e,{emit:t}){const n=oS(e,t);return jb(n),q(),(o,i)=>(w(),S(v(Y).div,F({role:"group"},{...v(hh).build().group.attrs},{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),rS=E({__name:"checkbox-group-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return jb(n),q(),(o,i)=>(w(),S(v(Y).div,F({role:"group"},v(hh).build().group.attrs,{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),sS=E({__name:"checkbox-hidden-input",props:{asChild:{type:Boolean}},setup(e){const t=Gr(),n=wn();return q(),(o,i)=>{var a;return w(),S(v(Y).input,F({"aria-describedby":(a=v(n))==null?void 0:a.ariaDescribedby},v(t).getHiddenInputProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["aria-describedby","as-child"])}}}),lS=E({__name:"checkbox-indicator",props:{indeterminate:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=Gr(),o=T(()=>t.indeterminate?n.value.indeterminate:n.value.checked);return q(),(i,a)=>(w(),S(v(Y).div,F(v(n).getIndicatorProps(),{hidden:!o.value,"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["hidden","as-child"]))}}),cS=E({__name:"checkbox-label",props:{asChild:{type:Boolean}},setup(e){const t=Gr();return q(),(n,o)=>(w(),S(v(Y).span,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),dS=E({__name:"checkbox-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return Fb(n),q(),(o,i)=>(w(),S(v(Y).label,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),uS=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=wn(),r=iS(),s=T(()=>{const d=Re(e);return Br(d,r?.value.getItemProps({value:d.value})??{})}),l=T(()=>{const d=Re(s);return{id:n,ids:{label:a?.value.ids.label,hiddenInput:a?.value.ids.control},disabled:a?.value.disabled,readOnly:a?.value.readOnly,invalid:a?.value.invalid,required:a?.value.required,dir:i.value.dir,getRootNode:o?.value.getRootNode,...an(d),onCheckedChange(u){var h;t?.("checkedChange",u),t?.("update:checked",u.checked),(h=d.onCheckedChange)==null||h.call(d,u)}}}),c=bt(eS,l);return T(()=>Qk(c,Tt))},hS=E({__name:"checkbox-root",props:jt({checked:{},defaultChecked:{},disabled:{type:Boolean},form:{},id:{},ids:{},invalid:{type:Boolean},name:{},readOnly:{type:Boolean},required:{type:Boolean},value:{},asChild:{type:Boolean}},{checked:void 0,defaultChecked:void 0,disabled:void 0,invalid:void 0,readOnly:void 0,required:void 0}),emits:["checkedChange","update:checked"],setup(e,{emit:t}){const n=uS(e,t);return Fb(n),q(),(o,i)=>(w(),S(v(Y).label,F(v(n).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),vi=Object.freeze(Object.defineProperty({__proto__:null,Context:Hk,Control:jk,Group:aS,GroupProvider:rS,HiddenInput:sS,Indicator:lS,Label:cS,Root:hS,RootProvider:dS},Symbol.toStringTag,{value:"Module"}));var pS=le("clipboard").parts("root","control","trigger","indicator","input","label");pS.build();ee()(["getRootNode","id","ids","value","defaultValue","timeout","onStatusChange","onValueChange"]);ee()(["copied"]);var fS=Object.defineProperty,gS=(e,t,n)=>t in e?fS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t,n)=>gS(e,typeof t!="symbol"?t+"":t,n),tl={itemToValue(e){return typeof e=="string"?e:Bo(e)&&ro(e,"value")?e.value:""},itemToString(e){return typeof e=="string"?e:Bo(e)&&ro(e,"label")?e.label:tl.itemToValue(e)},isItemDisabled(e){return Bo(e)&&ro(e,"disabled")?!!e.disabled:!1}},si=class Wb{constructor(t){this.options=t,K(this,"items"),K(this,"indexMap",null),K(this,"copy",n=>new Wb({...this.options,items:n??[...this.items]})),K(this,"isEqual",n=>Je(this.items,n.items)),K(this,"setItems",n=>this.copy(n)),K(this,"getValues",(n=this.items)=>{const o=[];for(const i of n){const a=this.getItemValue(i);a!=null&&o.push(a)}return o}),K(this,"find",n=>{if(n==null)return null;const o=this.indexOf(n);return o!==-1?this.at(o):null}),K(this,"findMany",n=>{const o=[];for(const i of n){const a=this.find(i);a!=null&&o.push(a)}return o}),K(this,"at",n=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[n]??null;let o=0;const i=this.group();for(const[,a]of i)for(const r of a){if(o===n)return r;o++}return null}),K(this,"sortFn",(n,o)=>{const i=this.indexOf(n),a=this.indexOf(o);return(i??0)-(a??0)}),K(this,"sort",n=>[...n].sort(this.sortFn.bind(this))),K(this,"getItemValue",n=>{var o,i;return n==null?null:((i=(o=this.options).itemToValue)==null?void 0:i.call(o,n))??tl.itemToValue(n)}),K(this,"getItemDisabled",n=>{var o,i;return n==null?!1:((i=(o=this.options).isItemDisabled)==null?void 0:i.call(o,n))??tl.isItemDisabled(n)}),K(this,"stringifyItem",n=>{var o,i;return n==null?null:((i=(o=this.options).itemToString)==null?void 0:i.call(o,n))??tl.itemToString(n)}),K(this,"stringify",n=>n==null?null:this.stringifyItem(this.find(n))),K(this,"stringifyItems",(n,o=", ")=>{const i=[];for(const a of n){const r=this.stringifyItem(a);r!=null&&i.push(r)}return i.join(o)}),K(this,"stringifyMany",(n,o)=>this.stringifyItems(this.findMany(n),o)),K(this,"has",n=>this.indexOf(n)!==-1),K(this,"hasItem",n=>n==null?!1:this.has(this.getItemValue(n))),K(this,"group",()=>{const{groupBy:n,groupSort:o}=this.options;if(!n)return[["",[...this.items]]];const i=new Map;this.items.forEach((r,s)=>{const l=n(r,s);i.has(l)||i.set(l,[]),i.get(l).push(r)});let a=Array.from(i.entries());return o&&a.sort(([r],[s])=>{if(typeof o=="function")return o(r,s);if(Array.isArray(o)){const l=o.indexOf(r),c=o.indexOf(s);return l===-1?1:c===-1?-1:l-c}return o==="asc"?r.localeCompare(s):o==="desc"?s.localeCompare(r):0}),a}),K(this,"getNextValue",(n,o=1,i=!1)=>{let a=this.indexOf(n);if(a===-1)return null;for(a=i?Math.min(a+o,this.size-1):a+o;a<=this.size&&this.getItemDisabled(this.at(a));)a++;return this.getItemValue(this.at(a))}),K(this,"getPreviousValue",(n,o=1,i=!1)=>{let a=this.indexOf(n);if(a===-1)return null;for(a=i?Math.max(a-o,0):a-o;a>=0&&this.getItemDisabled(this.at(a));)a--;return this.getItemValue(this.at(a))}),K(this,"indexOf",n=>{if(n==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(o=>this.getItemValue(o)===n);if(!this.indexMap){this.indexMap=new Map;let o=0;const i=this.group();for(const[,a]of i)for(const r of a){const s=this.getItemValue(r);s!=null&&this.indexMap.set(s,o),o++}}return this.indexMap.get(n)??-1}),K(this,"getByText",(n,o)=>{const i=o!=null?this.indexOf(o):-1,a=n.length===1;for(let r=0;r<this.items.length;r++){const s=this.items[(i+r+1)%this.items.length];if(!(a&&this.getItemValue(s)===o)&&!this.getItemDisabled(s)&&mS(this.stringifyItem(s),n))return s}}),K(this,"search",(n,o)=>{const{state:i,currentValue:a,timeout:r=350}=o,s=i.keysSoFar+n,l=s.length>1&&Array.from(s).every(p=>p===s[0])?s[0]:s,c=this.getByText(l,a),d=this.getItemValue(c);function u(){clearTimeout(i.timer),i.timer=-1}function h(p){i.keysSoFar=p,u(),p!==""&&(i.timer=+setTimeout(()=>{h(""),u()},r))}return h(s),d}),K(this,"update",(n,o)=>{let i=this.indexOf(n);return i===-1?this:this.copy([...this.items.slice(0,i),o,...this.items.slice(i+1)])}),K(this,"upsert",(n,o,i="append")=>{let a=this.indexOf(n);return a===-1?(i==="append"?this.append:this.prepend)(o):this.copy([...this.items.slice(0,a),o,...this.items.slice(a+1)])}),K(this,"insert",(n,...o)=>this.copy(xa(this.items,n,...o))),K(this,"insertBefore",(n,...o)=>{let i=this.indexOf(n);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(xa(this.items,i,...o))}),K(this,"insertAfter",(n,...o)=>{let i=this.indexOf(n);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(xa(this.items,i+1,...o))}),K(this,"prepend",(...n)=>this.copy(xa(this.items,0,...n))),K(this,"append",(...n)=>this.copy(xa(this.items,this.items.length,...n))),K(this,"filter",n=>{const o=this.items.filter((i,a)=>n(this.stringifyItem(i),a,i));return this.copy(o)}),K(this,"remove",(...n)=>{const o=n.map(i=>typeof i=="string"?i:this.getItemValue(i));return this.copy(this.items.filter(i=>{const a=this.getItemValue(i);return a==null?!1:!o.includes(a)}))}),K(this,"move",(n,o)=>{const i=this.indexOf(n);return i===-1?this:this.copy(hs(this.items,[i],o))}),K(this,"moveBefore",(n,...o)=>{let i=this.items.findIndex(r=>this.getItemValue(r)===n);if(i===-1)return this;let a=o.map(r=>this.items.findIndex(s=>this.getItemValue(s)===r)).sort((r,s)=>r-s);return this.copy(hs(this.items,a,i))}),K(this,"moveAfter",(n,...o)=>{let i=this.items.findIndex(r=>this.getItemValue(r)===n);if(i===-1)return this;let a=o.map(r=>this.items.findIndex(s=>this.getItemValue(s)===r)).sort((r,s)=>r-s);return this.copy(hs(this.items,a,i+1))}),K(this,"reorder",(n,o)=>this.copy(hs(this.items,[n],o))),K(this,"compareValue",(n,o)=>{const i=this.indexOf(n),a=this.indexOf(o);return i<a?-1:i>a?1:0}),K(this,"range",(n,o)=>{let i=[],a=n;for(;a!=null;){if(this.find(a)&&i.push(a),a===o)return i;a=this.getNextValue(a)}return[]}),K(this,"getValueRange",(n,o)=>n&&o?this.compareValue(n,o)<=0?this.range(n,o):this.range(o,n):[]),K(this,"toString",()=>{let n="";for(const o of this.items){const i=this.getItemValue(o),a=this.stringifyItem(o),r=this.getItemDisabled(o),s=[i,a,r].filter(Boolean).join(":");n+=s+","}return n}),K(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let t=0;for(;this.getItemDisabled(this.at(t));)t++;return this.getItemValue(this.at(t))}get lastValue(){let t=this.size-1;for(;this.getItemDisabled(this.at(t));)t--;return this.getItemValue(this.at(t))}*[Symbol.iterator](){yield*this.items}},mS=(e,t)=>!!(e!=null&&e.toLowerCase().startsWith(t.toLowerCase()));function xa(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function hs(e,t,n){t=[...t].sort((i,a)=>i-a);const o=t.map(i=>e[i]);for(let i=t.length-1;i>=0;i--)e=[...e.slice(0,t[i]),...e.slice(t[i]+1)];return n=Math.max(0,n-t.filter(i=>i<n).length),[...e.slice(0,n),...o,...e.slice(n)]}var vS=class nl extends Set{constructor(t=[]){super(t),K(this,"selectionMode","single"),K(this,"deselectable",!0),K(this,"copy",()=>{const n=new nl([...this]);return this.sync(n)}),K(this,"sync",n=>(n.selectionMode=this.selectionMode,n.deselectable=this.deselectable,n)),K(this,"isEmpty",()=>this.size===0),K(this,"isSelected",n=>this.selectionMode==="none"||n==null?!1:this.has(n)),K(this,"canSelect",(n,o)=>this.selectionMode!=="none"||!n.getItemDisabled(n.find(o))),K(this,"firstSelectedValue",n=>{let o=null;for(let i of this)(!o||n.compareValue(i,o)<0)&&(o=i);return o}),K(this,"lastSelectedValue",n=>{let o=null;for(let i of this)(!o||n.compareValue(i,o)>0)&&(o=i);return o}),K(this,"extendSelection",(n,o,i)=>{if(this.selectionMode==="none")return this;if(this.selectionMode==="single")return this.replaceSelection(n,i);const a=this.copy(),r=Array.from(this).pop();for(let s of n.getValueRange(o,r??i))a.delete(s);for(let s of n.getValueRange(i,o))this.canSelect(n,s)&&a.add(s);return a}),K(this,"toggleSelection",(n,o)=>{if(this.selectionMode==="none")return this;if(this.selectionMode==="single"&&!this.isSelected(o))return this.replaceSelection(n,o);const i=this.copy();return i.has(o)?i.delete(o):i.canSelect(n,o)&&i.add(o),i}),K(this,"replaceSelection",(n,o)=>{if(this.selectionMode==="none")return this;if(o==null)return this;if(!this.canSelect(n,o))return this;const i=new nl([o]);return this.sync(i)}),K(this,"setSelection",n=>{if(this.selectionMode==="none")return this;let o=new nl;for(let i of n)if(i!=null&&(o.add(i),this.selectionMode==="single"))break;return this.sync(o)}),K(this,"clearSelection",()=>{const n=this.copy();return n.deselectable&&n.size>0&&n.clear(),n}),K(this,"select",(n,o,i)=>this.selectionMode==="none"?this:this.selectionMode==="single"?this.isSelected(o)&&this.deselectable?this.toggleSelection(n,o):this.replaceSelection(n,o):this.selectionMode==="multiple"||i?this.toggleSelection(n,o):this.replaceSelection(n,o)),K(this,"deselect",n=>{const o=this.copy();return o.delete(n),o}),K(this,"isEqual",n=>Je(Array.from(this),Array.from(n)))}};function Ub(e,t,n){for(let o=0;o<t.length;o++)e=n.getChildren(e,t.slice(o+1))[t[o]];return e}function bS(e){const t=yS(e),n=[],o=new Set;for(const i of t){const a=i.join();o.has(a)||(o.add(a),n.push(i))}return n}function Gb(e,t){for(let n=0;n<Math.min(e.length,t.length);n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return e.length-t.length}function yS(e){return e.sort(Gb)}function xS(e,t){let n;return wt(e,{...t,onEnter:(o,i)=>{if(t.predicate(o,i))return n=o,"stop"}}),n}function wS(e,t){const n=[];return wt(e,{onEnter:(o,i)=>{t.predicate(o,i)&&n.push(o)},getChildren:t.getChildren}),n}function Zp(e,t){let n;return wt(e,{onEnter:(o,i)=>{if(t.predicate(o,i))return n=[...i],"stop"},getChildren:t.getChildren}),n}function CS(e,t){let n=t.initialResult;return wt(e,{...t,onEnter:(o,i)=>{n=t.nextResult(n,o,i)}}),n}function _S(e,t){return CS(e,{...t,initialResult:[],nextResult:(n,o,i)=>(n.push(...t.transform(o,i)),n)})}function $S(e,t){const{predicate:n,create:o,getChildren:i}=t,a=(r,s)=>{const l=i(r,s),c=[];l.forEach((p,m)=>{const f=[...s,m],b=a(p,f);b&&c.push(b)});const d=s.length===0,u=n(r,s),h=c.length>0;return d||u||h?o(r,c,s):null};return a(e,[])||o(e,[],[])}function kS(e,t){const n=[];let o=0;const i=new Map,a=new Map;return wt(e,{getChildren:t.getChildren,onEnter:(r,s)=>{i.has(r)||i.set(r,o++);const l=t.getChildren(r,s);l.forEach(p=>{a.has(p)||a.set(p,r),i.has(p)||i.set(p,o++)});const c=l.length>0?l.map(p=>i.get(p)):void 0,d=a.get(r),u=d?i.get(d):void 0,h=i.get(r);n.push({...r,_children:c,_parent:u,_index:h})}}),n}function SS(e,t){return{type:"insert",index:e,nodes:t}}function ES(e){return{type:"remove",indexes:e}}function ph(){return{type:"replace"}}function qb(e){return[e.slice(0,-1),e[e.length-1]]}function Yb(e,t,n=new Map){var o;const[i,a]=qb(e);for(let s=i.length-1;s>=0;s--){const l=i.slice(0,s).join();switch((o=n.get(l))==null?void 0:o.type){case"remove":continue}n.set(l,ph())}const r=n.get(i.join());switch(r?.type){case"remove":n.set(i.join(),{type:"removeThenInsert",removeIndexes:r.indexes,insertIndex:a,insertNodes:t});break;default:n.set(i.join(),SS(a,t))}return n}function Kb(e){const t=new Map,n=new Map;for(const o of e){const i=o.slice(0,-1).join(),a=n.get(i)??[];a.push(o[o.length-1]),n.set(i,a.sort((r,s)=>r-s))}for(const o of e)for(let i=o.length-2;i>=0;i--){const a=o.slice(0,i).join();t.has(a)||t.set(a,ph())}for(const[o,i]of n)t.set(o,ES(i));return t}function OS(e,t){const n=new Map,[o,i]=qb(e);for(let a=o.length-1;a>=0;a--){const r=o.slice(0,a).join();n.set(r,ph())}return n.set(o.join(),{type:"removeThenInsert",removeIndexes:[i],insertIndex:i,insertNodes:[t]}),n}function _c(e,t,n){return TS(e,{...n,getChildren:(o,i)=>{const a=i.join(),r=t.get(a);switch(r?.type){case"replace":case"remove":case"removeThenInsert":case"insert":return n.getChildren(o,i);default:return[]}},transform:(o,i,a)=>{const r=a.join(),s=t.get(r);switch(s?.type){case"remove":return n.create(o,i.filter((d,u)=>!s.indexes.includes(u)),a);case"removeThenInsert":const l=i.filter((d,u)=>!s.removeIndexes.includes(u)),c=s.removeIndexes.reduce((d,u)=>u<d?d-1:d,s.insertIndex);return n.create(o,Jp(l,c,0,...s.insertNodes),a);case"insert":return n.create(o,Jp(i,s.index,0,...s.nodes),a);case"replace":return n.create(o,i,a);default:return o}}})}function Jp(e,t,n,...o){return[...e.slice(0,t),...o,...e.slice(t+n)]}function TS(e,t){const n={};return wt(e,{...t,onLeave:(o,i)=>{const a=[0,...i],r=a.join(),s=t.transform(o,n[r]??[],i),l=a.slice(0,-1).join(),c=n[l]??[];c.push(s),n[l]=c}}),n[""][0]}function IS(e,t){const{nodes:n,at:o}=t;if(o.length===0)throw new Error("Can't insert nodes at the root");const i=Yb(o,n);return _c(e,i,t)}function PS(e,t){if(t.at.length===0)return t.node;const n=OS(t.at,t.node);return _c(e,n,t)}function VS(e,t){if(t.indexPaths.length===0)return e;for(const o of t.indexPaths)if(o.length===0)throw new Error("Can't remove the root node");const n=Kb(t.indexPaths);return _c(e,n,t)}function DS(e,t){if(t.indexPaths.length===0)return e;for(const a of t.indexPaths)if(a.length===0)throw new Error("Can't move the root node");if(t.to.length===0)throw new Error("Can't move nodes to the root");const n=bS(t.indexPaths),o=n.map(a=>Ub(e,a,t)),i=Yb(t.to,o,Kb(n));return _c(e,i,t)}function wt(e,t){const{onEnter:n,onLeave:o,getChildren:i}=t;let a=[],r=[{node:e}];const s=t.reuseIndexPath?()=>a:()=>a.slice();for(;r.length>0;){let l=r[r.length-1];if(l.state===void 0){const d=n?.(l.node,s());if(d==="stop")return;l.state=d==="skip"?-1:0}const c=l.children||i(l.node,s());if(l.children||(l.children=c),l.state!==-1){if(l.state<c.length){let d=l.state;a.push(d),r.push({node:c[d]}),l.state=d+1;continue}if(o?.(l.node,s())==="stop")return}a.pop(),r.pop()}}var fh=class Xb{constructor(t){this.options=t,K(this,"rootNode"),K(this,"isEqual",n=>Je(this.rootNode,n.rootNode)),K(this,"getNodeChildren",n=>{var o,i;return((i=(o=this.options).nodeToChildren)==null?void 0:i.call(o,n))??Oi.nodeToChildren(n)??[]}),K(this,"resolveIndexPath",n=>typeof n=="string"?this.getIndexPath(n):n),K(this,"resolveNode",n=>{const o=this.resolveIndexPath(n);return o?this.at(o):void 0}),K(this,"getNodeChildrenCount",n=>{var o,i;return((i=(o=this.options).nodeToChildrenCount)==null?void 0:i.call(o,n))??Oi.nodeToChildrenCount(n)}),K(this,"getNodeValue",n=>{var o,i;return((i=(o=this.options).nodeToValue)==null?void 0:i.call(o,n))??Oi.nodeToValue(n)}),K(this,"getNodeDisabled",n=>{var o,i;return((i=(o=this.options).isNodeDisabled)==null?void 0:i.call(o,n))??Oi.isNodeDisabled(n)}),K(this,"stringify",n=>{const o=this.findNode(n);return o?this.stringifyNode(o):null}),K(this,"stringifyNode",n=>{var o,i;return((i=(o=this.options).nodeToString)==null?void 0:i.call(o,n))??Oi.nodeToString(n)}),K(this,"getFirstNode",(n=this.rootNode)=>{let o;return wt(n,{getChildren:this.getNodeChildren,onEnter:(i,a)=>{if(!o&&a.length>0&&!this.getNodeDisabled(i))return o=i,"stop"}}),o}),K(this,"getLastNode",(n=this.rootNode,o={})=>{let i;return wt(n,{getChildren:this.getNodeChildren,onEnter:(a,r)=>{var s;if(!this.isSameNode(a,n)){if((s=o.skip)!=null&&s.call(o,{value:this.getNodeValue(a),node:a,indexPath:r}))return"skip";r.length>0&&!this.getNodeDisabled(a)&&(i=a)}}}),i}),K(this,"at",n=>Ub(this.rootNode,n,{getChildren:this.getNodeChildren})),K(this,"findNode",(n,o=this.rootNode)=>xS(o,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===n})),K(this,"findNodes",(n,o=this.rootNode)=>{const i=new Set(n.filter(a=>a!=null));return wS(o,{getChildren:this.getNodeChildren,predicate:a=>i.has(this.getNodeValue(a))})}),K(this,"sort",n=>n.reduce((o,i)=>{const a=this.getIndexPath(i);return a&&o.push({value:i,indexPath:a}),o},[]).sort((o,i)=>Gb(o.indexPath,i.indexPath)).map(({value:o})=>o)),K(this,"getIndexPath",n=>Zp(this.rootNode,{getChildren:this.getNodeChildren,predicate:o=>this.getNodeValue(o)===n})),K(this,"getValue",n=>{const o=this.at(n);return o?this.getNodeValue(o):void 0}),K(this,"getValuePath",n=>{if(!n)return[];const o=[];let i=[...n];for(;i.length>0;){const a=this.at(i);a&&o.unshift(this.getNodeValue(a)),i.pop()}return o}),K(this,"getDepth",n=>{const o=Zp(this.rootNode,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===n});return o?.length??0}),K(this,"isSameNode",(n,o)=>this.getNodeValue(n)===this.getNodeValue(o)),K(this,"isRootNode",n=>this.isSameNode(n,this.rootNode)),K(this,"contains",(n,o)=>!n||!o?!1:o.slice(0,n.length).every((i,a)=>n[a]===o[a])),K(this,"getNextNode",(n,o={})=>{let i=!1,a;return wt(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(r,s)=>{var l;if(this.isRootNode(r))return;const c=this.getNodeValue(r);if((l=o.skip)!=null&&l.call(o,{value:c,node:r,indexPath:s}))return c===n&&(i=!0),"skip";if(i&&!this.getNodeDisabled(r))return a=r,"stop";c===n&&(i=!0)}}),a}),K(this,"getPreviousNode",(n,o={})=>{let i,a=!1;return wt(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(r,s)=>{var l;if(this.isRootNode(r))return;const c=this.getNodeValue(r);if((l=o.skip)!=null&&l.call(o,{value:c,node:r,indexPath:s}))return"skip";if(c===n)return a=!0,"stop";this.getNodeDisabled(r)||(i=r)}}),a?i:void 0}),K(this,"getParentNodes",n=>{var o;const i=(o=this.resolveIndexPath(n))==null?void 0:o.slice();if(!i)return[];const a=[];for(;i.length>0;){i.pop();const r=this.at(i);r&&!this.isRootNode(r)&&a.unshift(r)}return a}),K(this,"getDescendantNodes",(n,o)=>{const i=this.resolveNode(n);if(!i)return[];const a=[];return wt(i,{getChildren:this.getNodeChildren,onEnter:(r,s)=>{s.length!==0&&(!(o!=null&&o.withBranch)&&this.isBranchNode(r)||a.push(r))}}),a}),K(this,"getDescendantValues",(n,o)=>this.getDescendantNodes(n,o).map(i=>this.getNodeValue(i))),K(this,"getParentIndexPath",n=>n.slice(0,-1)),K(this,"getParentNode",n=>{const o=this.resolveIndexPath(n);return o?this.at(this.getParentIndexPath(o)):void 0}),K(this,"visit",n=>{const{skip:o,...i}=n;wt(this.rootNode,{...i,getChildren:this.getNodeChildren,onEnter:(a,r)=>{var s;if(!this.isRootNode(a))return o!=null&&o({value:this.getNodeValue(a),node:a,indexPath:r})?"skip":(s=i.onEnter)==null?void 0:s.call(i,a,r)}})}),K(this,"getPreviousSibling",n=>{const o=this.getParentNode(n);if(!o)return;const i=this.getNodeChildren(o);let a=n[n.length-1];for(;--a>=0;){const r=i[a];if(!this.getNodeDisabled(r))return r}}),K(this,"getNextSibling",n=>{const o=this.getParentNode(n);if(!o)return;const i=this.getNodeChildren(o);let a=n[n.length-1];for(;++a<i.length;){const r=i[a];if(!this.getNodeDisabled(r))return r}}),K(this,"getSiblingNodes",n=>{const o=this.getParentNode(n);return o?this.getNodeChildren(o):[]}),K(this,"getValues",(n=this.rootNode)=>_S(n,{getChildren:this.getNodeChildren,transform:o=>[this.getNodeValue(o)]}).slice(1)),K(this,"isValidDepth",(n,o)=>o==null?!0:typeof o=="function"?o(n.length):n.length===o),K(this,"isBranchNode",n=>this.getNodeChildren(n).length>0||this.getNodeChildrenCount(n)!=null),K(this,"getBranchValues",(n=this.rootNode,o={})=>{let i=[];return wt(n,{getChildren:this.getNodeChildren,onEnter:(a,r)=>{var s;if(r.length===0)return;const l=this.getNodeValue(a);if((s=o.skip)!=null&&s.call(o,{value:l,node:a,indexPath:r}))return"skip";this.isBranchNode(a)&&this.isValidDepth(r,o.depth)&&i.push(this.getNodeValue(a))}}),i}),K(this,"flatten",(n=this.rootNode)=>kS(n,{getChildren:this.getNodeChildren})),K(this,"_create",(n,o)=>this.getNodeChildren(n).length>0||o.length>0?{...n,children:o}:{...n}),K(this,"_insert",(n,o,i)=>this.copy(IS(n,{at:o,nodes:i,getChildren:this.getNodeChildren,create:this._create}))),K(this,"copy",n=>new Xb({...this.options,rootNode:n})),K(this,"_replace",(n,o,i)=>this.copy(PS(n,{at:o,node:i,getChildren:this.getNodeChildren,create:this._create}))),K(this,"_move",(n,o,i)=>this.copy(DS(n,{indexPaths:o,to:i,getChildren:this.getNodeChildren,create:this._create}))),K(this,"_remove",(n,o)=>this.copy(VS(n,{indexPaths:o,getChildren:this.getNodeChildren,create:this._create}))),K(this,"replace",(n,o)=>this._replace(this.rootNode,n,o)),K(this,"remove",n=>this._remove(this.rootNode,n)),K(this,"insertBefore",(n,o)=>this.getParentNode(n)?this._insert(this.rootNode,n,o):void 0),K(this,"insertAfter",(n,o)=>{if(!this.getParentNode(n))return;const i=[...n.slice(0,-1),n[n.length-1]+1];return this._insert(this.rootNode,i,o)}),K(this,"move",(n,o)=>this._move(this.rootNode,n,o)),K(this,"filter",n=>{const o=$S(this.rootNode,{predicate:n,getChildren:this.getNodeChildren,create:this._create});return this.copy(o)}),K(this,"toJSON",()=>this.getValues(this.rootNode)),this.rootNode=t.rootNode}},Oi={nodeToValue(e){return typeof e=="string"?e:Bo(e)&&ro(e,"value")?e.value:""},nodeToString(e){return typeof e=="string"?e:Bo(e)&&ro(e,"label")?e.label:Oi.nodeToValue(e)},isNodeDisabled(e){return Bo(e)&&ro(e,"disabled")?!!e.disabled:!1},nodeToChildren(e){return e.children},nodeToChildrenCount(e){if(Bo(e)&&ro(e,"childrenCount"))return e.childrenCount}};const MS=e=>new si(e),Qp=e=>new fh(e);var RS=Object.defineProperty,AS=(e,t,n)=>t in e?RS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gh=(e,t,n)=>AS(e,t+"",n),FS=(e,t)=>{if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0},mh=class{toHexInt(){return this.toFormat("rgba").toHexInt()}getChannelValue(t){if(t in this)return this[t];throw new Error("Unsupported color channel: "+t)}getChannelValuePercent(t,n){const o=n??this.getChannelValue(t),{minValue:i,maxValue:a}=this.getChannelRange(t);return f_(o,i,a)}getChannelPercentValue(t,n){const{minValue:o,maxValue:i,step:a}=this.getChannelRange(t),r=g_(n,o,i,a);return kp(r,o,i,a)}withChannelValue(t,n){const{minValue:o,maxValue:i}=this.getChannelRange(t);if(t in this){let a=this.clone();return a[t]=Ze(n,o,i),a}throw new Error("Unsupported color channel: "+t)}getColorAxes(t){let{xChannel:n,yChannel:o}=t,i=n||this.getChannels().find(s=>s!==o),a=o||this.getChannels().find(s=>s!==i),r=this.getChannels().find(s=>s!==i&&s!==a);return{xChannel:i,yChannel:a,zChannel:r}}incrementChannel(t,n){const{minValue:o,maxValue:i,step:a}=this.getChannelRange(t),r=kp(Ze(this.getChannelValue(t)+n,o,i),o,i,a);return this.withChannelValue(t,r)}decrementChannel(t,n){return this.incrementChannel(t,-n)}isEqual(t){return FS(this.toJSON(),t.toJSON())&&this.getChannelValue("alpha")===t.getChannelValue("alpha")}},NS=/^#[\da-f]+$/i,LS=/^rgba?\((.*)\)$/,BS=/[^#]/gi,Zb=class ol extends mh{constructor(t,n,o,i){super(),this.red=t,this.green=n,this.blue=o,this.alpha=i}static parse(t){let n=[];if(NS.test(t)&&[4,5,7,9].includes(t.length)){const i=(t.length<6?t.replace(BS,"$&$&"):t).slice(1).split("");for(;i.length>0;)n.push(parseInt(i.splice(0,2).join(""),16));n[3]=n[3]!==void 0?n[3]/255:void 0}const o=t.match(LS);return o!=null&&o[1]&&(n=o[1].split(",").map(i=>Number(i.trim())).map((i,a)=>Ze(i,0,a<3?255:1))),n.length<3?void 0:new ol(n[0],n[1],n[2],n[3]??1)}toString(t){switch(t){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(this.alpha*255).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"hsb":return this.toHSB().toString("hsb");default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"rgba":return this;case"hsba":return this.toHSB();case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+t)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const t=this.red/255,n=this.green/255,o=this.blue/255,i=Math.min(t,n,o),a=Math.max(t,n,o),r=a-i,s=a===0?0:r/a;let l=0;if(r!==0){switch(a){case t:l=(n-o)/r+(n<o?6:0);break;case n:l=(o-t)/r+2;break;case o:l=(t-n)/r+4;break}l/=6}return new yh(Ee(l*360,2),Ee(s*100,2),Ee(a*100,2),Ee(this.alpha,2))}toHSL(){const t=this.red/255,n=this.green/255,o=this.blue/255,i=Math.min(t,n,o),a=Math.max(t,n,o),r=(a+i)/2,s=a-i;let l=-1,c=-1;if(s===0)l=c=0;else{switch(c=s/(r<.5?a+i:2-a-i),a){case t:l=(n-o)/s+(n<o?6:0);break;case n:l=(o-t)/s+2;break;case o:l=(t-n)/s+4;break}l/=6}return new bh(Ee(l*360,2),Ee(c*100,2),Ee(r*100,2),Ee(this.alpha,2))}clone(){return new ol(this.red,this.green,this.blue,this.alpha)}getChannelFormatOptions(t){switch(t){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,n){let o=this.getChannelFormatOptions(t),i=this.getChannelValue(t);return new Intl.NumberFormat(n,o).format(i)}getChannelRange(t){switch(t){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}toJSON(){return{r:this.red,g:this.green,b:this.blue,a:this.alpha}}getFormat(){return"rgba"}getChannels(){return ol.colorChannels}};gh(Zb,"colorChannels",["red","green","blue"]);var vh=Zb,zS=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,Jb=class il extends mh{constructor(t,n,o,i){super(),this.hue=t,this.saturation=n,this.lightness=o,this.alpha=i}static parse(t){let n;if(n=t.match(zS)){const[o,i,a,r]=(n[1]??n[2]).split(",").map(s=>Number(s.trim().replace("%","")));return new il(yb(o,360),Ze(i,0,100),Ze(a,0,100),Ze(r??1,0,1))}}toString(t){switch(t){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.lightness,2)}%, ${this.alpha})`;case"hsb":return this.toHSB().toString("hsb");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"hsla":return this;case"hsba":return this.toHSB();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+t)}}toHSB(){let t=this.saturation/100,n=this.lightness/100,o=n+t*Math.min(n,1-n);return t=o===0?0:2*(1-n/o),new yh(Ee(this.hue,2),Ee(t*100,2),Ee(o*100,2),Ee(this.alpha,2))}toRGB(){let t=this.hue,n=this.saturation/100,o=this.lightness/100,i=n*Math.min(o,1-o),a=(r,s=(r+t/30)%12)=>o-i*Math.max(Math.min(s-3,9-s,1),-1);return new vh(Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255),Ee(this.alpha,2))}clone(){return new il(this.hue,this.saturation,this.lightness,this.alpha)}getChannelFormatOptions(t){switch(t){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,n){let o=this.getChannelFormatOptions(t),i=this.getChannelValue(t);return(t==="saturation"||t==="lightness")&&(i/=100),new Intl.NumberFormat(n,o).format(i)}getChannelRange(t){switch(t){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}toJSON(){return{h:this.hue,s:this.saturation,l:this.lightness,a:this.alpha}}getFormat(){return"hsla"}getChannels(){return il.colorChannels}};gh(Jb,"colorChannels",["hue","saturation","lightness"]);var bh=Jb,HS=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,Qb=class al extends mh{constructor(t,n,o,i){super(),this.hue=t,this.saturation=n,this.brightness=o,this.alpha=i}static parse(t){let n;if(n=t.match(HS)){const[o,i,a,r]=(n[1]??n[2]).split(",").map(s=>Number(s.trim().replace("%","")));return new al(yb(o,360),Ze(i,0,100),Ze(a,0,100),Ze(r??1,0,1))}}toString(t){switch(t){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${Ee(this.saturation,2)}%, ${Ee(this.brightness,2)}%, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"hsba":return this;case"hsla":return this.toHSL();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+t)}}toHSL(){let t=this.saturation/100,n=this.brightness/100,o=n*(1-t/2);return t=o===0||o===1?0:(n-o)/Math.min(o,1-o),new bh(Ee(this.hue,2),Ee(t*100,2),Ee(o*100,2),Ee(this.alpha,2))}toRGB(){let t=this.hue,n=this.saturation/100,o=this.brightness/100,i=(a,r=(a+t/60)%6)=>o-n*o*Math.max(Math.min(r,4-r,1),0);return new vh(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),Ee(this.alpha,2))}clone(){return new al(this.hue,this.saturation,this.brightness,this.alpha)}getChannelFormatOptions(t){switch(t){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,n){let o=this.getChannelFormatOptions(t),i=this.getChannelValue(t);return(t==="saturation"||t==="brightness")&&(i/=100),new Intl.NumberFormat(n,o).format(i)}getChannelRange(t){switch(t){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}toJSON(){return{h:this.hue,s:this.saturation,b:this.brightness,a:this.alpha}}getFormat(){return"hsba"}getChannels(){return al.colorChannels}};gh(Qb,"colorChannels",["hue","saturation","brightness"]);var yh=Qb,jS="aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32",WS=e=>{const t=new Map,n=e.split(",");for(let o=0;o<n.length;o++){const[i,a]=n[o].split(":");t.set(i,`#${a}`),i.includes("gray")&&t.set(i.replace("gray","grey"),`#${a}`)}return t},ef=WS(jS),Nl=e=>{var t;if(ef.has(e))return Nl(ef.get(e));const n=vh.parse(e)||yh.parse(e)||bh.parse(e);if(!n){const o=new Error("Invalid color value: "+e);throw(t=Error.captureStackTrace)==null||t.call(Error,o,Nl),o}return n};const US=["top","right","bottom","left"],go=Math.min,Ct=Math.max,Ll=Math.round,ps=Math.floor,vn=e=>({x:e,y:e}),GS={left:"right",right:"left",bottom:"top",top:"bottom"},qS={start:"end",end:"start"};function qd(e,t,n){return Ct(e,go(t,n))}function Un(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function aa(e){return e.split("-")[1]}function xh(e){return e==="x"?"y":"x"}function wh(e){return e==="y"?"height":"width"}const YS=new Set(["top","bottom"]);function fn(e){return YS.has(Gn(e))?"y":"x"}function Ch(e){return xh(fn(e))}function KS(e,t,n){n===void 0&&(n=!1);const o=aa(e),i=Ch(e),a=wh(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(r=Bl(r)),[r,Bl(r)]}function XS(e){const t=Bl(e);return[Yd(e),t,Yd(t)]}function Yd(e){return e.replace(/start|end/g,t=>qS[t])}const tf=["left","right"],nf=["right","left"],ZS=["top","bottom"],JS=["bottom","top"];function QS(e,t,n){switch(e){case"top":case"bottom":return n?t?nf:tf:t?tf:nf;case"left":case"right":return t?ZS:JS;default:return[]}}function eE(e,t,n,o){const i=aa(e);let a=QS(Gn(e),n==="start",o);return i&&(a=a.map(r=>r+"-"+i),t&&(a=a.concat(a.map(Yd)))),a}function Bl(e){return e.replace(/left|right|bottom|top/g,t=>GS[t])}function tE(e){return{top:0,right:0,bottom:0,left:0,...e}}function ey(e){return typeof e!="number"?tE(e):{top:e,right:e,bottom:e,left:e}}function zl(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function of(e,t,n){let{reference:o,floating:i}=e;const a=fn(t),r=Ch(t),s=wh(r),l=Gn(t),c=a==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let p;switch(l){case"top":p={x:d,y:o.y-i.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y}}switch(aa(t)){case"start":p[r]-=h*(n&&c?-1:1);break;case"end":p[r]+=h*(n&&c?-1:1);break}return p}const nE=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:a=[],platform:r}=n,s=a.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=of(c,o,l),h=o,p={},m=0;for(let f=0;f<s.length;f++){const{name:b,fn:g}=s[f],{x:y,y:x,data:C,reset:k}=await g({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:c,platform:r,elements:{reference:e,floating:t}});d=y??d,u=x??u,p={...p,[b]:{...p[b],...C}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(c=k.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:d,y:u}=of(c,h,l)),f=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:p}};async function Cr(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:a,rects:r,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Un(t,e),m=ey(p),f=s[h?u==="floating"?"reference":"floating":u],b=zl(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(f)))==null||n?f:f.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),g=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),x=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},C=zl(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(b.top-C.top+m.top)/x.y,bottom:(C.bottom-b.bottom+m.bottom)/x.y,left:(b.left-C.left+m.left)/x.x,right:(C.right-b.right+m.right)/x.x}}const oE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:a,platform:r,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Un(e,t)||{};if(c==null)return{};const u=ey(d),h={x:n,y:o},p=Ch(i),m=wh(p),f=await r.getDimensions(c),b=p==="y",g=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",C=a.reference[m]+a.reference[p]-h[p]-a.floating[m],k=h[p]-a.reference[p],O=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let P=O?O[x]:0;(!P||!await(r.isElement==null?void 0:r.isElement(O)))&&(P=s.floating[x]||a.floating[m]);const $=C/2-k/2,I=P/2-f[m]/2-1,A=go(u[g],I),M=go(u[y],I),j=A,Q=P-f[m]-M,N=P/2-f[m]/2+$,B=qd(j,N,Q),G=!l.arrow&&aa(i)!=null&&N!==B&&a.reference[m]/2-(N<j?A:M)-f[m]/2<0,J=G?N<j?N-j:N-Q:0;return{[p]:h[p]+J,data:{[p]:B,centerOffset:N-B-J,...G&&{alignmentOffset:J}},reset:G}}}),iE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:a,rects:r,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...b}=Un(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const g=Gn(i),y=fn(s),x=Gn(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=h||(x||!f?[Bl(s)]:XS(s)),O=m!=="none";!h&&O&&k.push(...eE(s,f,m,C));const P=[s,...k],$=await Cr(t,b),I=[];let A=((o=a.flip)==null?void 0:o.overflows)||[];if(d&&I.push($[g]),u){const N=KS(i,r,C);I.push($[N[0]],$[N[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(N=>N<=0)){var M,j;const N=(((M=a.flip)==null?void 0:M.index)||0)+1,B=P[N];if(B&&(!(u==="alignment"&&y!==fn(B))||A.every(J=>fn(J.placement)===y?J.overflows[0]>0:!0)))return{data:{index:N,overflows:A},reset:{placement:B}};let G=(j=A.filter(J=>J.overflows[0]<=0).sort((J,Z)=>J.overflows[1]-Z.overflows[1])[0])==null?void 0:j.placement;if(!G)switch(p){case"bestFit":{var Q;const J=(Q=A.filter(Z=>{if(O){const ie=fn(Z.placement);return ie===y||ie==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ie=>ie>0).reduce((ie,re)=>ie+re,0)]).sort((Z,ie)=>Z[1]-ie[1])[0])==null?void 0:Q[0];J&&(G=J);break}case"initialPlacement":G=s;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function af(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 US.some(t=>e[t]>=0)}const aE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=Un(e,t);switch(o){case"referenceHidden":{const a=await Cr(t,{...i,elementContext:"reference"}),r=af(a,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:rf(r)}}}case"escaped":{const a=await Cr(t,{...i,altBoundary:!0}),r=af(a,n.floating);return{data:{escapedOffsets:r,escaped:rf(r)}}}default:return{}}}}},ty=new Set(["left","top"]);async function rE(e,t){const{placement:n,platform:o,elements:i}=e,a=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=Gn(n),s=aa(n),l=fn(n)==="y",c=ty.has(r)?-1:1,d=a&&l?-1:1,u=Un(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const sE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:a,placement:r,middlewareData:s}=t,l=await rE(t,e);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:r}}}}},lE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:a=!0,crossAxis:r=!1,limiter:s={fn:b=>{let{x:g,y}=b;return{x:g,y}}},...l}=Un(e,t),c={x:n,y:o},d=await Cr(t,l),u=fn(Gn(i)),h=xh(u);let p=c[h],m=c[u];if(a){const b=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=p+d[b],x=p-d[g];p=qd(y,p,x)}if(r){const b=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=m+d[b],x=m-d[g];m=qd(y,m,x)}const f=s.fn({...t,[h]:p,[u]:m});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[h]:a,[u]:r}}}}}},cE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:a,middlewareData:r}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Un(e,t),d={x:n,y:o},u=fn(i),h=xh(u);let p=d[h],m=d[u];const f=Un(s,t),b=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const x=h==="y"?"height":"width",C=a.reference[h]-a.floating[x]+b.mainAxis,k=a.reference[h]+a.reference[x]-b.mainAxis;p<C?p=C:p>k&&(p=k)}if(c){var g,y;const x=h==="y"?"width":"height",C=ty.has(Gn(i)),k=a.reference[u]-a.floating[x]+(C&&((g=r.offset)==null?void 0:g[u])||0)+(C?0:b.crossAxis),O=a.reference[u]+a.reference[x]+(C?0:((y=r.offset)==null?void 0:y[u])||0)-(C?b.crossAxis:0);m<k?m=k:m>O&&(m=O)}return{[h]:p,[u]:m}}}},dE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:a,platform:r,elements:s}=t,{apply:l=()=>{},...c}=Un(e,t),d=await Cr(t,c),u=Gn(i),h=aa(i),p=fn(i)==="y",{width:m,height:f}=a.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=h===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,b=h==="end"?"top":"bottom");const y=f-d.top-d.bottom,x=m-d.left-d.right,C=go(f-d[b],y),k=go(m-d[g],x),O=!t.middlewareData.shift;let P=C,$=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(P=y),O&&!h){const A=Ct(d.left,0),M=Ct(d.right,0),j=Ct(d.top,0),Q=Ct(d.bottom,0);p?$=m-2*(A!==0||M!==0?A+M:Ct(d.left,d.right)):P=f-2*(j!==0||Q!==0?j+Q:Ct(d.top,d.bottom))}await l({...t,availableWidth:$,availableHeight:P});const I=await r.getDimensions(s.floating);return m!==I.width||f!==I.height?{reset:{rects:!0}}:{}}}};function $c(){return typeof window<"u"}function ra(e){return ny(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cn(e){var t;return(t=(ny(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ny(e){return $c()?e instanceof Node||e instanceof St(e).Node:!1}function nn(e){return $c()?e instanceof Element||e instanceof St(e).Element:!1}function yn(e){return $c()?e instanceof HTMLElement||e instanceof St(e).HTMLElement:!1}function sf(e){return!$c()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}const uE=new Set(["inline","contents"]);function qr(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=on(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!uE.has(i)}const hE=new Set(["table","td","th"]);function pE(e){return hE.has(ra(e))}const fE=[":popover-open",":modal"];function kc(e){return fE.some(t=>{try{return e.matches(t)}catch{return!1}})}const gE=["transform","translate","scale","rotate","perspective"],mE=["transform","translate","scale","rotate","perspective","filter"],vE=["paint","layout","strict","content"];function _h(e){const t=$h(),n=nn(e)?on(e):e;return gE.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mE.some(o=>(n.willChange||"").includes(o))||vE.some(o=>(n.contain||"").includes(o))}function bE(e){let t=mo(e);for(;yn(t)&&!qi(t);){if(_h(t))return t;if(kc(t))return null;t=mo(t)}return null}function $h(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yE=new Set(["html","body","#document"]);function qi(e){return yE.has(ra(e))}function on(e){return St(e).getComputedStyle(e)}function Sc(e){return nn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mo(e){if(ra(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sf(e)&&e.host||Cn(e);return sf(t)?t.host:t}function oy(e){const t=mo(e);return qi(t)?e.ownerDocument?e.ownerDocument.body:e.body:yn(t)&&qr(t)?t:oy(t)}function _r(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=oy(e),a=i===((o=e.ownerDocument)==null?void 0:o.body),r=St(i);if(a){const s=Kd(r);return t.concat(r,r.visualViewport||[],qr(i)?i:[],s&&n?_r(s):[])}return t.concat(i,_r(i,[],n))}function Kd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function iy(e){const t=on(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=yn(e),a=i?e.offsetWidth:n,r=i?e.offsetHeight:o,s=Ll(n)!==a||Ll(o)!==r;return s&&(n=a,o=r),{width:n,height:o,$:s}}function kh(e){return nn(e)?e:e.contextElement}function zi(e){const t=kh(e);if(!yn(t))return vn(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:a}=iy(t);let r=(a?Ll(n.width):n.width)/o,s=(a?Ll(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const xE=vn(0);function ay(e){const t=St(e);return!$h()||!t.visualViewport?xE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==St(e)?!1:t}function Qo(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=kh(e);let r=vn(1);t&&(o?nn(o)&&(r=zi(o)):r=zi(e));const s=wE(a,n,o)?ay(a):vn(0);let l=(i.left+s.x)/r.x,c=(i.top+s.y)/r.y,d=i.width/r.x,u=i.height/r.y;if(a){const h=St(a),p=o&&nn(o)?St(o):o;let m=h,f=Kd(m);for(;f&&o&&p!==m;){const b=zi(f),g=f.getBoundingClientRect(),y=on(f),x=g.left+(f.clientLeft+parseFloat(y.paddingLeft))*b.x,C=g.top+(f.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,u*=b.y,l+=x,c+=C,m=St(f),f=Kd(m)}}return zl({width:d,height:u,x:l,y:c})}function Ec(e,t){const n=Sc(e).scrollLeft;return t?t.left+n:Qo(Cn(e)).left+n}function ry(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ec(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function CE(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const a=i==="fixed",r=Cn(o),s=t?kc(t.floating):!1;if(o===r||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=vn(1);const d=vn(0),u=yn(o);if((u||!u&&!a)&&((ra(o)!=="body"||qr(r))&&(l=Sc(o)),yn(o))){const p=Qo(o);c=zi(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const h=r&&!u&&!a?ry(r,l):vn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function _E(e){return Array.from(e.getClientRects())}function $E(e){const t=Cn(e),n=Sc(e),o=e.ownerDocument.body,i=Ct(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Ct(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ec(e);const s=-n.scrollTop;return on(o).direction==="rtl"&&(r+=Ct(t.clientWidth,o.clientWidth)-i),{width:i,height:a,x:r,y:s}}const lf=25;function kE(e,t){const n=St(e),o=Cn(e),i=n.visualViewport;let a=o.clientWidth,r=o.clientHeight,s=0,l=0;if(i){a=i.width,r=i.height;const d=$h();(!d||d&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Ec(o);if(c<=0){const d=o.ownerDocument,u=d.body,h=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(o.clientWidth-u.clientWidth-p);m<=lf&&(a-=m)}else c<=lf&&(a+=c);return{width:a,height:r,x:s,y:l}}const SE=new Set(["absolute","fixed"]);function EE(e,t){const n=Qo(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,a=yn(e)?zi(e):vn(1),r=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=o*a.y;return{width:r,height:s,x:l,y:c}}function cf(e,t,n){let o;if(t==="viewport")o=kE(e,n);else if(t==="document")o=$E(Cn(e));else if(nn(t))o=EE(t,n);else{const i=ay(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zl(o)}function sy(e,t){const n=mo(e);return n===t||!nn(n)||qi(n)?!1:on(n).position==="fixed"||sy(n,t)}function OE(e,t){const n=t.get(e);if(n)return n;let o=_r(e,[],!1).filter(s=>nn(s)&&ra(s)!=="body"),i=null;const a=on(e).position==="fixed";let r=a?mo(e):e;for(;nn(r)&&!qi(r);){const s=on(r),l=_h(r);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&i&&SE.has(i.position)||qr(r)&&!l&&sy(e,r))?o=o.filter(c=>c!==r):i=s,r=mo(r)}return t.set(e,o),o}function TE(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const a=[...n==="clippingAncestors"?kc(t)?[]:OE(t,this._c):[].concat(n),o],r=a[0],s=a.reduce((l,c)=>{const d=cf(t,c,i);return l.top=Ct(d.top,l.top),l.right=go(d.right,l.right),l.bottom=go(d.bottom,l.bottom),l.left=Ct(d.left,l.left),l},cf(t,r,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function IE(e){const{width:t,height:n}=iy(e);return{width:t,height:n}}function PE(e,t,n){const o=yn(t),i=Cn(t),a=n==="fixed",r=Qo(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=vn(0);function c(){l.x=Ec(i)}if(o||!o&&!a)if((ra(t)!=="body"||qr(i))&&(s=Sc(t)),o){const p=Qo(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&c();a&&!o&&i&&c();const d=i&&!o&&!a?ry(i,s):vn(0),u=r.left+s.scrollLeft-l.x-d.x,h=r.top+s.scrollTop-l.y-d.y;return{x:u,y:h,width:r.width,height:r.height}}function Kc(e){return on(e).position==="static"}function df(e,t){if(!yn(e)||on(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function ly(e,t){const n=St(e);if(kc(e))return n;if(!yn(e)){let i=mo(e);for(;i&&!qi(i);){if(nn(i)&&!Kc(i))return i;i=mo(i)}return n}let o=df(e,t);for(;o&&pE(o)&&Kc(o);)o=df(o,t);return o&&qi(o)&&Kc(o)&&!_h(o)?n:o||bE(e)||n}const VE=async function(e){const t=this.getOffsetParent||ly,n=this.getDimensions,o=await n(e.floating);return{reference:PE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function DE(e){return on(e).direction==="rtl"}const ME={convertOffsetParentRelativeRectToViewportRelativeRect:CE,getDocumentElement:Cn,getClippingRect:TE,getOffsetParent:ly,getElementRects:VE,getClientRects:_E,getDimensions:IE,getScale:zi,isElement:nn,isRTL:DE};function cy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function RE(e,t){let n=null,o;const i=Cn(e);function a(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(s||t(),!h||!p)return;const m=ps(u),f=ps(i.clientWidth-(d+h)),b=ps(i.clientHeight-(u+p)),g=ps(d),y={rootMargin:-m+"px "+-f+"px "+-b+"px "+-g+"px",threshold:Ct(0,go(1,l))||1};let x=!0;function C(k){const O=k[0].intersectionRatio;if(O!==l){if(!x)return r();O?r(!1,O):o=setTimeout(()=>{r(!1,1e-7)},1e3)}O===1&&!cy(c,e.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(C,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return r(!0),a}function AE(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=kh(e),d=i||a?[...c?_r(c):[],..._r(t)]:[];d.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),a&&g.addEventListener("resize",n)});const u=c&&s?RE(c,n):null;let h=-1,p=null;r&&(p=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let m,f=l?Qo(e):null;l&&b();function b(){const g=Qo(e);f&&!cy(f,g)&&n(),f=g,m=requestAnimationFrame(b)}return n(),()=>{var g;d.forEach(y=>{i&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),u?.(),(g=p)==null||g.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const FE=sE,NE=lE,LE=iE,BE=dE,zE=aE,HE=oE,jE=cE,WE=(e,t,n)=>{const o=new Map,i={platform:ME,...n},a={...i.platform,_c:o};return nE(e,t,{...i,platform:a})};function uf(e=0,t=0,n=0,o=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,o);const i={x:e,y:t,width:n,height:o,top:t,right:e+n,bottom:t+o,left:e};return{...i,toJSON:()=>i}}function UE(e){if(!e)return uf();const{x:t,y:n,width:o,height:i}=e;return uf(t,n,o,i)}function GE(e,t){return{contextElement:Be(e)?e:void 0,getBoundingClientRect:()=>{const n=e,o=t?.(n);return o||!n?UE(o):n.getBoundingClientRect()}}}var wa=e=>({variable:e,reference:`var(${e})`}),Tn={arrowSize:wa("--arrow-size"),arrowSizeHalf:wa("--arrow-size-half"),arrowBg:wa("--arrow-background"),transformOrigin:wa("--transform-origin"),arrowOffset:wa("--arrow-offset")},qE=e=>e==="top"||e==="bottom"?"y":"x";function YE(e,t){return{name:"transformOrigin",fn(n){var o,i,a,r;const{elements:s,middlewareData:l,placement:c,rects:d,y:u}=n,h=c.split("-")[0],p=qE(h),m=((o=l.arrow)==null?void 0:o.x)||0,f=((i=l.arrow)==null?void 0:i.y)||0,b=t?.clientWidth||0,g=t?.clientHeight||0,y=m+b/2,x=f+g/2,C=Math.abs(((a=l.shift)==null?void 0:a.y)||0),k=d.reference.height/2,O=g/2,P=((r=e.offset)==null?void 0:r.mainAxis)??e.gutter,$=typeof P=="number"?P+O:P??O,I=C>$,A={top:`${y}px calc(100% + ${$}px)`,bottom:`${y}px ${-$}px`,left:`calc(100% + ${$}px) ${x}px`,right:`${-$}px ${x}px`}[h],M=`${y}px ${d.reference.y+k-u}px`,j=!!e.overlap&&p==="y"&&I;return s.floating.style.setProperty(Tn.transformOrigin.variable,j?M:A),{data:{transformOrigin:j?M:A}}}}}var KE={name:"rects",fn({rects:e}){return{data:e}}},XE=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:o,y:i}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:o!=null?`${o}px`:"",top:i!=null?`${i}px`:"",[a]:`calc(100% + ${Tn.arrowOffset.reference})`}),{}}}};function ZE(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function JE(e){return e.split("-")[0]}var QE={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function hf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Sh(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function eO(e,t,n){const o=e||t.createElement("div");return HE({element:o,padding:n.arrowPadding})}function tO(e,t){if(!JC(t.offset??t.gutter))return FE(({placement:n})=>{var o,i;const a=(e?.clientHeight||0)/2,r=((o=t.offset)==null?void 0:o.mainAxis)??t.gutter,s=typeof r=="number"?r+a:r??a,{hasAlign:l}=ZE(n),c=l?void 0:t.shift,d=((i=t.offset)==null?void 0:i.crossAxis)??c;return vc({crossAxis:d,mainAxis:s,alignmentAxis:t.shift})})}function nO(e){if(!e.flip)return;const t=Sh(e.boundary);return LE({...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function oO(e){if(!e.slide&&!e.overlap)return;const t=Sh(e.boundary);return NE({...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:jE()})}function iO(e){return BE({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:o,availableWidth:i}){const a=t.floating,r=Math.round(n.reference.width),s=Math.round(n.reference.height);i=Math.floor(i),o=Math.floor(o),a.style.setProperty("--reference-width",`${r}px`),a.style.setProperty("--reference-height",`${s}px`),a.style.setProperty("--available-width",`${i}px`),a.style.setProperty("--available-height",`${o}px`)}})}function aO(e){if(e.hideWhenDetached)return zE({strategy:"referenceHidden",boundary:Sh(e.boundary)??"clippingAncestors"})}function rO(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function sO(e,t,n={}){const o=GE(e,n.getAnchorRect);if(!t||!o)return;const i=Object.assign({},QE,n),a=t.querySelector("[data-part=arrow]"),r=[tO(a,i),nO(i),oO(i),eO(a,t.ownerDocument,i),XE(a),YE({gutter:i.gutter,offset:i.offset,overlap:i.overlap},a),iO(i),aO(i),KE],{placement:s,strategy:l,onComplete:c,onPositioned:d}=i,u=async()=>{var f;if(!o||!t)return;const b=await WE(o,t,{placement:s,middleware:r,strategy:l});c?.(b),d?.({placed:!0});const g=Fe(t),y=hf(g,b.x),x=hf(g,b.y);t.style.setProperty("--x",`${y}px`),t.style.setProperty("--y",`${x}px`),i.hideWhenDetached&&((f=b.middlewareData.hide)!=null&&f.referenceHidden?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const C=t.firstElementChild;if(C){const k=Gi(C);t.style.setProperty("--z-index",k.zIndex)}},h=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:u,floatingElement:t}),d?.({placed:!0})):await u()},p=rO(i.listeners),m=i.listeners?AE(o,t,h,p):a_;return h(),()=>{m?.(),d?.({placed:!1})}}function Et(e,t,n={}){const{defer:o,...i}=n,a=o?ae:s=>s(),r=[];return r.push(a(()=>{const s=typeof e=="function"?e():e,l=typeof t=="function"?t():t;r.push(sO(s,l,i))})),()=>{r.forEach(s=>s?.())}}var lO={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Eh(e={}){const{placement:t,sameWidth:n,fitViewport:o,strategy:i="absolute"}=e;return{arrow:{position:"absolute",width:Tn.arrowSize.reference,height:Tn.arrowSize.reference,[Tn.arrowSizeHalf.variable]:`calc(${Tn.arrowSize.reference} / 2)`,[Tn.arrowOffset.variable]:`calc(${Tn.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?lO[t.split("-")[0]]:void 0,background:Tn.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:o?"var(--available-width)":void 0,maxHeight:o?"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)"}}}var dy=le("color-picker",["root","label","control","trigger","positioner","content","area","areaThumb","valueText","areaBackground","channelSlider","channelSliderLabel","channelSliderTrack","channelSliderThumb","channelSliderValueText","channelInput","transparencyGrid","swatchGroup","swatchTrigger","swatchIndicator","swatch","eyeDropperTrigger","formatTrigger","formatSelect"]);dy.build();var cO=e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`color-picker:${e.id}:hidden-input`},dO=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`color-picker:${e.id}:control`},uO=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`color-picker:${e.id}:trigger`},hO=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`color-picker:${e.id}:content`},pO=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`color-picker:${e.id}:positioner`},fO=e=>{var t;return((t=e.ids)==null?void 0:t.formatSelect)??`color-picker:${e.id}:format-select`},gO=e=>{var t;return((t=e.ids)==null?void 0:t.area)??`color-picker:${e.id}:area`},mO=e=>{var t;return((t=e.ids)==null?void 0:t.areaThumb)??`color-picker:${e.id}:area-thumb`},vO=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.channelSliderTrack)==null?void 0:o.call(n,t))??`color-picker:${e.id}:slider-track:${t}`},bO=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.channelSliderThumb)==null?void 0:o.call(n,t))??`color-picker:${e.id}:slider-thumb:${t}`},rl=e=>e.getById(hO(e)),yO=e=>e.getById(mO(e)),xO=(e,t)=>e.getById(bO(e,t)),wO=e=>e.getById(fO(e)),pf=e=>e.getById(cO(e)),CO=e=>e.getById(gO(e)),_O=(e,t,n)=>{const o=CO(e);if(!o)return;const{getPercentValue:i}=rb(t,o);return{x:i({dir:n,orientation:"horizontal"}),y:i({orientation:"vertical"})}},$O=e=>e.getById(dO(e)),Xc=e=>e.getById(uO(e)),kO=e=>e.getById(pO(e)),SO=(e,t)=>e.getById(vO(e,t)),EO=(e,t,n,o)=>{const i=SO(e,n);if(!i)return;const{getPercentValue:a}=rb(t,i);return{x:a({dir:o,orientation:"horizontal"}),y:a({orientation:"vertical"})}},OO=e=>[...fo(rl(e),"input[data-channel]"),...fo($O(e),"input[data-channel]")];function TO(e,t){if(t==null)return"";if(t==="hex")return e.toString("hex");if(t==="css")return e.toString("css");if(t in e)return e.getChannelValue(t).toString();const n=e.getFormat()==="hsla";switch(t){case"hue":return n?e.toFormat("hsla").getChannelValue("hue").toString():e.toFormat("hsba").getChannelValue("hue").toString();case"saturation":return n?e.toFormat("hsla").getChannelValue("saturation").toString():e.toFormat("hsba").getChannelValue("saturation").toString();case"lightness":return e.toFormat("hsla").getChannelValue("lightness").toString();case"brightness":return e.toFormat("hsba").getChannelValue("brightness").toString();case"red":case"green":case"blue":return e.toFormat("rgba").getChannelValue(t).toString();default:return e.getChannelValue(t).toString()}}var ff=e=>Nl(e),IO=/^[0-9a-fA-F]{3,8}$/;function PO(e){return IO.test(e)}function VO(e){return e.startsWith("#")?e:PO(e)?`#${e}`:e}var{and:DO}=et();DO("isOpenControlled","closeOnSelect");function gf(e,t,n){const o=OO(e);ae(()=>{o.forEach(i=>{const a=i.dataset.channel;Jt(i,TO(n||t,a))})})}function MO(e,t){const n=wO(e);n&&ae(()=>Jt(n,t))}ee()(["closeOnSelect","dir","disabled","format","defaultFormat","getRootNode","id","ids","initialFocusEl","inline","name","positioning","onFocusOutside","onFormatChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","onValueChangeEnd","defaultOpen","open","positioning","required","readOnly","value","defaultValue","invalid","openAutoFocus"]);ee()(["xChannel","yChannel"]);ee()(["channel","orientation"]);ee()(["value","disabled"]);ee()(["value","respectAlpha"]);ee()(["size"]);dy.extendWith("view");var uy=le("combobox").parts("root","clearTrigger","content","control","input","item","itemGroup","itemGroupLabel","itemIndicator","itemText","label","list","positioner","trigger");uy.build();var hy=e=>new si(e);hy.empty=()=>new si({items:[]});var RO=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`combobox:${e.id}:control`},AO=e=>{var t;return((t=e.ids)==null?void 0:t.input)??`combobox:${e.id}:input`},FO=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`combobox:${e.id}:content`},NO=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`combobox:${e.id}:popper`},LO=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`combobox:${e.id}:toggle-btn`},BO=e=>{var t;return((t=e.ids)==null?void 0:t.clearTrigger)??`combobox:${e.id}:clear-btn`},to=e=>e.getById(FO(e)),Ti=e=>e.getById(AO(e)),mf=e=>e.getById(NO(e)),vf=e=>e.getById(RO(e)),Ka=e=>e.getById(LO(e)),bf=e=>e.getById(BO(e)),Ca=(e,t)=>{if(t==null)return null;const n=`[role=option][data-value="${CSS.escape(t)}"]`;return db(to(e),n)},yf=e=>{const t=Ti(e);e.isActiveElement(t)||t==null||t.focus({preventScroll:!0})},zO=e=>{const t=Ka(e);e.isActiveElement(t)||t==null||t.focus({preventScroll:!0})},{guards:HO,createMachine:jO,choose:WO}=bc(),{and:Ue,not:yt}=HO;jO({props({props:e}){return{loopFocus:!0,openOnClick:!1,defaultValue:[],defaultInputValue:"",closeOnSelect:!e.multiple,allowCustomValue:!1,alwaysSubmitOnEnter:!1,inputBehavior:"none",selectionBehavior:e.multiple?"clear":"replace",openOnKeyPress:!0,openOnChange:!0,composite:!0,navigate({node:t}){ib(t)},collection:hy.empty(),...e,positioning:{placement:"bottom",sameWidth:!0,...e.positioning},translations:{triggerLabel:"Toggle suggestions",clearTriggerLabel:"Clear value",...e.translations}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"suggesting":"idle"},context({prop:e,bindable:t,getContext:n,getEvent:o}){return{currentPlacement:t(()=>({defaultValue:void 0})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:Je,hash(i){return i.join(",")},onChange(i){var a;const r=n(),s=r.get("selectedItems"),l=e("collection"),c=i.map(d=>s.find(u=>l.getItemValue(u)===d)||l.find(d));r.set("selectedItems",c),(a=e("onValueChange"))==null||a({value:i,items:c})}})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(i){var a;const r=e("collection").find(i);(a=e("onHighlightChange"))==null||a({highlightedValue:i,highlightedItem:r})}})),inputValue:t(()=>{let i=e("inputValue")||e("defaultInputValue");const a=e("value")||e("defaultValue");if(!i.trim()&&!e("multiple")){const r=e("collection").stringifyMany(a);i=ut(e("selectionBehavior"),{preserve:i||r,replace:r,clear:""})}return{defaultValue:i,value:e("inputValue"),onChange(r){var s;const l=o(),c=(l.previousEvent||l).src;(s=e("onInputValueChange"))==null||s({inputValue:r,reason:c})}}}),highlightedItem:t(()=>{const i=e("highlightedValue");return{defaultValue:e("collection").find(i)}}),selectedItems:t(()=>{const i=e("value")||e("defaultValue")||[];return{defaultValue:e("collection").findMany(i)}})}},computed:{isInputValueEmpty:({context:e})=>e.get("inputValue").length===0,isInteractive:({prop:e})=>!(e("readOnly")||e("disabled")),autoComplete:({prop:e})=>e("inputBehavior")==="autocomplete",autoHighlight:({prop:e})=>e("inputBehavior")==="autohighlight",hasSelectedItems:({context:e})=>e.get("value").length>0,valueAsString:({context:e,prop:t})=>t("collection").stringifyItems(e.get("selectedItems")),isCustomValue:({context:e,computed:t})=>e.get("inputValue")!==t("valueAsString")},watch({context:e,prop:t,track:n,action:o,send:i}){n([()=>e.hash("value")],()=>{o(["syncSelectedItems"])}),n([()=>e.get("inputValue")],()=>{o(["syncInputValue"])}),n([()=>e.get("highlightedValue")],()=>{o(["syncHighlightedItem","autofillInputValue"])}),n([()=>t("open")],()=>{o(["toggleVisibility"])}),n([()=>t("collection").toString()],()=>{i({type:"CHILDREN_CHANGE"})})},on:{"SELECTED_ITEMS.SYNC":{actions:["syncSelectedItems"]},"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedValue"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedValue"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setValue"]},"INPUT_VALUE.SET":{actions:["setInputValue"]},"POSITIONING.SET":{actions:["reposition"]}},entry:WO([{guard:"autoFocus",actions:["setInitialFocus"]}]),states:{idle:{tags:["idle","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":{target:"interacting"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{target:"focused",actions:["clearInputValue","clearSelectedItems","setInitialFocus"]}}},focused:{tags:["focused","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":[{guard:"isChangeEvent",target:"suggesting"},{target:"interacting"}],"INPUT.CHANGE":[{guard:Ue("isOpenControlled","openOnChange"),actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{guard:"openOnChange",target:"suggesting",actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{actions:["setInputValue"]}],"LAYER.INTERACT_OUTSIDE":{target:"idle"},"INPUT.ESCAPE":{guard:Ue("isCustomValue",yt("allowCustomValue")),actions:["revertInputValue"]},"INPUT.BLUR":{target:"idle"},"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_DOWN":[{guard:Ue("isOpenControlled","autoComplete"),actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"isOpenControlled",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_UP":[{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems"]}}},interacting:{tags:["open","focused"],entry:["setInitialFocus"],effects:["scrollToHighlightedItem","trackDismissableLayer","trackPlacement","hideOtherElements"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]},{actions:["scrollToHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"]},"INPUT.END":{actions:["highlightLastItem"]},"INPUT.ARROW_DOWN":[{guard:Ue("autoComplete","isLastItemHighlighted"),actions:["clearHighlightedValue","scrollContentToTop"]},{actions:["highlightNextItem"]}],"INPUT.ARROW_UP":[{guard:Ue("autoComplete","isFirstItemHighlighted"),actions:["clearHighlightedValue"]},{actions:["highlightPrevItem"]}],"INPUT.ENTER":[{guard:Ue("isOpenControlled","isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":[{guard:"autoComplete",target:"suggesting",actions:["setInputValue"]},{target:"suggesting",actions:["clearHighlightedValue","setInputValue"]}],"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.CLICK":[{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],"LAYER.ESCAPE":[{guard:Ue("isOpenControlled","autoComplete"),actions:["syncInputValue","invokeOnClose"]},{guard:"autoComplete",target:"focused",actions:["syncInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"LAYER.INTERACT_OUTSIDE":[{guard:Ue("isOpenControlled","isCustomValue",yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}},suggesting:{tags:["open","focused"],effects:["trackDismissableLayer","scrollToHighlightedItem","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"autoHighlight",actions:["highlightFirstItem"]},{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]}],"INPUT.ARROW_DOWN":{target:"interacting",actions:["highlightNextItem"]},"INPUT.ARROW_UP":{target:"interacting",actions:["highlightPrevItem"]},"INPUT.HOME":{target:"interacting",actions:["highlightFirstItem"]},"INPUT.END":{target:"interacting",actions:["highlightLastItem"]},"INPUT.ENTER":[{guard:Ue("isOpenControlled","isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("hasHighlightedItem"),yt("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":{actions:["setInputValue"]},"LAYER.ESCAPE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.POINTER_MOVE":{target:"interacting",actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"LAYER.INTERACT_OUTSIDE":[{guard:Ue("isOpenControlled","isCustomValue",yt("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:Ue("isCustomValue",yt("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.CLICK":[{guard:Ue("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}}},implementations:{guards:{isInputValueEmpty:({computed:e})=>e("isInputValueEmpty"),autoComplete:({computed:e,prop:t})=>e("autoComplete")&&!t("multiple"),autoHighlight:({computed:e})=>e("autoHighlight"),isFirstItemHighlighted:({prop:e,context:t})=>e("collection").firstValue===t.get("highlightedValue"),isLastItemHighlighted:({prop:e,context:t})=>e("collection").lastValue===t.get("highlightedValue"),isCustomValue:({computed:e})=>e("isCustomValue"),allowCustomValue:({prop:e})=>!!e("allowCustomValue"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null,openOnChange:({prop:e,context:t})=>{const n=e("openOnChange");return ZC(n)?n:!!(n!=null&&n({inputValue:t.get("inputValue")}))},restoreFocus:({event:e})=>e.restoreFocus==null?!0:!!e.restoreFocus,isChangeEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="INPUT.CHANGE"},autoFocus:({prop:e})=>!!e("autoFocus"),isHighlightedItemRemoved:({prop:e,context:t})=>!e("collection").has(t.get("highlightedValue"))},effects:{trackDismissableLayer({send:e,prop:t,scope:n}){return t("disableLayer")?void 0:ia(()=>to(n),{type:"listbox",defer:!0,exclude:()=>[Ti(n),Ka(n),bf(n)],onFocusOutside:t("onFocusOutside"),onPointerDownOutside:t("onPointerDownOutside"),onInteractOutside:t("onInteractOutside"),onEscapeKeyDown(o){o.preventDefault(),o.stopPropagation(),e({type:"LAYER.ESCAPE",src:"escape-key"})},onDismiss(){e({type:"LAYER.INTERACT_OUTSIDE",src:"interact-outside",restoreFocus:!1})}})},hideOtherElements({scope:e}){return xk([Ti(e),to(e),Ka(e),bf(e)])},trackPlacement({context:e,prop:t,scope:n}){const o=()=>vf(n)||Ka(n),i=()=>mf(n);return e.set("currentPlacement",t("positioning").placement),Et(o,i,{...t("positioning"),defer:!0,onComplete(a){e.set("currentPlacement",a.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n,event:o}){const i=Ti(n);let a=[];const r=c=>{const d=o.current().type.includes("POINTER"),u=e.get("highlightedValue");if(d||!u)return;const h=to(n),p=t("scrollToIndexFn");if(p){const b=t("collection").indexOf(u);p({index:b,immediate:c,getElement:()=>Ca(n,u)});return}const m=Ca(n,u),f=ae(()=>{yr(m,{rootEl:h,block:"nearest"})});a.push(f)},s=ae(()=>r(!0));a.push(s);const l=Nr(i,{attributes:["aria-activedescendant"],callback:()=>r(!1)});return a.push(l),()=>{a.forEach(c=>c())}}},actions:{reposition({context:e,prop:t,scope:n,event:o}){Et(()=>vf(n),()=>mf(n),{...t("positioning"),...o.options,defer:!0,listeners:!1,onComplete(i){e.set("currentPlacement",i.placement)}})},setHighlightedValue({context:e,event:t}){t.value!=null&&e.set("highlightedValue",t.value)},clearHighlightedValue({context:e}){e.set("highlightedValue",null)},selectHighlightedItem(e){var t;const{context:n,prop:o}=e,i=o("collection"),a=n.get("highlightedValue");if(!a||!i.has(a))return;const r=o("multiple")?Zo(n.get("value"),a):[a];(t=o("onSelect"))==null||t({value:r,itemValue:a}),n.set("value",r);const s=ut(o("selectionBehavior"),{preserve:n.get("inputValue"),replace:i.stringifyMany(r),clear:""});n.set("inputValue",s)},scrollToHighlightedItem({context:e,prop:t,scope:n}){pc(()=>{const o=e.get("highlightedValue");if(o==null)return;const i=Ca(n,o),a=to(n),r=t("scrollToIndexFn");if(r){const s=t("collection").indexOf(o);r({index:s,immediate:!0,getElement:()=>Ca(n,o)});return}yr(i,{rootEl:a,block:"nearest"})})},selectItem(e){const{context:t,event:n,flush:o,prop:i}=e;n.value!=null&&o(()=>{var a;const r=i("multiple")?Zo(t.get("value"),n.value):[n.value];(a=i("onSelect"))==null||a({value:r,itemValue:n.value}),t.set("value",r);const s=ut(i("selectionBehavior"),{preserve:t.get("inputValue"),replace:i("collection").stringifyMany(r),clear:""});t.set("inputValue",s)})},clearItem(e){const{context:t,event:n,flush:o,prop:i}=e;n.value!=null&&o(()=>{const a=qo(t.get("value"),n.value);t.set("value",a);const r=ut(i("selectionBehavior"),{preserve:t.get("inputValue"),replace:i("collection").stringifyMany(a),clear:""});t.set("inputValue",r)})},setInitialFocus({scope:e}){ae(()=>{yf(e)})},setFinalFocus({scope:e}){ae(()=>{const t=Ka(e);t?.dataset.focusable==null?yf(e):zO(e)})},syncInputValue({context:e,scope:t,event:n}){const o=Ti(t);o&&(o.value=e.get("inputValue"),queueMicrotask(()=>{n.current().type!=="INPUT.CHANGE"&&P1(o)}))},setInputValue({context:e,event:t}){e.set("inputValue",t.value)},clearInputValue({context:e}){e.set("inputValue","")},revertInputValue({context:e,prop:t,computed:n}){const o=t("selectionBehavior"),i=ut(o,{replace:n("hasSelectedItems")?n("valueAsString"):"",preserve:e.get("inputValue"),clear:""});e.set("inputValue",i)},setValue(e){const{context:t,flush:n,event:o,prop:i}=e;n(()=>{t.set("value",o.value);const a=ut(i("selectionBehavior"),{preserve:t.get("inputValue"),replace:i("collection").stringifyMany(o.value),clear:""});t.set("inputValue",a)})},clearSelectedItems(e){const{context:t,flush:n,prop:o}=e;n(()=>{t.set("value",[]);const i=ut(o("selectionBehavior"),{preserve:t.get("inputValue"),replace:o("collection").stringifyMany([]),clear:""});t.set("inputValue",i)})},scrollContentToTop({prop:e,scope:t}){const n=e("scrollToIndexFn");if(n){const o=e("collection").firstValue;n({index:0,immediate:!0,getElement:()=>Ca(t,o)})}else{const o=to(t);if(!o)return;o.scrollTop=0}},invokeOnOpen({prop:e,event:t}){var n;const o=xf(t);(n=e("onOpenChange"))==null||n({open:!0,reason:o})},invokeOnClose({prop:e,event:t}){var n;const o=xf(t);(n=e("onOpenChange"))==null||n({open:!1,reason:o})},highlightFirstItem({context:e,prop:t,scope:n}){(to(n)?queueMicrotask:ae)(()=>{const o=t("collection").firstValue;o&&e.set("highlightedValue",o)})},highlightFirstItemIfNeeded({computed:e,action:t}){e("autoHighlight")&&t(["highlightFirstItem"])},highlightLastItem({context:e,prop:t,scope:n}){(to(n)?queueMicrotask:ae)(()=>{const o=t("collection").lastValue;o&&e.set("highlightedValue",o)})},highlightNextItem({context:e,prop:t}){let n=null;const o=e.get("highlightedValue"),i=t("collection");o?(n=i.getNextValue(o),!n&&t("loopFocus")&&(n=i.firstValue)):n=i.firstValue,n&&e.set("highlightedValue",n)},highlightPrevItem({context:e,prop:t}){let n=null;const o=e.get("highlightedValue"),i=t("collection");o?(n=i.getPreviousValue(o),!n&&t("loopFocus")&&(n=i.lastValue)):n=i.lastValue,n&&e.set("highlightedValue",n)},highlightFirstSelectedItem({context:e,prop:t}){ae(()=>{const[n]=t("collection").sort(e.get("value"));n&&e.set("highlightedValue",n)})},highlightFirstOrSelectedItem({context:e,prop:t,computed:n}){ae(()=>{let o=null;n("hasSelectedItems")?o=t("collection").sort(e.get("value"))[0]:o=t("collection").firstValue,o&&e.set("highlightedValue",o)})},highlightLastOrSelectedItem({context:e,prop:t,computed:n}){ae(()=>{const o=t("collection");let i=null;n("hasSelectedItems")?i=o.sort(e.get("value"))[0]:i=o.lastValue,i&&e.set("highlightedValue",i)})},autofillInputValue({context:e,computed:t,prop:n,event:o,scope:i}){const a=Ti(i),r=n("collection");if(!t("autoComplete")||!a||!o.keypress)return;const s=r.stringify(e.get("highlightedValue"));ae(()=>{a.value=s||e.get("inputValue")})},syncSelectedItems(e){queueMicrotask(()=>{const{context:t,prop:n}=e,o=n("collection"),i=t.get("value"),a=i.map(s=>t.get("selectedItems").find(l=>o.getItemValue(l)===s)||o.find(s));t.set("selectedItems",a);const r=ut(n("selectionBehavior"),{preserve:t.get("inputValue"),replace:o.stringifyMany(i),clear:""});t.set("inputValue",r)})},syncHighlightedItem({context:e,prop:t}){const n=t("collection").find(e.get("highlightedValue"));e.set("highlightedItem",n)},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}});function xf(e){return(e.previousEvent||e).src}ee()(["allowCustomValue","autoFocus","closeOnSelect","collection","composite","defaultHighlightedValue","defaultInputValue","defaultOpen","defaultValue","dir","disabled","disableLayer","form","getRootNode","highlightedValue","id","ids","inputBehavior","inputValue","invalid","loopFocus","multiple","name","navigate","onFocusOutside","onHighlightChange","onInputValueChange","onInteractOutside","onOpenChange","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","openOnChange","openOnClick","openOnKeyPress","placeholder","positioning","readOnly","required","scrollToIndexFn","selectionBehavior","translations","value","alwaysSubmitOnEnter"]);ee()(["htmlFor"]);ee()(["id"]);ee()(["item","persistFocus"]);uy.extendWith("empty");function Zc(e,t){return e-t*Math.floor(e/t)}const py=1721426;function fs(e,t,n,o){t=Oh(e,t);let i=t-1,a=-2;return n<=2?a=0:sl(t)&&(a=-1),py-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+o)}function sl(e){return e%4===0&&(e%100!==0||e%400===0)}function Oh(e,t){return e==="BC"?1-t:t}function UO(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const GO={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]};let Yi=class{fromJulianDay(t){let n=t,o=n-py,i=Math.floor(o/146097),a=Zc(o,146097),r=Math.floor(a/36524),s=Zc(a,36524),l=Math.floor(s/1461),c=Zc(s,1461),d=Math.floor(c/365),u=i*400+r*100+l*4+d+(r!==4&&d!==4?1:0),[h,p]=UO(u),m=n-fs(h,p,1,1),f=2;n<fs(h,p,3,1)?f=0:sl(p)&&(f=1);let b=Math.floor(((m+f)*12+373)/367),g=n-fs(h,p,b,1)+1;return new jl(h,p,b,g)}toJulianDay(t){return fs(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return GO[sl(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return sl(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}};const qO={"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 li(e,t){return t=$t(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function YO(e,t){return t=$t(t,e.calendar),e=Rn(e),t=Rn(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function KO(e,t){return t=$t(t,e.calendar),e=$r(e),t=$r(t),e.era===t.era&&e.year===t.year}function XO(e,t){return Oc(e.calendar,t.calendar)&&li(e,t)}function ZO(e,t){return Oc(e.calendar,t.calendar)&&YO(e,t)}function JO(e,t){return Oc(e.calendar,t.calendar)&&KO(e,t)}function Oc(e,t){var n,o,i,a;return(a=(i=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&i!==void 0?i:(o=t.isEqual)===null||o===void 0?void 0:o.call(t,e))!==null&&a!==void 0?a:e.identifier===t.identifier}function QO(e,t){return li(e,Tc(t))}const eT={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function fy(e,t,n){let o=e.calendar.toJulianDay(e),i=n?eT[n]:oT(t),a=Math.ceil(o+1-i)%7;return a<0&&(a+=7),a}function gy(e){return An(Date.now(),e)}function Tc(e){return Yo(gy(e))}function my(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function tT(e,t){return wf(e)-wf(t)}function wf(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Jc=null;function Th(){return Jc==null&&(Jc=new Intl.DateTimeFormat().resolvedOptions().timeZone),Jc}function Rn(e){return e.subtract({days:e.day-1})}function Xd(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function $r(e){return Rn(e.subtract({months:e.month-1}))}function nT(e){return Xd(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function kr(e,t,n){let o=fy(e,t,n);return e.subtract({days:o})}function Cf(e,t,n){return kr(e,t,n).add({days:6})}const _f=new Map,Qc=new Map;function vy(e){if(Intl.Locale){let n=_f.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&_f.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function oT(e){let t=Qc.get(e);if(!t){if(Intl.Locale){let o=new Intl.Locale(e);if("getWeekInfo"in o&&(t=o.getWeekInfo(),t))return Qc.set(e,t),t.firstDay}let n=vy(e);if(e.includes("-fw-")){let o=e.split("-fw-")[1].split("-")[0];o==="mon"?t={firstDay:1}:o==="tue"?t={firstDay:2}:o==="wed"?t={firstDay:3}:o==="thu"?t={firstDay:4}:o==="fri"?t={firstDay:5}:o==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&qO[n]||0};Qc.set(e,t)}return t.firstDay}function iT(e,t,n){let o=e.calendar.getDaysInMonth(e);return Math.ceil((fy(Rn(e),t,n)+o)/7)}function by(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function yy(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const aT={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 rT(e,t){let n=e.calendar.toJulianDay(e),o=Math.ceil(n+1)%7;o<0&&(o+=7);let i=vy(t),[a,r]=aT[i]||[6,0];return o===a||o===r}function Ki(e){e=$t(e,new Yi);let t=Oh(e.era,e.year);return xy(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function xy(e,t,n,o,i,a,r){let s=new Date;return s.setUTCHours(o,i,a,r),s.setUTCFullYear(e,t-1,n),s.getTime()}function Zd(e,t){if(t==="UTC")return 0;if(e>0&&t===Th())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:o,day:i,hour:a,minute:r,second:s}=wy(e,t);return xy(n,o,i,a,r,s,0)-Math.floor(e/1e3)*1e3}const $f=new Map;function wy(e,t){let n=$f.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"}),$f.set(t,n));let o=n.formatToParts(new Date(e)),i={};for(let a of o)a.type!=="literal"&&(i[a.type]=a.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const kf=864e5;function sT(e,t,n,o){return(n===o?[n]:[n,o]).filter(i=>lT(e,t,i))}function lT(e,t,n){let o=wy(n,t);return e.year===o.year&&e.month===o.month&&e.day===o.day&&e.hour===o.hour&&e.minute===o.minute&&e.second===o.second}function Vn(e,t,n="compatible"){let o=ei(e);if(t==="UTC")return Ki(o);if(t===Th()&&n==="compatible"){o=$t(o,new Yi);let l=new Date,c=Oh(o.era,o.year);return l.setFullYear(c,o.month-1,o.day),l.setHours(o.hour,o.minute,o.second,o.millisecond),l.getTime()}let i=Ki(o),a=Zd(i-kf,t),r=Zd(i+kf,t),s=sT(o,t,i-a,i-r);if(s.length===1)return s[0];if(s.length>1)switch(n){case"compatible":case"earlier":return s[0];case"later":return s[s.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-a,i-r);case"compatible":case"later":return Math.max(i-a,i-r);case"reject":throw new RangeError("No such absolute time found")}}function Cy(e,t,n="compatible"){return new Date(Vn(e,t,n))}function An(e,t){let n=Zd(e,t),o=new Date(e+n),i=o.getUTCFullYear(),a=o.getUTCMonth()+1,r=o.getUTCDate(),s=o.getUTCHours(),l=o.getUTCMinutes(),c=o.getUTCSeconds(),d=o.getUTCMilliseconds();return new Iy(i<1?"BC":"AD",i<1?-i+1:i,a,r,t,n,s,l,c,d)}function Yo(e){return new jl(e.calendar,e.era,e.year,e.month,e.day)}function ei(e,t){let n=0,o=0,i=0,a=0;if("timeZone"in e)({hour:n,minute:o,second:i,millisecond:a}=e);else if("hour"in e)return e;return new kT(e.calendar,e.era,e.year,e.month,e.day,n,o,i,a)}function $t(e,t){if(Oc(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),o=e.copy();return o.calendar=t,o.era=n.era,o.year=n.year,o.month=n.month,o.day=n.day,ti(o),o}function cT(e,t,n){if(e instanceof Iy)return e.timeZone===t?e:uT(e,t);let o=Vn(e,t,n);return An(o,t)}function dT(e){let t=Ki(e)-e.offset;return new Date(t)}function uT(e,t){let n=Ki(e)-e.offset;return $t(An(n,t),e.calendar)}const _a=36e5;function Ic(e,t){let n=e.copy(),o="hour"in n?gT(n,t):0;Jd(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Qd(n),_y(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=o,hT(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,r;let l=(a=(r=n.calendar).isInverseEra)===null||a===void 0?void 0:a.call(r,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Jd(e,t){var n,o;!((n=(o=e.calendar).isInverseEra)===null||n===void 0)&&n.call(o,e)&&(t=-t),e.year+=t}function Qd(e){for(;e.month<1;)Jd(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Jd(e,1)}function hT(e){for(;e.day<1;)e.month--,Qd(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Qd(e)}function _y(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 ti(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),_y(e)}function $y(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function ky(e,t){return Ic(e,$y(t))}function Ih(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),ti(n),n}function Hl(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),fT(n),n}function pT(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=gs(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=gs(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=gs(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=gs(e.hour,24),t}function fT(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 gs(e,t){let n=e%t;return n<0&&(n+=t),n}function gT(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,pT(e)}function Ph(e,t,n,o){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),l=s.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=Fn(l,n,0,s.length-1,o?.round),i.era=s[l],ti(i);break}case"year":var a,r;!((a=(r=i.calendar).isInverseEra)===null||a===void 0)&&a.call(r,i)&&(n=-n),i.year=Fn(e.year,n,-1/0,9999,o?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=Fn(e.month,n,1,e.calendar.getMonthsInYear(e),o?.round);break;case"day":i.day=Fn(e.day,n,1,e.calendar.getDaysInMonth(e),o?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),ti(i),i}function Sy(e,t,n,o){let i=e.copy();switch(t){case"hour":{let a=e.hour,r=0,s=23;if(o?.hourCycle===12){let l=a>=12;r=l?12:0,s=l?23:11}i.hour=Fn(a,n,r,s,o?.round);break}case"minute":i.minute=Fn(e.minute,n,0,59,o?.round);break;case"second":i.second=Fn(e.second,n,0,59,o?.round);break;case"millisecond":i.millisecond=Fn(e.millisecond,n,0,999,o?.round);break;default:throw new Error("Unsupported field "+t)}return i}function Fn(e,t,n,o,i=!1){if(i){e+=Math.sign(t),e<n&&(e=o);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>o&&(e=n)}else e+=t,e<n?e=o-(n-e-1):e>o&&(e=n+(e-o-1));return e}function Ey(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 i=Ic(ei(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Vn(i,e.timeZone)}else n=Ki(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let o=An(n,e.timeZone);return $t(o,e.calendar)}function mT(e,t){return Ey(e,$y(t))}function vT(e,t,n,o){switch(t){case"hour":{let i=0,a=23;if(o?.hourCycle===12){let m=e.hour>=12;i=m?12:0,a=m?23:11}let r=ei(e),s=$t(Hl(r,{hour:i}),new Yi),l=[Vn(s,e.timeZone,"earlier"),Vn(s,e.timeZone,"later")].filter(m=>An(m,e.timeZone).day===s.day)[0],c=$t(Hl(r,{hour:a}),new Yi),d=[Vn(c,e.timeZone,"earlier"),Vn(c,e.timeZone,"later")].filter(m=>An(m,e.timeZone).day===c.day).pop(),u=Ki(e)-e.offset,h=Math.floor(u/_a),p=u%_a;return u=Fn(h,n,Math.floor(l/_a),Math.floor(d/_a),o?.round)*_a+p,$t(An(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Sy(e,t,n,o);case"era":case"year":case"month":case"day":{let i=Ph(ei(e),t,n,o),a=Vn(i,e.timeZone);return $t(An(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function bT(e,t,n){let o=ei(e),i=Hl(Ih(o,t),t);if(i.compare(o)===0)return e;let a=Vn(i,e.timeZone,n);return $t(An(a,e.timeZone),e.calendar)}function yT(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 Oy(e){let t=$t(e,new Yi),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 Ty(e){return`${Oy(e)}T${yT(e)}`}function xT(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),o=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return i!==0&&(a+=`:${String(i).padStart(2,"0")}`),a}function wT(e){return`${Ty(e)}${xT(e.offset)}[${e.timeZone}]`}function CT(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vh(e,t,n){CT(e,t),t.set(e,n)}function Dh(e){let t=typeof e[0]=="object"?e.shift():new Yi,n;if(typeof e[0]=="string")n=e.shift();else{let r=t.getEras();n=r[r.length-1]}let o=e.shift(),i=e.shift(),a=e.shift();return[t,n,o,i,a]}var _T=new WeakMap;let jl=class eu{copy(){return this.era?new eu(this.calendar,this.era,this.year,this.month,this.day):new eu(this.calendar,this.year,this.month,this.day)}add(t){return Ic(this,t)}subtract(t){return ky(this,t)}set(t){return Ih(this,t)}cycle(t,n,o){return Ph(this,t,n,o)}toDate(t){return Cy(this,t)}toString(){return Oy(this)}compare(t){return my(this,t)}constructor(...t){Vh(this,_T,{writable:!0,value:void 0});let[n,o,i,a,r]=Dh(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,ti(this)}};var $T=new WeakMap;let kT=class tu{copy(){return this.era?new tu(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new tu(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Ic(this,t)}subtract(t){return ky(this,t)}set(t){return Ih(Hl(this,t),t)}cycle(t,n,o){switch(t){case"era":case"year":case"month":case"day":return Ph(this,t,n,o);default:return Sy(this,t,n,o)}}toDate(t,n){return Cy(this,t,n)}toString(){return Ty(this)}compare(t){let n=my(this,t);return n===0?tT(this,ei(t)):n}constructor(...t){Vh(this,$T,{writable:!0,value:void 0});let[n,o,i,a,r]=Dh(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ti(this)}};var ST=new WeakMap;let Iy=class nu{copy(){return this.era?new nu(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new nu(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Ey(this,t)}subtract(t){return mT(this,t)}set(t,n){return bT(this,t,n)}cycle(t,n,o){return vT(this,t,n,o)}toDate(){return dT(this)}toString(){return wT(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-cT(t,this.timeZone).toDate().getTime()}constructor(...t){Vh(this,ST,{writable:!0,value:void 0});let[n,o,i,a,r]=Dh(t),s=t.shift(),l=t.shift();this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.timeZone=s,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ti(this)}},ed=new Map,bn=class{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 o=this.formatter.formatToParts(t),i=this.formatter.formatToParts(n);return[...o.map(a=>({...a,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(a=>({...a,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return TT()&&(this.resolvedHourCycle||(this.resolvedHourCycle=IT(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=Py(t,n),this.options=n}};const ET={true:{ja:"h11"},false:{}};function Py(e,t={}){if(typeof t.hour12=="boolean"&&OT()){t={...t};let i=ET[String(t.hour12)][e.split("-")[0]],a=t.hour12?"h12":"h23";t.hourCycle=i??a,delete t.hour12}let n=e+(t?Object.entries(t).sort((i,a)=>i[0]<a[0]?-1:1).join():"");if(ed.has(n))return ed.get(n);let o=new Intl.DateTimeFormat(e,t);return ed.set(n,o),o}let td=null;function OT(){return td==null&&(td=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),td}let nd=null;function TT(){return nd==null&&(nd=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),nd}function IT(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=Py(e,{...t,timeZone:void 0}),o=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(a=>a.type==="hour").value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(a=>a.type==="hour").value,10);if(o===0&&i===23)return"h23";if(o===24&&i===23)return"h24";if(o===0&&i===11)return"h11";if(o===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function PT(e,t,n,o,i){const a={};for(let s in t){const l=s,c=t[l];c!=null&&(a[l]=Math.floor(c/2),a[l]>0&&c%2===0&&a[l]--)}const r=ci(e,t,n).subtract(a);return Yr(e,r,t,n,o,i)}function ci(e,t,n,o,i){let a=e;return t.years?a=$r(e):t.months?a=Rn(e):t.weeks&&(a=kr(e,n)),Yr(e,a,t,n,o,i)}function Mh(e,t,n,o,i){let a={...t};a.days?a.days--:a.weeks?a.weeks--:a.months?a.months--:a.years&&a.years--;let r=ci(e,t,n).subtract(a);return Yr(e,r,t,n,o,i)}function Yr(e,t,n,o,i,a){return i&&e.compare(i)>=0&&(t=yy(t,ci(Yo(i),n,o))),a&&e.compare(a)<=0&&(t=by(t,Mh(Yo(a),n,o))),t}function Zt(e,t,n){let o=Yo(e);return t&&(o=yy(o,Yo(t))),n&&(o=by(o,Yo(n))),o}function Sf(e,t,n,o,i,a){switch(t){case"start":return ci(e,n,o,i,a);case"end":return Mh(e,n,o,i,a);case"center":default:return PT(e,n,o,i,a)}}function _t(e,t){return t!=null&&li(e,t)}function Ef(e,t,n,o,i){return e?t!=null&&t(e,n)?!0:pn(e,o,i):!1}function pn(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function VT(e,t,n){const o=e.subtract({days:1});return li(o,e)||pn(o,t,n)}function DT(e,t,n){const o=e.add({days:1});return li(o,e)||pn(o,t,n)}function Rh(e){let t={...e};for(let n in t)t[n]=1;return t}function Vy(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Dy(e){return e?.calendar.identifier==="gregory"&&e.era==="BC"?"short":void 0}function My(e,t){const n=ei(Tc(t));return new bn(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Dy(n),timeZone:t})}function Of(e,t){const n=Tc(t);return new bn(e,{month:"long",year:"numeric",era:Dy(n),calendar:n?.calendar.identifier,timeZone:t})}function MT(e,t,n,o,i){let a=n.formatRangeToParts(e.toDate(i),t.toDate(i)),r=-1;for(let c=0;c<a.length;c++){let d=a[c];if(d.source==="shared"&&d.type==="literal")r=c;else if(d.source==="endRange")break}let s="",l="";for(let c=0;c<a.length;c++)c<r?s+=a[c].value:c>r&&(l+=a[c].value);return o(s,l)}function RT(e,t,n,o){let i=e,a=e,r=My(n,o);return li(i,a)?r.format(i.toDate(o)):MT(i,a,r,(s,l)=>`${s} – ${l}`,o)}var AT=["sun","mon","tue","wed","thu","fri","sat"];function Ry(e){return e!=null?AT[e]:void 0}function Ay(e,t,n){const o=Ry(n);return kr(e,t,o)}function Fy(e,t,n,o){const i=t.add({weeks:e}),a=[];let r=Ay(i,n,o);for(;a.length<7;){a.push(r);let s=r.add({days:1});if(li(r,s))break;r=s}return a}function FT(e,t,n,o){const i=Ry(o),a=n??iT(e,t,i);return[...new Array(a).keys()].map(r=>Fy(r,e,t,o))}function NT(e,t){const n=new bn(e,{weekday:"long",timeZone:t}),o=new bn(e,{weekday:"short",timeZone:t}),i=new bn(e,{weekday:"narrow",timeZone:t});return a=>{const r=a instanceof Date?a:a.toDate(t);return{value:a,short:o.format(r),long:n.format(r),narrow:i.format(r)}}}function LT(e,t,n,o){const i=Ay(e,o,t),a=[...new Array(7).keys()],r=NT(o,n);return a.map(s=>r(i.add({days:s})))}function BT(e,t="long"){const n=new Date(2021,0,1),o=[];for(let i=0;i<12;i++)o.push(n.toLocaleString(e,{month:t})),n.setMonth(n.getMonth()+1);return o}function zT(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var HT=10;function jT(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,o=parseInt(e.slice(-2),10),i=n+o;return i>t+HT?(i-100).toString():i.toString()}return e}}function sr(e,t){const n=t!=null&&t.strict?10:12,o=e-e%10,i=[];for(let a=0;a<n;a+=1){const r=o+a;i.push(r)}return i}function Fi(e){return Tc(e??Th())}function Kr(e,t,n,o){return function(i){const{startDate:a,focusedDate:r}=i,s=Vy(a,e);return pn(r,n,o)?{startDate:a,focusedDate:Zt(r,n,o),endDate:s}:r.compare(a)<0?{startDate:Mh(r,e,t,n,o),focusedDate:Zt(r,n,o),endDate:s}:r.compare(s)>0?{startDate:ci(r,e,t,n,o),endDate:s,focusedDate:Zt(r,n,o)}:{startDate:a,endDate:s,focusedDate:Zt(r,n,o)}}}function Ny(e,t,n,o,i,a){const r=Kr(n,o,i,a),s=t.add(n);return r({focusedDate:e.add(n),startDate:ci(Yr(e,s,n,o,i,a),n,o)})}function Ly(e,t,n,o,i,a){const r=Kr(n,o,i,a);let s=t.subtract(n);return r({focusedDate:e.subtract(n),startDate:ci(Yr(e,s,n,o,i,a),n,o)})}function WT(e,t,n,o,i,a,r){const s=Kr(o,i,a,r);if(!n&&!o.days)return s({focusedDate:e.add(Rh(o)),startDate:t});if(o.days)return Ny(e,t,o,i,a,r);if(o.weeks)return s({focusedDate:e.add({months:1}),startDate:t});if(o.months||o.years)return s({focusedDate:e.add({years:1}),startDate:t})}function UT(e,t,n,o,i,a,r){const s=Kr(o,i,a,r);if(!n&&!o.days)return s({focusedDate:e.subtract(Rh(o)),startDate:t});if(o.days)return Ly(e,t,o,i,a,r);if(o.weeks)return s({focusedDate:e.subtract({months:1}),startDate:t});if(o.months||o.years)return s({focusedDate:e.subtract({years:1}),startDate:t})}var Tf=e=>e!=null&&e.length===4,GT=e=>e!=null&&parseFloat(e)<=12,qT=e=>e!=null&&parseFloat(e)<=31;function YT(e,t,n){const o=KT(t,n);let{year:i,month:a,day:r}=XT(o,e)??{};if(i!=null||a!=null||r!=null){const l=new Date;i||(i=l.getFullYear().toString()),a||(a=(l.getMonth()+1).toString()),r||(r=l.getDate().toString())}if(Tf(i)||(i=jT(i)),Tf(i)&>(a)&&qT(r))return new jl(+i,+a,+r);const s=Date.parse(e);if(!isNaN(s)){const l=new Date(s);return new jl(l.getFullYear(),l.getMonth()+1,l.getDate())}}function KT(e,t){return new bn(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:n,value:o})=>n==="literal"?`${o}?`:`((?!=<${n}>)\\d+)?`).join("")}function XT(e,t){var n;const o=t.match(e);return(n=e.toString().match(/<(.+?)>/g))==null?void 0:n.map(i=>{var a;const r=i.match(/<(.+)>/);return!r||r.length<=0?null:(a=i.match(/<(.+)>/))==null?void 0:a[1]}).reduce((i,a,r)=>(a&&(o&&o.length>r?i[a]=o[r+1]:i[a]=null),i),{})}function If(e,t,n){const o=Yo(gy(n));switch(e){case"thisWeek":return[kr(o,t),Cf(o,t)];case"thisMonth":return[Rn(o),o];case"thisQuarter":return[Rn(o).add({months:-((o.month-1)%3)}),o];case"thisYear":return[$r(o),o];case"last3Days":return[o.add({days:-2}),o];case"last7Days":return[o.add({days:-6}),o];case"last14Days":return[o.add({days:-13}),o];case"last30Days":return[o.add({days:-29}),o];case"last90Days":return[o.add({days:-89}),o];case"lastMonth":return[Rn(o.add({months:-1})),Xd(o.add({months:-1}))];case"lastQuarter":return[Rn(o.add({months:-((o.month-1)%3)-3})),Xd(o.add({months:-((o.month-1)%3)-1}))];case"lastWeek":return[kr(o,t).add({weeks:-1}),Cf(o,t).add({weeks:-1})];case"lastYear":return[$r(o.add({years:-1})),nT(o.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var ms="__live-region__";function By(e={}){const{level:t="polite",document:n=document,root:o,delay:i=0}=e,a=n.defaultView??window,r=o??n.body;function s(c,d){const u=n.getElementById(ms);u?.remove(),d=d??i;const h=n.createElement("span");h.id=ms,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"}),r.appendChild(h),a.setTimeout(()=>{h.textContent=c},d)}function l(){const c=n.getElementById(ms);c?.remove()}return{announce:s,destroy:l,toJSON(){return ms}}}var zy=le("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"),ke=zy.build(),ZT=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.label)==null?void 0:o.call(n,t))??`datepicker:${e.id}:label:${t}`},JT=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`datepicker:${e.id}`},QT=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.table)==null?void 0:o.call(n,t))??`datepicker:${e.id}:table:${t}`},ou=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`datepicker:${e.id}:content`},od=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.cellTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:cell-trigger:${t}`},eI=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.prevTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:prev:${t}`},tI=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.nextTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:next:${t}`},nI=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.viewTrigger)==null?void 0:o.call(n,t))??`datepicker:${e.id}:view:${t}`},Hy=e=>{var t;return((t=e.ids)==null?void 0:t.clearTrigger)??`datepicker:${e.id}:clear`},jy=e=>{var t;return((t=e.ids)==null?void 0:t.control)??`datepicker:${e.id}:control`},Pf=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.input)==null?void 0:o.call(n,t))??`datepicker:${e.id}:input:${t}`},Wy=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`datepicker:${e.id}:trigger`},Uy=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`datepicker:${e.id}:positioner`},Gy=e=>{var t;return((t=e.ids)==null?void 0:t.monthSelect)??`datepicker:${e.id}:month-select`},qy=e=>{var t;return((t=e.ids)==null?void 0:t.yearSelect)??`datepicker:${e.id}:year-select`},Vf=(e,t)=>db(ll(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),Df=e=>e.getById(Wy(e)),ll=e=>e.getById(ou(e)),$a=e=>fo(Yy(e),"[data-part=input]"),oI=e=>e.getById(qy(e)),iI=e=>e.getById(Gy(e)),aI=e=>e.getById(Hy(e)),rI=e=>e.getById(Uy(e)),Yy=e=>e.getById(jy(e));function iu(e){const[t,n]=e;return!t||!n||t.compare(n)<=0?e:[n,t]}function bi(e,t){const[n,o]=t;return!n||!o?!1:n.compare(e)<=0&&o.compare(e)>=0}function vs(e){return e.slice().sort((t,n)=>t.compare(n))}function sI(e){return ut(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var lI={day:"dd",month:"mm",year:"yyyy"};function cI(e){return new bn(e).formatToParts(new Date).map(t=>lI[t.type]??t.value).join("")}var Ky=(e,t)=>e?/\d/.test(e)||e===t||e.length!==1:!0,Mf=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),dI=(e,t)=>e.split("").filter(n=>Ky(n,t)).join("");function uI(e){const t=new Intl.DateTimeFormat(e).formatToParts(new Date).find(n=>n.type==="literal");return t?t.value:"/"}var hI={dayCell(e){return e.unavailable?`Not available. ${e.formattedDate}`:e.selected?`Selected date. ${e.formattedDate}`:`Choose ${e.formattedDate}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return ut(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 ut(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return ut(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"};function zn(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Ah(e){return e===0?"day":e===1?"month":"year"}function Fh(e,t,n){return Ah(Ze(zn(e,0),zn(t,0),zn(n,2)))}function pI(e,t){return zn(e,0)>zn(t,0)}function fI(e,t){return zn(e,0)<zn(t,0)}function gI(e,t,n){const o=zn(e,0)+1;return Fh(Ah(o),t,n)}function mI(e,t,n){const o=zn(e,0)-1;return Fh(Ah(o),t,n)}var vI=["day","month","year"];function bI(e){vI.forEach(t=>e(t))}function yI(e,t){const{state:n,context:o,prop:i,send:a,computed:r,scope:s}=e,l=o.get("startValue"),c=r("endValue"),d=o.get("value"),u=o.get("focusedValue"),h=o.get("hoveredValue"),p=h?iu([d[0],h]):[],m=i("disabled"),f=i("readOnly"),b=r("isInteractive"),g=i("min"),y=i("max"),x=i("locale"),C=i("timeZone"),k=i("startOfWeek"),O=n.matches("focused"),P=n.matches("open"),$=i("selectionMode")==="range",I=i("isDateUnavailable"),A=o.get("currentPlacement"),M=Eh({...i("positioning"),placement:A}),j=uI(x),Q={...hI,...i("translations")};function N(W=l){const L=i("fixedWeeks")?6:void 0;return FT(W,x,L,k)}function B(W={}){const{format:L}=W;return BT(x,L).map((X,ne)=>{const ue=ne+1,ve=u.set({month:ue}),$e=pn(ve,g,y);return{label:X,value:ue,disabled:$e}})}function G(){return zT({from:g?.year??1900,to:y?.year??2100}).map(W=>({label:W.toString(),value:W,disabled:!ar(W,g?.year,y?.year)}))}function J(W){return sr(l.year).map(L=>({label:L.toString(),value:L,disabled:!ar(L,g?.year,y?.year)}))}function Z(W){return Ef(W,I,x,g,y)}function ie(W){const L=l??Fi(C);a({type:"FOCUS.SET",value:L.set({month:W})})}function re(W){const L=l??Fi(C);a({type:"FOCUS.SET",value:L.set({year:W})})}function ce(W){const{value:L,disabled:X}=W,ne=u.set({year:L}),ue=!sr(l.year,{strict:!0}).includes(L),ve=ar(L,g?.year,y?.year),$e={focused:u.year===W.value,selectable:ue||ve,outsideRange:ue,selected:!!d.find(lt=>lt&<.year===L),valueText:L.toString(),inRange:$&&(bi(ne,d)||bi(ne,p)),value:ne,get disabled(){return X||!$e.selectable}};return $e}function pe(W){const{value:L,disabled:X}=W,ne=u.set({month:L}),ue=Of(x,C),ve={focused:u.month===W.value,selectable:!pn(ne,g,y),selected:!!d.find($e=>$e&&$e.month===L&&$e.year===u.year),valueText:ue.format(ne.toDate(C)),inRange:$&&(bi(ne,d)||bi(ne,p)),value:ne,get disabled(){return X||!ve.selectable}};return ve}function me(W){const{value:L,disabled:X,visibleRange:ne=r("visibleRange")}=W,ue=My(x,C),ve=Rh(r("visibleDuration")),$e=i("outsideDaySelectable"),lt=ne.start.add(ve).subtract({days:1}),Yt=pn(L,ne.start,lt),ui=$&&bi(L,d),hi=$&&_t(L,d[0]),ha=$&&_t(L,d[1]),So=$&&p.length>0,pi=So&&bi(L,p),pa=So&&_t(L,p[0]),Ew=So&&_t(L,p[1]),fa={invalid:pn(L,g,y),disabled:X||!$e&&Yt||pn(L,g,y),selected:d.some(Ow=>_t(L,Ow)),unavailable:Ef(L,I,x,g,y)&&!X,outsideRange:Yt,today:QO(L,C),weekend:rT(L,x),formattedDate:ue.format(L.toDate(C)),get focused(){return _t(L,u)&&(!fa.outsideRange||$e)},get ariaLabel(){return Q.dayCell(fa)},get selectable(){return!fa.disabled&&!fa.unavailable},inRange:ui||pi,firstInRange:hi,lastInRange:ha,inHoveredRange:pi,firstInHoveredRange:pa,lastInHoveredRange:Ew};return fa}function _e(W){const{view:L="day",id:X}=W;return[L,X].filter(Boolean).join(" ")}return{focused:O,open:P,inline:!!i("inline"),view:o.get("view"),getRangePresetValue(W){return If(W,x,C)},getDaysInWeek(W,L=l){return Fy(W,L,x,k)},getOffset(W){const L=l.add(W),X=c.add(W),ne=Of(x,C);return{visibleRange:{start:L,end:X},weeks:N(L),visibleRangeText:{start:ne.format(L.toDate(C)),end:ne.format(X.toDate(C))}}},getMonthWeeks:N,isUnavailable:Z,weeks:N(),weekDays:LT(Fi(C),k,C,x),visibleRangeText:r("visibleRangeText"),value:d,valueAsDate:d.filter(W=>W!=null).map(W=>W.toDate(C)),valueAsString:r("valueAsString"),focusedValue:u,focusedValueAsDate:u?.toDate(C),focusedValueAsString:i("format")(u,{locale:x,timeZone:C}),visibleRange:r("visibleRange"),selectToday(){const W=Zt(Fi(C),g,y);a({type:"VALUE.SET",value:W})},setValue(W){const L=W.map(X=>Zt(X,g,y));a({type:"VALUE.SET",value:L})},clearValue(){a({type:"VALUE.CLEAR"})},setFocusedValue(W){a({type:"FOCUS.SET",value:W})},setOpen(W){i("inline")||n.matches("open")===W||a({type:W?"OPEN":"CLOSE"})},focusMonth:ie,focusYear:re,getYears:G,getMonths:B,getYearsGrid(W={}){const{columns:L=1}=W;return xp(J(),L)},getDecade(){const W=sr(u.year);return{start:W.at(0),end:W.at(-1)}},getMonthsGrid(W={}){const{columns:L=1,format:X}=W;return xp(B({format:X}),L)},format(W,L={month:"long",year:"numeric"}){return new bn(x,L).format(W.toDate(C))},setView(W){a({type:"VIEW.SET",view:W})},goToNext(){a({type:"GOTO.NEXT",view:o.get("view")})},goToPrev(){a({type:"GOTO.PREV",view:o.get("view")})},getRootProps(){return t.element({...ke.root.attrs,dir:i("dir"),id:JT(s),"data-state":P?"open":"closed","data-disabled":V(m),"data-readonly":V(f)})},getLabelProps(W={}){const{index:L=0}=W;return t.label({...ke.label.attrs,id:ZT(s,L),dir:i("dir"),htmlFor:Pf(s,L),"data-state":P?"open":"closed","data-index":L,"data-disabled":V(m),"data-readonly":V(f)})},getControlProps(){return t.element({...ke.control.attrs,dir:i("dir"),id:jy(s),"data-disabled":V(m)})},getRangeTextProps(){return t.element({...ke.rangeText.attrs,dir:i("dir")})},getContentProps(){return t.element({...ke.content.attrs,hidden:!P,dir:i("dir"),"data-state":P?"open":"closed","data-placement":A,"data-inline":V(i("inline")),id:ou(s),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":Q.content})},getTableProps(W={}){const{view:L="day",columns:X=L==="day"?7:4}=W,ne=_e(W);return t.element({...ke.table.attrs,role:"grid","data-columns":X,"aria-roledescription":sI(L),id:QT(s,ne),"aria-readonly":Ne(f),"aria-disabled":Ne(m),"aria-multiselectable":Ne(i("selectionMode")!=="single"),"data-view":L,dir:i("dir"),tabIndex:-1,onKeyDown(ue){if(ue.defaultPrevented)return;const ve={Enter(){L==="day"&&Z(u)||L==="month"&&!pe({value:u.month}).selectable||L==="year"&&!ce({value:u.year}).selectable||a({type:"TABLE.ENTER",view:L,columns:X,focus:!0})},ArrowLeft(){a({type:"TABLE.ARROW_LEFT",view:L,columns:X,focus:!0})},ArrowRight(){a({type:"TABLE.ARROW_RIGHT",view:L,columns:X,focus:!0})},ArrowUp(){a({type:"TABLE.ARROW_UP",view:L,columns:X,focus:!0})},ArrowDown(){a({type:"TABLE.ARROW_DOWN",view:L,columns:X,focus:!0})},PageUp($e){a({type:"TABLE.PAGE_UP",larger:$e.shiftKey,view:L,columns:X,focus:!0})},PageDown($e){a({type:"TABLE.PAGE_DOWN",larger:$e.shiftKey,view:L,columns:X,focus:!0})},Home(){a({type:"TABLE.HOME",view:L,columns:X,focus:!0})},End(){a({type:"TABLE.END",view:L,columns:X,focus:!0})}}[br(ue,{dir:i("dir")})];ve&&(ve(ue),ue.preventDefault(),ue.stopPropagation())},onPointerLeave(){a({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){a({type:"TABLE.POINTER_DOWN",view:L})},onPointerUp(){a({type:"TABLE.POINTER_UP",view:L})}})},getTableHeadProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableHead.attrs,"aria-hidden":!0,dir:i("dir"),"data-view":L,"data-disabled":V(m)})},getTableHeaderProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableHeader.attrs,dir:i("dir"),"data-view":L,"data-disabled":V(m)})},getTableBodyProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableBody.attrs,"data-view":L,"data-disabled":V(m)})},getTableRowProps(W={}){const{view:L="day"}=W;return t.element({...ke.tableRow.attrs,"aria-disabled":Ne(m),"data-disabled":V(m),"data-view":L})},getDayTableCellState:me,getDayTableCellProps(W){const{value:L}=W,X=me(W);return t.element({...ke.tableCell.attrs,role:"gridcell","aria-disabled":Ne(!X.selectable),"aria-selected":X.selected||X.inRange,"aria-invalid":Ne(X.invalid),"aria-current":X.today?"date":void 0,"data-value":L.toString()})},getDayTableCellTriggerProps(W){const{value:L}=W,X=me(W);return t.element({...ke.tableCellTrigger.attrs,id:od(s,L.toString()),role:"button",dir:i("dir"),tabIndex:X.focused?0:-1,"aria-label":X.ariaLabel,"aria-disabled":Ne(!X.selectable),"aria-invalid":Ne(X.invalid),"data-disabled":V(!X.selectable),"data-selected":V(X.selected),"data-value":L.toString(),"data-view":"day","data-today":V(X.today),"data-focus":V(X.focused),"data-unavailable":V(X.unavailable),"data-range-start":V(X.firstInRange),"data-range-end":V(X.lastInRange),"data-in-range":V(X.inRange),"data-outside-range":V(X.outsideRange),"data-weekend":V(X.weekend),"data-in-hover-range":V(X.inHoveredRange),"data-hover-range-start":V(X.firstInHoveredRange),"data-hover-range-end":V(X.lastInHoveredRange),onClick(ne){ne.defaultPrevented||X.selectable&&a({type:"CELL.CLICK",cell:"day",value:L})},onPointerMove:$?ne=>{if(ne.pointerType==="touch"||!X.selectable)return;const ue=!s.isActiveElement(ne.currentTarget);h&&XO(L,h)||a({type:"CELL.POINTER_MOVE",cell:"day",value:L,focus:ue})}:void 0})},getMonthTableCellState:pe,getMonthTableCellProps(W){const{value:L,columns:X}=W,ne=pe(W);return t.element({...ke.tableCell.attrs,dir:i("dir"),colSpan:X,role:"gridcell","aria-selected":Ne(ne.selected||ne.inRange),"data-selected":V(ne.selected),"aria-disabled":Ne(!ne.selectable),"data-value":L})},getMonthTableCellTriggerProps(W){const{value:L}=W,X=pe(W);return t.element({...ke.tableCellTrigger.attrs,dir:i("dir"),role:"button",id:od(s,L.toString()),"data-selected":V(X.selected),"aria-disabled":Ne(!X.selectable),"data-disabled":V(!X.selectable),"data-focus":V(X.focused),"data-in-range":V(X.inRange),"data-outside-range":V(X.outsideRange),"aria-label":X.valueText,"data-view":"month","data-value":L,tabIndex:X.focused?0:-1,onClick(ne){ne.defaultPrevented||X.selectable&&a({type:"CELL.CLICK",cell:"month",value:L})},onPointerMove:$?ne=>{if(ne.pointerType==="touch"||!X.selectable)return;const ue=!s.isActiveElement(ne.currentTarget);h&&X.value&&ZO(X.value,h)||a({type:"CELL.POINTER_MOVE",cell:"month",value:X.value,focus:ue})}:void 0})},getYearTableCellState:ce,getYearTableCellProps(W){const{value:L,columns:X}=W,ne=ce(W);return t.element({...ke.tableCell.attrs,dir:i("dir"),colSpan:X,role:"gridcell","aria-selected":Ne(ne.selected),"data-selected":V(ne.selected),"aria-disabled":Ne(!ne.selectable),"data-value":L})},getYearTableCellTriggerProps(W){const{value:L}=W,X=ce(W);return t.element({...ke.tableCellTrigger.attrs,dir:i("dir"),role:"button",id:od(s,L.toString()),"data-selected":V(X.selected),"data-focus":V(X.focused),"data-in-range":V(X.inRange),"aria-disabled":Ne(!X.selectable),"data-disabled":V(!X.selectable),"aria-label":X.valueText,"data-outside-range":V(X.outsideRange),"data-value":L,"data-view":"year",tabIndex:X.focused?0:-1,onClick(ne){ne.defaultPrevented||X.selectable&&a({type:"CELL.CLICK",cell:"year",value:L})},onPointerMove:$?ne=>{if(ne.pointerType==="touch"||!X.selectable)return;const ue=!s.isActiveElement(ne.currentTarget);h&&X.value&&JO(X.value,h)||a({type:"CELL.POINTER_MOVE",cell:"year",value:X.value,focus:ue})}:void 0})},getNextTriggerProps(W={}){const{view:L="day"}=W,X=m||!r("isNextVisibleRangeValid");return t.button({...ke.nextTrigger.attrs,dir:i("dir"),id:tI(s,L),type:"button","aria-label":Q.nextTrigger(L),disabled:X,"data-disabled":V(X),onClick(ne){ne.defaultPrevented||a({type:"GOTO.NEXT",view:L})}})},getPrevTriggerProps(W={}){const{view:L="day"}=W,X=m||!r("isPrevVisibleRangeValid");return t.button({...ke.prevTrigger.attrs,dir:i("dir"),id:eI(s,L),type:"button","aria-label":Q.prevTrigger(L),disabled:X,"data-disabled":V(X),onClick(ne){ne.defaultPrevented||a({type:"GOTO.PREV",view:L})}})},getClearTriggerProps(){return t.button({...ke.clearTrigger.attrs,id:Hy(s),dir:i("dir"),type:"button","aria-label":Q.clearTrigger,hidden:!d.length,onClick(W){W.defaultPrevented||a({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ke.trigger.attrs,id:Wy(s),dir:i("dir"),type:"button","data-placement":A,"aria-label":Q.trigger(P),"aria-controls":ou(s),"data-state":P?"open":"closed","aria-haspopup":"grid",disabled:m,onClick(W){W.defaultPrevented||b&&a({type:"TRIGGER.CLICK"})}})},getViewProps(W={}){const{view:L="day"}=W;return t.element({...ke.view.attrs,"data-view":L,hidden:o.get("view")!==L})},getViewTriggerProps(W={}){const{view:L="day"}=W;return t.button({...ke.viewTrigger.attrs,"data-view":L,dir:i("dir"),id:nI(s,L),type:"button",disabled:m,"aria-label":Q.viewTrigger(L),onClick(X){X.defaultPrevented||b&&a({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(W={}){const{view:L="day"}=W;return t.element({...ke.viewControl.attrs,"data-view":L,dir:i("dir")})},getInputProps(W={}){const{index:L=0,fixOnBlur:X=!0}=W;return t.input({...ke.input.attrs,id:Pf(s,L),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:i("dir"),name:i("name"),"data-index":L,"data-state":P?"open":"closed",readOnly:f,disabled:m,placeholder:i("placeholder")||cI(x),defaultValue:r("valueAsString")[L],onBeforeInput(ne){const{data:ue}=Yv(ne);Ky(ue,j)||ne.preventDefault()},onFocus(){a({type:"INPUT.FOCUS",index:L})},onBlur(ne){const ue=ne.currentTarget.value.trim();a({type:"INPUT.BLUR",value:ue,index:L,fixOnBlur:X})},onKeyDown(ne){if(ne.defaultPrevented||!b)return;const ue={Enter(ve){vr(ve)||Z(u)||ve.currentTarget.value.trim()!==""&&a({type:"INPUT.ENTER",value:ve.currentTarget.value,index:L})}}[ne.key];ue&&(ue(ne),ne.preventDefault())},onInput(ne){const ue=ne.currentTarget.value;a({type:"INPUT.CHANGE",value:dI(ue,j),index:L})}})},getMonthSelectProps(){return t.select({...ke.monthSelect.attrs,id:Gy(s),"aria-label":Q.monthSelect,disabled:m,dir:i("dir"),defaultValue:l.month,onChange(W){ie(Number(W.currentTarget.value))}})},getYearSelectProps(){return t.select({...ke.yearSelect.attrs,id:qy(s),disabled:m,"aria-label":Q.yearSelect,dir:i("dir"),defaultValue:l.year,onChange(W){re(Number(W.currentTarget.value))}})},getPositionerProps(){return t.element({id:Uy(s),...ke.positioner.attrs,dir:i("dir"),style:M.floating})},getPresetTriggerProps(W){const L=Array.isArray(W.value)?W.value:If(W.value,x,C),X=L.filter(ne=>ne!=null).map(ne=>ne.toDate(C).toDateString());return t.button({...ke.presetTrigger.attrs,"aria-label":Q.presetTrigger(X),type:"button",onClick(ne){ne.defaultPrevented||a({type:"PRESET.CLICK",value:L})}})}}}var{and:Mt}=et();function xI(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let o=0;o<n;o++)if(!_t(e[o],t[o]))return!1;return!0}function bs(e,t){return e.map(n=>t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var wI={props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",o=e.selectionMode||"single",i=e.numOfMonths||1,a=e.defaultValue?vs(e.defaultValue).map(u=>Zt(u,e.min,e.max)):void 0,r=e.value?vs(e.value).map(u=>Zt(u,e.min,e.max)):void 0;let s=e.focusedValue||e.defaultFocusedValue||r?.[0]||a?.[0]||Fi(n);s=Zt(s,e.min,e.max);const l="day",c="year",d=Fh(e.view||l,l,c);return{locale:t,numOfMonths:i,timeZone:n,selectionMode:o,defaultView:d,minView:l,maxView:c,outsideDaySelectable:!1,closeOnSelect:!0,format(u,{locale:h,timeZone:p}){return new bn(h,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric"}).format(u.toDate(p))},parse(u,{locale:h,timeZone:p}){return YT(u,h,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:s,defaultFocusedValue:s,value:r,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:_t,hash:o=>o.toString(),sync:!0,onChange(o){var i;const a=n(),r=a.get("view"),s=a.get("value"),l=bs(s,e);(i=e("onFocusChange"))==null||i({value:s,valueAsString:l,view:r,focusedValue:o})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:xI,hash:o=>o.map(i=>i.toString()).join(","),onChange(o){var i;const a=n(),r=bs(o,e);(i=e("onValueChange"))==null||i({value:o,valueAsString:r,view:a.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:(o,i)=>i!==null&&o!==null&&_t(o,i)})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(o){var i;(i=e("onViewChange"))==null||i({view:o})}})),startValue:t(()=>{const o=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:Sf(o,"start",{months:e("numOfMonths")},e("locale")),isEqual:_t,hash:i=>i.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})=>Vy(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText({context:e,prop:t,computed:n}){const o=t("timeZone"),i=new bn(t("locale"),{month:"long",year:"numeric",timeZone:o}),a=i.format(e.get("startValue").toDate(o)),r=i.format(n("endValue").toDate(o)),s=t("selectionMode")==="range"?`${a} - ${r}`:a;return{start:a,end:r,formatted:s}},isPrevVisibleRangeValid:({context:e,prop:t})=>!VT(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!DT(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>bs(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:o,computed:i}){e([()=>t("locale")],()=>{o(["setStartValue"])}),e([()=>n.hash("focusedValue")],()=>{o(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{o(["syncMonthSelectElement","syncYearSelectElement"])}),e([()=>n.get("inputValue")],()=>{o(["syncInputValue"])}),e([()=>n.hash("value")],()=>{o(["syncInputElement"])}),e([()=>i("valueAsString").toString()],()=>{o(["announceValueText"])}),e([()=>n.get("view")],()=>{o(["focusActiveCell"])}),e([()=>t("open")],()=>{o(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","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:Mt("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Mt("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Mt("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:"isMultiPicker",actions:["setFocusedDate","toggleSelectedDate"]},{guard:Mt("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":{guard:Mt("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:Mt("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Mt("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Mt("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:"isMultiPicker",actions:["toggleSelectedDate"]},{guard:Mt("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})=>pI(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",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})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="INTERACT_OUTSIDE"},isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const o=Yy(n);return Et(o,()=>rI(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",By({level:"assertive",document:n})),()=>{var o,i;return(i=(o=t.get("announcer"))==null?void 0:o.destroy)==null?void 0:i.call(o)}},trackDismissableElement({scope:e,send:t,context:n,prop:o}){return o("inline")?void 0:ia(()=>ll(e),{type:"popover",defer:!0,exclude:[...$a(e),Df(e),aI(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=gI(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=mI(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}){var o;const i=e.get("value").map(a=>RT(a,null,t("locale"),t("timeZone")));(o=n.get("announcer"))==null||o.announce(i.join(","),3e3)},announceVisibleRange({computed:e,refs:t}){var n;const{formatted:o}=e("visibleRangeText");(n=t.get("announcer"))==null||n.announce(o)},disableTextSelection({scope:e}){eh({target:ll(e),doc:e.getDoc()})},enableTextSelection({scope:e}){sb({doc:e.getDoc(),target:ll(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&Ie(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){ae(()=>{$a(e).forEach((n,o)=>{Jt(n,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;Ie(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;Ie(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;Ie(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;Ie(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const o=t.value.map(i=>Zt(i,n("min"),n("max")));e.set("value",o)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,o=Array.from(t.get("value"));o[t.get("activeIndex")]=cl(e,n.value??t.get("focusedValue")),t.set("value",iu(o))},resetSelection(e){const{context:t,event:n}=e,o=cl(e,n.value??t.get("focusedValue"));t.set("value",[o])},toggleSelectedDate(e){const{context:t,event:n}=e,o=cl(e,n.value??t.get("focusedValue")),i=t.get("value").findIndex(a=>_t(a,o));if(i===-1){const a=[...t.get("value"),o];t.set("value",vs(a))}else{const a=Array.from(t.get("value"));a.splice(i,1),t.set("value",vs(a))}},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")),o=e.get("activeIndex");n[o]=e.get("focusedValue").copy(),e.set("value",iu(n));const i=t("valueAsString");e.set("inputValue",i[o])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});Ie(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});Ie(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});Ie(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});Ie(e,n)},focusNextPage(e){const{context:t,computed:n,prop:o}=e,i=Ny(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),o("locale"),o("min"),o("max"));ys(e,i)},focusPreviousPage(e){const{context:t,computed:n,prop:o}=e,i=Ly(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),o("locale"),o("min"),o("max"));ys(e,i)},focusSectionStart(e){const{context:t}=e;Ie(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;Ie(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:o,prop:i}=e,a=WT(t.get("focusedValue"),t.get("startValue"),n.larger,o("visibleDuration"),i("locale"),i("min"),i("max"));a&&ys(e,a)},focusPreviousSection(e){const{context:t,event:n,computed:o,prop:i}=e,a=UT(t.get("focusedValue"),t.get("startValue"),n.larger,o("visibleDuration"),i("locale"),i("min"),i("max"));a&&ys(e,a)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});Ie(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});Ie(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});Ie(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});Ie(e,n)},clearFocusedDate(e){const{prop:t}=e;Ie(e,Fi(t("timeZone")))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").subtract({months:n.columns});Ie(e,o)},focusNextMonthColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").add({months:n.columns});Ie(e,o)},focusPreviousYearColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").subtract({years:n.columns});Ie(e,o)},focusNextYearColumn(e){const{context:t,event:n}=e,o=t.get("focusedValue").add({years:n.columns});Ie(e,o)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue").set({month:1});Ie(e,n)},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue").set({month:12});Ie(e,n)},focusFirstYear(e){const{context:t}=e,n=sr(t.get("focusedValue").year),o=t.get("focusedValue").set({year:n[0]});Ie(e,o)},focusLastYear(e){const{context:t}=e,n=sr(t.get("focusedValue").year),o=t.get("focusedValue").set({year:n[n.length-1]});Ie(e,o)},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}){ae(()=>{var n;const o=t.get("view");(n=Vf(e,o))==null||n.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&ae(()=>{var o;const i=t.get("view");(o=Vf(e,i))==null||o.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}){ae(()=>{var t;(t=Df(e))==null||t.focus({preventScroll:!0})})},focusFirstInputElement({scope:e}){ae(()=>{const[t]=$a(e);t?.focus({preventScroll:!0})})},focusInputElement({scope:e}){ae(()=>{const t=$a(e),n=t.findLastIndex(a=>a.value!==""),o=Math.max(n,0),i=t[o];i?.focus({preventScroll:!0}),i?.setSelectionRange(i.value.length,i.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=iI(e);Jt(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=oI(e);Jt(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 o=$a(e),i=n.index??t.get("activeIndex");Jt(o[i],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||!Mf(o)||Ie(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||!Mf(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Zt(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const a=bs(i,n);e.set("inputValue",a[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const o=e.get("focusedValue");if(!pn(o,e.get("startValue"),t("endValue")))return;const i=Sf(o,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e}){var t;e("inline")||(t=e("onOpenChange"))==null||t({open:!0})},invokeOnClose({prop:e}){var t;e("inline")||(t=e("onOpenChange"))==null||t({open:!1})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}},cl=(e,t)=>{const{context:n,prop:o}=e,i=n.get("view");let a=typeof t=="number"?n.get("focusedValue").set({[i]:t}):t;return bI(r=>{fI(r,o("minView"))&&(a=a.set({[r]:r==="day"?1:0}))}),a};function Ie(e,t){const{context:n,prop:o,computed:i}=e;if(!t)return;const a=cl(e,t);if(_t(n.get("focusedValue"),a))return;const r=Kr(i("visibleDuration"),o("locale"),o("min"),o("max"))({focusedDate:a,startDate:n.get("startValue")});n.set("startValue",r.startDate),n.set("focusedValue",r.focusedDate)}function ys(e,t){const{context:n}=e;n.set("startValue",t.startDate);const o=n.get("focusedValue");_t(o,t.focusedDate)||n.set("focusedValue",t.focusedDate)}ee()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","parse","placeholder","getRootNode","id","ids","inline","isDateUnavailable","locale","max","min","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","defaultOpen","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","defaultView","defaultValue","view","defaultFocusedValue","outsideDaySelectable","minView","maxView"]);ee()(["index","fixOnBlur"]);ee()(["value"]);ee()(["columns","id","view"]);ee()(["disabled","value","columns"]);ee()(["view"]);const[Xy,Me]=xe("DatePickerContext"),CI=E({__name:"date-picker-clear-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getClearTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),_I=E({__name:"date-picker-content",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=dh(),o=T(()=>Br(t.value.getContentProps(),n.value.presenceProps));return q(),(i,a)=>v(n).unmounted?te("",!0):(w(),S(v(Y).div,F({key:0},o.value,{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),$I=E({__name:"date-picker-context",setup(e){const t=Me();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),kI=E({__name:"date-picker-control",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getControlProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),SI=E({__name:"date-picker-input",props:{index:{},fixOnBlur:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=Me();return q(),(o,i)=>(w(),S(v(Y).input,F(v(n).getInputProps(t),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),EI=E({__name:"date-picker-label",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).label,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),OI=["value"],TI=E({__name:"date-picker-month-select",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).select,F(v(t).getMonthSelectProps(),{"as-child":e.asChild}),{default:_(()=>[(w(!0),H(we,null,Oe(v(t).getMonths(),i=>(w(),H("option",{key:i.value,value:i.value},oe(i.label),9,OI))),128))]),_:1},16,["as-child"]))}}),[II,di]=xe("DatePickerViewPropsContext"),PI=E({__name:"date-picker-next-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getNextTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),VI=E({__name:"date-picker-positioner",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Hr(),o=lh(T(()=>({...n.value,present:t.value.open})));return ch(o),q(),(i,a)=>v(o).unmounted?te("",!0):(w(),S(v(Y).div,F({key:0},v(t).getPositionerProps(),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),DI=E({__name:"date-picker-preset-trigger",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me();return q(),(o,i)=>(w(),S(v(Y).button,F(v(n).getPresetTriggerProps(t),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),MI=E({__name:"date-picker-prev-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getPrevTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),RI=E({__name:"date-picker-range-text",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=T(()=>{const{start:o,end:i}=t.value.visibleRangeText;return Qt([o,i]).filter(Boolean).join(" - ")});return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getRangeTextProps(),{"as-child":e.asChild}),{default:_(()=>[Te(oe(n.value),1)]),_:1},16,["as-child"]))}}),AI=E({__name:"date-picker-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return Xy(n),xn(T(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),FI=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=T(()=>{const s=Re(e);return{id:n,dir:i.value.dir,locale:i.value.locale,value:s.modelValue,getRootNode:o?.value.getRootNode,...an(s),onFocusChange:l=>{var c;t?.("focusChange",l),t?.("update:focusedValue",l.focusedValue),(c=s.onFocusChange)==null||c.call(s,l)},onViewChange:l=>{var c;t?.("viewChange",l),t?.("update:view",l.view),(c=s.onViewChange)==null||c.call(s,l)},onOpenChange:l=>{var c;t?.("openChange",l),t?.("update:open",l.open),(c=s.onOpenChange)==null||c.call(s,l)},onValueChange:l=>{var c;t?.("valueChange",l),t?.("update:modelValue",l.value),(c=s.onValueChange)==null||c.call(s,l)}}}),r=bt(wI,a);return T(()=>yI(r,Tt))},NI=E({__name:"date-picker-root",props:jt({closeOnSelect:{type:Boolean},defaultFocusedValue:{},defaultOpen:{type:Boolean},defaultValue:{},defaultView:{},disabled:{type:Boolean},fixedWeeks:{type:Boolean},focusedValue:{},format:{type:Function},id:{},ids:{},isDateUnavailable:{type:Function},locale:{},max:{},maxView:{},min:{},minView:{},modelValue:{},name:{},numOfMonths:{},open:{type:Boolean},outsideDaySelectable:{type:Boolean},parse:{type:Function},placeholder:{},positioning:{},readOnly:{type:Boolean},selectionMode:{},startOfWeek:{},timeZone:{},translations:{},view:{},inline:{type:Boolean},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{closeOnSelect:void 0,defaultOpen:void 0,disabled:void 0,fixedWeeks:void 0,open:void 0,readOnly:void 0,outsideDaySelectable:void 0,inline:void 0}),emits:["focusChange","openChange","valueChange","viewChange","update:modelValue","update:open","update:view","update:focusedValue"],setup(e,{emit:t}){const n=e,o=FI(n,t);return Xy(o),xn(T(()=>({lazyMount:n.lazyMount,unmountOnExit:n.unmountOnExit}))),q(),(i,a)=>(w(),S(v(Y).div,F(v(o).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),[LI,Pc]=xe("DatePickerTablePropsContext"),BI=E({__name:"date-picker-table-body",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).tbody,F(v(t).getTableBodyProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),[zI,HI]=xe("DatePickerTableCellPropsContext"),jI=E({__name:"date-picker-table-cell-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=HI(),o=di(),i=T(()=>{const a={day:t.value.getDayTableCellTriggerProps,month:t.value.getMonthTableCellTriggerProps,year:t.value.getYearTableCellTriggerProps}[o.view];return a(n)});return q(),(a,r)=>(w(),S(v(Y).div,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),WI=E({__name:"date-picker-table-cell",props:{value:{},disabled:{type:Boolean},columns:{},visibleRange:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me(),o=di();zI(t);const i=T(()=>({day:n.value.getDayTableCellProps,month:n.value.getMonthTableCellProps,year:n.value.getYearTableCellProps})[o.view??"day"](t));return q(),(a,r)=>(w(),S(v(Y).td,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),UI=E({__name:"date-picker-table-head",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).thead,F(v(t).getTableHeadProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),GI=E({__name:"date-picker-table-header",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).th,F(v(t).getTableHeaderProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),qI=E({__name:"date-picker-table-row",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=Pc();return q(),(o,i)=>(w(),S(v(Y).tr,F(v(t).getTableRowProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),YI=E({__name:"date-picker-table",props:{view:{},columns:{},id:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me(),o=di(),i=vt(),a=t.id??i;return LI({...t,id:a,...o}),q(),(r,s)=>(w(),S(v(Y).table,F(v(n).getTableProps(t),{"as-child":e.asChild}),{default:_(()=>[D(r.$slots,"default")]),_:3},16,["as-child"]))}}),KI=E({__name:"date-picker-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),XI=E({__name:"date-picker-view-control",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getViewControlProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),ZI=E({__name:"date-picker-view-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Me(),n=di();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getViewTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),Zy=zy.extendWith("view"),JI=E({__name:"date-picker-view",props:{view:{},asChild:{type:Boolean}},setup(e){const t=e,n=Me();return II(t),q(),(o,i)=>(w(),S(v(Y).div,F(v(Zy).build().view.attrs,{hidden:v(n).view!==e.view,"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["hidden","as-child"]))}}),QI=["value"],eP=E({__name:"date-picker-year-select",props:{asChild:{type:Boolean}},setup(e){const t=Me();return q(),(n,o)=>(w(),S(v(Y).select,F(v(t).getYearSelectProps(),{"as-child":e.asChild}),{default:_(()=>[(w(!0),H(we,null,Oe(v(t).getYears(),i=>(w(),H("option",{key:i.value,value:i.value},oe(i.label),9,QI))),128))]),_:1},16,["as-child"]))}}),de=Object.freeze(Object.defineProperty({__proto__:null,ClearTrigger:CI,Content:_I,Context:$I,Control:kI,Input:SI,Label:EI,MonthSelect:TI,NextTrigger:PI,Positioner:VI,PresetTrigger:DI,PrevTrigger:MI,RangeText:RI,Root:NI,RootProvider:AI,Table:YI,TableBody:BI,TableCell:WI,TableCellTrigger:jI,TableHead:UI,TableHeader:GI,TableRow:qI,Trigger:KI,View:JI,ViewControl:XI,ViewTrigger:ZI,YearSelect:eP},Symbol.toStringTag,{value:"Module"}));var Jy=le("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger");Jy.build();ee()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var tP=e=>typeof e.getAsEntry=="function"?e.getAsEntry():typeof e.webkitGetAsEntry=="function"?e.webkitGetAsEntry():null,Qy=e=>e.isDirectory,au=e=>e.isFile,ru=(e,t)=>(Object.defineProperty(e,"relativePath",{value:t?`${t}/${e.name}`:e.name}),e),nP=(e,t)=>Promise.all(Array.from(e).filter(n=>n.kind==="file").map(n=>{const o=tP(n);if(!o)return null;if(Qy(o)&&t)return e0(o.createReader(),`${o.name}`);if(au(o)&&typeof n.getAsFile=="function"){const i=n.getAsFile();return Promise.resolve(i?ru(i,""):null)}if(au(o))return new Promise(i=>{o.file(a=>{i(ru(a,""))})})}).filter(n=>n)),e0=(e,t="")=>new Promise(n=>{const o=[],i=()=>{e.readEntries(a=>{if(a.length===0){n(Promise.all(o).then(s=>s.flat()));return}const r=a.map(s=>{if(!s)return null;if(Qy(s))return e0(s.createReader(),`${t}${s.name}`);if(au(s))return new Promise(l=>{s.file(c=>{l(ru(c,t))})})}).filter(s=>s);o.push(Promise.all(r)),i()})};i()});function oP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function iP(e){return/^.*\.[\w]+$/.test(e)}var Rf=e=>oP(e)||iP(e);function aP(e){if(e!=null)return typeof e=="string"?e:Array.isArray(e)?e.filter(Rf).join(","):Object.entries(e).reduce((t,[n,o])=>[...t,n,...o],[]).filter(Rf).join(",")}var xs=(e,t)=>e.name===t.name&&e.size===t.size&&e.type===t.type,ka=e=>e!=null;function rP(e,t,n){if(ka(e.size))if(ka(t)&&ka(n)){if(e.size>n)return[!1,"FILE_TOO_LARGE"];if(e.size<t)return[!1,"FILE_TOO_SMALL"]}else{if(ka(t)&&e.size<t)return[!1,"FILE_TOO_SMALL"];if(ka(n)&&e.size>n)return[!1,"FILE_TOO_LARGE"]}return[!0,null]}var sP="3g2_video/3gpp2[3gp,3gpp_video/3gpp[3mf_model/3mf[7z_application/x-7z-compressed[aac_audio/aac[ac_application/pkix-attr-cert[adp_audio/adpcm[adts_audio/aac[ai_application/postscript[aml_application/automationml-aml+xml[amlx_application/automationml-amlx+zip[amr_audio/amr[apk_application/vnd.android.package-archive[apng_image/apng[appcache,manifest_text/cache-manifest[appinstaller_application/appinstaller[appx_application/appx[appxbundle_application/appxbundle[asc_application/pgp-keys[atom_application/atom+xml[atomcat_application/atomcat+xml[atomdeleted_application/atomdeleted+xml[atomsvc_application/atomsvc+xml[au,snd_audio/basic[avi_video/x-msvideo[avci_image/avci[avcs_image/avcs[avif_image/avif[aw_application/applixware[bdoc_application/bdoc[bin,bpk,buffer,deb,deploy,dist,distz,dll,dmg,dms,dump,elc,exe,img,iso,lrf,mar,msi,msm,msp,pkg,so_application/octet-stream[bmp,dib_image/bmp[btf,btif_image/prs.btif[bz2_application/x-bzip2[c_text/x-c[ccxml_application/ccxml+xml[cdfx_application/cdfx+xml[cdmia_application/cdmi-capability[cdmic_application/cdmi-container[cdmid_application/cdmi-domain[cdmio_application/cdmi-object[cdmiq_application/cdmi-queue[cer_application/pkix-cert[cgm_image/cgm[cjs_application/node[class_application/java-vm[coffee,litcoffee_text/coffeescript[conf,def,in,ini,list,log,text,txt_text/plain[cpp,cxx,cc_text/x-c++src[cpl_application/cpl+xml[cpt_application/mac-compactpro[crl_application/pkix-crl[css_text/css[csv_text/csv[cu_application/cu-seeme[cwl_application/cwl[cww_application/prs.cww[davmount_application/davmount+xml[dbk_application/docbook+xml[doc_application/msword[docx_application/vnd.openxmlformats-officedocument.wordprocessingml.document[dsc_text/prs.lines.tag[dssc_application/dssc+der[dtd_application/xml-dtd[dwd_application/atsc-dwd+xml[ear,jar,war_application/java-archive[ecma_application/ecmascript[emf_image/emf[eml,mime_message/rfc822[emma_application/emma+xml[emotionml_application/emotionml+xml[eot_application/vnd.ms-fontobject[eps,ps_application/postscript[epub_application/epub+zip[exi_application/exi[exp_application/express[exr_image/aces[ez_application/andrew-inset[fdf_application/fdf[fdt_application/fdt+xml[fits_image/fits[flac_audio/flac[flv_video/x-flv[g3_image/g3fax[geojson_application/geo+json[gif_image/gif[glb_model/gltf-binary[gltf_model/gltf+json[gml_application/gml+xml[go_text/x-go[gpx_application/gpx+xml[gz_application/gzip[h_text/x-h[h261_video/h261[h263_video/h263[h264_video/h264[heic_image/heic[heics_image/heic-sequence[heif_image/heif[heifs_image/heif-sequence[htm,html,shtml_text/html[ico_image/x-icon[icns_image/x-icns[ics,ifb_text/calendar[iges,igs_model/iges[ink,inkml_application/inkml+xml[ipa_application/octet-stream[java_text/x-java-source[jp2,jpg2_image/jp2[jpeg,jpe,jpg_image/jpeg[jpf,jpx_image/jpx[jpm,jpgm_image/jpm[jpgv_video/jpeg[jph_image/jph[js,mjs_text/javascript[json_application/json[json5_application/json5[jsonld_application/ld+json[jsx_text/jsx[jxl_image/jxl[jxr_image/jxr[ktx_image/ktx[ktx2_image/ktx2[less_text/less[m1v,m2v,mpe,mpeg,mpg_video/mpeg[m4a_audio/mp4[m4v_video/x-m4v[md,markdown_text/markdown[mid,midi,kar,rmi_audio/midi[mkv_video/x-matroska[mp2,mp2a,mp3,mpga,m3a,m2a_audio/mpeg[mp4,mp4v,mpg4_video/mp4[mp4a_audio/mp4[mp4s,m4p_application/mp4[odp_application/vnd.oasis.opendocument.presentation[oda_application/oda[ods_application/vnd.oasis.opendocument.spreadsheet[odt_application/vnd.oasis.opendocument.text[oga,ogg,opus,spx_audio/ogg[ogv_video/ogg[ogx_application/ogg[otf_font/otf[p12,pfx_application/x-pkcs12[pdf_application/pdf[pem_application/x-pem-file[php_text/x-php[png_image/png[ppt_application/vnd.ms-powerpoint[pptx_application/vnd.openxmlformats-officedocument.presentationml.presentation[pskcxml_application/pskc+xml[psd_image/vnd.adobe.photoshop[py_text/x-python[qt,mov_video/quicktime[rar_application/vnd.rar[rdf_application/rdf+xml[rtf_text/rtf[sass_text/x-sass[scss_text/x-scss[sgm,sgml_text/sgml[sh_application/x-sh[svg,svgz_image/svg+xml[swf_application/x-shockwave-flash[tar_application/x-tar[tif,tiff_image/tiff[toml_application/toml[ts_video/mp2t[tsx_text/tsx[tsv_text/tab-separated-values[ttc_font/collection[ttf_font/ttf[vtt_text/vtt[wasm_application/wasm[wav_audio/wav[weba_audio/webm[webm_video/webm[webmanifest_application/manifest+json[webp_image/webp[wma_audio/x-ms-wma[wmv_video/x-ms-wmv[woff_font/woff[woff2_font/woff2[xls_application/vnd.ms-excel[xlsx_application/vnd.openxmlformats-officedocument.spreadsheetml.sheet[xml_application/xml[xz_application/x-xz[yaml,yml_text/yaml[zip_application/zip",lP=new Map(sP.split("[").flatMap(e=>{const[t,n]=e.split("_");return t.split(",").map(o=>[o,n])}));function cP(e){const t=e.split(".").pop();return t&&lP.get(t)||null}function dP(e,t){if(e&&t){const n=Array.isArray(t)?t:typeof t=="string"?t.split(","):[];if(n.length===0)return!0;const o=e.name||"",i=(e.type||cP(o)||"").toLowerCase(),a=i.replace(/\/.*$/,"");return n.some(r=>{const s=r.trim().toLowerCase();return s.charAt(0)==="."?o.toLowerCase().endsWith(s):s.endsWith("/*")?a===s.replace(/\/.*$/,""):i===s})}return!0}function uP(e,t){const n=e.type==="application/x-moz-file"||dP(e,t);return[n,n?null:"FILE_INVALID_TYPE"]}var hP=le("editable").parts("root","area","label","preview","input","editTrigger","submitTrigger","cancelTrigger","control");hP.build();ee()(["activationMode","autoResize","dir","disabled","finalFocusEl","form","getRootNode","id","ids","invalid","maxLength","name","onEditChange","onFocusOutside","onInteractOutside","onPointerDownOutside","onValueChange","onValueCommit","onValueRevert","placeholder","readOnly","required","selectOnFocus","edit","defaultEdit","submitMode","translations","defaultValue","value"]);const pP=le("fieldset").parts("root","errorText","helperText","legend");pP.build();const[t0,Vt]=xe("FileUploadContext"),fP=E({__name:"file-upload-clear-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Vt();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getClearTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),gP=E({__name:"file-upload-context",setup(e){const t=Vt();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),mP=E({__name:"file-upload-dropzone",props:jt({asChild:{type:Boolean},disableClick:{type:Boolean}},{disableClick:void 0}),setup(e){const t=e,n=Vt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(n).getDropzoneProps(t),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),vP=E({__name:"file-upload-hidden-input",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=wn();return q(),(o,i)=>{var a;return w(),S(v(Y).input,F({"aria-describedby":(a=v(n))==null?void 0:a.ariaDescribedby},v(t).getHiddenInputProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["aria-describedby","as-child"])}}}),[bP,Xr]=xe("FileUploadItemPropsContext"),yP=E({__name:"file-upload-item-delete-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr();return q(),(o,i)=>(w(),S(v(Y).button,F(v(t).getItemDeleteTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),[xP,wP]=xe("FileUploadItemGroupPropsContext"),CP=E({__name:"file-upload-item-group",props:{asChild:{type:Boolean},type:{}},setup(e){const t=e,n=T(()=>oo(t,["type"])),o=Vt();return xP(n),q(),(i,a)=>(w(),S(v(Y).ul,F(v(o).getItemGroupProps(n.value),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),_P=E({__name:"file-upload-item-name",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr(),o=Mr();return q(),(i,a)=>(w(),S(v(Y).div,F(v(t).getItemNameProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default",{},()=>{var r;return[Te(oe(((r=o.default)==null?void 0:r.call(o))||v(n).file.name),1)]})]),_:3},16,["as-child"]))}}),$P=E({__name:"file-upload-item-preview-image",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr(),o=he("");return Iv(i=>{const a=t.value.createFileUrl(n.value.file,r=>o.value=r);i(a)}),q(),(i,a)=>o.value?(w(),S(v(Y).img,Ke(F({key:0},v(t).getItemPreviewImageProps({...v(n),url:o.value}))),null,16)):te("",!0)}}),kP=E({__name:"file-upload-item-preview",props:{type:{default:".*"},asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr();return q(),(o,i)=>v(n).file.type.match(e.type??".*")?(w(),S(v(Y).div,F({key:0},v(t).getItemPreviewProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"])):te("",!0)}}),SP=E({__name:"file-upload-item-size-text",props:{asChild:{type:Boolean}},setup(e){const t=Vt(),n=Xr(),o=Mr();return q(),(i,a)=>(w(),S(v(Y).div,F(v(t).getItemSizeTextProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default",{},()=>{var r;return[Te(oe(((r=o.default)==null?void 0:r.call(o))||v(t).getFileSize(v(n).file)),1)]})]),_:3},16,["as-child"]))}}),EP=E({__name:"file-upload-item",props:{file:{},type:{},asChild:{type:Boolean}},setup(e){const t=e,n=Vt(),o=wP(),i=T(()=>({...t,type:o.value.type}));return bP(i),q(),(a,r)=>(w(),S(v(Y).li,F(v(n).getItemProps(i.value),{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),OP=E({__name:"file-upload-label",props:{asChild:{type:Boolean}},setup(e){const t=Vt();return q(),(n,o)=>(w(),S(v(Y).label,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),TP=E({__name:"file-upload-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return t0(n),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}});function IP(e){const t=new Map;return function(n,o){const i=n+(o?Object.entries(o).sort((r,s)=>r[0]<s[0]?-1:1).join():"");if(t.has(i))return t.get(i);let a=new e(n,o);return t.set(i,a),a}}var PP=IP(Intl.NumberFormat);function VP(e,t,n={}){return PP(t,n).format(e)}var DP=["","kilo","mega","giga","tera"],MP=["","kilo","mega","giga","tera","peta"],RP=(e,t="en-US",n={})=>{if(Number.isNaN(e))return"";if(e===0)return"0 B";const{unitSystem:o="decimal",precision:i=3,unit:a="byte",unitDisplay:r="short"}=n,s=o==="binary"?1024:1e3,l=a==="bit"?DP:MP,c=e<0;let d=Math.abs(e),u=0;for(;d>=s&&u<l.length-1;)d/=s,u++;const h=parseFloat(d.toPrecision(i)),p=c?-h:h;return VP(p,t,{style:"unit",unit:l[u]+a,unitDisplay:r})},n0=le("file-upload").parts("root","dropzone","item","itemDeleteTrigger","itemGroup","itemName","itemPreview","itemPreviewImage","itemSizeText","label","trigger","clearTrigger"),Rt=n0.build(),o0=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`file:${e.id}`},i0=e=>{var t;return((t=e.ids)==null?void 0:t.dropzone)??`file:${e.id}:dropzone`},su=e=>{var t;return((t=e.ids)==null?void 0:t.hiddenInput)??`file:${e.id}:input`},AP=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`file:${e.id}:trigger`},FP=e=>{var t;return((t=e.ids)==null?void 0:t.label)??`file:${e.id}:label`},NP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.item)==null?void 0:o.call(n,t))??`file:${e.id}:item:${t}`},LP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemName)==null?void 0:o.call(n,t))??`file:${e.id}:item-name:${t}`},BP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemSizeText)==null?void 0:o.call(n,t))??`file:${e.id}:item-size:${t}`},zP=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.itemPreview)==null?void 0:o.call(n,t))??`file:${e.id}:item-preview:${t}`},HP=e=>e.getById(o0(e)),Af=e=>e.getById(su(e)),jP=e=>e.getById(i0(e));function Ff(e){const t=Pe(e);return e.dataTransfer?e.dataTransfer.types.some(n=>n==="Files"||n==="application/x-moz-file"):!!t&&"files"in t}function WP(e,t,n){const{prop:o,computed:i}=e;return!i("multiple")&&t>1?!1:!i("multiple")&&t+n.length===2?!0:!(t+n.length>o("maxFiles"))}function Nf(e,t,n=[],o=[]){const{prop:i,computed:a}=e,r=[],s=[],l={acceptedFiles:n,rejectedFiles:o};return t.forEach(c=>{var d;const[u,h]=uP(c,a("acceptAttr")),[p,m]=rP(c,i("minFileSize"),i("maxFileSize")),f=(d=i("validate"))==null?void 0:d(c,l),b=f?f.length===0:!0;if(u&&p&&b)r.push(c);else{const g=[h,m];b||g.push(...f??[]),s.push({file:c,errors:g.filter(Boolean)})}}),WP(e,r.length,n)||(r.forEach(c=>{s.push({file:c,errors:["TOO_MANY_FILES"]})}),r.splice(0)),{acceptedFiles:r,rejectedFiles:s}}function UP(e,t){const n=Fe(e);try{if("DataTransfer"in n){const o=new n.DataTransfer;t.forEach(i=>{o.items.add(i)}),e.files=o.files}}catch{}}var Xn="accepted";function GP(e,t){const{state:n,send:o,prop:i,computed:a,scope:r,context:s}=e,l=!!i("disabled"),c=!!i("required"),d=i("allowDrop"),u=i("translations"),h=n.matches("dragging"),p=n.matches("focused")&&!l;return{dragging:h,focused:p,disabled:!!l,transforming:s.get("transforming"),openFilePicker(){l||o({type:"OPEN"})},deleteFile(m,f=Xn){o({type:"FILE.DELETE",file:m,itemType:f})},acceptedFiles:s.get("acceptedFiles"),rejectedFiles:s.get("rejectedFiles"),setFiles(m){o({type:"FILES.SET",files:m,count:m.length})},clearRejectedFiles(){o({type:"REJECTED_FILES.CLEAR"})},clearFiles(){o({type:"FILES.CLEAR"})},getFileSize(m){return RP(m.size,i("locale"))},createFileUrl(m,f){const b=r.getWin(),g=b.URL.createObjectURL(m);return f(g),()=>b.URL.revokeObjectURL(g)},setClipboardFiles(m){if(l)return!1;const f=Array.from(m?.items??[]).reduce((b,g)=>{if(g.kind!=="file")return b;const y=g.getAsFile();return y?[...b,y]:b},[]);return f.length?(o({type:"FILES.SET",files:f}),!0):!1},getRootProps(){return t.element({...Rt.root.attrs,dir:i("dir"),id:o0(r),"data-disabled":V(l),"data-dragging":V(h)})},getDropzoneProps(m={}){return t.element({...Rt.dropzone.attrs,dir:i("dir"),id:i0(r),tabIndex:l||m.disableClick?void 0:0,role:m.disableClick?"application":"button","aria-label":u.dropzone,"aria-disabled":l,"data-invalid":V(i("invalid")),"data-disabled":V(l),"data-dragging":V(h),onKeyDown(f){l||f.defaultPrevented||f.currentTarget===Pe(f)&&(m.disableClick||f.key!=="Enter"&&f.key!==" "||o({type:"DROPZONE.CLICK",src:"keydown"}))},onClick(f){l||f.defaultPrevented||m.disableClick||f.currentTarget===Pe(f)&&(f.currentTarget.localName==="label"&&f.preventDefault(),o({type:"DROPZONE.CLICK"}))},onDragOver(f){if(l||!d)return;f.preventDefault(),f.stopPropagation();try{f.dataTransfer.dropEffect="copy"}catch{}if(!Ff(f))return;const b=f.dataTransfer.items.length;o({type:"DROPZONE.DRAG_OVER",count:b})},onDragLeave(f){l||d&&(rt(f.currentTarget,f.relatedTarget)||o({type:"DROPZONE.DRAG_LEAVE"}))},onDrop(f){if(l)return;d&&(f.preventDefault(),f.stopPropagation());const b=Ff(f);l||!b||nP(f.dataTransfer.items,i("directory")).then(g=>{o({type:"DROPZONE.DROP",files:pb(g)})})},onFocus(){l||o({type:"DROPZONE.FOCUS"})},onBlur(){l||o({type:"DROPZONE.BLUR"})}})},getTriggerProps(){return t.button({...Rt.trigger.attrs,dir:i("dir"),id:AP(r),disabled:l,"data-disabled":V(l),"data-invalid":V(i("invalid")),type:"button",onClick(m){l||(rt(jP(r),m.currentTarget)&&m.stopPropagation(),o({type:"OPEN"}))}})},getHiddenInputProps(){return t.input({id:su(r),tabIndex:-1,disabled:l,type:"file",required:i("required"),capture:i("capture"),name:i("name"),accept:a("acceptAttr"),webkitdirectory:i("directory")?"":void 0,multiple:a("multiple")||i("maxFiles")>1,onClick(m){m.stopPropagation(),m.currentTarget.value=""},onInput(m){if(l)return;const{files:f}=m.currentTarget;o({type:"FILE.SELECT",files:f?Array.from(f):[]})},style:gc})},getItemGroupProps(m={}){const{type:f=Xn}=m;return t.element({...Rt.itemGroup.attrs,dir:i("dir"),"data-disabled":V(l),"data-type":f})},getItemProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.item.attrs,dir:i("dir"),id:NP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemNameProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.itemName.attrs,dir:i("dir"),id:LP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemSizeTextProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.itemSizeText.attrs,dir:i("dir"),id:BP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemPreviewProps(m){const{file:f,type:b=Xn}=m;return t.element({...Rt.itemPreview.attrs,dir:i("dir"),id:zP(r,f.name),"data-disabled":V(l),"data-type":b})},getItemPreviewImageProps(m){var f;const{file:b,url:g,type:y=Xn}=m;if(!b.type.startsWith("image/"))throw new Error("Preview Image is only supported for image files");return t.img({...Rt.itemPreviewImage.attrs,alt:(f=u.itemPreview)==null?void 0:f.call(u,b),src:g,"data-disabled":V(l),"data-type":y})},getItemDeleteTriggerProps(m){var f;const{file:b,type:g=Xn}=m;return t.button({...Rt.itemDeleteTrigger.attrs,dir:i("dir"),type:"button",disabled:l,"data-disabled":V(l),"data-type":g,"aria-label":(f=u.deleteFile)==null?void 0:f.call(u,b),onClick(){l||o({type:"FILE.DELETE",file:b,itemType:g})}})},getLabelProps(){return t.label({...Rt.label.attrs,dir:i("dir"),id:FP(r),htmlFor:su(r),"data-disabled":V(l),"data-required":V(c)})},getClearTriggerProps(){return t.button({...Rt.clearTrigger.attrs,dir:i("dir"),type:"button",disabled:l,hidden:s.get("acceptedFiles").length===0,"data-disabled":V(l),onClick(m){m.defaultPrevented||l||o({type:"FILES.CLEAR"})}})}}}var qP={props({props:e}){return{minFileSize:0,maxFileSize:Number.POSITIVE_INFINITY,maxFiles:1,allowDrop:!0,preventDocumentDrop:!0,defaultAcceptedFiles:[],...e,translations:{dropzone:"dropzone",itemPreview:t=>`preview of ${t.name}`,deleteFile:t=>`delete file ${t.name}`,...e.translations}}},initialState(){return"idle"},context({prop:e,bindable:t,getContext:n}){return{acceptedFiles:t(()=>({defaultValue:e("defaultAcceptedFiles"),value:e("acceptedFiles"),isEqual:(o,i)=>o.length===i?.length&&o.every((a,r)=>xs(a,i[r])),hash(o){return o.map(i=>`${i.name}-${i.size}`).join(",")},onChange(o){var i,a;const r=n();(i=e("onFileAccept"))==null||i({files:o}),(a=e("onFileChange"))==null||a({acceptedFiles:o,rejectedFiles:r.get("rejectedFiles")})}})),rejectedFiles:t(()=>({defaultValue:[],isEqual:(o,i)=>o.length===i?.length&&o.every((a,r)=>xs(a.file,i[r].file)),onChange(o){var i,a;const r=n();(i=e("onFileReject"))==null||i({files:o}),(a=e("onFileChange"))==null||a({acceptedFiles:r.get("acceptedFiles"),rejectedFiles:o})}})),transforming:t(()=>({defaultValue:!1}))}},computed:{acceptAttr:({prop:e})=>aP(e("accept")),multiple:({prop:e})=>e("maxFiles")>1},watch({track:e,context:t,action:n}){e([()=>t.hash("acceptedFiles")],()=>{n(["syncInputElement"])})},on:{"FILES.SET":{actions:["setFiles"]},"FILE.SELECT":{actions:["setEventFiles"]},"FILE.DELETE":{actions:["removeFile"]},"FILES.CLEAR":{actions:["clearFiles"]},"REJECTED_FILES.CLEAR":{actions:["clearRejectedFiles"]}},effects:["preventDocumentDrop"],states:{idle:{on:{OPEN:{actions:["openFilePicker"]},"DROPZONE.CLICK":{actions:["openFilePicker"]},"DROPZONE.FOCUS":{target:"focused"},"DROPZONE.DRAG_OVER":{target:"dragging"}}},focused:{on:{"DROPZONE.BLUR":{target:"idle"},OPEN:{actions:["openFilePicker"]},"DROPZONE.CLICK":{actions:["openFilePicker"]},"DROPZONE.DRAG_OVER":{target:"dragging"}}},dragging:{on:{"DROPZONE.DROP":{target:"idle",actions:["setEventFiles"]},"DROPZONE.DRAG_LEAVE":{target:"idle"}}}},implementations:{effects:{preventDocumentDrop({prop:e,scope:t}){if(!e("preventDocumentDrop")||!e("allowDrop")||e("disabled"))return;const n=t.getDoc(),o=a=>{a?.preventDefault()},i=a=>{rt(HP(t),Pe(a))||a.preventDefault()};return xr(ge(n,"dragover",o,!1),ge(n,"drop",i,!1))}},actions:{syncInputElement({scope:e,context:t}){queueMicrotask(()=>{const n=Af(e);if(!n)return;UP(n,t.get("acceptedFiles"));const o=e.getWin();n.dispatchEvent(new o.Event("change",{bubbles:!0}))})},openFilePicker({scope:e}){ae(()=>{var t;(t=Af(e))==null||t.click()})},setFiles(e){const{computed:t,context:n,event:o}=e,{acceptedFiles:i,rejectedFiles:a}=Nf(e,o.files);n.set("acceptedFiles",t("multiple")?i:i.length>0?[i[0]]:[]),n.set("rejectedFiles",a)},setEventFiles(e){const{computed:t,context:n,event:o,prop:i}=e,a=n.get("acceptedFiles"),r=n.get("rejectedFiles"),{acceptedFiles:s,rejectedFiles:l}=Nf(e,o.files,a,r),c=u=>{if(t("multiple")){n.set("acceptedFiles",h=>[...h,...u]),n.set("rejectedFiles",l);return}if(u.length){n.set("acceptedFiles",[u[0]]),n.set("rejectedFiles",l);return}l.length&&(n.set("acceptedFiles",n.get("acceptedFiles")),n.set("rejectedFiles",l))},d=i("transformFiles");d?(n.set("transforming",!0),d(s).then(c).catch(u=>{Wn(`[zag-js/file-upload] error transforming files
|
|
2
2
|
${u}`)}).finally(()=>{n.set("transforming",!1)})):c(s)},removeFile({context:e,event:t}){if(t.itemType==="rejected"){const n=e.get("rejectedFiles").filter(o=>!xs(o.file,t.file));e.set("rejectedFiles",n)}else{const n=e.get("acceptedFiles").filter(o=>!xs(o,t.file));e.set("acceptedFiles",n)}},clearRejectedFiles({context:e}){e.set("rejectedFiles",[])},clearFiles({context:e}){e.set("acceptedFiles",[]),e.set("rejectedFiles",[])}}}};ee()(["accept","acceptedFiles","allowDrop","capture","defaultAcceptedFiles","dir","directory","disabled","getRootNode","id","ids","invalid","locale","maxFiles","maxFileSize","minFileSize","name","onFileAccept","onFileChange","onFileReject","preventDocumentDrop","required","transformFiles","translations","validate"]);ee()(["file","type"]);const YP=(e={},t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=wn(),r=T(()=>{const l=Re(e);return{id:n,ids:{label:a?.value.ids.label,hiddenInput:a?.value.ids.control},dir:i.value.dir,disabled:a?.value.disabled,invalid:a?.value.invalid,locale:i.value.locale,required:a?.value.required,getRootNode:o?.value.getRootNode,...an(l),onFileChange:c=>{var d;t?.("update:acceptedFiles",c.acceptedFiles),t?.("fileChange",c),(d=l.onFileChange)==null||d.call(l,c)},onFileAccept:c=>{var d;t?.("fileAccept",c),(d=l.onFileAccept)==null||d.call(l,c)},onFileReject:c=>{var d;t?.("fileReject",c),(d=l.onFileReject)==null||d.call(l,c)}}}),s=bt(qP,r);return T(()=>GP(s,Tt))},KP=E({__name:"file-upload-root",props:jt({accept:{},defaultAcceptedFiles:{},allowDrop:{type:Boolean},capture:{},directory:{type:Boolean},disabled:{type:Boolean},id:{},ids:{},invalid:{type:Boolean},locale:{},maxFileSize:{},maxFiles:{},minFileSize:{},name:{},preventDocumentDrop:{type:Boolean},required:{type:Boolean},translations:{},validate:{type:Function},transformFiles:{type:Function},asChild:{type:Boolean}},{allowDrop:void 0,directory:void 0,disabled:void 0,invalid:void 0,preventDocumentDrop:void 0,required:void 0}),emits:["update:acceptedFiles","fileAccept","fileChange","fileReject"],setup(e,{emit:t}){const n=YP(e,t);return t0(n),q(),(o,i)=>(w(),S(v(Y).div,F(v(n).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),XP=E({__name:"file-upload-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Vt();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),At=Object.freeze(Object.defineProperty({__proto__:null,ClearTrigger:fP,Context:gP,Dropzone:mP,HiddenInput:vP,Item:EP,ItemDeleteTrigger:yP,ItemGroup:CP,ItemName:_P,ItemPreview:kP,ItemPreviewImage:$P,ItemSizeText:SP,Label:OP,Root:KP,RootProvider:TP,Trigger:XP},Symbol.toStringTag,{value:"Module"})),ZP=Symbol(),Lf=Object.getPrototypeOf,lu=new WeakMap,JP=e=>e&&(lu.has(e)?lu.get(e):Lf(e)===Object.prototype||Lf(e)===Array.prototype),QP=e=>JP(e)&&e[ZP]||null,Bf=(e,t=!0)=>{lu.set(e,t)};function eV(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function a0(e,t){const n=eV();return n?(n[e]||(n[e]=t()),n[e]):t()}var dl=a0("__zag__refSet",()=>new WeakSet),tV=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,nV=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,oV=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",iV=e=>tV(e)||nV(e)||oV(e),cu=e=>e!==null&&typeof e=="object",zf=e=>cu(e)&&!dl.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!iV(e)&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),Fo=a0("__zag__proxyStateMap",()=>new WeakMap),aV=(e=Object.is,t=(s,l)=>new Proxy(s,l),n=new WeakMap,o=(s,l)=>{const c=n.get(s);if(c?.[0]===l)return c[1];const d=Array.isArray(s)?[]:Object.create(Object.getPrototypeOf(s));return Bf(d,!0),n.set(s,[l,d]),Reflect.ownKeys(s).forEach(u=>{const h=Reflect.get(s,u);dl.has(h)?(Bf(h,!1),d[u]=h):Fo.has(h)?d[u]=lV(h):d[u]=h}),Object.freeze(d)},i=new WeakMap,a=[1,1],r=s=>{if(!cu(s))throw new Error("object required");const l=i.get(s);if(l)return l;let c=a[0];const d=new Set,u=(O,P=++a[0])=>{c!==P&&(c=P,d.forEach($=>$(O,P)))};let h=a[1];const p=(O=++a[1])=>(h!==O&&!d.size&&(h=O,f.forEach(([P])=>{const $=P[1](O);$>c&&(c=$)})),c),m=O=>(P,$)=>{const I=[...P];I[1]=[O,...I[1]],u(I,$)},f=new Map,b=(O,P)=>{if(d.size){const $=P[3](m(O));f.set(O,[P,$])}else f.set(O,[P])},g=O=>{var P;const $=f.get(O);$&&(f.delete(O),(P=$[1])==null||P.call($))},y=O=>(d.add(O),d.size===1&&f.forEach(([P,$],I)=>{const A=P[3](m(I));f.set(I,[P,A])}),()=>{d.delete(O),d.size===0&&f.forEach(([P,$],I)=>{$&&($(),f.set(I,[P]))})}),x=Array.isArray(s)?[]:Object.create(Object.getPrototypeOf(s)),C=t(x,{deleteProperty(O,P){const $=Reflect.get(O,P);g(P);const I=Reflect.deleteProperty(O,P);return I&&u(["delete",[P],$]),I},set(O,P,$,I){var A;const M=Reflect.has(O,P),j=Reflect.get(O,P,I);if(M&&(e(j,$)||i.has($)&&e(j,i.get($))))return!0;g(P),cu($)&&($=QP($)||$);let Q=$;if(!((A=Object.getOwnPropertyDescriptor(O,P))!=null&&A.set)){!Fo.has($)&&zf($)&&(Q=r0($));const N=!dl.has(Q)&&Fo.get(Q);N&&b(P,N)}return Reflect.set(O,P,Q,I),u(["set",[P],$,j]),!0}});i.set(s,C);const k=[x,p,o,y];return Fo.set(C,k),Reflect.ownKeys(s).forEach(O=>{const P=Object.getOwnPropertyDescriptor(s,O);P.get||P.set?Object.defineProperty(x,O,P):C[O]=s[O]}),C})=>[r,Fo,dl,e,t,zf,n,o,i,a],[rV]=aV();function r0(e={}){return rV(e)}function sV(e,t,n){const o=Fo.get(e);let i;const a=[],r=o[3];let s=!1;const l=r(c=>{a.push(c),i||(i=Promise.resolve().then(()=>{i=void 0,s&&t(a.splice(0))}))});return s=!0,()=>{s=!1,l()}}function lV(e){const t=Fo.get(e),[n,o,i]=t;return i(n,o())}var cV=le("floating-panel").parts("trigger","positioner","content","header","body","title","resizeTrigger","dragTrigger","stageTrigger","closeTrigger","control");cV.build();var dV=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`float:${e.id}:trigger`},uV=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`float:${e.id}:positioner`},hV=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`float:${e.id}:content`},pV=e=>{var t;return((t=e.ids)==null?void 0:t.header)??`float:${e.id}:header`},Hf=e=>e.getById(dV(e)),jf=e=>e.getById(uV(e)),Wf=e=>e.getById(hV(e)),fV=e=>e.getById(pV(e)),Zn=(e,t,n)=>{let o;return Be(t)?o=Db(t):o=nk(e.getWin()),n&&(o=Ur({x:-o.width,y:o.minY,width:o.width*3,height:o.height*2})),oo(o,["x","y","width","height"])},Sa=r0({stack:[],count(){return this.stack.length},add(e){this.stack.includes(e)||this.stack.push(e)},remove(e){const t=this.stack.indexOf(e);t<0||this.stack.splice(t,1)},bringToFront(e){this.remove(e),this.add(e)},isTopmost(e){return this.stack[this.stack.length-1]===e},indexOf(e){return this.stack.indexOf(e)}}),{not:Uf,and:gV}=et(),mV={minimize:"Minimize window",maximize:"Maximize window",restore:"Restore window"};Uf("isMaximized"),Uf("isMinimized"),gV("isOpenControlled","closeOnEsc");ee()(["allowOverflow","closeOnEscape","defaultOpen","defaultPosition","defaultSize","dir","disabled","draggable","getAnchorPosition","getBoundaryEl","getRootNode","gridSize","id","ids","lockAspectRatio","maxSize","minSize","onOpenChange","onPositionChange","onPositionChangeEnd","onSizeChange","onSizeChangeEnd","onStageChange","open","persistRect","position","resizable","size","strategy","translations"]);ee()(["axis"]);var vV=le("hoverCard").parts("arrow","arrowTip","trigger","positioner","content");vV.build();var bV=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`hover-card:${e.id}:trigger`},yV=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`hover-card:${e.id}:content`},xV=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`hover-card:${e.id}:popper`},id=e=>e.getById(bV(e)),wV=e=>e.getById(yV(e)),Gf=e=>e.getById(xV(e)),{not:ws,and:qf}=et();qf("isOpenControlled",ws("isPointer")),ws("isPointer"),qf("isOpenControlled",ws("isPointer")),ws("isPointer");ee()(["closeDelay","dir","getRootNode","id","ids","disabled","onOpenChange","defaultOpen","open","openDelay","positioning","onInteractOutside","onPointerDownOutside","onFocusOutside"]);var CV={Int8Array:"int8array",Uint8Array:"uint8array",Uint8ClampedArray:"uint8clampedarray",Int16Array:"int16array",Uint16Array:"uint16array",Int32Array:"int32array",Uint32Array:"uint32array",Float32Array:"float32array",Float64Array:"float64array",BigInt64Array:"bigint64array",BigUint64Array:"biguint64array"};Object.fromEntries(Object.entries(CV).map(([e,t])=>[t,e]));const[s0,tt]=xe("TreeViewContext"),[_V,Gt]=xe("TreeViewNodePropsContext"),$V=E({__name:"tree-view-branch-content",props:{asChild:{type:Boolean}},setup(e){const t=Sb(),n=tt(),o=Gt(),i=T(()=>{const a=n.value.getBranchContentProps(o),[,r]=t(a,["hidden","data-state"]);return r});return q(),(a,r)=>(w(),S(v(xc).Content,F(i.value,{"as-child":e.asChild}),{default:_(()=>[D(a.$slots,"default")]),_:3},16,["as-child"]))}}),kV=E({__name:"tree-view-branch-control",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getBranchControlProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),SV=E({__name:"tree-view-branch-indent-guide",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getBranchIndentGuideProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),EV=E({__name:"tree-view-branch-indicator",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getBranchIndicatorProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),OV=E({__name:"tree-view-branch-text",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).span,F(v(t).getBranchTextProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),TV=E({__name:"tree-view-branch-trigger",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getBranchTriggerProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),[IV,Nh]=xe("TreeViewNodeContext"),PV=E({__name:"tree-view-branch",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt(),o=Nh(),i=Hr(),a=T(()=>t.value.getBranchContentProps(n));return q(),(r,s)=>(w(),S(v(xc).Root,F({open:v(o).expanded,ids:{content:a.value.id}},v(t).getBranchProps(v(n)),{"lazy-mount":v(i).lazyMount,"unmount-on-exit":v(i).unmountOnExit,"as-child":e.asChild}),{default:_(()=>[D(r.$slots,"default")]),_:3},16,["open","ids","lazy-mount","unmount-on-exit","as-child"]))}}),VV=E({__name:"tree-view-context",setup(e){const t=tt();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),DV=E({__name:"tree-view-item-indicator",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getItemIndicatorProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),MV=E({__name:"tree-view-item-text",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).span,F(v(t).getItemTextProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),RV=E({__name:"tree-view-item",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).div,F(v(t).getItemProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),AV=E({__name:"tree-view-label",props:{asChild:{type:Boolean}},setup(e){const t=tt();return q(),(n,o)=>(w(),S(v(Y).h3,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),FV=E({__name:"tree-view-node-checkbox",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).span,F(v(t).getNodeCheckboxProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),NV=E({__name:"tree-view-node-checkbox-indicator",props:{indeterminate:{},fallback:{}},setup(e){const t=Nh();return(n,o)=>v(t).checked==="indeterminate"?D(n.$slots,"indeterminate",{key:0}):v(t).checked===!0?D(n.$slots,"default",{key:1}):D(n.$slots,"fallback",{key:2})}}),LV=E({__name:"tree-view-node-rename-input",props:{asChild:{type:Boolean}},setup(e){const t=tt(),n=Gt();return q(),(o,i)=>(w(),S(v(Y).input,F(v(t).getNodeRenameInputProps(v(n)),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}}),BV=E({__name:"tree-view-node-context",setup(e){const t=Nh();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),l0=E({__name:"tree-view-node-provider",props:{node:{},indexPath:{}},setup(e){const t=e,n=tt(),o=T(()=>n.value.getNodeState(t));return IV(o),_V(t),q(),(i,a)=>D(i.$slots,"default")}}),zV=E({__name:"tree-view-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return s0(n),xn(T(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}});var c0=le("tree-view").parts("branch","branchContent","branchControl","branchIndentGuide","branchIndicator","branchText","branchTrigger","item","itemIndicator","itemText","label","nodeCheckbox","nodeRenameInput","root","tree"),ot=c0.build(),d0=e=>new fh(e);d0.empty=()=>new fh({rootNode:{children:[]}});var HV=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`tree:${e.id}:root`},Yf=e=>{var t;return((t=e.ids)==null?void 0:t.label)??`tree:${e.id}:label`},u0=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.node)==null?void 0:o.call(n,t))??`tree:${e.id}:node:${t}`},ad=e=>{var t;return((t=e.ids)==null?void 0:t.tree)??`tree:${e.id}:tree`},Kt=(e,t)=>{var n;t!=null&&((n=e.getById(u0(e,t)))==null||n.focus())},h0=(e,t)=>`tree:${e.id}:rename-input:${t}`,Kf=(e,t)=>e.getById(h0(e,t));function p0(e,t,n){const o=e.getNodeValue(t);if(!e.isBranchNode(t))return n.includes(o);const i=e.getDescendantValues(o),a=i.every(s=>n.includes(s)),r=i.some(s=>n.includes(s));return a?!0:r?"indeterminate":!1}function jV(e,t,n){const o=e.getDescendantValues(t),i=o.every(a=>n.includes(a));return Qt(i?qo(n,...o):Mn(n,...o))}function WV(e,t){const n=new Map;return e.visit({onEnter:o=>{const i=e.getNodeValue(o),a=e.isBranchNode(o),r=p0(e,o,t);n.set(i,{type:a?"branch":"leaf",checked:r})}}),n}function UV(e,t){const{context:n,scope:o,computed:i,prop:a,send:r}=e,s=a("collection"),l=Array.from(n.get("expandedValue")),c=Array.from(n.get("selectedValue")),d=Array.from(n.get("checkedValue")),u=i("isTypingAhead"),h=n.get("focusedValue"),p=n.get("loadingStatus"),m=n.get("renamingValue");function f(b){const{node:g,indexPath:y}=b,x=s.getNodeValue(g),C=s.getFirstNode(),k=C?s.getNodeValue(C):null;return{id:u0(o,x),value:x,indexPath:y,valuePath:s.getValuePath(y),disabled:!!g.disabled,focused:h==null?k==x:h===x,selected:c.includes(x),expanded:l.includes(x),loading:p[x]==="loading",depth:y.length,isBranch:s.isBranchNode(g),renaming:m===x,get checked(){return p0(s,g,d)}}}return{collection:s,expandedValue:l,selectedValue:c,checkedValue:d,toggleChecked(b,g){r({type:"CHECKED.TOGGLE",value:b,isBranch:g})},setChecked(b){r({type:"CHECKED.SET",value:b})},clearChecked(){r({type:"CHECKED.CLEAR"})},getCheckedMap(){return WV(s,d)},expand(b){r({type:b?"BRANCH.EXPAND":"EXPANDED.ALL",value:b})},collapse(b){r({type:b?"BRANCH.COLLAPSE":"EXPANDED.CLEAR",value:b})},deselect(b){r({type:b?"NODE.DESELECT":"SELECTED.CLEAR",value:b})},select(b){r({type:b?"NODE.SELECT":"SELECTED.ALL",value:b,isTrusted:!1})},getVisibleNodes(){return i("visibleNodes").map(({node:b})=>b)},focus(b){Kt(o,b)},selectParent(b){const g=s.getParentNode(b);if(!g)return;const y=Mn(c,s.getNodeValue(g));r({type:"SELECTED.SET",value:y,src:"select.parent"})},expandParent(b){const g=s.getParentNode(b);if(!g)return;const y=Mn(l,s.getNodeValue(g));r({type:"EXPANDED.SET",value:y,src:"expand.parent"})},setExpandedValue(b){const g=Qt(b);r({type:"EXPANDED.SET",value:g})},setSelectedValue(b){const g=Qt(b);r({type:"SELECTED.SET",value:g})},startRenaming(b){r({type:"NODE.RENAME",value:b})},submitRenaming(b,g){r({type:"RENAME.SUBMIT",value:b,label:g})},cancelRenaming(){r({type:"RENAME.CANCEL"})},getRootProps(){return t.element({...ot.root.attrs,id:HV(o),dir:a("dir")})},getLabelProps(){return t.element({...ot.label.attrs,id:Yf(o),dir:a("dir")})},getTreeProps(){return t.element({...ot.tree.attrs,id:ad(o),dir:a("dir"),role:"tree","aria-label":"Tree View","aria-labelledby":Yf(o),"aria-multiselectable":a("selectionMode")==="multiple"||void 0,tabIndex:-1,onKeyDown(b){if(b.defaultPrevented||vr(b))return;const g=Pe(b);if(lc(g))return;const y=g?.closest("[data-part=branch-control], [data-part=item]");if(!y)return;const x=y.dataset.value;if(x==null){console.warn("[zag-js/tree-view] Node id not found for node",y);return}const C=y.matches("[data-part=branch-control]"),k={ArrowDown($){un($)||($.preventDefault(),r({type:"NODE.ARROW_DOWN",id:x,shiftKey:$.shiftKey}))},ArrowUp($){un($)||($.preventDefault(),r({type:"NODE.ARROW_UP",id:x,shiftKey:$.shiftKey}))},ArrowLeft($){un($)||y.dataset.disabled||($.preventDefault(),r({type:C?"BRANCH_NODE.ARROW_LEFT":"NODE.ARROW_LEFT",id:x}))},ArrowRight($){!C||y.dataset.disabled||($.preventDefault(),r({type:"BRANCH_NODE.ARROW_RIGHT",id:x}))},Home($){un($)||($.preventDefault(),r({type:"NODE.HOME",id:x,shiftKey:$.shiftKey}))},End($){un($)||($.preventDefault(),r({type:"NODE.END",id:x,shiftKey:$.shiftKey}))},Space($){var I;y.dataset.disabled||(u?r({type:"TREE.TYPEAHEAD",key:$.key}):(I=k.Enter)==null||I.call(k,$))},Enter($){y.dataset.disabled||Si(g)&&un($)||(r({type:C?"BRANCH_NODE.CLICK":"NODE.CLICK",id:x,src:"keyboard"}),Si(g)||$.preventDefault())},"*"($){y.dataset.disabled||($.preventDefault(),r({type:"SIBLINGS.EXPAND",id:x}))},a($){!$.metaKey||y.dataset.disabled||($.preventDefault(),r({type:"SELECTED.ALL",moveFocus:!0}))},F2($){if(y.dataset.disabled)return;const I=a("canRename");if(!I)return;const A=s.getIndexPath(x);if(A){const M=s.at(A);if(M&&!I(M,A))return}$.preventDefault(),r({type:"NODE.RENAME",value:x})}},O=br(b,{dir:a("dir")}),P=k[O];if(P){P(b);return}jn.isValidEvent(b)&&(r({type:"TREE.TYPEAHEAD",key:b.key,id:x}),b.preventDefault())}})},getNodeState:f,getItemProps(b){const g=f(b);return t.element({...ot.item.attrs,id:g.id,dir:a("dir"),"data-ownedby":ad(o),"data-path":b.indexPath.join("/"),"data-value":g.value,tabIndex:g.focused?0:-1,"data-focus":V(g.focused),role:"treeitem","aria-current":g.selected?"true":void 0,"aria-selected":g.disabled?void 0:g.selected,"data-selected":V(g.selected),"aria-disabled":Ne(g.disabled),"data-disabled":V(g.disabled),"data-renaming":V(g.renaming),"aria-level":g.depth,"data-depth":g.depth,style:{"--depth":g.depth},onFocus(y){y.stopPropagation(),r({type:"NODE.FOCUS",id:g.value})},onClick(y){if(g.disabled||!Go(y)||Si(y.currentTarget)&&un(y))return;const x=y.metaKey||y.ctrlKey;r({type:"NODE.CLICK",id:g.value,shiftKey:y.shiftKey,ctrlKey:x}),y.stopPropagation(),Si(y.currentTarget)||y.preventDefault()}})},getItemTextProps(b){const g=f(b);return t.element({...ot.itemText.attrs,"data-disabled":V(g.disabled),"data-selected":V(g.selected),"data-focus":V(g.focused)})},getItemIndicatorProps(b){const g=f(b);return t.element({...ot.itemIndicator.attrs,"aria-hidden":!0,"data-disabled":V(g.disabled),"data-selected":V(g.selected),"data-focus":V(g.focused),hidden:!g.selected})},getBranchProps(b){const g=f(b);return t.element({...ot.branch.attrs,"data-depth":g.depth,dir:a("dir"),"data-branch":g.value,role:"treeitem","data-ownedby":ad(o),"data-value":g.value,"aria-level":g.depth,"aria-selected":g.disabled?void 0:g.selected,"data-path":b.indexPath.join("/"),"data-selected":V(g.selected),"aria-expanded":g.expanded,"data-state":g.expanded?"open":"closed","aria-disabled":Ne(g.disabled),"data-disabled":V(g.disabled),"data-loading":V(g.loading),"aria-busy":Ne(g.loading),style:{"--depth":g.depth}})},getBranchIndicatorProps(b){const g=f(b);return t.element({...ot.branchIndicator.attrs,"aria-hidden":!0,"data-state":g.expanded?"open":"closed","data-disabled":V(g.disabled),"data-selected":V(g.selected),"data-focus":V(g.focused),"data-loading":V(g.loading)})},getBranchTriggerProps(b){const g=f(b);return t.element({...ot.branchTrigger.attrs,role:"button",dir:a("dir"),"data-disabled":V(g.disabled),"data-state":g.expanded?"open":"closed","data-value":g.value,"data-loading":V(g.loading),disabled:g.loading,onClick(y){g.disabled||g.loading||(r({type:"BRANCH_TOGGLE.CLICK",id:g.value}),y.stopPropagation())}})},getBranchControlProps(b){const g=f(b);return t.element({...ot.branchControl.attrs,role:"button",id:g.id,dir:a("dir"),tabIndex:g.focused?0:-1,"data-path":b.indexPath.join("/"),"data-state":g.expanded?"open":"closed","data-disabled":V(g.disabled),"data-selected":V(g.selected),"data-focus":V(g.focused),"data-renaming":V(g.renaming),"data-value":g.value,"data-depth":g.depth,"data-loading":V(g.loading),"aria-busy":Ne(g.loading),onFocus(y){r({type:"NODE.FOCUS",id:g.value}),y.stopPropagation()},onClick(y){if(g.disabled||g.loading||!Go(y)||Si(y.currentTarget)&&un(y))return;const x=y.metaKey||y.ctrlKey;r({type:"BRANCH_NODE.CLICK",id:g.value,shiftKey:y.shiftKey,ctrlKey:x}),y.stopPropagation()}})},getBranchTextProps(b){const g=f(b);return t.element({...ot.branchText.attrs,dir:a("dir"),"data-disabled":V(g.disabled),"data-state":g.expanded?"open":"closed","data-loading":V(g.loading)})},getBranchContentProps(b){const g=f(b);return t.element({...ot.branchContent.attrs,role:"group",dir:a("dir"),"data-state":g.expanded?"open":"closed","data-depth":g.depth,"data-path":b.indexPath.join("/"),"data-value":g.value,hidden:!g.expanded})},getBranchIndentGuideProps(b){const g=f(b);return t.element({...ot.branchIndentGuide.attrs,"data-depth":g.depth})},getNodeCheckboxProps(b){const g=f(b),y=g.checked;return t.element({...ot.nodeCheckbox.attrs,tabIndex:-1,role:"checkbox","data-state":y===!0?"checked":y===!1?"unchecked":"indeterminate","aria-checked":y===!0?"true":y===!1?"false":"mixed","data-disabled":V(g.disabled),onClick(x){if(x.defaultPrevented||g.disabled||!Go(x))return;r({type:"CHECKED.TOGGLE",value:g.value,isBranch:g.isBranch}),x.stopPropagation();const C=x.currentTarget.closest("[role=treeitem]");C?.focus({preventScroll:!0})}})},getNodeRenameInputProps(b){const g=f(b);return t.input({...ot.nodeRenameInput.attrs,id:h0(o,g.value),type:"text","aria-label":"Rename tree item",hidden:!g.renaming,onKeyDown(y){vr(y)||(y.key==="Escape"&&(r({type:"RENAME.CANCEL"}),y.preventDefault()),y.key==="Enter"&&(r({type:"RENAME.SUBMIT",label:y.currentTarget.value}),y.preventDefault()),y.stopPropagation())},onBlur(y){r({type:"RENAME.SUBMIT",label:y.currentTarget.value})}})}}}function Cs(e,t){const{context:n,prop:o,refs:i}=e;if(!o("loadChildren")){n.set("expandedValue",f=>Qt(Mn(f,...t)));return}const a=n.get("loadingStatus"),[r,s]=wp(t,f=>a[f]==="loaded");if(r.length>0&&n.set("expandedValue",f=>Qt(Mn(f,...r))),s.length===0)return;const l=o("collection"),[c,d]=wp(s,f=>{const b=l.findNode(f);return l.getNodeChildren(b).length>0});if(c.length>0&&n.set("expandedValue",f=>Qt(Mn(f,...c))),d.length===0)return;n.set("loadingStatus",f=>({...f,...d.reduce((b,g)=>({...b,[g]:"loading"}),{})}));const u=d.map(f=>{const b=l.getIndexPath(f),g=l.getValuePath(b),y=l.findNode(f);return{id:f,indexPath:b,valuePath:g,node:y}}),h=i.get("pendingAborts"),p=o("loadChildren");ah(p,()=>"[zag-js/tree-view] `loadChildren` is required for async expansion");const m=u.map(({id:f,indexPath:b,valuePath:g,node:y})=>{const x=h.get(f);x&&(x.abort(),h.delete(f));const C=new AbortController;return h.set(f,C),p({valuePath:g,indexPath:b,node:y,signal:C.signal})});Promise.allSettled(m).then(f=>{var b,g;const y=[],x=[],C=n.get("loadingStatus");let k=o("collection");f.forEach((O,P)=>{const{id:$,indexPath:I,node:A,valuePath:M}=u[P];O.status==="fulfilled"?(C[$]="loaded",y.push($),k=k.replace(I,{...A,children:O.value})):(h.delete($),Reflect.deleteProperty(C,$),x.push({node:A,error:O.reason,indexPath:I,valuePath:M}))}),n.set("loadingStatus",C),y.length&&(n.set("expandedValue",O=>Qt(Mn(O,...y))),(b=o("onLoadChildrenComplete"))==null||b({collection:k})),x.length&&((g=o("onLoadChildrenError"))==null||g({nodes:x}))})}function Jn(e){const{prop:t,context:n}=e;return function({indexPath:o}){return t("collection").getValuePath(o).slice(0,-1).some(i=>!n.get("expandedValue").includes(i))}}var{and:rn}=et(),GV={props({props:e}){return{selectionMode:"single",collection:d0.empty(),typeahead:!0,expandOnClick:!0,defaultExpandedValue:[],defaultSelectedValue:[],...e}},initialState(){return"idle"},context({prop:e,bindable:t,getContext:n}){return{expandedValue:t(()=>({defaultValue:e("defaultExpandedValue"),value:e("expandedValue"),isEqual:Je,onChange(o){var i;const a=n().get("focusedValue");(i=e("onExpandedChange"))==null||i({expandedValue:o,focusedValue:a,get expandedNodes(){return e("collection").findNodes(o)}})}})),selectedValue:t(()=>({defaultValue:e("defaultSelectedValue"),value:e("selectedValue"),isEqual:Je,onChange(o){var i;const a=n().get("focusedValue");(i=e("onSelectionChange"))==null||i({selectedValue:o,focusedValue:a,get selectedNodes(){return e("collection").findNodes(o)}})}})),focusedValue:t(()=>({defaultValue:e("defaultFocusedValue")||null,value:e("focusedValue"),onChange(o){var i;(i=e("onFocusChange"))==null||i({focusedValue:o,get focusedNode(){return o?e("collection").findNode(o):null}})}})),loadingStatus:t(()=>({defaultValue:{}})),checkedValue:t(()=>({defaultValue:e("defaultCheckedValue")||[],value:e("checkedValue"),isEqual:Je,onChange(o){var i;(i=e("onCheckedChange"))==null||i({checkedValue:o})}})),renamingValue:t(()=>({sync:!0,defaultValue:null}))}},refs(){return{typeaheadState:{...jn.defaultOptions},pendingAborts:new Map}},computed:{isMultipleSelection:({prop:e})=>e("selectionMode")==="multiple",isTypingAhead:({refs:e})=>e.get("typeaheadState").keysSoFar.length>0,visibleNodes:({prop:e,context:t})=>{const n=[];return e("collection").visit({skip:Jn({prop:e,context:t}),onEnter:(o,i)=>{n.push({node:o,indexPath:i})}}),n}},on:{"EXPANDED.SET":{actions:["setExpanded"]},"EXPANDED.CLEAR":{actions:["clearExpanded"]},"EXPANDED.ALL":{actions:["expandAllBranches"]},"BRANCH.EXPAND":{actions:["expandBranches"]},"BRANCH.COLLAPSE":{actions:["collapseBranches"]},"SELECTED.SET":{actions:["setSelected"]},"SELECTED.ALL":[{guard:rn("isMultipleSelection","moveFocus"),actions:["selectAllNodes","focusTreeLastNode"]},{guard:"isMultipleSelection",actions:["selectAllNodes"]}],"SELECTED.CLEAR":{actions:["clearSelected"]},"NODE.SELECT":{actions:["selectNode"]},"NODE.DESELECT":{actions:["deselectNode"]},"CHECKED.TOGGLE":{actions:["toggleChecked"]},"CHECKED.SET":{actions:["setChecked"]},"CHECKED.CLEAR":{actions:["clearChecked"]},"NODE.FOCUS":{actions:["setFocusedNode"]},"NODE.ARROW_DOWN":[{guard:rn("isShiftKey","isMultipleSelection"),actions:["focusTreeNextNode","extendSelectionToNextNode"]},{actions:["focusTreeNextNode"]}],"NODE.ARROW_UP":[{guard:rn("isShiftKey","isMultipleSelection"),actions:["focusTreePrevNode","extendSelectionToPrevNode"]},{actions:["focusTreePrevNode"]}],"NODE.ARROW_LEFT":{actions:["focusBranchNode"]},"BRANCH_NODE.ARROW_LEFT":[{guard:"isBranchExpanded",actions:["collapseBranch"]},{actions:["focusBranchNode"]}],"BRANCH_NODE.ARROW_RIGHT":[{guard:rn("isBranchFocused","isBranchExpanded"),actions:["focusBranchFirstNode"]},{actions:["expandBranch"]}],"SIBLINGS.EXPAND":{actions:["expandSiblingBranches"]},"NODE.HOME":[{guard:rn("isShiftKey","isMultipleSelection"),actions:["extendSelectionToFirstNode","focusTreeFirstNode"]},{actions:["focusTreeFirstNode"]}],"NODE.END":[{guard:rn("isShiftKey","isMultipleSelection"),actions:["extendSelectionToLastNode","focusTreeLastNode"]},{actions:["focusTreeLastNode"]}],"NODE.CLICK":[{guard:rn("isCtrlKey","isMultipleSelection"),actions:["toggleNodeSelection"]},{guard:rn("isShiftKey","isMultipleSelection"),actions:["extendSelectionToNode"]},{actions:["selectNode"]}],"BRANCH_NODE.CLICK":[{guard:rn("isCtrlKey","isMultipleSelection"),actions:["toggleNodeSelection"]},{guard:rn("isShiftKey","isMultipleSelection"),actions:["extendSelectionToNode"]},{guard:"expandOnClick",actions:["selectNode","toggleBranchNode"]},{actions:["selectNode"]}],"BRANCH_TOGGLE.CLICK":{actions:["toggleBranchNode"]},"TREE.TYPEAHEAD":{actions:["focusMatchedNode"]}},exit:["clearPendingAborts"],states:{idle:{on:{"NODE.RENAME":{target:"renaming",actions:["setRenamingValue"]}}},renaming:{entry:["syncRenameInput","focusRenameInput"],on:{"RENAME.SUBMIT":{guard:"isRenameLabelValid",target:"idle",actions:["submitRenaming"]},"RENAME.CANCEL":{target:"idle",actions:["cancelRenaming"]}}}},implementations:{guards:{isBranchFocused:({context:e,event:t})=>e.get("focusedValue")===t.id,isBranchExpanded:({context:e,event:t})=>e.get("expandedValue").includes(t.id),isShiftKey:({event:e})=>e.shiftKey,isCtrlKey:({event:e})=>e.ctrlKey,hasSelectedItems:({context:e})=>e.get("selectedValue").length>0,isMultipleSelection:({prop:e})=>e("selectionMode")==="multiple",moveFocus:({event:e})=>!!e.moveFocus,expandOnClick:({prop:e})=>!!e("expandOnClick"),isRenameLabelValid:({event:e})=>e.label.trim()!==""},actions:{selectNode({context:e,event:t}){const n=t.id||t.value;e.set("selectedValue",o=>n==null?o:!t.isTrusted&&Ri(n)?o.concat(...n):[Ri(n)?Lr(n):n].filter(Boolean))},deselectNode({context:e,event:t}){const n=Js(t.id||t.value);e.set("selectedValue",o=>qo(o,...n))},setFocusedNode({context:e,event:t}){e.set("focusedValue",t.id)},clearFocusedNode({context:e}){e.set("focusedValue",null)},clearSelectedItem({context:e}){e.set("selectedValue",[])},toggleBranchNode({context:e,event:t,action:n}){const o=e.get("expandedValue").includes(t.id);n(o?["collapseBranch"]:["expandBranch"])},expandBranch(e){const{event:t}=e;Cs(e,[t.id])},expandBranches(e){const{context:t,event:n}=e,o=Js(n.value);Cs(e,jc(o,t.get("expandedValue")))},collapseBranch({context:e,event:t}){e.set("expandedValue",n=>qo(n,t.id))},collapseBranches(e){const{context:t,event:n}=e,o=Js(n.value);t.set("expandedValue",i=>qo(i,...o))},setExpanded({context:e,event:t}){Ri(t.value)&&e.set("expandedValue",t.value)},clearExpanded({context:e}){e.set("expandedValue",[])},setSelected({context:e,event:t}){Ri(t.value)&&e.set("selectedValue",t.value)},clearSelected({context:e}){e.set("selectedValue",[])},focusTreeFirstNode({prop:e,scope:t}){const n=e("collection"),o=n.getFirstNode(),i=n.getNodeValue(o);Kt(t,i)},focusTreeLastNode(e){const{prop:t,scope:n}=e,o=t("collection"),i=o.getLastNode(void 0,{skip:Jn(e)}),a=o.getNodeValue(i);Kt(n,a)},focusBranchFirstNode({event:e,prop:t,scope:n}){const o=t("collection"),i=o.findNode(e.id),a=o.getFirstNode(i),r=o.getNodeValue(a);Kt(n,r)},focusTreeNextNode(e){const{event:t,prop:n,scope:o}=e,i=n("collection"),a=i.getNextNode(t.id,{skip:Jn(e)});if(!a)return;const r=i.getNodeValue(a);Kt(o,r)},focusTreePrevNode(e){const{event:t,prop:n,scope:o}=e,i=n("collection"),a=i.getPreviousNode(t.id,{skip:Jn(e)});if(!a)return;const r=i.getNodeValue(a);Kt(o,r)},focusBranchNode({event:e,prop:t,scope:n}){const o=t("collection"),i=o.getParentNode(e.id),a=i?o.getNodeValue(i):void 0;Kt(n,a)},selectAllNodes({context:e,prop:t}){e.set("selectedValue",t("collection").getValues())},focusMatchedNode(e){const{context:t,prop:n,refs:o,event:i,scope:a,computed:r}=e,s=r("visibleNodes").map(({node:c})=>({textContent:n("collection").stringifyNode(c),id:n("collection").getNodeValue(c)})),l=jn(s,{state:o.get("typeaheadState"),activeId:t.get("focusedValue"),key:i.key});Kt(a,l?.id)},toggleNodeSelection({context:e,event:t}){const n=Zo(e.get("selectedValue"),t.id);e.set("selectedValue",n)},expandAllBranches(e){const{context:t,prop:n}=e,o=n("collection").getBranchValues(),i=jc(o,t.get("expandedValue"));Cs(e,i)},expandSiblingBranches(e){const{context:t,event:n,prop:o}=e,i=o("collection"),a=i.getIndexPath(n.id);if(!a)return;const r=i.getSiblingNodes(a).map(l=>i.getNodeValue(l)),s=jc(r,t.get("expandedValue"));Cs(e,s)},extendSelectionToNode(e){const{context:t,event:n,prop:o,computed:i}=e,a=o("collection"),r=Bi(t.get("selectedValue"))||a.getNodeValue(a.getFirstNode()),s=n.id;let l=[r,s],c=0;i("visibleNodes").forEach(({node:d})=>{const u=a.getNodeValue(d);c===1&&l.push(u),(u===r||u===s)&&c++}),t.set("selectedValue",Qt(l))},extendSelectionToNextNode(e){const{context:t,event:n,prop:o}=e,i=o("collection"),a=i.getNextNode(n.id,{skip:Jn(e)});if(!a)return;const r=new Set(t.get("selectedValue")),s=i.getNodeValue(a);s!=null&&(r.has(n.id)&&r.has(s)?r.delete(n.id):r.has(s)||r.add(s),t.set("selectedValue",Array.from(r)))},extendSelectionToPrevNode(e){const{context:t,event:n,prop:o}=e,i=o("collection"),a=i.getPreviousNode(n.id,{skip:Jn(e)});if(!a)return;const r=new Set(t.get("selectedValue")),s=i.getNodeValue(a);s!=null&&(r.has(n.id)&&r.has(s)?r.delete(n.id):r.has(s)||r.add(s),t.set("selectedValue",Array.from(r)))},extendSelectionToFirstNode(e){const{context:t,prop:n}=e,o=n("collection"),i=Bi(t.get("selectedValue")),a=[];o.visit({skip:Jn(e),onEnter:r=>{const s=o.getNodeValue(r);if(a.push(s),s===i)return"stop"}}),t.set("selectedValue",a)},extendSelectionToLastNode(e){const{context:t,prop:n}=e,o=n("collection"),i=Bi(t.get("selectedValue")),a=[];let r=!1;o.visit({skip:Jn(e),onEnter:s=>{const l=o.getNodeValue(s);l===i&&(r=!0),r&&a.push(l)}}),t.set("selectedValue",a)},clearPendingAborts({refs:e}){const t=e.get("pendingAborts");t.forEach(n=>n.abort()),t.clear()},toggleChecked({context:e,event:t,prop:n}){const o=n("collection");e.set("checkedValue",i=>t.isBranch?jV(o,t.value,i):Zo(i,t.value))},setChecked({context:e,event:t}){e.set("checkedValue",t.value)},clearChecked({context:e}){e.set("checkedValue",[])},setRenamingValue({context:e,event:t,prop:n}){e.set("renamingValue",t.value);const o=n("onRenameStart");if(o){const i=n("collection"),a=i.getIndexPath(t.value);if(a){const r=i.at(a);r&&o({value:t.value,node:r,indexPath:a})}}},submitRenaming({context:e,event:t,prop:n,scope:o}){var i;const a=e.get("renamingValue");if(!a)return;const r=n("collection").getIndexPath(a);if(!r)return;const s=t.label.trim(),l=n("onBeforeRename");if(l&&!l({value:a,label:s,indexPath:r})){e.set("renamingValue",null),Kt(o,a);return}(i=n("onRenameComplete"))==null||i({value:a,label:s,indexPath:r}),e.set("renamingValue",null),Kt(o,a)},cancelRenaming({context:e,scope:t}){const n=e.get("renamingValue");e.set("renamingValue",null),n&&Kt(t,n)},syncRenameInput({context:e,scope:t,prop:n}){const o=e.get("renamingValue");if(!o)return;const i=n("collection"),a=i.findNode(o);if(!a)return;const r=i.stringifyNode(a),s=Kf(t,o);Jt(s,r)},focusRenameInput({context:e,scope:t}){const n=e.get("renamingValue");if(!n)return;const o=Kf(t,n);o&&(o.focus(),o.select())}}}};ee()(["ids","collection","dir","expandedValue","expandOnClick","defaultFocusedValue","focusedValue","getRootNode","id","onExpandedChange","onFocusChange","onSelectionChange","checkedValue","selectedValue","selectionMode","typeahead","defaultExpandedValue","defaultSelectedValue","defaultCheckedValue","onCheckedChange","onLoadChildrenComplete","onLoadChildrenError","loadChildren","canRename","onRenameStart","onBeforeRename","onRenameComplete"]);ee()(["node","indexPath"]);const f0=(e,t)=>{const n=vt(),o=It(Pt),i=Ut(Wt),a=T(()=>{const s=Re(e);return{id:n,dir:i.value.dir,getRootNode:o?.value.getRootNode,...an(s),onFocusChange:l=>{var c;t?.("focusChange",l),t?.("update:focusedValue",l.focusedValue),(c=s.onFocusChange)==null||c.call(s,l)},onExpandedChange:l=>{var c;t?.("expandedChange",l),t?.("update:expandedValue",l.expandedValue),(c=s.onExpandedChange)==null||c.call(s,l)},onSelectionChange:l=>{var c;t?.("selectionChange",l),t?.("update:selectedValue",l.selectedValue),(c=s.onSelectionChange)==null||c.call(s,l)},onCheckedChange:l=>{var c;t?.("checkedChange",l),t?.("update:checkedValue",l.checkedValue),(c=s.onCheckedChange)==null||c.call(s,l)},onLoadChildrenComplete:l=>{var c;t?.("loadChildrenComplete",l),(c=s.onLoadChildrenComplete)==null||c.call(s,l)},onLoadChildrenError:l=>{var c;t?.("loadChildrenError",l),(c=s.onLoadChildrenError)==null||c.call(s,l)},onRenameStart:l=>{var c;t?.("renameStart",l),(c=s.onRenameStart)==null||c.call(s,l)},onBeforeRename:l=>{var c;return t?.("beforeRename",l),((c=s.onBeforeRename)==null?void 0:c.call(s,l))??!0},onRenameComplete:l=>{var c;t?.("renameComplete",l),(c=s.onRenameComplete)==null||c.call(s,l)}}}),r=bt(GV,a);return T(()=>UV(r,Tt))},g0=E({__name:"tree-view-root",props:jt({collection:{},defaultExpandedValue:{},defaultSelectedValue:{},defaultCheckedValue:{},defaultFocusedValue:{},checkedValue:{},expandOnClick:{type:Boolean},expandedValue:{},focusedValue:{},id:{},ids:{},selectedValue:{},selectionMode:{},typeahead:{type:Boolean},loadChildren:{type:Function},canRename:{type:Function},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{expandOnClick:void 0,typeahead:void 0,lazyMount:void 0,unmountOnExit:void 0,asChild:void 0}),emits:["expandedChange","focusChange","selectionChange","checkedChange","loadChildrenComplete","loadChildrenError","renameStart","beforeRename","renameComplete","update:expandedValue","update:focusedValue","update:selectedValue","update:checkedValue"],setup(e,{emit:t}){const n=e,o=f0(n,t);return s0(o),xn(T(()=>({lazyMount:n.lazyMount,unmountOnExit:n.unmountOnExit}))),q(),(i,a)=>(w(),S(v(Y).div,F(v(o).getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(i.$slots,"default")]),_:3},16,["as-child"]))}}),m0=E({__name:"tree-view-tree",props:{asChild:{type:Boolean}},setup(e){const t=tt();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getTreeProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),qn=Object.freeze(Object.defineProperty({__proto__:null,Branch:PV,BranchContent:$V,BranchControl:kV,BranchIndentGuide:SV,BranchIndicator:EV,BranchText:OV,BranchTrigger:TV,Context:VV,Item:RV,ItemIndicator:DV,ItemText:MV,Label:AV,NodeCheckbox:FV,NodeCheckboxIndicator:NV,NodeContext:BV,NodeProvider:l0,NodeRenameInput:LV,Root:g0,RootProvider:zV,Tree:m0},Symbol.toStringTag,{value:"Module"}));var v0=le("listbox").parts("label","input","item","itemText","itemIndicator","itemGroup","itemGroupLabel","content","root","valueText");v0.build();var b0=e=>new si(e);b0.empty=()=>new si({items:[]});var qV=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`select:${e.id}:content`},YV=(e,t)=>{var n,o;return((o=(n=e.ids)==null?void 0:n.item)==null?void 0:o.call(n,t))??`select:${e.id}:option:${t}`},Xf=e=>e.getById(qV(e)),Zf=(e,t)=>e.getById(YV(e,t)),{guards:KV,createMachine:XV}=bc(),{or:ZV}=KV;XV({props({props:e}){return{loopFocus:!1,composite:!0,defaultValue:[],multiple:!1,typeahead:!0,collection:b0.empty(),orientation:"vertical",selectionMode:"single",...e}},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:Je,onChange(n){var o;const i=e("collection").findMany(n);return(o=e("onValueChange"))==null?void 0:o({value:n,items:i})}})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),sync:!0,onChange(n){var o;(o=e("onHighlightChange"))==null||o({highlightedValue:n,highlightedItem:e("collection").find(n),highlightedIndex:e("collection").indexOf(n)})}})),highlightedItem:t(()=>({defaultValue:null})),selectedItems:t(()=>{const n=e("value")??e("defaultValue")??[];return{defaultValue:e("collection").findMany(n)}}),focused:t(()=>({sync:!0,defaultValue:!1}))}},refs(){return{typeahead:{...jn.defaultOptions},focusVisible:!1}},computed:{hasSelectedItems:({context:e})=>e.get("value").length>0,isTypingAhead:({refs:e})=>e.get("typeahead").keysSoFar!=="",isInteractive:({prop:e})=>!e("disabled"),selection:({context:e,prop:t})=>{const n=new vS(e.get("value"));return n.selectionMode=t("selectionMode"),n.deselectable=!!t("deselectable"),n},multiple:({prop:e})=>e("selectionMode")==="multiple"||e("selectionMode")==="extended",valueAsString:({context:e,prop:t})=>t("collection").stringifyItems(e.get("selectedItems"))},initialState(){return"idle"},watch({context:e,prop:t,track:n,action:o}){n([()=>e.get("value").toString()],()=>{o(["syncSelectedItems"])}),n([()=>e.get("highlightedValue")],()=>{o(["syncHighlightedItem"])}),n([()=>t("collection").toString()],()=>{o(["syncHighlightedValue"])})},effects:["trackFocusVisible"],on:{"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedItem"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setSelectedItems"]},"VALUE.CLEAR":{actions:["clearSelectedItems"]}},states:{idle:{effects:["scrollToHighlightedItem"],on:{"INPUT.FOCUS":{actions:["setFocused"]},"CONTENT.FOCUS":[{guard:ZV("hasSelectedValue","hasHighlightedValue"),actions:["setFocused"]},{actions:["setFocused","setDefaultHighlightedValue"]}],"CONTENT.BLUR":{actions:["clearFocused"]},"ITEM.CLICK":{actions:["setHighlightedItem","selectHighlightedItem"]},"CONTENT.TYPEAHEAD":{actions:["setFocused","highlightMatchingItem"]},"ITEM.POINTER_MOVE":{actions:["highlightItem"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedItem"]},NAVIGATE:{actions:["setFocused","setHighlightedItem","selectWithKeyboard"]}}}},implementations:{guards:{hasSelectedValue:({context:e})=>e.get("value").length>0,hasHighlightedValue:({context:e})=>e.get("highlightedValue")!=null},effects:{trackFocusVisible:({scope:e,refs:t})=>{var n;return Cc({root:(n=e.getRootNode)==null?void 0:n.call(e),onChange(o){t.set("focusVisible",o.isFocusVisible)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){const o=i=>{const a=e.get("highlightedValue");if(a==null||Xk()!=="keyboard")return;const r=Xf(n),s=t("scrollToIndexFn");if(s){const c=t("collection").indexOf(a);s?.({index:c,immediate:i,getElement(){return Zf(n,a)}});return}const l=Zf(n,a);yr(l,{rootEl:r,block:"nearest"})};return ae(()=>o(!0)),Nr(()=>Xf(n),{defer:!0,attributes:["data-activedescendant"],callback(){o(!1)}})}},actions:{selectHighlightedItem({context:e,prop:t,event:n,computed:o}){const i=n.value??e.get("highlightedValue"),a=t("collection");if(i==null||!a.has(i))return;const r=o("selection");if(n.shiftKey&&o("multiple")&&n.anchorValue){const s=r.extendSelection(a,n.anchorValue,i);Ea(r,s,t("onSelect")),e.set("value",Array.from(s))}else{const s=r.select(a,i,n.metaKey);Ea(r,s,t("onSelect")),e.set("value",Array.from(s))}},selectWithKeyboard({context:e,prop:t,event:n,computed:o}){const i=o("selection"),a=t("collection");if(n.shiftKey&&o("multiple")&&n.anchorValue){const r=i.extendSelection(a,n.anchorValue,n.value);Ea(i,r,t("onSelect")),e.set("value",Array.from(r));return}if(t("selectOnHighlight")){const r=i.replaceSelection(a,n.value);Ea(i,r,t("onSelect")),e.set("value",Array.from(r))}},highlightItem({context:e,event:t}){e.set("highlightedValue",t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:o}){const i=t("collection").search(n.key,{state:o.get("typeahead"),currentValue:e.get("highlightedValue")});i!=null&&e.set("highlightedValue",i)},setHighlightedItem({context:e,event:t}){e.set("highlightedValue",t.value)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},selectItem({context:e,prop:t,event:n,computed:o}){const i=t("collection"),a=o("selection"),r=a.select(i,n.value);Ea(a,r,t("onSelect")),e.set("value",Array.from(r))},clearItem({context:e,event:t,computed:n}){const o=n("selection").deselect(t.value);e.set("value",Array.from(o))},setSelectedItems({context:e,event:t}){e.set("value",t.value)},clearSelectedItems({context:e}){e.set("value",[])},syncSelectedItems({context:e,prop:t}){const n=t("collection"),o=e.get("selectedItems"),i=e.get("value").map(a=>o.find(r=>n.getItemValue(r)===a)||n.find(a));e.set("selectedItems",i)},syncHighlightedItem({context:e,prop:t}){const n=t("collection"),o=e.get("highlightedValue"),i=o?n.find(o):null;e.set("highlightedItem",i)},syncHighlightedValue({context:e,prop:t}){const n=t("collection"),o=e.get("highlightedValue");o!=null&&!n.has(o)&&e.set("highlightedValue",null)},setFocused({context:e}){e.set("focused",!0)},setDefaultHighlightedValue({context:e,prop:t}){const n=t("collection").firstValue;n!=null&&e.set("highlightedValue",n)},clearFocused({context:e}){e.set("focused",!1)}}}});var JV=(e,t)=>{const n=new Set(e);for(const o of t)n.delete(o);return n};function Ea(e,t,n){const o=JV(t,e);for(const i of o)n?.({value:i})}ee()(["collection","defaultHighlightedValue","defaultValue","dir","disabled","deselectable","disallowSelectAll","getRootNode","highlightedValue","id","ids","loopFocus","onHighlightChange","onSelect","onValueChange","orientation","scrollToIndexFn","selectionMode","selectOnHighlight","typeahead","value"]);ee()(["item","highlightOnHover"]);ee()(["id"]);ee()(["htmlFor"]);v0.extendWith("empty");var QV=le("marquee").parts("root","viewport","content","edge","item");QV.build();ee()(["autoFill","defaultPaused","delay","dir","getRootNode","id","ids","loopCount","onComplete","onLoopComplete","onPauseChange","paused","pauseOnInteraction","reverse","side","spacing","speed","translations"]);var y0=le("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem");y0.build();var x0=e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`menu:${e.id}:trigger`},e2=e=>{var t;return((t=e.ids)==null?void 0:t.contextTrigger)??`menu:${e.id}:ctx-trigger`},w0=e=>{var t;return((t=e.ids)==null?void 0:t.content)??`menu:${e.id}:content`},t2=e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`menu:${e.id}:popper`},du=(e,t)=>`${e.id}/${t}`,Eo=e=>e?.dataset.value??null,no=e=>e.getById(w0(e)),Jf=e=>e.getById(t2(e)),_s=e=>e.getById(x0(e)),n2=(e,t)=>t?e.getById(du(e,t)):null,rd=e=>e.getById(e2(e)),Zr=e=>{const t=`[role^="menuitem"][data-ownedby=${CSS.escape(w0(e))}]:not([data-disabled])`;return fo(no(e),t)},o2=e=>Bi(Zr(e)),i2=e=>Lr(Zr(e)),Lh=(e,t)=>t?e.id===t||e.dataset.value===t:!1,a2=(e,t)=>{const n=Zr(e),o=n.findIndex(i=>Lh(i,t.value));return YC(n,o,{loop:t.loop??t.loopFocus})},r2=(e,t)=>{const n=Zr(e),o=n.findIndex(i=>Lh(i,t.value));return KC(n,o,{loop:t.loop??t.loopFocus})},s2=(e,t)=>{const n=Zr(e),o=n.find(i=>Lh(i,t.value));return jn(n,{state:t.typeaheadState,key:t.key,activeId:o?.id??null})},l2=e=>{var t;return!!((t=e?.getAttribute("role"))!=null&&t.startsWith("menuitem"))&&!!(e!=null&&e.hasAttribute("aria-controls"))},c2="menu:select";function d2(e,t){if(!e)return;const n=Fe(e),o=new n.CustomEvent(c2,{detail:{value:t}});e.dispatchEvent(o)}var{not:Ft,and:yi,or:u2}=et();Ft("isSubmenu"),u2("isOpenAutoFocusEvent","isArrowDownEvent"),yi(Ft("isTriggerItem"),"isOpenControlled"),Ft("isTriggerItem"),yi("isSubmenu","isOpenControlled"),Ft("isPointerSuspended"),yi(Ft("isPointerSuspended"),Ft("isTriggerItem")),yi(Ft("isTriggerItemHighlighted"),Ft("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),yi(Ft("isTriggerItemHighlighted"),Ft("isHighlightedItemEditable"),"closeOnSelect"),yi(Ft("isTriggerItemHighlighted"),Ft("isHighlightedItemEditable"));function Qf(e){let t=e.parent;for(;t&&t.context.get("isSubmenu");)t=t.refs.get("parent");t?.send({type:"CLOSE"})}function h2(e,t){return e?ak(e,t):!1}function p2(e,t,n){const o=Object.keys(e).length>0;if(!t)return null;if(!o)return du(n,t);for(const i in e){const a=e[i],r=x0(a.scope);if(r===t)return r}return du(n,t)}ee()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","onSelect","open","positioning","typeahead"]);ee()(["closeOnSelect","disabled","value","valueText"]);ee()(["htmlFor"]);ee()(["id"]);ee()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]);const[C0,$o]=xe("NumberInputContext"),f2=E({__name:"number-input-context",setup(e){const t=$o();return(n,o)=>D(n.$slots,"default",Ke(Qe(v(t))))}}),g2=E({__name:"number-input-control",props:{asChild:{type:Boolean}},setup(e){const t=$o();return q(),(n,o)=>(w(),S(v(Y).div,F(v(t).getControlProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),m2=E({__name:"number-input-decrement-trigger",props:{asChild:{type:Boolean}},setup(e){const t=$o();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getDecrementTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),v2=E({__name:"number-input-increment-trigger",props:{asChild:{type:Boolean}},setup(e){const t=$o();return q(),(n,o)=>(w(),S(v(Y).button,F(v(t).getIncrementTriggerProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),b2=E({__name:"number-input-input",props:{asChild:{type:Boolean}},setup(e){const t=$o(),n=wn();return q(),(o,i)=>{var a;return w(),S(v(Y).input,F({"aria-describedby":(a=v(n))==null?void 0:a.ariaDescribedby},v(t).getInputProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["aria-describedby","as-child"])}}}),y2=E({__name:"number-input-label",props:{asChild:{type:Boolean}},setup(e){const t=$o();return q(),(n,o)=>(w(),S(v(Y).label,F(v(t).getLabelProps(),{"as-child":e.asChild}),{default:_(()=>[D(n.$slots,"default")]),_:3},16,["as-child"]))}}),x2=E({__name:"number-input-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,n=T(()=>t.value);return C0(n),q(),(o,i)=>(w(),S(v(Y).div,F(n.value.getRootProps(),{"as-child":e.asChild}),{default:_(()=>[D(o.$slots,"default")]),_:3},16,["as-child"]))}});let sd=new Map,uu=!1;try{uu=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Wl=!1;try{Wl=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const _0={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};let w2=class{format(t){let n="";if(!uu&&this.options.signDisplay!=null?n=_2(this.numberFormatter,this.options.signDisplay,t):n=this.numberFormatter.format(t),this.options.style==="unit"&&!Wl){var o;let{unit:i,unitDisplay:a="short",locale:r}=this.resolvedOptions();if(!i)return n;let s=(o=_0[i])===null||o===void 0?void 0:o[a];n+=s[r]||s.default}return n}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.format(t)} – ${this.format(n)}`}formatRangeToParts(t,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let o=this.numberFormatter.formatToParts(t),i=this.numberFormatter.formatToParts(n);return[...o.map(a=>({...a,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(a=>({...a,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!uu&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!Wl&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,n={}){this.numberFormatter=C2(t,n),this.options=n}};function C2(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${n}`),t.style==="unit"&&!Wl){var o;let{unit:r,unitDisplay:s="short"}=t;if(!r)throw new Error('unit option must be provided with style: "unit"');if(!(!((o=_0[r])===null||o===void 0)&&o[s]))throw new Error(`Unsupported unit ${r} with unitDisplay = ${s}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((r,s)=>r[0]<s[0]?-1:1).join():"");if(sd.has(i))return sd.get(i);let a=new Intl.NumberFormat(e,t);return sd.set(i,a),a}function _2(e,t,n){if(t==="auto")return e.format(n);if(t==="never")return e.format(Math.abs(n));{let o=!1;if(t==="always"?o=n>0||Object.is(n,0):t==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):o=n>0),o){let i=e.format(-n),a=e.format(n),r=i.replace(a,"").replace(/\u200e|\u061C/,"");return[...r].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(a,"!!!").replace(r,"+").replace("!!!",a)}else return e.format(n)}}const $2=new RegExp("^.*\\(.*\\).*$"),k2=["latn","arab","hanidec","deva","beng","fullwide"];let $0=class{parse(t){return ld(this.locale,this.options,t).parse(t)}isValidPartialNumber(t,n,o){return ld(this.locale,this.options,t).isValidPartialNumber(t,n,o)}getNumberingSystem(t){return ld(this.locale,this.options,t).options.numberingSystem}constructor(t,n={}){this.locale=t,this.options=n}};const eg=new Map;function ld(e,t,n){let o=tg(e,t);if(!e.includes("-nu-")&&!o.isValidPartialNumber(n)){for(let i of k2)if(i!==o.options.numberingSystem){let a=tg(e+(e.includes("-u-")?"-nu-":"-u-nu-")+i,t);if(a.isValidPartialNumber(n))return a}}return o}function tg(e,t){let n=e+(t?Object.entries(t).sort((i,a)=>i[0]<a[0]?-1:1).join():""),o=eg.get(n);return o||(o=new S2(e,t),eg.set(n,o)),o}let S2=class{parse(t){let n=this.sanitize(t);if(this.symbols.group&&(n=xi(n,this.symbols.group,"")),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,"-")),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let r=n.indexOf("-");n=n.replace("-",""),n=n.replace("+","");let s=n.indexOf(".");s===-1&&(s=n.length),n=n.replace(".",""),s-2===0?n=`0.${n}`:s-2===-1?n=`0.0${n}`:s-2===-2?n="0.00":n=`${n.slice(0,s-2)}.${n.slice(s-2)}`,r>-1&&(n=`-${n}`)}let o=n?+n:NaN;if(isNaN(o))return NaN;if(this.options.style==="percent"){var i,a;let r={...this.options,style:"decimal",minimumFractionDigits:Math.min(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)+2,20),maximumFractionDigits:Math.min(((a=this.options.maximumFractionDigits)!==null&&a!==void 0?a:0)+2,20)};return new $0(this.locale,r).parse(new w2(this.locale,r).format(o))}return this.options.currencySign==="accounting"&&$2.test(t)&&(o=-1*o),o}sanitize(t){return t=t.replace(this.symbols.literals,""),this.symbols.minusSign&&(t=t.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(t=t.replace(",",this.symbols.decimal),t=t.replace("،",this.symbols.decimal)),this.symbols.group&&(t=xi(t,".",this.symbols.group))),this.symbols.group==="’"&&t.includes("'")&&(t=xi(t,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(t=xi(t," ",this.symbols.group),t=xi(t,/\u00A0/g,this.symbols.group)),t}isValidPartialNumber(t,n=-1/0,o=1/0){return t=this.sanitize(t),this.symbols.minusSign&&t.startsWith(this.symbols.minusSign)&&n<0?t=t.slice(this.symbols.minusSign.length):this.symbols.plusSign&&t.startsWith(this.symbols.plusSign)&&o>0&&(t=t.slice(this.symbols.plusSign.length)),this.symbols.group&&t.startsWith(this.symbols.group)||this.symbols.decimal&&t.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(t=xi(t,this.symbols.group,"")),t=t.replace(this.symbols.numeral,""),this.symbols.decimal&&(t=t.replace(this.symbols.decimal,"")),t.length===0)}constructor(t,n={}){this.locale=t,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(t,n),this.options=this.formatter.resolvedOptions(),this.symbols=O2(t,this.formatter,this.options,n);var o,i;this.options.style==="percent"&&(((o=this.options.minimumFractionDigits)!==null&&o!==void 0?o:0)>18||((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}};const ng=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),E2=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function O2(e,t,n,o){var i,a,r,s;let l=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),d=l.formatToParts(10000.111),u=E2.map($=>l.formatToParts($));var h;let p=(h=(i=c.find($=>$.type==="minusSign"))===null||i===void 0?void 0:i.value)!==null&&h!==void 0?h:"-",m=(a=d.find($=>$.type==="plusSign"))===null||a===void 0?void 0:a.value;!m&&(o?.signDisplay==="exceptZero"||o?.signDisplay==="always")&&(m="+");let f=(r=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find($=>$.type==="decimal"))===null||r===void 0?void 0:r.value,b=(s=c.find($=>$.type==="group"))===null||s===void 0?void 0:s.value,g=c.filter($=>!ng.has($.type)).map($=>og($.value)),y=u.flatMap($=>$.filter(I=>!ng.has(I.type)).map(I=>og(I.value))),x=[...new Set([...g,...y])].sort(($,I)=>I.length-$.length),C=x.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${x.join("|")}|[\\p{White_Space}]`,"gu"),k=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),O=new Map(k.map(($,I)=>[$,I])),P=new RegExp(`[${k.join("")}]`,"g");return{minusSign:p,plusSign:m,decimal:f,group:b,literals:C,numeral:P,index:$=>String(O.get($))}}function xi(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function og(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var k0=le("numberInput").parts("root","label","input","control","valueText","incrementTrigger","decrementTrigger","scrubber"),Qn=k0.build(),T2=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`number-input:${e.id}`},Xa=e=>{var t;return((t=e.ids)==null?void 0:t.input)??`number-input:${e.id}:input`},S0=e=>{var t;return((t=e.ids)==null?void 0:t.incrementTrigger)??`number-input:${e.id}:inc`},E0=e=>{var t;return((t=e.ids)==null?void 0:t.decrementTrigger)??`number-input:${e.id}:dec`},I2=e=>{var t;return((t=e.ids)==null?void 0:t.scrubber)??`number-input:${e.id}:scrubber`},O0=e=>`number-input:${e.id}:cursor`,P2=e=>{var t;return((t=e.ids)==null?void 0:t.label)??`number-input:${e.id}:label`},Za=e=>e.getById(Xa(e)),V2=e=>e.getById(S0(e)),D2=e=>e.getById(E0(e)),T0=e=>e.getDoc().getElementById(O0(e)),M2=(e,t)=>{let n=null;return t==="increment"&&(n=V2(e)),t==="decrement"&&(n=D2(e)),n},R2=(e,t)=>{if(!uc())return N2(e,t),()=>{var n;(n=T0(e))==null||n.remove()}},A2=e=>{const t=e.getDoc(),n=t.documentElement,o=t.body;return o.style.pointerEvents="none",n.style.userSelect="none",n.style.cursor="ew-resize",()=>{o.style.pointerEvents="",n.style.userSelect="",n.style.cursor="",n.style.length||n.removeAttribute("style"),o.style.length||o.removeAttribute("style")}},F2=(e,t)=>{const{point:n,isRtl:o,event:i}=t,a=e.getWin(),r=rr(i.movementX,a.devicePixelRatio),s=rr(i.movementY,a.devicePixelRatio);let l=r>0?"increment":r<0?"decrement":null;o&&l==="increment"&&(l="decrement"),o&&l==="decrement"&&(l="increment");const c={x:n.x+r,y:n.y+s},d=a.innerWidth,u=rr(7.5,a.devicePixelRatio);return c.x=d_(c.x+u,d)-u,{hint:l,point:c}},N2=(e,t)=>{const n=e.getDoc(),o=n.createElement("div");o.className="scrubber--cursor",o.id=O0(e),Object.assign(o.style,{width:"15px",height:"15px",position:"fixed",pointerEvents:"none",left:"0px",top:"0px",zIndex:Hv,transform:t?`translate3d(${t.x}px, ${t.y}px, 0px)`:void 0,willChange:"transform"}),o.innerHTML=`
|
|
3
3
|
<svg width="46" height="15" style="left: -15.5px; position: absolute; top: 0; filter: drop-shadow(rgba(0, 0, 0, 0.4) 0px 1px 1.1px);">
|
|
4
4
|
<g transform="translate(2 3)">
|
|
@@ -19,7 +19,7 @@ ${u}`)}).finally(()=>{n.set("transforming",!1)})):c(s)},removeFile({context:e,ev
|
|
|
19
19
|
top: ${r.top}px;
|
|
20
20
|
z-index: 1000;
|
|
21
21
|
pointer-events: none;
|
|
22
|
-
`,this.app=Fd(Gm,{data:t,placement:r.placement,targetPosition:n}),this.app.mount(this.container),document.body.appendChild(this.container)}hide(){this.app&&(this.app.unmount(),this.app=null),this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null)}updatePosition(t){if(this.container&&this.app){const n={width:this.container.offsetWidth,height:this.container.offsetHeight},o=this.calculateOptimalPosition(t,n);this.container.style.left=`${o.left}px`,this.container.style.top=`${o.top}px`;const i=this.app._instance;i!=null&&i.props&&(i.props.placement=o.placement,i.props.targetPosition=t)}}}new DB;let qm=!1;qm||(io.register(Su,Eu,gl,pl,Z3,Tr),qm=!0);se({slots:["ganttChart"],base:{ganttChart:{backgroundColor:"background.default",borderRadius:"lg",border:"1px solid",borderColor:"border.muted",height:"fit-content"}}});se({slots:["timeItem","checkIcon","footer","mentuItemContainer"],base:{timeItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},checkIcon:{width:"12",height:"12",color:"text.normal"},footer:{display:"flex",alignItems:"center",paddingY:"6",paddingX:"8",borderRadius:"md",_focus:{outline:"none"}},mentuItemContainer:{display:"flex",flexDirection:"column",paddingX:"8",paddingTop:"8",maxHeight:"176",overflowY:"auto",gap:"0",scrollBehavior:"smooth","&:focus-within":{scrollBehavior:"smooth"}}}});const MB={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function RB(e,t){return w(),H("svg",MB,[...t[0]||(t[0]=[U("g",{"clip-path":"url(#clip0_12427_264)"},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM11.5303 6.53033L12.0607 6L11 4.93934L10.4697 5.46967L6.5 9.43934L5.53033 8.46967L5 7.93934L3.93934 9L4.46967 9.53033L5.96967 11.0303C6.26256 11.3232 6.73744 11.3232 7.03033 11.0303L11.5303 6.53033Z",fill:"currentColor"})],-1),U("defs",null,[U("clipPath",{id:"clip0_12427_264"},[U("rect",{width:"16",height:"16",fill:"white"})])],-1)])])}const AB={render:RB},FB={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function NB(e,t){return w(),H("svg",FB,[...t[0]||(t[0]=[U("g",{"clip-path":"url(#clip0_12427_230)"},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.3934 0.292893C4.58094 0.105357 4.83529 0 5.10051 0H10.8995C11.1647 0 11.4191 0.105357 11.6066 0.292893L15.7071 4.3934C15.8946 4.58093 16 4.83529 16 5.10051V10.8995C16 11.1647 15.8946 11.4191 15.7071 11.6066L11.6066 15.7071C11.4191 15.8946 11.1647 16 10.8995 16H5.10051C4.83529 16 4.58094 15.8946 4.3934 15.7071L0.292894 11.6066C0.105357 11.4191 0 11.1647 0 10.8995V5.10051C0 4.83529 0.105357 4.58094 0.292893 4.3934L4.3934 0.292893ZM8.75 3.75V4.5V8V8.75H7.25V8V4.5V3.75H8.75ZM8 12C8.55229 12 9 11.5523 9 11C9 10.4477 8.55229 10 8 10C7.44772 10 7 10.4477 7 11C7 11.5523 7.44772 12 8 12Z",fill:"currentColor"})],-1),U("defs",null,[U("clipPath",{id:"clip0_12427_230"},[U("rect",{width:"16",height:"16",fill:"white"})])],-1)])])}const LB={render:NB},BB=se({className:"toast",slots:[...U0.keys(),"icon"],base:{root:{paddingTop:"6",paddingBottom:"6",paddingLeft:"12",paddingRight:"12",borderRadius:"md",boxShadow:"elevations-overlay",gap:"6",fontSize:"base",fontWeight:"regular",fontFamily:"sans",lineHeight:"lg",letterSpacing:"normal",backgroundColor:"blackalpha.900",color:"whitealpha.1000",display:"flex",alignItems:"center",whiteSpace:"nowrap"}},variants:{variant:{default:{},success:{icon:{color:"green.800"}},failed:{icon:{color:"red.800"}}}},defaultVariants:{variant:"default"}}),Od=(e,t,n)=>{const o=BB({variant:t}),i=JM({...n||{},placement:n?.placement||"bottom-end",overlap:n?.overlap||!0,gap:n?.gap||24,duration:n?.duration||3e3});i.create({title:e});const a=s=>({success:at(AB,{class:o.icon}),failed:at(LB,{class:o.icon}),default:at("",null)})[s],r=document.createElement("div");document.body.appendChild(r),Fd({render:()=>at(oR,{toaster:i},{default:()=>at(eR,{class:o.root,"data-testid":`toast-${t}`},[a(t),at(tR,null,e)])})}).mount(r)},Hi={success:(e,t)=>Od(e,"success",t),failed:(e,t)=>Od(e,"failed",t),default:(e,t)=>Od(e,"default",t)};ri({base:{},variants:{textStyle:{body_xsmall_caps_medium:{textStyle:"body_xsmall_caps_medium"},body_xsmall_caps_bold:{textStyle:"body_xsmall_caps_bold"},body_xsmall_regular:{textStyle:"body_xsmall_regular"},body_xsmall_medium:{textStyle:"body_xsmall_medium"},body_small_regular:{textStyle:"body_small_regular"},body_small_medium:{textStyle:"body_small_medium"},body_small_semibold:{textStyle:"body_small_semibold"},body_base_regular:{textStyle:"body_base_regular"},body_base_medium:{textStyle:"body_base_medium"},body_base_semibold:{textStyle:"body_base_semibold"},heading_text_h1:{textStyle:"heading_text_h1"},heading_text_h2:{textStyle:"heading_text_h2"},heading_text_h3:{textStyle:"heading_text_h3"},heading_text_h4:{textStyle:"heading_text_h4"},heading_text_h5:{textStyle:"heading_text_h5"},code_regular:{textStyle:"code_regular"},code_small:{textStyle:"code_small"},number_regular:{textStyle:"number_regular"},number_small:{textStyle:"number_small"}}},defaultVariants:{textStyle:"body_base_regular"}});const zB=E({name:"InputWidget",__name:"Input",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=T(()=>e.property.ui);return(n,o)=>(w(),S(v(zh),F({"model-value":e.field.state.value},v(t),{disabled:e.property.BYOCdisabled||e.disabled,variant:"default",state:"idle","onUpdate:modelValue":e.field.handleChange,onBlur:e.field.handleBlur}),null,16,["model-value","disabled","onUpdate:modelValue","onBlur"]))}}),Td=Object.assign(zB,{__name:"Input"}),HB=E({name:"BooleanWidget",__name:"Boolean",props:{property:{},field:{}},setup(e){const t=n=>{e.field.handleChange(n==="true")};return(n,o)=>(w(),H("div",null,[z(v(rx),{modelValue:e.field.state.value,options:[{value:"true",label:"Yes"},{value:"false",label:"No"}],"onUpdate:modelValue":t},null,8,["modelValue"])]))}}),jB=Object.assign(HB,{__name:"Boolean"}),WB=E({name:"RadioWidget",__name:"Radio",props:{property:{},field:{}},setup(e){const t=T(()=>e.property.enum&&e.property.enumNames?e.property.enum.map((n,o)=>({value:n,label:e.property.enumNames?.[o]||n})):[]);return(n,o)=>(w(),H("div",null,[z(v(rx),{"model-value":e.field.state.value,options:v(t),"onUpdate:modelValue":e.field.handleChange},null,8,["model-value","options","onUpdate:modelValue"])]))}}),UB=Object.assign(WB,{__name:"Radio"}),Dt=Symbol("form"),Yx=Symbol("getPayloadFn"),Ou=(e,t,n,o)=>{const i={},a=e[`${t}.auth-type`],r=e[`${t}.connector`],s=e[`${t}.connectorType`],l=e[`${t}.credentialType`];Object.keys(e).forEach(p=>{p.includes(`${t}.extra.`)&&(i[p.replace(`${t}.extra.`,"")]=e[p])}),Object.keys(e).forEach(p=>{p.includes(`${t}.${a}.extra.`)&&(i[p.replace(`${t}.${a}.extra.`,"")]=e[p])});const c=e[`${t}.host`]?.endsWith("/")?e[`${t}.host`].substr(0,e[`${t}.host`].length-1):e[`${t}.host`],d=e[`${t}.host`]?.startsWith("http")?e[`${t}.host`].startsWith("https")?443:80:e[`${t}.port`],u=typeof c=="string"&&c.length>0,h=typeof l=="string"&&l.length>0;return{name:o,...h&&{credentialType:l},...u&&{host:c},...u&&d&&{port:e[`${t}.port`]?parseInt(e[`${t}.port`]):d},authType:a,connectorType:s,...r?{connector:r}:{},connectBy:e[`${t}.connectBy`],username:e[`${t}.${a}.username`],password:e[`${t}.${a}.password`],extra:i,connectorConfigName:n}},Kx=Array.isArray,Xx=e=>!!e&&e.constructor===Object,ep=(e,t)=>{if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(n.length!==o.length)return!1;for(let i=0;i<n.length;i++)if(!Reflect.has(t,n[i])||!ep(e[n[i]],t[n[i]]))return!1;return!0},GB=(e,t,n=o=>o)=>e.reduce((o,i)=>(o[t(i)]=n(i),o),{}),qB=(e,t)=>{const n=e.reduce((o,i)=>{const a=i;return o[a]||(o[a]=i),o},{});return Object.values(n)},YB=(e,t)=>Object.keys(e).reduce((o,i)=>(o[i]=t(e[i],i),o),{}),tp=(e,t)=>e?t.reduce((n,o)=>(Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]),n),{}):{},Zx=(e,t)=>e?!t||t.length===0?e:t.reduce((n,o)=>(delete n[o],n),{...e}):{},KB=(e,t,n)=>{const o=t.split(/[\.\[\]]/g);let i=e;for(const a of o){if(i===null||i===void 0)return n;const r=a.replace(/['"]/g,"");r.trim()!==""&&(i=i[r])}return i===void 0?n:i},XB=e=>{if(!e)return[];const t=(n,o)=>Xx(n)?Object.entries(n).flatMap(([i,a])=>t(a,[...o,i])):Kx(n)?n.flatMap((i,a)=>t(i,[...o,`${a}`])):[o.join(".")];return t(e,[])},yo=e=>e?GB(XB(e),t=>t,t=>KB(e,t)):{},Jx=(e,t=" ")=>{if(!e)return"";const n=t.replace(/[\W]{1}/g,"\\$&"),o=new RegExp(`^[${n}]+|[${n}]+$`,"g");return e.replace(o,"")},ZB={trailing:!0};function JB(e,t=25,n={}){if(n={...ZB,...n},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let o,i,a=[],r,s;const l=(u,h)=>(r=QB(e,u,h),r.finally(()=>{if(r=null,n.trailing&&s&&!i){const p=l(u,s);return s=null,p}}),r),c=function(...u){return n.trailing&&(s=u),r||new Promise(h=>{const p=!i&&n.leading;clearTimeout(i),i=setTimeout(()=>{i=null;const m=n.leading?o:l(this,u);s=null;for(const f of a)f(m);a=[]},t),p?(o=l(this,u),h(o)):a.push(h)})},d=u=>{u&&(clearTimeout(u),i=null)};return c.isPending=()=>!!i,c.cancel=()=>{d(i),a=[],s=null},c.flush=()=>{if(d(i),!s||r)return;const u=s;return s=null,l(this,u)},c}async function QB(e,t,n){return await e.apply(t,n)}function es(...e){const t=typeof e[e.length-1]=="string"?e.pop():void 0;e6(e[0],e[1])&&e.unshift(t);let[n,o,i={}]=e,a=!1;const r=T(()=>Re(n));if(typeof r.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a string.");if(typeof o!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const s=Aw();i.server??=!0,i.default??=n6,i.getCachedData??=ew,i.lazy??=!1,i.immediate??=!0,i.deep??=Fw.deep,i.dedupe??="cancel",i._functionName,s._asyncData[r.value];function l(){const m={cause:"initial",dedupe:i.dedupe};return s._asyncData[r.value]?._init||(m.cachedData=i.getCachedData(r.value,s,{cause:"initial"}),s._asyncData[r.value]=Ym(s,r.value,o,i,m.cachedData)),()=>s._asyncData[r.value].execute(m)}const c=l(),d=s._asyncData[r.value];d._deps++;const u=i.server!==!1&&s.payload.serverRendered;{let m=function(C){const k=s._asyncData[C];k?._deps&&(k._deps--,k._deps===0&&k?._off())};const f=Vr();if(f&&u&&i.immediate&&!f.sp&&(f.sp=[]),f&&!f._nuxtOnBeforeMountCbs){f._nuxtOnBeforeMountCbs=[];const C=f._nuxtOnBeforeMountCbs;Nw(()=>{C.forEach(k=>{k()}),C.splice(0,C.length)}),Wu(()=>C.splice(0,C.length))}const b=f&&(f._nuxtClientOnly||st(Lw,!1));u&&s.isHydrating&&(d.error.value||d.data.value!==void 0)?d.status.value=d.error.value?"error":"success":f&&(!b&&s.payload.serverRendered&&s.isHydrating||i.lazy)&&i.immediate?f._nuxtOnBeforeMountCbs.push(c):i.immediate&&d.status.value!=="success"&&c();const g=zw(),y=Ae(r,(C,k)=>{if((C||k)&&C!==k){a=!0;const O=s._asyncData[k]?.data.value!==void 0,P=s._asyncDataPromises[k]!==void 0,$={cause:"initial",dedupe:i.dedupe};if(!s._asyncData[C]?._init){let I;k&&O?I=s._asyncData[k].data.value:(I=i.getCachedData(C,s,{cause:"initial"}),$.cachedData=I),s._asyncData[C]=Ym(s,C,o,i,I)}s._asyncData[C]._deps++,k&&m(k),(i.immediate||O||P)&&s._asyncData[C].execute($),jw(()=>{a=!1})}},{flush:"sync"}),x=i.watch?Ae(i.watch,()=>{a||d._execute({cause:"watch",dedupe:i.dedupe})}):()=>{};g&&Bw(()=>{y(),x(),m(r.value)})}const h={data:Bs(()=>s._asyncData[r.value]?.data),pending:Bs(()=>s._asyncData[r.value]?.pending),status:Bs(()=>s._asyncData[r.value]?.status),error:Bs(()=>s._asyncData[r.value]?.error),refresh:(...m)=>s._asyncData[r.value]?._init?s._asyncData[r.value].execute(...m):l()(),execute:(...m)=>h.refresh(...m),clear:()=>{const m=s._asyncData[r.value];if(m?._abortController)try{m._abortController.abort(new DOMException("AsyncData aborted by user.","AbortError"))}finally{m._abortController=void 0}Qx(s,r.value)}},p=Promise.resolve(s._asyncDataPromises[r.value]).then(()=>h);return Object.assign(p,h),p}function Bs(e){return T({get(){return e()?.value},set(t){const n=e();n&&(n.value=t)}})}function e6(e,t){return!(typeof e=="string"||typeof e=="object"&&e!==null||typeof e=="function"&&typeof t=="function")}function Qx(e,t){t in e.payload.data&&(e.payload.data[t]=void 0),t in e.payload._errors&&(e.payload._errors[t]=void 0),e._asyncData[t]&&(e._asyncData[t].data.value=v(e._asyncData[t]._default()),e._asyncData[t].error.value=void 0,e._asyncData[t].status.value="idle"),t in e._asyncDataPromises&&(e._asyncDataPromises[t]=void 0)}function t6(e,t){const n={};for(const o of t)n[o]=e[o];return n}function Ym(e,t,n,o,i){e.payload._errors[t]??=void 0;const a=o.getCachedData!==ew,r=n,s=o.deep?he:El,l=i!==void 0,c=e.hook("app:data:refresh",async u=>{(!u||u.includes(t))&&await d.execute({cause:"refresh:hook"})}),d={data:s(l?i:o.default()),pending:T(()=>d.status.value==="pending"),error:Tv(e.payload._errors,t),status:El("idle"),execute:(...u)=>{const[h,p=void 0]=u,m=h&&p===void 0&&typeof h=="object"?h:{};if(e._asyncDataPromises[t]&&(m.dedupe??o.dedupe)==="defer")return e._asyncDataPromises[t];{const b="cachedData"in m?m.cachedData:o.getCachedData(t,e,{cause:m.cause??"refresh:manual"});if(b!==void 0)return e.payload.data[t]=d.data.value=b,d.error.value=void 0,d.status.value="success",Promise.resolve(b)}d._abortController&&d._abortController.abort(new DOMException("AsyncData request cancelled by deduplication","AbortError")),d._abortController=new AbortController,d.status.value="pending";const f=new Promise((b,g)=>{try{const y=m.timeout??o.timeout,x=o6([d._abortController?.signal,m?.signal],y);if(x.aborted){const C=x.reason;g(C instanceof Error?C:new DOMException(String(C??"Aborted"),"AbortError"));return}return x.addEventListener("abort",()=>{const C=x.reason;g(C instanceof Error?C:new DOMException(String(C??"Aborted"),"AbortError"))},{once:!0}),Promise.resolve(r(e,{signal:x})).then(b,g)}catch(y){g(y)}}).then(async b=>{let g=b;o.transform&&(g=await o.transform(b)),o.pick&&(g=t6(g,o.pick)),e.payload.data[t]=g,d.data.value=g,d.error.value=void 0,d.status.value="success"}).catch(b=>{if(!(e._asyncDataPromises[t]&&e._asyncDataPromises[t]!==f)&&!d._abortController?.signal.aborted){if(typeof DOMException<"u"&&b instanceof DOMException&&b.name==="AbortError"){d.status.value="idle";return}d.error.value=Hw(b),d.data.value=v(o.default()),d.status.value="error"}}).finally(()=>{delete e._asyncDataPromises[t]});return e._asyncDataPromises[t]=f,e._asyncDataPromises[t]},_execute:JB((...u)=>d.execute(...u),0,{leading:!0}),_default:o.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{c(),e._asyncData[t]?._init&&(e._asyncData[t]._init=!1),a||po(()=>{e._asyncData[t]?._init||(Qx(e,t),d.execute=()=>Promise.resolve())})}};return d}const n6=()=>{},ew=(e,t,n)=>{if(t.isHydrating)return t.payload.data[e];if(n.cause!=="refresh:manual"&&n.cause!=="refresh:hook")return t.static.data[e]};function o6(e,t){const n=e.filter(a=>!!a);if(typeof t=="number"&&t>=0){const a=AbortSignal.timeout?.(t);a&&n.push(a)}if(AbortSignal.any)return AbortSignal.any(n);const o=new AbortController;for(const a of n)if(a.aborted){const r=a.reason??new DOMException("Aborted","AbortError");try{o.abort(r)}catch{o.abort()}return o.signal}const i=()=>{const r=n.find(s=>s.aborted)?.reason??new DOMException("Aborted","AbortError");try{o.abort(r)}catch{o.abort()}};for(const a of n)a.addEventListener?.("abort",i,{once:!0});return o.signal}async function tw(e){const{data:t}=await es(()=>`credential_${Re(e)}`,()=>$fetch(`/workflows/v1/configmap/${Re(e)}`),"$vlaIZ4700T");return{credentialConfig:T(()=>{const o=t.value?.data;return o&&"kind"in o?JSON.parse(o.data.config):o?.config??null}),data:t}}function Nc(e){const t={};return Object.entries(e.properties).forEach(([n,o])=>{o.default?o?.ui?.widget==="Repeater"&&o.default?t[n]=JSON.parse(o.default):t[n]=o.default:o.properties&&(t[n]=Nc(o))}),t}const i6={class:"flex mt-3"},a6={key:1,class:"p-3 mt-4 border rounded-md border-green-400 bg-green-100"},r6={key:0,class:"mt-1"},s6={class:"text-sm text-green-600"},l6={key:2,class:"p-3 mt-4 border rounded-md border-new-red-400 bg-new-red-100"},c6={class:"mt-1"},d6={class:"text-sm text-new-red-600","data-test-id":"error-log-message"},u6=E({__name:"CredentialWidget",props:{property:{},modelValue:{}},async setup(e){let t,n;const o=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),i=st(Dt),{credentialConfig:a}=([t,n]=Rr(()=>tw(()=>e.property.ui.credentialType)),t=await t,n(),t),r=i.useStore(d=>Zx(d.values,["credential_guid_body","credential_property_id"]));Ae(()=>e.property,d=>{d&&i.setFieldValue("credential_property_id",d.id)},{immediate:!0}),Ae(r,d=>{d&&i.setFieldValue("credential_guid_body",Ou(yo(d),e.property.id,e.property.ui?.credentialType,void 0))},{immediate:!0}),Ae(a,d=>{d&&Object.entries(Nc(d)).forEach(([u,h])=>{i.state.values[`${e.property.id}.${u}`]||i.setFieldValue(`${e.property.id}.${u}`,h)})},{immediate:!0});const s=he(!1),l=he(null);async function c(){s.value=!0,l.value=null;try{const d=await $fetch("/workflows/v1/auth",{method:"POST",body:JSON.stringify(Ou(yo(i.state.values),e.property.id,e.property.ui?.credentialType,void 0))});l.value=d}catch(d){l.value={success:!1,message:d?.data?.message||d?.message||"Authentication failed"}}finally{s.value=!1}}return(d,u)=>(w(),H("div",{class:R(e.property.ui.class)},[v(a)?(w(),H(we,{key:0},[z(v(o),{"config-map":v(a),"base-key":e.property.id},null,8,["config-map","base-key"]),U("div",i6,[z(v(Xt),{loading:v(s),label:v(s)?"Testing Authentication":"Test Authentication",onClick:c},null,8,["loading","label"])])],64)):te("",!0),v(l)?.success?(w(),H("div",a6,[u[0]||(u[0]=U("span",{class:"text-sm font-semibold text-green-700"}," Authentication successful ",-1)),v(l).message?(w(),H("div",r6,[U("span",s6,oe(v(l).message),1)])):te("",!0)])):te("",!0),v(l)&&!v(l).success?(w(),H("div",l6,[u[1]||(u[1]=U("span",{class:"text-sm font-semibold text-new-red-700"}," Authentication failed ",-1)),U("div",c6,[U("span",d6,oe(v(l).message),1)])])):te("",!0)],2))}}),h6=Object.assign(u6,{__name:"CredentialWidget"}),p6=E({__name:"Nested",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url));return(n,o)=>(w(),S(v(t),{"config-map":e.property,"base-key":e.property.id},null,8,["config-map","base-key"]))}}),f6=Object.assign(p6,{__name:"Nested"}),g6=E({__name:"Password",props:{field:{},property:{},disabled:{type:Boolean}},setup(e){const t=he(e.field.state.value??""),n=o=>{t.value=o,e.field.handleChange(o)};return(o,i)=>(w(),S(v(zh),{id:e.property.id,type:"password","model-value":v(t),placeholder:e.property.placeholder,disabled:e.disabled,"data-test-id":e.property.id,"onUpdate:modelValue":n,onBlur:e.field.handleBlur},null,8,["id","model-value","placeholder","disabled","data-test-id","onBlur"]))}}),m6=Object.assign(g6,{__name:"Password"}),v6=E({name:"SelectWidget",__name:"Select",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=T(()=>e.property.ui?.mode==="multiple"),n=T(()=>e.property.enum&&e.property.enumNames?e.property.enum.map((a,r)=>({value:a,label:e.property.enumNames?.[r]||a})):[]),o=he((()=>{if(t.value)return e.field.state.value;const a=e.field.state.value;return a?[a]:[]})());function i(a){e.field.handleChange(t.value?a:a[0]),o.value=a}return(a,r)=>(w(),S(v(la),{id:e.property.id,"model-value":v(o),options:v(n),placeholder:e.property.placeholder,"is-disabled":e.disabled,multiple:v(t),variant:"default","onUpdate:modelValue":i,onBlur:e.field.handleBlur},null,8,["id","model-value","options","placeholder","is-disabled","multiple","onBlur"]))}}),b6=Object.assign(v6,{__name:"Select"}),y6=E({__name:"SQLTree",props:{field:{}},async setup(e){let t,n;const o=st(Dt),{data:i}=([t,n]=Rr(()=>es("metadata",()=>$fetch("/workflows/v1/metadata",{method:"POST",body:o.getFieldValue("credential_guid_body")}))),t=await t,n(),t),a=T(()=>i.value?qB(i.value.data.map(h=>h.TABLE_CATALOG)).map(h=>({value:h,label:h,children:i.value.data.filter(p=>p.TABLE_CATALOG===h).map(p=>({value:`${h}:${p.TABLE_SCHEMA}`,label:p.TABLE_SCHEMA}))})):[]),r=u=>{let h=u;return h.startsWith("^")&&(h=h.slice(1)),h.endsWith("$")&&(h=h.slice(0,-1)),h},l=he((u=>{const h=[];if(u){if(typeof u=="object")Object.keys(u)?.forEach(p=>{u[p]?.length>0?u[p]?.forEach(m=>{h.push(`${r(p)}:${r(m)}`)}):h.push(r(p))});else if(typeof u=="string")try{const p=JSON.parse(u);Object.keys(p)?.forEach(m=>{p[m].length>0?p[m]?.forEach(f=>{h.push(`${r(m)}:${r(f)}`)}):h.push(r(m))})}catch{h.push(r(u))}}return h})(e.field.state.value)),c=u=>{const h={};return u.forEach(p=>{if(p.includes(":")){const m=p.split(":")[0];h[`^${m}$`]=[]}else h[`^${p}$`]=[]}),u.forEach(p=>{if(p.includes(":")){const m=p.split(":")[0],f=p.split(":")[1];f&&h[`^${m}$`].push(`^${f}$`)}}),h},d=u=>{const h=c(u);e.field.handleChange(h),l.value=u};return(u,h)=>(w(),S(v(la),{isTree:"",multiple:"",options:v(a),modelValue:v(l),"onUpdate:modelValue":d},null,8,["options","modelValue"]))}}),x6=Object.assign(y6,{__name:"SQLTree"}),w6=E({__name:"APITree",props:{field:{},property:{}},async setup(e){let t,n;const o=st(Dt),{data:i}=([t,n]=Rr(()=>es(`${e.property.id}_metadata`,()=>{const u=o.getFieldValue("credential_guid_body"),h=e.property.ui?.metadataTemplateKey;return $fetch("/workflows/v1/metadata",{method:"POST",body:{...u&&u,...h&&{type:h},...h&&{database:h}}})})),t=await t,n(),t);function a(u,h=null){return u.map(p=>{const m=h?`${h}:${p.value}`:p.value;return{value:m,label:p.title,children:p.children?a(p.children,m):void 0}})}const r=T(()=>i.value?a(i.value.data):[]),l=he((u=>{const h=[],p=(m,f=[])=>{Array.isArray(m)?f.length>0&&h.push(f.join(":")):typeof m=="object"&&m!==null&&Object.keys(m).forEach(b=>{p(m[b],[...f,b])})};if(u)if(typeof u=="string")try{p(JSON.parse(u))}catch{h.push(u)}else p(u);return h})(e.field.state.value)),c=u=>{const h={};return u.forEach(p=>{const m=p.split(":");let f=h;m.forEach((b,g)=>{f[b]||(f[b]={}),g!==m.length-1&&(f=f[b])})}),h},d=u=>{const h=c(u);e.field.handleChange(h),l.value=u};return(u,h)=>(w(),S(v(la),{isTree:"",multiple:"",options:v(r),modelValue:v(l),"onUpdate:modelValue":d},null,8,["options","modelValue"]))}}),C6=Object.assign(w6,{__name:"APITree"}),_6={class:"border border-gray-200 rounded-lg p-6 bg-white"},$6={class:"flex items-center justify-between mb-4"},k6={key:0,class:"mt-4 space-y-3"},S6={class:"flex items-start gap-3"},E6={class:"flex-1"},O6={class:"flex items-center gap-2"},T6={class:"font-medium text-gray-900 capitalize"},I6={key:0,class:"text-sm text-gray-600 mt-1"},P6={key:1,class:"text-sm text-red-600 mt-1"},V6={key:1,class:"mt-4 text-center text-gray-500 text-sm"},D6=E({name:"SageWidget",__name:"Sage",props:{property:{},field:{}},setup(e){const t=st(Yx),n=he(!1),o=he(null);async function i(){n.value=!0,o.value=null;try{const s=await t(),l=await $fetch("/workflows/v1/check",{method:"POST",body:s});o.value=l.data,l.success?Hi.success("Pre-flight checks completed!",{placement:"top",duration:3e3}):Hi.failed("Some pre-flight checks failed",{placement:"top",duration:3e3})}catch(s){Hi.failed("Failed to run pre-flight checks. Please try again.",{placement:"top",duration:3e3}),console.error("Pre-flight check error:",s)}finally{n.value=!1}}const a=s=>s?"✓":"✗",r=s=>s?"text-green-600":"text-red-600";return(s,l)=>(w(),H("div",_6,[U("div",$6,[l[0]||(l[0]=U("div",null,[U("h3",{class:"text-lg font-semibold text-gray-900"}," Pre-flight Checks "),U("p",{class:"text-sm text-gray-500 mt-1"}," Verify your configuration before starting the workflow ")],-1)),z(v(Xt),{label:"Check","is-loading":v(n),onClick:i},null,8,["is-loading"])]),v(o)?(w(),H("div",k6,[(w(!0),H(we,null,Oe(v(o),(c,d)=>(w(),H("div",{key:d,class:"border border-gray-200 rounded-md p-4"},[U("div",S6,[U("span",{class:R(["text-xl font-bold",r(c.success)])},oe(a(c.success)),3),U("div",E6,[U("div",O6,[U("h4",T6,oe(d.replace(/([A-Z])/g," $1").trim()),1),U("span",{class:R(["text-xs px-2 py-0.5 rounded-full font-medium",c.success?"bg-green-100 text-green-700":"bg-red-100 text-red-700"])},oe(c.success?"Passed":"Failed"),3)]),c.success&&c.successMessage?(w(),H("p",I6,oe(c.successMessage),1)):te("",!0),!c.success&&c.failureMessage?(w(),H("p",P6,oe(c.failureMessage),1)):te("",!0)])])]))),128))])):v(n)?te("",!0):(w(),H("div",V6,' Click "Check" to run pre-flight checks '))]))}}),M6=Object.assign(D6,{__name:"Sage"}),R6=E({__name:"Connection",props:{property:{},modelValue:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n={properties:{name:{type:"string",ui:{widget:"input",label:"Connection name",placeholder:"environment",help:"Name of your connection which represents your source environment. Example - 'production', 'development', 'gold', 'analytics' ",required:!0,grid:4,rules:[{required:!0,message:"Please enter a connection name"}]}}}};return(o,i)=>(w(),S(v(t),{"config-map":n,"base-key":e.property.id},null,8,["base-key"]))}}),A6=Object.assign(R6,{__name:"Connection"}),F6={key:0,class:"text-sm text-gray-500 mt-2"},N6={key:1,class:"text-sm text-red-500 mt-2"},L6=E({name:"FileUploadWidget",__name:"FileUpload",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=he(!1),n=he(null),o=async r=>{const s=new FormData;return s.append("file",r),await $fetch("/workflows/v1/file",{method:"POST",body:s})},i=async r=>{const{files:s}=r;if(!s||s.length===0)return;const l=s[0];if(l){t.value=!0,n.value=null;try{const c=await o(l);e.property.ui?.fileMetadata?e.field.handleChange(JSON.stringify({...c,fileKey:c.key,fileId:c.id})):e.field.handleChange(c.id)}catch(c){n.value=c instanceof Error?c.message:"Failed to upload file"}finally{t.value=!1}}},a=T(()=>({placeholder:e.property.ui?.placeholder||"Drag and drop files here",accept:e.property.ui?.accept,isDisabled:e.disabled||t.value}));return(r,s)=>(w(),H("div",null,[z(v(yA),F(v(a),{onFileAccept:i,onBlur:e.field.handleBlur}),null,16,["onBlur"]),v(t)?(w(),H("div",F6," Uploading... ")):te("",!0),v(n)?(w(),H("div",N6,oe(v(n)),1)):te("",!0)]))}}),B6=Object.assign(L6,{__name:"FileUpload"});const Km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),z6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),H6=e=>{const t=z6(e);return t.charAt(0).toUpperCase()+t.slice(1)},j6=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),Xm=e=>e==="";var Ha={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const W6=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":o,strokeWidth:i,"stroke-width":a,size:r=Ha.width,color:s=Ha.stroke,...l},{slots:c})=>at("svg",{...Ha,...l,width:r,height:r,stroke:s,"stroke-width":Xm(n)||Xm(o)||n===!0||o===!0?Number(i||a||Ha["stroke-width"])*24/Number(r):i||a||Ha["stroke-width"],class:j6("lucide",l.class,...e?[`lucide-${Km(H6(e))}-icon`,`lucide-${Km(e)}`]:["lucide-icon"])},[...t.map(d=>at(...d)),...c.default?[c.default()]:[]]);const np=(e,t)=>(n,{slots:o,attrs:i})=>at(W6,{...i,...n,iconNode:t,name:e},o);const U6=np("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const G6=np("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const q6=np("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Y6={key:0,class:"text-red-500"},K6={key:0,class:"absolute right-3 top-3 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer"},X6={class:"flex justify-center"},Z6=E({__name:"Repeater",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=st(Dt),o=r=>{r.pushValue()},i=(r,s)=>{const l=e.property.ui.minItems??1;r.state.value.length>l&&r.removeValue(s)},a=r=>e.property.ui.maxItems!==void 0&&r.state.value.length>=e.property.ui.maxItems;return(r,s)=>(w(),S(v(n).Field,{name:e.property.id,mode:"array"},{default:_(({field:l})=>[U("div",null,[U("div",null,[z(v(Hh),null,{default:_(()=>[Te(oe(e.property.ui?.label)+" ",1),e.property?.required?(w(),H("span",Y6," * ")):te("",!0)]),_:1})]),(w(!0),H(we,null,Oe(l.state.value,(c,d)=>(w(),H("div",{key:d,class:"relative mb-3 border border-gray-300 rounded-lg p-4 group hover:border-gray-400 transition-colors"},[l.state.value.length>(e.property.ui.minItems??1)?(w(),H("div",K6,[z(v(G6),{class:"w-4 h-4 text-gray-400 hover:text-red-500",onClick:()=>{i(l,d)}},null,8,["onClick"])])):te("",!0),z(v(t),{configMap:e.property,baseKey:`${e.property.id}[${d}]`},null,8,["configMap","baseKey"])]))),128)),U("div",X6,[z(v(Xt),{type:"default",label:`Add to ${e.property.ui.label}`,disabled:a(l),onClick:()=>{o(l)}},null,8,["label","disabled","onClick"])])])]),_:1},8,["name"]))}}),J6=Object.assign(Z6,{__name:"Repeater"}),Q6=E({name:"ConnectionSelector",__name:"ConnectionSelector",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=T(()=>e.property.enumNames?.map((i,a)=>({label:i,value:e.property.enum?.[a]}))||[{label:"Production Database",value:"default/snowflake/1234567890"},{label:"Staging Database",value:"default/snowflake/0987654321"},{label:"Development Database",value:"default/postgres/8938390"},{label:"Analytics Warehouse",value:"default/bigquery/1234567890"},{label:"Backup Storage",value:"default/s3/1234567890"}]),n=he(e.field.state.value?[e.field.state.value]:[]);function o(i){n.value=i,e.field.handleChange(i[0])}return(i,a)=>(w(),S(v(la),{id:e.property.id,modelValue:v(n),options:v(t),placeholder:e.property.placeholder,"is-disabled":e.disabled,variant:"default","onUpdate:modelValue":o,onBlur:e.field.handleBlur},null,8,["id","modelValue","options","placeholder","is-disabled","onBlur"]))}}),e5=Object.assign(Q6,{__name:"ConnectionSelector"}),t5=E({name:"SwitcherWidget",__name:"Switcher",props:{property:{},field:{}},setup(e){const t=({checked:n})=>{e.field.handleChange(n)};return(n,o)=>(w(),H("div",null,[z(v(EF),{checked:e.field.state.value,onCheckedChange:t},{default:_(()=>[Te(oe(e.property.ui?.title),1)]),_:1},8,["checked"])]))}}),n5=Object.assign(t5,{__name:"Switcher"}),Zm=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},zt=(...e)=>e.reduce((t,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach(o=>{["__proto__","constructor","prototype"].includes(o)||(Array.isArray(t[o])&&Array.isArray(n[o])?t[o]=zt.options.mergeArrays?zt.options.uniqueArrayItems?Array.from(new Set(t[o].concat(n[o]))):[...t[o],...n[o]]:n[o]:Zm(t[o])&&Zm(n[o])?t[o]=zt(t[o],n[o]):t[o]=n[o]===void 0?zt.options.allowUndefinedOverrides?n[o]:t[o]:n[o])}),t},{}),Tu={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};zt.options=Tu;zt.withOptions=(e,...t)=>{zt.options=Object.assign(Object.assign({},Tu),e);const n=zt(...t);return zt.options=Tu,n};const o5={properties:{divider:{ui:{widget:"divider",class:"mt-0"}},header:{ui:{widget:"header",label:"Secure Agent Configuration",class:"mb-4 text-base text-new-gray-500"}},"agent-name":{type:"string",required:!0,ui:{widget:"agentSelector",label:"Agent",grid:4,rules:[{required:!0,message:"Please select an agent"}]}},"secret-manager":{type:"string",required:!0,enum:["awssecretmanager","azurekeyvault","gcpsecretmanager","secretinjectionenvironment","kubernetes","custom"],enumNames:["AWS Secret Manager","Azure Key Vault","GCP Secret Manager","Environment Variable based Injection","Kubernetes Secret","Custom"],ui:{widget:"select",label:"Secret Store",placeholder:"Secret Store",rules:[{required:!0,message:"Please select the secret store"}]}},"secret-path":{type:"string",required:!0,ui:{label:"Secret Path/Name in Secret Manager",placeholder:"Enter Secret Path/Name",help:"The secret path or name of the stored secret in the secret manager",hidden:!1,grid:4,rules:[{required:!0,message:"Please enter the secret path"}]}},"aws-region":{type:"string",enum:["us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-south-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-west-1","eu-west-2","eu-west-3","eu-north-1","eu-south-1","me-south-1","sa-east-1"],required:!0,enumNames:["US East (N. Virginia)","US East (Ohio)","US West (N. California)","US West (Oregon)","Africa (Cape Town)","Asia Pacific (Hong Kong)","Asia Pacific (Mumbai)","Asia Pacific (Tokyo)","Asia Pacific (Seoul)","Asia Pacific (Osaka)","Asia Pacific (Singapore)","Asia Pacific (Sydney)","Canada (Central)","Europe (Frankfurt)","Europe (Ireland)","Europe (London)","Europe (Paris)","Europe (Stockholm)","Europe (Milan)","Middle East (Bahrain)","South America (São Paulo)"],ui:{widget:"select",label:"AWS Region",placeholder:"Select AWS Region",grid:4,rules:[{required:!0,message:"Please select a region"}]}},"aws-auth-method":{type:"string",required:!0,enum:["iam","iam-assume-role","access-key"],default:"iam",enumNames:["IAM","IAM Assume Role","Access Key and Secret Key"],ui:{widget:"select",label:"AWS Authentication Method",placeholder:"Select AWS Authentication Method",help:"In case of IAM assume role or access key and secret key authentication, the keys should be set as environment variables or added in kubernetes secrets",grid:4,rules:[{required:!0,message:"Please select an AWS authentication method"}]}},"aws-assume-role-arn":{type:"string",required:!0,ui:{label:"AWS Assume Role ARN",placeholder:"Enter AWS Role ARN to assume",help:"The AWS role ARN to assume for accessing AWS Secret Manager",hidden:!1,grid:4}},"azure-auth-method":{type:"string",enum:["managed_identity","service_principal"],default:"managed_identity",enumNames:["Managed Identity","Service Principal"],ui:{widget:"select",label:"Azure Authentication Method",placeholder:"Select Azure Authentication Method",help:"In case of Service Principal authentication, the client id, client secret and tenant id should be set as environment variables or added in kubernetes secrets",grid:4,rules:[{required:!0,message:"Please select an Azure authentication method"}]}},"azure-vault-name":{type:"string",required:!0,ui:{label:"Azure Key Vault Name",placeholder:"Enter Azure Key Vault Name",help:"The name of the Azure Key Vault",hidden:!1,grid:8}},"agent-custom-config":{type:"string",ui:{label:"Agent Custom configuration",placeholder:"{}",help:"Use this if you wish to use any custom configuration for the agent. Do not enter any sensitive information here.",hidden:!1,grid:8}},"aws-secret-manager-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the AWS Secret, add the path for the fields with the placeholder Store Credential Path. Example: username",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"azure-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the Azure Key Vault, add the name of key vault secret for the fields with the placeholder Store Credential Path. Example: atlan-crawler-db-username",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"secret-injection-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"Add the expected environment variable values for the fields with the placeholder Store Credential Path. Example: vault:secret/data/accounts/test#PASSWORD",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"kubernetes-secret-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the K8S Secret, add the corresponding key name in the secret for the fields with the placeholder Store Credential Path. Example: username",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"gcp-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the Google Secret Manager, add the secret path for the fields with the placeholder Store Credential Path. Example: projects/{project_id}/secrets/{secret_id}/versions/{version_id}",link:{label:"View docs",url:"https://ask.atlan.com/"}}}},anyOf:[{properties:{"secret-manager":{const:"awssecretmanager"}},required:["aws-auth-method","aws-region","secret-path","aws-secret-manager-help-text"]},{properties:{"aws-auth-method":{const:"iam-assume-role"},"secret-manager":{const:"awssecretmanager"}},required:["aws-assume-role-arn"]},{properties:{"secret-manager":{const:"azurekeyvault"}},required:["azure-auth-method","azure-vault-name","azure-help-text"]},{properties:{"secret-manager":{const:"secretinjectionenvironment"}},required:["secret-injection-help-text"]},{properties:{"secret-manager":{const:"kubernetes"}},required:["secret-path","kubernetes-secret-help-text"]},{properties:{"secret-manager":{const:"gcpsecretmanager"}},required:["gcp-help-text"]},{properties:{"secret-manager":{const:"custom"}},required:["agent-custom-config"]}]},i5={config:o5},a5=e=>{try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}return!0};function r5(e){if(!e)return{message:null,link:null};if(!a5(e))return{message:e,link:null};const t=JSON.parse(e);return{message:t.error_message??t.debug_message??e,link:t.doc_link?t.doc_link:null}}const s5={key:0,class:"flex items-center justify-center",style:{height:"100px"}},l5={key:1,class:"flex items-center justify-center"},c5={class:"text-red-500 text-sm"},d5={class:"mt-2"},u5={key:0,class:"flex flex-col mt-2 gap-y-2"},h5={class:"flex"},p5={key:0,class:"p-3 border rounded-md border-green-400 bg-green-100"},f5={key:0,class:"mt-1"},g5={class:"text-sm text-green-600"},m5={key:1,class:"p-3 border rounded-md border-new-red-400 bg-new-red-100"},v5={class:"mt-1"},b5={class:"text-sm text-new-red-600","data-test-id":"error-log-message"},y5=["href"],x5="atlan-connectors-agent",w5=E({__name:"Agent",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=st(Dt),o=T(()=>e.property.ui?.agentConfigs??[]),i=T(()=>e.property.ui?.agentType),a=T(()=>{const b=i.value?[{name:i.value,options:{}}]:[],g=o.value.map(([y,x={}])=>({name:y,options:x}));return[...b,...g].filter(y=>y.name)});async function r(b){if(b===x5)return{data:i5};const y=(await $fetch(`/workflows/v1/configmap/${b}`))?.data;return y&&"kind"in y?{data:{config:JSON.parse(y.data.config)}}:{data:{config:y?.config??{}}}}const s=he(null),l=he(!0),c=he(null);Ae(a,async b=>{l.value=!0,c.value=null;try{s.value=await Promise.all(b.map(({name:g})=>r(g)))}catch(g){c.value=g}finally{l.value=!1}},{immediate:!0});const d=T(()=>{if(!s.value)return null;let b={};for(let g=0;g<a.value.length;g++){const y=a.value[g];if(!y)continue;const x=s.value[g]?.data?.config;if(x)if(Object.keys(y.options).length>0){const C=zt(b,x,y.options);b=zt.withOptions({mergeArrays:!1},C,y.options)}else b=zt(b,x)}return Object.keys(b).length>0?b:null}),u=n.useStore(b=>yo(b.values));Ae(d,b=>{b?.properties&&Object.entries(Nc(b)).forEach(([g,y])=>{const x=`${e.property.id}.${g}`;u.value[x]||n.setFieldValue(x,y)})},{immediate:!0});const h=T(()=>{const b=o.value[0];return Array.isArray(b)?b[0]:i.value??""}),p=he(!1),m=he(null);Ae(u,()=>{m.value=null});async function f(){p.value=!0,m.value=null;try{const b=await $fetch("/workflows/v1/auth",{method:"POST",body:JSON.stringify(Ou(u.value,e.property.id,h.value,void 0))});m.value={success:!0,message:b.message||"Authentication successful"}}catch(b){const g=b,{message:y,link:x}=r5(g?.data?.message||g?.message);m.value={success:!1,message:y||"Authentication failed",link:x}}finally{p.value=!1}}return(b,g)=>v(l)?(w(),H("div",s5,[...g[0]||(g[0]=[U("span",{class:"text-sm text-gray-500"},"Loading credential configuration...",-1)])])):v(c)?(w(),H("div",l5,[U("span",c5,oe(v(c)),1)])):v(d)?(w(),H("div",{key:2,class:R([e.property.ui?.class,"flex flex-col gap-y-2"])},[U("div",d5,[z(v(t),{"config-map":v(d),"base-key":e.property.id},null,8,["config-map","base-key"])]),e.property.ui?.showTestAuthentication?(w(),H("div",u5,[U("div",h5,[z(v(Xt),{loading:v(p),label:v(p)?"Testing Authentication":"Test Authentication",onClick:f},null,8,["loading","label"])]),v(m)?.success?(w(),H("div",p5,[g[1]||(g[1]=U("span",{class:"text-sm font-semibold text-green-700"}," Authentication successful ",-1)),v(m).message?(w(),H("div",f5,[U("span",g5,oe(v(m).message),1)])):te("",!0)])):te("",!0),v(m)&&!v(m).success?(w(),H("div",m5,[g[2]||(g[2]=U("span",{class:"text-sm font-semibold text-new-red-700"}," Authentication failed ",-1)),U("div",v5,[U("span",b5,oe(v(m).message),1),v(m).link?(w(),H("a",{key:0,href:v(m).link,target:"_blank",class:"ml-1 text-sm text-blue-600 underline"}," Troubleshoot ",8,y5)):te("",!0)])])):te("",!0)])):te("",!0)],2)):te("",!0)}}),C5=Object.assign(w5,{__name:"Agent"}),_5=E({name:"AgentSelector",__name:"AgentSelector",props:{property:{},disabled:{type:Boolean},field:{},baseKey:{}},setup(e){const t=st(Dt),n=[{id:"atlas-agent-1",label:"Atlas Agent 1",agentType:"atlas"},{id:"miner-agent-2",label:"Miner Agent 2",agentType:"miner"},{id:"lineage-agent-3",label:"Lineage Agent 3",agentType:"lineage"},{id:"catalog-agent-4",label:"Catalog Agent 4",agentType:"catalog"}],o=n.map(({id:r,label:s})=>({value:r,label:s})),i=he(e.field.state.value?[e.field.state.value]:[]);function a(r){i.value=r,e.field.handleChange(r[0]);const s=n.find(l=>l.id===r[0]);if(s){const l=e.baseKey?`${e.baseKey}.agent-type`:"agent-type";t.setFieldValue(l,s.agentType)}}return(r,s)=>(w(),S(v(la),{id:e.property.id,"model-value":v(i),options:v(o),placeholder:e.property.placeholder,"is-disabled":e.disabled,variant:"default","onUpdate:modelValue":a,onBlur:e.field.handleBlur},null,8,["id","model-value","options","placeholder","is-disabled","onBlur"]))}}),$5=Object.assign(_5,{__name:"AgentSelector"});var Jm;const k5=typeof window<"u";k5&&((Jm=window?.navigator)!=null&&Jm.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function S5(e,t){function n(...o){return new Promise((i,a)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(a)})}return n}const nw=e=>e();function E5(e=nw){const t=he(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...a)=>{t.value&&e(...a)};return{isActive:Pv(t),pause:n,resume:o,eventFilter:i}}function O5(e){return e}var Qm=Object.getOwnPropertySymbols,T5=Object.prototype.hasOwnProperty,I5=Object.prototype.propertyIsEnumerable,P5=(e,t)=>{var n={};for(var o in e)T5.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Qm)for(var o of Qm(e))t.indexOf(o)<0&&I5.call(e,o)&&(n[o]=e[o]);return n};function V5(e,t,n={}){const o=n,{eventFilter:i=nw}=o,a=P5(o,["eventFilter"]);return Ae(e,S5(i,t),a)}var D5=Object.defineProperty,M5=Object.defineProperties,R5=Object.getOwnPropertyDescriptors,Ql=Object.getOwnPropertySymbols,ow=Object.prototype.hasOwnProperty,iw=Object.prototype.propertyIsEnumerable,ev=(e,t,n)=>t in e?D5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A5=(e,t)=>{for(var n in t||(t={}))ow.call(t,n)&&ev(e,n,t[n]);if(Ql)for(var n of Ql(t))iw.call(t,n)&&ev(e,n,t[n]);return e},F5=(e,t)=>M5(e,R5(t)),N5=(e,t)=>{var n={};for(var o in e)ow.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Ql)for(var o of Ql(e))t.indexOf(o)<0&&iw.call(e,o)&&(n[o]=e[o]);return n};function ec(e,t,n={}){const o=n,{eventFilter:i}=o,a=N5(o,["eventFilter"]),{eventFilter:r,pause:s,resume:l,isActive:c}=E5(i);return{stop:V5(e,t,F5(A5({},a),{eventFilter:r})),pause:s,resume:l,isActive:c}}function L5(e,t,n){return Ae(e,(o,i,a)=>{o&&t(o,i,a)},n)}const tv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},nv="__vueuse_ssr_handlers__";tv[nv]=tv[nv]||{};var ov;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(ov||(ov={}));function B5(){const e=he([]);return e.value.set=t=>{t&&e.value.push(t)},Ww(()=>{e.value.length=0}),e}var z5=Object.defineProperty,iv=Object.getOwnPropertySymbols,H5=Object.prototype.hasOwnProperty,j5=Object.prototype.propertyIsEnumerable,av=(e,t,n)=>t in e?z5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W5=(e,t)=>{for(var n in t||(t={}))H5.call(t,n)&&av(e,n,t[n]);if(iv)for(var n of iv(t))j5.call(t,n)&&av(e,n,t[n]);return e};const U5={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};W5({linear:O5},U5);var Id={},ja={},Wa={},rv;function op(){if(rv)return Wa;rv=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.HostType=void 0;var e;return function(t){t.domain="domain",t.socket="socket",t.IPv4="IPv4",t.IPv6="IPv6"}(e||(Wa.HostType=e={})),Wa}var Sn={},sv;function G5(){if(sv)return Sn;sv=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.fullHostName=t,Sn.encode=n,Sn.decode=o,Sn.hasText=i,Sn.validateUrl=a,Sn.parseHost=r;const e=op();function t(s,l){let c="";return s.name&&(c=s.type===e.HostType.IPv4||s.type===e.HostType.IPv6?s.name:n(s.name,l??{})),s.port&&(c+=`:${s.port}`),c}function n(s,l){return s=encodeURIComponent(s),l.plusForSpace&&(s=s.replace(/%20/g,"+")),l.encodeDollar?s:s.replace(/%24/g,"$")}function o(s){return decodeURIComponent(s.replace(/\+/g,"%20"))}function i(s){return typeof s=="string"&&/\S/.test(s)}function a(s){const l=s.search(/[^a-z0-9-._:\/?[\]@!$&'()*+,;=%~]/i);if(l>=0){const c=JSON.stringify(s[l]).replace(/^"|"$/g,"'");throw new Error(`Invalid URL character ${c} at position ${l}`)}}function r(s,l){if(l){if(typeof s!="string")throw new TypeError(`Invalid "host" parameter: ${JSON.stringify(s)}`);s=s.trim()}let c,d;if(s[0]==="["?(c=s.match(/((\[[0-9a-z:%_]{2,45}])(?::(-?[0-9a-z]+))?)/i),d=!0):l?c=s.match(/(([a-z0-9.$/\- _]*)(?::(-?[0-9a-z]+))?)/i):c=s.match(/(([a-z0-9.+$%\-_]*)(?::(-?[0-9a-z]+))?)/i),c){const u={};if(c[2]&&(d?(u.name=c[2],u.type=e.HostType.IPv6):c[2].match(/([0-9]{1,3}\.){3}[0-9]{1,3}/)?(u.name=c[2],u.type=e.HostType.IPv4):(u.name=l?c[2]:o(c[2]),u.type=u.name.match(/\/|.*\.sock$/i)?e.HostType.socket:e.HostType.domain)),c[3]){const h=c[3],p=parseInt(h);if(p>0&&p<65536&&p.toString()===h)u.port=p;else throw new Error(`Invalid port: ${JSON.stringify(h)}. Valid port range is: [1...65535]`)}if(u.name||u.port)return Object.defineProperty(u,"toString",{value:h=>t(u,h),enumerable:!1}),u}return null}return Sn}var lv;function q5(){if(lv)return ja;lv=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.ConnectionString=void 0;const e=op(),t=G5(),n='Invalid "defaults" parameter: ';class o{get host(){return this.hosts?.[0].toString()}get hostname(){return this.hosts?.[0].name}get port(){return this.hosts?.[0].port}get type(){return this.hosts?.[0].type}constructor(a,r){if(a=a??"",typeof a!="string")throw new TypeError(`Invalid connection string: ${JSON.stringify(a)}`);if(typeof(r??{})!="object")throw new TypeError(n+JSON.stringify(r));a=a.trim(),(0,t.validateUrl)(a);let s=a.match(/^(.*)?:\/\//);if(s){const c=s[1];if(c){const d=c.match(/^([a-z]+[a-z0-9+-.:]*)/i);if(c&&(!d||d[1]!==c))throw new Error(`Invalid protocol name: ${c}`);this.protocol=c}a=a.substring(s[0].length)}if(s=a.match(/^([\w-_.+!*'()$%]*):?([\w-_.+!*'()$%~]*)@/),s&&(s[1]&&(this.user=(0,t.decode)(s[1])),s[2]&&(this.password=(0,t.decode)(s[2])),a=a.substring(s[0].length)),a[0]!=="/"){const c=a.search(/[\/?]/);(c===-1?a:a.substring(0,c)).split(",").forEach(u=>{const h=(0,t.parseHost)(u);h&&(this.hosts||(this.hosts=[]),this.hosts.push(h))}),c>=0&&(a=a.substring(c))}s=a.match(/\/([\w-_.+!*'()$%]+)/g),s&&(this.path=s.map(c=>(0,t.decode)(c.substring(1))));const l=a.indexOf("?");if(l!==-1&&(a=a.substring(l+1),s=a.match(/([\w-_.+!*'()$%]+)=([\w-_.+!*'()$%,]+)/g),s)){const c={};s.forEach(d=>{const u=d.split("="),h=(0,t.decode)(u[0]),p=u[1].split(",").map(t.decode);h in c?Array.isArray(c[h])?c[h].push(...p):c[h]=[c[h],...p]:c[h]=p.length>1?p:p[0]}),this.params=c}r&&this.setDefaults(r)}static parseHost(a){return(0,t.parseHost)(a,!0)}toString(a){let r=this.protocol?`${this.protocol}://`:"";const s=a||{};if(this.user||this.password){if(this.user&&(r+=(0,t.encode)(this.user,s)),this.password){r+=":";const l=s.passwordHash;if(l){const c=typeof l=="string"&&l[0]||"#";r+=c.repeat(this.password.length)}else r+=(0,t.encode)(this.password,s)}r+="@"}if(Array.isArray(this.hosts)&&(r+=this.hosts.map(l=>(0,t.fullHostName)(l,a)).join()),Array.isArray(this.path)&&this.path.forEach(l=>{r+=`/${(0,t.encode)(l,s)}`}),this.params&&typeof this.params=="object"){const l=[];for(const c in this.params){let d=this.params[c];d=Array.isArray(d)?d:[d],d=d.map(u=>(0,t.encode)(typeof u=="string"?u:JSON.stringify(u),s)).join(),s.plusForSpace&&(d=d.replace(/%20/g,"+")),l.push(`${(0,t.encode)(c,s)}=${d}`)}l.length&&(r+=`?${l.join("&")}`)}return r}setDefaults(a){if(!a||typeof a!="object")throw new TypeError(n+JSON.stringify(a));if(!("protocol"in this)&&(0,t.hasText)(a.protocol)&&(this.protocol=a.protocol&&a.protocol.trim()),Array.isArray(a.hosts)){const r=Array.isArray(this.hosts)?this.hosts:[];a.hosts.filter(l=>l&&typeof l=="object").forEach(l=>{const d={name:(0,t.hasText)(l.name)?l.name.trim():void 0,port:l.port,type:l.type};let u=!1;for(let h=0;h<r.length;h++){const p=(0,t.fullHostName)(r[h]),m=(0,t.fullHostName)(d);if(p.toLowerCase()===m.toLowerCase()){u=!0;break}}if(!u){const h={};if(d.name)if(d.type&&d.type in e.HostType)h.name=d.name,h.type=d.type;else{const m=(0,t.parseHost)(d.name,!0);m&&(h.name=m.name,h.type=m.type)}const p=d.port;typeof p=="number"&&p>0&&p<65536&&(h.port=p),(h.name||h.port)&&(Object.defineProperty(h,"toString",{value:m=>(0,t.fullHostName)(h,m)}),r.push(h))}}),r.length&&(this.hosts=r)}if(!("user"in this)&&(0,t.hasText)(a.user)&&(this.user=a.user.trim()),!("password"in this)&&(0,t.hasText)(a.password)&&(this.password=a.password.trim()),!("path"in this)&&Array.isArray(a.path)){const r=a.path.filter(t.hasText);r.length&&(this.path=r)}if(a.params&&typeof a.params=="object"&&Object.keys(a.params).length)if(this.params&&typeof this.params=="object")for(const s in a.params)s in this.params||(this.params[s]=a.params[s]);else{this.params={};for(const s in a.params)this.params[s]=a.params[s]}return this}}return ja.ConnectionString=o,function(){["setDefaults","toString"].forEach(i=>{const a=Object.getOwnPropertyDescriptor(o.prototype,i);a.enumerable=!1,Object.defineProperty(o.prototype,i,a)})}(),ja}var cv;function Y5(){return cv||(cv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HostType=e.ConnectionString=void 0;var t=q5();Object.defineProperty(e,"ConnectionString",{enumerable:!0,get:function(){return t.ConnectionString}});var n=op();Object.defineProperty(e,"HostType",{enumerable:!0,get:function(){return n.HostType}})}(Id)),Id}var zs=Y5();const dv=0,uv=1,K5=E({__name:"AdvancedJDBCUrlGroup",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=e,o=st(Dt),i=o.useStore(u=>yo(u.values));function a(u){try{return new zs.ConnectionString(u),!0}catch{return!1}}const r=T(()=>i.value[n.property.ui.urlPropertyId]),s=T(()=>tp(i.value,Object.values(yo(n.property.ui.urlPartPropertyIdMapping)).filter(u=>u!==n.property.ui.urlPropertyId))),l=[],c=ec(r,async u=>{const h=n.property.ui.isDelimitedBySemicolons?u?.replace(";","?").replaceAll(";","&"):u;if(h&&a(h)){const p=new zs.ConnectionString(h);l[uv]?.pause(),Object.entries(n.property.ui.urlPartPropertyIdMapping).forEach(([m,f])=>{m==="searchParams"?Object.entries(f).forEach(([b,g])=>{p.params?.[b]&&Object.keys(i.value).includes(g)&&o.setFieldValue(g,p.params[b])}):m==="pathname"?Object.keys(i.value).includes(f)&&o.setFieldValue(f,p.path?.[0]):m==="username"?Object.keys(i.value).includes(f)&&o.setFieldValue(f,p.user):p[m]&&Object.keys(i.value).includes(f)&&o.setFieldValue(f,p[m])}),await po(),l[uv]?.resume()}});l.push(c);const d=ec([s,()=>n.property.ui],async([u,h],[p,m])=>{l[dv]?.pause();let f={protocol:Jx(h.protocol,":")};if(r.value){const y=h.isDelimitedBySemicolons?r.value.replace(";","?").replaceAll(";","&"):r.value;if(a(y)&&ep(m,h)){const x=new zs.ConnectionString(y);for(const C of["protocol","user","password","hosts","port","path","params"])f={...f,[C]:x[C]}}}const b={};Object.entries(h.urlPartPropertyIdMapping).forEach(([y,x])=>{y==="searchParams"?Object.entries(x).forEach(([C,k])=>{Object.keys(u).includes(k)?f={...f,params:{...f.params,[C]:u[k]}}:f={...f,params:{...f.params,[C]:k}}}):y==="hostname"?u[x]&&(b.name=u[x],f={...f,hosts:[b]}):y==="port"?u[x]&&(b.port=u[x],f={...f,hosts:[b]}):y==="username"?u[x]&&(f={...f,user:u[x]}):y==="pathname"?u[x]&&(f={...f,path:[u[x]]}):u[x]&&(f={...f,[y]:u[x]})});const g=new zs.ConnectionString(null,f);o.setFieldValue(h.urlPropertyId,h.isDelimitedBySemicolons?g.toString().replace("?",";").replaceAll("&",";"):g.toString()),await po(),l[dv]?.resume()});return l.push(d),(u,h)=>(w(),S(v(t),{class:"border border-gray-200 rounded-lg p-3 mb-4","config-map":n.property,"base-key":n.property.id.split(".")[0]},null,8,["config-map","base-key"]))}}),X5=Object.assign(K5,{__name:"AdvancedJDBCUrlGroup"}),hv=0,pv=1,Z5=E({__name:"JDBCUrlGroup",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=e,o=st(Dt),i=o.useStore(d=>yo(d.values)),a=T(()=>i.value[n.property.ui.urlPropertyId]),r=T(()=>tp(i.value,Object.values(yo(n.property.ui.urlPartPropertyIdMapping)).filter(d=>d!==n.property.ui.urlPropertyId))),s=[],l=ec(a,async d=>{const u=n.property.ui.isDelimitedBySemicolons?d?.replace(";","?").replaceAll(";","&"):d;if(u&&URL.canParse(u)){const h=new URL(u);s[pv]?.pause(),Object.entries(n.property.ui.urlPartPropertyIdMapping).forEach(([p,m])=>{if(p==="searchParams")Object.entries(m).forEach(([f,b])=>{h.searchParams.get(f)&&Object.keys(i.value).includes(b)&&o.setFieldValue(b,h.searchParams.get(f))});else{const f=h[p];f&&Object.keys(i.value).includes(m)&&o.setFieldValue(m,p==="pathname"?Jx(f,"/"):f)}}),await po(),s[pv]?.resume()}});s.push(l);const c=ec([r,()=>n.property.ui],async([d,u],[h,p])=>{s[hv]?.pause();let m=new URL(`${u.protocol}//`);if(a.value){const f=u.isDelimitedBySemicolons?a.value.replace(";","?").replaceAll(";","&"):a.value;URL.canParse(f)&&ep(p,u)&&(m=new URL(f))}Object.entries(u.urlPartPropertyIdMapping).forEach(([f,b])=>{f==="searchParams"?Object.entries(b).forEach(([g,y])=>{Object.keys(d).includes(y)?m.searchParams.set(g,d[y]):m.searchParams.set(g,y)}):d[b]&&(m[f]=d[b])}),o.setFieldValue(u.urlPropertyId,u.isDelimitedBySemicolons?m.toString().replace("?",";").replaceAll("&",";"):m.toString()),await po(),s[hv]?.resume()});return s.push(c),(d,u)=>(w(),S(v(t),{class:"border border-gray-200 rounded-lg p-3 mb-4","config-map":n.property,"base-key":n.property.id.split(".")[0]},null,8,["config-map","base-key"]))}}),J5=Object.assign(Z5,{__name:"JDBCUrlGroup"}),Q5=E({__name:"NestedCollapse",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=he([]);return(o,i)=>(w(),S(v($$),{modelValue:v(n),"onUpdate:modelValue":i[0]||(i[0]=a=>Uw(n)?n.value=a:null),collapsible:""},{default:_(()=>[(w(!0),H(we,null,Oe(e.property.panels,a=>(w(),S(v(h$),{key:a.id,value:a.id},{default:_(()=>[z(v(v$),null,{default:_(()=>[Te(oe(a.header)+" ",1),z(v(m$),null,{default:_(()=>[z(v(U6),{class:"w-4 h-4 transition-transform"})]),_:1})]),_:2},1024),z(v(p$),null,{default:_(()=>[z(v(t),{"config-map":a.configMap,"base-key":e.property.id},null,8,["config-map","base-key"])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]))}}),e4=Object.assign(Q5,{__name:"NestedCollapse"}),t4=E({__name:"ApiSelect",props:{field:{},property:{}},async setup(e){let t,n;const o=st(Dt),i=T(()=>!!e.property.ui?.isMultiple),{data:a}=([t,n]=Rr(()=>es(`${e.property.id}_metadata`,()=>{const h=o.getFieldValue("credential_guid_body"),{metadataTemplateKey:p,metadataTransformerTemplateKey:m}=e.property.ui??{};return $fetch("/workflows/v1/metadata",{method:"POST",body:{...h&&h,...p&&{type:p},...p&&{database:p},...m&&{metadataTransformerTemplateKey:m}}})})),t=await t,n(),t);function r(h,p=null){return h.map(m=>{const f=p?`${p}:${m.value}`:m.value;return{value:f,label:m.title,children:m.children?r(m.children,f):void 0}})}const s=T(()=>a.value?r(a.value.data):[]),c=he((h=>{const p=[],m=(f,b=[])=>{Array.isArray(f)?b.length>0&&p.push(b.join(":")):typeof f=="object"&&f!==null&&Object.keys(f).forEach(g=>{m(f[g],[...b,g])})};if(h)if(typeof h=="string")try{m(JSON.parse(h))}catch{p.push(h)}else m(h);return p})(e.field.state.value)),d=h=>{const p={};return h.forEach(m=>{const f=m.split(":");let b=p;f.forEach((g,y)=>{b[g]||(b[g]={}),y!==f.length-1&&(b=b[g])})}),p},u=h=>{const p=Array.isArray(h)?h:[h].filter(Boolean);e.field.handleChange(d(p)),c.value=p};return(h,p)=>(w(),S(v(la),{isTree:"",multiple:v(i),options:v(s),modelValue:v(c),"onUpdate:modelValue":u},null,8,["multiple","options","modelValue"]))}}),n4=Object.assign(t4,{__name:"ApiSelect"}),o4={class:"flex flex-col gap-y-1"},i4={class:"text-gray-600"},a4=["href"],r4=E({__name:"Checkbox",props:{field:{},property:{}},setup(e){const t=T(()=>e.property?.ui),n=o=>{e.field.handleChange(o),e.field.handleBlur()};return(o,i)=>(w(),H("div",o4,[z(v(ix),{checked:e.field.state.value,"data-test-id":e.property?.id,"onUpdate:checked":n},{default:_(()=>[U("span",i4,oe(v(t)?.title),1),v(t)?.link?(w(),H("a",{key:0,href:v(t).link.url,target:"_blank",class:"hover:underline"},oe(v(t).link.text),9,a4)):te("",!0)]),_:1},8,["checked","data-test-id"])]))}}),s4=Object.assign(r4,{__name:"Checkbox"});function Pd(e,t){return e-t*Math.floor(e/t)}const aw=1721426;function Hs(e,t,n,o){t=ip(e,t);let i=t-1,a=-2;return n<=2?a=0:Cl(t)&&(a=-1),aw-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+o)}function Cl(e){return e%4===0&&(e%100!==0||e%400===0)}function ip(e,t){return e==="BC"?1-t:t}function l4(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const c4={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 Qi{fromJulianDay(t){let n=t,o=n-aw,i=Math.floor(o/146097),a=Pd(o,146097),r=Math.floor(a/36524),s=Pd(a,36524),l=Math.floor(s/1461),c=Pd(s,1461),d=Math.floor(c/365),u=i*400+r*100+l*4+d+(r!==4&&d!==4?1:0),[h,p]=l4(u),m=n-Hs(h,p,1,1),f=2;n<Hs(h,p,3,1)?f=0:Cl(p)&&(f=1);let b=Math.floor(((m+f)*12+373)/367),g=n-Hs(h,p,b,1)+1;return new na(h,p,b,g)}toJulianDay(t){return Hs(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return c4[Cl(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Cl(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}function d4(e,t){var n,o,i,a;return(a=(i=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&i!==void 0?i:(o=t.isEqual)===null||o===void 0?void 0:o.call(t,e))!==null&&a!==void 0?a:e.identifier===t.identifier}function u4(e){return Nn(Date.now(),e)}function h4(e){return m4(u4(e))}function rw(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function p4(e,t){return fv(e)-fv(t)}function fv(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Vd=null;function ap(){return Vd==null&&(Vd=new Intl.DateTimeFormat().resolvedOptions().timeZone),Vd}function ea(e){e=mn(e,new Qi);let t=ip(e.era,e.year);return sw(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function sw(e,t,n,o,i,a,r){let s=new Date;return s.setUTCHours(o,i,a,r),s.setUTCFullYear(e,t-1,n),s.getTime()}function Iu(e,t){if(t==="UTC")return 0;if(e>0&&t===ap())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:o,day:i,hour:a,minute:r,second:s}=lw(e,t);return sw(n,o,i,a,r,s,0)-Math.floor(e/1e3)*1e3}const gv=new Map;function lw(e,t){let n=gv.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"}),gv.set(t,n));let o=n.formatToParts(new Date(e)),i={};for(let a of o)a.type!=="literal"&&(i[a.type]=a.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const mv=864e5;function f4(e,t,n,o){return(n===o?[n]:[n,o]).filter(a=>g4(e,t,a))}function g4(e,t,n){let o=lw(n,t);return e.year===o.year&&e.month===o.month&&e.day===o.day&&e.hour===o.hour&&e.minute===o.minute&&e.second===o.second}function Dn(e,t,n="compatible"){let o=ta(e);if(t==="UTC")return ea(o);if(t===ap()&&n==="compatible"){o=mn(o,new Qi);let l=new Date,c=ip(o.era,o.year);return l.setFullYear(c,o.month-1,o.day),l.setHours(o.hour,o.minute,o.second,o.millisecond),l.getTime()}let i=ea(o),a=Iu(i-mv,t),r=Iu(i+mv,t),s=f4(o,t,i-a,i-r);if(s.length===1)return s[0];if(s.length>1)switch(n){case"compatible":case"earlier":return s[0];case"later":return s[s.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-a,i-r);case"compatible":case"later":return Math.max(i-a,i-r);case"reject":throw new RangeError("No such absolute time found")}}function cw(e,t,n="compatible"){return new Date(Dn(e,t,n))}function Nn(e,t){let n=Iu(e,t),o=new Date(e+n),i=o.getUTCFullYear(),a=o.getUTCMonth()+1,r=o.getUTCDate(),s=o.getUTCHours(),l=o.getUTCMinutes(),c=o.getUTCSeconds(),d=o.getUTCMilliseconds();return new Ir(i<1?"BC":"AD",i<1?-i+1:i,a,r,t,n,s,l,c,d)}function m4(e){return new na(e.calendar,e.era,e.year,e.month,e.day)}function ta(e,t){let n=0,o=0,i=0,a=0;if("timeZone"in e)({hour:n,minute:o,second:i,millisecond:a}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:o,second:i,millisecond:a}=t),new nc(e.calendar,e.era,e.year,e.month,e.day,n,o,i,a)}function mn(e,t){if(d4(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),o=e.copy();return o.calendar=t,o.era=n.era,o.year=n.year,o.month=n.month,o.day=n.day,ai(o),o}function v4(e,t,n){if(e instanceof Ir)return e.timeZone===t?e:y4(e,t);let o=Dn(e,t,n);return Nn(o,t)}function b4(e){let t=ea(e)-e.offset;return new Date(t)}function y4(e,t){let n=ea(e)-e.offset;return mn(Nn(n,t),e.calendar)}const Ua=36e5;function Lc(e,t){let n=e.copy(),o="hour"in n?_4(n,t):0;Pu(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Vu(n),dw(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=o,x4(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,r;let l=(a=(r=n.calendar).isInverseEra)===null||a===void 0?void 0:a.call(r,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Pu(e,t){var n,o;!((n=(o=e.calendar).isInverseEra)===null||n===void 0)&&n.call(o,e)&&(t=-t),e.year+=t}function Vu(e){for(;e.month<1;)Pu(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Pu(e,1)}function x4(e){for(;e.day<1;)e.month--,Vu(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Vu(e)}function dw(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 ai(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),dw(e)}function uw(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function hw(e,t){return Lc(e,uw(t))}function rp(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),ai(n),n}function tc(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),C4(n),n}function w4(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=js(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=js(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=js(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=js(e.hour,24),t}function C4(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 js(e,t){let n=e%t;return n<0&&(n+=t),n}function _4(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,w4(e)}function sp(e,t,n,o){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),l=s.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=Ln(l,n,0,s.length-1,o?.round),i.era=s[l],ai(i);break}case"year":var a,r;!((a=(r=i.calendar).isInverseEra)===null||a===void 0)&&a.call(r,i)&&(n=-n),i.year=Ln(e.year,n,-1/0,9999,o?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=Ln(e.month,n,1,e.calendar.getMonthsInYear(e),o?.round);break;case"day":i.day=Ln(e.day,n,1,e.calendar.getDaysInMonth(e),o?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),ai(i),i}function pw(e,t,n,o){let i=e.copy();switch(t){case"hour":{let a=e.hour,r=0,s=23;if(o?.hourCycle===12){let l=a>=12;r=l?12:0,s=l?23:11}i.hour=Ln(a,n,r,s,o?.round);break}case"minute":i.minute=Ln(e.minute,n,0,59,o?.round);break;case"second":i.second=Ln(e.second,n,0,59,o?.round);break;case"millisecond":i.millisecond=Ln(e.millisecond,n,0,999,o?.round);break;default:throw new Error("Unsupported field "+t)}return i}function Ln(e,t,n,o,i=!1){if(i){e+=Math.sign(t),e<n&&(e=o);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>o&&(e=n)}else e+=t,e<n?e=o-(n-e-1):e>o&&(e=n+(e-o-1));return e}function fw(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 i=Lc(ta(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Dn(i,e.timeZone)}else n=ea(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let o=Nn(n,e.timeZone);return mn(o,e.calendar)}function $4(e,t){return fw(e,uw(t))}function k4(e,t,n,o){switch(t){case"hour":{let i=0,a=23;if(o?.hourCycle===12){let m=e.hour>=12;i=m?12:0,a=m?23:11}let r=ta(e),s=mn(tc(r,{hour:i}),new Qi),l=[Dn(s,e.timeZone,"earlier"),Dn(s,e.timeZone,"later")].filter(m=>Nn(m,e.timeZone).day===s.day)[0],c=mn(tc(r,{hour:a}),new Qi),d=[Dn(c,e.timeZone,"earlier"),Dn(c,e.timeZone,"later")].filter(m=>Nn(m,e.timeZone).day===c.day).pop(),u=ea(e)-e.offset,h=Math.floor(u/Ua),p=u%Ua;return u=Ln(h,n,Math.floor(l/Ua),Math.floor(d/Ua),o?.round)*Ua+p,mn(Nn(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return pw(e,t,n,o);case"era":case"year":case"month":case"day":{let i=sp(ta(e),t,n,o),a=Dn(i,e.timeZone);return mn(Nn(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function S4(e,t,n){let o=ta(e),i=tc(rp(o,t),t);if(i.compare(o)===0)return e;let a=Dn(i,e.timeZone,n);return mn(Nn(a,e.timeZone),e.calendar)}function E4(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 gw(e){let t=mn(e,new Qi),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 mw(e){return`${gw(e)}T${E4(e)}`}function O4(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),o=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return i!==0&&(a+=`:${String(i).padStart(2,"0")}`),a}function T4(e){return`${mw(e)}${O4(e.offset)}[${e.timeZone}]`}function I4(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lp(e,t,n){I4(e,t),t.set(e,n)}function cp(e){let t=typeof e[0]=="object"?e.shift():new Qi,n;if(typeof e[0]=="string")n=e.shift();else{let r=t.getEras();n=r[r.length-1]}let o=e.shift(),i=e.shift(),a=e.shift();return[t,n,o,i,a]}var P4=new WeakMap;class na{copy(){return this.era?new na(this.calendar,this.era,this.year,this.month,this.day):new na(this.calendar,this.year,this.month,this.day)}add(t){return Lc(this,t)}subtract(t){return hw(this,t)}set(t){return rp(this,t)}cycle(t,n,o){return sp(this,t,n,o)}toDate(t){return cw(this,t)}toString(){return gw(this)}compare(t){return rw(this,t)}constructor(...t){lp(this,P4,{writable:!0,value:void 0});let[n,o,i,a,r]=cp(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,ai(this)}}var V4=new WeakMap;class nc{copy(){return this.era?new nc(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new nc(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Lc(this,t)}subtract(t){return hw(this,t)}set(t){return rp(tc(this,t),t)}cycle(t,n,o){switch(t){case"era":case"year":case"month":case"day":return sp(this,t,n,o);default:return pw(this,t,n,o)}}toDate(t,n){return cw(this,t,n)}toString(){return mw(this)}compare(t){let n=rw(this,t);return n===0?p4(this,ta(t)):n}constructor(...t){lp(this,V4,{writable:!0,value:void 0});let[n,o,i,a,r]=cp(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ai(this)}}var D4=new WeakMap;class Ir{copy(){return this.era?new Ir(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Ir(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return fw(this,t)}subtract(t){return $4(this,t)}set(t,n){return S4(this,t,n)}cycle(t,n,o){return k4(this,t,n,o)}toDate(){return b4(this)}toString(){return T4(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-v4(t,this.timeZone).toDate().getTime()}constructor(...t){lp(this,D4,{writable:!0,value:void 0});let[n,o,i,a,r]=cp(t),s=t.shift(),l=t.shift();this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.timeZone=s,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ai(this)}}const M4=E({__name:"Date",props:{field:{},property:{}},setup(e){const t=ap(),n=T(()=>e.property?.ui),o=T(()=>h4(t)),i=T(()=>o.value.add({days:n.value?.min??0})),a=T(()=>o.value.add({days:n.value?.max??0})),r=T(()=>o.value.add({days:n.value?.default??0})),s=h=>{const p=h;return p.compare(i.value)<0||p.compare(a.value)>0},l=h=>{const p=parseInt(h,10);if(!p)return null;const m=new Date(p*1e3);return new na(m.getUTCFullYear(),m.getUTCMonth()+1,m.getUTCDate())},c=h=>Math.floor(h.toDate("UTC").getTime()/1e3).toString(),d=T(()=>{const h=e.field.state.value;if(!h||parseInt(h,10)===0)return[];const p=l(h);return p?[p]:[]}),u=h=>{const[p]=h.value;p&&(e.field.handleChange(c(p)),e.field.handleBlur())};return Dr(()=>{const h=e.field.state.value;(!h||parseInt(h,10)===0)&&(e.field.handleChange(c(r.value)),e.field.handleBlur())}),(h,p)=>(w(),S(v(fA),{"model-value":v(d),"is-date-unavailable":s,"data-test-id":e.property?.id,onValueChange:u},null,8,["model-value","data-test-id"]))}}),R4=Object.assign(M4,{__name:"Date"}),A4=E({__name:"InputNumber",props:{field:{},property:{}},setup(e){const t=e.field.state.value,n=he((()=>{if(t==null||t==="")return"";const i=typeof t=="string"?parseFloat(t):t;return isNaN(i)?"":String(i)})()),o=i=>{n.value=i;const a=parseFloat(i);e.field.handleChange(isNaN(a)?void 0:a),e.field.handleBlur()};return(i,a)=>(w(),S(v(LA),{"model-value":v(n),min:e.property?.ui?.min,max:e.property?.ui?.max,step:e.property?.ui?.step,disabled:e.property?.ui?.disabled,"data-test-id":e.property?.id,class:"w-full","onUpdate:modelValue":o},null,8,["model-value","min","max","step","disabled","data-test-id"]))}}),F4=Object.assign(A4,{__name:"InputNumber"}),N4={key:0,class:"text-red-500"},L4={class:"max-h-[300px] overflow-y-auto overflow-x-hidden pr-1"},B4=["data-test-id"],z4={class:"flex-grow max-w-[calc(100%-30px)]"},H4={key:0,class:"absolute right-0 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer p-1"},j4={class:"flex justify-center"},W4=E({__name:"InputRepeater",props:{property:{}},setup(e){const t=st(Dt),n=B5(),o=d=>{const u=new Set;return d.filter(h=>h.trim()===""?!0:u.has(h.trim())?!1:(u.add(h.trim()),!0))},i=d=>{const u=e.property.ui.maxItems;u!==void 0&&d.state.value.length>=u||(d.pushValue(""),po(()=>{const h=n.value[d.state.value.length-1];h&&h.focus()}))},a=(d,u)=>{const h=e.property.ui.minItems??1;d.state.value.length>h&&d.removeValue(u)},r=(d,u)=>{u===d.state.value.length-1&&i(d)},s=(d,u,h)=>{h.preventDefault();const m=(h.clipboardData?.getData("text")??"").split(/\r?\n|\r|,/).map(g=>g.trim()).filter(g=>g.length>0);if(m.length===0)return;const f=[...d.state.value];f.splice(u,1,...m);const b=o(f);t.setFieldValue(e.property.id,b)},l=(d,u,h)=>{const p=[...d.state.value];p[u]=h,t.setFieldValue(e.property.id,p)},c=d=>e.property.ui.maxItems!==void 0&&d.state.value.length>=e.property.ui.maxItems;return(d,u)=>(w(),S(v(t).Field,{name:e.property.id,mode:"array"},{default:_(({field:h})=>[U("div",null,[U("div",null,[z(v(Hh),null,{default:_(()=>[Te(oe(e.property.ui?.label)+" ",1),e.property?.required?(w(),H("span",N4," * ")):te("",!0)]),_:1})]),U("div",L4,[(w(!0),H(we,null,Oe(h.state.value,(p,m)=>(w(),H("div",{key:m,"data-test-id":e.property.id,class:"relative flex items-center justify-between group mb-4"},[U("div",z4,[z(v(zh),{ref_for:!0,ref:v(n).set,"model-value":h.state.value[m],placeholder:e.property.ui?.placeholder,"onUpdate:modelValue":f=>l(h,m,f),onFocus:()=>r(h,m),onPaste:f=>s(h,m,f),onKeydown:Ad(mr(()=>i(h),["prevent"]),["enter"])},null,8,["model-value","placeholder","onUpdate:modelValue","onFocus","onPaste","onKeydown"])]),h.state.value.length>(e.property.ui.minItems??1)?(w(),H("div",H4,[z(v(q6),{class:"w-4 h-4 text-gray-400 hover:text-red-500",onClick:()=>a(h,m)},null,8,["onClick"])])):te("",!0)],8,B4))),128))]),U("div",j4,[z(v(Xt),{type:"default",label:`Add to ${e.property.ui.label}`,disabled:c(h),onClick:()=>i(h)},null,8,["label","disabled","onClick"])])])]),_:1},8,["name"]))}}),U4=Object.assign(W4,{__name:"InputRepeater"}),G4=E({__name:"Evaluate",props:{property:{}},setup(e){const t=st(Dt),n=T(()=>e.property.ui?.value);return L5(n,()=>{t?.setFieldValue(e.property.id,n.value)},{immediate:!0}),(o,i)=>(w(),S(gt(null)))}}),q4=Object.assign(G4,{__name:"Evaluate"});function Wo(){return Wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Wo.apply(this,arguments)}function Y4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Pr(e,t)}function Du(e){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Du(e)}function Pr(e,t){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,i){return o.__proto__=i,o},Pr(e,t)}function K4(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _l(e,t,n){return K4()?_l=Reflect.construct.bind():_l=function(i,a,r){var s=[null];s.push.apply(s,a);var l=Function.bind.apply(i,s),c=new l;return r&&Pr(c,r.prototype),c},_l.apply(null,arguments)}function X4(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Mu(e){var t=typeof Map=="function"?new Map:void 0;return Mu=function(o){if(o===null||!X4(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(o))return t.get(o);t.set(o,i)}function i(){return _l(o,arguments,Du(this).constructor)}return i.prototype=Object.create(o.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Pr(i,o)},Mu(e)}var Z4=/%[sdj%]/g,J4=function(){};function Ru(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var o=n.field;t[o]=t[o]||[],t[o].push(n)}),t}function kt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=0,a=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var r=e.replace(Z4,function(s){if(s==="%%")return"%";if(i>=a)return s;switch(s){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return s}});return r}return e}function Q4(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function je(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Q4(t)&&typeof e=="string"&&!e)}function e8(e,t,n){var o=[],i=0,a=e.length;function r(s){o.push.apply(o,s||[]),i++,i===a&&n(o)}e.forEach(function(s){t(s,r)})}function vv(e,t,n){var o=0,i=e.length;function a(r){if(r&&r.length){n(r);return}var s=o;o=o+1,s<i?t(e[s],a):n([])}a([])}function t8(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n]||[])}),t}var bv=function(e){Y4(t,e);function t(n,o){var i;return i=e.call(this,"Async Validation Error")||this,i.errors=n,i.fields=o,i}return t}(Mu(Error));function n8(e,t,n,o,i){if(t.first){var a=new Promise(function(h,p){var m=function(g){return o(g),g.length?p(new bv(g,Ru(g))):h(i)},f=t8(e);vv(f,n,m)});return a.catch(function(h){return h}),a}var r=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),l=s.length,c=0,d=[],u=new Promise(function(h,p){var m=function(b){if(d.push.apply(d,b),c++,c===l)return o(d),d.length?p(new bv(d,Ru(d))):h(i)};s.length||(o(d),h(i)),s.forEach(function(f){var b=e[f];r.indexOf(f)!==-1?vv(b,n,m):e8(b,n,m)})});return u.catch(function(h){return h}),u}function o8(e){return!!(e&&e.message!==void 0)}function i8(e,t){for(var n=e,o=0;o<t.length;o++){if(n==null)return n;n=n[t[o]]}return n}function yv(e,t){return function(n){var o;return e.fullFields?o=i8(t,e.fullFields):o=t[n.field||e.fullField],o8(n)?(n.field=n.field||e.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||e.fullField}}}function xv(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];typeof o=="object"&&typeof e[n]=="object"?e[n]=Wo({},e[n],o):e[n]=o}}return e}var vw=function(t,n,o,i,a,r){t.required&&(!o.hasOwnProperty(t.field)||je(n,r||t.type))&&i.push(kt(a.messages.required,t.fullField))},a8=function(t,n,o,i,a){(/^\s+$/.test(n)||n==="")&&i.push(kt(a.messages.whitespace,t.fullField))},Ws,r8=function(){if(Ws)return Ws;var e="[a-fA-F\\d:]",t=function(C){return C&&C.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",i=(`
|
|
22
|
+
`,this.app=Fd(Gm,{data:t,placement:r.placement,targetPosition:n}),this.app.mount(this.container),document.body.appendChild(this.container)}hide(){this.app&&(this.app.unmount(),this.app=null),this.container&&this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null)}updatePosition(t){if(this.container&&this.app){const n={width:this.container.offsetWidth,height:this.container.offsetHeight},o=this.calculateOptimalPosition(t,n);this.container.style.left=`${o.left}px`,this.container.style.top=`${o.top}px`;const i=this.app._instance;i!=null&&i.props&&(i.props.placement=o.placement,i.props.targetPosition=t)}}}new DB;let qm=!1;qm||(io.register(Su,Eu,gl,pl,Z3,Tr),qm=!0);se({slots:["ganttChart"],base:{ganttChart:{backgroundColor:"background.default",borderRadius:"lg",border:"1px solid",borderColor:"border.muted",height:"fit-content"}}});se({slots:["timeItem","checkIcon","footer","mentuItemContainer"],base:{timeItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},checkIcon:{width:"12",height:"12",color:"text.normal"},footer:{display:"flex",alignItems:"center",paddingY:"6",paddingX:"8",borderRadius:"md",_focus:{outline:"none"}},mentuItemContainer:{display:"flex",flexDirection:"column",paddingX:"8",paddingTop:"8",maxHeight:"176",overflowY:"auto",gap:"0",scrollBehavior:"smooth","&:focus-within":{scrollBehavior:"smooth"}}}});const MB={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function RB(e,t){return w(),H("svg",MB,[...t[0]||(t[0]=[U("g",{"clip-path":"url(#clip0_12427_264)"},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM11.5303 6.53033L12.0607 6L11 4.93934L10.4697 5.46967L6.5 9.43934L5.53033 8.46967L5 7.93934L3.93934 9L4.46967 9.53033L5.96967 11.0303C6.26256 11.3232 6.73744 11.3232 7.03033 11.0303L11.5303 6.53033Z",fill:"currentColor"})],-1),U("defs",null,[U("clipPath",{id:"clip0_12427_264"},[U("rect",{width:"16",height:"16",fill:"white"})])],-1)])])}const AB={render:RB},FB={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function NB(e,t){return w(),H("svg",FB,[...t[0]||(t[0]=[U("g",{"clip-path":"url(#clip0_12427_230)"},[U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.3934 0.292893C4.58094 0.105357 4.83529 0 5.10051 0H10.8995C11.1647 0 11.4191 0.105357 11.6066 0.292893L15.7071 4.3934C15.8946 4.58093 16 4.83529 16 5.10051V10.8995C16 11.1647 15.8946 11.4191 15.7071 11.6066L11.6066 15.7071C11.4191 15.8946 11.1647 16 10.8995 16H5.10051C4.83529 16 4.58094 15.8946 4.3934 15.7071L0.292894 11.6066C0.105357 11.4191 0 11.1647 0 10.8995V5.10051C0 4.83529 0.105357 4.58094 0.292893 4.3934L4.3934 0.292893ZM8.75 3.75V4.5V8V8.75H7.25V8V4.5V3.75H8.75ZM8 12C8.55229 12 9 11.5523 9 11C9 10.4477 8.55229 10 8 10C7.44772 10 7 10.4477 7 11C7 11.5523 7.44772 12 8 12Z",fill:"currentColor"})],-1),U("defs",null,[U("clipPath",{id:"clip0_12427_230"},[U("rect",{width:"16",height:"16",fill:"white"})])],-1)])])}const LB={render:NB},BB=se({className:"toast",slots:[...U0.keys(),"icon"],base:{root:{paddingTop:"6",paddingBottom:"6",paddingLeft:"12",paddingRight:"12",borderRadius:"md",boxShadow:"elevations-overlay",gap:"6",fontSize:"base",fontWeight:"regular",fontFamily:"sans",lineHeight:"lg",letterSpacing:"normal",backgroundColor:"blackalpha.900",color:"whitealpha.1000",display:"flex",alignItems:"center",whiteSpace:"nowrap"}},variants:{variant:{default:{},success:{icon:{color:"green.800"}},failed:{icon:{color:"red.800"}}}},defaultVariants:{variant:"default"}}),Od=(e,t,n)=>{const o=BB({variant:t}),i=JM({...n||{},placement:n?.placement||"bottom-end",overlap:n?.overlap||!0,gap:n?.gap||24,duration:n?.duration||3e3});i.create({title:e});const a=s=>({success:at(AB,{class:o.icon}),failed:at(LB,{class:o.icon}),default:at("",null)})[s],r=document.createElement("div");document.body.appendChild(r),Fd({render:()=>at(oR,{toaster:i},{default:()=>at(eR,{class:o.root,"data-testid":`toast-${t}`},[a(t),at(tR,null,e)])})}).mount(r)},Hi={success:(e,t)=>Od(e,"success",t),failed:(e,t)=>Od(e,"failed",t),default:(e,t)=>Od(e,"default",t)};ri({base:{},variants:{textStyle:{body_xsmall_caps_medium:{textStyle:"body_xsmall_caps_medium"},body_xsmall_caps_bold:{textStyle:"body_xsmall_caps_bold"},body_xsmall_regular:{textStyle:"body_xsmall_regular"},body_xsmall_medium:{textStyle:"body_xsmall_medium"},body_small_regular:{textStyle:"body_small_regular"},body_small_medium:{textStyle:"body_small_medium"},body_small_semibold:{textStyle:"body_small_semibold"},body_base_regular:{textStyle:"body_base_regular"},body_base_medium:{textStyle:"body_base_medium"},body_base_semibold:{textStyle:"body_base_semibold"},heading_text_h1:{textStyle:"heading_text_h1"},heading_text_h2:{textStyle:"heading_text_h2"},heading_text_h3:{textStyle:"heading_text_h3"},heading_text_h4:{textStyle:"heading_text_h4"},heading_text_h5:{textStyle:"heading_text_h5"},code_regular:{textStyle:"code_regular"},code_small:{textStyle:"code_small"},number_regular:{textStyle:"number_regular"},number_small:{textStyle:"number_small"}}},defaultVariants:{textStyle:"body_base_regular"}});const zB=E({name:"InputWidget",__name:"Input",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=T(()=>e.property.ui);return(n,o)=>(w(),S(v(zh),F({"model-value":e.field.state.value},v(t),{disabled:e.property.BYOCdisabled||e.disabled,variant:"default",state:"idle","onUpdate:modelValue":e.field.handleChange,onBlur:e.field.handleBlur}),null,16,["model-value","disabled","onUpdate:modelValue","onBlur"]))}}),Td=Object.assign(zB,{__name:"Input"}),HB=E({name:"BooleanWidget",__name:"Boolean",props:{property:{},field:{}},setup(e){const t=n=>{e.field.handleChange(n==="true")};return(n,o)=>(w(),H("div",null,[z(v(rx),{modelValue:e.field.state.value,options:[{value:"true",label:"Yes"},{value:"false",label:"No"}],"onUpdate:modelValue":t},null,8,["modelValue"])]))}}),jB=Object.assign(HB,{__name:"Boolean"}),WB=E({name:"RadioWidget",__name:"Radio",props:{property:{},field:{}},setup(e){const t=T(()=>e.property.enum&&e.property.enumNames?e.property.enum.map((n,o)=>({value:n,label:e.property.enumNames?.[o]||n})):[]);return(n,o)=>(w(),H("div",null,[z(v(rx),{"model-value":e.field.state.value,options:v(t),"onUpdate:modelValue":e.field.handleChange},null,8,["model-value","options","onUpdate:modelValue"])]))}}),UB=Object.assign(WB,{__name:"Radio"}),Dt=Symbol("form"),Yx=Symbol("getPayloadFn"),Ou=(e,t,n,o)=>{const i={},a=e[`${t}.auth-type`],r=e[`${t}.connector`],s=e[`${t}.connectorType`],l=e[`${t}.credentialType`];Object.keys(e).forEach(p=>{p.includes(`${t}.extra.`)&&(i[p.replace(`${t}.extra.`,"")]=e[p])}),Object.keys(e).forEach(p=>{p.includes(`${t}.${a}.extra.`)&&(i[p.replace(`${t}.${a}.extra.`,"")]=e[p])});const c=e[`${t}.host`]?.endsWith("/")?e[`${t}.host`].substr(0,e[`${t}.host`].length-1):e[`${t}.host`],d=e[`${t}.host`]?.startsWith("http")?e[`${t}.host`].startsWith("https")?443:80:e[`${t}.port`],u=typeof c=="string"&&c.length>0,h=typeof l=="string"&&l.length>0;return{name:o,...h&&{credentialType:l},...u&&{host:c},...u&&d&&{port:e[`${t}.port`]?parseInt(e[`${t}.port`]):d},authType:a,connectorType:s,...r?{connector:r}:{},connectBy:e[`${t}.connectBy`],username:e[`${t}.${a}.username`],password:e[`${t}.${a}.password`],extra:i,connectorConfigName:n}},Kx=Array.isArray,Xx=e=>!!e&&e.constructor===Object,ep=(e,t)=>{if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(n.length!==o.length)return!1;for(let i=0;i<n.length;i++)if(!Reflect.has(t,n[i])||!ep(e[n[i]],t[n[i]]))return!1;return!0},GB=(e,t,n=o=>o)=>e.reduce((o,i)=>(o[t(i)]=n(i),o),{}),qB=(e,t)=>{const n=e.reduce((o,i)=>{const a=i;return o[a]||(o[a]=i),o},{});return Object.values(n)},YB=(e,t)=>Object.keys(e).reduce((o,i)=>(o[i]=t(e[i],i),o),{}),tp=(e,t)=>e?t.reduce((n,o)=>(Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]),n),{}):{},Zx=(e,t)=>e?!t||t.length===0?e:t.reduce((n,o)=>(delete n[o],n),{...e}):{},KB=(e,t,n)=>{const o=t.split(/[\.\[\]]/g);let i=e;for(const a of o){if(i===null||i===void 0)return n;const r=a.replace(/['"]/g,"");r.trim()!==""&&(i=i[r])}return i===void 0?n:i},XB=e=>{if(!e)return[];const t=(n,o)=>Xx(n)?Object.entries(n).flatMap(([i,a])=>t(a,[...o,i])):Kx(n)?n.flatMap((i,a)=>t(i,[...o,`${a}`])):[o.join(".")];return t(e,[])},yo=e=>e?GB(XB(e),t=>t,t=>KB(e,t)):{},Jx=(e,t=" ")=>{if(!e)return"";const n=t.replace(/[\W]{1}/g,"\\$&"),o=new RegExp(`^[${n}]+|[${n}]+$`,"g");return e.replace(o,"")},ZB={trailing:!0};function JB(e,t=25,n={}){if(n={...ZB,...n},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let o,i,a=[],r,s;const l=(u,h)=>(r=QB(e,u,h),r.finally(()=>{if(r=null,n.trailing&&s&&!i){const p=l(u,s);return s=null,p}}),r),c=function(...u){return n.trailing&&(s=u),r||new Promise(h=>{const p=!i&&n.leading;clearTimeout(i),i=setTimeout(()=>{i=null;const m=n.leading?o:l(this,u);s=null;for(const f of a)f(m);a=[]},t),p?(o=l(this,u),h(o)):a.push(h)})},d=u=>{u&&(clearTimeout(u),i=null)};return c.isPending=()=>!!i,c.cancel=()=>{d(i),a=[],s=null},c.flush=()=>{if(d(i),!s||r)return;const u=s;return s=null,l(this,u)},c}async function QB(e,t,n){return await e.apply(t,n)}function es(...e){const t=typeof e[e.length-1]=="string"?e.pop():void 0;e6(e[0],e[1])&&e.unshift(t);let[n,o,i={}]=e,a=!1;const r=T(()=>Re(n));if(typeof r.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a string.");if(typeof o!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const s=Aw();i.server??=!0,i.default??=n6,i.getCachedData??=ew,i.lazy??=!1,i.immediate??=!0,i.deep??=Fw.deep,i.dedupe??="cancel",i._functionName,s._asyncData[r.value];function l(){const m={cause:"initial",dedupe:i.dedupe};return s._asyncData[r.value]?._init||(m.cachedData=i.getCachedData(r.value,s,{cause:"initial"}),s._asyncData[r.value]=Ym(s,r.value,o,i,m.cachedData)),()=>s._asyncData[r.value].execute(m)}const c=l(),d=s._asyncData[r.value];d._deps++;const u=i.server!==!1&&s.payload.serverRendered;{let m=function(C){const k=s._asyncData[C];k?._deps&&(k._deps--,k._deps===0&&k?._off())};const f=Vr();if(f&&u&&i.immediate&&!f.sp&&(f.sp=[]),f&&!f._nuxtOnBeforeMountCbs){f._nuxtOnBeforeMountCbs=[];const C=f._nuxtOnBeforeMountCbs;Nw(()=>{C.forEach(k=>{k()}),C.splice(0,C.length)}),Wu(()=>C.splice(0,C.length))}const b=f&&(f._nuxtClientOnly||st(Lw,!1));u&&s.isHydrating&&(d.error.value||d.data.value!==void 0)?d.status.value=d.error.value?"error":"success":f&&(!b&&s.payload.serverRendered&&s.isHydrating||i.lazy)&&i.immediate?f._nuxtOnBeforeMountCbs.push(c):i.immediate&&d.status.value!=="success"&&c();const g=zw(),y=Ae(r,(C,k)=>{if((C||k)&&C!==k){a=!0;const O=s._asyncData[k]?.data.value!==void 0,P=s._asyncDataPromises[k]!==void 0,$={cause:"initial",dedupe:i.dedupe};if(!s._asyncData[C]?._init){let I;k&&O?I=s._asyncData[k].data.value:(I=i.getCachedData(C,s,{cause:"initial"}),$.cachedData=I),s._asyncData[C]=Ym(s,C,o,i,I)}s._asyncData[C]._deps++,k&&m(k),(i.immediate||O||P)&&s._asyncData[C].execute($),jw(()=>{a=!1})}},{flush:"sync"}),x=i.watch?Ae(i.watch,()=>{a||d._execute({cause:"watch",dedupe:i.dedupe})}):()=>{};g&&Bw(()=>{y(),x(),m(r.value)})}const h={data:Bs(()=>s._asyncData[r.value]?.data),pending:Bs(()=>s._asyncData[r.value]?.pending),status:Bs(()=>s._asyncData[r.value]?.status),error:Bs(()=>s._asyncData[r.value]?.error),refresh:(...m)=>s._asyncData[r.value]?._init?s._asyncData[r.value].execute(...m):l()(),execute:(...m)=>h.refresh(...m),clear:()=>{const m=s._asyncData[r.value];if(m?._abortController)try{m._abortController.abort(new DOMException("AsyncData aborted by user.","AbortError"))}finally{m._abortController=void 0}Qx(s,r.value)}},p=Promise.resolve(s._asyncDataPromises[r.value]).then(()=>h);return Object.assign(p,h),p}function Bs(e){return T({get(){return e()?.value},set(t){const n=e();n&&(n.value=t)}})}function e6(e,t){return!(typeof e=="string"||typeof e=="object"&&e!==null||typeof e=="function"&&typeof t=="function")}function Qx(e,t){t in e.payload.data&&(e.payload.data[t]=void 0),t in e.payload._errors&&(e.payload._errors[t]=void 0),e._asyncData[t]&&(e._asyncData[t].data.value=v(e._asyncData[t]._default()),e._asyncData[t].error.value=void 0,e._asyncData[t].status.value="idle"),t in e._asyncDataPromises&&(e._asyncDataPromises[t]=void 0)}function t6(e,t){const n={};for(const o of t)n[o]=e[o];return n}function Ym(e,t,n,o,i){e.payload._errors[t]??=void 0;const a=o.getCachedData!==ew,r=n,s=o.deep?he:El,l=i!==void 0,c=e.hook("app:data:refresh",async u=>{(!u||u.includes(t))&&await d.execute({cause:"refresh:hook"})}),d={data:s(l?i:o.default()),pending:T(()=>d.status.value==="pending"),error:Tv(e.payload._errors,t),status:El("idle"),execute:(...u)=>{const[h,p=void 0]=u,m=h&&p===void 0&&typeof h=="object"?h:{};if(e._asyncDataPromises[t]&&(m.dedupe??o.dedupe)==="defer")return e._asyncDataPromises[t];{const b="cachedData"in m?m.cachedData:o.getCachedData(t,e,{cause:m.cause??"refresh:manual"});if(b!==void 0)return e.payload.data[t]=d.data.value=b,d.error.value=void 0,d.status.value="success",Promise.resolve(b)}d._abortController&&d._abortController.abort(new DOMException("AsyncData request cancelled by deduplication","AbortError")),d._abortController=new AbortController,d.status.value="pending";const f=new Promise((b,g)=>{try{const y=m.timeout??o.timeout,x=o6([d._abortController?.signal,m?.signal],y);if(x.aborted){const C=x.reason;g(C instanceof Error?C:new DOMException(String(C??"Aborted"),"AbortError"));return}return x.addEventListener("abort",()=>{const C=x.reason;g(C instanceof Error?C:new DOMException(String(C??"Aborted"),"AbortError"))},{once:!0}),Promise.resolve(r(e,{signal:x})).then(b,g)}catch(y){g(y)}}).then(async b=>{let g=b;o.transform&&(g=await o.transform(b)),o.pick&&(g=t6(g,o.pick)),e.payload.data[t]=g,d.data.value=g,d.error.value=void 0,d.status.value="success"}).catch(b=>{if(!(e._asyncDataPromises[t]&&e._asyncDataPromises[t]!==f)&&!d._abortController?.signal.aborted){if(typeof DOMException<"u"&&b instanceof DOMException&&b.name==="AbortError"){d.status.value="idle";return}d.error.value=Hw(b),d.data.value=v(o.default()),d.status.value="error"}}).finally(()=>{delete e._asyncDataPromises[t]});return e._asyncDataPromises[t]=f,e._asyncDataPromises[t]},_execute:JB((...u)=>d.execute(...u),0,{leading:!0}),_default:o.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{c(),e._asyncData[t]?._init&&(e._asyncData[t]._init=!1),a||po(()=>{e._asyncData[t]?._init||(Qx(e,t),d.execute=()=>Promise.resolve())})}};return d}const n6=()=>{},ew=(e,t,n)=>{if(t.isHydrating)return t.payload.data[e];if(n.cause!=="refresh:manual"&&n.cause!=="refresh:hook")return t.static.data[e]};function o6(e,t){const n=e.filter(a=>!!a);if(typeof t=="number"&&t>=0){const a=AbortSignal.timeout?.(t);a&&n.push(a)}if(AbortSignal.any)return AbortSignal.any(n);const o=new AbortController;for(const a of n)if(a.aborted){const r=a.reason??new DOMException("Aborted","AbortError");try{o.abort(r)}catch{o.abort()}return o.signal}const i=()=>{const r=n.find(s=>s.aborted)?.reason??new DOMException("Aborted","AbortError");try{o.abort(r)}catch{o.abort()}};for(const a of n)a.addEventListener?.("abort",i,{once:!0});return o.signal}async function tw(e){const{data:t}=await es(()=>`credential_${Re(e)}`,()=>$fetch(`/workflows/v1/configmap/${Re(e)}`),"$vlaIZ4700T");return{credentialConfig:T(()=>{const o=t.value?.data;return o&&"kind"in o?JSON.parse(o.data.config):o?.config??null}),data:t}}function Nc(e){const t={};return Object.entries(e.properties).forEach(([n,o])=>{o.default?o?.ui?.widget==="Repeater"&&o.default?t[n]=JSON.parse(o.default):t[n]=o.default:o.properties&&(t[n]=Nc(o))}),t}const i6={key:0,class:"flex mt-3"},a6={key:1,class:"p-3 mt-4 border rounded-md border-green-400 bg-green-100"},r6={key:0,class:"mt-1"},s6={class:"text-sm text-green-600"},l6={key:2,class:"p-3 mt-4 border rounded-md border-new-red-400 bg-new-red-100"},c6={class:"mt-1"},d6={class:"text-sm text-new-red-600","data-test-id":"error-log-message"},u6=E({__name:"CredentialWidget",props:{property:{},modelValue:{}},async setup(e){let t,n;const o=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),i=st(Dt),{credentialConfig:a}=([t,n]=Rr(()=>tw(()=>e.property.ui.credentialType)),t=await t,n(),t),r=i.useStore(d=>Zx(d.values,["credential_guid_body","credential_property_id"]));Ae(()=>e.property,d=>{d&&i.setFieldValue("credential_property_id",d.id)},{immediate:!0}),Ae(r,d=>{d&&i.setFieldValue("credential_guid_body",Ou(yo(d),e.property.id,e.property.ui?.credentialType,void 0))},{immediate:!0}),Ae(a,d=>{d&&Object.entries(Nc(d)).forEach(([u,h])=>{i.state.values[`${e.property.id}.${u}`]||i.setFieldValue(`${e.property.id}.${u}`,h)})},{immediate:!0});const s=he(!1),l=he(null);async function c(){s.value=!0,l.value=null;try{const d=await $fetch("/workflows/v1/auth",{method:"POST",body:JSON.stringify(Ou(yo(i.state.values),e.property.id,e.property.ui?.credentialType,void 0))});l.value=d}catch(d){l.value={success:!1,message:d?.data?.message||d?.message||"Authentication failed"}}finally{s.value=!1}}return(d,u)=>(w(),H("div",{class:R(e.property.ui.class)},[v(a)?(w(),H(we,{key:0},[z(v(o),{"config-map":v(a),"base-key":e.property.id},null,8,["config-map","base-key"]),e.property.ui?.isTestAuthenticationDisabled?te("",!0):(w(),H("div",i6,[z(v(Xt),{loading:v(s),label:v(s)?"Testing Authentication":"Test Authentication",onClick:c},null,8,["loading","label"])]))],64)):te("",!0),!e.property.ui?.isTestAuthenticationDisabled&&v(l)?.success?(w(),H("div",a6,[u[0]||(u[0]=U("span",{class:"text-sm font-semibold text-green-700"}," Authentication successful ",-1)),v(l).message?(w(),H("div",r6,[U("span",s6,oe(v(l).message),1)])):te("",!0)])):te("",!0),!e.property.ui?.isTestAuthenticationDisabled&&v(l)&&!v(l).success?(w(),H("div",l6,[u[1]||(u[1]=U("span",{class:"text-sm font-semibold text-new-red-700"}," Authentication failed ",-1)),U("div",c6,[U("span",d6,oe(v(l).message),1)])])):te("",!0)],2))}}),h6=Object.assign(u6,{__name:"CredentialWidget"}),p6=E({__name:"Nested",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url));return(n,o)=>(w(),S(v(t),{"config-map":e.property,"base-key":e.property.id},null,8,["config-map","base-key"]))}}),f6=Object.assign(p6,{__name:"Nested"}),g6=E({__name:"Password",props:{field:{},property:{},disabled:{type:Boolean}},setup(e){const t=he(e.field.state.value??""),n=o=>{t.value=o,e.field.handleChange(o)};return(o,i)=>(w(),S(v(zh),{id:e.property.id,type:"password","model-value":v(t),placeholder:e.property.placeholder,disabled:e.disabled,"data-test-id":e.property.id,"onUpdate:modelValue":n,onBlur:e.field.handleBlur},null,8,["id","model-value","placeholder","disabled","data-test-id","onBlur"]))}}),m6=Object.assign(g6,{__name:"Password"}),v6=E({name:"SelectWidget",__name:"Select",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=T(()=>e.property.ui?.mode==="multiple"),n=T(()=>e.property.enum&&e.property.enumNames?e.property.enum.map((a,r)=>({value:a,label:e.property.enumNames?.[r]||a})):[]),o=he((()=>{if(t.value)return e.field.state.value;const a=e.field.state.value;return a?[a]:[]})());function i(a){e.field.handleChange(t.value?a:a[0]),o.value=a}return(a,r)=>(w(),S(v(la),{id:e.property.id,"model-value":v(o),options:v(n),placeholder:e.property.placeholder,"is-disabled":e.disabled,multiple:v(t),variant:"default","onUpdate:modelValue":i,onBlur:e.field.handleBlur},null,8,["id","model-value","options","placeholder","is-disabled","multiple","onBlur"]))}}),b6=Object.assign(v6,{__name:"Select"}),y6=E({__name:"SQLTree",props:{field:{}},async setup(e){let t,n;const o=st(Dt),{data:i}=([t,n]=Rr(()=>es("metadata",()=>$fetch("/workflows/v1/metadata",{method:"POST",body:o.getFieldValue("credential_guid_body")}))),t=await t,n(),t),a=T(()=>i.value?qB(i.value.data.map(h=>h.TABLE_CATALOG)).map(h=>({value:h,label:h,children:i.value.data.filter(p=>p.TABLE_CATALOG===h).map(p=>({value:`${h}:${p.TABLE_SCHEMA}`,label:p.TABLE_SCHEMA}))})):[]),r=u=>{let h=u;return h.startsWith("^")&&(h=h.slice(1)),h.endsWith("$")&&(h=h.slice(0,-1)),h},l=he((u=>{const h=[];if(u){if(typeof u=="object")Object.keys(u)?.forEach(p=>{u[p]?.length>0?u[p]?.forEach(m=>{h.push(`${r(p)}:${r(m)}`)}):h.push(r(p))});else if(typeof u=="string")try{const p=JSON.parse(u);Object.keys(p)?.forEach(m=>{p[m].length>0?p[m]?.forEach(f=>{h.push(`${r(m)}:${r(f)}`)}):h.push(r(m))})}catch{h.push(r(u))}}return h})(e.field.state.value)),c=u=>{const h={};return u.forEach(p=>{if(p.includes(":")){const m=p.split(":")[0];h[`^${m}$`]=[]}else h[`^${p}$`]=[]}),u.forEach(p=>{if(p.includes(":")){const m=p.split(":")[0],f=p.split(":")[1];f&&h[`^${m}$`].push(`^${f}$`)}}),h},d=u=>{const h=c(u);e.field.handleChange(h),l.value=u};return(u,h)=>(w(),S(v(la),{isTree:"",multiple:"",options:v(a),modelValue:v(l),"onUpdate:modelValue":d},null,8,["options","modelValue"]))}}),x6=Object.assign(y6,{__name:"SQLTree"}),w6=E({__name:"APITree",props:{field:{},property:{}},async setup(e){let t,n;const o=st(Dt),{data:i}=([t,n]=Rr(()=>es(`${e.property.id}_metadata`,()=>{const u=o.getFieldValue("credential_guid_body"),h=e.property.ui?.metadataTemplateKey;return $fetch("/workflows/v1/metadata",{method:"POST",body:{...u&&u,...h&&{type:h},...h&&{database:h}}})})),t=await t,n(),t);function a(u,h=null){return u.map(p=>{const m=h?`${h}:${p.value}`:p.value;return{value:m,label:p.title,children:p.children?a(p.children,m):void 0}})}const r=T(()=>i.value?a(i.value.data):[]),l=he((u=>{const h=[],p=(m,f=[])=>{Array.isArray(m)?f.length>0&&h.push(f.join(":")):typeof m=="object"&&m!==null&&Object.keys(m).forEach(b=>{p(m[b],[...f,b])})};if(u)if(typeof u=="string")try{p(JSON.parse(u))}catch{h.push(u)}else p(u);return h})(e.field.state.value)),c=u=>{const h={};return u.forEach(p=>{const m=p.split(":");let f=h;m.forEach((b,g)=>{f[b]||(f[b]={}),g!==m.length-1&&(f=f[b])})}),h},d=u=>{const h=c(u);e.field.handleChange(h),l.value=u};return(u,h)=>(w(),S(v(la),{isTree:"",multiple:"",options:v(r),modelValue:v(l),"onUpdate:modelValue":d},null,8,["options","modelValue"]))}}),C6=Object.assign(w6,{__name:"APITree"}),_6={class:"border border-gray-200 rounded-lg p-6 bg-white"},$6={class:"flex items-center justify-between mb-4"},k6={key:0,class:"mt-4 space-y-3"},S6={class:"flex items-start gap-3"},E6={class:"flex-1"},O6={class:"flex items-center gap-2"},T6={class:"font-medium text-gray-900 capitalize"},I6={key:0,class:"text-sm text-gray-600 mt-1"},P6={key:1,class:"text-sm text-red-600 mt-1"},V6={key:1,class:"mt-4 text-center text-gray-500 text-sm"},D6=E({name:"SageWidget",__name:"Sage",props:{property:{},field:{}},setup(e){const t=st(Yx),n=he(!1),o=he(null);async function i(){n.value=!0,o.value=null;try{const s=await t(),l=await $fetch("/workflows/v1/check",{method:"POST",body:s});o.value=l.data,l.success?Hi.success("Pre-flight checks completed!",{placement:"top",duration:3e3}):Hi.failed("Some pre-flight checks failed",{placement:"top",duration:3e3})}catch(s){Hi.failed("Failed to run pre-flight checks. Please try again.",{placement:"top",duration:3e3}),console.error("Pre-flight check error:",s)}finally{n.value=!1}}const a=s=>s?"✓":"✗",r=s=>s?"text-green-600":"text-red-600";return(s,l)=>(w(),H("div",_6,[U("div",$6,[l[0]||(l[0]=U("div",null,[U("h3",{class:"text-lg font-semibold text-gray-900"}," Pre-flight Checks "),U("p",{class:"text-sm text-gray-500 mt-1"}," Verify your configuration before starting the workflow ")],-1)),z(v(Xt),{label:"Check","is-loading":v(n),onClick:i},null,8,["is-loading"])]),v(o)?(w(),H("div",k6,[(w(!0),H(we,null,Oe(v(o),(c,d)=>(w(),H("div",{key:d,class:"border border-gray-200 rounded-md p-4"},[U("div",S6,[U("span",{class:R(["text-xl font-bold",r(c.success)])},oe(a(c.success)),3),U("div",E6,[U("div",O6,[U("h4",T6,oe(d.replace(/([A-Z])/g," $1").trim()),1),U("span",{class:R(["text-xs px-2 py-0.5 rounded-full font-medium",c.success?"bg-green-100 text-green-700":"bg-red-100 text-red-700"])},oe(c.success?"Passed":"Failed"),3)]),c.success&&c.successMessage?(w(),H("p",I6,oe(c.successMessage),1)):te("",!0),!c.success&&c.failureMessage?(w(),H("p",P6,oe(c.failureMessage),1)):te("",!0)])])]))),128))])):v(n)?te("",!0):(w(),H("div",V6,' Click "Check" to run pre-flight checks '))]))}}),M6=Object.assign(D6,{__name:"Sage"}),R6=E({__name:"Connection",props:{property:{},modelValue:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n={properties:{name:{type:"string",ui:{widget:"input",label:"Connection name",placeholder:"environment",help:"Name of your connection which represents your source environment. Example - 'production', 'development', 'gold', 'analytics' ",required:!0,grid:4,rules:[{required:!0,message:"Please enter a connection name"}]}}}};return(o,i)=>(w(),S(v(t),{"config-map":n,"base-key":e.property.id},null,8,["base-key"]))}}),A6=Object.assign(R6,{__name:"Connection"}),F6={key:0,class:"text-sm text-gray-500 mt-2"},N6={key:1,class:"text-sm text-red-500 mt-2"},L6=E({name:"FileUploadWidget",__name:"FileUpload",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=he(!1),n=he(null),o=async r=>{const s=new FormData;return s.append("file",r),await $fetch("/workflows/v1/file",{method:"POST",body:s})},i=async r=>{const{files:s}=r;if(!s||s.length===0)return;const l=s[0];if(l){t.value=!0,n.value=null;try{const c=await o(l);e.property.ui?.fileMetadata?e.field.handleChange(JSON.stringify({...c,fileKey:c.key,fileId:c.id})):e.field.handleChange(c.id)}catch(c){n.value=c instanceof Error?c.message:"Failed to upload file"}finally{t.value=!1}}},a=T(()=>({placeholder:e.property.ui?.placeholder||"Drag and drop files here",accept:e.property.ui?.accept,isDisabled:e.disabled||t.value}));return(r,s)=>(w(),H("div",null,[z(v(yA),F(v(a),{onFileAccept:i,onBlur:e.field.handleBlur}),null,16,["onBlur"]),v(t)?(w(),H("div",F6," Uploading... ")):te("",!0),v(n)?(w(),H("div",N6,oe(v(n)),1)):te("",!0)]))}}),B6=Object.assign(L6,{__name:"FileUpload"});const Km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),z6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),H6=e=>{const t=z6(e);return t.charAt(0).toUpperCase()+t.slice(1)},j6=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),Xm=e=>e==="";var Ha={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const W6=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":o,strokeWidth:i,"stroke-width":a,size:r=Ha.width,color:s=Ha.stroke,...l},{slots:c})=>at("svg",{...Ha,...l,width:r,height:r,stroke:s,"stroke-width":Xm(n)||Xm(o)||n===!0||o===!0?Number(i||a||Ha["stroke-width"])*24/Number(r):i||a||Ha["stroke-width"],class:j6("lucide",l.class,...e?[`lucide-${Km(H6(e))}-icon`,`lucide-${Km(e)}`]:["lucide-icon"])},[...t.map(d=>at(...d)),...c.default?[c.default()]:[]]);const np=(e,t)=>(n,{slots:o,attrs:i})=>at(W6,{...i,...n,iconNode:t,name:e},o);const U6=np("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const G6=np("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const q6=np("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Y6={key:0,class:"text-red-500"},K6={key:0,class:"absolute right-3 top-3 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer"},X6={class:"flex justify-center"},Z6=E({__name:"Repeater",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=st(Dt),o=r=>{r.pushValue()},i=(r,s)=>{const l=e.property.ui.minItems??1;r.state.value.length>l&&r.removeValue(s)},a=r=>e.property.ui.maxItems!==void 0&&r.state.value.length>=e.property.ui.maxItems;return(r,s)=>(w(),S(v(n).Field,{name:e.property.id,mode:"array"},{default:_(({field:l})=>[U("div",null,[U("div",null,[z(v(Hh),null,{default:_(()=>[Te(oe(e.property.ui?.label)+" ",1),e.property?.required?(w(),H("span",Y6," * ")):te("",!0)]),_:1})]),(w(!0),H(we,null,Oe(l.state.value,(c,d)=>(w(),H("div",{key:d,class:"relative mb-3 border border-gray-300 rounded-lg p-4 group hover:border-gray-400 transition-colors"},[l.state.value.length>(e.property.ui.minItems??1)?(w(),H("div",K6,[z(v(G6),{class:"w-4 h-4 text-gray-400 hover:text-red-500",onClick:()=>{i(l,d)}},null,8,["onClick"])])):te("",!0),z(v(t),{configMap:e.property,baseKey:`${e.property.id}[${d}]`},null,8,["configMap","baseKey"])]))),128)),U("div",X6,[z(v(Xt),{type:"default",label:`Add to ${e.property.ui.label}`,disabled:a(l),onClick:()=>{o(l)}},null,8,["label","disabled","onClick"])])])]),_:1},8,["name"]))}}),J6=Object.assign(Z6,{__name:"Repeater"}),Q6=E({name:"ConnectionSelector",__name:"ConnectionSelector",props:{property:{},disabled:{type:Boolean},field:{}},setup(e){const t=T(()=>e.property.enumNames?.map((i,a)=>({label:i,value:e.property.enum?.[a]}))||[{label:"Production Database",value:"default/snowflake/1234567890"},{label:"Staging Database",value:"default/snowflake/0987654321"},{label:"Development Database",value:"default/postgres/8938390"},{label:"Analytics Warehouse",value:"default/bigquery/1234567890"},{label:"Backup Storage",value:"default/s3/1234567890"}]),n=he(e.field.state.value?[e.field.state.value]:[]);function o(i){n.value=i,e.field.handleChange(i[0])}return(i,a)=>(w(),S(v(la),{id:e.property.id,modelValue:v(n),options:v(t),placeholder:e.property.placeholder,"is-disabled":e.disabled,variant:"default","onUpdate:modelValue":o,onBlur:e.field.handleBlur},null,8,["id","modelValue","options","placeholder","is-disabled","onBlur"]))}}),e5=Object.assign(Q6,{__name:"ConnectionSelector"}),t5=E({name:"SwitcherWidget",__name:"Switcher",props:{property:{},field:{}},setup(e){const t=({checked:n})=>{e.field.handleChange(n)};return(n,o)=>(w(),H("div",null,[z(v(EF),{checked:e.field.state.value,onCheckedChange:t},{default:_(()=>[Te(oe(e.property.ui?.title),1)]),_:1},8,["checked"])]))}}),n5=Object.assign(t5,{__name:"Switcher"}),Zm=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},zt=(...e)=>e.reduce((t,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach(o=>{["__proto__","constructor","prototype"].includes(o)||(Array.isArray(t[o])&&Array.isArray(n[o])?t[o]=zt.options.mergeArrays?zt.options.uniqueArrayItems?Array.from(new Set(t[o].concat(n[o]))):[...t[o],...n[o]]:n[o]:Zm(t[o])&&Zm(n[o])?t[o]=zt(t[o],n[o]):t[o]=n[o]===void 0?zt.options.allowUndefinedOverrides?n[o]:t[o]:n[o])}),t},{}),Tu={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};zt.options=Tu;zt.withOptions=(e,...t)=>{zt.options=Object.assign(Object.assign({},Tu),e);const n=zt(...t);return zt.options=Tu,n};const o5={properties:{divider:{ui:{widget:"divider",class:"mt-0"}},header:{ui:{widget:"header",label:"Secure Agent Configuration",class:"mb-4 text-base text-new-gray-500"}},"agent-name":{type:"string",required:!0,ui:{widget:"agentSelector",label:"Agent",grid:4,rules:[{required:!0,message:"Please select an agent"}]}},"secret-manager":{type:"string",required:!0,enum:["awssecretmanager","azurekeyvault","gcpsecretmanager","secretinjectionenvironment","kubernetes","custom"],enumNames:["AWS Secret Manager","Azure Key Vault","GCP Secret Manager","Environment Variable based Injection","Kubernetes Secret","Custom"],ui:{widget:"select",label:"Secret Store",placeholder:"Secret Store",rules:[{required:!0,message:"Please select the secret store"}]}},"secret-path":{type:"string",required:!0,ui:{label:"Secret Path/Name in Secret Manager",placeholder:"Enter Secret Path/Name",help:"The secret path or name of the stored secret in the secret manager",hidden:!1,grid:4,rules:[{required:!0,message:"Please enter the secret path"}]}},"aws-region":{type:"string",enum:["us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-south-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-west-1","eu-west-2","eu-west-3","eu-north-1","eu-south-1","me-south-1","sa-east-1"],required:!0,enumNames:["US East (N. Virginia)","US East (Ohio)","US West (N. California)","US West (Oregon)","Africa (Cape Town)","Asia Pacific (Hong Kong)","Asia Pacific (Mumbai)","Asia Pacific (Tokyo)","Asia Pacific (Seoul)","Asia Pacific (Osaka)","Asia Pacific (Singapore)","Asia Pacific (Sydney)","Canada (Central)","Europe (Frankfurt)","Europe (Ireland)","Europe (London)","Europe (Paris)","Europe (Stockholm)","Europe (Milan)","Middle East (Bahrain)","South America (São Paulo)"],ui:{widget:"select",label:"AWS Region",placeholder:"Select AWS Region",grid:4,rules:[{required:!0,message:"Please select a region"}]}},"aws-auth-method":{type:"string",required:!0,enum:["iam","iam-assume-role","access-key"],default:"iam",enumNames:["IAM","IAM Assume Role","Access Key and Secret Key"],ui:{widget:"select",label:"AWS Authentication Method",placeholder:"Select AWS Authentication Method",help:"In case of IAM assume role or access key and secret key authentication, the keys should be set as environment variables or added in kubernetes secrets",grid:4,rules:[{required:!0,message:"Please select an AWS authentication method"}]}},"aws-assume-role-arn":{type:"string",required:!0,ui:{label:"AWS Assume Role ARN",placeholder:"Enter AWS Role ARN to assume",help:"The AWS role ARN to assume for accessing AWS Secret Manager",hidden:!1,grid:4}},"azure-auth-method":{type:"string",enum:["managed_identity","service_principal"],default:"managed_identity",enumNames:["Managed Identity","Service Principal"],ui:{widget:"select",label:"Azure Authentication Method",placeholder:"Select Azure Authentication Method",help:"In case of Service Principal authentication, the client id, client secret and tenant id should be set as environment variables or added in kubernetes secrets",grid:4,rules:[{required:!0,message:"Please select an Azure authentication method"}]}},"azure-vault-name":{type:"string",required:!0,ui:{label:"Azure Key Vault Name",placeholder:"Enter Azure Key Vault Name",help:"The name of the Azure Key Vault",hidden:!1,grid:8}},"agent-custom-config":{type:"string",ui:{label:"Agent Custom configuration",placeholder:"{}",help:"Use this if you wish to use any custom configuration for the agent. Do not enter any sensitive information here.",hidden:!1,grid:8}},"aws-secret-manager-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the AWS Secret, add the path for the fields with the placeholder Store Credential Path. Example: username",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"azure-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the Azure Key Vault, add the name of key vault secret for the fields with the placeholder Store Credential Path. Example: atlan-crawler-db-username",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"secret-injection-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"Add the expected environment variable values for the fields with the placeholder Store Credential Path. Example: vault:secret/data/accounts/test#PASSWORD",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"kubernetes-secret-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the K8S Secret, add the corresponding key name in the secret for the fields with the placeholder Store Credential Path. Example: username",link:{label:"View docs",url:"https://ask.atlan.com/"}}},"gcp-help-text":{type:"banner",ui:{hidden:!1,category:"info",prefixText:"For the Google Secret Manager, add the secret path for the fields with the placeholder Store Credential Path. Example: projects/{project_id}/secrets/{secret_id}/versions/{version_id}",link:{label:"View docs",url:"https://ask.atlan.com/"}}}},anyOf:[{properties:{"secret-manager":{const:"awssecretmanager"}},required:["aws-auth-method","aws-region","secret-path","aws-secret-manager-help-text"]},{properties:{"aws-auth-method":{const:"iam-assume-role"},"secret-manager":{const:"awssecretmanager"}},required:["aws-assume-role-arn"]},{properties:{"secret-manager":{const:"azurekeyvault"}},required:["azure-auth-method","azure-vault-name","azure-help-text"]},{properties:{"secret-manager":{const:"secretinjectionenvironment"}},required:["secret-injection-help-text"]},{properties:{"secret-manager":{const:"kubernetes"}},required:["secret-path","kubernetes-secret-help-text"]},{properties:{"secret-manager":{const:"gcpsecretmanager"}},required:["gcp-help-text"]},{properties:{"secret-manager":{const:"custom"}},required:["agent-custom-config"]}]},i5={config:o5},a5=e=>{try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}return!0};function r5(e){if(!e)return{message:null,link:null};if(!a5(e))return{message:e,link:null};const t=JSON.parse(e);return{message:t.error_message??t.debug_message??e,link:t.doc_link?t.doc_link:null}}const s5={key:0,class:"flex items-center justify-center",style:{height:"100px"}},l5={key:1,class:"flex items-center justify-center"},c5={class:"text-red-500 text-sm"},d5={class:"mt-2"},u5={key:0,class:"flex flex-col mt-2 gap-y-2"},h5={class:"flex"},p5={key:0,class:"p-3 border rounded-md border-green-400 bg-green-100"},f5={key:0,class:"mt-1"},g5={class:"text-sm text-green-600"},m5={key:1,class:"p-3 border rounded-md border-new-red-400 bg-new-red-100"},v5={class:"mt-1"},b5={class:"text-sm text-new-red-600","data-test-id":"error-log-message"},y5=["href"],x5="atlan-connectors-agent",w5=E({__name:"Agent",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=st(Dt),o=T(()=>e.property.ui?.agentConfigs??[]),i=T(()=>e.property.ui?.agentType),a=T(()=>{const b=i.value?[{name:i.value,options:{}}]:[],g=o.value.map(([y,x={}])=>({name:y,options:x}));return[...b,...g].filter(y=>y.name)});async function r(b){if(b===x5)return{data:i5};const y=(await $fetch(`/workflows/v1/configmap/${b}`))?.data;return y&&"kind"in y?{data:{config:JSON.parse(y.data.config)}}:{data:{config:y?.config??{}}}}const s=he(null),l=he(!0),c=he(null);Ae(a,async b=>{l.value=!0,c.value=null;try{s.value=await Promise.all(b.map(({name:g})=>r(g)))}catch(g){c.value=g}finally{l.value=!1}},{immediate:!0});const d=T(()=>{if(!s.value)return null;let b={};for(let g=0;g<a.value.length;g++){const y=a.value[g];if(!y)continue;const x=s.value[g]?.data?.config;if(x)if(Object.keys(y.options).length>0){const C=zt(b,x,y.options);b=zt.withOptions({mergeArrays:!1},C,y.options)}else b=zt(b,x)}return Object.keys(b).length>0?b:null}),u=n.useStore(b=>yo(b.values));Ae(d,b=>{b?.properties&&Object.entries(Nc(b)).forEach(([g,y])=>{const x=`${e.property.id}.${g}`;u.value[x]||n.setFieldValue(x,y)})},{immediate:!0});const h=T(()=>{const b=o.value[0];return Array.isArray(b)?b[0]:i.value??""}),p=he(!1),m=he(null);Ae(u,()=>{m.value=null});async function f(){p.value=!0,m.value=null;try{const b=await $fetch("/workflows/v1/auth",{method:"POST",body:JSON.stringify(Ou(u.value,e.property.id,h.value,void 0))});m.value={success:!0,message:b.message||"Authentication successful"}}catch(b){const g=b,{message:y,link:x}=r5(g?.data?.message||g?.message);m.value={success:!1,message:y||"Authentication failed",link:x}}finally{p.value=!1}}return(b,g)=>v(l)?(w(),H("div",s5,[...g[0]||(g[0]=[U("span",{class:"text-sm text-gray-500"},"Loading credential configuration...",-1)])])):v(c)?(w(),H("div",l5,[U("span",c5,oe(v(c)),1)])):v(d)?(w(),H("div",{key:2,class:R([e.property.ui?.class,"flex flex-col gap-y-2"])},[U("div",d5,[z(v(t),{"config-map":v(d),"base-key":e.property.id},null,8,["config-map","base-key"])]),e.property.ui?.showTestAuthentication?(w(),H("div",u5,[U("div",h5,[z(v(Xt),{loading:v(p),label:v(p)?"Testing Authentication":"Test Authentication",onClick:f},null,8,["loading","label"])]),v(m)?.success?(w(),H("div",p5,[g[1]||(g[1]=U("span",{class:"text-sm font-semibold text-green-700"}," Authentication successful ",-1)),v(m).message?(w(),H("div",f5,[U("span",g5,oe(v(m).message),1)])):te("",!0)])):te("",!0),v(m)&&!v(m).success?(w(),H("div",m5,[g[2]||(g[2]=U("span",{class:"text-sm font-semibold text-new-red-700"}," Authentication failed ",-1)),U("div",v5,[U("span",b5,oe(v(m).message),1),v(m).link?(w(),H("a",{key:0,href:v(m).link,target:"_blank",class:"ml-1 text-sm text-blue-600 underline"}," Troubleshoot ",8,y5)):te("",!0)])])):te("",!0)])):te("",!0)],2)):te("",!0)}}),C5=Object.assign(w5,{__name:"Agent"}),_5=E({name:"AgentSelector",__name:"AgentSelector",props:{property:{},disabled:{type:Boolean},field:{},baseKey:{}},setup(e){const t=st(Dt),n=[{id:"atlas-agent-1",label:"Atlas Agent 1",agentType:"atlas"},{id:"miner-agent-2",label:"Miner Agent 2",agentType:"miner"},{id:"lineage-agent-3",label:"Lineage Agent 3",agentType:"lineage"},{id:"catalog-agent-4",label:"Catalog Agent 4",agentType:"catalog"}],o=n.map(({id:r,label:s})=>({value:r,label:s})),i=he(e.field.state.value?[e.field.state.value]:[]);function a(r){i.value=r,e.field.handleChange(r[0]);const s=n.find(l=>l.id===r[0]);if(s){const l=e.baseKey?`${e.baseKey}.agent-type`:"agent-type";t.setFieldValue(l,s.agentType)}}return(r,s)=>(w(),S(v(la),{id:e.property.id,"model-value":v(i),options:v(o),placeholder:e.property.placeholder,"is-disabled":e.disabled,variant:"default","onUpdate:modelValue":a,onBlur:e.field.handleBlur},null,8,["id","model-value","options","placeholder","is-disabled","onBlur"]))}}),$5=Object.assign(_5,{__name:"AgentSelector"});var Jm;const k5=typeof window<"u";k5&&((Jm=window?.navigator)!=null&&Jm.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function S5(e,t){function n(...o){return new Promise((i,a)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(a)})}return n}const nw=e=>e();function E5(e=nw){const t=he(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...a)=>{t.value&&e(...a)};return{isActive:Pv(t),pause:n,resume:o,eventFilter:i}}function O5(e){return e}var Qm=Object.getOwnPropertySymbols,T5=Object.prototype.hasOwnProperty,I5=Object.prototype.propertyIsEnumerable,P5=(e,t)=>{var n={};for(var o in e)T5.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Qm)for(var o of Qm(e))t.indexOf(o)<0&&I5.call(e,o)&&(n[o]=e[o]);return n};function V5(e,t,n={}){const o=n,{eventFilter:i=nw}=o,a=P5(o,["eventFilter"]);return Ae(e,S5(i,t),a)}var D5=Object.defineProperty,M5=Object.defineProperties,R5=Object.getOwnPropertyDescriptors,Ql=Object.getOwnPropertySymbols,ow=Object.prototype.hasOwnProperty,iw=Object.prototype.propertyIsEnumerable,ev=(e,t,n)=>t in e?D5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A5=(e,t)=>{for(var n in t||(t={}))ow.call(t,n)&&ev(e,n,t[n]);if(Ql)for(var n of Ql(t))iw.call(t,n)&&ev(e,n,t[n]);return e},F5=(e,t)=>M5(e,R5(t)),N5=(e,t)=>{var n={};for(var o in e)ow.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Ql)for(var o of Ql(e))t.indexOf(o)<0&&iw.call(e,o)&&(n[o]=e[o]);return n};function ec(e,t,n={}){const o=n,{eventFilter:i}=o,a=N5(o,["eventFilter"]),{eventFilter:r,pause:s,resume:l,isActive:c}=E5(i);return{stop:V5(e,t,F5(A5({},a),{eventFilter:r})),pause:s,resume:l,isActive:c}}function L5(e,t,n){return Ae(e,(o,i,a)=>{o&&t(o,i,a)},n)}const tv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},nv="__vueuse_ssr_handlers__";tv[nv]=tv[nv]||{};var ov;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(ov||(ov={}));function B5(){const e=he([]);return e.value.set=t=>{t&&e.value.push(t)},Ww(()=>{e.value.length=0}),e}var z5=Object.defineProperty,iv=Object.getOwnPropertySymbols,H5=Object.prototype.hasOwnProperty,j5=Object.prototype.propertyIsEnumerable,av=(e,t,n)=>t in e?z5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W5=(e,t)=>{for(var n in t||(t={}))H5.call(t,n)&&av(e,n,t[n]);if(iv)for(var n of iv(t))j5.call(t,n)&&av(e,n,t[n]);return e};const U5={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};W5({linear:O5},U5);var Id={},ja={},Wa={},rv;function op(){if(rv)return Wa;rv=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.HostType=void 0;var e;return function(t){t.domain="domain",t.socket="socket",t.IPv4="IPv4",t.IPv6="IPv6"}(e||(Wa.HostType=e={})),Wa}var Sn={},sv;function G5(){if(sv)return Sn;sv=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.fullHostName=t,Sn.encode=n,Sn.decode=o,Sn.hasText=i,Sn.validateUrl=a,Sn.parseHost=r;const e=op();function t(s,l){let c="";return s.name&&(c=s.type===e.HostType.IPv4||s.type===e.HostType.IPv6?s.name:n(s.name,l??{})),s.port&&(c+=`:${s.port}`),c}function n(s,l){return s=encodeURIComponent(s),l.plusForSpace&&(s=s.replace(/%20/g,"+")),l.encodeDollar?s:s.replace(/%24/g,"$")}function o(s){return decodeURIComponent(s.replace(/\+/g,"%20"))}function i(s){return typeof s=="string"&&/\S/.test(s)}function a(s){const l=s.search(/[^a-z0-9-._:\/?[\]@!$&'()*+,;=%~]/i);if(l>=0){const c=JSON.stringify(s[l]).replace(/^"|"$/g,"'");throw new Error(`Invalid URL character ${c} at position ${l}`)}}function r(s,l){if(l){if(typeof s!="string")throw new TypeError(`Invalid "host" parameter: ${JSON.stringify(s)}`);s=s.trim()}let c,d;if(s[0]==="["?(c=s.match(/((\[[0-9a-z:%_]{2,45}])(?::(-?[0-9a-z]+))?)/i),d=!0):l?c=s.match(/(([a-z0-9.$/\- _]*)(?::(-?[0-9a-z]+))?)/i):c=s.match(/(([a-z0-9.+$%\-_]*)(?::(-?[0-9a-z]+))?)/i),c){const u={};if(c[2]&&(d?(u.name=c[2],u.type=e.HostType.IPv6):c[2].match(/([0-9]{1,3}\.){3}[0-9]{1,3}/)?(u.name=c[2],u.type=e.HostType.IPv4):(u.name=l?c[2]:o(c[2]),u.type=u.name.match(/\/|.*\.sock$/i)?e.HostType.socket:e.HostType.domain)),c[3]){const h=c[3],p=parseInt(h);if(p>0&&p<65536&&p.toString()===h)u.port=p;else throw new Error(`Invalid port: ${JSON.stringify(h)}. Valid port range is: [1...65535]`)}if(u.name||u.port)return Object.defineProperty(u,"toString",{value:h=>t(u,h),enumerable:!1}),u}return null}return Sn}var lv;function q5(){if(lv)return ja;lv=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.ConnectionString=void 0;const e=op(),t=G5(),n='Invalid "defaults" parameter: ';class o{get host(){return this.hosts?.[0].toString()}get hostname(){return this.hosts?.[0].name}get port(){return this.hosts?.[0].port}get type(){return this.hosts?.[0].type}constructor(a,r){if(a=a??"",typeof a!="string")throw new TypeError(`Invalid connection string: ${JSON.stringify(a)}`);if(typeof(r??{})!="object")throw new TypeError(n+JSON.stringify(r));a=a.trim(),(0,t.validateUrl)(a);let s=a.match(/^(.*)?:\/\//);if(s){const c=s[1];if(c){const d=c.match(/^([a-z]+[a-z0-9+-.:]*)/i);if(c&&(!d||d[1]!==c))throw new Error(`Invalid protocol name: ${c}`);this.protocol=c}a=a.substring(s[0].length)}if(s=a.match(/^([\w-_.+!*'()$%]*):?([\w-_.+!*'()$%~]*)@/),s&&(s[1]&&(this.user=(0,t.decode)(s[1])),s[2]&&(this.password=(0,t.decode)(s[2])),a=a.substring(s[0].length)),a[0]!=="/"){const c=a.search(/[\/?]/);(c===-1?a:a.substring(0,c)).split(",").forEach(u=>{const h=(0,t.parseHost)(u);h&&(this.hosts||(this.hosts=[]),this.hosts.push(h))}),c>=0&&(a=a.substring(c))}s=a.match(/\/([\w-_.+!*'()$%]+)/g),s&&(this.path=s.map(c=>(0,t.decode)(c.substring(1))));const l=a.indexOf("?");if(l!==-1&&(a=a.substring(l+1),s=a.match(/([\w-_.+!*'()$%]+)=([\w-_.+!*'()$%,]+)/g),s)){const c={};s.forEach(d=>{const u=d.split("="),h=(0,t.decode)(u[0]),p=u[1].split(",").map(t.decode);h in c?Array.isArray(c[h])?c[h].push(...p):c[h]=[c[h],...p]:c[h]=p.length>1?p:p[0]}),this.params=c}r&&this.setDefaults(r)}static parseHost(a){return(0,t.parseHost)(a,!0)}toString(a){let r=this.protocol?`${this.protocol}://`:"";const s=a||{};if(this.user||this.password){if(this.user&&(r+=(0,t.encode)(this.user,s)),this.password){r+=":";const l=s.passwordHash;if(l){const c=typeof l=="string"&&l[0]||"#";r+=c.repeat(this.password.length)}else r+=(0,t.encode)(this.password,s)}r+="@"}if(Array.isArray(this.hosts)&&(r+=this.hosts.map(l=>(0,t.fullHostName)(l,a)).join()),Array.isArray(this.path)&&this.path.forEach(l=>{r+=`/${(0,t.encode)(l,s)}`}),this.params&&typeof this.params=="object"){const l=[];for(const c in this.params){let d=this.params[c];d=Array.isArray(d)?d:[d],d=d.map(u=>(0,t.encode)(typeof u=="string"?u:JSON.stringify(u),s)).join(),s.plusForSpace&&(d=d.replace(/%20/g,"+")),l.push(`${(0,t.encode)(c,s)}=${d}`)}l.length&&(r+=`?${l.join("&")}`)}return r}setDefaults(a){if(!a||typeof a!="object")throw new TypeError(n+JSON.stringify(a));if(!("protocol"in this)&&(0,t.hasText)(a.protocol)&&(this.protocol=a.protocol&&a.protocol.trim()),Array.isArray(a.hosts)){const r=Array.isArray(this.hosts)?this.hosts:[];a.hosts.filter(l=>l&&typeof l=="object").forEach(l=>{const d={name:(0,t.hasText)(l.name)?l.name.trim():void 0,port:l.port,type:l.type};let u=!1;for(let h=0;h<r.length;h++){const p=(0,t.fullHostName)(r[h]),m=(0,t.fullHostName)(d);if(p.toLowerCase()===m.toLowerCase()){u=!0;break}}if(!u){const h={};if(d.name)if(d.type&&d.type in e.HostType)h.name=d.name,h.type=d.type;else{const m=(0,t.parseHost)(d.name,!0);m&&(h.name=m.name,h.type=m.type)}const p=d.port;typeof p=="number"&&p>0&&p<65536&&(h.port=p),(h.name||h.port)&&(Object.defineProperty(h,"toString",{value:m=>(0,t.fullHostName)(h,m)}),r.push(h))}}),r.length&&(this.hosts=r)}if(!("user"in this)&&(0,t.hasText)(a.user)&&(this.user=a.user.trim()),!("password"in this)&&(0,t.hasText)(a.password)&&(this.password=a.password.trim()),!("path"in this)&&Array.isArray(a.path)){const r=a.path.filter(t.hasText);r.length&&(this.path=r)}if(a.params&&typeof a.params=="object"&&Object.keys(a.params).length)if(this.params&&typeof this.params=="object")for(const s in a.params)s in this.params||(this.params[s]=a.params[s]);else{this.params={};for(const s in a.params)this.params[s]=a.params[s]}return this}}return ja.ConnectionString=o,function(){["setDefaults","toString"].forEach(i=>{const a=Object.getOwnPropertyDescriptor(o.prototype,i);a.enumerable=!1,Object.defineProperty(o.prototype,i,a)})}(),ja}var cv;function Y5(){return cv||(cv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HostType=e.ConnectionString=void 0;var t=q5();Object.defineProperty(e,"ConnectionString",{enumerable:!0,get:function(){return t.ConnectionString}});var n=op();Object.defineProperty(e,"HostType",{enumerable:!0,get:function(){return n.HostType}})}(Id)),Id}var zs=Y5();const dv=0,uv=1,K5=E({__name:"AdvancedJDBCUrlGroup",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=e,o=st(Dt),i=o.useStore(u=>yo(u.values));function a(u){try{return new zs.ConnectionString(u),!0}catch{return!1}}const r=T(()=>i.value[n.property.ui.urlPropertyId]),s=T(()=>tp(i.value,Object.values(yo(n.property.ui.urlPartPropertyIdMapping)).filter(u=>u!==n.property.ui.urlPropertyId))),l=[],c=ec(r,async u=>{const h=n.property.ui.isDelimitedBySemicolons?u?.replace(";","?").replaceAll(";","&"):u;if(h&&a(h)){const p=new zs.ConnectionString(h);l[uv]?.pause(),Object.entries(n.property.ui.urlPartPropertyIdMapping).forEach(([m,f])=>{m==="searchParams"?Object.entries(f).forEach(([b,g])=>{p.params?.[b]&&Object.keys(i.value).includes(g)&&o.setFieldValue(g,p.params[b])}):m==="pathname"?Object.keys(i.value).includes(f)&&o.setFieldValue(f,p.path?.[0]):m==="username"?Object.keys(i.value).includes(f)&&o.setFieldValue(f,p.user):p[m]&&Object.keys(i.value).includes(f)&&o.setFieldValue(f,p[m])}),await po(),l[uv]?.resume()}});l.push(c);const d=ec([s,()=>n.property.ui],async([u,h],[p,m])=>{l[dv]?.pause();let f={protocol:Jx(h.protocol,":")};if(r.value){const y=h.isDelimitedBySemicolons?r.value.replace(";","?").replaceAll(";","&"):r.value;if(a(y)&&ep(m,h)){const x=new zs.ConnectionString(y);for(const C of["protocol","user","password","hosts","port","path","params"])f={...f,[C]:x[C]}}}const b={};Object.entries(h.urlPartPropertyIdMapping).forEach(([y,x])=>{y==="searchParams"?Object.entries(x).forEach(([C,k])=>{Object.keys(u).includes(k)?f={...f,params:{...f.params,[C]:u[k]}}:f={...f,params:{...f.params,[C]:k}}}):y==="hostname"?u[x]&&(b.name=u[x],f={...f,hosts:[b]}):y==="port"?u[x]&&(b.port=u[x],f={...f,hosts:[b]}):y==="username"?u[x]&&(f={...f,user:u[x]}):y==="pathname"?u[x]&&(f={...f,path:[u[x]]}):u[x]&&(f={...f,[y]:u[x]})});const g=new zs.ConnectionString(null,f);o.setFieldValue(h.urlPropertyId,h.isDelimitedBySemicolons?g.toString().replace("?",";").replaceAll("&",";"):g.toString()),await po(),l[dv]?.resume()});return l.push(d),(u,h)=>(w(),S(v(t),{class:"border border-gray-200 rounded-lg p-3 mb-4","config-map":n.property,"base-key":n.property.id.split(".")[0]},null,8,["config-map","base-key"]))}}),X5=Object.assign(K5,{__name:"AdvancedJDBCUrlGroup"}),hv=0,pv=1,Z5=E({__name:"JDBCUrlGroup",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=e,o=st(Dt),i=o.useStore(d=>yo(d.values)),a=T(()=>i.value[n.property.ui.urlPropertyId]),r=T(()=>tp(i.value,Object.values(yo(n.property.ui.urlPartPropertyIdMapping)).filter(d=>d!==n.property.ui.urlPropertyId))),s=[],l=ec(a,async d=>{const u=n.property.ui.isDelimitedBySemicolons?d?.replace(";","?").replaceAll(";","&"):d;if(u&&URL.canParse(u)){const h=new URL(u);s[pv]?.pause(),Object.entries(n.property.ui.urlPartPropertyIdMapping).forEach(([p,m])=>{if(p==="searchParams")Object.entries(m).forEach(([f,b])=>{h.searchParams.get(f)&&Object.keys(i.value).includes(b)&&o.setFieldValue(b,h.searchParams.get(f))});else{const f=h[p];f&&Object.keys(i.value).includes(m)&&o.setFieldValue(m,p==="pathname"?Jx(f,"/"):f)}}),await po(),s[pv]?.resume()}});s.push(l);const c=ec([r,()=>n.property.ui],async([d,u],[h,p])=>{s[hv]?.pause();let m=new URL(`${u.protocol}//`);if(a.value){const f=u.isDelimitedBySemicolons?a.value.replace(";","?").replaceAll(";","&"):a.value;URL.canParse(f)&&ep(p,u)&&(m=new URL(f))}Object.entries(u.urlPartPropertyIdMapping).forEach(([f,b])=>{f==="searchParams"?Object.entries(b).forEach(([g,y])=>{Object.keys(d).includes(y)?m.searchParams.set(g,d[y]):m.searchParams.set(g,y)}):d[b]&&(m[f]=d[b])}),o.setFieldValue(u.urlPropertyId,u.isDelimitedBySemicolons?m.toString().replace("?",";").replaceAll("&",";"):m.toString()),await po(),s[hv]?.resume()});return s.push(c),(d,u)=>(w(),S(v(t),{class:"border border-gray-200 rounded-lg p-3 mb-4","config-map":n.property,"base-key":n.property.id.split(".")[0]},null,8,["config-map","base-key"]))}}),J5=Object.assign(Z5,{__name:"JDBCUrlGroup"}),Q5=E({__name:"NestedCollapse",props:{property:{}},setup(e){const t=xo(()=>wo(()=>Promise.resolve().then(()=>ko),void 0,import.meta.url)),n=he([]);return(o,i)=>(w(),S(v($$),{modelValue:v(n),"onUpdate:modelValue":i[0]||(i[0]=a=>Uw(n)?n.value=a:null),collapsible:""},{default:_(()=>[(w(!0),H(we,null,Oe(e.property.panels,a=>(w(),S(v(h$),{key:a.id,value:a.id},{default:_(()=>[z(v(v$),null,{default:_(()=>[Te(oe(a.header)+" ",1),z(v(m$),null,{default:_(()=>[z(v(U6),{class:"w-4 h-4 transition-transform"})]),_:1})]),_:2},1024),z(v(p$),null,{default:_(()=>[z(v(t),{"config-map":a.configMap,"base-key":e.property.id},null,8,["config-map","base-key"])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]))}}),e4=Object.assign(Q5,{__name:"NestedCollapse"}),t4=E({__name:"ApiSelect",props:{field:{},property:{}},async setup(e){let t,n;const o=st(Dt),i=T(()=>!!e.property.ui?.isMultiple),{data:a}=([t,n]=Rr(()=>es(`${e.property.id}_metadata`,()=>{const h=o.getFieldValue("credential_guid_body"),{metadataTemplateKey:p,metadataTransformerTemplateKey:m}=e.property.ui??{};return $fetch("/workflows/v1/metadata",{method:"POST",body:{...h&&h,...p&&{type:p},...p&&{database:p},...m&&{metadataTransformerTemplateKey:m}}})})),t=await t,n(),t);function r(h,p=null){return h.map(m=>{const f=p?`${p}:${m.value}`:m.value;return{value:f,label:m.title,children:m.children?r(m.children,f):void 0}})}const s=T(()=>a.value?r(a.value.data):[]),c=he((h=>{const p=[],m=(f,b=[])=>{Array.isArray(f)?b.length>0&&p.push(b.join(":")):typeof f=="object"&&f!==null&&Object.keys(f).forEach(g=>{m(f[g],[...b,g])})};if(h)if(typeof h=="string")try{m(JSON.parse(h))}catch{p.push(h)}else m(h);return p})(e.field.state.value)),d=h=>{const p={};return h.forEach(m=>{const f=m.split(":");let b=p;f.forEach((g,y)=>{b[g]||(b[g]={}),y!==f.length-1&&(b=b[g])})}),p},u=h=>{const p=Array.isArray(h)?h:[h].filter(Boolean);e.field.handleChange(d(p)),c.value=p};return(h,p)=>(w(),S(v(la),{isTree:"",multiple:v(i),options:v(s),modelValue:v(c),"onUpdate:modelValue":u},null,8,["multiple","options","modelValue"]))}}),n4=Object.assign(t4,{__name:"ApiSelect"}),o4={class:"flex flex-col gap-y-1"},i4={class:"text-gray-600"},a4=["href"],r4=E({__name:"Checkbox",props:{field:{},property:{}},setup(e){const t=T(()=>e.property?.ui),n=o=>{e.field.handleChange(o),e.field.handleBlur()};return(o,i)=>(w(),H("div",o4,[z(v(ix),{checked:e.field.state.value,"data-test-id":e.property?.id,"onUpdate:checked":n},{default:_(()=>[U("span",i4,oe(v(t)?.title),1),v(t)?.link?(w(),H("a",{key:0,href:v(t).link.url,target:"_blank",class:"hover:underline"},oe(v(t).link.text),9,a4)):te("",!0)]),_:1},8,["checked","data-test-id"])]))}}),s4=Object.assign(r4,{__name:"Checkbox"});function Pd(e,t){return e-t*Math.floor(e/t)}const aw=1721426;function Hs(e,t,n,o){t=ip(e,t);let i=t-1,a=-2;return n<=2?a=0:Cl(t)&&(a=-1),aw-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+o)}function Cl(e){return e%4===0&&(e%100!==0||e%400===0)}function ip(e,t){return e==="BC"?1-t:t}function l4(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const c4={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 Qi{fromJulianDay(t){let n=t,o=n-aw,i=Math.floor(o/146097),a=Pd(o,146097),r=Math.floor(a/36524),s=Pd(a,36524),l=Math.floor(s/1461),c=Pd(s,1461),d=Math.floor(c/365),u=i*400+r*100+l*4+d+(r!==4&&d!==4?1:0),[h,p]=l4(u),m=n-Hs(h,p,1,1),f=2;n<Hs(h,p,3,1)?f=0:Cl(p)&&(f=1);let b=Math.floor(((m+f)*12+373)/367),g=n-Hs(h,p,b,1)+1;return new na(h,p,b,g)}toJulianDay(t){return Hs(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return c4[Cl(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Cl(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}function d4(e,t){var n,o,i,a;return(a=(i=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&i!==void 0?i:(o=t.isEqual)===null||o===void 0?void 0:o.call(t,e))!==null&&a!==void 0?a:e.identifier===t.identifier}function u4(e){return Nn(Date.now(),e)}function h4(e){return m4(u4(e))}function rw(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function p4(e,t){return fv(e)-fv(t)}function fv(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Vd=null;function ap(){return Vd==null&&(Vd=new Intl.DateTimeFormat().resolvedOptions().timeZone),Vd}function ea(e){e=mn(e,new Qi);let t=ip(e.era,e.year);return sw(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function sw(e,t,n,o,i,a,r){let s=new Date;return s.setUTCHours(o,i,a,r),s.setUTCFullYear(e,t-1,n),s.getTime()}function Iu(e,t){if(t==="UTC")return 0;if(e>0&&t===ap())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:o,day:i,hour:a,minute:r,second:s}=lw(e,t);return sw(n,o,i,a,r,s,0)-Math.floor(e/1e3)*1e3}const gv=new Map;function lw(e,t){let n=gv.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"}),gv.set(t,n));let o=n.formatToParts(new Date(e)),i={};for(let a of o)a.type!=="literal"&&(i[a.type]=a.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const mv=864e5;function f4(e,t,n,o){return(n===o?[n]:[n,o]).filter(a=>g4(e,t,a))}function g4(e,t,n){let o=lw(n,t);return e.year===o.year&&e.month===o.month&&e.day===o.day&&e.hour===o.hour&&e.minute===o.minute&&e.second===o.second}function Dn(e,t,n="compatible"){let o=ta(e);if(t==="UTC")return ea(o);if(t===ap()&&n==="compatible"){o=mn(o,new Qi);let l=new Date,c=ip(o.era,o.year);return l.setFullYear(c,o.month-1,o.day),l.setHours(o.hour,o.minute,o.second,o.millisecond),l.getTime()}let i=ea(o),a=Iu(i-mv,t),r=Iu(i+mv,t),s=f4(o,t,i-a,i-r);if(s.length===1)return s[0];if(s.length>1)switch(n){case"compatible":case"earlier":return s[0];case"later":return s[s.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-a,i-r);case"compatible":case"later":return Math.max(i-a,i-r);case"reject":throw new RangeError("No such absolute time found")}}function cw(e,t,n="compatible"){return new Date(Dn(e,t,n))}function Nn(e,t){let n=Iu(e,t),o=new Date(e+n),i=o.getUTCFullYear(),a=o.getUTCMonth()+1,r=o.getUTCDate(),s=o.getUTCHours(),l=o.getUTCMinutes(),c=o.getUTCSeconds(),d=o.getUTCMilliseconds();return new Ir(i<1?"BC":"AD",i<1?-i+1:i,a,r,t,n,s,l,c,d)}function m4(e){return new na(e.calendar,e.era,e.year,e.month,e.day)}function ta(e,t){let n=0,o=0,i=0,a=0;if("timeZone"in e)({hour:n,minute:o,second:i,millisecond:a}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:o,second:i,millisecond:a}=t),new nc(e.calendar,e.era,e.year,e.month,e.day,n,o,i,a)}function mn(e,t){if(d4(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),o=e.copy();return o.calendar=t,o.era=n.era,o.year=n.year,o.month=n.month,o.day=n.day,ai(o),o}function v4(e,t,n){if(e instanceof Ir)return e.timeZone===t?e:y4(e,t);let o=Dn(e,t,n);return Nn(o,t)}function b4(e){let t=ea(e)-e.offset;return new Date(t)}function y4(e,t){let n=ea(e)-e.offset;return mn(Nn(n,t),e.calendar)}const Ua=36e5;function Lc(e,t){let n=e.copy(),o="hour"in n?_4(n,t):0;Pu(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Vu(n),dw(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=o,x4(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,r;let l=(a=(r=n.calendar).isInverseEra)===null||a===void 0?void 0:a.call(r,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Pu(e,t){var n,o;!((n=(o=e.calendar).isInverseEra)===null||n===void 0)&&n.call(o,e)&&(t=-t),e.year+=t}function Vu(e){for(;e.month<1;)Pu(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Pu(e,1)}function x4(e){for(;e.day<1;)e.month--,Vu(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Vu(e)}function dw(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 ai(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),dw(e)}function uw(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function hw(e,t){return Lc(e,uw(t))}function rp(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),ai(n),n}function tc(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),C4(n),n}function w4(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=js(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=js(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=js(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=js(e.hour,24),t}function C4(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 js(e,t){let n=e%t;return n<0&&(n+=t),n}function _4(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,w4(e)}function sp(e,t,n,o){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),l=s.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=Ln(l,n,0,s.length-1,o?.round),i.era=s[l],ai(i);break}case"year":var a,r;!((a=(r=i.calendar).isInverseEra)===null||a===void 0)&&a.call(r,i)&&(n=-n),i.year=Ln(e.year,n,-1/0,9999,o?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=Ln(e.month,n,1,e.calendar.getMonthsInYear(e),o?.round);break;case"day":i.day=Ln(e.day,n,1,e.calendar.getDaysInMonth(e),o?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),ai(i),i}function pw(e,t,n,o){let i=e.copy();switch(t){case"hour":{let a=e.hour,r=0,s=23;if(o?.hourCycle===12){let l=a>=12;r=l?12:0,s=l?23:11}i.hour=Ln(a,n,r,s,o?.round);break}case"minute":i.minute=Ln(e.minute,n,0,59,o?.round);break;case"second":i.second=Ln(e.second,n,0,59,o?.round);break;case"millisecond":i.millisecond=Ln(e.millisecond,n,0,999,o?.round);break;default:throw new Error("Unsupported field "+t)}return i}function Ln(e,t,n,o,i=!1){if(i){e+=Math.sign(t),e<n&&(e=o);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>o&&(e=n)}else e+=t,e<n?e=o-(n-e-1):e>o&&(e=n+(e-o-1));return e}function fw(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 i=Lc(ta(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Dn(i,e.timeZone)}else n=ea(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let o=Nn(n,e.timeZone);return mn(o,e.calendar)}function $4(e,t){return fw(e,uw(t))}function k4(e,t,n,o){switch(t){case"hour":{let i=0,a=23;if(o?.hourCycle===12){let m=e.hour>=12;i=m?12:0,a=m?23:11}let r=ta(e),s=mn(tc(r,{hour:i}),new Qi),l=[Dn(s,e.timeZone,"earlier"),Dn(s,e.timeZone,"later")].filter(m=>Nn(m,e.timeZone).day===s.day)[0],c=mn(tc(r,{hour:a}),new Qi),d=[Dn(c,e.timeZone,"earlier"),Dn(c,e.timeZone,"later")].filter(m=>Nn(m,e.timeZone).day===c.day).pop(),u=ea(e)-e.offset,h=Math.floor(u/Ua),p=u%Ua;return u=Ln(h,n,Math.floor(l/Ua),Math.floor(d/Ua),o?.round)*Ua+p,mn(Nn(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return pw(e,t,n,o);case"era":case"year":case"month":case"day":{let i=sp(ta(e),t,n,o),a=Dn(i,e.timeZone);return mn(Nn(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function S4(e,t,n){let o=ta(e),i=tc(rp(o,t),t);if(i.compare(o)===0)return e;let a=Dn(i,e.timeZone,n);return mn(Nn(a,e.timeZone),e.calendar)}function E4(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 gw(e){let t=mn(e,new Qi),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 mw(e){return`${gw(e)}T${E4(e)}`}function O4(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),o=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return i!==0&&(a+=`:${String(i).padStart(2,"0")}`),a}function T4(e){return`${mw(e)}${O4(e.offset)}[${e.timeZone}]`}function I4(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lp(e,t,n){I4(e,t),t.set(e,n)}function cp(e){let t=typeof e[0]=="object"?e.shift():new Qi,n;if(typeof e[0]=="string")n=e.shift();else{let r=t.getEras();n=r[r.length-1]}let o=e.shift(),i=e.shift(),a=e.shift();return[t,n,o,i,a]}var P4=new WeakMap;class na{copy(){return this.era?new na(this.calendar,this.era,this.year,this.month,this.day):new na(this.calendar,this.year,this.month,this.day)}add(t){return Lc(this,t)}subtract(t){return hw(this,t)}set(t){return rp(this,t)}cycle(t,n,o){return sp(this,t,n,o)}toDate(t){return cw(this,t)}toString(){return gw(this)}compare(t){return rw(this,t)}constructor(...t){lp(this,P4,{writable:!0,value:void 0});let[n,o,i,a,r]=cp(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,ai(this)}}var V4=new WeakMap;class nc{copy(){return this.era?new nc(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new nc(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Lc(this,t)}subtract(t){return hw(this,t)}set(t){return rp(tc(this,t),t)}cycle(t,n,o){switch(t){case"era":case"year":case"month":case"day":return sp(this,t,n,o);default:return pw(this,t,n,o)}}toDate(t,n){return cw(this,t,n)}toString(){return mw(this)}compare(t){let n=rw(this,t);return n===0?p4(this,ta(t)):n}constructor(...t){lp(this,V4,{writable:!0,value:void 0});let[n,o,i,a,r]=cp(t);this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ai(this)}}var D4=new WeakMap;class Ir{copy(){return this.era?new Ir(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Ir(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return fw(this,t)}subtract(t){return $4(this,t)}set(t,n){return S4(this,t,n)}cycle(t,n,o){return k4(this,t,n,o)}toDate(){return b4(this)}toString(){return T4(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-v4(t,this.timeZone).toDate().getTime()}constructor(...t){lp(this,D4,{writable:!0,value:void 0});let[n,o,i,a,r]=cp(t),s=t.shift(),l=t.shift();this.calendar=n,this.era=o,this.year=i,this.month=a,this.day=r,this.timeZone=s,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ai(this)}}const M4=E({__name:"Date",props:{field:{},property:{}},setup(e){const t=ap(),n=T(()=>e.property?.ui),o=T(()=>h4(t)),i=T(()=>o.value.add({days:n.value?.min??0})),a=T(()=>o.value.add({days:n.value?.max??0})),r=T(()=>o.value.add({days:n.value?.default??0})),s=h=>{const p=h;return p.compare(i.value)<0||p.compare(a.value)>0},l=h=>{const p=parseInt(h,10);if(!p)return null;const m=new Date(p*1e3);return new na(m.getUTCFullYear(),m.getUTCMonth()+1,m.getUTCDate())},c=h=>Math.floor(h.toDate("UTC").getTime()/1e3).toString(),d=T(()=>{const h=e.field.state.value;if(!h||parseInt(h,10)===0)return[];const p=l(h);return p?[p]:[]}),u=h=>{const[p]=h.value;p&&(e.field.handleChange(c(p)),e.field.handleBlur())};return Dr(()=>{const h=e.field.state.value;(!h||parseInt(h,10)===0)&&(e.field.handleChange(c(r.value)),e.field.handleBlur())}),(h,p)=>(w(),S(v(fA),{"model-value":v(d),"is-date-unavailable":s,"data-test-id":e.property?.id,onValueChange:u},null,8,["model-value","data-test-id"]))}}),R4=Object.assign(M4,{__name:"Date"}),A4=E({__name:"InputNumber",props:{field:{},property:{}},setup(e){const t=e.field.state.value,n=he((()=>{if(t==null||t==="")return"";const i=typeof t=="string"?parseFloat(t):t;return isNaN(i)?"":String(i)})()),o=i=>{n.value=i;const a=parseFloat(i);e.field.handleChange(isNaN(a)?void 0:a),e.field.handleBlur()};return(i,a)=>(w(),S(v(LA),{"model-value":v(n),min:e.property?.ui?.min,max:e.property?.ui?.max,step:e.property?.ui?.step,disabled:e.property?.ui?.disabled,"data-test-id":e.property?.id,class:"w-full","onUpdate:modelValue":o},null,8,["model-value","min","max","step","disabled","data-test-id"]))}}),F4=Object.assign(A4,{__name:"InputNumber"}),N4={key:0,class:"text-red-500"},L4={class:"max-h-[300px] overflow-y-auto overflow-x-hidden pr-1"},B4=["data-test-id"],z4={class:"flex-grow max-w-[calc(100%-30px)]"},H4={key:0,class:"absolute right-0 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer p-1"},j4={class:"flex justify-center"},W4=E({__name:"InputRepeater",props:{property:{}},setup(e){const t=st(Dt),n=B5(),o=d=>{const u=new Set;return d.filter(h=>h.trim()===""?!0:u.has(h.trim())?!1:(u.add(h.trim()),!0))},i=d=>{const u=e.property.ui.maxItems;u!==void 0&&d.state.value.length>=u||(d.pushValue(""),po(()=>{const h=n.value[d.state.value.length-1];h&&h.focus()}))},a=(d,u)=>{const h=e.property.ui.minItems??1;d.state.value.length>h&&d.removeValue(u)},r=(d,u)=>{u===d.state.value.length-1&&i(d)},s=(d,u,h)=>{h.preventDefault();const m=(h.clipboardData?.getData("text")??"").split(/\r?\n|\r|,/).map(g=>g.trim()).filter(g=>g.length>0);if(m.length===0)return;const f=[...d.state.value];f.splice(u,1,...m);const b=o(f);t.setFieldValue(e.property.id,b)},l=(d,u,h)=>{const p=[...d.state.value];p[u]=h,t.setFieldValue(e.property.id,p)},c=d=>e.property.ui.maxItems!==void 0&&d.state.value.length>=e.property.ui.maxItems;return(d,u)=>(w(),S(v(t).Field,{name:e.property.id,mode:"array"},{default:_(({field:h})=>[U("div",null,[U("div",null,[z(v(Hh),null,{default:_(()=>[Te(oe(e.property.ui?.label)+" ",1),e.property?.required?(w(),H("span",N4," * ")):te("",!0)]),_:1})]),U("div",L4,[(w(!0),H(we,null,Oe(h.state.value,(p,m)=>(w(),H("div",{key:m,"data-test-id":e.property.id,class:"relative flex items-center justify-between group mb-4"},[U("div",z4,[z(v(zh),{ref_for:!0,ref:v(n).set,"model-value":h.state.value[m],placeholder:e.property.ui?.placeholder,"onUpdate:modelValue":f=>l(h,m,f),onFocus:()=>r(h,m),onPaste:f=>s(h,m,f),onKeydown:Ad(mr(()=>i(h),["prevent"]),["enter"])},null,8,["model-value","placeholder","onUpdate:modelValue","onFocus","onPaste","onKeydown"])]),h.state.value.length>(e.property.ui.minItems??1)?(w(),H("div",H4,[z(v(q6),{class:"w-4 h-4 text-gray-400 hover:text-red-500",onClick:()=>a(h,m)},null,8,["onClick"])])):te("",!0)],8,B4))),128))]),U("div",j4,[z(v(Xt),{type:"default",label:`Add to ${e.property.ui.label}`,disabled:c(h),onClick:()=>i(h)},null,8,["label","disabled","onClick"])])])]),_:1},8,["name"]))}}),U4=Object.assign(W4,{__name:"InputRepeater"}),G4=E({__name:"Evaluate",props:{property:{}},setup(e){const t=st(Dt),n=T(()=>e.property.ui?.value);return L5(n,()=>{t?.setFieldValue(e.property.id,n.value)},{immediate:!0}),(o,i)=>(w(),S(gt(null)))}}),q4=Object.assign(G4,{__name:"Evaluate"});function Wo(){return Wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Wo.apply(this,arguments)}function Y4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Pr(e,t)}function Du(e){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Du(e)}function Pr(e,t){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,i){return o.__proto__=i,o},Pr(e,t)}function K4(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _l(e,t,n){return K4()?_l=Reflect.construct.bind():_l=function(i,a,r){var s=[null];s.push.apply(s,a);var l=Function.bind.apply(i,s),c=new l;return r&&Pr(c,r.prototype),c},_l.apply(null,arguments)}function X4(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Mu(e){var t=typeof Map=="function"?new Map:void 0;return Mu=function(o){if(o===null||!X4(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(o))return t.get(o);t.set(o,i)}function i(){return _l(o,arguments,Du(this).constructor)}return i.prototype=Object.create(o.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Pr(i,o)},Mu(e)}var Z4=/%[sdj%]/g,J4=function(){};function Ru(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var o=n.field;t[o]=t[o]||[],t[o].push(n)}),t}function kt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=0,a=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var r=e.replace(Z4,function(s){if(s==="%%")return"%";if(i>=a)return s;switch(s){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return s}});return r}return e}function Q4(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function je(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Q4(t)&&typeof e=="string"&&!e)}function e8(e,t,n){var o=[],i=0,a=e.length;function r(s){o.push.apply(o,s||[]),i++,i===a&&n(o)}e.forEach(function(s){t(s,r)})}function vv(e,t,n){var o=0,i=e.length;function a(r){if(r&&r.length){n(r);return}var s=o;o=o+1,s<i?t(e[s],a):n([])}a([])}function t8(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n]||[])}),t}var bv=function(e){Y4(t,e);function t(n,o){var i;return i=e.call(this,"Async Validation Error")||this,i.errors=n,i.fields=o,i}return t}(Mu(Error));function n8(e,t,n,o,i){if(t.first){var a=new Promise(function(h,p){var m=function(g){return o(g),g.length?p(new bv(g,Ru(g))):h(i)},f=t8(e);vv(f,n,m)});return a.catch(function(h){return h}),a}var r=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),l=s.length,c=0,d=[],u=new Promise(function(h,p){var m=function(b){if(d.push.apply(d,b),c++,c===l)return o(d),d.length?p(new bv(d,Ru(d))):h(i)};s.length||(o(d),h(i)),s.forEach(function(f){var b=e[f];r.indexOf(f)!==-1?vv(b,n,m):e8(b,n,m)})});return u.catch(function(h){return h}),u}function o8(e){return!!(e&&e.message!==void 0)}function i8(e,t){for(var n=e,o=0;o<t.length;o++){if(n==null)return n;n=n[t[o]]}return n}function yv(e,t){return function(n){var o;return e.fullFields?o=i8(t,e.fullFields):o=t[n.field||e.fullField],o8(n)?(n.field=n.field||e.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||e.fullField}}}function xv(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];typeof o=="object"&&typeof e[n]=="object"?e[n]=Wo({},e[n],o):e[n]=o}}return e}var vw=function(t,n,o,i,a,r){t.required&&(!o.hasOwnProperty(t.field)||je(n,r||t.type))&&i.push(kt(a.messages.required,t.fullField))},a8=function(t,n,o,i,a){(/^\s+$/.test(n)||n==="")&&i.push(kt(a.messages.whitespace,t.fullField))},Ws,r8=function(){if(Ws)return Ws;var e="[a-fA-F\\d:]",t=function(C){return C&&C.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",i=(`
|
|
23
23
|
(?:
|
|
24
24
|
(?:`+o+":){7}(?:"+o+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
25
25
|
(?:`+o+":){6}(?:"+n+"|:"+o+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
@@ -30,4 +30,4 @@ ${u}`)}).finally(()=>{n.set("transforming",!1)})):c(s)},removeFile({context:e,ev
|
|
|
30
30
|
(?:`+o+":){1}(?:(?::"+o+"){0,4}:"+n+"|(?::"+o+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
31
31
|
(?::(?:(?::`+o+"){0,5}:"+n+"|(?::"+o+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
32
32
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
33
|
-
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+n+"$)|(?:^"+i+"$)"),r=new RegExp("^"+n+"$"),s=new RegExp("^"+i+"$"),l=function(C){return C&&C.exact?a:new RegExp("(?:"+t(C)+n+t(C)+")|(?:"+t(C)+i+t(C)+")","g")};l.v4=function(x){return x&&x.exact?r:new RegExp(""+t(x)+n+t(x),"g")},l.v6=function(x){return x&&x.exact?s:new RegExp(""+t(x)+i+t(x),"g")};var c="(?:(?:[a-z]+:)?//)",d="(?:\\S+(?::\\S*)?@)?",u=l.v4().source,h=l.v6().source,p="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",m="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",f="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",b="(?::\\d{2,5})?",g='(?:[/?#][^\\s"]*)?',y="(?:"+c+"|www\\.)"+d+"(?:localhost|"+u+"|"+h+"|"+p+m+f+")"+b+g;return Ws=new RegExp("(?:^"+y+"$)","i"),Ws},wv={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},er={integer:function(t){return er.number(t)&&parseInt(t,10)===t},float:function(t){return er.number(t)&&!er.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!er.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(wv.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(r8())},hex:function(t){return typeof t=="string"&&!!t.match(wv.hex)}},s8=function(t,n,o,i,a){if(t.required&&n===void 0){vw(t,n,o,i,a);return}var r=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=t.type;r.indexOf(s)>-1?er[s](n)||i.push(kt(a.messages.types[s],t.fullField,t.type)):s&&typeof n!==t.type&&i.push(kt(a.messages.types[s],t.fullField,t.type))},l8=function(t,n,o,i,a){var r=typeof t.len=="number",s=typeof t.min=="number",l=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=n,u=null,h=typeof n=="number",p=typeof n=="string",m=Array.isArray(n);if(h?u="number":p?u="string":m&&(u="array"),!u)return!1;m&&(d=n.length),p&&(d=n.replace(c,"_").length),r?d!==t.len&&i.push(kt(a.messages[u].len,t.fullField,t.len)):s&&!l&&d<t.min?i.push(kt(a.messages[u].min,t.fullField,t.min)):l&&!s&&d>t.max?i.push(kt(a.messages[u].max,t.fullField,t.max)):s&&l&&(d<t.min||d>t.max)&&i.push(kt(a.messages[u].range,t.fullField,t.min,t.max))},ki="enum",c8=function(t,n,o,i,a){t[ki]=Array.isArray(t[ki])?t[ki]:[],t[ki].indexOf(n)===-1&&i.push(kt(a.messages[ki],t.fullField,t[ki].join(", ")))},d8=function(t,n,o,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(kt(a.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var r=new RegExp(t.pattern);r.test(n)||i.push(kt(a.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},fe={required:vw,whitespace:a8,type:s8,range:l8,enum:c8,pattern:d8},u8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n,"string")&&!t.required)return o();fe.required(t,n,i,r,a,"string"),je(n,"string")||(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a),fe.pattern(t,n,i,r,a),t.whitespace===!0&&fe.whitespace(t,n,i,r,a))}o(r)},h8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe.type(t,n,i,r,a)}o(r)},p8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(n===""&&(n=void 0),je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},f8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe.type(t,n,i,r,a)}o(r)},g8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),je(n)||fe.type(t,n,i,r,a)}o(r)},m8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},v8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},b8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(n==null&&!t.required)return o();fe.required(t,n,i,r,a,"array"),n!=null&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},y8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe.type(t,n,i,r,a)}o(r)},x8="enum",w8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe[x8](t,n,i,r,a)}o(r)},C8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n,"string")&&!t.required)return o();fe.required(t,n,i,r,a),je(n,"string")||fe.pattern(t,n,i,r,a)}o(r)},_8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n,"date")&&!t.required)return o();if(fe.required(t,n,i,r,a),!je(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),fe.type(t,l,i,r,a),l&&fe.range(t,l.getTime(),i,r,a)}}o(r)},$8=function(t,n,o,i,a){var r=[],s=Array.isArray(n)?"array":typeof n;fe.required(t,n,i,r,a,s),o(r)},Dd=function(t,n,o,i,a){var r=t.type,s=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(je(n,r)&&!t.required)return o();fe.required(t,n,i,s,a,r),je(n,r)||fe.type(t,n,i,s,a)}o(s)},k8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a)}o(r)},fr={string:u8,method:h8,number:p8,boolean:f8,regexp:g8,integer:m8,float:v8,array:b8,object:y8,enum:w8,pattern:C8,date:_8,url:Dd,hex:Dd,email:Dd,required:$8,any:k8};function Au(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Fu=Au(),ts=function(){function e(n){this.rules=null,this._messages=Fu,this.define(n)}var t=e.prototype;return t.define=function(o){var i=this;if(!o)throw new Error("Cannot configure a schema with no rules");if(typeof o!="object"||Array.isArray(o))throw new Error("Rules must be an object");this.rules={},Object.keys(o).forEach(function(a){var r=o[a];i.rules[a]=Array.isArray(r)?r:[r]})},t.messages=function(o){return o&&(this._messages=xv(Au(),o)),this._messages},t.validate=function(o,i,a){var r=this;i===void 0&&(i={}),a===void 0&&(a=function(){});var s=o,l=i,c=a;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,s),Promise.resolve(s);function d(f){var b=[],g={};function y(C){if(Array.isArray(C)){var k;b=(k=b).concat.apply(k,C)}else b.push(C)}for(var x=0;x<f.length;x++)y(f[x]);b.length?(g=Ru(b),c(b,g)):c(null,s)}if(l.messages){var u=this.messages();u===Fu&&(u=Au()),xv(u,l.messages),l.messages=u}else l.messages=this.messages();var h={},p=l.keys||Object.keys(this.rules);p.forEach(function(f){var b=r.rules[f],g=s[f];b.forEach(function(y){var x=y;typeof x.transform=="function"&&(s===o&&(s=Wo({},s)),g=s[f]=x.transform(g)),typeof x=="function"?x={validator:x}:x=Wo({},x),x.validator=r.getValidationMethod(x),x.validator&&(x.field=f,x.fullField=x.fullField||f,x.type=r.getType(x),h[f]=h[f]||[],h[f].push({rule:x,value:g,source:s,field:f}))})});var m={};return n8(h,l,function(f,b){var g=f.rule,y=(g.type==="object"||g.type==="array")&&(typeof g.fields=="object"||typeof g.defaultField=="object");y=y&&(g.required||!g.required&&f.value),g.field=f.field;function x(O,P){return Wo({},P,{fullField:g.fullField+"."+O,fullFields:g.fullFields?[].concat(g.fullFields,[O]):[O]})}function C(O){O===void 0&&(O=[]);var P=Array.isArray(O)?O:[O];!l.suppressWarning&&P.length&&e.warning("async-validator:",P),P.length&&g.message!==void 0&&(P=[].concat(g.message));var $=P.map(yv(g,s));if(l.first&&$.length)return m[g.field]=1,b($);if(!y)b($);else{if(g.required&&!f.value)return g.message!==void 0?$=[].concat(g.message).map(yv(g,s)):l.error&&($=[l.error(g,kt(l.messages.required,g.field))]),b($);var I={};g.defaultField&&Object.keys(f.value).map(function(j){I[j]=g.defaultField}),I=Wo({},I,f.rule.fields);var A={};Object.keys(I).forEach(function(j){var Q=I[j],N=Array.isArray(Q)?Q:[Q];A[j]=N.map(x.bind(null,j))});var M=new e(A);M.messages(l.messages),f.rule.options&&(f.rule.options.messages=l.messages,f.rule.options.error=l.error),M.validate(f.value,f.rule.options||l,function(j){var Q=[];$&&$.length&&Q.push.apply(Q,$),j&&j.length&&Q.push.apply(Q,j),b(Q.length?Q:null)})}}var k;if(g.asyncValidator)k=g.asyncValidator(g,f.value,C,f.source,l);else if(g.validator){try{k=g.validator(g,f.value,C,f.source,l)}catch(O){console.error?.(O),l.suppressValidatorError||setTimeout(function(){throw O},0),C(O.message)}k===!0?C():k===!1?C(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):k instanceof Array?C(k):k instanceof Error&&C(k.message)}k&&k.then&&k.then(function(){return C()},function(O){return C(O)})},function(f){d(f)},s)},t.getType=function(o){if(o.type===void 0&&o.pattern instanceof RegExp&&(o.type="pattern"),typeof o.validator!="function"&&o.type&&!fr.hasOwnProperty(o.type))throw new Error(kt("Unknown rule type %s",o.type));return o.type||"string"},t.getValidationMethod=function(o){if(typeof o.validator=="function")return o.validator;var i=Object.keys(o),a=i.indexOf("message");return a!==-1&&i.splice(a,1),i.length===1&&i[0]==="required"?fr.required:fr[this.getType(o)]||void 0},e}();ts.register=function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");fr[t]=n};ts.warning=J4;ts.messages=Fu;ts.validators=fr;function S8(e){const t=new ts({[e.id]:e.ui?.rules??[]});return{onBlurAsync:async({value:n})=>{try{await t.validate({[e.id]:n})}catch({errors:o}){return o[0].message}}}}const E8={class:"grid grid-cols-8 gap-x-4 gap-y-4"},O8={key:0,class:"text-red-500"},T8={key:1,class:"text-red-500 text-xs"},I8=E({__name:"DynamicForm",props:{configMap:{},baseKey:{},currentStep:{}},setup(e,{expose:t}){const n=st(Dt),o=n.useStore(p=>yo(p.values)),i=(p=8,m,f)=>{let b=`col-span-${p}`;return m&&(b+=` col-start-${m}`),f&&(b+=` col-start-${m}`),b},a=p=>e.baseKey?`${e.baseKey}.${p}`:p,r=T(()=>{const p=JSON.parse(JSON.stringify(e.configMap));if(p.anyOf){p.anyOf.forEach(f=>{f.required.forEach(b=>{p.properties&&p.properties[b]&&(p.properties[b].ui.hidden=!0)})});const m=[];p.anyOf.forEach(f=>{Object.keys(f.properties).every(g=>{if(o.value[a(g)]?.toString()===f.properties[g]?.const?.toString())return!0})&&m.push(f)}),m.length>0&&m.forEach(f=>{f.required.forEach(b=>{p.properties&&p.properties[b]&&(p.properties[b].ui.hidden=!1)})})}return p}),s=p=>{const m=r.value?.properties[p];let f={id:a(p),name:a(p)};if(m.type==="conditional"){const{conditions:b,...g}=m,y=b?.find(x=>x.regex?new RegExp(x.regex).test(o.value[x.property]):o.value[x.property]===x.value);f={...f,...g,...y}}else f={...f,...m};return f},l=T(()=>{{const p=[];return r.value?.properties&&(e.currentStep?.properties?e.currentStep.properties.forEach(m=>{Object.keys(r?.value?.properties).find(b=>b===m)&&(r.value?.properties[m].ui?.hidden||p.push(s(m)))}):Object.keys(r?.value?.properties).forEach(m=>{r.value?.properties[m].ui?.hidden||p.push(s(m))})),p}}),c=["credential","nested","connection","sage","Repeater","agent","advancedJdbcUrlGroup","jdbcurlgroup","nestedcollapse","inputrepeater"],d=["evaluate"],u=p=>{if(p.ui?.widget)switch(p.ui?.widget?.toLowerCase()){case"divider":return"hr";case"header":return"h5";case"radio":return UB;case"credential":return h6;case"nested":return f6;case"input":return Td;case"password":return m6;case"select":return b6;case"sqltree":return x6;case"apitree":return C6;case"sage":case"sagev2":return M6;case"connection":return A6;case"fileupload":return B6;case"repeater":return J6;case"connectionselector":return e5;case"switcher":return n5;case"agent":return C5;case"agentselector":return $5;case"advancedjdbcurlgroup":return X5;case"jdbcurlgroup":return J5;case"nestedcollapse":return e4;case"apiselect":return n4;case"checkbox":return s4;case"date":return R4;case"inputnumber":return F4;case"inputrepeater":return U4;case"evaluate":return q4;default:return p.ui.widget}else switch(p.type){case"string":case"number":return Td;case"boolean":return jB;case"array":return"Select";case"object":return"Form";case"code":return"CodeBlock";case"banner":return"Banner";default:return Td}};async function h(){if(await n.handleSubmit(),!n.state.isValid)throw new Error("Form is invalid");return n.state.values}return t({validate:h}),(p,m)=>(w(),H("div",E8,[(w(!0),H(we,null,Oe(v(l),f=>(w(),H(we,{key:`${f.id}`},[f.ui?.hidden?te("",!0):(w(),H("div",{key:0,class:R(i(f.ui?.grid,f.ui?.start,f.ui?.end))},[c.includes(f?.ui?.widget)?(w(),S(gt(u(f)),{key:0,property:f},null,8,["property"])):d.includes(f?.ui?.widget)?(w(),S(gt(u(f)),{key:1,property:f},null,8,["property"])):(w(),S(v(n).Field,{key:2,name:f.id,validators:v(S8)(f)},{default:_(({field:b})=>[f.ui?.label?(w(),S(v(Hh),{key:0},{default:_(()=>[Te(oe(f.ui?.label)+" ",1),f?.required?(w(),H("span",O8," * ")):te("",!0)]),_:2},1024)):te("",!0),(w(),S(gt(u(f)),{field:b,"base-key":e.baseKey,property:f},null,8,["field","base-key","property"])),b.state.meta.isTouched&&!b.state.meta.isValid?(w(),H("span",T8,oe(b.state.meta.errors.join(", ")),1)):te("",!0)]),_:2},1032,["name","validators"]))],2))],64))),128))]))}}),bw=Object.assign(I8,{__name:"DynamicForm"}),ko=Object.freeze(Object.defineProperty({__proto__:null,default:bw},Symbol.toStringTag,{value:"Module"})),ji=new WeakMap,$l=new WeakMap,oc={current:[]};let Md=!1,gr=0;const tr=new Set,Us=new Map;function yw(e){const t=Array.from(e).sort((n,o)=>n instanceof Hn&&n.options.deps.includes(o)?1:o instanceof Hn&&o.options.deps.includes(n)?-1:0);for(const n of t){if(oc.current.includes(n))continue;oc.current.push(n),n.recompute();const o=$l.get(n);if(o)for(const i of o){const a=ji.get(i);a&&yw(a)}}}function P8(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function V8(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function xw(e){if(gr>0&&!Us.has(e)&&Us.set(e,e.prevState),tr.add(e),!(gr>0)&&!Md)try{for(Md=!0;tr.size>0;){const t=Array.from(tr);tr.clear();for(const n of t){const o=Us.get(n)??n.prevState;n.prevState=o,P8(n)}for(const n of t){const o=ji.get(n);o&&(oc.current.push(n),yw(o))}for(const n of t){const o=ji.get(n);if(o)for(const i of o)V8(i)}}}finally{Md=!1,oc.current=[],Us.clear()}}function dn(e){gr++;try{e()}finally{if(gr--,gr===0){const t=tr.values().next().value;t&&xw(t)}}}function D8(e){return typeof e=="function"}class ic{constructor(t,n){this.listeners=new Set,this.subscribe=o=>{var i,a;this.listeners.add(o);const r=(a=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:a.call(i,o,this);return()=>{this.listeners.delete(o),r?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,o,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):D8(t)?this.state=t(this.prevState):this.state=t,(i=(o=this.options)==null?void 0:o.onUpdate)==null||i.call(o),xw(this)}}class Hn{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=this.options.deps.length,o=new Array(n),i=new Array(n);for(let a=0;a<n;a++){const r=this.options.deps[a];o[a]=r.prevState,i[a]=r.state}return this.lastSeenDepValues=i,{prevDepVals:o,currDepVals:i,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,o;this.prevState=this.state;const i=this.getDepVals();this.state=this.options.fn(i),(o=(n=this.options).onUpdate)==null||o.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const a of this.options.deps)a instanceof Hn&&a.checkIfRecalculationNeededDeeply();let n=!1;const o=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let a=0;a<i.length;a++)if(i[a]!==o[a]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var o,i;this.listeners.add(n);const a=(i=(o=this.options).onSubscribe)==null?void 0:i.call(o,n,this);return()=>{this.listeners.delete(n),a?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const n of t)if(n instanceof Hn)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof ic){let o=ji.get(n);o||(o=new Set,ji.set(n,o)),o.add(this);let i=$l.get(this);i||(i=new Set,$l.set(this,i)),i.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof Hn)this.unregisterFromGraph(n.options.deps);else if(n instanceof ic){const o=ji.get(n);o&&o.delete(this);const i=$l.get(this);i&&i.delete(n)}}}function M8(e){return typeof e=="function"}function Cv(e,...t){return M8(e)?e(...t):e}function R8(e){return e||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"")}class ww{#n=!0;#e;#t;#a;#o;#i;#r;#s;#c=0;#u=5;#d=()=>{this.debugLog("Connected to event bus"),this.#i=!0,this.debugLog("Emitting queued events",this.#o),this.#o.forEach(t=>this.emitEventToBus(t)),this.#o=[],this.stopConnectLoop(),this.#t().removeEventListener("tanstack-connect-success",this.#d)};#l=()=>{if(this.#t().addEventListener("tanstack-connect-success",this.#d),this.#c<this.#u){this.#c++,this.dispatchCustomEvent("tanstack-connect",{});return}this.#t().removeEventListener("tanstack-connect",this.#l),this.debugLog("Max retries reached, giving up on connection"),this.stopConnectLoop()};constructor({pluginId:t,debug:n=!1,enabled:o=!0,reconnectEveryMs:i=1e3}){this.#e=t,this.#n=o,this.#t=this.getGlobalTarget,this.#a=n,this.debugLog(" Initializing event subscription for plugin",this.#e),this.#o=[],this.#i=!1,this.#r=null,this.#s=i}startConnectLoop(){this.#r!==null||this.#i||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#r=setInterval(this.#l,this.#s))}stopConnectLoop(){this.#r!==null&&(clearInterval(this.#r),this.#r=null,this.debugLog("Stopped connect loop"))}debugLog(...t){this.#a&&console.log(`🌴 [tanstack-devtools:${this.#e}-plugin]`,...t)}getGlobalTarget(){if(typeof globalThis<"u"&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog("Using global event target"),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<"u"&&typeof window.addEventListener<"u")return this.debugLog("Using window as event target"),window;const t=typeof EventTarget<"u"?new EventTarget:void 0;return typeof t>"u"||typeof t.addEventListener>"u"?(this.debugLog("No event mechanism available, running in non-web environment"),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog("Using new EventTarget as fallback"),t)}getPluginId(){return this.#e}dispatchCustomEventShim(t,n){try{const o=new Event(t,{detail:n});this.#t().dispatchEvent(o)}catch{this.debugLog("Failed to dispatch shim event")}}dispatchCustomEvent(t,n){try{this.#t().dispatchEvent(new CustomEvent(t,{detail:n}))}catch{this.dispatchCustomEventShim(t,n)}}emitEventToBus(t){this.debugLog("Emitting event to client bus",t),this.dispatchCustomEvent("tanstack-dispatch-event",t)}emit(t,n){if(!this.#n){this.debugLog("Event bus client is disabled, not emitting event",t,n);return}if(!this.#i){this.debugLog("Bus not available, will be pushed as soon as connected"),this.#o.push({type:`${this.#e}:${t}`,payload:n,pluginId:this.#e}),typeof CustomEvent<"u"&&(this.#l(),this.startConnectLoop());return}return this.emitEventToBus({type:`${this.#e}:${t}`,payload:n,pluginId:this.#e})}on(t,n){const o=`${this.#e}:${t}`;if(!this.#n)return this.debugLog("Event bus client is disabled, not registering event",o),()=>{};const i=a=>{this.debugLog("Received event from bus",a.detail),n(a.detail)};return this.#t().addEventListener(o,i),this.debugLog("Registered event to bus",o),()=>{this.#t().removeEventListener(o,i)}}onAll(t){if(!this.#n)return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const n=o=>{const i=o.detail;t(i)};return this.#t().addEventListener("tanstack-devtools-global",n),()=>this.#t().removeEventListener("tanstack-devtools-global",n)}onAllPluginEvents(t){if(!this.#n)return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const n=o=>{const i=o.detail;this.#e&&i.pluginId!==this.#e||t(i)};return this.#t().addEventListener("tanstack-devtools-global",n),()=>this.#t().removeEventListener("tanstack-devtools-global",n)}}class A8 extends ww{constructor(t){super({pluginId:"pacer",debug:t?.debug})}}const F8=(e,t)=>{Cw.emit(e,t)},Cw=new A8;function _v(){return{executionCount:0,isPending:!1,lastArgs:void 0,lastExecutionTime:0,nextExecutionTime:0,status:"idle",maybeExecuteCount:0}}const N8={enabled:!0,leading:!0,trailing:!0,wait:0};class L8{constructor(t,n){this.fn=t,this.store=new ic(_v()),this.setOptions=o=>{this.options={...this.options,...o},this.#t()||this.cancel()},this.#e=o=>{this.store.setState(i=>{const a={...i,...o},{isPending:r}=a;return{...a,status:this.#t()?r?"pending":"idle":"disabled"}}),F8("Throttler",this)},this.#t=()=>!!Cv(this.options.enabled,this),this.#a=()=>Cv(this.options.wait,this),this.maybeExecute=(...o)=>{this.#e({maybeExecuteCount:this.store.state.maybeExecuteCount+1});const i=Date.now(),a=i-this.store.state.lastExecutionTime,r=this.#a();if(this.options.leading&&a>=r)this.#o(...o);else if(this.#e({lastArgs:o}),!this.#n&&this.options.trailing){const s=this.store.state.lastExecutionTime?i-this.store.state.lastExecutionTime:0,l=r-s;this.#e({isPending:!0}),this.#n=setTimeout(()=>{const{lastArgs:c}=this.store.state;c!==void 0&&this.#o(...c)},l)}},this.#o=(...o)=>{if(!this.#t())return;this.fn(...o);const i=Date.now(),a=i+this.#a();this.#i(),this.#e({executionCount:this.store.state.executionCount+1,lastExecutionTime:i,nextExecutionTime:a,isPending:!1,lastArgs:void 0}),this.options.onExecute?.(o,this),setTimeout(()=>{this.store.state.isPending||this.#e({nextExecutionTime:void 0})},this.#a())},this.flush=()=>{this.store.state.isPending&&this.store.state.lastArgs&&this.#o(...this.store.state.lastArgs)},this.#i=()=>{this.#n&&(clearTimeout(this.#n),this.#n=void 0)},this.cancel=()=>{this.#i(),this.#e({lastArgs:void 0,isPending:!1})},this.reset=()=>{this.#e(_v())},this.key=R8(n.key),this.options={...N8,...n},this.#e(this.options.initialState??{}),Cw.on("d-Throttler",o=>{o.payload.key===this.key&&(this.#e(o.payload.store.state),this.setOptions(o.payload.options))})}#n;#e;#t;#a;#o;#i}function B8(e,t){return new L8(e,t).maybeExecute}function _w(e,t){return typeof e=="function"?e(t):e}function nr(e,t){return dp(t).reduce((o,i)=>{if(o===null)return null;if(typeof o<"u")return o[i]},e)}function Gs(e,t,n){const o=dp(t);function i(a){if(!o.length)return _w(n,a);const r=o.shift();if(typeof r=="string"||typeof r=="number"&&!Array.isArray(a))return typeof a=="object"?(a===null&&(a={}),{...a,[r]:i(a[r])}):{[r]:i()};if(Array.isArray(a)&&typeof r=="number"){const s=a.slice(0,r);return[...s.length?s:new Array(r),i(a[r]),...a.slice(r+1)]}return[...new Array(r),i()]}return i(e)}function z8(e,t){const n=dp(t);function o(i){if(!i)return;if(n.length===1){const r=n[0];if(Array.isArray(i)&&typeof r=="number")return i.filter((c,d)=>d!==r);const{[r]:s,...l}=i;return l}const a=n.shift();if(typeof a=="string"&&typeof i=="object")return{...i,[a]:o(i[a])};if(typeof a=="number"&&Array.isArray(i)){if(a>=i.length)return i;const r=i.slice(0,a);return[...r.length?r:new Array(a),o(i[a]),...i.slice(a+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return o(e)}const H8=/^(\d+)$/gm,j8=/\.(\d+)(?=\.)/gm,W8=/^(\d+)\./gm,U8=/\.(\d+$)/gm,G8=/\.{2,}/gm,Nu="__int__",qs=`${Nu}$1`;function dp(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replace(/(^\[)|]/gm,"").replace(/\[/g,".").replace(H8,qs).replace(j8,`.${qs}.`).replace(W8,`${qs}.`).replace(U8,`.${qs}`).replace(G8,".").split(".").map(t=>{if(t.startsWith(Nu)){const n=t.substring(Nu.length),o=parseInt(n,10);return String(o)===n?o:n}return t})}function q8(e){return!(Array.isArray(e)&&e.length===0)}function Lu(e,t){const n=o=>o.validators.filter(Boolean).map(i=>({cause:i.cause,validate:i.fn}));return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!1},runValidation:n})}function Bu(e,t){const{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:o,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},r=n??0,s=l=>l.validators.filter(Boolean).map(c=>{const d=c?.cause||e;let u=r;switch(d){case"change":u=i??r;break;case"blur":u=o??r;break;case"dynamic":u=a??r;break;case"submit":u=0;break}return e==="submit"&&(u=0),{cause:d,validate:c.fn,debounceMs:u}});return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!0},runValidation:s})}const zu=e=>!!e&&typeof e=="object"&&"fields"in e;function Di(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,a]of e)if(!t.has(i)||!Object.is(a,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const i of n)if(!o.includes(i)||!Di(e[i],t[i]))return!1;return!0}const $v=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:"form"}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:"field"}:{newErrorValue:void 0,newSource:void 0},kv=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:"field"}:e?{newErrorValue:e,newSource:"form"}:{newErrorValue:void 0,newSource:void 0};function ht(e,t){return e==null?t:{...e,...t}}let Uo=256;const kl=[];let Ys;for(;Uo--;)kl[Uo]=(Uo+256).toString(16).substring(1);function Y8(){let e=0,t,n="";if(!Ys||Uo+16>256){for(Ys=new Array(256),e=256;e--;)Ys[e]=256*Math.random()|0;e=0,Uo=0}for(;e<16;e++)t=Ys[Uo+e],e===6?n+=kl[t&15|64]:e===8?n+=kl[t&63|128]:n+=kl[t],e&1&&e>1&&e<11&&(n+="-");return Uo++,n}const Li=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});const t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:"mount"},o={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:"change"},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:"blur"},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:"submit"},r=t?void 0:{fn:()=>{},cause:"server"};switch(e.event.type){case"mount":return e.runValidation({validators:[n],form:e.form});case"submit":return e.runValidation({validators:[o,i,a,r],form:e.form});case"server":return e.runValidation({validators:[],form:e.form});case"blur":return e.runValidation({validators:[i,r],form:e.form});case"change":return e.runValidation({validators:[o,r],form:e.form});default:throw new Error(`Unknown validation event type: ${e.event.type}`)}};function K8(e,t){const n=new Map;for(const o of e){const i=o.path??[];let a=t,r="";for(let s=0;s<i.length;s++){const l=i[s];if(l===void 0)continue;const c=typeof l=="object"?l.key:l,d=Number(c);Array.isArray(a)&&!Number.isNaN(d)?r+=`[${d}]`:r+=(s>0?".":"")+String(c),typeof a=="object"&&a!==null?a=a[c]:a=void 0}n.set(r,(n.get(r)??[]).concat(o))}return Object.fromEntries(n)}const Sv=(e,t)=>{const n=K8(e,t);return{form:n,fields:n}},Wi={validate({value:e,validationSource:t},n){const o=n["~standard"].validate(e);if(o instanceof Promise)throw new Error("async function passed to sync validator");if(o.issues)return t==="field"?o.issues:Sv(o.issues,e)},async validateAsync({value:e,validationSource:t},n){const o=await n["~standard"].validate(e);if(o.issues)return t==="field"?o.issues:Sv(o.issues,e)}},$w=e=>!!e&&"~standard"in e,ac={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function Ks(e){function t(u,h,p,m){const f=o(u,h,p,m);({insert:()=>s(f,u,h),remove:()=>l(f),swap:()=>m!==void 0&&d(f,u,h,m),move:()=>m!==void 0&&c(f,u,h,m)})[p]()}function n(u,h){return`${u}[${h}]`}function o(u,h,p,m){const f=[n(u,h)];if(p==="swap")f.push(n(u,m));else if(p==="move"){const[b,g]=[Math.min(h,m),Math.max(h,m)];for(let y=b;y<=g;y++)f.push(n(u,y))}else{const b=e.getFieldValue(u),g=Array.isArray(b)?b.length:0;for(let y=h+1;y<g;y++)f.push(n(u,y))}return Object.keys(e.fieldInfo).filter(b=>f.some(g=>b.startsWith(g)))}function i(u,h){return u.replace(/\[(\d+)\]/,(p,m)=>{const f=parseInt(m,10);return`[${h==="up"?f+1:Math.max(0,f-1)}]`})}function a(u,h){(h==="up"?u:[...u].reverse()).forEach(m=>{const f=i(m.toString(),h),b=e.getFieldMeta(f);b?e.setFieldMeta(m,b):e.setFieldMeta(m,r())})}const r=()=>ac,s=(u,h,p)=>{a(u,"down"),u.forEach(m=>{m.toString().startsWith(n(h,p))&&e.setFieldMeta(m,r())})},l=u=>{a(u,"up")},c=(u,h,p,m)=>{const f=new Map(Object.keys(e.fieldInfo).filter(b=>b.startsWith(n(h,p))).map(b=>[b,e.getFieldMeta(b)]));a(u,p<m?"up":"down"),Object.keys(e.fieldInfo).filter(b=>b.startsWith(n(h,m))).forEach(b=>{const g=b.replace(n(h,m),n(h,p)),y=f.get(g);y&&e.setFieldMeta(b,y)})},d=(u,h,p,m)=>{u.forEach(f=>{if(!f.toString().startsWith(n(h,p)))return;const b=f.toString().replace(n(h,p),n(h,m)),[g,y]=[e.getFieldMeta(f),e.getFieldMeta(b)];g&&e.setFieldMeta(b,g),y&&e.setFieldMeta(f,y)})};return{handleArrayFieldMetaShift:t}}class X8 extends ww{constructor(){super({pluginId:"form-devtools"})}}const Lt=new X8;function Rd(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}class Z8{constructor(t){this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const o=this.fieldMetaDerived.mount(),i=this.store.mount(),a=()=>{o(),i(),Lt.emit("form-unmounted",{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});const{onMount:r}=this.options.validators||{};return Lt.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}),r&&this.validateSync("mount"),a},this.update=o=>{if(!o)return;const i=this.options;this.options=o;const a=!!o.transform?.deps?.some((l,c)=>l!==this.prevTransformArray[c]),r=o.defaultValues&&!Di(o.defaultValues,i.defaultValues)&&!this.state.isTouched,s=!Di(o.defaultState,i.defaultState)&&!this.state.isTouched;!r&&!s&&!a||(dn(()=>{this.baseStore.setState(()=>Rd(Object.assign({},this.state,s?o.defaultState:{},r?{values:o.defaultValues}:{},a?{_force_re_eval:!this.state._force_re_eval}:{})))}),Lt.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}))},this.reset=(o,i)=>{const{fieldMeta:a}=this.state,r=this.resetFieldMeta(a);o&&!i?.keepDefaultValues&&(this.options={...this.options,defaultValues:o}),this.baseStore.setState(()=>Rd({...this.options.defaultState,values:o??this.options.defaultValues??this.options.defaultState?.values,fieldMetaBase:r}))},this.validateAllFields=async o=>{const i=[];return dn(()=>{Object.values(this.fieldInfo).forEach(r=>{if(!r.instance)return;const s=r.instance;i.push(Promise.resolve().then(()=>s.validate(o,{skipFormValidation:!0}))),r.instance.state.meta.isTouched||r.instance.setMeta(l=>({...l,isTouched:!0}))})}),(await Promise.all(i)).flat()},this.validateArrayFieldsStartingFrom=async(o,i,a)=>{const r=this.getFieldValue(o),s=Array.isArray(r)?Math.max(r.length-1,0):null,l=[`${o}[${i}]`];for(let h=i+1;h<=(s??0);h++)l.push(`${o}[${h}]`);const c=Object.keys(this.fieldInfo).filter(h=>l.some(p=>h.startsWith(p))),d=[];return dn(()=>{c.forEach(h=>{d.push(Promise.resolve().then(()=>this.validateField(h,a)))})}),(await Promise.all(d)).flat()},this.validateField=(o,i)=>{const a=this.fieldInfo[o]?.instance;return a?(a.state.meta.isTouched||a.setMeta(r=>({...r,isTouched:!0})),a.validate(i)):[]},this.validateSync=o=>{const i=Lu(o,{...this.options,form:this,validationLogic:this.options.validationLogic||Li});let a=!1;const r={};return dn(()=>{for(const c of i){if(!c.validate)continue;const d=this.runValidator({validate:c.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:u,fieldErrors:h}=Sl(d),p=Ga(c.cause);for(const m of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[m]===void 0)continue;const f=this.getFieldMeta(m);if(!f)continue;const{errorMap:b,errorSourceMap:g}=f,y=h?.[m],{newErrorValue:x,newSource:C}=$v({newFormValidatorError:y,isPreviousErrorFromFormValidator:g?.[p]==="form",previousErrorValue:b?.[p]});C==="form"&&(r[m]={...r[m],[p]:y}),b?.[p]!==x&&this.setFieldMeta(m,k=>({...k,errorMap:{...k.errorMap,[p]:x},errorSourceMap:{...k.errorSourceMap,[p]:C}}))}this.state.errorMap?.[p]!==u&&this.baseStore.setState(m=>({...m,errorMap:{...m.errorMap,[p]:u}})),(u||h)&&(a=!0)}const s=Ga("submit");this.state.errorMap?.[s]&&o!=="submit"&&!a&&this.baseStore.setState(c=>({...c,errorMap:{...c.errorMap,[s]:void 0}}));const l=Ga("server");this.state.errorMap?.[l]&&o!=="server"&&!a&&this.baseStore.setState(c=>({...c,errorMap:{...c.errorMap,[l]:void 0}}))}),{hasErrored:a,fieldsErrorMap:r}},this.validateAsync=async o=>{const i=Bu(o,{...this.options,form:this,validationLogic:this.options.validationLogic||Li});this.state.isFormValidating||this.baseStore.setState(c=>({...c,isFormValidating:!0}));const a=[];let r;for(const c of i){if(!c.validate)continue;const d=Ga(c.cause);this.state.validationMetaMap[d]?.lastAbortController.abort();const h=new AbortController;this.state.validationMetaMap[d]={lastAbortController:h},a.push(new Promise(async p=>{let m;try{m=await new Promise((y,x)=>{setTimeout(async()=>{if(h.signal.aborted)return y(void 0);try{y(await this.runValidator({validate:c.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:h.signal},type:"validateAsync"}))}catch(C){x(C)}},c.debounceMs)})}catch(y){m=y}const{formError:f,fieldErrors:b}=Sl(m);b&&(r=r?{...r,...b}:b);const g=Ga(c.cause);for(const y of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[y]===void 0)continue;const x=this.getFieldMeta(y);if(!x)continue;const{errorMap:C,errorSourceMap:k}=x,O=r?.[y],{newErrorValue:P,newSource:$}=$v({newFormValidatorError:O,isPreviousErrorFromFormValidator:k?.[g]==="form",previousErrorValue:C?.[g]});C?.[g]!==P&&this.setFieldMeta(y,I=>({...I,errorMap:{...I.errorMap,[g]:P},errorSourceMap:{...I.errorSourceMap,[g]:$}}))}this.baseStore.setState(y=>({...y,errorMap:{...y.errorMap,[g]:f}})),p(r?{fieldErrors:r,errorMapKey:g}:void 0)}))}let s=[];const l={};if(a.length){s=await Promise.all(a);for(const c of s)if(c?.fieldErrors){const{errorMapKey:d}=c;for(const[u,h]of Object.entries(c.fieldErrors)){const m={...l[u]||{},[d]:h};l[u]=m}}}return this.baseStore.setState(c=>({...c,isFormValidating:!1})),l},this.validate=o=>{const{hasErrored:i,fieldsErrorMap:a}=this.validateSync(o);return i&&!this.options.asyncAlways?a:this.validateAsync(o)},this.getFieldValue=o=>nr(this.state.values,o),this.getFieldMeta=o=>this.state.fieldMeta[o],this.getFieldInfo=o=>this.fieldInfo[o]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(o,i)=>{this.baseStore.setState(a=>({...a,fieldMetaBase:{...a.fieldMetaBase,[o]:_w(i,a.fieldMetaBase[o])}}))},this.resetFieldMeta=o=>Object.keys(o).reduce((i,a)=>{const r=a;return i[r]=ac,i},{}),this.setFieldValue=(o,i,a)=>{const r=a?.dontUpdateMeta??!1,s=a?.dontRunListeners??!1,l=a?.dontValidate??!1;dn(()=>{r||this.setFieldMeta(o,c=>({...c,isTouched:!0,isDirty:!0,errorMap:{...c?.errorMap,onMount:void 0}})),this.baseStore.setState(c=>({...c,values:Gs(c.values,o,i)}))}),s||this.getFieldInfo(o).instance?.triggerOnChangeListener(),l||this.validateField(o,"change")},this.deleteField=o=>{const a=[...Object.keys(this.fieldInfo).filter(r=>{const s=o.toString();return r!==s&&r.startsWith(s)}),o];this.baseStore.setState(r=>{const s={...r};return a.forEach(l=>{s.values=z8(s.values,l),delete this.fieldInfo[l],delete s.fieldMetaBase[l]}),s})},this.pushFieldValue=(o,i,a)=>{this.setFieldValue(o,r=>[...Array.isArray(r)?r:[],i],a)},this.insertFieldValue=async(o,i,a,r)=>{this.setFieldValue(o,l=>[...l.slice(0,i),a,...l.slice(i)],ht(r,{dontValidate:!0}));const s=r?.dontValidate??!1;s||await this.validateField(o,"change"),Ks(this).handleArrayFieldMetaShift(o,i,"insert"),s||await this.validateArrayFieldsStartingFrom(o,i,"change")},this.replaceFieldValue=async(o,i,a,r)=>{this.setFieldValue(o,l=>l.map((c,d)=>d===i?a:c),ht(r,{dontValidate:!0})),(r?.dontValidate??!1)||(await this.validateField(o,"change"),await this.validateArrayFieldsStartingFrom(o,i,"change"))},this.removeFieldValue=async(o,i,a)=>{const r=this.getFieldValue(o),s=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(o,c=>c.filter((d,u)=>u!==i),ht(a,{dontValidate:!0})),Ks(this).handleArrayFieldMetaShift(o,i,"remove"),s!==null){const c=`${o}[${s}]`;this.deleteField(c)}(a?.dontValidate??!1)||(await this.validateField(o,"change"),await this.validateArrayFieldsStartingFrom(o,i,"change"))},this.swapFieldValues=(o,i,a,r)=>{this.setFieldValue(o,l=>{const c=l[i],d=l[a];return Gs(Gs(l,`${i}`,d),`${a}`,c)},ht(r,{dontValidate:!0})),Ks(this).handleArrayFieldMetaShift(o,i,"swap",a),(r?.dontValidate??!1)||(this.validateField(o,"change"),this.validateField(`${o}[${i}]`,"change"),this.validateField(`${o}[${a}]`,"change"))},this.moveFieldValues=(o,i,a,r)=>{this.setFieldValue(o,l=>{const c=[...l];return c.splice(a,0,c.splice(i,1)[0]),c},ht(r,{dontValidate:!0})),Ks(this).handleArrayFieldMetaShift(o,i,"move",a),(r?.dontValidate??!1)||(this.validateField(o,"change"),this.validateField(`${o}[${i}]`,"change"),this.validateField(`${o}[${a}]`,"change"))},this.clearFieldValues=(o,i)=>{const a=this.getFieldValue(o),r=Array.isArray(a)?Math.max(a.length-1,0):null;if(this.setFieldValue(o,[],ht(i,{dontValidate:!0})),r!==null)for(let l=0;l<=r;l++){const c=`${o}[${l}]`;this.deleteField(c)}(i?.dontValidate??!1)||this.validateField(o,"change")},this.resetField=o=>{this.baseStore.setState(i=>({...i,fieldMetaBase:{...i.fieldMetaBase,[o]:ac},values:this.options.defaultValues?Gs(i.values,o,nr(this.options.defaultValues,o)):i.values}))},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((o,[i,a])=>(Object.keys(a).length&&a.errors.length&&(o[i]={errors:a.errors,errorMap:a.errorMap}),o),{})}),this.parseValuesWithSchema=o=>Wi.validate({value:this.state.values,validationSource:"form"},o),this.parseValuesWithSchemaAsync=o=>Wi.validateAsync({value:this.state.values,validationSource:"form"},o),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=t?.formId??Y8(),this._devtoolsSubmissionOverride=!1,this.baseStore=new ic(Rd({...t?.defaultState,values:t?.defaultValues??t?.defaultState?.values})),this.fieldMetaDerived=new Hn({deps:[this.baseStore],fn:({prevDepVals:o,currDepVals:i,prevVal:a})=>{const r=a,s=o?.[0],l=i[0];let c=0;const d={};for(const u of Object.keys(l.fieldMetaBase)){const h=l.fieldMetaBase[u],p=s?.fieldMetaBase[u],m=r?.[u],f=nr(l.values,u);let b=m?.errors;if(!p||h.errorMap!==p.errorMap){b=Object.values(h.errorMap??{}).filter(k=>k!==void 0);const C=this.getFieldInfo(u)?.instance;C&&!C.options.disableErrorFlat&&(b=b?.flat(1))}const g=!q8(b??[]),y=!h.isDirty,x=Di(f,nr(this.options.defaultValues,u))||Di(f,this.getFieldInfo(u)?.instance?.options.defaultValue);if(m&&m.isPristine===y&&m.isValid===g&&m.isDefaultValue===x&&m.errors===b&&h===p){d[u]=m,c++;continue}d[u]={...h,errors:b,isPristine:y,isValid:g,isDefaultValue:x}}return Object.keys(l.fieldMetaBase).length&&r&&c===Object.keys(l.fieldMetaBase).length?r:d}}),this.store=new Hn({deps:[this.baseStore,this.fieldMetaDerived],fn:({prevDepVals:o,currDepVals:i,prevVal:a})=>{const r=a,s=o?.[0],l=i[0],c=i[1],d=Object.values(c).filter(Boolean),u=d.some(N=>N.isValidating),h=d.every(N=>N.isValid),p=d.some(N=>N.isTouched),m=d.some(N=>N.isBlurred),f=d.every(N=>N.isDefaultValue),b=p&&l.errorMap?.onMount,g=d.some(N=>N.isDirty),y=!g,x=!!(l.errorMap?.onMount||d.some(N=>N?.errorMap?.onMount)),C=!!u;let k=r?.errors??[];(!s||l.errorMap!==s.errorMap)&&(k=Object.values(l.errorMap).reduce((N,B)=>B===void 0?N:B&&zu(B)?(N.push(B.form),N):(N.push(B),N),[]));const O=k.length===0,P=h&&O,$=this.options.canSubmitWhenInvalid??!1,I=l.submissionAttempts===0&&!p&&!x||!C&&!l.isSubmitting&&P||$;let A=l.errorMap;if(b&&(k=k.filter(N=>N!==l.errorMap.onMount),A=Object.assign(A,{onMount:void 0})),r&&s&&r.errorMap===A&&r.fieldMeta===this.fieldMetaDerived.state&&r.errors===k&&r.isFieldsValidating===u&&r.isFieldsValid===h&&r.isFormValid===O&&r.isValid===P&&r.canSubmit===I&&r.isTouched===p&&r.isBlurred===m&&r.isPristine===y&&r.isDefaultValue===f&&r.isDirty===g&&Di(s,l))return r;let M={...l,errorMap:A,fieldMeta:this.fieldMetaDerived.state,errors:k,isFieldsValidating:u,isFieldsValid:h,isFormValid:O,isValid:P,canSubmit:I,isTouched:p,isBlurred:m,isPristine:y,isDefaultValue:f,isDirty:g};const j=this.options.transform?.deps??[];if(j.length!==this.prevTransformArray.length||j.some((N,B)=>N!==this.prevTransformArray[B])){const N=Object.assign({},this,{state:M});this.options.transform?.fn(N),M=N.state,this.prevTransformArray=j}return M}}),this.handleSubmit=this.handleSubmit.bind(this),this.update(t||{});const n=B8(o=>Lt.emit("form-state",{id:this._formId,state:o}),{wait:300});this.store.subscribe(()=>{n(this.store.state)}),Lt.on("request-form-state",o=>{o.payload.id===this._formId&&Lt.emit("form-api",{id:this._formId,state:this.store.state,options:this.options})}),Lt.on("request-form-reset",o=>{o.payload.id===this._formId&&this.reset()}),Lt.on("request-form-force-submit",o=>{o.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)})}get state(){return this.store.state}get formId(){return this._formId}runValidator(t){return $w(t.validate)?Wi[t.type](t.value,t.validate):t.validate(t.value)}async handleSubmit(t){this.baseStore.setState(i=>({...i,isSubmitted:!1,submissionAttempts:i.submissionAttempts+1,isSubmitSuccessful:!1})),dn(()=>{Object.values(this.fieldInfo).forEach(i=>{i.instance&&(i.instance.state.meta.isTouched||i.instance.setMeta(a=>({...a,isTouched:!0})))})});const n=t??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:n});return}this.baseStore.setState(i=>({...i,isSubmitting:!0}));const o=()=>{this.baseStore.setState(i=>({...i,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){o(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:n}),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validateAllFields",errors:Object.values(this.state.fieldMeta).map(i=>i.errors).flat()});return}if(await this.validate("submit"),!this.state.isValid){o(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:n}),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validate",errors:this.state.errors});return}dn(()=>{Object.values(this.fieldInfo).forEach(i=>{i.instance?.options.listeners?.onSubmit?.({value:i.instance.state.value,fieldApi:i.instance})})}),this.options.listeners?.onSubmit?.({formApi:this,meta:n});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:n}),dn(()=>{this.baseStore.setState(i=>({...i,isSubmitted:!0,isSubmitSuccessful:!0})),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),o()})}catch(i){throw this.baseStore.setState(a=>({...a,isSubmitSuccessful:!1})),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"inflight",onError:i}),o(),i}}setErrorMap(t){dn(()=>{Object.entries(t).forEach(([n,o])=>{const i=n;if(zu(o)){const{formError:a,fieldErrors:r}=Sl(o);for(const s of Object.keys(this.fieldInfo))this.getFieldMeta(s)&&this.setFieldMeta(s,c=>({...c,errorMap:{...c.errorMap,[i]:r?.[s]},errorSourceMap:{...c.errorSourceMap,[i]:"form"}}));this.baseStore.setState(s=>({...s,errorMap:{...s.errorMap,[i]:a}}))}else this.baseStore.setState(a=>({...a,errorMap:{...a.errorMap,[i]:o}}))})})}}function Sl(e){if(e){if(zu(e)){const t=Sl(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return{formError:e}}return{formError:void 0}}function Ga(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class J8{constructor(t){this.options={},this.mount=()=>{const n=this.store.mount();this.options.defaultValue!==void 0&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});const o=this.getInfo();o.instance=this,this.update(this.options);const{onMount:i}=this.options.validators||{};if(i){const a=this.runValidator({validate:i,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});a&&this.setMeta(r=>({...r,errorMap:{...r?.errorMap,onMount:a},errorSourceMap:{...r?.errorSourceMap,onMount:"field"}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),n},this.update=n=>{this.options=n;const o=this.name!==n.name;if(this.name=n.name,this.state.value===void 0){const i=nr(n.form.options.defaultValues,n.name),a=n.defaultValue??i;o?this.setValue(r=>r||a,{dontUpdateMeta:!0}):a!==void 0&&this.setValue(a,{dontUpdateMeta:!0})}this.form.getFieldMeta(this.name)===void 0&&this.setMeta(this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,o)=>{this.form.setFieldValue(this.name,n,ht(o,{dontRunListeners:!0,dontValidate:!0})),o?.dontRunListeners||this.triggerOnChangeListener(),o?.dontValidate||this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=n=>this.form.setFieldMeta(this.name,n),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(n,o)=>{this.form.pushFieldValue(this.name,n,ht(o,{dontRunListeners:!0})),o?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(n,o,i)=>{this.form.insertFieldValue(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(n,o,i)=>{this.form.replaceFieldValue(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(n,o)=>{this.form.removeFieldValue(this.name,n,ht(o,{dontRunListeners:!0})),o?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(n,o,i)=>{this.form.swapFieldValues(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(n,o,i)=>{this.form.moveFieldValues(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=n=>{this.form.clearFieldValues(this.name,ht(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=n=>{const o=Object.values(this.form.fieldInfo),i=[];for(const a of o){if(!a.instance)continue;const{onChangeListenTo:r,onBlurListenTo:s}=a.instance.options.validators||{};n==="change"&&r?.includes(this.name)&&i.push(a.instance),n==="blur"&&s?.includes(this.name)&&i.push(a.instance)}return i},this.validateSync=(n,o)=>{const i=Lu(n,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||Li}),r=this.getLinkedFields(n).reduce((c,d)=>{const u=Lu(n,{...d.options,form:d.form,validationLogic:d.form.options.validationLogic||Li});return u.forEach(h=>{h.field=d}),c.concat(u)},[]);let s=!1;dn(()=>{const c=(d,u)=>{const h=Xs(u.cause),p=u.validate?Ev(d.runValidator({validate:u.validate,value:{value:d.store.state.value,validationSource:"field",fieldApi:d},type:"validate"})):void 0,m=o[h],{newErrorValue:f,newSource:b}=kv({formLevelError:m,fieldLevelError:p});d.state.meta.errorMap?.[h]!==f&&d.setMeta(g=>({...g,errorMap:{...g.errorMap,[h]:f},errorSourceMap:{...g.errorSourceMap,[h]:b}})),f&&(s=!0)};for(const d of i)c(this,d);for(const d of r)d.validate&&c(d.field,d)});const l=Xs("submit");return this.state.meta.errorMap?.[l]&&n!=="submit"&&!s&&this.setMeta(c=>({...c,errorMap:{...c.errorMap,[l]:void 0},errorSourceMap:{...c.errorSourceMap,[l]:void 0}})),{hasErrored:s}},this.validateAsync=async(n,o)=>{const i=Bu(n,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||Li}),a=await o,r=this.getLinkedFields(n),s=r.reduce((h,p)=>{const m=Bu(n,{...p.options,form:p.form,validationLogic:p.form.options.validationLogic||Li});return m.forEach(f=>{f.field=p}),h.concat(m)},[]);this.state.meta.isValidating||this.setMeta(h=>({...h,isValidating:!0}));for(const h of r)h.setMeta(p=>({...p,isValidating:!0}));const l=[],c=[],d=(h,p,m)=>{const f=Xs(p.cause);h.getInfo().validationMetaMap[f]?.lastAbortController.abort();const g=new AbortController;this.getInfo().validationMetaMap[f]={lastAbortController:g},m.push(new Promise(async y=>{let x;try{x=await new Promise(($,I)=>{this.timeoutIds.validations[p.cause]&&clearTimeout(this.timeoutIds.validations[p.cause]),this.timeoutIds.validations[p.cause]=setTimeout(async()=>{if(g.signal.aborted)return $(void 0);try{$(await this.runValidator({validate:p.validate,value:{value:h.store.state.value,fieldApi:h,signal:g.signal,validationSource:"field"},type:"validateAsync"}))}catch(A){I(A)}},p.debounceMs)})}catch($){x=$}if(g.signal.aborted)return y(void 0);const C=Ev(x),k=a[this.name]?.[f],{newErrorValue:O,newSource:P}=kv({formLevelError:k,fieldLevelError:C});h.setMeta($=>({...$,errorMap:{...$?.errorMap,[f]:O},errorSourceMap:{...$.errorSourceMap,[f]:P}})),y(O)}))};for(const h of i)h.validate&&d(this,h,l);for(const h of s)h.validate&&d(h.field,h,c);let u=[];(l.length||c.length)&&(u=await Promise.all(l),await Promise.all(c)),this.setMeta(h=>({...h,isValidating:!1}));for(const h of r)h.setMeta(p=>({...p,isValidating:!1}));return u.filter(Boolean)},this.validate=(n,o)=>{if(!this.state.meta.isTouched)return[];const{fieldsErrorMap:i}=o?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(n),{hasErrored:a}=this.validateSync(n,i[this.name]??{});if(a&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[Xs(n)]?.lastAbortController.abort(),this.state.meta.errors;const r=o?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(n);return this.validateAsync(n,r)},this.handleChange=n=>{this.setValue(n)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(o=>({...o,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(o=>({...o,isBlurred:!0})),this.validate("blur"),this.triggerOnBlurListener()},this.parseValueWithSchema=n=>Wi.validate({value:this.state.value,validationSource:"field"},n),this.parseValueWithSchemaAsync=n=>Wi.validateAsync({value:this.state.value,validationSource:"field"},n),this.form=t.form,this.name=t.name,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=new Hn({deps:[this.form.store],fn:()=>{const n=this.form.getFieldValue(this.name),o=this.form.getFieldMeta(this.name)??{...ac,...t.defaultMeta};return{value:n,meta:o}}}),this.options=t}get state(){return this.store.state}runValidator(t){return $w(t.validate)?Wi[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}triggerOnBlurListener(){const t=this.form.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},t)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});const n=this.options.listeners?.onBlurDebounceMs;n&&n>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},n)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})}triggerOnChangeListener(){const t=this.form.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},t)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});const n=this.options.listeners?.onChangeDebounceMs;n&&n>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},n)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})}}function Ev(e){if(e)return e}function Xs(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}function Hu(e,t=n=>n){const n=he(t(e.state));return Ae(()=>e,(o,i,a)=>{const r=o.subscribe(()=>{const s=t(o.state);Q8(Gw(n.value),s)||(n.value=s)});a(()=>{r()})},{immediate:!0}),Pv(n)}function Q8(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,i]of e)if(!t.has(o)||!Object.is(i,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Object.is(e[n[o]],t[n[o]]))return!1;return!0}function kw(e){const t=(()=>{const a=new J8({...e,form:e.form,name:e.name});return a.Field=Sw,a})(),n=Hu(t.store,i=>i);let o;return Dr(()=>{o=t.mount()}),Wu(()=>{o()}),Ae(()=>e,()=>{t.update({...e,form:e.form})}),{api:t,state:n}}const Sw=E((e,t)=>{const n=kw({...e,...t.attrs});return()=>t.slots.default({field:n.api,state:n.state.value})},{name:"Field",inheritAttrs:!1});function ez(e){const t=(()=>{const n=new Z8(e),o=n;return o.Field=E((i,a)=>()=>at(Sw,{...i,...a.attrs,form:n},a.slots),{name:"APIField",inheritAttrs:!1}),o.useField=i=>kw({...i,form:n}),o.useStore=i=>Hu(n.store,i),o.Subscribe=E((i,a)=>{const s={...i,...a.attrs}.selector??(c=>c),l=Hu(n.store,s);return()=>a.slots.default(l.value)},{name:"Subscribe",inheritAttrs:!1}),o})();return Dr(t.mount),t.update(e),t}const tz=E({__name:"DynamicFormWrapper",props:{configMap:{},baseKey:{},currentStep:{}},setup(e,{expose:t}){const n=e,o=ez({defaultValues:Nc(n.configMap)}),i=Vv("formRef");ju(Dt,o);async function a(){const r=await i.value.validate();return n.currentStep?tp(r,[...n.currentStep.properties,"credential_guid_body","credential_property_id"]):r}return t({validate:a,form:o}),(r,s)=>{const l=bw;return w(),S(l,F({ref:"formRef"},n),null,16)}}}),nz=Object.assign(tz,{__name:"DynamicFormWrapper"});async function oz(){const{data:e}=await es("configmaps",()=>$fetch("/workflows/v1/configmaps")),t=T(()=>(e.value?.data??[]).find(r=>!r.startsWith("atlan-connectors-")&&r!=="manifest")??"workflow"),{credentialConfig:n,data:o}=await tw(t),i=T(()=>{const a=o.value?.data,r=a&&"kind"in a?a.metadata?.name:void 0,s=a&&"kind"in a?a.metadata?.name:a?.name,l=a&&"kind"in a?a.metadata?.logo:a?.logo;return{id:r||t.value,name:n.value?.name||s||t.value,logo:n.value?.logo||l||"",config:n.value}});return{workflowConfig:n,workflowMeta:i}}const iz={class:"min-h-screen bg-gray-50 py-8 flex flex-col"},az={class:"w-[700px] mx-auto px-4 flex flex-col flex-1"},rz={class:"flex items-center justify-between mb-8"},sz={class:"flex items-center gap-4"},lz=["src"],cz={class:"mb-8 overflow-x-auto pb-3"},dz={class:"bg-white rounded-lg shadow-sm p-8 flex gap-8 grow"},uz={class:"flex-1 w-full"},hz={class:"flex justify-between py-3 border-t"},pz={key:2,class:"flex ml-auto gap-x-2"},fz={key:3,class:"flex ml-auto gap-x-2"},Tz=E({__name:"index",async setup(e){let t,n;const{workflowConfig:o,workflowMeta:i}=([t,n]=Rr(()=>oz()),t=await t,n(),t);qw(()=>({title:i.value.name?`${i.value.name} | App Playground`:"App Playground"}));const a=he(1),r=T(()=>o.value.steps||[]),s=T(()=>r.value?r.value[a.value-1]:{}),l=T(()=>r.value.map(b=>({...b,value:b.id}))),c=he(!1),d=he({}),u=he(""),h=he(!1),p=Vv("formRef");async function m(){let b=YB(await p.value.validate(),x=>Xx(x)||Kx(x)?JSON.stringify(x):x);const g=b.credential_guid_body,y=b.credential_property_id;return b=Zx(b,["credential_guid_body","credential_property_id",y]),d.value={...d.value,[s.value.id]:b},{...d.value,connection:{connection_name:"test-connection",connection_qualified_name:`default/${i.value.id}/${Math.round(new Date().getTime()/1e3)}`},...g?{credentials:JSON.parse(g)}:{},metadata:Object.assign({},...Object.values(d.value))}}ju(Yx,m);async function f(){c.value=!0,u.value="";try{const b=await m();if(a.value===r.value.length){try{await $fetch("/workflows/v1/start",{method:"POST",body:b}),a.value=1,d.value={},p.value.form.reset(),Hi.success("Workflow started successfully!",{placement:"top",duration:3e3})}catch{Hi.failed("Failed to start workflow. Please try again.",{placement:"top",duration:3e3})}return}a.value=a.value+1}catch(b){Hi.failed("Failed to validate form: "+b.message,{placement:"top"})}finally{c.value=!1}}return(b,g)=>{const y=nz;return w(),H("div",iz,[U("div",az,[U("div",rz,[U("div",sz,[U("img",{src:v(i).logo,alt:"App Logo",class:"w-16 h-16"},null,8,lz),z(v(wA),{as:"h1",size:"xl"},{default:_(()=>[Te(oe(v(i).name)+" App ",1)]),_:1})])]),U("div",cz,[z(v(SF),{items:v(l),"model-value":v(a),orientation:"horizontal",type:"default",onStepChange:g[0]||(g[0]=x=>a.value=x)},null,8,["items","model-value"])]),U("div",dz,[U("div",uz,[z(y,{ref:"formRef","current-step":v(s),"config-map":v(o)},null,8,["current-step","config-map"])])]),U("div",hz,[v(a)>0?(w(),S(v(Xt),{key:0,type:"subtle",label:"Back",onClick:g[1]||(g[1]=()=>{a.value=v(a)-1})})):te("",!0),v(a)<v(r).length?(w(),S(v(Xt),{key:1,label:"Next",class:"ml-auto","is-loading":v(c),onClick:f},null,8,["is-loading"])):v(a)===v(r).length&&!v(h)?(w(),H("div",pz,[v(u)?(w(),S(v(Xt),{key:1,label:"Retry",type:"subtle","is-loading":v(c),onClick:f},null,8,["is-loading"])):(w(),S(v(Xt),{key:0,label:"Start Workflow","is-loading":v(c),onClick:f},null,8,["is-loading"]))])):v(h)?(w(),H("div",fz,[z(v(Xt),{label:"Workflow Started!",type:"success",disabled:!0})])):te("",!0)])])])}}});export{Tz as default};
|
|
33
|
+
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+n+"$)|(?:^"+i+"$)"),r=new RegExp("^"+n+"$"),s=new RegExp("^"+i+"$"),l=function(C){return C&&C.exact?a:new RegExp("(?:"+t(C)+n+t(C)+")|(?:"+t(C)+i+t(C)+")","g")};l.v4=function(x){return x&&x.exact?r:new RegExp(""+t(x)+n+t(x),"g")},l.v6=function(x){return x&&x.exact?s:new RegExp(""+t(x)+i+t(x),"g")};var c="(?:(?:[a-z]+:)?//)",d="(?:\\S+(?::\\S*)?@)?",u=l.v4().source,h=l.v6().source,p="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",m="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",f="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",b="(?::\\d{2,5})?",g='(?:[/?#][^\\s"]*)?',y="(?:"+c+"|www\\.)"+d+"(?:localhost|"+u+"|"+h+"|"+p+m+f+")"+b+g;return Ws=new RegExp("(?:^"+y+"$)","i"),Ws},wv={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},er={integer:function(t){return er.number(t)&&parseInt(t,10)===t},float:function(t){return er.number(t)&&!er.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!er.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(wv.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(r8())},hex:function(t){return typeof t=="string"&&!!t.match(wv.hex)}},s8=function(t,n,o,i,a){if(t.required&&n===void 0){vw(t,n,o,i,a);return}var r=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=t.type;r.indexOf(s)>-1?er[s](n)||i.push(kt(a.messages.types[s],t.fullField,t.type)):s&&typeof n!==t.type&&i.push(kt(a.messages.types[s],t.fullField,t.type))},l8=function(t,n,o,i,a){var r=typeof t.len=="number",s=typeof t.min=="number",l=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=n,u=null,h=typeof n=="number",p=typeof n=="string",m=Array.isArray(n);if(h?u="number":p?u="string":m&&(u="array"),!u)return!1;m&&(d=n.length),p&&(d=n.replace(c,"_").length),r?d!==t.len&&i.push(kt(a.messages[u].len,t.fullField,t.len)):s&&!l&&d<t.min?i.push(kt(a.messages[u].min,t.fullField,t.min)):l&&!s&&d>t.max?i.push(kt(a.messages[u].max,t.fullField,t.max)):s&&l&&(d<t.min||d>t.max)&&i.push(kt(a.messages[u].range,t.fullField,t.min,t.max))},ki="enum",c8=function(t,n,o,i,a){t[ki]=Array.isArray(t[ki])?t[ki]:[],t[ki].indexOf(n)===-1&&i.push(kt(a.messages[ki],t.fullField,t[ki].join(", ")))},d8=function(t,n,o,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(kt(a.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var r=new RegExp(t.pattern);r.test(n)||i.push(kt(a.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},fe={required:vw,whitespace:a8,type:s8,range:l8,enum:c8,pattern:d8},u8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n,"string")&&!t.required)return o();fe.required(t,n,i,r,a,"string"),je(n,"string")||(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a),fe.pattern(t,n,i,r,a),t.whitespace===!0&&fe.whitespace(t,n,i,r,a))}o(r)},h8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe.type(t,n,i,r,a)}o(r)},p8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(n===""&&(n=void 0),je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},f8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe.type(t,n,i,r,a)}o(r)},g8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),je(n)||fe.type(t,n,i,r,a)}o(r)},m8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},v8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},b8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(n==null&&!t.required)return o();fe.required(t,n,i,r,a,"array"),n!=null&&(fe.type(t,n,i,r,a),fe.range(t,n,i,r,a))}o(r)},y8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe.type(t,n,i,r,a)}o(r)},x8="enum",w8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a),n!==void 0&&fe[x8](t,n,i,r,a)}o(r)},C8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n,"string")&&!t.required)return o();fe.required(t,n,i,r,a),je(n,"string")||fe.pattern(t,n,i,r,a)}o(r)},_8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n,"date")&&!t.required)return o();if(fe.required(t,n,i,r,a),!je(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),fe.type(t,l,i,r,a),l&&fe.range(t,l.getTime(),i,r,a)}}o(r)},$8=function(t,n,o,i,a){var r=[],s=Array.isArray(n)?"array":typeof n;fe.required(t,n,i,r,a,s),o(r)},Dd=function(t,n,o,i,a){var r=t.type,s=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(je(n,r)&&!t.required)return o();fe.required(t,n,i,s,a,r),je(n,r)||fe.type(t,n,i,s,a)}o(s)},k8=function(t,n,o,i,a){var r=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(je(n)&&!t.required)return o();fe.required(t,n,i,r,a)}o(r)},fr={string:u8,method:h8,number:p8,boolean:f8,regexp:g8,integer:m8,float:v8,array:b8,object:y8,enum:w8,pattern:C8,date:_8,url:Dd,hex:Dd,email:Dd,required:$8,any:k8};function Au(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Fu=Au(),ts=function(){function e(n){this.rules=null,this._messages=Fu,this.define(n)}var t=e.prototype;return t.define=function(o){var i=this;if(!o)throw new Error("Cannot configure a schema with no rules");if(typeof o!="object"||Array.isArray(o))throw new Error("Rules must be an object");this.rules={},Object.keys(o).forEach(function(a){var r=o[a];i.rules[a]=Array.isArray(r)?r:[r]})},t.messages=function(o){return o&&(this._messages=xv(Au(),o)),this._messages},t.validate=function(o,i,a){var r=this;i===void 0&&(i={}),a===void 0&&(a=function(){});var s=o,l=i,c=a;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,s),Promise.resolve(s);function d(f){var b=[],g={};function y(C){if(Array.isArray(C)){var k;b=(k=b).concat.apply(k,C)}else b.push(C)}for(var x=0;x<f.length;x++)y(f[x]);b.length?(g=Ru(b),c(b,g)):c(null,s)}if(l.messages){var u=this.messages();u===Fu&&(u=Au()),xv(u,l.messages),l.messages=u}else l.messages=this.messages();var h={},p=l.keys||Object.keys(this.rules);p.forEach(function(f){var b=r.rules[f],g=s[f];b.forEach(function(y){var x=y;typeof x.transform=="function"&&(s===o&&(s=Wo({},s)),g=s[f]=x.transform(g)),typeof x=="function"?x={validator:x}:x=Wo({},x),x.validator=r.getValidationMethod(x),x.validator&&(x.field=f,x.fullField=x.fullField||f,x.type=r.getType(x),h[f]=h[f]||[],h[f].push({rule:x,value:g,source:s,field:f}))})});var m={};return n8(h,l,function(f,b){var g=f.rule,y=(g.type==="object"||g.type==="array")&&(typeof g.fields=="object"||typeof g.defaultField=="object");y=y&&(g.required||!g.required&&f.value),g.field=f.field;function x(O,P){return Wo({},P,{fullField:g.fullField+"."+O,fullFields:g.fullFields?[].concat(g.fullFields,[O]):[O]})}function C(O){O===void 0&&(O=[]);var P=Array.isArray(O)?O:[O];!l.suppressWarning&&P.length&&e.warning("async-validator:",P),P.length&&g.message!==void 0&&(P=[].concat(g.message));var $=P.map(yv(g,s));if(l.first&&$.length)return m[g.field]=1,b($);if(!y)b($);else{if(g.required&&!f.value)return g.message!==void 0?$=[].concat(g.message).map(yv(g,s)):l.error&&($=[l.error(g,kt(l.messages.required,g.field))]),b($);var I={};g.defaultField&&Object.keys(f.value).map(function(j){I[j]=g.defaultField}),I=Wo({},I,f.rule.fields);var A={};Object.keys(I).forEach(function(j){var Q=I[j],N=Array.isArray(Q)?Q:[Q];A[j]=N.map(x.bind(null,j))});var M=new e(A);M.messages(l.messages),f.rule.options&&(f.rule.options.messages=l.messages,f.rule.options.error=l.error),M.validate(f.value,f.rule.options||l,function(j){var Q=[];$&&$.length&&Q.push.apply(Q,$),j&&j.length&&Q.push.apply(Q,j),b(Q.length?Q:null)})}}var k;if(g.asyncValidator)k=g.asyncValidator(g,f.value,C,f.source,l);else if(g.validator){try{k=g.validator(g,f.value,C,f.source,l)}catch(O){console.error?.(O),l.suppressValidatorError||setTimeout(function(){throw O},0),C(O.message)}k===!0?C():k===!1?C(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):k instanceof Array?C(k):k instanceof Error&&C(k.message)}k&&k.then&&k.then(function(){return C()},function(O){return C(O)})},function(f){d(f)},s)},t.getType=function(o){if(o.type===void 0&&o.pattern instanceof RegExp&&(o.type="pattern"),typeof o.validator!="function"&&o.type&&!fr.hasOwnProperty(o.type))throw new Error(kt("Unknown rule type %s",o.type));return o.type||"string"},t.getValidationMethod=function(o){if(typeof o.validator=="function")return o.validator;var i=Object.keys(o),a=i.indexOf("message");return a!==-1&&i.splice(a,1),i.length===1&&i[0]==="required"?fr.required:fr[this.getType(o)]||void 0},e}();ts.register=function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");fr[t]=n};ts.warning=J4;ts.messages=Fu;ts.validators=fr;function S8(e){const t=new ts({[e.id]:e.ui?.rules??[]});return{onBlurAsync:async({value:n})=>{try{await t.validate({[e.id]:n})}catch({errors:o}){return o[0].message}}}}const E8={class:"grid grid-cols-8 gap-x-4 gap-y-4"},O8={key:0,class:"text-red-500"},T8={key:1,class:"text-red-500 text-xs"},I8=E({__name:"DynamicForm",props:{configMap:{},baseKey:{},currentStep:{}},setup(e,{expose:t}){const n=st(Dt),o=n.useStore(p=>yo(p.values)),i=(p=8,m,f)=>{let b=`col-span-${p}`;return m&&(b+=` col-start-${m}`),f&&(b+=` col-start-${m}`),b},a=p=>e.baseKey?`${e.baseKey}.${p}`:p,r=T(()=>{const p=JSON.parse(JSON.stringify(e.configMap));if(p.anyOf){p.anyOf.forEach(f=>{f.required.forEach(b=>{p.properties&&p.properties[b]&&(p.properties[b].ui.hidden=!0)})});const m=[];p.anyOf.forEach(f=>{Object.keys(f.properties).every(g=>{if(o.value[a(g)]?.toString()===f.properties[g]?.const?.toString())return!0})&&m.push(f)}),m.length>0&&m.forEach(f=>{f.required.forEach(b=>{p.properties&&p.properties[b]&&(p.properties[b].ui.hidden=!1)})})}return p}),s=p=>{const m=r.value?.properties[p];let f={id:a(p),name:a(p)};if(m.type==="conditional"){const{conditions:b,...g}=m,y=b?.find(x=>x.regex?new RegExp(x.regex).test(o.value[x.property]):o.value[x.property]===x.value);f={...f,...g,...y}}else f={...f,...m};return f},l=T(()=>{{const p=[];return r.value?.properties&&(e.currentStep?.properties?e.currentStep.properties.forEach(m=>{Object.keys(r?.value?.properties).find(b=>b===m)&&(r.value?.properties[m].ui?.hidden||p.push(s(m)))}):Object.keys(r?.value?.properties).forEach(m=>{r.value?.properties[m].ui?.hidden||p.push(s(m))})),p}}),c=["credential","nested","connection","sage","Repeater","agent","advancedJdbcUrlGroup","jdbcurlgroup","nestedcollapse","inputrepeater"],d=["evaluate"],u=p=>{if(p.ui?.widget)switch(p.ui?.widget?.toLowerCase()){case"divider":return"hr";case"header":return"h5";case"radio":return UB;case"credential":return h6;case"nested":return f6;case"input":return Td;case"password":return m6;case"select":return b6;case"sqltree":return x6;case"apitree":return C6;case"sage":case"sagev2":return M6;case"connection":return A6;case"fileupload":return B6;case"repeater":return J6;case"connectionselector":return e5;case"switcher":return n5;case"agent":return C5;case"agentselector":return $5;case"advancedjdbcurlgroup":return X5;case"jdbcurlgroup":return J5;case"nestedcollapse":return e4;case"apiselect":return n4;case"checkbox":return s4;case"date":return R4;case"inputnumber":return F4;case"inputrepeater":return U4;case"evaluate":return q4;default:return p.ui.widget}else switch(p.type){case"string":case"number":return Td;case"boolean":return jB;case"array":return"Select";case"object":return"Form";case"code":return"CodeBlock";case"banner":return"Banner";default:return Td}};async function h(){if(await n.handleSubmit(),!n.state.isValid)throw new Error("Form is invalid");return n.state.values}return t({validate:h}),(p,m)=>(w(),H("div",E8,[(w(!0),H(we,null,Oe(v(l),f=>(w(),H(we,{key:`${f.id}`},[f.ui?.hidden?te("",!0):(w(),H("div",{key:0,class:R(i(f.ui?.grid,f.ui?.start,f.ui?.end))},[c.includes(f?.ui?.widget)?(w(),S(gt(u(f)),{key:0,property:f},null,8,["property"])):d.includes(f?.ui?.widget)?(w(),S(gt(u(f)),{key:1,property:f},null,8,["property"])):(w(),S(v(n).Field,{key:2,name:f.id,validators:v(S8)(f)},{default:_(({field:b})=>[f.ui?.label?(w(),S(v(Hh),{key:0},{default:_(()=>[Te(oe(f.ui?.label)+" ",1),f?.required?(w(),H("span",O8," * ")):te("",!0)]),_:2},1024)):te("",!0),(w(),S(gt(u(f)),{field:b,"base-key":e.baseKey,property:f},null,8,["field","base-key","property"])),b.state.meta.isTouched&&!b.state.meta.isValid?(w(),H("span",T8,oe(b.state.meta.errors.join(", ")),1)):te("",!0)]),_:2},1032,["name","validators"]))],2))],64))),128))]))}}),bw=Object.assign(I8,{__name:"DynamicForm"}),ko=Object.freeze(Object.defineProperty({__proto__:null,default:bw},Symbol.toStringTag,{value:"Module"})),ji=new WeakMap,$l=new WeakMap,oc={current:[]};let Md=!1,gr=0;const tr=new Set,Us=new Map;function yw(e){const t=Array.from(e).sort((n,o)=>n instanceof Hn&&n.options.deps.includes(o)?1:o instanceof Hn&&o.options.deps.includes(n)?-1:0);for(const n of t){if(oc.current.includes(n))continue;oc.current.push(n),n.recompute();const o=$l.get(n);if(o)for(const i of o){const a=ji.get(i);a&&yw(a)}}}function P8(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function V8(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function xw(e){if(gr>0&&!Us.has(e)&&Us.set(e,e.prevState),tr.add(e),!(gr>0)&&!Md)try{for(Md=!0;tr.size>0;){const t=Array.from(tr);tr.clear();for(const n of t){const o=Us.get(n)??n.prevState;n.prevState=o,P8(n)}for(const n of t){const o=ji.get(n);o&&(oc.current.push(n),yw(o))}for(const n of t){const o=ji.get(n);if(o)for(const i of o)V8(i)}}}finally{Md=!1,oc.current=[],Us.clear()}}function dn(e){gr++;try{e()}finally{if(gr--,gr===0){const t=tr.values().next().value;t&&xw(t)}}}function D8(e){return typeof e=="function"}class ic{constructor(t,n){this.listeners=new Set,this.subscribe=o=>{var i,a;this.listeners.add(o);const r=(a=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:a.call(i,o,this);return()=>{this.listeners.delete(o),r?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,o,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):D8(t)?this.state=t(this.prevState):this.state=t,(i=(o=this.options)==null?void 0:o.onUpdate)==null||i.call(o),xw(this)}}class Hn{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=this.options.deps.length,o=new Array(n),i=new Array(n);for(let a=0;a<n;a++){const r=this.options.deps[a];o[a]=r.prevState,i[a]=r.state}return this.lastSeenDepValues=i,{prevDepVals:o,currDepVals:i,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,o;this.prevState=this.state;const i=this.getDepVals();this.state=this.options.fn(i),(o=(n=this.options).onUpdate)==null||o.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const a of this.options.deps)a instanceof Hn&&a.checkIfRecalculationNeededDeeply();let n=!1;const o=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let a=0;a<i.length;a++)if(i[a]!==o[a]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var o,i;this.listeners.add(n);const a=(i=(o=this.options).onSubscribe)==null?void 0:i.call(o,n,this);return()=>{this.listeners.delete(n),a?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const n of t)if(n instanceof Hn)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof ic){let o=ji.get(n);o||(o=new Set,ji.set(n,o)),o.add(this);let i=$l.get(this);i||(i=new Set,$l.set(this,i)),i.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof Hn)this.unregisterFromGraph(n.options.deps);else if(n instanceof ic){const o=ji.get(n);o&&o.delete(this);const i=$l.get(this);i&&i.delete(n)}}}function M8(e){return typeof e=="function"}function Cv(e,...t){return M8(e)?e(...t):e}function R8(e){return e||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"")}class ww{#n=!0;#e;#t;#a;#o;#i;#r;#s;#c=0;#u=5;#d=()=>{this.debugLog("Connected to event bus"),this.#i=!0,this.debugLog("Emitting queued events",this.#o),this.#o.forEach(t=>this.emitEventToBus(t)),this.#o=[],this.stopConnectLoop(),this.#t().removeEventListener("tanstack-connect-success",this.#d)};#l=()=>{if(this.#t().addEventListener("tanstack-connect-success",this.#d),this.#c<this.#u){this.#c++,this.dispatchCustomEvent("tanstack-connect",{});return}this.#t().removeEventListener("tanstack-connect",this.#l),this.debugLog("Max retries reached, giving up on connection"),this.stopConnectLoop()};constructor({pluginId:t,debug:n=!1,enabled:o=!0,reconnectEveryMs:i=1e3}){this.#e=t,this.#n=o,this.#t=this.getGlobalTarget,this.#a=n,this.debugLog(" Initializing event subscription for plugin",this.#e),this.#o=[],this.#i=!1,this.#r=null,this.#s=i}startConnectLoop(){this.#r!==null||this.#i||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#r=setInterval(this.#l,this.#s))}stopConnectLoop(){this.#r!==null&&(clearInterval(this.#r),this.#r=null,this.debugLog("Stopped connect loop"))}debugLog(...t){this.#a&&console.log(`🌴 [tanstack-devtools:${this.#e}-plugin]`,...t)}getGlobalTarget(){if(typeof globalThis<"u"&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog("Using global event target"),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<"u"&&typeof window.addEventListener<"u")return this.debugLog("Using window as event target"),window;const t=typeof EventTarget<"u"?new EventTarget:void 0;return typeof t>"u"||typeof t.addEventListener>"u"?(this.debugLog("No event mechanism available, running in non-web environment"),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog("Using new EventTarget as fallback"),t)}getPluginId(){return this.#e}dispatchCustomEventShim(t,n){try{const o=new Event(t,{detail:n});this.#t().dispatchEvent(o)}catch{this.debugLog("Failed to dispatch shim event")}}dispatchCustomEvent(t,n){try{this.#t().dispatchEvent(new CustomEvent(t,{detail:n}))}catch{this.dispatchCustomEventShim(t,n)}}emitEventToBus(t){this.debugLog("Emitting event to client bus",t),this.dispatchCustomEvent("tanstack-dispatch-event",t)}emit(t,n){if(!this.#n){this.debugLog("Event bus client is disabled, not emitting event",t,n);return}if(!this.#i){this.debugLog("Bus not available, will be pushed as soon as connected"),this.#o.push({type:`${this.#e}:${t}`,payload:n,pluginId:this.#e}),typeof CustomEvent<"u"&&(this.#l(),this.startConnectLoop());return}return this.emitEventToBus({type:`${this.#e}:${t}`,payload:n,pluginId:this.#e})}on(t,n){const o=`${this.#e}:${t}`;if(!this.#n)return this.debugLog("Event bus client is disabled, not registering event",o),()=>{};const i=a=>{this.debugLog("Received event from bus",a.detail),n(a.detail)};return this.#t().addEventListener(o,i),this.debugLog("Registered event to bus",o),()=>{this.#t().removeEventListener(o,i)}}onAll(t){if(!this.#n)return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const n=o=>{const i=o.detail;t(i)};return this.#t().addEventListener("tanstack-devtools-global",n),()=>this.#t().removeEventListener("tanstack-devtools-global",n)}onAllPluginEvents(t){if(!this.#n)return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const n=o=>{const i=o.detail;this.#e&&i.pluginId!==this.#e||t(i)};return this.#t().addEventListener("tanstack-devtools-global",n),()=>this.#t().removeEventListener("tanstack-devtools-global",n)}}class A8 extends ww{constructor(t){super({pluginId:"pacer",debug:t?.debug})}}const F8=(e,t)=>{Cw.emit(e,t)},Cw=new A8;function _v(){return{executionCount:0,isPending:!1,lastArgs:void 0,lastExecutionTime:0,nextExecutionTime:0,status:"idle",maybeExecuteCount:0}}const N8={enabled:!0,leading:!0,trailing:!0,wait:0};class L8{constructor(t,n){this.fn=t,this.store=new ic(_v()),this.setOptions=o=>{this.options={...this.options,...o},this.#t()||this.cancel()},this.#e=o=>{this.store.setState(i=>{const a={...i,...o},{isPending:r}=a;return{...a,status:this.#t()?r?"pending":"idle":"disabled"}}),F8("Throttler",this)},this.#t=()=>!!Cv(this.options.enabled,this),this.#a=()=>Cv(this.options.wait,this),this.maybeExecute=(...o)=>{this.#e({maybeExecuteCount:this.store.state.maybeExecuteCount+1});const i=Date.now(),a=i-this.store.state.lastExecutionTime,r=this.#a();if(this.options.leading&&a>=r)this.#o(...o);else if(this.#e({lastArgs:o}),!this.#n&&this.options.trailing){const s=this.store.state.lastExecutionTime?i-this.store.state.lastExecutionTime:0,l=r-s;this.#e({isPending:!0}),this.#n=setTimeout(()=>{const{lastArgs:c}=this.store.state;c!==void 0&&this.#o(...c)},l)}},this.#o=(...o)=>{if(!this.#t())return;this.fn(...o);const i=Date.now(),a=i+this.#a();this.#i(),this.#e({executionCount:this.store.state.executionCount+1,lastExecutionTime:i,nextExecutionTime:a,isPending:!1,lastArgs:void 0}),this.options.onExecute?.(o,this),setTimeout(()=>{this.store.state.isPending||this.#e({nextExecutionTime:void 0})},this.#a())},this.flush=()=>{this.store.state.isPending&&this.store.state.lastArgs&&this.#o(...this.store.state.lastArgs)},this.#i=()=>{this.#n&&(clearTimeout(this.#n),this.#n=void 0)},this.cancel=()=>{this.#i(),this.#e({lastArgs:void 0,isPending:!1})},this.reset=()=>{this.#e(_v())},this.key=R8(n.key),this.options={...N8,...n},this.#e(this.options.initialState??{}),Cw.on("d-Throttler",o=>{o.payload.key===this.key&&(this.#e(o.payload.store.state),this.setOptions(o.payload.options))})}#n;#e;#t;#a;#o;#i}function B8(e,t){return new L8(e,t).maybeExecute}function _w(e,t){return typeof e=="function"?e(t):e}function nr(e,t){return dp(t).reduce((o,i)=>{if(o===null)return null;if(typeof o<"u")return o[i]},e)}function Gs(e,t,n){const o=dp(t);function i(a){if(!o.length)return _w(n,a);const r=o.shift();if(typeof r=="string"||typeof r=="number"&&!Array.isArray(a))return typeof a=="object"?(a===null&&(a={}),{...a,[r]:i(a[r])}):{[r]:i()};if(Array.isArray(a)&&typeof r=="number"){const s=a.slice(0,r);return[...s.length?s:new Array(r),i(a[r]),...a.slice(r+1)]}return[...new Array(r),i()]}return i(e)}function z8(e,t){const n=dp(t);function o(i){if(!i)return;if(n.length===1){const r=n[0];if(Array.isArray(i)&&typeof r=="number")return i.filter((c,d)=>d!==r);const{[r]:s,...l}=i;return l}const a=n.shift();if(typeof a=="string"&&typeof i=="object")return{...i,[a]:o(i[a])};if(typeof a=="number"&&Array.isArray(i)){if(a>=i.length)return i;const r=i.slice(0,a);return[...r.length?r:new Array(a),o(i[a]),...i.slice(a+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return o(e)}const H8=/^(\d+)$/gm,j8=/\.(\d+)(?=\.)/gm,W8=/^(\d+)\./gm,U8=/\.(\d+$)/gm,G8=/\.{2,}/gm,Nu="__int__",qs=`${Nu}$1`;function dp(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replace(/(^\[)|]/gm,"").replace(/\[/g,".").replace(H8,qs).replace(j8,`.${qs}.`).replace(W8,`${qs}.`).replace(U8,`.${qs}`).replace(G8,".").split(".").map(t=>{if(t.startsWith(Nu)){const n=t.substring(Nu.length),o=parseInt(n,10);return String(o)===n?o:n}return t})}function q8(e){return!(Array.isArray(e)&&e.length===0)}function Lu(e,t){const n=o=>o.validators.filter(Boolean).map(i=>({cause:i.cause,validate:i.fn}));return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!1},runValidation:n})}function Bu(e,t){const{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:o,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},r=n??0,s=l=>l.validators.filter(Boolean).map(c=>{const d=c?.cause||e;let u=r;switch(d){case"change":u=i??r;break;case"blur":u=o??r;break;case"dynamic":u=a??r;break;case"submit":u=0;break}return e==="submit"&&(u=0),{cause:d,validate:c.fn,debounceMs:u}});return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!0},runValidation:s})}const zu=e=>!!e&&typeof e=="object"&&"fields"in e;function Di(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,a]of e)if(!t.has(i)||!Object.is(a,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const i of n)if(!o.includes(i)||!Di(e[i],t[i]))return!1;return!0}const $v=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:"form"}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:"field"}:{newErrorValue:void 0,newSource:void 0},kv=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:"field"}:e?{newErrorValue:e,newSource:"form"}:{newErrorValue:void 0,newSource:void 0};function ht(e,t){return e==null?t:{...e,...t}}let Uo=256;const kl=[];let Ys;for(;Uo--;)kl[Uo]=(Uo+256).toString(16).substring(1);function Y8(){let e=0,t,n="";if(!Ys||Uo+16>256){for(Ys=new Array(256),e=256;e--;)Ys[e]=256*Math.random()|0;e=0,Uo=0}for(;e<16;e++)t=Ys[Uo+e],e===6?n+=kl[t&15|64]:e===8?n+=kl[t&63|128]:n+=kl[t],e&1&&e>1&&e<11&&(n+="-");return Uo++,n}const Li=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});const t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:"mount"},o={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:"change"},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:"blur"},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:"submit"},r=t?void 0:{fn:()=>{},cause:"server"};switch(e.event.type){case"mount":return e.runValidation({validators:[n],form:e.form});case"submit":return e.runValidation({validators:[o,i,a,r],form:e.form});case"server":return e.runValidation({validators:[],form:e.form});case"blur":return e.runValidation({validators:[i,r],form:e.form});case"change":return e.runValidation({validators:[o,r],form:e.form});default:throw new Error(`Unknown validation event type: ${e.event.type}`)}};function K8(e,t){const n=new Map;for(const o of e){const i=o.path??[];let a=t,r="";for(let s=0;s<i.length;s++){const l=i[s];if(l===void 0)continue;const c=typeof l=="object"?l.key:l,d=Number(c);Array.isArray(a)&&!Number.isNaN(d)?r+=`[${d}]`:r+=(s>0?".":"")+String(c),typeof a=="object"&&a!==null?a=a[c]:a=void 0}n.set(r,(n.get(r)??[]).concat(o))}return Object.fromEntries(n)}const Sv=(e,t)=>{const n=K8(e,t);return{form:n,fields:n}},Wi={validate({value:e,validationSource:t},n){const o=n["~standard"].validate(e);if(o instanceof Promise)throw new Error("async function passed to sync validator");if(o.issues)return t==="field"?o.issues:Sv(o.issues,e)},async validateAsync({value:e,validationSource:t},n){const o=await n["~standard"].validate(e);if(o.issues)return t==="field"?o.issues:Sv(o.issues,e)}},$w=e=>!!e&&"~standard"in e,ac={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function Ks(e){function t(u,h,p,m){const f=o(u,h,p,m);({insert:()=>s(f,u,h),remove:()=>l(f),swap:()=>m!==void 0&&d(f,u,h,m),move:()=>m!==void 0&&c(f,u,h,m)})[p]()}function n(u,h){return`${u}[${h}]`}function o(u,h,p,m){const f=[n(u,h)];if(p==="swap")f.push(n(u,m));else if(p==="move"){const[b,g]=[Math.min(h,m),Math.max(h,m)];for(let y=b;y<=g;y++)f.push(n(u,y))}else{const b=e.getFieldValue(u),g=Array.isArray(b)?b.length:0;for(let y=h+1;y<g;y++)f.push(n(u,y))}return Object.keys(e.fieldInfo).filter(b=>f.some(g=>b.startsWith(g)))}function i(u,h){return u.replace(/\[(\d+)\]/,(p,m)=>{const f=parseInt(m,10);return`[${h==="up"?f+1:Math.max(0,f-1)}]`})}function a(u,h){(h==="up"?u:[...u].reverse()).forEach(m=>{const f=i(m.toString(),h),b=e.getFieldMeta(f);b?e.setFieldMeta(m,b):e.setFieldMeta(m,r())})}const r=()=>ac,s=(u,h,p)=>{a(u,"down"),u.forEach(m=>{m.toString().startsWith(n(h,p))&&e.setFieldMeta(m,r())})},l=u=>{a(u,"up")},c=(u,h,p,m)=>{const f=new Map(Object.keys(e.fieldInfo).filter(b=>b.startsWith(n(h,p))).map(b=>[b,e.getFieldMeta(b)]));a(u,p<m?"up":"down"),Object.keys(e.fieldInfo).filter(b=>b.startsWith(n(h,m))).forEach(b=>{const g=b.replace(n(h,m),n(h,p)),y=f.get(g);y&&e.setFieldMeta(b,y)})},d=(u,h,p,m)=>{u.forEach(f=>{if(!f.toString().startsWith(n(h,p)))return;const b=f.toString().replace(n(h,p),n(h,m)),[g,y]=[e.getFieldMeta(f),e.getFieldMeta(b)];g&&e.setFieldMeta(b,g),y&&e.setFieldMeta(f,y)})};return{handleArrayFieldMetaShift:t}}class X8 extends ww{constructor(){super({pluginId:"form-devtools"})}}const Lt=new X8;function Rd(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}class Z8{constructor(t){this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const o=this.fieldMetaDerived.mount(),i=this.store.mount(),a=()=>{o(),i(),Lt.emit("form-unmounted",{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});const{onMount:r}=this.options.validators||{};return Lt.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}),r&&this.validateSync("mount"),a},this.update=o=>{if(!o)return;const i=this.options;this.options=o;const a=!!o.transform?.deps?.some((l,c)=>l!==this.prevTransformArray[c]),r=o.defaultValues&&!Di(o.defaultValues,i.defaultValues)&&!this.state.isTouched,s=!Di(o.defaultState,i.defaultState)&&!this.state.isTouched;!r&&!s&&!a||(dn(()=>{this.baseStore.setState(()=>Rd(Object.assign({},this.state,s?o.defaultState:{},r?{values:o.defaultValues}:{},a?{_force_re_eval:!this.state._force_re_eval}:{})))}),Lt.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}))},this.reset=(o,i)=>{const{fieldMeta:a}=this.state,r=this.resetFieldMeta(a);o&&!i?.keepDefaultValues&&(this.options={...this.options,defaultValues:o}),this.baseStore.setState(()=>Rd({...this.options.defaultState,values:o??this.options.defaultValues??this.options.defaultState?.values,fieldMetaBase:r}))},this.validateAllFields=async o=>{const i=[];return dn(()=>{Object.values(this.fieldInfo).forEach(r=>{if(!r.instance)return;const s=r.instance;i.push(Promise.resolve().then(()=>s.validate(o,{skipFormValidation:!0}))),r.instance.state.meta.isTouched||r.instance.setMeta(l=>({...l,isTouched:!0}))})}),(await Promise.all(i)).flat()},this.validateArrayFieldsStartingFrom=async(o,i,a)=>{const r=this.getFieldValue(o),s=Array.isArray(r)?Math.max(r.length-1,0):null,l=[`${o}[${i}]`];for(let h=i+1;h<=(s??0);h++)l.push(`${o}[${h}]`);const c=Object.keys(this.fieldInfo).filter(h=>l.some(p=>h.startsWith(p))),d=[];return dn(()=>{c.forEach(h=>{d.push(Promise.resolve().then(()=>this.validateField(h,a)))})}),(await Promise.all(d)).flat()},this.validateField=(o,i)=>{const a=this.fieldInfo[o]?.instance;return a?(a.state.meta.isTouched||a.setMeta(r=>({...r,isTouched:!0})),a.validate(i)):[]},this.validateSync=o=>{const i=Lu(o,{...this.options,form:this,validationLogic:this.options.validationLogic||Li});let a=!1;const r={};return dn(()=>{for(const c of i){if(!c.validate)continue;const d=this.runValidator({validate:c.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:u,fieldErrors:h}=Sl(d),p=Ga(c.cause);for(const m of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[m]===void 0)continue;const f=this.getFieldMeta(m);if(!f)continue;const{errorMap:b,errorSourceMap:g}=f,y=h?.[m],{newErrorValue:x,newSource:C}=$v({newFormValidatorError:y,isPreviousErrorFromFormValidator:g?.[p]==="form",previousErrorValue:b?.[p]});C==="form"&&(r[m]={...r[m],[p]:y}),b?.[p]!==x&&this.setFieldMeta(m,k=>({...k,errorMap:{...k.errorMap,[p]:x},errorSourceMap:{...k.errorSourceMap,[p]:C}}))}this.state.errorMap?.[p]!==u&&this.baseStore.setState(m=>({...m,errorMap:{...m.errorMap,[p]:u}})),(u||h)&&(a=!0)}const s=Ga("submit");this.state.errorMap?.[s]&&o!=="submit"&&!a&&this.baseStore.setState(c=>({...c,errorMap:{...c.errorMap,[s]:void 0}}));const l=Ga("server");this.state.errorMap?.[l]&&o!=="server"&&!a&&this.baseStore.setState(c=>({...c,errorMap:{...c.errorMap,[l]:void 0}}))}),{hasErrored:a,fieldsErrorMap:r}},this.validateAsync=async o=>{const i=Bu(o,{...this.options,form:this,validationLogic:this.options.validationLogic||Li});this.state.isFormValidating||this.baseStore.setState(c=>({...c,isFormValidating:!0}));const a=[];let r;for(const c of i){if(!c.validate)continue;const d=Ga(c.cause);this.state.validationMetaMap[d]?.lastAbortController.abort();const h=new AbortController;this.state.validationMetaMap[d]={lastAbortController:h},a.push(new Promise(async p=>{let m;try{m=await new Promise((y,x)=>{setTimeout(async()=>{if(h.signal.aborted)return y(void 0);try{y(await this.runValidator({validate:c.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:h.signal},type:"validateAsync"}))}catch(C){x(C)}},c.debounceMs)})}catch(y){m=y}const{formError:f,fieldErrors:b}=Sl(m);b&&(r=r?{...r,...b}:b);const g=Ga(c.cause);for(const y of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[y]===void 0)continue;const x=this.getFieldMeta(y);if(!x)continue;const{errorMap:C,errorSourceMap:k}=x,O=r?.[y],{newErrorValue:P,newSource:$}=$v({newFormValidatorError:O,isPreviousErrorFromFormValidator:k?.[g]==="form",previousErrorValue:C?.[g]});C?.[g]!==P&&this.setFieldMeta(y,I=>({...I,errorMap:{...I.errorMap,[g]:P},errorSourceMap:{...I.errorSourceMap,[g]:$}}))}this.baseStore.setState(y=>({...y,errorMap:{...y.errorMap,[g]:f}})),p(r?{fieldErrors:r,errorMapKey:g}:void 0)}))}let s=[];const l={};if(a.length){s=await Promise.all(a);for(const c of s)if(c?.fieldErrors){const{errorMapKey:d}=c;for(const[u,h]of Object.entries(c.fieldErrors)){const m={...l[u]||{},[d]:h};l[u]=m}}}return this.baseStore.setState(c=>({...c,isFormValidating:!1})),l},this.validate=o=>{const{hasErrored:i,fieldsErrorMap:a}=this.validateSync(o);return i&&!this.options.asyncAlways?a:this.validateAsync(o)},this.getFieldValue=o=>nr(this.state.values,o),this.getFieldMeta=o=>this.state.fieldMeta[o],this.getFieldInfo=o=>this.fieldInfo[o]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(o,i)=>{this.baseStore.setState(a=>({...a,fieldMetaBase:{...a.fieldMetaBase,[o]:_w(i,a.fieldMetaBase[o])}}))},this.resetFieldMeta=o=>Object.keys(o).reduce((i,a)=>{const r=a;return i[r]=ac,i},{}),this.setFieldValue=(o,i,a)=>{const r=a?.dontUpdateMeta??!1,s=a?.dontRunListeners??!1,l=a?.dontValidate??!1;dn(()=>{r||this.setFieldMeta(o,c=>({...c,isTouched:!0,isDirty:!0,errorMap:{...c?.errorMap,onMount:void 0}})),this.baseStore.setState(c=>({...c,values:Gs(c.values,o,i)}))}),s||this.getFieldInfo(o).instance?.triggerOnChangeListener(),l||this.validateField(o,"change")},this.deleteField=o=>{const a=[...Object.keys(this.fieldInfo).filter(r=>{const s=o.toString();return r!==s&&r.startsWith(s)}),o];this.baseStore.setState(r=>{const s={...r};return a.forEach(l=>{s.values=z8(s.values,l),delete this.fieldInfo[l],delete s.fieldMetaBase[l]}),s})},this.pushFieldValue=(o,i,a)=>{this.setFieldValue(o,r=>[...Array.isArray(r)?r:[],i],a)},this.insertFieldValue=async(o,i,a,r)=>{this.setFieldValue(o,l=>[...l.slice(0,i),a,...l.slice(i)],ht(r,{dontValidate:!0}));const s=r?.dontValidate??!1;s||await this.validateField(o,"change"),Ks(this).handleArrayFieldMetaShift(o,i,"insert"),s||await this.validateArrayFieldsStartingFrom(o,i,"change")},this.replaceFieldValue=async(o,i,a,r)=>{this.setFieldValue(o,l=>l.map((c,d)=>d===i?a:c),ht(r,{dontValidate:!0})),(r?.dontValidate??!1)||(await this.validateField(o,"change"),await this.validateArrayFieldsStartingFrom(o,i,"change"))},this.removeFieldValue=async(o,i,a)=>{const r=this.getFieldValue(o),s=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(o,c=>c.filter((d,u)=>u!==i),ht(a,{dontValidate:!0})),Ks(this).handleArrayFieldMetaShift(o,i,"remove"),s!==null){const c=`${o}[${s}]`;this.deleteField(c)}(a?.dontValidate??!1)||(await this.validateField(o,"change"),await this.validateArrayFieldsStartingFrom(o,i,"change"))},this.swapFieldValues=(o,i,a,r)=>{this.setFieldValue(o,l=>{const c=l[i],d=l[a];return Gs(Gs(l,`${i}`,d),`${a}`,c)},ht(r,{dontValidate:!0})),Ks(this).handleArrayFieldMetaShift(o,i,"swap",a),(r?.dontValidate??!1)||(this.validateField(o,"change"),this.validateField(`${o}[${i}]`,"change"),this.validateField(`${o}[${a}]`,"change"))},this.moveFieldValues=(o,i,a,r)=>{this.setFieldValue(o,l=>{const c=[...l];return c.splice(a,0,c.splice(i,1)[0]),c},ht(r,{dontValidate:!0})),Ks(this).handleArrayFieldMetaShift(o,i,"move",a),(r?.dontValidate??!1)||(this.validateField(o,"change"),this.validateField(`${o}[${i}]`,"change"),this.validateField(`${o}[${a}]`,"change"))},this.clearFieldValues=(o,i)=>{const a=this.getFieldValue(o),r=Array.isArray(a)?Math.max(a.length-1,0):null;if(this.setFieldValue(o,[],ht(i,{dontValidate:!0})),r!==null)for(let l=0;l<=r;l++){const c=`${o}[${l}]`;this.deleteField(c)}(i?.dontValidate??!1)||this.validateField(o,"change")},this.resetField=o=>{this.baseStore.setState(i=>({...i,fieldMetaBase:{...i.fieldMetaBase,[o]:ac},values:this.options.defaultValues?Gs(i.values,o,nr(this.options.defaultValues,o)):i.values}))},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((o,[i,a])=>(Object.keys(a).length&&a.errors.length&&(o[i]={errors:a.errors,errorMap:a.errorMap}),o),{})}),this.parseValuesWithSchema=o=>Wi.validate({value:this.state.values,validationSource:"form"},o),this.parseValuesWithSchemaAsync=o=>Wi.validateAsync({value:this.state.values,validationSource:"form"},o),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=t?.formId??Y8(),this._devtoolsSubmissionOverride=!1,this.baseStore=new ic(Rd({...t?.defaultState,values:t?.defaultValues??t?.defaultState?.values})),this.fieldMetaDerived=new Hn({deps:[this.baseStore],fn:({prevDepVals:o,currDepVals:i,prevVal:a})=>{const r=a,s=o?.[0],l=i[0];let c=0;const d={};for(const u of Object.keys(l.fieldMetaBase)){const h=l.fieldMetaBase[u],p=s?.fieldMetaBase[u],m=r?.[u],f=nr(l.values,u);let b=m?.errors;if(!p||h.errorMap!==p.errorMap){b=Object.values(h.errorMap??{}).filter(k=>k!==void 0);const C=this.getFieldInfo(u)?.instance;C&&!C.options.disableErrorFlat&&(b=b?.flat(1))}const g=!q8(b??[]),y=!h.isDirty,x=Di(f,nr(this.options.defaultValues,u))||Di(f,this.getFieldInfo(u)?.instance?.options.defaultValue);if(m&&m.isPristine===y&&m.isValid===g&&m.isDefaultValue===x&&m.errors===b&&h===p){d[u]=m,c++;continue}d[u]={...h,errors:b,isPristine:y,isValid:g,isDefaultValue:x}}return Object.keys(l.fieldMetaBase).length&&r&&c===Object.keys(l.fieldMetaBase).length?r:d}}),this.store=new Hn({deps:[this.baseStore,this.fieldMetaDerived],fn:({prevDepVals:o,currDepVals:i,prevVal:a})=>{const r=a,s=o?.[0],l=i[0],c=i[1],d=Object.values(c).filter(Boolean),u=d.some(N=>N.isValidating),h=d.every(N=>N.isValid),p=d.some(N=>N.isTouched),m=d.some(N=>N.isBlurred),f=d.every(N=>N.isDefaultValue),b=p&&l.errorMap?.onMount,g=d.some(N=>N.isDirty),y=!g,x=!!(l.errorMap?.onMount||d.some(N=>N?.errorMap?.onMount)),C=!!u;let k=r?.errors??[];(!s||l.errorMap!==s.errorMap)&&(k=Object.values(l.errorMap).reduce((N,B)=>B===void 0?N:B&&zu(B)?(N.push(B.form),N):(N.push(B),N),[]));const O=k.length===0,P=h&&O,$=this.options.canSubmitWhenInvalid??!1,I=l.submissionAttempts===0&&!p&&!x||!C&&!l.isSubmitting&&P||$;let A=l.errorMap;if(b&&(k=k.filter(N=>N!==l.errorMap.onMount),A=Object.assign(A,{onMount:void 0})),r&&s&&r.errorMap===A&&r.fieldMeta===this.fieldMetaDerived.state&&r.errors===k&&r.isFieldsValidating===u&&r.isFieldsValid===h&&r.isFormValid===O&&r.isValid===P&&r.canSubmit===I&&r.isTouched===p&&r.isBlurred===m&&r.isPristine===y&&r.isDefaultValue===f&&r.isDirty===g&&Di(s,l))return r;let M={...l,errorMap:A,fieldMeta:this.fieldMetaDerived.state,errors:k,isFieldsValidating:u,isFieldsValid:h,isFormValid:O,isValid:P,canSubmit:I,isTouched:p,isBlurred:m,isPristine:y,isDefaultValue:f,isDirty:g};const j=this.options.transform?.deps??[];if(j.length!==this.prevTransformArray.length||j.some((N,B)=>N!==this.prevTransformArray[B])){const N=Object.assign({},this,{state:M});this.options.transform?.fn(N),M=N.state,this.prevTransformArray=j}return M}}),this.handleSubmit=this.handleSubmit.bind(this),this.update(t||{});const n=B8(o=>Lt.emit("form-state",{id:this._formId,state:o}),{wait:300});this.store.subscribe(()=>{n(this.store.state)}),Lt.on("request-form-state",o=>{o.payload.id===this._formId&&Lt.emit("form-api",{id:this._formId,state:this.store.state,options:this.options})}),Lt.on("request-form-reset",o=>{o.payload.id===this._formId&&this.reset()}),Lt.on("request-form-force-submit",o=>{o.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)})}get state(){return this.store.state}get formId(){return this._formId}runValidator(t){return $w(t.validate)?Wi[t.type](t.value,t.validate):t.validate(t.value)}async handleSubmit(t){this.baseStore.setState(i=>({...i,isSubmitted:!1,submissionAttempts:i.submissionAttempts+1,isSubmitSuccessful:!1})),dn(()=>{Object.values(this.fieldInfo).forEach(i=>{i.instance&&(i.instance.state.meta.isTouched||i.instance.setMeta(a=>({...a,isTouched:!0})))})});const n=t??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:n});return}this.baseStore.setState(i=>({...i,isSubmitting:!0}));const o=()=>{this.baseStore.setState(i=>({...i,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){o(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:n}),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validateAllFields",errors:Object.values(this.state.fieldMeta).map(i=>i.errors).flat()});return}if(await this.validate("submit"),!this.state.isValid){o(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:n}),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validate",errors:this.state.errors});return}dn(()=>{Object.values(this.fieldInfo).forEach(i=>{i.instance?.options.listeners?.onSubmit?.({value:i.instance.state.value,fieldApi:i.instance})})}),this.options.listeners?.onSubmit?.({formApi:this,meta:n});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:n}),dn(()=>{this.baseStore.setState(i=>({...i,isSubmitted:!0,isSubmitSuccessful:!0})),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),o()})}catch(i){throw this.baseStore.setState(a=>({...a,isSubmitSuccessful:!1})),Lt.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"inflight",onError:i}),o(),i}}setErrorMap(t){dn(()=>{Object.entries(t).forEach(([n,o])=>{const i=n;if(zu(o)){const{formError:a,fieldErrors:r}=Sl(o);for(const s of Object.keys(this.fieldInfo))this.getFieldMeta(s)&&this.setFieldMeta(s,c=>({...c,errorMap:{...c.errorMap,[i]:r?.[s]},errorSourceMap:{...c.errorSourceMap,[i]:"form"}}));this.baseStore.setState(s=>({...s,errorMap:{...s.errorMap,[i]:a}}))}else this.baseStore.setState(a=>({...a,errorMap:{...a.errorMap,[i]:o}}))})})}}function Sl(e){if(e){if(zu(e)){const t=Sl(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return{formError:e}}return{formError:void 0}}function Ga(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class J8{constructor(t){this.options={},this.mount=()=>{const n=this.store.mount();this.options.defaultValue!==void 0&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});const o=this.getInfo();o.instance=this,this.update(this.options);const{onMount:i}=this.options.validators||{};if(i){const a=this.runValidator({validate:i,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});a&&this.setMeta(r=>({...r,errorMap:{...r?.errorMap,onMount:a},errorSourceMap:{...r?.errorSourceMap,onMount:"field"}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),n},this.update=n=>{this.options=n;const o=this.name!==n.name;if(this.name=n.name,this.state.value===void 0){const i=nr(n.form.options.defaultValues,n.name),a=n.defaultValue??i;o?this.setValue(r=>r||a,{dontUpdateMeta:!0}):a!==void 0&&this.setValue(a,{dontUpdateMeta:!0})}this.form.getFieldMeta(this.name)===void 0&&this.setMeta(this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,o)=>{this.form.setFieldValue(this.name,n,ht(o,{dontRunListeners:!0,dontValidate:!0})),o?.dontRunListeners||this.triggerOnChangeListener(),o?.dontValidate||this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=n=>this.form.setFieldMeta(this.name,n),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(n,o)=>{this.form.pushFieldValue(this.name,n,ht(o,{dontRunListeners:!0})),o?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(n,o,i)=>{this.form.insertFieldValue(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(n,o,i)=>{this.form.replaceFieldValue(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(n,o)=>{this.form.removeFieldValue(this.name,n,ht(o,{dontRunListeners:!0})),o?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(n,o,i)=>{this.form.swapFieldValues(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(n,o,i)=>{this.form.moveFieldValues(this.name,n,o,ht(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=n=>{this.form.clearFieldValues(this.name,ht(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=n=>{const o=Object.values(this.form.fieldInfo),i=[];for(const a of o){if(!a.instance)continue;const{onChangeListenTo:r,onBlurListenTo:s}=a.instance.options.validators||{};n==="change"&&r?.includes(this.name)&&i.push(a.instance),n==="blur"&&s?.includes(this.name)&&i.push(a.instance)}return i},this.validateSync=(n,o)=>{const i=Lu(n,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||Li}),r=this.getLinkedFields(n).reduce((c,d)=>{const u=Lu(n,{...d.options,form:d.form,validationLogic:d.form.options.validationLogic||Li});return u.forEach(h=>{h.field=d}),c.concat(u)},[]);let s=!1;dn(()=>{const c=(d,u)=>{const h=Xs(u.cause),p=u.validate?Ev(d.runValidator({validate:u.validate,value:{value:d.store.state.value,validationSource:"field",fieldApi:d},type:"validate"})):void 0,m=o[h],{newErrorValue:f,newSource:b}=kv({formLevelError:m,fieldLevelError:p});d.state.meta.errorMap?.[h]!==f&&d.setMeta(g=>({...g,errorMap:{...g.errorMap,[h]:f},errorSourceMap:{...g.errorSourceMap,[h]:b}})),f&&(s=!0)};for(const d of i)c(this,d);for(const d of r)d.validate&&c(d.field,d)});const l=Xs("submit");return this.state.meta.errorMap?.[l]&&n!=="submit"&&!s&&this.setMeta(c=>({...c,errorMap:{...c.errorMap,[l]:void 0},errorSourceMap:{...c.errorSourceMap,[l]:void 0}})),{hasErrored:s}},this.validateAsync=async(n,o)=>{const i=Bu(n,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||Li}),a=await o,r=this.getLinkedFields(n),s=r.reduce((h,p)=>{const m=Bu(n,{...p.options,form:p.form,validationLogic:p.form.options.validationLogic||Li});return m.forEach(f=>{f.field=p}),h.concat(m)},[]);this.state.meta.isValidating||this.setMeta(h=>({...h,isValidating:!0}));for(const h of r)h.setMeta(p=>({...p,isValidating:!0}));const l=[],c=[],d=(h,p,m)=>{const f=Xs(p.cause);h.getInfo().validationMetaMap[f]?.lastAbortController.abort();const g=new AbortController;this.getInfo().validationMetaMap[f]={lastAbortController:g},m.push(new Promise(async y=>{let x;try{x=await new Promise(($,I)=>{this.timeoutIds.validations[p.cause]&&clearTimeout(this.timeoutIds.validations[p.cause]),this.timeoutIds.validations[p.cause]=setTimeout(async()=>{if(g.signal.aborted)return $(void 0);try{$(await this.runValidator({validate:p.validate,value:{value:h.store.state.value,fieldApi:h,signal:g.signal,validationSource:"field"},type:"validateAsync"}))}catch(A){I(A)}},p.debounceMs)})}catch($){x=$}if(g.signal.aborted)return y(void 0);const C=Ev(x),k=a[this.name]?.[f],{newErrorValue:O,newSource:P}=kv({formLevelError:k,fieldLevelError:C});h.setMeta($=>({...$,errorMap:{...$?.errorMap,[f]:O},errorSourceMap:{...$.errorSourceMap,[f]:P}})),y(O)}))};for(const h of i)h.validate&&d(this,h,l);for(const h of s)h.validate&&d(h.field,h,c);let u=[];(l.length||c.length)&&(u=await Promise.all(l),await Promise.all(c)),this.setMeta(h=>({...h,isValidating:!1}));for(const h of r)h.setMeta(p=>({...p,isValidating:!1}));return u.filter(Boolean)},this.validate=(n,o)=>{if(!this.state.meta.isTouched)return[];const{fieldsErrorMap:i}=o?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(n),{hasErrored:a}=this.validateSync(n,i[this.name]??{});if(a&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[Xs(n)]?.lastAbortController.abort(),this.state.meta.errors;const r=o?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(n);return this.validateAsync(n,r)},this.handleChange=n=>{this.setValue(n)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(o=>({...o,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(o=>({...o,isBlurred:!0})),this.validate("blur"),this.triggerOnBlurListener()},this.parseValueWithSchema=n=>Wi.validate({value:this.state.value,validationSource:"field"},n),this.parseValueWithSchemaAsync=n=>Wi.validateAsync({value:this.state.value,validationSource:"field"},n),this.form=t.form,this.name=t.name,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=new Hn({deps:[this.form.store],fn:()=>{const n=this.form.getFieldValue(this.name),o=this.form.getFieldMeta(this.name)??{...ac,...t.defaultMeta};return{value:n,meta:o}}}),this.options=t}get state(){return this.store.state}runValidator(t){return $w(t.validate)?Wi[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}triggerOnBlurListener(){const t=this.form.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},t)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});const n=this.options.listeners?.onBlurDebounceMs;n&&n>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},n)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})}triggerOnChangeListener(){const t=this.form.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},t)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});const n=this.options.listeners?.onChangeDebounceMs;n&&n>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},n)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})}}function Ev(e){if(e)return e}function Xs(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}function Hu(e,t=n=>n){const n=he(t(e.state));return Ae(()=>e,(o,i,a)=>{const r=o.subscribe(()=>{const s=t(o.state);Q8(Gw(n.value),s)||(n.value=s)});a(()=>{r()})},{immediate:!0}),Pv(n)}function Q8(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,i]of e)if(!t.has(o)||!Object.is(i,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Object.is(e[n[o]],t[n[o]]))return!1;return!0}function kw(e){const t=(()=>{const a=new J8({...e,form:e.form,name:e.name});return a.Field=Sw,a})(),n=Hu(t.store,i=>i);let o;return Dr(()=>{o=t.mount()}),Wu(()=>{o()}),Ae(()=>e,()=>{t.update({...e,form:e.form})}),{api:t,state:n}}const Sw=E((e,t)=>{const n=kw({...e,...t.attrs});return()=>t.slots.default({field:n.api,state:n.state.value})},{name:"Field",inheritAttrs:!1});function ez(e){const t=(()=>{const n=new Z8(e),o=n;return o.Field=E((i,a)=>()=>at(Sw,{...i,...a.attrs,form:n},a.slots),{name:"APIField",inheritAttrs:!1}),o.useField=i=>kw({...i,form:n}),o.useStore=i=>Hu(n.store,i),o.Subscribe=E((i,a)=>{const s={...i,...a.attrs}.selector??(c=>c),l=Hu(n.store,s);return()=>a.slots.default(l.value)},{name:"Subscribe",inheritAttrs:!1}),o})();return Dr(t.mount),t.update(e),t}const tz=E({__name:"DynamicFormWrapper",props:{configMap:{},baseKey:{},currentStep:{}},setup(e,{expose:t}){const n=e,o=ez({defaultValues:Nc(n.configMap)}),i=Vv("formRef");ju(Dt,o);async function a(){const r=await i.value.validate();return n.currentStep?tp(r,[...n.currentStep.properties,"credential_guid_body","credential_property_id"]):r}return t({validate:a,form:o}),(r,s)=>{const l=bw;return w(),S(l,F({ref:"formRef"},n),null,16)}}}),nz=Object.assign(tz,{__name:"DynamicFormWrapper"});async function oz(){const{data:e}=await es("configmaps",()=>$fetch("/workflows/v1/configmaps")),t=T(()=>{const a=e.value?.data??[];return(Array.isArray(a)?a:a.configmaps).find(s=>!s.startsWith("atlan-connectors-")&&s!=="manifest")??"workflow"}),{credentialConfig:n,data:o}=await tw(t),i=T(()=>{const a=o.value?.data,r=a&&"kind"in a?a.metadata?.name:void 0,s=a&&"kind"in a?a.metadata?.name:a?.name,l=a&&"kind"in a?a.metadata?.logo:a?.logo;return{id:r||t.value,name:n.value?.name||s||t.value,logo:n.value?.logo||l||"",config:n.value}});return{workflowConfig:n,workflowMeta:i}}const iz={class:"min-h-screen bg-gray-50 py-8 flex flex-col"},az={class:"w-[700px] mx-auto px-4 flex flex-col flex-1"},rz={class:"flex items-center justify-between mb-8"},sz={class:"flex items-center gap-4"},lz=["src"],cz={class:"mb-8 overflow-x-auto pb-3"},dz={class:"bg-white rounded-lg shadow-sm p-8 flex gap-8 grow"},uz={class:"flex-1 w-full"},hz={class:"flex justify-between py-3 border-t"},pz={key:2,class:"flex ml-auto gap-x-2"},fz={key:3,class:"flex ml-auto gap-x-2"},Tz=E({__name:"index",async setup(e){let t,n;const{workflowConfig:o,workflowMeta:i}=([t,n]=Rr(()=>oz()),t=await t,n(),t);qw(()=>({title:i.value.name?`${i.value.name} | App Playground`:"App Playground"}));const a=he(1),r=T(()=>o.value.steps||[]),s=T(()=>r.value?r.value[a.value-1]:{}),l=T(()=>r.value.map(b=>({...b,value:b.id}))),c=he(!1),d=he({}),u=he(""),h=he(!1),p=Vv("formRef");async function m(){let b=YB(await p.value.validate(),x=>Xx(x)||Kx(x)?JSON.stringify(x):x);const g=b.credential_guid_body,y=b.credential_property_id;return b=Zx(b,["credential_guid_body","credential_property_id",y]),d.value={...d.value,[s.value.id]:b},{...d.value,connection:{connection_name:"test-connection",connection_qualified_name:`default/${i.value.id}/${Math.round(new Date().getTime()/1e3)}`},...g?{credentials:JSON.parse(g)}:{},metadata:Object.assign({},...Object.values(d.value))}}ju(Yx,m);async function f(){c.value=!0,u.value="";try{const b=await m();if(a.value===r.value.length){try{await $fetch("/workflows/v1/start",{method:"POST",body:b}),a.value=1,d.value={},p.value.form.reset(),Hi.success("Workflow started successfully!",{placement:"top",duration:3e3})}catch{Hi.failed("Failed to start workflow. Please try again.",{placement:"top",duration:3e3})}return}a.value=a.value+1}catch(b){Hi.failed("Failed to validate form: "+b.message,{placement:"top"})}finally{c.value=!1}}return(b,g)=>{const y=nz;return w(),H("div",iz,[U("div",az,[U("div",rz,[U("div",sz,[U("img",{src:v(i).logo,alt:"App Logo",class:"w-16 h-16"},null,8,lz),z(v(wA),{as:"h1",size:"xl"},{default:_(()=>[Te(oe(v(i).name)+" App ",1)]),_:1})])]),U("div",cz,[z(v(SF),{items:v(l),"model-value":v(a),orientation:"horizontal",type:"default",onStepChange:g[0]||(g[0]=x=>a.value=x)},null,8,["items","model-value"])]),U("div",dz,[U("div",uz,[z(y,{ref:"formRef","current-step":v(s),"config-map":v(o)},null,8,["current-step","config-map"])])]),U("div",hz,[v(a)>0?(w(),S(v(Xt),{key:0,type:"subtle",label:"Back",onClick:g[1]||(g[1]=()=>{a.value=v(a)-1})})):te("",!0),v(a)<v(r).length?(w(),S(v(Xt),{key:1,label:"Next",class:"ml-auto","is-loading":v(c),onClick:f},null,8,["is-loading"])):v(a)===v(r).length&&!v(h)?(w(),H("div",pz,[v(u)?(w(),S(v(Xt),{key:1,label:"Retry",type:"subtle","is-loading":v(c),onClick:f},null,8,["is-loading"])):(w(),S(v(Xt),{key:0,label:"Start Workflow","is-loading":v(c),onClick:f},null,8,["is-loading"]))])):v(h)?(w(),H("div",fz,[z(v(Xt),{label:"Workflow Started!",type:"success",disabled:!0})])):te("",!0)])])])}}});export{Tz as default};
|