@gentbajko/slopify 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -80,5 +80,12 @@ export async function executeYoutubeRecipe(deps, context, providers, piece) {
|
|
|
80
80
|
["youtube_description", "description.txt", description],
|
|
81
81
|
["youtube_tags", "tags.txt", tags],
|
|
82
82
|
]), { description, tags: checked.value.tags, chapters: checked.value.chapters, durationSeconds });
|
|
83
|
+
deps.count?.("stage.completed", {
|
|
84
|
+
provider: llm.provider,
|
|
85
|
+
model: llm.model,
|
|
86
|
+
tokensIn: answer.value.usage?.inputTokens ?? 0,
|
|
87
|
+
tokensOut: answer.value.usage?.outputTokens ?? 0,
|
|
88
|
+
descriptions: 1,
|
|
89
|
+
});
|
|
83
90
|
return "done";
|
|
84
91
|
}
|
|
@@ -34,4 +34,7 @@ export const payloadSchema = z.strictObject({
|
|
|
34
34
|
audioSeconds: z.number().nonnegative().finite().optional(),
|
|
35
35
|
images: z.number().int().nonnegative().optional(),
|
|
36
36
|
thumbnails: z.number().int().nonnegative().optional(),
|
|
37
|
+
// A written YouTube description. Its event names no stage: it is made inside the Video
|
|
38
|
+
// stage, and a collector counting stage "video" as a finished video must not count it.
|
|
39
|
+
descriptions: z.number().int().nonnegative().optional(),
|
|
37
40
|
});
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+e.message+`
|
|
|
46
46
|
`},bf=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},xf=function(){m.useEffect(function(){return document.body.setAttribute(vf,(bf()+1).toString()),function(){var e=bf()-1;e<=0?document.body.removeAttribute(vf):document.body.setAttribute(vf,e.toString())}},[])},Sf=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;xf();var a=m.useMemo(function(){return gf(i)},[i]);return m.createElement(_f,{styles:yf(a,!t,i,n?``:`!important`)})},Cf=!1;if(typeof window<`u`)try{var wf=Object.defineProperty({},"passive",{get:function(){return Cf=!0,!0}});window.addEventListener(`test`,wf,wf),window.removeEventListener(`test`,wf,wf)}catch{Cf=!1}var Tf=Cf?{passive:!1}:!1,Ef=function(e){return e.tagName===`TEXTAREA`},Df=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ef(e)&&n[t]===`visible`)},Of=function(e){return Df(e,`overflowY`)},kf=function(e){return Df(e,`overflowX`)},Af=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Nf(e,r)){var i=Pf(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jf=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Mf=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Nf=function(e,t){return e===`v`?Of(t):kf(t)},Pf=function(e,t){return e===`v`?jf(t):Mf(t)},Ff=function(e,t){return e===`h`&&t===`rtl`?-1:1},If=function(e,t,n,r,i){var a=Ff(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Pf(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Nf(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Lf=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rf=function(e){return[e.deltaX,e.deltaY]},zf=function(e){return e&&`current`in e?e.current:e},Bf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vf=function(e){return`
|
|
47
47
|
.block-interactivity-${e} {pointer-events: none;}
|
|
48
48
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
49
|
-
`},Hf=0,Uf=[];function Wf(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(Hf++)[0],a=m.useState(ff)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Vd([e.lockRef.current],(e.shards||[]).map(zf),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Lf(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Af(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Af(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return If(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(Uf.length&&Uf[Uf.length-1]===a){var r=`deltaY`in n?Rf(n):Lf(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Bf(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(zf).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Gf(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=Lf(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,Rf(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,Lf(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return Uf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Tf),document.addEventListener(`touchmove`,c,Tf),document.addEventListener(`touchstart`,u,Tf),function(){Uf=Uf.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Tf),document.removeEventListener(`touchmove`,c,Tf),document.removeEventListener(`touchstart`,u,Tf)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:Vf(i)}):null,p?m.createElement(Sf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Kf=tf(nf,Wf),qf=m.forwardRef(function(e,t){return m.createElement(af,zd({},e,{ref:t,sideCar:Kf}))});qf.classNames=af.classNames;var Jf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Yf=new WeakMap,Xf=new WeakMap,Zf={},Qf=0,$f=function(e){return e&&(e.host||$f(e.parentNode))},ep=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=$f(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},tp=function(e,t,n,r){var i=ep(t,Array.isArray(e)?e:[e]);Zf[n]||(Zf[n]=new WeakMap);var a=Zf[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Yf.get(e)||0)+1,l=(a.get(e)||0)+1;Yf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Xf.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Qf++,function(){o.forEach(function(e){var t=Yf.get(e)-1,i=a.get(e)-1;Yf.set(e,t),a.set(e,i),t||(Xf.has(e)||e.removeAttribute(r),Xf.delete(e)),i||e.removeAttribute(n)}),Qf--,Qf||(Yf=new WeakMap,Yf=new WeakMap,Xf=new WeakMap,Zf={})}},np=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Jf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),tp(r,i,n,`aria-hidden`)):function(){return null}},rp=Object.defineProperty,ip=(e,t)=>rp(e,`name`,{value:t,configurable:!0}),ap=`Dialog`,[op,sp]=Yl(ap),[cp,lp]=op(ap),up=ip(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=Du({prop:r,defaultProp:i??!1,onChange:a,caller:ap}),[d,f]=m.useState(0),[p,g]=m.useState(0);return(0,h.jsx)(cp,{scope:t,triggerRef:s,contentRef:c,contentId:Gu(),titleId:Gu(),descriptionId:Gu(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:g,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),dp=`DialogPortal`,[fp,pp]=op(dp,{forceMount:void 0}),mp=ip(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=lp(dp,t);return(0,h.jsx)(fp,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,h.jsx)(Fu,{present:n||a.open,children:(0,h.jsx)(jd,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),hp=`DialogOverlay`,gp=m.forwardRef(ip(function(e,t){let n=pp(hp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=lp(hp,e.__scopeDialog);return a.modal?(0,h.jsx)(Fu,{present:r||a.open,children:(0,h.jsx)(vp,{...i,ref:t})}):null},`DialogOverlay`)),_p=El(`DialogOverlay.RemoveScroll`),vp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,...r}=e,i=lp(hp,n),a=Cl(t,sd());return(0,h.jsx)(qf,{as:_p,allowPinchZoom:!0,shards:[i.contentRef],children:(0,h.jsx)(Ul.div,{"data-state":Op(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),yp=`DialogContent`,bp=m.forwardRef(ip(function(e,t){let n=pp(yp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=lp(yp,e.__scopeDialog);return(0,h.jsx)(Fu,{present:r||a.open,children:a.modal?(0,h.jsx)(xp,{...i,ref:t}):(0,h.jsx)(Sp,{...i,ref:t})})},`DialogContent`)),xp=m.forwardRef(ip(function(e,t){let n=lp(yp,e.__scopeDialog),r=m.useRef(null),i=Cl(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return np(e)},[]),(0,h.jsx)(Cp,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:pu(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:pu(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:pu(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Sp=m.forwardRef(ip(function(e,t){let n=lp(yp,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,h.jsx)(Cp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Cp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=lp(yp,n);return Ld(),(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(vd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(od,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Op(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),wp=`DialogTitle`,Tp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,...r}=e,i=lp(wp,n),{setTitleCount:a}=i;return vu(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,h.jsx)(Ul.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Ep=`DialogDescription`,Dp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,...r}=e,i=lp(Ep,n),{setDescriptionCount:a}=i;return vu(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,h.jsx)(Ul.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`));function Op(e){return e?`open`:`closed`}ip(Op,`getState`);var kp=Object.defineProperty,Ap=(e,t)=>kp(e,`name`,{value:t,configurable:!0});function jp(e){let[t,n]=m.useState(void 0);return vu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Ap(jp,`useSize`);var Mp=[`top`,`right`,`bottom`,`left`],Np=Math.min,Pp=Math.max,Fp=Math.round,Ip=Math.floor,Lp=e=>({x:e,y:e}),Rp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function zp(e,t,n){return Pp(e,Np(t,n))}function Bp(e,t){return typeof e==`function`?e(t):e}function Vp(e){return e.split(`-`)[0]}function Hp(e){return e.split(`-`)[1]}function Up(e){return e===`x`?`y`:`x`}function Wp(e){return e===`y`?`height`:`width`}function Gp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Kp(e){return Up(Gp(e))}function qp(e,t,n){n===void 0&&(n=!1);let r=Hp(e),i=Kp(e),a=Wp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=nm(o)),[o,nm(o)]}function Jp(e){let t=nm(e);return[Yp(e),t,Yp(t)]}function Yp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xp=[`left`,`right`],Zp=[`right`,`left`],Qp=[`top`,`bottom`],$p=[`bottom`,`top`];function em(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Zp:Xp:t?Xp:Zp;case`left`:case`right`:return t?Qp:$p;default:return[]}}function tm(e,t,n,r){let i=Hp(e),a=em(Vp(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Yp)))),a}function nm(e){let t=Vp(e);return Rp[t]+e.slice(t.length)}function rm(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function im(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:rm(e)}function am(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function om(e,t,n){let{reference:r,floating:i}=e,a=Gp(t),o=Kp(t),s=Wp(o),c=Vp(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Hp(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function sm(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Bp(t,e),p=im(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=am(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=am(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var cm=50,lm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:sm},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=om(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<cm&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=om(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},um=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Bp(e,t)||{};if(l==null)return{};let d=im(u),f={x:n,y:r},p=Kp(i),m=Wp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Np(d[_],T),D=Np(d[v],T),O=C-h[m]-D,ee=C/2-h[m]/2+w,te=zp(E,ee,O),k=!c.arrow&&Hp(i)!=null&&ee!==te&&a.reference[m]/2-(ee<E?E:D)-h[m]/2<0,A=k?ee<E?ee-E:ee-O:0;return{[p]:f[p]+A,data:{[p]:te,centerOffset:ee-te-A,...k&&{alignmentOffset:A}},reset:k}}}),dm=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Bp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Vp(r),_=Gp(o),v=Vp(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[nm(o)]:Jp(o)),x=p!==`none`;!d&&x&&b.push(...tm(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=qp(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Gp(t)||T.every(e=>Gp(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Gp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function fm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pm(e){return Mp.some(t=>e[t]>=0)}var mm=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Bp(e,t);switch(i){case`referenceHidden`:{let e=fm(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:pm(e)}}}case`escaped`:{let e=fm(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:pm(e)}}}default:return{}}}}},hm=new Set([`left`,`top`]);async function gm(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Vp(n),s=Hp(n),c=Gp(n)===`y`,l=hm.has(o)?-1:1,u=a&&c?-1:1,d=Bp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var _m=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await gm(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},vm=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Bp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Gp(i),p=Up(f),m=u[p],h=u[f],g=(e,t)=>zp(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ym=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Bp(e,t),u={x:n,y:r},d=Gp(i),f=Up(d),p=u[f],m=u[d],h=Bp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=hm.has(Vp(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},bm=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Bp(e,t),c=await i.detectOverflow(t,s),l=Vp(n),u=Hp(n),d=Gp(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Np(p-c[m],g),y=Np(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Pp(c.left,c.right):S=p-2*Pp(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function xm(){return typeof window<`u`}function Sm(e){return Tm(e)?(e.nodeName||``).toLowerCase():`#document`}function Cm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wm(e){return((Tm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Tm(e){return xm()?e instanceof Node||e instanceof Cm(e).Node:!1}function Em(e){return xm()?e instanceof Element||e instanceof Cm(e).Element:!1}function Dm(e){return xm()?e instanceof HTMLElement||e instanceof Cm(e).HTMLElement:!1}function Om(e){return!xm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Cm(e).ShadowRoot}function km(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Bm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Am(e){return/^(table|td|th)$/.test(Sm(e))}function jm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Mm=/transform|translate|scale|rotate|perspective|filter/,Nm=/paint|layout|strict|content/,Pm=e=>!!e&&e!==`none`,Fm;function Im(e){let t=Em(e)?Bm(e):e;return Pm(t.transform)||Pm(t.translate)||Pm(t.scale)||Pm(t.rotate)||Pm(t.perspective)||!Rm()&&(Pm(t.backdropFilter)||Pm(t.filter))||Mm.test(t.willChange||``)||Nm.test(t.contain||``)}function Lm(e){let t=Hm(e);for(;Dm(t)&&!zm(t);){if(Im(t))return t;if(jm(t))return null;t=Hm(t)}return null}function Rm(){return Fm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Fm}function zm(e){return/^(html|body|#document)$/.test(Sm(e))}function Bm(e){return Cm(e).getComputedStyle(e)}function Vm(e){return Em(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hm(e){if(Sm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Om(e)&&e.host||wm(e);return Om(t)?t.host:t}function Um(e){let t=Hm(e);return zm(t)?(e.ownerDocument||e).body:Dm(t)&&km(t)?t:Um(t)}function Wm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Um(e),i=r===e.ownerDocument?.body,a=Cm(r);if(i){let e=Gm(a);return t.concat(a,a.visualViewport||[],km(r)?r:[],e&&n?Wm(e):[])}return t.concat(r,Wm(r,[],n))}function Gm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Km(e){let t=Bm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Dm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Fp(n)!==a||Fp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function qm(e){return Em(e)?e:e.contextElement}function Jm(e){let t=qm(e);if(!Dm(t))return Lp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Km(t),o=(a?Fp(n.width):n.width)/r,s=(a?Fp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ym=Lp(0);function Xm(e){let t=Cm(e);return!Rm()||!t.visualViewport?Ym:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zm(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Cm(e)}function Qm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=qm(e),o=Lp(1);t&&(r?Em(r)&&(o=Jm(r)):o=Jm(e));let s=Zm(a,n,r)?Xm(a):Lp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Cm(a),t=Em(r)?Cm(r):r,n=e,i=Gm(n);for(;i&&t!==n;){let e=Jm(i),t=i.getBoundingClientRect(),r=Bm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Cm(i),i=Gm(n)}}return am({width:u,height:d,x:c,y:l})}function $m(e,t){let n=Vm(e).scrollLeft;return t?t.left+n:Qm(wm(e)).left+n}function eh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-$m(e,n),y:n.top+t.scrollTop}}function th(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=wm(r),s=t?jm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Lp(1),u=Lp(0),d=Dm(r);if((d||!a)&&((Sm(r)!==`body`||km(o))&&(c=Vm(r)),d)){let e=Qm(r);l=Jm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?eh(o,c):Lp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function nh(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function rh(e){let t=Vm(e),n=e.ownerDocument.body,r=Pp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Pp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+$m(e),o=-t.scrollTop;return Bm(n).direction===`rtl`&&(a+=Pp(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ih=25;function ah(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Cm(e),a=wm(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Rm()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if($m(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ih&&(s-=o)}return{width:s,height:c,x:l,y:u}}function oh(e,t){let n=Qm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Jm(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function sh(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ah(e,n,t);else if(t===`document`)r=rh(wm(e));else if(Em(t))r=oh(t,n);else{let n=Xm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return am(r)}function ch(e,t){let n=t.get(e);if(n)return n;let r=Wm(e,[],!1).filter(e=>Em(e)&&Sm(e)!==`body`),i=null,a=Bm(e).position===`fixed`,o=a?Hm(e):e;for(;Em(o)&&!zm(o);){let e=Bm(o),t=Im(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Hm(o)}return t.set(e,r),r}function lh(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?jm(t)?[]:ch(t,this._c):[].concat(n),r],o=sh(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=sh(t,a[e],i);s=Pp(n.top,s),c=Np(n.right,c),l=Np(n.bottom,l),u=Pp(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function uh(e){let{width:t,height:n}=Km(e);return{width:t,height:n}}function dh(e,t,n){let r=Dm(t),i=wm(t),a=n===`fixed`,o=Qm(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Lp(0);if((r||!a)&&((Sm(t)!==`body`||km(i))&&(s=Vm(t)),r)){let e=Qm(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=$m(i));let l=i&&!r&&!a?eh(i,s):Lp(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function fh(e){return Bm(e).position===`static`}function ph(e,t){if(!Dm(e)||Bm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return wm(e)===n&&(n=n.ownerDocument.body),n}function mh(e,t){let n=Cm(e);if(jm(e))return n;if(!Dm(e)){let t=Hm(e);for(;t&&!zm(t);){if(Em(t)&&!fh(t))return t;t=Hm(t)}return n}let r=ph(e,t);for(;r&&Am(r)&&fh(r);)r=ph(r,t);return r&&zm(r)&&fh(r)&&!Im(r)?n:r||Lm(e)||n}var hh=async function(e){let t=this.getOffsetParent||mh,n=this.getDimensions,r=await n(e.floating);return{reference:dh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gh(e){return Bm(e).direction===`rtl`}var _h={convertOffsetParentRelativeRectToViewportRelativeRect:th,getDocumentElement:wm,getClippingRect:lh,getOffsetParent:mh,getElementRects:hh,getClientRects:nh,getDimensions:uh,getScale:Jm,isElement:Em,isRTL:gh};function vh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yh(e,t,n){let r=null,i,a=wm(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ip(d),h=Ip(a.clientWidth-(u+f)),g=Ip(a.clientHeight-(d+p)),_=Ip(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Pp(0,Np(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!vh(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Cm(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function bh(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=qm(e),u=i||a?[...l?Wm(l):[],...t?Wm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?yh(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Qm(e):null;c&&g();function g(){let t=Qm(e);h&&!vh(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var xh=_m,Sh=vm,Ch=dm,wh=bm,Th=mm,Eh=um,Dh=ym,Oh=(e,t,n)=>{let r=new Map,i=n??{},a={..._h,...i.platform,_c:r};return lm(e,t,{...i,platform:a})},kh=typeof document<`u`?m.useLayoutEffect:function(){};function Ah(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ah(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ah(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function jh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mh(e,t){let n=jh(e);return Math.round(t*n)/n}function Nh(e){let t=m.useRef(e);return kh(()=>{t.current=e}),t}function Ph(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Ah(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=Nh(c),O=Nh(i),ee=Nh(l),te=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Oh(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};k.current&&!Ah(T.current,t)&&(T.current=t,Bl.flushSync(()=>{d(t)}))})},[f,t,n,O,ee]);kh(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=m.useRef(!1);kh(()=>(k.current=!0,()=>{k.current=!1}),[]),kh(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,te);te()}},[x,S,te,D,E]);let A=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),j=m.useMemo(()=>({reference:x,floating:S}),[x,S]),M=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Mh(j.floating,u.x),r=Mh(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...jh(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:te,refs:A,elements:j,floatingStyles:M}),[u,te,A,j,M])}var Fh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Eh({element:r.current,padding:i}).fn(n):r?Eh({element:r,padding:i}).fn(n):{}}}},Ih=(e,t)=>{let n=xh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lh=(e,t)=>{let n=Sh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rh=(e,t)=>({fn:Dh(e).fn,options:[e,t]}),zh=(e,t)=>{let n=Ch(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bh=(e,t)=>{let n=wh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vh=(e,t)=>{let n=Th(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hh=(e,t)=>{let n=Fh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uh=Object.defineProperty,Wh=(e,t)=>Uh(e,`name`,{value:t,configurable:!0}),Gh=`Popper`,[Kh,qh]=Yl(Gh),[Jh,Yh]=Kh(Gh),Xh=Wh(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,h.jsx)(Jh,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Zh=`PopperAnchor`,Qh=m.forwardRef(Wh(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Yh(Zh,n),o=m.useRef(null),s=a.onAnchorChange,c=Cl(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ag(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,h.jsx)(Ul.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),$h=`PopperContent`,[eg,tg]=Kh($h),ng=m.forwardRef(Wh(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:g,..._}=e,v=Yh($h,n),[y,b]=m.useState(null),x=Cl(t,b),[S,C]=m.useState(null),w=jp(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],te=ee.length>0,k={padding:O,boundary:ee.filter(rg),altBoundary:te},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=Ph({strategy:`fixed`,placement:D,whileElementsMounted:Wh((...e)=>bh(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Ih({mainAxis:i+E,alignmentAxis:o}),c&&Lh({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Rh():void 0,...k}),c&&zh({...k}),Bh({...k,apply:Wh(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Hh({element:S,padding:s}),ig({arrowWidth:T,arrowHeight:E}),f&&Vh({strategy:`referenceHidden`,...k,boundary:te?k.boundary:void 0})]}),ne=v.setPlacementState;vu(()=>(ne(M),()=>{ne(void 0)}),[M,ne]);let[re,ie]=ag(M),ae=Qu(g);vu(()=>{N&&ae?.()},[N,ae]);let oe=P.arrow?.x,se=P.arrow?.y,ce=P.arrow?.centerOffset!==0,[le,ue]=m.useState();return vu(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),(0,h.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,h.jsx)(eg,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,h.jsx)(Ul.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:N?_.style?.animation:`none`}})})})},`PopperContent`));function rg(e){return e!==null}Wh(rg,`isNotNull`);var ig=Wh(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ag(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ag(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Wh(ag,`getSideAndAlignFromPlacement`);var og=Xh,sg=Qh,cg=ng,lg=Object.defineProperty,ug=(e,t)=>lg(e,`name`,{value:t,configurable:!0}),dg=!1;function fg(){let[e,t]=m.useState(dg);return m.useEffect(()=>{dg||(dg=!0,t(!0))},[]),e}ug(fg,`useIsHydrated`);var pg=m.useSyncExternalStore;function mg(){return()=>{}}ug(mg,`subscribe`);function hg(){return pg(mg,()=>!0,()=>!1)}ug(hg,`useIsHydratedModern`);var gg=typeof pg==`function`?hg:fg,_g=Object.defineProperty,vg=(e,t)=>_g(e,`name`,{value:t,configurable:!0}),yg=`rovingFocusGroup.onEntryFocus`,bg={bubbles:!1,cancelable:!0},xg=`RovingFocusGroup`,[Sg,Cg,wg]=$l(xg),[Tg,Eg]=Yl(xg,[wg]),[Dg,Og]=Tg(xg),kg=m.forwardRef(vg(function(e,t){return(0,h.jsx)(Sg.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(Sg.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(Ag,{...e,ref:t})})})},`RovingFocusGroup`)),Ag=m.forwardRef(vg(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=Cl(t,f),g=Yu(a),[_,v]=Du({prop:o,defaultProp:s??null,onChange:c,caller:xg}),[y,b]=m.useState(!1),x=Qu(l),S=Cg(n),C=m.useRef(!1),[w,T]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(yg,x),()=>e.removeEventListener(yg,x)},[x]),(0,h.jsx)(Dg,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:m.useCallback(e=>v(e),[v]),onItemShiftTab:m.useCallback(()=>b(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>T(e=>e-1),[]),children:(0,h.jsx)(Ul.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:pu(e.onMouseDown,()=>{C.current=!0}),onFocus:pu(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(yg,bg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Ig([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}C.current=!1}),onBlur:pu(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),jg=`RovingFocusGroupItem`,Mg=m.forwardRef(vg(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Gu(),l=a||c,u=Og(jg,n),d=u.currentTabStopId===l,f=Cg(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:_}=u,v=gg();return vu(()=>{if(v&&r)return p(),()=>g()},[v,r,p,g]),m.useEffect(()=>{if(!v&&r)return p(),()=>g()},[v,r,p,g]),(0,h.jsx)(Sg.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,h.jsx)(Ul.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:pu(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:pu(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:pu(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Fg(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Lg(n,r+1):n.slice(r+1)}setTimeout(()=>Ig(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Ng={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Pg(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}vg(Pg,`getDirectionAwareKey`);function Fg(e,t,n){let r=Pg(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ng[r]}vg(Fg,`getFocusIntent`);function Ig(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}vg(Ig,`focusFirst`);function Lg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}vg(Lg,`wrapArray`);var Rg=kg,zg=Mg,Bg=Object.defineProperty,Vg=(e,t)=>Bg(e,`name`,{value:t,configurable:!0}),Hg=[`Enter`,` `],Ug=[`ArrowDown`,`PageUp`,`Home`],Wg=[`ArrowUp`,`PageDown`,`End`],Gg=[...Ug,...Wg];[...Hg],[...Hg];var Kg=`Menu`,[qg,Jg,Yg]=$l(Kg),[Xg,Zg]=Yl(Kg,[Yg,qh,Eg]),Qg=qh(),$g=Eg(),[e_,t_]=Xg(Kg),[n_,r_]=Xg(Kg),i_=Vg(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Qg(t),[c,l]=m.useState(null),u=m.useRef(!1),d=Qu(a),f=Yu(i);return m.useEffect(()=>{let e=Vg(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Vg(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),m.useEffect(()=>{if(!n)return;let e=Vg(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,h.jsx)(og,{...s,children:(0,h.jsx)(e_,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,h.jsx)(n_,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),a_=m.forwardRef(Vg(function(e,t){let{__scopeMenu:n,...r}=e,i=Qg(n);return(0,h.jsx)(sg,{...i,...r,ref:t})},`MenuAnchor`)),o_=`MenuPortal`,[s_,c_]=Xg(o_,{forceMount:void 0}),l_=Vg(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=t_(o_,t);return(0,h.jsx)(s_,{scope:t,forceMount:n,children:(0,h.jsx)(Fu,{present:n||a.open,children:(0,h.jsx)(jd,{asChild:!0,container:i,children:r})})})},`MenuPortal`),u_=`MenuContent`,[d_,f_]=Xg(u_),p_=m.forwardRef(Vg(function(e,t){let n=c_(u_,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=t_(u_,e.__scopeMenu),o=r_(u_,e.__scopeMenu);return(0,h.jsx)(qg.Provider,{scope:e.__scopeMenu,children:(0,h.jsx)(Fu,{present:r||a.open,children:(0,h.jsx)(qg.Slot,{scope:e.__scopeMenu,children:o.modal?(0,h.jsx)(m_,{...i,ref:t}):(0,h.jsx)(h_,{...i,ref:t})})})})},`MenuContent`)),m_=m.forwardRef(Vg(function(e,t){let n=t_(u_,e.__scopeMenu),r=m.useRef(null),i=Cl(t,r);return m.useEffect(()=>{let e=r.current;if(e)return np(e)},[]),(0,h.jsx)(__,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:pu(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),h_=m.forwardRef(Vg(function(e,t){let n=t_(u_,e.__scopeMenu);return(0,h.jsx)(__,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),g_=El(`MenuContent.ScrollLock`),__=m.forwardRef(Vg(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:g,..._}=e,v=t_(u_,n),y=r_(u_,n),b=Qg(n),x=$g(n),S=Jg(n),[C,w]=m.useState(null),T=m.useRef(null),E=Cl(t,T,v.onContentChange),D=m.useRef(0),O=m.useRef(``),ee=m.useRef(0),te=m.useRef(null),k=m.useRef(`right`),A=m.useRef(0),j=g?qf:m.Fragment,M=g?{as:g_,allowPinchZoom:!0}:void 0,N=Vg(e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=N_(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;Vg((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);m.useEffect(()=>()=>window.clearTimeout(D.current),[]),Ld();let P=m.useCallback(e=>k.current===te.current?.side&&F_(e,te.current?.area),[]);return(0,h.jsx)(d_,{scope:n,searchRef:O,onItemEnter:m.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:m.useCallback(e=>{P(e)||(T.current?.focus(),w(null))},[P]),onTriggerLeave:m.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:m.useCallback(e=>{te.current=e},[]),children:(0,h.jsx)(j,{...M,children:(0,h.jsx)(vd,{asChild:!0,trapped:i,onMountAutoFocus:pu(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,h.jsx)(od,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,h.jsx)(Rg,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:pu(c,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,h.jsx)(cg,{role:`menu`,"aria-orientation":`vertical`,"data-state":O_(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:pu(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=T.current;if(e.target!==i||!Gg.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Wg.includes(e.key)&&a.reverse(),j_(a)}),onBlur:pu(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:pu(e.onPointerMove,I_(e=>{let t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>A.current?`right`:`left`;k.current=t,A.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),v_=`MenuItem`,y_=`menu.itemSelect`,b_=m.forwardRef(Vg(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=m.useRef(null),o=r_(v_,e.__scopeMenu),s=f_(v_,e.__scopeMenu),c=Cl(t,a),l=m.useRef(!1),u=Vg(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(y_,{bubbles:!0,cancelable:!0});e.addEventListener(y_,e=>r?.(e),{once:!0}),Wl(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,h.jsx)(x_,{...i,ref:c,disabled:n,onClick:pu(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:pu(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:pu(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Hg.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),x_=m.forwardRef(Vg(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=f_(v_,n),s=$g(n),c=m.useRef(null),l=Cl(t,c),[u,d]=m.useState(!1),[f,p]=m.useState(``);return m.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,h.jsx)(qg.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,h.jsx)(zg,{asChild:!0,...s,focusable:!r,children:(0,h.jsx)(Ul.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:pu(e.onPointerMove,I_(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pu(e.onPointerLeave,I_(e=>o.onItemLeave(e))),onFocus:pu(e.onFocus,()=>d(!0)),onBlur:pu(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[S_,C_]=Xg(`MenuRadioGroup`,{value:void 0,onValueChange:Vg(()=>{},`onValueChange`)}),[w_,T_]=Xg(`MenuItemIndicator`,{checked:!1}),[E_,D_]=Xg(`MenuSub`);function O_(e){return e?`open`:`closed`}Vg(O_,`getOpenState`);function k_(e){return e===`indeterminate`}Vg(k_,`isIndeterminate`);function A_(e){return k_(e)?`indeterminate`:e?`checked`:`unchecked`}Vg(A_,`getCheckedState`);function j_(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Vg(j_,`focusFirst`);function M_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Vg(M_,`wrapArray`);function N_(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=M_(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Vg(N_,`getNextMatch`);function P_(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Vg(P_,`isPointInPolygon`);function F_(e,t){return t?P_({x:e.clientX,y:e.clientY},t):!1}Vg(F_,`isPointerInGraceArea`);function I_(e){return t=>t.pointerType===`mouse`?e(t):void 0}Vg(I_,`whenMouse`);var L_=i_,R_=a_,z_=l_,B_=p_,V_=b_,H_=Object.defineProperty,U_=(e,t)=>H_(e,`name`,{value:t,configurable:!0}),W_=`DropdownMenu`,[G_,K_]=Yl(W_,[Zg]),q_=Zg(),[J_,Y_]=G_(W_),X_=U_(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=q_(t),l=m.useRef(null),[u,d]=Du({prop:i,defaultProp:a??!1,onChange:o,caller:W_});return(0,h.jsx)(J_,{scope:t,triggerId:Gu(),triggerRef:l,contentId:Gu(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,h.jsx)(L_,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Z_=`DropdownMenuTrigger`,Q_=m.forwardRef(U_(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Y_(Z_,n),o=q_(n),s=Cl(t,a.triggerRef);return(0,h.jsx)(R_,{asChild:!0,...o,children:(0,h.jsx)(Ul.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:pu(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:pu(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),$_=U_(e=>{let{__scopeDropdownMenu:t,...n}=e,r=q_(t);return(0,h.jsx)(z_,{...r,...n})},`DropdownMenuPortal`),ev=`DropdownMenuContent`,tv=m.forwardRef(U_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Y_(ev,n),a=q_(n),o=m.useRef(!1);return(0,h.jsx)(B_,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:pu(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:pu(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),nv=m.forwardRef(U_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=q_(n);return(0,h.jsx)(V_,{...i,...r,ref:t})},`DropdownMenuItem`)),rv=X_,iv=Q_,av=$_,ov=tv,sv=nv,cv=Object.defineProperty,lv=m.forwardRef(((e,t)=>cv(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,h.jsx)(Ul.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),uv=Object.defineProperty,dv=(e,t)=>uv(e,`name`,{value:t,configurable:!0});function fv(e){let t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}dv(fv,`usePrevious`);var pv=Object.defineProperty,mv=(e,t)=>pv(e,`name`,{value:t,configurable:!0});function hv(e,[t,n]){return Math.min(n,Math.max(t,e))}mv(hv,`clamp`);var gv=Object.defineProperty,_v=(e,t)=>gv(e,`name`,{value:t,configurable:!0}),vv=`Popover`,[yv,bv]=Yl(vv,[qh]),xv=qh(),[Sv,Cv]=yv(vv),wv=_v(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=xv(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=Du({prop:r,defaultProp:i??!1,onChange:a,caller:vv});return(0,h.jsx)(og,{...s,children:(0,h.jsx)(Sv,{scope:t,contentId:Gu(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Tv=`PopoverAnchor`,Ev=m.forwardRef(_v(function(e,t){let{__scopePopover:n,...r}=e,i=Cv(Tv,n),a=xv(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return m.useEffect(()=>(o(),()=>s()),[o,s]),(0,h.jsx)(sg,{...a,...r,ref:t})},`PopoverAnchor`)),Dv=`PopoverTrigger`,Ov=m.forwardRef(_v(function(e,t){let{__scopePopover:n,...r}=e,i=Cv(Dv,n),a=xv(n),o=Cl(t,i.triggerRef),s=(0,h.jsx)(Ul.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":zv(i.open),...r,ref:o,onClick:pu(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,h.jsx)(sg,{asChild:!0,...a,children:s})},`PopoverTrigger`)),kv=`PopoverPortal`,[Av,jv]=yv(kv,{forceMount:void 0}),Mv=_v(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Cv(kv,t);return(0,h.jsx)(Av,{scope:t,forceMount:n,children:(0,h.jsx)(Fu,{present:n||a.open,children:(0,h.jsx)(jd,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Nv=`PopoverContent`,Pv=m.forwardRef(_v(function(e,t){let n=jv(Nv,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Cv(Nv,e.__scopePopover);return(0,h.jsx)(Fu,{present:r||a.open,children:a.modal?(0,h.jsx)(Iv,{...i,ref:t}):(0,h.jsx)(Lv,{...i,ref:t})})},`PopoverContent`)),Fv=El(`PopoverContent.RemoveScroll`),Iv=m.forwardRef(_v(function(e,t){let n=Cv(Nv,e.__scopePopover),r=m.useRef(null),i=Cl(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return np(e)},[]),(0,h.jsx)(qf,{as:Fv,allowPinchZoom:!0,children:(0,h.jsx)(Rv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pu(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:pu(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:pu(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Lv=m.forwardRef(_v(function(e,t){let n=Cv(Nv,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,h.jsx)(Rv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Rv=m.forwardRef(_v(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Cv(Nv,n),p=xv(n);return Ld(),(0,h.jsx)(vd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(od,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,h.jsx)(cg,{"data-state":zv(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function zv(e){return e?`open`:`closed`}_v(zv,`getState`);var Bv=wv,Vv=Ev,Hv=Ov,Uv=Mv,Wv=Pv,Gv=Object.defineProperty,Kv=(e,t)=>Gv(e,`name`,{value:t,configurable:!0}),qv=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Jv=[` `,`Enter`],Yv=`Select`,[Xv,Zv,Qv]=$l(Yv),[$v,ey]=Yl(Yv,[Qv,qh]),ty=qh(),[ny,ry]=$v(Yv),[iy,ay]=$v(Yv);function oy(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:g,internal_do_not_use_render:_}=e,v=ty(t),[y,b]=m.useState(null),[x,S]=m.useState(null),[C,w]=m.useState(!1),T=Yu(l),[E,D]=Du({prop:r,defaultProp:i??!1,onChange:a,caller:Yv}),[O,ee]=Du({prop:o,defaultProp:s,onChange:c,caller:Yv}),te=m.useRef(null),k=m.useRef(O);m.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=Kv(()=>ee(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,ee]);let A=!y||!!g||!!y.closest(`form`),[j,M]=m.useState(new Set),N=Gu(),P=Array.from(j).map(e=>e.props.value).join(`;`),ne=m.useCallback(e=>{M(t=>new Set(t).add(e))},[]),re=m.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),ie={required:p,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:N,value:O,onValueChange:ee,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:te,disabled:f,name:u,autoComplete:d,form:g,nativeOptions:j,nativeSelectKey:P,isFormControl:A};return(0,h.jsx)(og,{...v,children:(0,h.jsx)(ny,{scope:t,...ie,children:(0,h.jsx)(Xv.Provider,{scope:t,children:(0,h.jsx)(iy,{scope:t,onNativeOptionAdd:ne,onNativeOptionRemove:re,children:Hy(_)?_(ie):n})})})})}Kv(oy,`SelectProvider`);var sy=Kv(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,h.jsx)(oy,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,h.jsxs)(h.Fragment,{children:[n,e?(0,h.jsx)(Vy,{__scopeSelect:t}):null]})})},`Select`),cy=`SelectTrigger`,ly=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=ty(n),o=ry(cy,n),s=o.disabled||r,c=Cl(t,o.onTriggerChange),l=Zv(n),u=m.useRef(`touch`),[d,f,p]=Wy(e=>{let t=l().filter(e=>!e.disabled),n=Gy(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=Kv(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,h.jsx)(sg,{asChild:!0,...a,children:(0,h.jsx)(Ul.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Uy(o.value)?``:void 0,...i,ref:c,onClick:pu(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&g(e)}),onPointerDown:pu(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:pu(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&qv.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),uy=`SelectValue`,dy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=ry(uy,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Cl(t,c.onValueNodeChange);vu(()=>{l(u)},[l,u]);let f=Uy(c.value);return(0,h.jsx)(Ul.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,h.jsx)(m.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),fy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,h.jsx)(Ul.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[py,my]=$v(`SelectPortal`,{forceMount:void 0}),hy=Kv(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,h.jsx)(py,{scope:e.__scopeSelect,forceMount:n,children:(0,h.jsx)(jd,{asChild:!0,...r})})},`SelectPortal`),gy=`SelectContent`,_y=m.forwardRef(Kv(function(e,t){let n=my(gy,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=ry(gy,e.__scopeSelect),[o,s]=m.useState();return vu(()=>{s(new DocumentFragment)},[]),(0,h.jsx)(Fu,{present:r||a.open,children:({present:e})=>e?(0,h.jsx)(Cy,{...i,ref:t}):(0,h.jsx)(vy,{...i,fragment:o})})},`SelectContent`)),vy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Bl.createPortal((0,h.jsx)(by,{scope:n,children:(0,h.jsx)(Xv.Slot,{scope:n,children:(0,h.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),yy=10,[by,xy]=$v(gy),Sy=El(`SelectContent.RemoveScroll`),Cy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=ry(gy,n),[x,S]=m.useState(null),[C,w]=m.useState(null),T=Cl(t,S),[E,D]=m.useState(null),[O,ee]=m.useState(null),te=Zv(n),[k,A]=m.useState(!1),j=m.useRef(!1);m.useEffect(()=>{if(x)return np(x)},[x]),Ld();let M=m.useCallback(e=>{let[t,...n]=te().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[te,C]),N=m.useCallback(()=>M([E,x]),[M,E,x]);m.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:ne}=b;m.useEffect(()=>{if(x){let e={x:0,y:0},t=Kv(t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},`handlePointerMove`),n=Kv(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||P(!1),document.removeEventListener(`pointermove`,t),ne.current=null},`handlePointerUp`);return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,P,ne]),m.useEffect(()=>{let e=Kv(()=>P(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[re,ie]=Wy(e=>{let t=te().filter(e=>!e.disabled),n=Gy(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(b.value!==void 0&&b.value===t||r)&&(D(e),r&&(j.current=!0))},[b.value]),oe=m.useCallback(()=>x?.focus(),[x]),se=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(b.value!==void 0&&b.value===t||r)&&ee(e)},[b.value]),ce=r===`popper`?Ty:wy,le=ce===Ty?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,h.jsx)(by,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:ae,selectedItem:E,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:N,selectedItemText:O,position:r,isPositioned:k,searchRef:re,children:(0,h.jsx)(qf,{as:Sy,allowPinchZoom:!0,children:(0,h.jsx)(vd,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:pu(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,h.jsx)(od,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,h.jsx)(ce,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...le,onPlaced:()=>A(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:pu(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=te().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),wy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=ry(gy,n),o=xy(gy,n),[s,c]=m.useState(null),[l,u]=m.useState(null),d=Cl(t,u),f=Zv(n),p=m.useRef(!1),g=m.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=m.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-yy,d=hv(a,[yy,Math.max(yy,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-yy,d=hv(a,[yy,Math.max(yy,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-yy*2,u=_.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+h+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-yy,D=c-E,O=v.offsetHeight/2,ee=v.offsetTop+O,te=m+h+ee,k=x-te;if(te<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=te+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+_.offsetTop+(e?w:0)+O)+k;s.style.height=t+`px`,_.scrollTop=te-E+_.offsetTop}s.style.margin=`${yy}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);vu(()=>x(),[x]);let[S,C]=m.useState();vu(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);let w=m.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return(0,h.jsx)(Ey,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:w,children:(0,h.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,h.jsx)(Ul.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Ty=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=yy,...a}=e,o=ty(n);return(0,h.jsx)(cg,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Ey,Dy]=$v(gy,{}),Oy=`SelectViewport`,ky=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=xy(Oy,n),o=Dy(Oy,n),s=Cl(t,a.onViewportChange),c=m.useRef(0);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,h.jsx)(Xv.Slot,{scope:n,children:(0,h.jsx)(Ul.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:pu(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-yy*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Ay,jy]=$v(`SelectGroup`),My=`SelectItem`,[Ny,Py]=$v(My),Fy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=ry(My,n),c=xy(My,n),l=s.value===r,[u,d]=m.useState(a??``),[f,p]=m.useState(!1),g=Cl(t,Qu(e=>c.itemRefCallback?.(e,r,i))),_=Gu(),v=m.useRef(`touch`),y=Kv(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,h.jsx)(Ny,{scope:n,value:r,disabled:i,textId:_,isSelected:l,onItemTextChange:m.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,h.jsx)(Xv.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,h.jsx)(Ul.div,{role:`option`,"aria-labelledby":_,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:pu(o.onFocus,()=>p(!0)),onBlur:pu(o.onBlur,()=>p(!1)),onClick:pu(o.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:pu(o.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:pu(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:pu(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pu(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:pu(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Jv.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Iy=`SelectItemText`,Ly=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=ry(Iy,n),s=xy(Iy,n),c=Py(Iy,n),l=ay(Iy,n),[u,d]=m.useState(null),f=Qu(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Cl(t,d,c.onItemTextChange,f),g=u?.textContent,_=m.useMemo(()=>(0,h.jsx)(`option`,{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=l;return vu(()=>(v(_),()=>y(_)),[v,y,_]),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ul.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Uy(o.value)?Bl.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Ry=`SelectItemIndicator`,zy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,...r}=e;return Py(Ry,n).isSelected?(0,h.jsx)(Ul.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),By=`SelectBubbleInput`,Vy=m.forwardRef(Kv(function({__scopeSelect:e,...t},n){let r=ry(By,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=m.useRef(null),g=Cl(n,p),_=i??``,v=fv(_),y=Array.from(d).some(e=>(e.props.value??``)===``);return m.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,h.jsxs)(Ul.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Gl,...t.style},ref:g,defaultValue:_,children:[Uy(i)&&!y?(0,h.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Hy(e){return typeof e==`function`}Kv(Hy,`isFunction`);function Uy(e){return e===``||e===void 0}Kv(Uy,`shouldShowPlaceholder`);function Wy(e){let t=Qu(e),n=m.useRef(``),r=m.useRef(0),i=m.useCallback(e=>{let i=n.current+e;t(i),Kv((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=m.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Kv(Wy,`useTypeaheadSearch`);function Gy(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ky(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Kv(Gy,`findNextItem`);function Ky(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Kv(Ky,`wrapArray`);var qy=Object.defineProperty,Jy=(e,t)=>qy(e,`name`,{value:t,configurable:!0}),Yy=`Toggle`,Xy=m.forwardRef(Jy(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=Du({prop:n,onChange:i,defaultProp:r??!1,caller:Yy});return(0,h.jsx)(Ul.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:pu(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Zy=Object.defineProperty,Qy=(e,t)=>Zy(e,`name`,{value:t,configurable:!0}),$y=`ToggleGroup`,[eb,tb]=Yl($y,[Eg]),nb=Eg(),rb=m.forwardRef(Qy(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,h.jsx)(ob,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,h.jsx)(sb,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${$y}\``)},`ToggleGroup`)),[ib,ab]=eb($y),ob=m.forwardRef(Qy(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Qy(()=>{},`onValueChange`),...a}=e,[o,s]=Du({prop:n,defaultProp:r??``,onChange:i,caller:$y});return(0,h.jsx)(ib,{scope:e.__scopeToggleGroup,type:`single`,value:m.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:m.useCallback(()=>s(``),[s]),children:(0,h.jsx)(ub,{...a,ref:t})})},`ToggleGroupImplSingle`)),sb=m.forwardRef(Qy(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Qy(()=>{},`onValueChange`),...a}=e,[o,s]=Du({prop:n,defaultProp:r??[],onChange:i,caller:$y}),c=m.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=m.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,h.jsx)(ib,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,h.jsx)(ub,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[cb,lb]=eb($y),ub=m.forwardRef(Qy(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=nb(n),u=Yu(o),d={dir:u,...c};return(0,h.jsx)(cb,{scope:n,rovingFocus:i,disabled:r,children:i?(0,h.jsx)(Rg,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,h.jsx)(Ul.div,{...d,ref:t})}):(0,h.jsx)(Ul.div,{...d,ref:t})})},`ToggleGroupImpl`)),db=`ToggleGroupItem`,fb=m.forwardRef(Qy(function(e,t){let n=ab(db,e.__scopeToggleGroup),r=lb(db,e.__scopeToggleGroup),i=nb(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=m.useRef(null);return r.rovingFocus?(0,h.jsx)(zg,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,h.jsx)(pb,{...s,ref:t})}):(0,h.jsx)(pb,{...s,ref:t})},`ToggleGroupItem`)),pb=m.forwardRef(Qy(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=ab(db,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,h.jsx)(Xy,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),mb=vl(`inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-sans transition-colors duration-150 ease-out motion-reduce:transition-none`,{variants:{variant:{outline:`rounded-control border border-line2 bg-panel2 text-ink hover:bg-panel2 hover:border-ink3`,accent:`rounded-control border border-accent bg-transparent text-run-text hover:bg-panel2`,primary:`rounded-control bg-accent px-[14px] font-semibold text-accent-ink hover:bg-accent-edge`,ghost:`rounded-control text-ink2 hover:bg-panel2 hover:text-ink`,danger:`rounded-control border border-red bg-transparent text-ink hover:bg-panel2`,play:`rounded-panel bg-accent text-accent-ink font-extrabold tracking-[0.02em] shadow-[0_4px_0_var(--color-accent-edge)] active:translate-y-[3px] active:shadow-[0_1px_0_var(--color-accent-edge)] motion-reduce:active:translate-y-0`},size:{default:`h-8 px-3 text-body`,play:`h-14 w-full px-4 text-row`}},defaultVariants:{variant:`outline`,size:`default`}});function B({className:e,variant:t,size:n,asChild:r=!1,...i}){let a=r?Dl:`button`;return(0,h.jsx)(a,{"data-slot":`button`,className:R(mb({variant:t,size:n}),e),...i})}var hb=up,gb=mp;function _b({className:e,...t}){return(0,h.jsx)(gp,{"data-slot":`dialog-overlay`,className:R(`fixed inset-0 z-40 bg-scrim`,e),...t})}function vb({className:e,children:t,...n}){return(0,h.jsxs)(gb,{children:[(0,h.jsx)(_b,{}),(0,h.jsx)(bp,{"data-slot":`dialog-content`,className:R(`fixed top-1/2 left-1/2 z-50 flex w-[calc(100%-2rem)] max-w-[480px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4`,`rounded-panel border border-line bg-panel p-[18px] shadow-[0_8px_24px_var(--color-shadow)]`,`data-[state=open]:animate-dialog-in motion-reduce:animate-none`,e),...n,children:t})]})}function yb({className:e,...t}){return(0,h.jsx)(Tp,{"data-slot":`dialog-title`,className:R(`text-title font-bold tracking-[-0.01em] text-ink`,e),...t})}function bb({className:e,...t}){return(0,h.jsx)(Dp,{"data-slot":`dialog-description`,className:R(`text-body text-ink2`,e),...t})}var V={projects:[`projects`],revisions:e=>[`project`,e,`revisions`],revision:(e,t)=>[`project`,e,`revision`,t],revisionFile:(e,t,n)=>[`revision-file`,e,t,n],project:e=>[`project`,e],article:(e,t=null)=>[`project`,e,`article`,t],audioPreview:(e,t)=>[`audio-preview`,e,t],file:(e,t)=>[`file`,e,t],staging:[`staging`],notice:[`notice`],usage:[`usage`],providers:[`providers`],voices:[`voices`],prompts:[`prompts`],entries:[`entries`],settings:[`settings`]};function xb(e){return rt({queryKey:V.projects,queryFn:()=>mo(e)})}function Sb(e,t){return rt({queryKey:V.project(t),queryFn:()=>ho(e,t)})}function Cb(e){return rt({queryKey:V.notice,queryFn:()=>So(e)})}function wb(e){return rt({queryKey:V.usage,queryFn:()=>xo(e)})}function Tb(e){return rt({queryKey:V.providers,queryFn:()=>To(e)})}function Eb(e){return rt({queryKey:V.voices,queryFn:()=>jo(e)})}function Db(e){return rt({queryKey:V.prompts,queryFn:()=>Io(e)})}function Ob(e){return rt({queryKey:V.entries,queryFn:()=>zo(e)})}function kb(e){return rt({queryKey:V.settings,queryFn:()=>ko(e)})}var Ab=[`Tokens in and out per stage, with provider and model`,`Audio seconds per segment`,`Images made`,`Thumbnails made`,`Videos rendered`,`Projects created`,`That this machine installed Slopify`,`The time each of those happened`],jb=[`API keys`,`Prompt bodies`,`Keyword values`,`Titles`,`Article or research text`,`Files and filenames`,`OS, locale, hardware`];function Mb(){let{api:e}=z(),t=_(),n=F(Cb(e)),r=it({mutationFn:()=>Co(e),onSuccess:e=>{t.setQueryData(V.notice,e)}}),i=n.data?.seen===!1,a=n.data?.appVersion;return(0,h.jsx)(hb,{open:i,children:(0,h.jsxs)(vb,{onEscapeKeyDown:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[(0,h.jsx)(yb,{children:`Anonymous usage stats`}),(0,h.jsx)(bb,{children:`These numbers power the live counters on slopify.stream.`}),(0,h.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,h.jsx)(Nb,{heading:`Tracked`,items:Ab}),(0,h.jsx)(Nb,{heading:`Never tracked`,items:jb})]}),(0,h.jsx)(`p`,{className:`text-small text-ink2`,children:`Every event carries a random ID of its own and this machine's random ID, and nothing else. Nothing you write, upload, or paste ever leaves your machine.`}),a===void 0?null:(0,h.jsx)(`p`,{className:`engraved text-ink3`,children:`Slopify ${a} · this version is included in each report`}),(0,h.jsx)(B,{autoFocus:!0,variant:`play`,size:`play`,disabled:r.isPending,onClick:()=>{r.mutate()},children:`Got it`}),r.error===null?null:(0,h.jsx)(`p`,{role:`alert`,className:`text-small text-red`,children:r.error.message})]})})}function Nb({heading:e,items:t}){let n=`notice-${e.replace(/\s+/g,`-`).toLowerCase()}`;return(0,h.jsxs)(`div`,{className:`flex flex-col gap-[6px]`,children:[(0,h.jsx)(`p`,{id:n,className:`engraved border-b border-line pb-1 text-ink3`,children:e}),(0,h.jsx)(`ul`,{"aria-labelledby":n,className:`m-0 flex list-none flex-col gap-[6px] p-0 text-small`,children:t.map(e=>(0,h.jsx)(`li`,{children:e},e))})]})}function Pb(e,t){if(t===`system`){e.removeAttribute(`data-theme`);return}e.setAttribute(`data-theme`,t)}function Fb(){let{api:e}=z(),t=F(kb(e)).data?.appearance??`system`;return(0,m.useEffect)(()=>{Pb(document.documentElement,t)},[t]),null}function Ib({reload:e}){let{version:t}=z(),n=(0,m.useSyncExternalStore)(t.subscribe,t.staleAt,t.staleAt);return(0,h.jsx)(hb,{open:n!==void 0,children:(0,h.jsxs)(vb,{onEscapeKeyDown:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[(0,h.jsx)(yb,{children:`Slopify was updated`}),(0,h.jsx)(bb,{children:`This tab was loaded before the update. Version ${n??``} is running now; reload to catch up.`}),(0,h.jsx)(B,{autoFocus:!0,variant:`play`,size:`play`,onClick:e,children:`Reload`})]})})}var Lb=[`stage.state`,`stage.progress`,`article.delta`,`llm.preview`,`image.landed`,`project.state`,`project.updated`],Rb=[`running.count`,`staging.progress`,`staging.failed`,`project.updated`,`project.state`];function zb(e,t,n){return Vb(e,t,Lb,n.refetch,e=>{if(n.accept?.(e)!==!1){if(e.type===`llm.preview`){n.previewWriting?.(e);return}if(e.type===`article.delta`){n.appendArticle(e.text);return}if(e.type===`image.landed`||e.type===`project.updated`){n.refetch();return}n.patch(e),e.type===`stage.state`&&n.refetch()}})}function Bb(e,t,n){return Vb(e,t,Rb,n.refetch,e=>{if(e.type===`running.count`){n.tally(e.count);return}if(e.type===`project.updated`||e.type===`project.state`){n.refetch(e.projectId);return}n.stagingChanged()})}function Vb(e,t,n,r,i){let a=e(t),o=!1;a.addEventListener(`open`,()=>{o&&r(),o=!0});for(let e of n)a.addEventListener(e,t=>{let n=Hb(t.data);n.type===e&&i(n)});return()=>{a.close()}}function Hb(e){return JSON.parse(e)}var Ub=[`16:9`,`9:16`],Wb=[`research`,`article`,`audio`,`images`,`thumbnail`,`video`,`document`],Gb=[`generate`,`provide`,`off`,`from_prompt`,`prompt_by_llm`];function Kb(e,t){return e[t]??`off`}var qb=[`zoom`,`pan`,`mixed`,`still`],Jb=[`text`,`llm`],Yb=[`dicemaster`,`plain`],Xb={dicemaster:`DiceMaster`,plain:`Plain`};function Zb(e){return e?.theme??`dicemaster`}function Qb(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function $b(e,t=`|`){return e.map(e=>_x(e)).join(t)}function ex(e,t){return typeof t==`bigint`?t.toString():t}function tx(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nx(e){return e==null}function rx(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ix(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function ax(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ox(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function sx(e){return JSON.stringify(e)}function cx(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var lx=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ux(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var dx=tx(()=>{if(nS.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function fx(e){if(ux(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ux(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function px(e){return fx(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var mx=new Set([`string`,`number`,`symbol`]);function hx(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function gx(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function _x(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function vx(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var yx={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function bx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return gx(e,ox(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&ax(e,r,n.shape[r])}return ax(this,`shape`,e),e},checks:[]}))}function xx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return gx(e,ox(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return ax(this,`shape`,r),r},checks:[]}))}function Sx(e,t){if(!fx(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return gx(e,ox(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ax(this,`shape`,n),n}}))}function Cx(e,t){if(!fx(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return gx(e,ox(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ax(this,`shape`,n),n}}))}function wx(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return gx(e,ox(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ax(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Tx(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return gx(t,ox(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ax(this,`shape`,i),i},checks:[]}))}function Ex(e,t,n){return gx(t,ox(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return ax(this,`shape`,i),i}}))}function Dx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ox(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kx(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ax(e){return typeof e==`string`?e:e?.message}function jx(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Mx(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ax(e.inst?._zod.def?.error?.(e))??Ax(a?.(e))??Ax(t?.error?.(e))??Ax(n.customError?.(e))??Ax(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}var Nx=/[\uD800-\uDBFF]/;function Px(e){let t=e.length;if(!Nx.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Fx(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ix(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Lx(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Rx(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Vx(e,n,r.value)}}function zx(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Bx(e,t,n){return zx(e,t,n,!1)}function Vx(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:zx(this,t,n.bind(this))},set(e){zx(this,t,e)}})}function Hx(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ux,Wx=!1,Gx={configurable:!0,get(){Wx=!0}};function Kx(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Ux!==e._zod){Ux=void 0;return}Ux=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Gx);let e=Wx;Wx=!1;try{let r=n(this);return Wx?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Wx||=e,r}catch(n){throw delete this[t],Wx||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function qx(e,t,n,r){let i=Hx(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Jx=`~constantCatch`;function Yx(e){let t=()=>e;return t[Jx]=!0,t}var Xx,Zx={value:void 0,enumerable:!1},Qx=`captureStackTrace`in Error?Error:null;function $x(e){let t=Qx;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Qx=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Zx.value=new a(r);try{Object.defineProperty(n,"_zod",Zx)}finally{Zx.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Rx(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?$x(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var eS=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},tS=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Xx=globalThis).__zod_globalConfig??(Xx.__zod_globalConfig={});var nS=globalThis.__zod_globalConfig;function rS(e){return e&&Object.assign(nS,e),nS}function iS(){let e=this._zod;return e.message??=JSON.stringify(e.def,ex,2),e.message}function aS(e){this._zod.message=e}var oS={get:iS,set:aS,enumerable:!0,configurable:!0},sS={value:void 0,enumerable:!1},cS={value:void 0,enumerable:!1},lS=new WeakSet([Object.prototype,Error.prototype]),uS=(e,t)=>{e.name=`$ZodError`,sS.value=e._zod,Object.defineProperty(e,"_zod",sS),cS.value=t,Object.defineProperty(e,"issues",cS),sS.value=void 0,cS.value=void 0,Object.defineProperty(e,"message",oS);let n=Object.getPrototypeOf(e);lS.has(n)||(lS.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},dS=U(`$ZodError`,uS),fS=U(`$ZodError`,uS,void 0,{Parent:Error});function pS(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function mS(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?pS(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function hS(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function gS(e,t){return{callee:t?.callee??e,Err:t?.Err}}var _S=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new eS;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Mx(e,o,rS())));throw lx(n,a?.callee??t),n}return s.value};return t},vS=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Mx(e,o,rS())));throw lx(n,a?.callee??t),n}return s.value};return t},yS=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new eS;return a.issues.length?{success:!1,error:new(e??dS)(a.issues.map(e=>Mx(e,i,rS())))}:{success:!0,data:a.value}},bS=yS(fS),xS=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Mx(e,i,rS())))}:{success:!0,data:a.value}},SS=xS(fS),CS=e=>{let t=_S(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,gS(n,a))};return n},wS=e=>{let t=_S(e),n=(e,r,i,a)=>t(e,r,i,gS(n,a));return n},TS=e=>{let t=vS(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,gS(n,a))};return n},ES=e=>{let t=vS(e),n=async(e,r,i,a)=>await t(e,r,i,gS(n,a));return n},DS=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yS(e)(t,n,i)},OS=e=>(t,n,r)=>yS(e)(t,n,r),kS=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return xS(e)(t,n,i)},AS=e=>async(t,n,r)=>xS(e)(t,n,r),jS=/^[cC][0-9a-z]{6,}$/,MS=/^[0-9a-z]+$/,NS=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,PS=/^[0-9a-vA-V]{20}$/,FS=/^[A-Za-z0-9]{27}$/,IS=/^[a-zA-Z0-9_-]{21}$/;function LS(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var RS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,BS=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,VS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HS=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function US(){return new RegExp(HS,`u`)}var WS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,KS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,JS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,YS=/^[A-Za-z0-9_-]*$/,XS=/^https?$/,ZS=/^\+[1-9]\d{6,14}$/,QS=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function $S(e){return RegExp(`^${e}$`)}var eC=$S(QS);function tC(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nC(e){return RegExp(`^${tC(e)}$`)}function rC(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${tC({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${tC({precision:e.precision})}`:n;return RegExp(`^${QS}T(?:${r})$`)}var iC=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},aC=/^-?\d+$/,oC=/^-?\d+(?:\.\d+)?$/,sC=/^(?:true|false)$/i,cC=/^null$/i,lC=/^[^A-Z]*$/,uC=/^[^a-z]*$/,dC=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fC=e=>{let t=e.value;return!nx(t)&&t.length!==void 0},pC={number:`number`,bigint:`bigint`,object:`date`},mC=U(`$ZodCheckLessThan`,(e,t)=>{dC.init(e,t);let n=pC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:pC[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hC=U(`$ZodCheckGreaterThan`,(e,t)=>{dC.init(e,t);let n=pC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:pC[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gC=U(`$ZodCheckMultipleOf`,(e,t)=>{dC.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ix(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_C=U(`$ZodCheckNumberFormat`,(e,t)=>{dC.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=yx[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=aC)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),vC=U(`$ZodCheckMaxLength`,(e,t)=>{var n;dC.init(e,t),(n=e._zod.def).when??(n.when=fC),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Px(r):i)<=t.maximum)return;let a=Fx(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yC=U(`$ZodCheckMinLength`,(e,t)=>{var n;dC.init(e,t),(n=e._zod.def).when??(n.when=fC),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Px(r):i)>=t.minimum)return;let a=Fx(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bC=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;dC.init(e,t),(n=e._zod.def).when??(n.when=fC),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Px(r):i;if(a===t.length)return;let o=Fx(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xC=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;dC.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),SC=U(`$ZodCheckRegex`,(e,t)=>{xC.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),CC=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=lC,xC.init(e,t)}),wC=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=uC,xC.init(e,t)}),TC=U(`$ZodCheckIncludes`,(e,t)=>{dC.init(e,t);let n=hx(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),EC=U(`$ZodCheckStartsWith`,(e,t)=>{dC.init(e,t);let n=RegExp(`^${hx(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),DC=U(`$ZodCheckEndsWith`,(e,t)=>{dC.init(e,t);let n=RegExp(`.*${hx(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),OC=U(`$ZodCheckOverwrite`,(e,t)=>{dC.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),kC=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
49
|
+
`},Hf=0,Uf=[];function Wf(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(Hf++)[0],a=m.useState(ff)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Vd([e.lockRef.current],(e.shards||[]).map(zf),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Lf(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Af(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Af(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return If(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(Uf.length&&Uf[Uf.length-1]===a){var r=`deltaY`in n?Rf(n):Lf(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Bf(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(zf).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Gf(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=Lf(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,Rf(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,Lf(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return Uf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Tf),document.addEventListener(`touchmove`,c,Tf),document.addEventListener(`touchstart`,u,Tf),function(){Uf=Uf.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Tf),document.removeEventListener(`touchmove`,c,Tf),document.removeEventListener(`touchstart`,u,Tf)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:Vf(i)}):null,p?m.createElement(Sf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Kf=tf(nf,Wf),qf=m.forwardRef(function(e,t){return m.createElement(af,zd({},e,{ref:t,sideCar:Kf}))});qf.classNames=af.classNames;var Jf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Yf=new WeakMap,Xf=new WeakMap,Zf={},Qf=0,$f=function(e){return e&&(e.host||$f(e.parentNode))},ep=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=$f(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},tp=function(e,t,n,r){var i=ep(t,Array.isArray(e)?e:[e]);Zf[n]||(Zf[n]=new WeakMap);var a=Zf[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Yf.get(e)||0)+1,l=(a.get(e)||0)+1;Yf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Xf.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Qf++,function(){o.forEach(function(e){var t=Yf.get(e)-1,i=a.get(e)-1;Yf.set(e,t),a.set(e,i),t||(Xf.has(e)||e.removeAttribute(r),Xf.delete(e)),i||e.removeAttribute(n)}),Qf--,Qf||(Yf=new WeakMap,Yf=new WeakMap,Xf=new WeakMap,Zf={})}},np=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Jf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),tp(r,i,n,`aria-hidden`)):function(){return null}},rp=Object.defineProperty,ip=(e,t)=>rp(e,`name`,{value:t,configurable:!0}),ap=`Dialog`,[op,sp]=Yl(ap),[cp,lp]=op(ap),up=ip(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=Du({prop:r,defaultProp:i??!1,onChange:a,caller:ap}),[d,f]=m.useState(0),[p,g]=m.useState(0);return(0,h.jsx)(cp,{scope:t,triggerRef:s,contentRef:c,contentId:Gu(),titleId:Gu(),descriptionId:Gu(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:g,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),dp=`DialogPortal`,[fp,pp]=op(dp,{forceMount:void 0}),mp=ip(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=lp(dp,t);return(0,h.jsx)(fp,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,h.jsx)(Fu,{present:n||a.open,children:(0,h.jsx)(jd,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),hp=`DialogOverlay`,gp=m.forwardRef(ip(function(e,t){let n=pp(hp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=lp(hp,e.__scopeDialog);return a.modal?(0,h.jsx)(Fu,{present:r||a.open,children:(0,h.jsx)(vp,{...i,ref:t})}):null},`DialogOverlay`)),_p=El(`DialogOverlay.RemoveScroll`),vp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,...r}=e,i=lp(hp,n),a=Cl(t,sd());return(0,h.jsx)(qf,{as:_p,allowPinchZoom:!0,shards:[i.contentRef],children:(0,h.jsx)(Ul.div,{"data-state":Op(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),yp=`DialogContent`,bp=m.forwardRef(ip(function(e,t){let n=pp(yp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=lp(yp,e.__scopeDialog);return(0,h.jsx)(Fu,{present:r||a.open,children:a.modal?(0,h.jsx)(xp,{...i,ref:t}):(0,h.jsx)(Sp,{...i,ref:t})})},`DialogContent`)),xp=m.forwardRef(ip(function(e,t){let n=lp(yp,e.__scopeDialog),r=m.useRef(null),i=Cl(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return np(e)},[]),(0,h.jsx)(Cp,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:pu(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:pu(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:pu(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Sp=m.forwardRef(ip(function(e,t){let n=lp(yp,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,h.jsx)(Cp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Cp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=lp(yp,n);return Ld(),(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(vd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(od,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Op(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),wp=`DialogTitle`,Tp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,...r}=e,i=lp(wp,n),{setTitleCount:a}=i;return vu(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,h.jsx)(Ul.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Ep=`DialogDescription`,Dp=m.forwardRef(ip(function(e,t){let{__scopeDialog:n,...r}=e,i=lp(Ep,n),{setDescriptionCount:a}=i;return vu(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,h.jsx)(Ul.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`));function Op(e){return e?`open`:`closed`}ip(Op,`getState`);var kp=Object.defineProperty,Ap=(e,t)=>kp(e,`name`,{value:t,configurable:!0});function jp(e){let[t,n]=m.useState(void 0);return vu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Ap(jp,`useSize`);var Mp=[`top`,`right`,`bottom`,`left`],Np=Math.min,Pp=Math.max,Fp=Math.round,Ip=Math.floor,Lp=e=>({x:e,y:e}),Rp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function zp(e,t,n){return Pp(e,Np(t,n))}function Bp(e,t){return typeof e==`function`?e(t):e}function Vp(e){return e.split(`-`)[0]}function Hp(e){return e.split(`-`)[1]}function Up(e){return e===`x`?`y`:`x`}function Wp(e){return e===`y`?`height`:`width`}function Gp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Kp(e){return Up(Gp(e))}function qp(e,t,n){n===void 0&&(n=!1);let r=Hp(e),i=Kp(e),a=Wp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=nm(o)),[o,nm(o)]}function Jp(e){let t=nm(e);return[Yp(e),t,Yp(t)]}function Yp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xp=[`left`,`right`],Zp=[`right`,`left`],Qp=[`top`,`bottom`],$p=[`bottom`,`top`];function em(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Zp:Xp:t?Xp:Zp;case`left`:case`right`:return t?Qp:$p;default:return[]}}function tm(e,t,n,r){let i=Hp(e),a=em(Vp(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Yp)))),a}function nm(e){let t=Vp(e);return Rp[t]+e.slice(t.length)}function rm(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function im(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:rm(e)}function am(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function om(e,t,n){let{reference:r,floating:i}=e,a=Gp(t),o=Kp(t),s=Wp(o),c=Vp(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Hp(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function sm(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Bp(t,e),p=im(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=am(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=am(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var cm=50,lm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:sm},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=om(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<cm&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=om(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},um=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Bp(e,t)||{};if(l==null)return{};let d=im(u),f={x:n,y:r},p=Kp(i),m=Wp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Np(d[_],T),D=Np(d[v],T),O=C-h[m]-D,ee=C/2-h[m]/2+w,te=zp(E,ee,O),k=!c.arrow&&Hp(i)!=null&&ee!==te&&a.reference[m]/2-(ee<E?E:D)-h[m]/2<0,A=k?ee<E?ee-E:ee-O:0;return{[p]:f[p]+A,data:{[p]:te,centerOffset:ee-te-A,...k&&{alignmentOffset:A}},reset:k}}}),dm=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Bp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Vp(r),_=Gp(o),v=Vp(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[nm(o)]:Jp(o)),x=p!==`none`;!d&&x&&b.push(...tm(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=qp(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Gp(t)||T.every(e=>Gp(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Gp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function fm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pm(e){return Mp.some(t=>e[t]>=0)}var mm=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Bp(e,t);switch(i){case`referenceHidden`:{let e=fm(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:pm(e)}}}case`escaped`:{let e=fm(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:pm(e)}}}default:return{}}}}},hm=new Set([`left`,`top`]);async function gm(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Vp(n),s=Hp(n),c=Gp(n)===`y`,l=hm.has(o)?-1:1,u=a&&c?-1:1,d=Bp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var _m=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await gm(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},vm=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Bp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Gp(i),p=Up(f),m=u[p],h=u[f],g=(e,t)=>zp(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ym=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Bp(e,t),u={x:n,y:r},d=Gp(i),f=Up(d),p=u[f],m=u[d],h=Bp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=hm.has(Vp(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},bm=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Bp(e,t),c=await i.detectOverflow(t,s),l=Vp(n),u=Hp(n),d=Gp(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Np(p-c[m],g),y=Np(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Pp(c.left,c.right):S=p-2*Pp(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function xm(){return typeof window<`u`}function Sm(e){return Tm(e)?(e.nodeName||``).toLowerCase():`#document`}function Cm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wm(e){return((Tm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Tm(e){return xm()?e instanceof Node||e instanceof Cm(e).Node:!1}function Em(e){return xm()?e instanceof Element||e instanceof Cm(e).Element:!1}function Dm(e){return xm()?e instanceof HTMLElement||e instanceof Cm(e).HTMLElement:!1}function Om(e){return!xm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Cm(e).ShadowRoot}function km(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Bm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Am(e){return/^(table|td|th)$/.test(Sm(e))}function jm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Mm=/transform|translate|scale|rotate|perspective|filter/,Nm=/paint|layout|strict|content/,Pm=e=>!!e&&e!==`none`,Fm;function Im(e){let t=Em(e)?Bm(e):e;return Pm(t.transform)||Pm(t.translate)||Pm(t.scale)||Pm(t.rotate)||Pm(t.perspective)||!Rm()&&(Pm(t.backdropFilter)||Pm(t.filter))||Mm.test(t.willChange||``)||Nm.test(t.contain||``)}function Lm(e){let t=Hm(e);for(;Dm(t)&&!zm(t);){if(Im(t))return t;if(jm(t))return null;t=Hm(t)}return null}function Rm(){return Fm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Fm}function zm(e){return/^(html|body|#document)$/.test(Sm(e))}function Bm(e){return Cm(e).getComputedStyle(e)}function Vm(e){return Em(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hm(e){if(Sm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Om(e)&&e.host||wm(e);return Om(t)?t.host:t}function Um(e){let t=Hm(e);return zm(t)?(e.ownerDocument||e).body:Dm(t)&&km(t)?t:Um(t)}function Wm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Um(e),i=r===e.ownerDocument?.body,a=Cm(r);if(i){let e=Gm(a);return t.concat(a,a.visualViewport||[],km(r)?r:[],e&&n?Wm(e):[])}return t.concat(r,Wm(r,[],n))}function Gm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Km(e){let t=Bm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Dm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Fp(n)!==a||Fp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function qm(e){return Em(e)?e:e.contextElement}function Jm(e){let t=qm(e);if(!Dm(t))return Lp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Km(t),o=(a?Fp(n.width):n.width)/r,s=(a?Fp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ym=Lp(0);function Xm(e){let t=Cm(e);return!Rm()||!t.visualViewport?Ym:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zm(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Cm(e)}function Qm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=qm(e),o=Lp(1);t&&(r?Em(r)&&(o=Jm(r)):o=Jm(e));let s=Zm(a,n,r)?Xm(a):Lp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Cm(a),t=Em(r)?Cm(r):r,n=e,i=Gm(n);for(;i&&t!==n;){let e=Jm(i),t=i.getBoundingClientRect(),r=Bm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Cm(i),i=Gm(n)}}return am({width:u,height:d,x:c,y:l})}function $m(e,t){let n=Vm(e).scrollLeft;return t?t.left+n:Qm(wm(e)).left+n}function eh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-$m(e,n),y:n.top+t.scrollTop}}function th(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=wm(r),s=t?jm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Lp(1),u=Lp(0),d=Dm(r);if((d||!a)&&((Sm(r)!==`body`||km(o))&&(c=Vm(r)),d)){let e=Qm(r);l=Jm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?eh(o,c):Lp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function nh(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function rh(e){let t=Vm(e),n=e.ownerDocument.body,r=Pp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Pp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+$m(e),o=-t.scrollTop;return Bm(n).direction===`rtl`&&(a+=Pp(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ih=25;function ah(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Cm(e),a=wm(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Rm()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if($m(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ih&&(s-=o)}return{width:s,height:c,x:l,y:u}}function oh(e,t){let n=Qm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Jm(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function sh(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ah(e,n,t);else if(t===`document`)r=rh(wm(e));else if(Em(t))r=oh(t,n);else{let n=Xm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return am(r)}function ch(e,t){let n=t.get(e);if(n)return n;let r=Wm(e,[],!1).filter(e=>Em(e)&&Sm(e)!==`body`),i=null,a=Bm(e).position===`fixed`,o=a?Hm(e):e;for(;Em(o)&&!zm(o);){let e=Bm(o),t=Im(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Hm(o)}return t.set(e,r),r}function lh(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?jm(t)?[]:ch(t,this._c):[].concat(n),r],o=sh(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=sh(t,a[e],i);s=Pp(n.top,s),c=Np(n.right,c),l=Np(n.bottom,l),u=Pp(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function uh(e){let{width:t,height:n}=Km(e);return{width:t,height:n}}function dh(e,t,n){let r=Dm(t),i=wm(t),a=n===`fixed`,o=Qm(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Lp(0);if((r||!a)&&((Sm(t)!==`body`||km(i))&&(s=Vm(t)),r)){let e=Qm(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=$m(i));let l=i&&!r&&!a?eh(i,s):Lp(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function fh(e){return Bm(e).position===`static`}function ph(e,t){if(!Dm(e)||Bm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return wm(e)===n&&(n=n.ownerDocument.body),n}function mh(e,t){let n=Cm(e);if(jm(e))return n;if(!Dm(e)){let t=Hm(e);for(;t&&!zm(t);){if(Em(t)&&!fh(t))return t;t=Hm(t)}return n}let r=ph(e,t);for(;r&&Am(r)&&fh(r);)r=ph(r,t);return r&&zm(r)&&fh(r)&&!Im(r)?n:r||Lm(e)||n}var hh=async function(e){let t=this.getOffsetParent||mh,n=this.getDimensions,r=await n(e.floating);return{reference:dh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gh(e){return Bm(e).direction===`rtl`}var _h={convertOffsetParentRelativeRectToViewportRelativeRect:th,getDocumentElement:wm,getClippingRect:lh,getOffsetParent:mh,getElementRects:hh,getClientRects:nh,getDimensions:uh,getScale:Jm,isElement:Em,isRTL:gh};function vh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yh(e,t,n){let r=null,i,a=wm(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ip(d),h=Ip(a.clientWidth-(u+f)),g=Ip(a.clientHeight-(d+p)),_=Ip(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Pp(0,Np(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!vh(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Cm(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function bh(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=qm(e),u=i||a?[...l?Wm(l):[],...t?Wm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?yh(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Qm(e):null;c&&g();function g(){let t=Qm(e);h&&!vh(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var xh=_m,Sh=vm,Ch=dm,wh=bm,Th=mm,Eh=um,Dh=ym,Oh=(e,t,n)=>{let r=new Map,i=n??{},a={..._h,...i.platform,_c:r};return lm(e,t,{...i,platform:a})},kh=typeof document<`u`?m.useLayoutEffect:function(){};function Ah(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ah(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ah(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function jh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mh(e,t){let n=jh(e);return Math.round(t*n)/n}function Nh(e){let t=m.useRef(e);return kh(()=>{t.current=e}),t}function Ph(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Ah(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=Nh(c),O=Nh(i),ee=Nh(l),te=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Oh(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};k.current&&!Ah(T.current,t)&&(T.current=t,Bl.flushSync(()=>{d(t)}))})},[f,t,n,O,ee]);kh(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=m.useRef(!1);kh(()=>(k.current=!0,()=>{k.current=!1}),[]),kh(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,te);te()}},[x,S,te,D,E]);let A=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),j=m.useMemo(()=>({reference:x,floating:S}),[x,S]),M=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Mh(j.floating,u.x),r=Mh(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...jh(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:te,refs:A,elements:j,floatingStyles:M}),[u,te,A,j,M])}var Fh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Eh({element:r.current,padding:i}).fn(n):r?Eh({element:r,padding:i}).fn(n):{}}}},Ih=(e,t)=>{let n=xh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lh=(e,t)=>{let n=Sh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rh=(e,t)=>({fn:Dh(e).fn,options:[e,t]}),zh=(e,t)=>{let n=Ch(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bh=(e,t)=>{let n=wh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vh=(e,t)=>{let n=Th(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hh=(e,t)=>{let n=Fh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uh=Object.defineProperty,Wh=(e,t)=>Uh(e,`name`,{value:t,configurable:!0}),Gh=`Popper`,[Kh,qh]=Yl(Gh),[Jh,Yh]=Kh(Gh),Xh=Wh(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,h.jsx)(Jh,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Zh=`PopperAnchor`,Qh=m.forwardRef(Wh(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Yh(Zh,n),o=m.useRef(null),s=a.onAnchorChange,c=Cl(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ag(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,h.jsx)(Ul.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),$h=`PopperContent`,[eg,tg]=Kh($h),ng=m.forwardRef(Wh(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:g,..._}=e,v=Yh($h,n),[y,b]=m.useState(null),x=Cl(t,b),[S,C]=m.useState(null),w=jp(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],te=ee.length>0,k={padding:O,boundary:ee.filter(rg),altBoundary:te},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=Ph({strategy:`fixed`,placement:D,whileElementsMounted:Wh((...e)=>bh(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Ih({mainAxis:i+E,alignmentAxis:o}),c&&Lh({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Rh():void 0,...k}),c&&zh({...k}),Bh({...k,apply:Wh(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Hh({element:S,padding:s}),ig({arrowWidth:T,arrowHeight:E}),f&&Vh({strategy:`referenceHidden`,...k,boundary:te?k.boundary:void 0})]}),ne=v.setPlacementState;vu(()=>(ne(M),()=>{ne(void 0)}),[M,ne]);let[re,ie]=ag(M),ae=Qu(g);vu(()=>{N&&ae?.()},[N,ae]);let oe=P.arrow?.x,se=P.arrow?.y,ce=P.arrow?.centerOffset!==0,[le,ue]=m.useState();return vu(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),(0,h.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,h.jsx)(eg,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,h.jsx)(Ul.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:N?_.style?.animation:`none`}})})})},`PopperContent`));function rg(e){return e!==null}Wh(rg,`isNotNull`);var ig=Wh(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ag(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ag(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Wh(ag,`getSideAndAlignFromPlacement`);var og=Xh,sg=Qh,cg=ng,lg=Object.defineProperty,ug=(e,t)=>lg(e,`name`,{value:t,configurable:!0}),dg=!1;function fg(){let[e,t]=m.useState(dg);return m.useEffect(()=>{dg||(dg=!0,t(!0))},[]),e}ug(fg,`useIsHydrated`);var pg=m.useSyncExternalStore;function mg(){return()=>{}}ug(mg,`subscribe`);function hg(){return pg(mg,()=>!0,()=>!1)}ug(hg,`useIsHydratedModern`);var gg=typeof pg==`function`?hg:fg,_g=Object.defineProperty,vg=(e,t)=>_g(e,`name`,{value:t,configurable:!0}),yg=`rovingFocusGroup.onEntryFocus`,bg={bubbles:!1,cancelable:!0},xg=`RovingFocusGroup`,[Sg,Cg,wg]=$l(xg),[Tg,Eg]=Yl(xg,[wg]),[Dg,Og]=Tg(xg),kg=m.forwardRef(vg(function(e,t){return(0,h.jsx)(Sg.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(Sg.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(Ag,{...e,ref:t})})})},`RovingFocusGroup`)),Ag=m.forwardRef(vg(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=Cl(t,f),g=Yu(a),[_,v]=Du({prop:o,defaultProp:s??null,onChange:c,caller:xg}),[y,b]=m.useState(!1),x=Qu(l),S=Cg(n),C=m.useRef(!1),[w,T]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(yg,x),()=>e.removeEventListener(yg,x)},[x]),(0,h.jsx)(Dg,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:m.useCallback(e=>v(e),[v]),onItemShiftTab:m.useCallback(()=>b(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>T(e=>e-1),[]),children:(0,h.jsx)(Ul.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:pu(e.onMouseDown,()=>{C.current=!0}),onFocus:pu(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(yg,bg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Ig([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}C.current=!1}),onBlur:pu(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),jg=`RovingFocusGroupItem`,Mg=m.forwardRef(vg(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Gu(),l=a||c,u=Og(jg,n),d=u.currentTabStopId===l,f=Cg(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:_}=u,v=gg();return vu(()=>{if(v&&r)return p(),()=>g()},[v,r,p,g]),m.useEffect(()=>{if(!v&&r)return p(),()=>g()},[v,r,p,g]),(0,h.jsx)(Sg.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,h.jsx)(Ul.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:pu(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:pu(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:pu(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Fg(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Lg(n,r+1):n.slice(r+1)}setTimeout(()=>Ig(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Ng={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Pg(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}vg(Pg,`getDirectionAwareKey`);function Fg(e,t,n){let r=Pg(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ng[r]}vg(Fg,`getFocusIntent`);function Ig(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}vg(Ig,`focusFirst`);function Lg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}vg(Lg,`wrapArray`);var Rg=kg,zg=Mg,Bg=Object.defineProperty,Vg=(e,t)=>Bg(e,`name`,{value:t,configurable:!0}),Hg=[`Enter`,` `],Ug=[`ArrowDown`,`PageUp`,`Home`],Wg=[`ArrowUp`,`PageDown`,`End`],Gg=[...Ug,...Wg];[...Hg],[...Hg];var Kg=`Menu`,[qg,Jg,Yg]=$l(Kg),[Xg,Zg]=Yl(Kg,[Yg,qh,Eg]),Qg=qh(),$g=Eg(),[e_,t_]=Xg(Kg),[n_,r_]=Xg(Kg),i_=Vg(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Qg(t),[c,l]=m.useState(null),u=m.useRef(!1),d=Qu(a),f=Yu(i);return m.useEffect(()=>{let e=Vg(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Vg(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),m.useEffect(()=>{if(!n)return;let e=Vg(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,h.jsx)(og,{...s,children:(0,h.jsx)(e_,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,h.jsx)(n_,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),a_=m.forwardRef(Vg(function(e,t){let{__scopeMenu:n,...r}=e,i=Qg(n);return(0,h.jsx)(sg,{...i,...r,ref:t})},`MenuAnchor`)),o_=`MenuPortal`,[s_,c_]=Xg(o_,{forceMount:void 0}),l_=Vg(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=t_(o_,t);return(0,h.jsx)(s_,{scope:t,forceMount:n,children:(0,h.jsx)(Fu,{present:n||a.open,children:(0,h.jsx)(jd,{asChild:!0,container:i,children:r})})})},`MenuPortal`),u_=`MenuContent`,[d_,f_]=Xg(u_),p_=m.forwardRef(Vg(function(e,t){let n=c_(u_,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=t_(u_,e.__scopeMenu),o=r_(u_,e.__scopeMenu);return(0,h.jsx)(qg.Provider,{scope:e.__scopeMenu,children:(0,h.jsx)(Fu,{present:r||a.open,children:(0,h.jsx)(qg.Slot,{scope:e.__scopeMenu,children:o.modal?(0,h.jsx)(m_,{...i,ref:t}):(0,h.jsx)(h_,{...i,ref:t})})})})},`MenuContent`)),m_=m.forwardRef(Vg(function(e,t){let n=t_(u_,e.__scopeMenu),r=m.useRef(null),i=Cl(t,r);return m.useEffect(()=>{let e=r.current;if(e)return np(e)},[]),(0,h.jsx)(__,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:pu(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),h_=m.forwardRef(Vg(function(e,t){let n=t_(u_,e.__scopeMenu);return(0,h.jsx)(__,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),g_=El(`MenuContent.ScrollLock`),__=m.forwardRef(Vg(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:g,..._}=e,v=t_(u_,n),y=r_(u_,n),b=Qg(n),x=$g(n),S=Jg(n),[C,w]=m.useState(null),T=m.useRef(null),E=Cl(t,T,v.onContentChange),D=m.useRef(0),O=m.useRef(``),ee=m.useRef(0),te=m.useRef(null),k=m.useRef(`right`),A=m.useRef(0),j=g?qf:m.Fragment,M=g?{as:g_,allowPinchZoom:!0}:void 0,N=Vg(e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=N_(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;Vg((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);m.useEffect(()=>()=>window.clearTimeout(D.current),[]),Ld();let P=m.useCallback(e=>k.current===te.current?.side&&F_(e,te.current?.area),[]);return(0,h.jsx)(d_,{scope:n,searchRef:O,onItemEnter:m.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:m.useCallback(e=>{P(e)||(T.current?.focus(),w(null))},[P]),onTriggerLeave:m.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:m.useCallback(e=>{te.current=e},[]),children:(0,h.jsx)(j,{...M,children:(0,h.jsx)(vd,{asChild:!0,trapped:i,onMountAutoFocus:pu(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,h.jsx)(od,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,h.jsx)(Rg,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:pu(c,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,h.jsx)(cg,{role:`menu`,"aria-orientation":`vertical`,"data-state":O_(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:pu(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=T.current;if(e.target!==i||!Gg.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Wg.includes(e.key)&&a.reverse(),j_(a)}),onBlur:pu(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:pu(e.onPointerMove,I_(e=>{let t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>A.current?`right`:`left`;k.current=t,A.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),v_=`MenuItem`,y_=`menu.itemSelect`,b_=m.forwardRef(Vg(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=m.useRef(null),o=r_(v_,e.__scopeMenu),s=f_(v_,e.__scopeMenu),c=Cl(t,a),l=m.useRef(!1),u=Vg(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(y_,{bubbles:!0,cancelable:!0});e.addEventListener(y_,e=>r?.(e),{once:!0}),Wl(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,h.jsx)(x_,{...i,ref:c,disabled:n,onClick:pu(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:pu(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:pu(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Hg.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),x_=m.forwardRef(Vg(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=f_(v_,n),s=$g(n),c=m.useRef(null),l=Cl(t,c),[u,d]=m.useState(!1),[f,p]=m.useState(``);return m.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,h.jsx)(qg.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,h.jsx)(zg,{asChild:!0,...s,focusable:!r,children:(0,h.jsx)(Ul.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:pu(e.onPointerMove,I_(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pu(e.onPointerLeave,I_(e=>o.onItemLeave(e))),onFocus:pu(e.onFocus,()=>d(!0)),onBlur:pu(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[S_,C_]=Xg(`MenuRadioGroup`,{value:void 0,onValueChange:Vg(()=>{},`onValueChange`)}),[w_,T_]=Xg(`MenuItemIndicator`,{checked:!1}),[E_,D_]=Xg(`MenuSub`);function O_(e){return e?`open`:`closed`}Vg(O_,`getOpenState`);function k_(e){return e===`indeterminate`}Vg(k_,`isIndeterminate`);function A_(e){return k_(e)?`indeterminate`:e?`checked`:`unchecked`}Vg(A_,`getCheckedState`);function j_(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Vg(j_,`focusFirst`);function M_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Vg(M_,`wrapArray`);function N_(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=M_(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Vg(N_,`getNextMatch`);function P_(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Vg(P_,`isPointInPolygon`);function F_(e,t){return t?P_({x:e.clientX,y:e.clientY},t):!1}Vg(F_,`isPointerInGraceArea`);function I_(e){return t=>t.pointerType===`mouse`?e(t):void 0}Vg(I_,`whenMouse`);var L_=i_,R_=a_,z_=l_,B_=p_,V_=b_,H_=Object.defineProperty,U_=(e,t)=>H_(e,`name`,{value:t,configurable:!0}),W_=`DropdownMenu`,[G_,K_]=Yl(W_,[Zg]),q_=Zg(),[J_,Y_]=G_(W_),X_=U_(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=q_(t),l=m.useRef(null),[u,d]=Du({prop:i,defaultProp:a??!1,onChange:o,caller:W_});return(0,h.jsx)(J_,{scope:t,triggerId:Gu(),triggerRef:l,contentId:Gu(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,h.jsx)(L_,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Z_=`DropdownMenuTrigger`,Q_=m.forwardRef(U_(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Y_(Z_,n),o=q_(n),s=Cl(t,a.triggerRef);return(0,h.jsx)(R_,{asChild:!0,...o,children:(0,h.jsx)(Ul.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:pu(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:pu(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),$_=U_(e=>{let{__scopeDropdownMenu:t,...n}=e,r=q_(t);return(0,h.jsx)(z_,{...r,...n})},`DropdownMenuPortal`),ev=`DropdownMenuContent`,tv=m.forwardRef(U_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Y_(ev,n),a=q_(n),o=m.useRef(!1);return(0,h.jsx)(B_,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:pu(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:pu(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),nv=m.forwardRef(U_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=q_(n);return(0,h.jsx)(V_,{...i,...r,ref:t})},`DropdownMenuItem`)),rv=X_,iv=Q_,av=$_,ov=tv,sv=nv,cv=Object.defineProperty,lv=m.forwardRef(((e,t)=>cv(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,h.jsx)(Ul.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),uv=Object.defineProperty,dv=(e,t)=>uv(e,`name`,{value:t,configurable:!0});function fv(e){let t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}dv(fv,`usePrevious`);var pv=Object.defineProperty,mv=(e,t)=>pv(e,`name`,{value:t,configurable:!0});function hv(e,[t,n]){return Math.min(n,Math.max(t,e))}mv(hv,`clamp`);var gv=Object.defineProperty,_v=(e,t)=>gv(e,`name`,{value:t,configurable:!0}),vv=`Popover`,[yv,bv]=Yl(vv,[qh]),xv=qh(),[Sv,Cv]=yv(vv),wv=_v(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=xv(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=Du({prop:r,defaultProp:i??!1,onChange:a,caller:vv});return(0,h.jsx)(og,{...s,children:(0,h.jsx)(Sv,{scope:t,contentId:Gu(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Tv=`PopoverAnchor`,Ev=m.forwardRef(_v(function(e,t){let{__scopePopover:n,...r}=e,i=Cv(Tv,n),a=xv(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return m.useEffect(()=>(o(),()=>s()),[o,s]),(0,h.jsx)(sg,{...a,...r,ref:t})},`PopoverAnchor`)),Dv=`PopoverTrigger`,Ov=m.forwardRef(_v(function(e,t){let{__scopePopover:n,...r}=e,i=Cv(Dv,n),a=xv(n),o=Cl(t,i.triggerRef),s=(0,h.jsx)(Ul.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":zv(i.open),...r,ref:o,onClick:pu(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,h.jsx)(sg,{asChild:!0,...a,children:s})},`PopoverTrigger`)),kv=`PopoverPortal`,[Av,jv]=yv(kv,{forceMount:void 0}),Mv=_v(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Cv(kv,t);return(0,h.jsx)(Av,{scope:t,forceMount:n,children:(0,h.jsx)(Fu,{present:n||a.open,children:(0,h.jsx)(jd,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Nv=`PopoverContent`,Pv=m.forwardRef(_v(function(e,t){let n=jv(Nv,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Cv(Nv,e.__scopePopover);return(0,h.jsx)(Fu,{present:r||a.open,children:a.modal?(0,h.jsx)(Iv,{...i,ref:t}):(0,h.jsx)(Lv,{...i,ref:t})})},`PopoverContent`)),Fv=El(`PopoverContent.RemoveScroll`),Iv=m.forwardRef(_v(function(e,t){let n=Cv(Nv,e.__scopePopover),r=m.useRef(null),i=Cl(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return np(e)},[]),(0,h.jsx)(qf,{as:Fv,allowPinchZoom:!0,children:(0,h.jsx)(Rv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pu(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:pu(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:pu(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Lv=m.forwardRef(_v(function(e,t){let n=Cv(Nv,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,h.jsx)(Rv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Rv=m.forwardRef(_v(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Cv(Nv,n),p=xv(n);return Ld(),(0,h.jsx)(vd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(od,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,h.jsx)(cg,{"data-state":zv(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function zv(e){return e?`open`:`closed`}_v(zv,`getState`);var Bv=wv,Vv=Ev,Hv=Ov,Uv=Mv,Wv=Pv,Gv=Object.defineProperty,Kv=(e,t)=>Gv(e,`name`,{value:t,configurable:!0}),qv=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Jv=[` `,`Enter`],Yv=`Select`,[Xv,Zv,Qv]=$l(Yv),[$v,ey]=Yl(Yv,[Qv,qh]),ty=qh(),[ny,ry]=$v(Yv),[iy,ay]=$v(Yv);function oy(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:g,internal_do_not_use_render:_}=e,v=ty(t),[y,b]=m.useState(null),[x,S]=m.useState(null),[C,w]=m.useState(!1),T=Yu(l),[E,D]=Du({prop:r,defaultProp:i??!1,onChange:a,caller:Yv}),[O,ee]=Du({prop:o,defaultProp:s,onChange:c,caller:Yv}),te=m.useRef(null),k=m.useRef(O);m.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=Kv(()=>ee(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,ee]);let A=!y||!!g||!!y.closest(`form`),[j,M]=m.useState(new Set),N=Gu(),P=Array.from(j).map(e=>e.props.value).join(`;`),ne=m.useCallback(e=>{M(t=>new Set(t).add(e))},[]),re=m.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),ie={required:p,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:N,value:O,onValueChange:ee,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:te,disabled:f,name:u,autoComplete:d,form:g,nativeOptions:j,nativeSelectKey:P,isFormControl:A};return(0,h.jsx)(og,{...v,children:(0,h.jsx)(ny,{scope:t,...ie,children:(0,h.jsx)(Xv.Provider,{scope:t,children:(0,h.jsx)(iy,{scope:t,onNativeOptionAdd:ne,onNativeOptionRemove:re,children:Hy(_)?_(ie):n})})})})}Kv(oy,`SelectProvider`);var sy=Kv(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,h.jsx)(oy,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,h.jsxs)(h.Fragment,{children:[n,e?(0,h.jsx)(Vy,{__scopeSelect:t}):null]})})},`Select`),cy=`SelectTrigger`,ly=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=ty(n),o=ry(cy,n),s=o.disabled||r,c=Cl(t,o.onTriggerChange),l=Zv(n),u=m.useRef(`touch`),[d,f,p]=Wy(e=>{let t=l().filter(e=>!e.disabled),n=Gy(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=Kv(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,h.jsx)(sg,{asChild:!0,...a,children:(0,h.jsx)(Ul.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Uy(o.value)?``:void 0,...i,ref:c,onClick:pu(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&g(e)}),onPointerDown:pu(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:pu(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&qv.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),uy=`SelectValue`,dy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=ry(uy,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Cl(t,c.onValueNodeChange);vu(()=>{l(u)},[l,u]);let f=Uy(c.value);return(0,h.jsx)(Ul.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,h.jsx)(m.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),fy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,h.jsx)(Ul.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[py,my]=$v(`SelectPortal`,{forceMount:void 0}),hy=Kv(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,h.jsx)(py,{scope:e.__scopeSelect,forceMount:n,children:(0,h.jsx)(jd,{asChild:!0,...r})})},`SelectPortal`),gy=`SelectContent`,_y=m.forwardRef(Kv(function(e,t){let n=my(gy,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=ry(gy,e.__scopeSelect),[o,s]=m.useState();return vu(()=>{s(new DocumentFragment)},[]),(0,h.jsx)(Fu,{present:r||a.open,children:({present:e})=>e?(0,h.jsx)(Cy,{...i,ref:t}):(0,h.jsx)(vy,{...i,fragment:o})})},`SelectContent`)),vy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Bl.createPortal((0,h.jsx)(by,{scope:n,children:(0,h.jsx)(Xv.Slot,{scope:n,children:(0,h.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),yy=10,[by,xy]=$v(gy),Sy=El(`SelectContent.RemoveScroll`),Cy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=ry(gy,n),[x,S]=m.useState(null),[C,w]=m.useState(null),T=Cl(t,S),[E,D]=m.useState(null),[O,ee]=m.useState(null),te=Zv(n),[k,A]=m.useState(!1),j=m.useRef(!1);m.useEffect(()=>{if(x)return np(x)},[x]),Ld();let M=m.useCallback(e=>{let[t,...n]=te().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[te,C]),N=m.useCallback(()=>M([E,x]),[M,E,x]);m.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:ne}=b;m.useEffect(()=>{if(x){let e={x:0,y:0},t=Kv(t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},`handlePointerMove`),n=Kv(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||P(!1),document.removeEventListener(`pointermove`,t),ne.current=null},`handlePointerUp`);return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,P,ne]),m.useEffect(()=>{let e=Kv(()=>P(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[re,ie]=Wy(e=>{let t=te().filter(e=>!e.disabled),n=Gy(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(b.value!==void 0&&b.value===t||r)&&(D(e),r&&(j.current=!0))},[b.value]),oe=m.useCallback(()=>x?.focus(),[x]),se=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(b.value!==void 0&&b.value===t||r)&&ee(e)},[b.value]),ce=r===`popper`?Ty:wy,le=ce===Ty?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,h.jsx)(by,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:ae,selectedItem:E,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:N,selectedItemText:O,position:r,isPositioned:k,searchRef:re,children:(0,h.jsx)(qf,{as:Sy,allowPinchZoom:!0,children:(0,h.jsx)(vd,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:pu(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,h.jsx)(od,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,h.jsx)(ce,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...le,onPlaced:()=>A(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:pu(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=te().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),wy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=ry(gy,n),o=xy(gy,n),[s,c]=m.useState(null),[l,u]=m.useState(null),d=Cl(t,u),f=Zv(n),p=m.useRef(!1),g=m.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=m.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-yy,d=hv(a,[yy,Math.max(yy,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-yy,d=hv(a,[yy,Math.max(yy,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-yy*2,u=_.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+h+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-yy,D=c-E,O=v.offsetHeight/2,ee=v.offsetTop+O,te=m+h+ee,k=x-te;if(te<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=te+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+_.offsetTop+(e?w:0)+O)+k;s.style.height=t+`px`,_.scrollTop=te-E+_.offsetTop}s.style.margin=`${yy}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);vu(()=>x(),[x]);let[S,C]=m.useState();vu(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);let w=m.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return(0,h.jsx)(Ey,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:w,children:(0,h.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,h.jsx)(Ul.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Ty=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=yy,...a}=e,o=ty(n);return(0,h.jsx)(cg,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Ey,Dy]=$v(gy,{}),Oy=`SelectViewport`,ky=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=xy(Oy,n),o=Dy(Oy,n),s=Cl(t,a.onViewportChange),c=m.useRef(0);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,h.jsx)(Xv.Slot,{scope:n,children:(0,h.jsx)(Ul.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:pu(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-yy*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Ay,jy]=$v(`SelectGroup`),My=`SelectItem`,[Ny,Py]=$v(My),Fy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=ry(My,n),c=xy(My,n),l=s.value===r,[u,d]=m.useState(a??``),[f,p]=m.useState(!1),g=Cl(t,Qu(e=>c.itemRefCallback?.(e,r,i))),_=Gu(),v=m.useRef(`touch`),y=Kv(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,h.jsx)(Ny,{scope:n,value:r,disabled:i,textId:_,isSelected:l,onItemTextChange:m.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,h.jsx)(Xv.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,h.jsx)(Ul.div,{role:`option`,"aria-labelledby":_,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:pu(o.onFocus,()=>p(!0)),onBlur:pu(o.onBlur,()=>p(!1)),onClick:pu(o.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:pu(o.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:pu(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:pu(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pu(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:pu(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Jv.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Iy=`SelectItemText`,Ly=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=ry(Iy,n),s=xy(Iy,n),c=Py(Iy,n),l=ay(Iy,n),[u,d]=m.useState(null),f=Qu(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Cl(t,d,c.onItemTextChange,f),g=u?.textContent,_=m.useMemo(()=>(0,h.jsx)(`option`,{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=l;return vu(()=>(v(_),()=>y(_)),[v,y,_]),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ul.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Uy(o.value)?Bl.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Ry=`SelectItemIndicator`,zy=m.forwardRef(Kv(function(e,t){let{__scopeSelect:n,...r}=e;return Py(Ry,n).isSelected?(0,h.jsx)(Ul.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),By=`SelectBubbleInput`,Vy=m.forwardRef(Kv(function({__scopeSelect:e,...t},n){let r=ry(By,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=m.useRef(null),g=Cl(n,p),_=i??``,v=fv(_),y=Array.from(d).some(e=>(e.props.value??``)===``);return m.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,h.jsxs)(Ul.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Gl,...t.style},ref:g,defaultValue:_,children:[Uy(i)&&!y?(0,h.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Hy(e){return typeof e==`function`}Kv(Hy,`isFunction`);function Uy(e){return e===``||e===void 0}Kv(Uy,`shouldShowPlaceholder`);function Wy(e){let t=Qu(e),n=m.useRef(``),r=m.useRef(0),i=m.useCallback(e=>{let i=n.current+e;t(i),Kv((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=m.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Kv(Wy,`useTypeaheadSearch`);function Gy(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ky(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Kv(Gy,`findNextItem`);function Ky(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Kv(Ky,`wrapArray`);var qy=Object.defineProperty,Jy=(e,t)=>qy(e,`name`,{value:t,configurable:!0}),Yy=`Toggle`,Xy=m.forwardRef(Jy(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=Du({prop:n,onChange:i,defaultProp:r??!1,caller:Yy});return(0,h.jsx)(Ul.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:pu(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Zy=Object.defineProperty,Qy=(e,t)=>Zy(e,`name`,{value:t,configurable:!0}),$y=`ToggleGroup`,[eb,tb]=Yl($y,[Eg]),nb=Eg(),rb=m.forwardRef(Qy(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,h.jsx)(ob,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,h.jsx)(sb,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${$y}\``)},`ToggleGroup`)),[ib,ab]=eb($y),ob=m.forwardRef(Qy(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Qy(()=>{},`onValueChange`),...a}=e,[o,s]=Du({prop:n,defaultProp:r??``,onChange:i,caller:$y});return(0,h.jsx)(ib,{scope:e.__scopeToggleGroup,type:`single`,value:m.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:m.useCallback(()=>s(``),[s]),children:(0,h.jsx)(ub,{...a,ref:t})})},`ToggleGroupImplSingle`)),sb=m.forwardRef(Qy(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Qy(()=>{},`onValueChange`),...a}=e,[o,s]=Du({prop:n,defaultProp:r??[],onChange:i,caller:$y}),c=m.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=m.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,h.jsx)(ib,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,h.jsx)(ub,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[cb,lb]=eb($y),ub=m.forwardRef(Qy(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=nb(n),u=Yu(o),d={dir:u,...c};return(0,h.jsx)(cb,{scope:n,rovingFocus:i,disabled:r,children:i?(0,h.jsx)(Rg,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,h.jsx)(Ul.div,{...d,ref:t})}):(0,h.jsx)(Ul.div,{...d,ref:t})})},`ToggleGroupImpl`)),db=`ToggleGroupItem`,fb=m.forwardRef(Qy(function(e,t){let n=ab(db,e.__scopeToggleGroup),r=lb(db,e.__scopeToggleGroup),i=nb(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=m.useRef(null);return r.rovingFocus?(0,h.jsx)(zg,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,h.jsx)(pb,{...s,ref:t})}):(0,h.jsx)(pb,{...s,ref:t})},`ToggleGroupItem`)),pb=m.forwardRef(Qy(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=ab(db,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,h.jsx)(Xy,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),mb=vl(`inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-sans transition-colors duration-150 ease-out motion-reduce:transition-none`,{variants:{variant:{outline:`rounded-control border border-line2 bg-panel2 text-ink hover:bg-panel2 hover:border-ink3`,accent:`rounded-control border border-accent bg-transparent text-run-text hover:bg-panel2`,primary:`rounded-control bg-accent px-[14px] font-semibold text-accent-ink hover:bg-accent-edge`,ghost:`rounded-control text-ink2 hover:bg-panel2 hover:text-ink`,danger:`rounded-control border border-red bg-transparent text-ink hover:bg-panel2`,play:`rounded-panel bg-accent text-accent-ink font-extrabold tracking-[0.02em] shadow-[0_4px_0_var(--color-accent-edge)] active:translate-y-[3px] active:shadow-[0_1px_0_var(--color-accent-edge)] motion-reduce:active:translate-y-0`},size:{default:`h-8 px-3 text-body`,play:`h-14 w-full px-4 text-row`}},defaultVariants:{variant:`outline`,size:`default`}});function B({className:e,variant:t,size:n,asChild:r=!1,...i}){let a=r?Dl:`button`;return(0,h.jsx)(a,{"data-slot":`button`,className:R(mb({variant:t,size:n}),e),...i})}var hb=up,gb=mp;function _b({className:e,...t}){return(0,h.jsx)(gp,{"data-slot":`dialog-overlay`,className:R(`fixed inset-0 z-40 bg-scrim`,e),...t})}function vb({className:e,children:t,...n}){return(0,h.jsxs)(gb,{children:[(0,h.jsx)(_b,{}),(0,h.jsx)(bp,{"data-slot":`dialog-content`,className:R(`fixed top-1/2 left-1/2 z-50 flex w-[calc(100%-2rem)] max-w-[480px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4`,`rounded-panel border border-line bg-panel p-[18px] shadow-[0_8px_24px_var(--color-shadow)]`,`data-[state=open]:animate-dialog-in motion-reduce:animate-none`,e),...n,children:t})]})}function yb({className:e,...t}){return(0,h.jsx)(Tp,{"data-slot":`dialog-title`,className:R(`text-title font-bold tracking-[-0.01em] text-ink`,e),...t})}function bb({className:e,...t}){return(0,h.jsx)(Dp,{"data-slot":`dialog-description`,className:R(`text-body text-ink2`,e),...t})}var V={projects:[`projects`],revisions:e=>[`project`,e,`revisions`],revision:(e,t)=>[`project`,e,`revision`,t],revisionFile:(e,t,n)=>[`revision-file`,e,t,n],project:e=>[`project`,e],article:(e,t=null)=>[`project`,e,`article`,t],audioPreview:(e,t)=>[`audio-preview`,e,t],file:(e,t)=>[`file`,e,t],staging:[`staging`],notice:[`notice`],usage:[`usage`],providers:[`providers`],voices:[`voices`],prompts:[`prompts`],entries:[`entries`],settings:[`settings`]};function xb(e){return rt({queryKey:V.projects,queryFn:()=>mo(e)})}function Sb(e,t){return rt({queryKey:V.project(t),queryFn:()=>ho(e,t)})}function Cb(e){return rt({queryKey:V.notice,queryFn:()=>So(e)})}function wb(e){return rt({queryKey:V.usage,queryFn:()=>xo(e)})}function Tb(e){return rt({queryKey:V.providers,queryFn:()=>To(e)})}function Eb(e){return rt({queryKey:V.voices,queryFn:()=>jo(e)})}function Db(e){return rt({queryKey:V.prompts,queryFn:()=>Io(e)})}function Ob(e){return rt({queryKey:V.entries,queryFn:()=>zo(e)})}function kb(e){return rt({queryKey:V.settings,queryFn:()=>ko(e)})}var Ab=[`Tokens in and out per stage, with provider and model`,`Audio seconds per segment`,`Images made`,`Thumbnails made`,`Videos rendered`,`PDF documents made`,`YouTube descriptions written`,`Projects created`,`That this machine installed Slopify`,`The time each of those happened`],jb=[`API keys`,`Prompt bodies`,`Keyword values`,`Titles`,`Article or research text`,`Files and filenames`,`OS, locale, hardware`];function Mb(){let{api:e}=z(),t=_(),n=F(Cb(e)),r=it({mutationFn:()=>Co(e),onSuccess:e=>{t.setQueryData(V.notice,e)}}),i=n.data?.seen===!1,a=n.data?.appVersion;return(0,h.jsx)(hb,{open:i,children:(0,h.jsxs)(vb,{onEscapeKeyDown:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[(0,h.jsx)(yb,{children:`Anonymous usage stats`}),(0,h.jsx)(bb,{children:`These numbers power the live counters on slopify.stream.`}),(0,h.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,h.jsx)(Nb,{heading:`Tracked`,items:Ab}),(0,h.jsx)(Nb,{heading:`Never tracked`,items:jb})]}),(0,h.jsx)(`p`,{className:`text-small text-ink2`,children:`Every event carries a random ID of its own and this machine's random ID, and nothing else. Nothing you write, upload, or paste ever leaves your machine.`}),a===void 0?null:(0,h.jsx)(`p`,{className:`engraved text-ink3`,children:`Slopify ${a} · this version is included in each report`}),(0,h.jsx)(B,{autoFocus:!0,variant:`play`,size:`play`,disabled:r.isPending,onClick:()=>{r.mutate()},children:`Got it`}),r.error===null?null:(0,h.jsx)(`p`,{role:`alert`,className:`text-small text-red`,children:r.error.message})]})})}function Nb({heading:e,items:t}){let n=`notice-${e.replace(/\s+/g,`-`).toLowerCase()}`;return(0,h.jsxs)(`div`,{className:`flex flex-col gap-[6px]`,children:[(0,h.jsx)(`p`,{id:n,className:`engraved border-b border-line pb-1 text-ink3`,children:e}),(0,h.jsx)(`ul`,{"aria-labelledby":n,className:`m-0 flex list-none flex-col gap-[6px] p-0 text-small`,children:t.map(e=>(0,h.jsx)(`li`,{children:e},e))})]})}function Pb(e,t){if(t===`system`){e.removeAttribute(`data-theme`);return}e.setAttribute(`data-theme`,t)}function Fb(){let{api:e}=z(),t=F(kb(e)).data?.appearance??`system`;return(0,m.useEffect)(()=>{Pb(document.documentElement,t)},[t]),null}function Ib({reload:e}){let{version:t}=z(),n=(0,m.useSyncExternalStore)(t.subscribe,t.staleAt,t.staleAt);return(0,h.jsx)(hb,{open:n!==void 0,children:(0,h.jsxs)(vb,{onEscapeKeyDown:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[(0,h.jsx)(yb,{children:`Slopify was updated`}),(0,h.jsx)(bb,{children:`This tab was loaded before the update. Version ${n??``} is running now; reload to catch up.`}),(0,h.jsx)(B,{autoFocus:!0,variant:`play`,size:`play`,onClick:e,children:`Reload`})]})})}var Lb=[`stage.state`,`stage.progress`,`article.delta`,`llm.preview`,`image.landed`,`project.state`,`project.updated`],Rb=[`running.count`,`staging.progress`,`staging.failed`,`project.updated`,`project.state`];function zb(e,t,n){return Vb(e,t,Lb,n.refetch,e=>{if(n.accept?.(e)!==!1){if(e.type===`llm.preview`){n.previewWriting?.(e);return}if(e.type===`article.delta`){n.appendArticle(e.text);return}if(e.type===`image.landed`||e.type===`project.updated`){n.refetch();return}n.patch(e),e.type===`stage.state`&&n.refetch()}})}function Bb(e,t,n){return Vb(e,t,Rb,n.refetch,e=>{if(e.type===`running.count`){n.tally(e.count);return}if(e.type===`project.updated`||e.type===`project.state`){n.refetch(e.projectId);return}n.stagingChanged()})}function Vb(e,t,n,r,i){let a=e(t),o=!1;a.addEventListener(`open`,()=>{o&&r(),o=!0});for(let e of n)a.addEventListener(e,t=>{let n=Hb(t.data);n.type===e&&i(n)});return()=>{a.close()}}function Hb(e){return JSON.parse(e)}var Ub=[`16:9`,`9:16`],Wb=[`research`,`article`,`audio`,`images`,`thumbnail`,`video`,`document`],Gb=[`generate`,`provide`,`off`,`from_prompt`,`prompt_by_llm`];function Kb(e,t){return e[t]??`off`}var qb=[`zoom`,`pan`,`mixed`,`still`],Jb=[`text`,`llm`],Yb=[`dicemaster`,`plain`],Xb={dicemaster:`DiceMaster`,plain:`Plain`};function Zb(e){return e?.theme??`dicemaster`}function Qb(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function $b(e,t=`|`){return e.map(e=>_x(e)).join(t)}function ex(e,t){return typeof t==`bigint`?t.toString():t}function tx(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nx(e){return e==null}function rx(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ix(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function ax(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ox(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function sx(e){return JSON.stringify(e)}function cx(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var lx=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ux(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var dx=tx(()=>{if(nS.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function fx(e){if(ux(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ux(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function px(e){return fx(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var mx=new Set([`string`,`number`,`symbol`]);function hx(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function gx(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function _x(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function vx(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var yx={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function bx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return gx(e,ox(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&ax(e,r,n.shape[r])}return ax(this,`shape`,e),e},checks:[]}))}function xx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return gx(e,ox(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return ax(this,`shape`,r),r},checks:[]}))}function Sx(e,t){if(!fx(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return gx(e,ox(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ax(this,`shape`,n),n}}))}function Cx(e,t){if(!fx(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return gx(e,ox(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ax(this,`shape`,n),n}}))}function wx(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return gx(e,ox(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ax(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Tx(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return gx(t,ox(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ax(this,`shape`,i),i},checks:[]}))}function Ex(e,t,n){return gx(t,ox(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return ax(this,`shape`,i),i}}))}function Dx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ox(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kx(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ax(e){return typeof e==`string`?e:e?.message}function jx(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Mx(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ax(e.inst?._zod.def?.error?.(e))??Ax(a?.(e))??Ax(t?.error?.(e))??Ax(n.customError?.(e))??Ax(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}var Nx=/[\uD800-\uDBFF]/;function Px(e){let t=e.length;if(!Nx.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Fx(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ix(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Lx(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Rx(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Vx(e,n,r.value)}}function zx(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Bx(e,t,n){return zx(e,t,n,!1)}function Vx(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:zx(this,t,n.bind(this))},set(e){zx(this,t,e)}})}function Hx(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ux,Wx=!1,Gx={configurable:!0,get(){Wx=!0}};function Kx(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Ux!==e._zod){Ux=void 0;return}Ux=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Gx);let e=Wx;Wx=!1;try{let r=n(this);return Wx?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Wx||=e,r}catch(n){throw delete this[t],Wx||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function qx(e,t,n,r){let i=Hx(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Jx=`~constantCatch`;function Yx(e){let t=()=>e;return t[Jx]=!0,t}var Xx,Zx={value:void 0,enumerable:!1},Qx=`captureStackTrace`in Error?Error:null;function $x(e){let t=Qx;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Qx=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Zx.value=new a(r);try{Object.defineProperty(n,"_zod",Zx)}finally{Zx.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Rx(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?$x(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var eS=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},tS=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Xx=globalThis).__zod_globalConfig??(Xx.__zod_globalConfig={});var nS=globalThis.__zod_globalConfig;function rS(e){return e&&Object.assign(nS,e),nS}function iS(){let e=this._zod;return e.message??=JSON.stringify(e.def,ex,2),e.message}function aS(e){this._zod.message=e}var oS={get:iS,set:aS,enumerable:!0,configurable:!0},sS={value:void 0,enumerable:!1},cS={value:void 0,enumerable:!1},lS=new WeakSet([Object.prototype,Error.prototype]),uS=(e,t)=>{e.name=`$ZodError`,sS.value=e._zod,Object.defineProperty(e,"_zod",sS),cS.value=t,Object.defineProperty(e,"issues",cS),sS.value=void 0,cS.value=void 0,Object.defineProperty(e,"message",oS);let n=Object.getPrototypeOf(e);lS.has(n)||(lS.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},dS=U(`$ZodError`,uS),fS=U(`$ZodError`,uS,void 0,{Parent:Error});function pS(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function mS(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?pS(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function hS(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function gS(e,t){return{callee:t?.callee??e,Err:t?.Err}}var _S=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new eS;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Mx(e,o,rS())));throw lx(n,a?.callee??t),n}return s.value};return t},vS=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Mx(e,o,rS())));throw lx(n,a?.callee??t),n}return s.value};return t},yS=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new eS;return a.issues.length?{success:!1,error:new(e??dS)(a.issues.map(e=>Mx(e,i,rS())))}:{success:!0,data:a.value}},bS=yS(fS),xS=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Mx(e,i,rS())))}:{success:!0,data:a.value}},SS=xS(fS),CS=e=>{let t=_S(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,gS(n,a))};return n},wS=e=>{let t=_S(e),n=(e,r,i,a)=>t(e,r,i,gS(n,a));return n},TS=e=>{let t=vS(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,gS(n,a))};return n},ES=e=>{let t=vS(e),n=async(e,r,i,a)=>await t(e,r,i,gS(n,a));return n},DS=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yS(e)(t,n,i)},OS=e=>(t,n,r)=>yS(e)(t,n,r),kS=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return xS(e)(t,n,i)},AS=e=>async(t,n,r)=>xS(e)(t,n,r),jS=/^[cC][0-9a-z]{6,}$/,MS=/^[0-9a-z]+$/,NS=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,PS=/^[0-9a-vA-V]{20}$/,FS=/^[A-Za-z0-9]{27}$/,IS=/^[a-zA-Z0-9_-]{21}$/;function LS(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var RS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,BS=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,VS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HS=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function US(){return new RegExp(HS,`u`)}var WS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,KS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,JS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,YS=/^[A-Za-z0-9_-]*$/,XS=/^https?$/,ZS=/^\+[1-9]\d{6,14}$/,QS=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function $S(e){return RegExp(`^${e}$`)}var eC=$S(QS);function tC(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nC(e){return RegExp(`^${tC(e)}$`)}function rC(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${tC({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${tC({precision:e.precision})}`:n;return RegExp(`^${QS}T(?:${r})$`)}var iC=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},aC=/^-?\d+$/,oC=/^-?\d+(?:\.\d+)?$/,sC=/^(?:true|false)$/i,cC=/^null$/i,lC=/^[^A-Z]*$/,uC=/^[^a-z]*$/,dC=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fC=e=>{let t=e.value;return!nx(t)&&t.length!==void 0},pC={number:`number`,bigint:`bigint`,object:`date`},mC=U(`$ZodCheckLessThan`,(e,t)=>{dC.init(e,t);let n=pC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:pC[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hC=U(`$ZodCheckGreaterThan`,(e,t)=>{dC.init(e,t);let n=pC[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:pC[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gC=U(`$ZodCheckMultipleOf`,(e,t)=>{dC.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ix(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_C=U(`$ZodCheckNumberFormat`,(e,t)=>{dC.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=yx[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=aC)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),vC=U(`$ZodCheckMaxLength`,(e,t)=>{var n;dC.init(e,t),(n=e._zod.def).when??(n.when=fC),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Px(r):i)<=t.maximum)return;let a=Fx(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yC=U(`$ZodCheckMinLength`,(e,t)=>{var n;dC.init(e,t),(n=e._zod.def).when??(n.when=fC),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Px(r):i)>=t.minimum)return;let a=Fx(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bC=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;dC.init(e,t),(n=e._zod.def).when??(n.when=fC),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Px(r):i;if(a===t.length)return;let o=Fx(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xC=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;dC.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),SC=U(`$ZodCheckRegex`,(e,t)=>{xC.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),CC=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=lC,xC.init(e,t)}),wC=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=uC,xC.init(e,t)}),TC=U(`$ZodCheckIncludes`,(e,t)=>{dC.init(e,t);let n=hx(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),EC=U(`$ZodCheckStartsWith`,(e,t)=>{dC.init(e,t);let n=RegExp(`^${hx(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),DC=U(`$ZodCheckEndsWith`,(e,t)=>{dC.init(e,t);let n=RegExp(`.*${hx(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),OC=U(`$ZodCheckOverwrite`,(e,t)=>{dC.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),kC=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
50
50
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
51
51
|
`)}\n};`)(...Object.values(this.closed))}},AC={major:4,minor:5,patch:4},jC=U(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=AC;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Dx(t),a;for(let o of n){if(o._zod.def.when){if(Ox(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new eS;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(jx(t.issues,n,e),i||=Dx(t,n))});else{if(t.issues.length===n)continue;jx(t.issues,n,e),i||=Dx(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Dx(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new eS;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new eS;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Bx(this,`~standard`,NC(this))},set"~standard"(e){zx(this,`~standard`,e)}}),MC=e=>e.success?{value:e.data}:{issues:e.error?.issues};function NC(e){return{validate:t=>{try{return MC(bS(e,t))}catch{return SS(e,t).then(MC)}},vendor:`zod`,version:1}}var PC=U(`$ZodString`,(e,t)=>{jC.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??iC(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),FC=U(`$ZodStringFormat`,(e,t)=>{xC.init(e,t),PC.init(e,t)}),IC=U(`$ZodGUID`,(e,t)=>{t.pattern??=zS,FC.init(e,t)}),LC=U(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=BS(e)}else t.pattern??=BS();FC.init(e,t)}),RC=U(`$ZodEmail`,(e,t)=>{t.pattern??=VS,FC.init(e,t)});function zC(e,t){if(!t.normalize&&t.protocol?.source===XS.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var BC=/[\t\n\r]/g;function VC(e){return e.replace(BC,``)}function HC(e,t){return t.lastIndex=0,t.test(e.hostname)}function UC(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var WC=U(`$ZodURL`,(e,t)=>{FC.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=zC(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!HC(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!UC(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:VC(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),GC=U(`$ZodEmoji`,(e,t)=>{t.pattern??=US(),FC.init(e,t)}),KC=U(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?IS:LS(t.length),FC.init(e,t)}),qC=U(`$ZodCUID`,(e,t)=>{t.pattern??=jS,FC.init(e,t)}),JC=U(`$ZodCUID2`,(e,t)=>{t.pattern??=MS,FC.init(e,t)}),YC=U(`$ZodULID`,(e,t)=>{t.pattern??=NS,FC.init(e,t)}),XC=U(`$ZodXID`,(e,t)=>{t.pattern??=PS,FC.init(e,t)}),ZC=U(`$ZodKSUID`,(e,t)=>{t.pattern??=FS,FC.init(e,t)}),QC=U(`$ZodISODateTime`,(e,t)=>{t.pattern??=rC(t),FC.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),$C=U(`$ZodISODate`,(e,t)=>{t.pattern??=eC,FC.init(e,t)}),ew=U(`$ZodISOTime`,(e,t)=>{t.pattern??=nC(t),FC.init(e,t)}),tw=U(`$ZodISODuration`,(e,t)=>{t.pattern??=RS,FC.init(e,t)}),nw=U(`$ZodIPv4`,(e,t)=>{t.pattern??=WS,FC.init(e,t),e._zod.bag.format=`ipv4`}),rw=/^[0-9a-fA-F:.]+$/;function iw(e){if(!rw.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var aw=U(`$ZodIPv6`,(e,t)=>{t.pattern??=GS,FC.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{iw(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),ow=U(`$ZodCIDRv4`,(e,t)=>{t.pattern??=KS,FC.init(e,t)});function sw(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:iw(n)}var cw=U(`$ZodCIDRv6`,(e,t)=>{t.pattern??=qS,FC.init(e,t),e._zod.check=n=>{sw(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function lw(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var uw=U(`$ZodBase64`,(e,t)=>{t.pattern??=JS,FC.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{lw(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function dw(e){if(!YS.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return lw(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var fw=U(`$ZodBase64URL`,(e,t)=>{t.pattern??=YS,FC.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{dw(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),pw=U(`$ZodE164`,(e,t)=>{t.pattern??=ZS,FC.init(e,t)});function mw(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var hw=U(`$ZodJWT`,(e,t)=>{FC.init(e,t),e._zod.check=n=>{mw(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),gw=U(`$ZodNumber`,(e,t)=>{jC.init(e,t),e._zod.pattern=e._zod.bag.pattern??oC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),_w=U(`$ZodNumberFormat`,(e,t)=>{_C.init(e,t),gw.init(e,t)}),vw=U(`$ZodBoolean`,(e,t)=>{jC.init(e,t),e._zod.pattern=sC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),yw=U(`$ZodNull`,(e,t)=>{jC.init(e,t),e._zod.pattern=cC,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),bw=U(`$ZodUnknown`,(e,t)=>{jC.init(e,t),e._zod.parse=e=>e}),xw=U(`$ZodNever`,(e,t)=>{jC.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Sw(e,t,n){e.issues.length&&t.issues.push(...kx(n,e.issues)),t.value[n]=e.value}var Cw=U(`$ZodArray`,(e,t)=>{jC.init(e,t);let n=nS.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;e<a.length;e++){let n=a[e],s=t.element._zod.run({value:n,issues:[]},i);s instanceof Promise?o.push(s.then(t=>Sw(t,r,e))):Sw(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function ww(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...kx(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var Tw=[];function Ew(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Tw,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=vx(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Dw(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ww(e,n,i,t,u,d))):ww(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Ow=new WeakMap,kw=U(`$ZodObject`,(e,t)=>{if(jC.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Ow.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),Ow.set(t,n),n}})}let n=tx(()=>Ew(t));Kx(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||ax(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=ux,i=t.catchall,a,o=nS.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>ww(n,t,e,c,r,i))):ww(a,t,e,c,r,i)}return i?Dw(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Aw=U(`$ZodObjectJIT`,(e,t)=>{kw.init(e,t);let n=e._zod.parse,r=tx(()=>Ew(t)),i=nS.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new kC([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
52
52
|
for (let i = 0; i < ${e}.issues.length; i++) {
|
package/dist/web/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
7
|
<meta name="color-scheme" content="dark light" />
|
|
8
8
|
<title>Slopify</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-DV01Cyjx.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-B6NbhpjD.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|