@fungi.computer/shed 0.5.3 → 0.5.4

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.
@@ -92,7 +92,7 @@ Example:
92
92
  For tests, pass a Ghostty instance directly:
93
93
  import { Ghostty, Terminal } from "ghostty-web";
94
94
  const ghostty = await Ghostty.load();
95
- const term = new Terminal({ ghostty });`)}var pS;function mS(){return pS??=Gle.load(),pS}var uue=[``,`bold `,`italic `,`bold italic `];async function hS(e,t){await Promise.all(uue.map(n=>document.fonts.load(`${n}${String(e)}px ${t}`)))}var due=L({path:vg,entries:Cg(L({name:vg,type:Eg([`file`,`directory`,`symlink`]),size:yg,modifiedAt:yg})),nextOffset:Dg(yg)}),fue=Wx(`computer.list`,1,qo(()=>Gx({list:qx(Kx(to().transform(e=>ug(due)(e))))}))),gS=Tg([L({state:Eg([`running`,`sleeping`,`starting`,`start_failed`])}),L({state:mg(`queued`),position:yg.pipe(kg(Wg()),kg(Vg(0)))})]),_S=L({enabled:bg,effective:bg,blockedBy:Dg(Eg([`team`,`global`]))}),pue=L({computerId:Xg,name:Xg,runtime:gS,backends:Cg(L({id:Xg,kind:Eg([`platform-container`,`on-box-vm`,`local`]),status:Eg([`ready`,`queued`,`online`,`offline`]),queuePosition:Dg(yg.pipe(kg(Wg()),kg(Vg(0)))),hostId:Dg(vg),hostLabel:Dg(vg),folderLabel:Dg(vg),detachable:bg})),internet:_S});Wx(`computer.instrument.read`,1,qo(()=>Gx({read:qx(Kx(to().transform(e=>ug(pue)(e))))}))),Wx(`computer.instrument.control`,1,qo(()=>Gx({start:qx(Kx(to().transform(e=>ug(gS)(e)))),setInternetAccess:qx(Kx(to().transform(e=>ug(_S)(e)))),detachLocal:qx(Kx(to().transform(e=>ug(L({detached:bg}))(e))))})));var vS=Tg([L({ports:Cg(L({port:yg.pipe(kg(Wg()),kg(Ug({minimum:1,maximum:65535}))),previewUrl:Xg,openMode:Eg([`inline`,`external-only`]),expiresAt:yg.pipe(kg(Wg()),kg(Vg(0)))})).pipe(kg(Jg(64)))}),L({error:mg(`port_previews_not_configured`)})]),yS=L({port:yg.annotate({message:`Use a port from 1 to 65535.`}).check(Wg({message:`Use a port from 1 to 65535.`}),Ug({minimum:1,maximum:65535},{message:`Use a port from 1 to 65535.`})),exposed:bg}),mue=L({port:yg.pipe(kg(Wg()),kg(Ug({minimum:1,maximum:65535}))),removed:bg}),bS=Wx(`computer.ports`,2,qo(()=>Gx({list:qx(Kx(to().transform(e=>ug(vS)(e)))),expose:qx(Kx(to().transform(e=>ug(yS)(e)))),unexpose:qx(Kx(to().transform(e=>ug(mue)(e))))})));async function hue(e){let t=ug(vS)(await e.require(bS).list());if(`error`in t)return t;for(let{previewUrl:e,expiresAt:n}of t.ports){let t=new URL(e);if(t.protocol!==`https:`||t.username||t.password||n<=Date.now())throw Error(`Computer preview URL is invalid`)}return t}var gue=Eg([`synced`,`pending`,`unknown`]),xS=L({port:Dg(yS.fields.port),id:Xg,command:Xg,cwd:Dg(vg),startedAt:yg.pipe(kg(Wg()),kg(Hg(0))),state:Eg([`running`,`exited`,`uncertain`]),exitCode:Dg(yg.pipe(kg(Wg()))),sync:gue,endedAt:Dg(yg.pipe(kg(Wg()),kg(Hg(0))))}),_ue=L({processes:Cg(xS)}),vue=L({process:xS,signalled:bg}),yue=L({process:xS,lines:Cg(vg.pipe(kg(Jg(2e3)))).pipe(kg(Jg(200))),truncated:bg});L({requestId:Xg.pipe(kg(Jg(256))),command:Xg.pipe(kg(Jg(16384))),cwd:fg(vg),port:fg(yS.fields.port)});var SS=Wx(`computer.processes`,1,qo(()=>Gx({start:qx(Kx(to().transform(e=>ug(xS)(e)))),list:qx(Kx(to().transform(e=>ug(_ue)(e)))),kill:qx(Kx(to().transform(e=>ug(vue)(e)))),logs:qx(Kx(to().transform(e=>ug(yue)(e))))})));function bue(e){let t=o_(e);return t.action===`setup`?{reason:`no-runtime`,message:`No Computer is running to answer this yet.`,action:`setup`}:t.action===`grant`?{reason:`not-granted`,message:`This App needs permission to see this Computer.`,action:`grant`}:{reason:`failed`,message:t.message,action:`retry`}}var xue=Wx(`computer.readFile`,1,qo(()=>Gx({open:qx(Gx({response:qx(ns(Response)),close:Jx}))}))),Sue=Wx(`computer.writeFile`,3,qo(()=>Gx({open:qx(Gx({write:Jx,close:Jx})),mkdir:Jx,replace:qx(Kx(to().transform(e=>ug(Cue)(e))))}))),Cue=Tg([L({kind:mg(`replaced`),path:Xg,bytes:yg.pipe(kg(Wg()),kg(Hg(0)))}),L({kind:mg(`conflict`)})]),CS=L({computerName:Xg.pipe(kg(Jg(256))),teamName:Xg.pipe(kg(Jg(256))),modelDoor:Xg.pipe(kg(Jg(256))),uptimeSeconds:yg.pipe(kg(Wg()),kg(Hg(0))),version:Xg.pipe(kg(Jg(64)))}),wS=Wx(`computer.terminal`,2,qo(()=>Gx({open:qx(Gx({information:qx(Kx(to().transform(e=>ug(CS)(e)))),output:qx(ns(ReadableStream).transform(e=>e.pipeThrough(new TransformStream({transform(e,t){t.enqueue(ns(Uint8Array).parse(e))}})))),input:qx(ns(WritableStream)),resize:Jx,close:Jx}))})));async function wue(e,t,n={}){n.signal?.throwIfAborted();let r=await e.require(wS).open(t),i,a=()=>i===void 0?(n.signal?.removeEventListener(`abort`,o),i=Promise.resolve().then(async()=>{try{await r.close()}finally{r[Symbol.dispose]()}}),i):i,o=()=>{a().catch(e=>{rv(`computer.terminal.abort-close`,e)})};n.signal?.addEventListener(`abort`,o,{once:!0});try{let[e,t,o]=await Promise.all([r.output(),r.input(),r.information()]);n.signal?.throwIfAborted();let s=e,c=t;return{information:ug(CS)(o),output:s,input:c,resize:async e=>{if(n.signal?.throwIfAborted(),i!==void 0)throw Error(`Computer terminal is closed`);await r.resize(e)},close:a}}catch(e){throw await a().catch(e=>{rv(`computer.terminal.open-cleanup`,e)}),e}}function TS(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Tue(...e){return t=>{let n=!1,r=e.map(e=>{let r=TS(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():TS(e[t],null)}}}}function Eue(...e){return F.useCallback(Tue(...e),e)}function Due(e){let t=F.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];DS(r)&&typeof OS==`function`&&(r=OS(r._payload)),F.Children.forEach(r,e=>{if(Mue(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;DS(n)&&typeof OS==`function`&&(n=OS(n._payload)),a=kue(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=F.cloneElement(a,void 0,s):!o&&F.Children.count(r)===1&&F.isValidElement(r)&&(a=r);let c=a?jue(a):void 0,l=Eue(n,c);if(!a){if(r||r===0)throw Error(o?Iue(e):Fue(e));return r}let u=Aue(i,a.props??{});return a.type!==F.Fragment&&(u.ref=n?l:c),F.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var ES=Due(`Slot`),Oue=Symbol.for(`radix.slottable`),kue=(e,t)=>{if(`child`in e.props){let t=e.props.child;return F.isValidElement(t)?F.cloneElement(t,void 0,e.props.children(t.props.children)):null}return F.isValidElement(t)?t:null};function Aue(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function jue(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mue(e){return F.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Oue}var Nue=Symbol.for(`react.lazy`);function DS(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Nue&&`_payload`in e&&Pue(e._payload)}function Pue(e){return typeof e==`object`&&!!e&&`then`in e}var Fue=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Iue=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,OS=F.use,Lue=Object.freeze({alphaIntercept:-9,alphaSlope:19,blurStdDeviation:1.5}),Rue=Object.freeze({background:`#eff1f5`,foreground:`#4c4f69`,cursor:`#4c4f69`,cursorAccent:`#eff1f5`,surface:`#ccd0da`,selectionBackground:`#4c4f69`,selectionForeground:`#eff1f5`,primary:`#f98284`,accent:`#ea76cb`,success:`#40a02b`,info:`oklch(58% 0.158 241.966)`,warning:`#df8e1d`,error:`#d20f39`,black:`#5c5f77`,red:`#d20f39`,green:`#40a02b`,yellow:`#df8e1d`,blue:`#1e66f5`,magenta:`#ea76cb`,cyan:`#179299`,white:`#4c4f69`,brightBlack:`#6c6f85`,brightRed:`#d20f39`,brightGreen:`#40a02b`,brightYellow:`#df8e1d`,brightBlue:`#1e66f5`,brightMagenta:`#8839ef`,brightCyan:`#04a5e5`,brightWhite:`#4c4f69`}),zue=Object.freeze({background:`#1e1e2e`,foreground:`#cdd6f4`,cursor:`#cdd6f4`,cursorAccent:`#1e1e2e`,surface:`#45475a`,selectionBackground:`#cdd6f4`,selectionForeground:`#1e1e2e`,primary:`#f98284`,accent:`#f5c2e7`,success:`#a6e3a1`,info:`#89b4fa`,warning:`#f9e2af`,error:`#f38ba8`,black:`#45475a`,red:`#f38ba8`,green:`#a6e3a1`,yellow:`#f9e2af`,blue:`#89b4fa`,magenta:`#f5c2e7`,cyan:`#94e2d5`,white:`#cdd6f4`,brightBlack:`#585b70`,brightRed:`#f38ba8`,brightGreen:`#a6e3a1`,brightYellow:`#f9e2af`,brightBlue:`#89b4fa`,brightMagenta:`#cba6f7`,brightCyan:`#89dceb`,brightWhite:`#cdd6f4`}),Bue=Object.freeze({background:`#fbfbfa`,foreground:`#1a1b1e`,cursor:`#1a1b1e`,cursorAccent:`#fbfbfa`,surface:`#e6e6e1`,selectionBackground:`#1a1b1e`,selectionForeground:`#fbfbfa`,primary:`#e5534b`,accent:`#e5534b`,success:`#2f7a3e`,info:`#2659c4`,warning:`#9a6200`,error:`#c4383a`,black:`#5c5f66`,red:`#c4383a`,green:`#2f7a3e`,yellow:`#9a6200`,blue:`#2659c4`,magenta:`#933a88`,cyan:`#0f7079`,white:`#1a1b1e`,brightBlack:`#6b6f76`,brightRed:`#c4383a`,brightGreen:`#2f7a3e`,brightYellow:`#9a6200`,brightBlue:`#2659c4`,brightMagenta:`#933a88`,brightCyan:`#0f7079`,brightWhite:`#1a1b1e`}),Vue=Object.freeze({background:`#0e0f11`,foreground:`#e3e3df`,cursor:`#e3e3df`,cursorAccent:`#0e0f11`,surface:`#26292e`,selectionBackground:`#e3e3df`,selectionForeground:`#0e0f11`,primary:`#ff7b6b`,accent:`#ff7b6b`,success:`#8fd19e`,info:`#8ab4f8`,warning:`#e7c27a`,error:`#ff8a80`,black:`#9a9ea6`,red:`#ff8a80`,green:`#8fd19e`,yellow:`#e7c27a`,blue:`#8ab4f8`,magenta:`#dba6e8`,cyan:`#7fd3d3`,white:`#e3e3df`,brightBlack:`#7d828b`,brightRed:`#ff8a80`,brightGreen:`#8fd19e`,brightYellow:`#e7c27a`,brightBlue:`#8ab4f8`,brightMagenta:`#dba6e8`,brightCyan:`#7fd3d3`,brightWhite:`#e3e3df`});function kS(e){switch(e.trim()){case`readout`:return Bue;case`readout-night`:return Vue;case`latte`:return Rue;case`mocha`:return zue;default:return}}var Hue=Object.freeze([`2xs`,`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`]);Object.freeze(`--stipe-font-synthesis.--stipe-surface-frame-width.--stipe-surface-frame-image.--stipe-surface-molding-contrast.--stipe-shadow-raised.--stipe-shadow-inset.--stipe-shadow-edge.--stipe-display-gasket-face.--stipe-display-texture-image.--stipe-display-text-shadow.--stipe-canvas.--stipe-surface.--stipe-surface-raised.--stipe-surface-selected.--stipe-fg-muted.--stipe-linework.--stipe-hairline.--stipe-hairline-quiet.--stipe-figure-ink.--stipe-density-compact.--stipe-density-comfortable.--stipe-motion-spring.--stipe-motion-squish.--stipe-motion-fast.--stipe-motion-normal.--stipe-motion-slow.--stipe-motion-ease.--stipe-motion-ease-exit.--stipe-motion-bounce.--stipe-motion-spring-duration.--stipe-motion-stretch.--stipe-motion-distance.--stipe-motion-stagger.--stipe-motion-blur.--stipe-motion-shake.--stipe-motion-steps.--stipe-motion-fuse.--stipe-press-depth.--stipe-press-scale.--stipe-layer-desktop.--stipe-layer-windows.--stipe-layer-chrome.--stipe-layer-popover.--stipe-layer-dialog.--stipe-layer-toast.--stipe-layer-tooltip.--stipe-overlay-shadow-outset.--stipe-icon-size-sm.--stipe-icon-size-md.--stipe-icon-size-lg.--stipe-icon-stroke.--stipe-card-rim.--stipe-card-rim-edge.--stipe-card-face.--stipe-card-panel.--stipe-card-ink.--stipe-card-ink-muted.--stipe-card-accent.--stipe-card-shadow.--stipe-card-foil-highlight.--stipe-card-foil-warm.--stipe-card-foil-cool.--stipe-avatar-shadow.--stipe-art-coral.--stipe-art-blue.--stipe-art-mint.--stipe-art-grape.--stipe-art-yellow.--stipe-art-cream.--stipe-art-ink.--stipe-art-inkcap.--stipe-art-graphite.--stipe-sketch-ink`.split(`.`));function AS(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=AS(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Uue(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=AS(e))&&(r&&(r+=` `),r+=t);return r}var jS=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,MS=Uue,Wue=(e,t)=>n=>{if(t?.variants==null)return MS(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=jS(t)||jS(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return MS(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},NS=Object.defineProperty,Gue=((e,t)=>{let n={};for(var r in e)NS(n,r,{get:e[r],enumerable:!0});return t||NS(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>LS,isAnyNonArbitrary:()=>ade,isArbitraryFamilyName:()=>fde,isArbitraryImage:()=>mde,isArbitraryLength:()=>lde,isArbitraryNumber:()=>ude,isArbitraryPosition:()=>pde,isArbitraryShadow:()=>hde,isArbitrarySize:()=>cde,isArbitraryValue:()=>JS,isArbitraryVariable:()=>YS,isArbitraryVariableFamilyName:()=>_de,isArbitraryVariableImage:()=>bde,isArbitraryVariableLength:()=>gde,isArbitraryVariablePosition:()=>vde,isArbitraryVariableShadow:()=>xde,isArbitraryVariableSize:()=>yde,isArbitraryVariableWeight:()=>Sde,isArbitraryWeight:()=>dde,isFraction:()=>Que,isInteger:()=>$ue,isNamedContainerQuery:()=>ode,isNumber:()=>IS,isPercent:()=>ede,isTshirtSize:()=>tde}),PS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Kue=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,que=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jue=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Yue=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xue=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zue=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Que=e=>Kue.test(e),IS=e=>!!e&&!Number.isNaN(Number(e)),$ue=e=>!!e&&Number.isInteger(Number(e)),ede=e=>e.endsWith(`%`)&&IS(e.slice(0,-1)),tde=e=>que.test(e),LS=()=>!0,nde=e=>Jue.test(e)&&!Yue.test(e),RS=()=>!1,rde=e=>Xue.test(e),ide=e=>Zue.test(e),ade=e=>!JS(e)&&!YS(e),ode=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),zS=(e,t,n)=>{let r=PS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},BS=(e,t,n=!1)=>{let r=FS.exec(e);return r?r[1]?t(r[1]):n:!1},VS=e=>e===`position`||e===`percentage`,HS=e=>e===`image`||e===`url`,US=e=>e===`length`||e===`size`||e===`bg-size`,WS=e=>e===`length`,sde=e=>e===`number`,GS=e=>e===`family-name`,KS=e=>e===`number`||e===`weight`,qS=e=>e===`shadow`,cde=e=>zS(e,US,RS),JS=e=>PS.test(e),lde=e=>zS(e,WS,nde),ude=e=>zS(e,sde,IS),dde=e=>zS(e,KS,LS),fde=e=>zS(e,GS,RS),pde=e=>zS(e,VS,RS),mde=e=>zS(e,HS,ide),hde=e=>zS(e,qS,rde),YS=e=>FS.test(e),gde=e=>BS(e,WS),_de=e=>BS(e,GS),vde=e=>BS(e,VS),yde=e=>BS(e,US),bde=e=>BS(e,HS),xde=e=>BS(e,qS,!0),Sde=e=>BS(e,KS,!0),XS=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},Cde=e=>typeof e==`function`&&e.isThemeGetter===!0,wde=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),Tde=(e,t)=>{let n=wde(e);t.prefix!==void 0&&(n.prefix=t.prefix);let r=(e,t)=>{if(t)for(let n in t)t[n]!==void 0&&(e[n]=t[n])},i=t.override;i&&(i.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...i.orderSensitiveModifiers]),r(n.theme,i.theme),r(n.classGroups,i.classGroups),r(n.conflictingClassGroups,i.conflictingClassGroups),r(n.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers));let a=(e,t)=>{if(t)for(let n in t){let r=t[n];r&&(e[n]=(e[n]??[]).concat(r))}},o=t.extend;return o&&(o.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...n.orderSensitiveModifiers,...o.orderSensitiveModifiers]),a(n.theme,o.theme),a(n.classGroups,o.classGroups),a(n.conflictingClassGroups,o.conflictingClassGroups),a(n.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers)),n},ZS={isAny:0,isAnyNonArbitrary:1,isArbitraryValue:2,isArbitraryVariable:3,isFraction:4,isNumber:5,isInteger:6,isPercent:7,isTshirtSize:8,isNamedContainerQuery:9,isArbitraryLength:10,isArbitraryNumber:11,isArbitraryWeight:12,isArbitraryFamilyName:13,isArbitraryPosition:14,isArbitrarySize:15,isArbitraryImage:16,isArbitraryShadow:17,isArbitraryVariableLength:18,isArbitraryVariableFamilyName:19,isArbitraryVariablePosition:20,isArbitraryVariableSize:21,isArbitraryVariableImage:22,isArbitraryVariableShadow:23,isArbitraryVariableWeight:24},Ede=25,Dde=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),QS=(e,t,n)=>{let r=e.idByName.get(t);return r===void 0&&(r=e.names.length,e.names.push(t),e.idByName.set(t,r),e.classifierFns.set(t,n)),r},$S=(e,t)=>{if(typeof t==`function`){let n=e.fnName.get(t);return n===void 0&&(n=`$c`+e.fnName.size,e.fnName.set(t,n),e.impls[n]=t),QS(e,n,t)}let n=t.$v,r=Gue[n];if(ZS[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return QS(e,n,r)},eC=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),Ode=(e,t)=>e.theme[t]??[],kde=(e,t,n)=>{let r=eC(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=eC(),e.nextPart.set(n,t)),e=t}return e},a=(n,r,o)=>{if(typeof n==`string`){let e=n===``?r:i(r,n);e.classGroupId=o;return}if(typeof n==`function`){if(Cde(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:$S(t,n),groupId:o});return}if(XS(n,`$t`)){for(let t of Ode(e,n.$t))a(t,r,o);return}if(XS(n,`$v`)){(r.validators??=[]).push({validatorId:$S(t,n),groupId:o});return}for(let[e,t]of Object.entries(n)){let n=i(r,e);for(let e of t)a(e,n,o)}};for(let[t,i]of Object.entries(e.classGroups)){let e=n(t);for(let t of i)a(t,r,e)}return r},Ade=e=>{let t=Dde(),n=[],r=new Map,i=e=>{let t=r.get(e);return t===void 0&&(t=n.length,n.push(e),r.set(e,t)),t},a=kde(e,t,i),o=e=>{if(e.validators)return!1;for(let t of e.nextPart.values())if(!o(t))return!1;return!0},s=(e,t,n)=>{e.classGroupId>=0&&n.push({tail:t,gid:e.classGroupId});for(let[r,i]of e.nextPart)s(i,t+`-`+r,n)},c=e=>{for(let[t,n]of[...e.nextPart])o(n)?(s(n,t,e.lit),e.nextPart.delete(t)):c(n)};c(a);let l=[{edges:new Map,groupId:-1,vlist:-1}],u=()=>(l.push({edges:new Map,groupId:-1,vlist:-1}),l.length-1),d=[],f=new Map,p=e=>{let t=e.map(e=>e.validatorId+`:`+e.groupId).join(`,`),n=f.get(t);return n===void 0&&(n=d.length,d.push(e.map(e=>[e.validatorId,e.groupId])),f.set(t,n)),n},m=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),i=l[n].edges.get(r);i===void 0&&(i=u(),l[n].edges.set(r,i)),n=i}return n},h=[],g=(e,t,n)=>{e.classGroupId>=0&&(l[t].groupId=e.classGroupId),e.validators&&(l[t].vlist=p(e.validators));for(let{tail:n,gid:r}of e.lit)h.push({anchor:t,tail:n,gid:r});for(let[r,i]of e.nextPart){let e=t;if(!n){let n=l[t].edges.get(45);n===void 0&&(n=u(),l[t].edges.set(45,n)),e=n}let a=m(e,r);g(i,a,!1)}};g(a,0,!0);let _=new Set(h.map(e=>e.anchor)),v=e=>l[e].groupId>=0||l[e].vlist>=0||_.has(e),y=new Map,b=[],x=e=>{let t=b.length;y.set(e,t);let n={edges:[],groupId:l[e].groupId,vlist:l[e].vlist};b.push(n);let r=[...l[e].edges.entries()].sort((e,t)=>e[0]-t[0]);for(let[e,t]of r){let r=String.fromCharCode(e),i=t;for(;l[i].edges.size===1&&!v(i);){let[[e,t]]=l[i].edges.entries();r+=String.fromCharCode(e),i=t}n.edges.push({label:r,oldTarget:i})}for(let e of n.edges)x(e.oldTarget);return t};x(0);let S=b.length,C=0;for(let e of b)C+=e.edges.length;let w=new Int32Array(S),T=new Int32Array(C),E=``,D=new Int32Array(S),O=new Int32Array(S),k=[];{let e=0;for(let t=0;t<S;t++){let n=b[t];w[t]=n.edges.length;for(let t of n.edges)T[e]=t.label.length,E+=t.label,k.push(y.get(t.oldTarget)),e++;D[t]=n.groupId,O[t]=n.vlist}}{let e=new Int32Array(S);for(let t=S-1;t>=0;t--){let n=1,r=t+1;for(let i=0;i<w[t];i++)n+=e[r],r+=e[r];e[t]=n}let t=0;for(let n=0;n<S;n++){let r=n+1;for(let i=0;i<w[n];i++){if(r!==k[t])throw Error(`cn compiler: edge target mismatch at ${t}`);r+=e[r],t++}}}for(let e of h)e.anchor=y.get(e.anchor);{let e=new Int32Array(d.length).fill(-1),t=[];for(let n=0;n<S;n++){let r=O[n];r>=0&&(e[r]===-1&&(e[r]=t.length,t.push(d[r])),O[n]=e[r])}d.length=0,d.push(...t)}let A=0;for(let e of d)A+=e.length;let j=new Int32Array(A),M=new Int32Array(A);{let e=0;for(let t of d)for(let[n,r]of t)j[e]=n,M[e]=r,e++}h.sort((e,t)=>e.anchor-t.anchor||e.gid-t.gid||(e.tail<t.tail?-1:1));let ee=[];for(let e of h){let t=ee[ee.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):ee.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let N=new Map,te=[];for(let e of ee){let t=e.tails.join(` `),n=N.get(t);n===void 0&&(n=te.length,N.set(t,n),te.push(e.tails)),e.set=n}for(let e of te.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let ne=new Set(te.flat()).size;ee.sort((e,t)=>e.anchor-t.anchor||e.set-t.set);for(let t of Object.values(e.conflictingClassGroups))for(let e of t)i(e);for(let t of Object.values(e.conflictingClassGroupModifiers))for(let e of t)i(e);for(let t of e.postfixLookupClassGroups??[])i(t);let re=n.length,P=new Int32Array(re).fill(-1),ie=0,ae=e=>(P[e]===-1&&(P[e]=ie++),P[e]);for(let e=0;e<M.length;e++)M[e]=ae(M[e]);for(let e of ee)e.gid=ae(e.gid);for(let e=0;e<D.length;e++)D[e]>=0&&(D[e]=ae(D[e]));for(let e=0;e<re;e++)P[e]===-1&&(P[e]=ie++);let oe=Array(re);for(let e=0;e<re;e++)oe[P[e]]=n[e];let se=[],ce=[],le=[],ue=[],de=[];for(let t=0;t<re;t++){let n=oe[t],i=(e.conflictingClassGroups[n]??[]).map(e=>P[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>P[r.get(e)]);i.length&&(se.push(t),ce.push(i.length),le.push(...i));for(let e of a)ue.push(t),de.push(e)}let fe=(e.postfixLookupClassGroups??[]).map(e=>P[r.get(e)]),pe=[],me=new Int32Array(j.length);for(let e=0;e<j.length;e++){let n=t.names[j[e]],r=ZS[n];if(r!==void 0)me[e]=r;else{let t=pe.indexOf(n);t===-1&&(t=pe.length,pe.push(n)),me[e]=Ede+t}}let he=new Map,ge=[],_e=[],ve=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(me[e++]);let r=n.join(`,`),i=he.get(r);i===void 0&&(i=ge.length,he.set(r,i),ge.push(n.length),_e.push(...n)),ve.push(i)}}let ye={};for(let e of pe)ye[e]=t.classifierFns.get(e);return{G:re,customNames:pe,impls:ye,edgeCounts:w,edgeLabelLen:T,labelText:E,edgeTargetActual:k,nodeGroup:D,nodeVlist:O,nodeCount:S,totalEdges:C,patCounts:ge,patOps:_e,listPat:ve,vlistGroup:M,litEntries:h,sets:te,attachments:ee,uniqueTailCount:ne,adjGid:se,adjCnt:ce,adjTgt:le,patGid:ue,patTgt:de,postfixLookup:fe,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},tC=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},jde=e=>{let t=Ade(e),n=t.litEntries.length,r=new Int32Array(n),i=new Int32Array(n),a=new Int32Array(n),o=``,s=new Int32Array(t.uniqueTailCount*2);{let e=new Map,n=0,c=0;for(let l of t.attachments)for(let u of t.sets[l.set]){let t=e.get(u);t===void 0&&(t=n++,e.set(u,t),s[t*2]=o.length,s[t*2+1]=u.length,o+=u),r[c]=l.anchor,i[c]=l.gid,a[c]=t,c++}}return{tables:{GROUP_COUNT:t.G,edgeStart:tC(t.edgeCounts),labelStart:tC(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:tC(t.patCounts),vlistOps:Int32Array.from(t.patOps),vlistRef:Int32Array.from(t.listPat),vlistGroup:t.vlistGroup,litAnchor:r,litGroup:i,litPool:a,poolOffsets:s,poolText:o,adjGid:Int32Array.from(t.adjGid),adjStart:tC(t.adjCnt),adjTgt:Int32Array.from(t.adjTgt),patGid:Int32Array.from(t.patGid),patTgt:Int32Array.from(t.patTgt),postfixLookupGroups:Int32Array.from(t.postfixLookup),customValidatorNames:t.customNames,orderSensitiveModifiers:t.orderSensitiveModifiers},validatorImpls:t.impls,prefix:t.prefix}},Mde=`line`in Error(),nC=-1,rC=-1,iC=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},aC=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},Nde=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,ee=new Uint8Array(M),N=0,te=!0;for(let e=0;e<m.length;e++){ee[m[e]]=1;let t=_[g[e]*2+1];t>N&&(N=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(te=!1)}let ne=1;for(;ne<m.length*2;)ne<<=1;let re=new Int32Array(ne).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(iC(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&ne-1;for(;re[n]!==-1;)n=n+1&ne-1;re[n]=e}let P=(e,t,n,r)=>{let i=(iC(t,n,r)^Math.imul(e,2654435761)|0)&ne-1,a=r-n;for(;;){let r=re[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&ne-1}},ie=n.cacheSize??8192,ae=n.prefix??e.prefix??``,oe=ae===``?``:ae+`:`,se=oe.length,ce=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),le=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ue=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,de=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pe=0,me=-1,he=-1,ge=-1,_e=-1,ve=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ye=e=>/\s/.test(String.fromCharCode(e)),be=(e,t,n)=>{if(pe=0,me=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)pe=1;else if(r===40&&i===41)pe=2;else return;ge=t+1,_e=n-1;let a=t+1;if(ve(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ve(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(me=t+1,he=a,ge=a+1)}},xe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},Se=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ce=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,we=e=>!!e&&!Number.isNaN(Number(e)),Te=(e,t,n)=>{if(n-t<11||!xe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&xe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&xe(e,t+10,t+18,`-normal/`)},Ee=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],De=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),Oe=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ke=(e,t,n,r)=>{if(e>=10){if(e>=25)return ce[e-25](t.slice(n,r));let i=e-10;if(pe!==Ee[i])return!1;if(me>=0){for(let e of De[i])if(xe(t,me,he,e))return!0;return!1}switch(Oe[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ge,_e);return le.test(e)&&!ue.test(e)}case 3:return we(t.slice(ge,_e));case 4:return fe.test(t.slice(ge,_e));default:return de.test(t.slice(ge,_e))}}switch(e){case 0:return!0;case 1:return pe===0;case 2:return pe===1;case 3:return pe===2;case 4:return Se.test(t.slice(n,r));case 5:return we(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&we(t.slice(n,r-1));case 8:return Ce.test(t.slice(n,r));default:return Te(t,n,r)}},Ae=new Set(typeof E==`string`?E.split(` `):E),je=(e,t,n,r,i,a)=>{let o=iC(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Me=new Map,Ne=new Map,Pe=2,Fe=4096,Ie=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||Ae.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Ne.get(s);return c===void 0&&Ne.set(s,c=Pe++),c},Le=new Map,Re=r,ze=r+4096,Be=()=>Re++,Ve=2097152,He=8192,Ue=new Int32Array(He),We=Array(He).fill(null),Ge=new Int32Array(He),Ke=new Int32Array(He),qe=new Uint8Array(He),Je=0,Ye=(e,t,n,r,i,a,o,s)=>{let c=e;if(We[e]!==null){if(We[e|1]===null)c=e|1;else if(!(Je++&3))c=e|Je>>2&1;else return}We[c]=t.slice(n,r),Ue[c]=i,Ge[c]=a,Ke[c]=o,qe[c]=s},Xe=()=>We.fill(null),Ze=256,Qe=[new Int32Array(Ze),new Int32Array(Ze),new Int32Array(Ze),new Int32Array(Ze)],[$e,et,tt,nt]=Qe,rt=new Uint8Array(Ze),it=new Uint8Array(Ze),at=()=>{Ze*=2,Qe=Qe.map(e=>{let t=new Int32Array(Ze);return t.set(e),t}),[$e,et,tt,nt]=Qe;let e=new Uint8Array(Ze);e.set(rt),rt=e,it=new Uint8Array(Ze)},ot=64,st=new Int32Array(ot),ct=new Int32Array(ot),lt=new Int32Array(r),ut=2048,dt=21,ft=new Float64Array(ut),pt=new Int32Array(ut),mt=0,ht=(e,t)=>{if(e===0&&t<r)return lt[t]===mt?1:(lt[t]=mt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>dt;for(;pt[i]===mt;){if(ft[i]===n)return 1;i=i+1&ut-1}return ft[i]=n,pt[i]=mt,0},gt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?nC:je(Le,e,t+1,r,0,Be)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=ct[t];if(r>n)continue;let i=st[t],a=n-r;if(ee[i]===1&&a>0&&a<=N){let t=e.charCodeAt(r);if(te===!1||t!==91&&t!==40){let t=P(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;be(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ke(d[t],e,r,n))return p[h+t]}return nC},_t=e=>{let t=e.length,n=0,c=0,u=!1;(Pe>Fe||Me.size>Fe)&&(Me=new Map,Ne=new Map,Pe=2,Xe()),Re>ze&&(Le=new Map,Re=r,Xe());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ye(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ye(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ze&&at();let _=n++;$e[_]=p,et[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Ue[y]===v&&We[y]!==null&&We[y].length===g?t=y:Ue[y|1]===v&&We[y|1]!==null&&We[y|1].length===g&&(t=y|1),t>=0){let n=We[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){tt[_]=Ge[t],nt[_]=Ke[t],rt[_]=qe[t];continue}}}let b=p;if(se!==0){if(h-p<=se||!e.startsWith(oe,p)){tt[_]=nC,Ye(y,e,p,h,v,nC,0,0);continue}b=p+se}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let N=0,te=0,ne=0,re=-1,P=0;(l[0]>=0||ee[0]===1)&&(st[0]=0,ct[0]=M,P=1);let ie=rC,ae=0;for(let t=M;t<D;t++)if(t===A&&(ie=te<ne?rC:N,ae=P),N!==rC){let n=e.charCodeAt(t),r=-1;if(te<ne)o.charCodeAt(te)===n?(te++,te===ne&&(r=N=re)):N=rC;else{let e=i[N],t=i[N+1],c=rC;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(te=e+1,ne=a[i+1],re=s[i],c=N);break}}N=c}if(r>=0&&(l[r]>=0||ee[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(P===ot){ot*=2;let e=new Int32Array(ot);e.set(st),st=e;let t=new Int32Array(ot);t.set(ct),ct=t}st[P]=r,ct[P]=t+2,P++}}A===D&&(ie=te<ne?rC:N,ae=P);let ce=te<ne?rC:N,le,ue=!1;if(A>=0){if(ue=!0,le=gt(e,E,A,ie,ae),le!==nC&&le<r&&j[le]){let t=gt(e,E,D,ce,P);t!==nC&&t!==le&&(le=t,ue=!1)}else le===nC&&(le=gt(e,E,D,ce,P),ue=!1)}else le=gt(e,E,D,ce,P);let de=0,fe=0;le===nC?tt[_]=nC:(fe=+!!ue,de=b>=C?+!!O:je(Me,e,b,C,+!!O,e=>Ie(e,O)),tt[_]=le,rt[_]=fe,nt[_]=de),Ye(y,e,p,h,v,le,de,fe)}if(n===0)return``;if(n===1)return $e[0]===0&&et[0]===t?e:e.slice($e[0],et[0]);if(n*k>ut){for(;n*k>ut;)ut<<=1,dt--;ft=new Float64Array(ut),pt=new Int32Array(ut)}if(Pe>=Ve||Re>=Ve)throw Error(`cn: too many distinct classes in one merge`);mt=mt+1|0,mt===0&&(lt.fill(0),pt.fill(0),mt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=tt[e];if(t===nC){it[e]=1;continue}let n=nt[e];if(ht(n,t)===1){it[e]=0,f=!0;continue}if(it[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)ht(n,x[e]);if(rt[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&ht(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!it[m]){m++;continue}let t=$e[m],r=et[m],i=m+1;for(;i<n&&it[i]&&$e[i]===r+1&&e.charCodeAt(r)===32;)r=et[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},vt=16384,yt=new Int32Array(vt*2),bt=0,xt=1,St=Object.create(null),Ct=Object.create(null),wt=new Map,Tt=new Map,Et=0,Dt=0,Ot=()=>{bt^=vt,xt=xt+1|0,Dt=0},kt=e=>{let t=St[e];if(t!==void 0)return t;let n=aC(e,0,e.length),r=(n&16383)+bt,i=yt[r]===(n^xt)||yt[r^vt]===(n^xt-1);return i&&(t=Ct[e],t!==void 0)?(St[e]=t,t):(t=_t(e),i?(St[e]=t,++Et>ie&&(Et=0,Ct=St,St=Object.create(null),Ot())):(yt[r]=n^xt,++Dt>vt&&Ot()),t)},At=e=>{let t=wt.get(e);if(t!==void 0)return t;let n=aC(e,0,e.length),r=(n&16383)+bt,i=yt[r]===(n^xt)||yt[r^vt]===(n^xt-1);return i&&(t=Tt.get(e),t!==void 0)?(wt.set(e,t),t):(t=_t(e),i?(wt.set(e,t),++Et>ie&&(Et=0,Tt=wt,wt=new Map,Ot())):(yt[r]=n^xt,++Dt>vt&&Ot()),t)},jt=e=>{let t=aC(e,0,e.length),n=(t&16383)+bt;return yt[n]===(t^xt)||yt[n^vt]===(t^xt-1)||(yt[n]=t^xt,++Dt>vt&&Ot(),!1)},Mt=ie===0?_t:Mde?e=>{let t=wt.get(e);return t===void 0?At(e):t}:kt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Mt(arguments[0]):Mt(Fde.apply(null,arguments))},mergeString:Mt,seenBefore:ie===0?()=>!1:jt,mergeUncached:_t}},oC=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:oC(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Pde=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:oC(i,t);a&&(n&&(n+=` `),n+=a)}return n},Fde=function(){return Pde(arguments,!1)},Ide=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},l=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},u=(t,c)=>{let u=t.length,d=s===null?null:s.n;if(!c){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let f=``,p=-1,m=0,h=!1;for(let e=0;e<u;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=oC(n,!0),!n)continue;h=!0}p<0&&(f=n,p=e),m++}}if(m===0)return``;if(m===1)return e(f);if(h){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let g=i.get(f);g===void 0&&(g=a.get(f),g!==void 0&&i.set(f,g));let _=null;if(g!==void 0)outer:for(let e=0;e<g.length;e++){let n=g[e];if(n.t!==m)continue;let r=n.a,i=1;for(let e=p+1;e<u;e++){let n=t[e];if(n&&n!==r[i++])continue outer}_=n;break}if(_===null){let s=f,c=[f];for(let e=p+1;e<u;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);_={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},g===void 0&&i.set(f,g=[]),g.length>=256&&g.shift(),g.push(_),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==_&&(s.n=_),s=_,_.r},d=t=>Array.isArray(t)?u(t.slice(),!1):e(oC(t,!0));return function(t,n,r){let i=arguments.length;if((i|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&c(i,t,n,r))return s=i,i.r;if(e!==i&&c(e,t,n,r))return e.r}return u([t,n,r],!0)}if(i===1)return typeof t==`string`?e(t):d(t);let a=s;if(a!==null){let e=a.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<i;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(a!==e){let e=a.a,t=0,n=!0;for(let r=0;r<i;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===a.t)return a.r}}let o=[];for(let e=0;e<i;e++)o.push(arguments[e]);return u(o,!0)}},Lde=`{"theme":{"animate":[{"$v":"isAny"}],"aspect":["video"],"blur":[{"$v":"isTshirtSize"}],"breakpoint":[{"$v":"isTshirtSize"}],"color":[{"$v":"isAny"}],"container":[{"$v":"isTshirtSize"}],"drop-shadow":[{"$v":"isTshirtSize"}],"ease":["in","out","in-out"],"font":[{"$v":"isAnyNonArbitrary"}],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[{"$v":"isTshirtSize"}],"leading":["none","tight","snug","normal","relaxed","loose"],"perspective":["dramatic","near","normal","midrange","distant","none"],"radius":[{"$v":"isTshirtSize"}],"shadow":[{"$v":"isTshirtSize"}],"spacing":["px",{"$v":"isNumber"}],"text":[{"$v":"isTshirtSize"}],"text-shadow":[{"$v":"isTshirtSize"}],"tracking":["tighter","tight","normal","wide","wider","widest"]},"classGroups":{"aspect":[{"aspect":["auto","square",{"$v":"isFraction"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"aspect"}]}],"container":["container"],"container-type":[{"@container":["","normal","size",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"container-named":[{"$v":"isNamedContainerQuery"}],"columns":[{"columns":[{"$v":"isNumber"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"container"}]},"columns-auto"],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],"box":[{"box":["border","content"]}],"display":["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],"sr":["sr-only","not-sr-only"],"float":[{"float":["right","left","none","start","end"]}],"clear":[{"clear":["left","right","both","none","start","end"]}],"isolation":["isolate","isolation-auto"],"object-fit":[{"object":["contain","cover","fill","none","scale-down"]}],"object-position":[{"object":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"overflow":[{"overflow":["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],"overscroll":[{"overscroll":["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],"position":["static","fixed","absolute","relative","sticky"],"inset":[{"inset":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-x":[{"inset-x":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-y":[{"inset-y":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"start":[{"inset-s":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"start":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"end":[{"inset-e":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"end":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-bs":[{"inset-bs":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-be":[{"inset-be":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"top":[{"top":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"right":[{"right":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"bottom":[{"bottom":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"left":[{"left":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"visibility":["visible","invisible","collapse"],"z":[{"z":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"basis":[{"basis":[{"$v":"isFraction"},"full","auto",{"$t":"container"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"flex-direction":[{"flex":["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{"flex":["nowrap","wrap","wrap-reverse"]}],"flex":[{"flex":[{"$v":"isNumber"},{"$v":"isFraction"},"auto","initial","none",{"$v":"isArbitraryValue"}]}],"grow":[{"grow":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shrink":[{"shrink":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"order":[{"order":[{"$v":"isInteger"},"first","last","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-cols":[{"grid-cols":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start-end":[{"col":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start":[{"col-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-end":[{"col-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-rows":[{"grid-rows":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start-end":[{"row":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start":[{"row-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-end":[{"row-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-cols":[{"$t":"spacing"}]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-rows":[{"$t":"spacing"}]}],"gap":[{"gap":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-x":[{"gap-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-y":[{"gap-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"justify-content":[{"justify":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{"content":["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{"items":["start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"align-self":[{"self":["auto","start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"p":[{"p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"px":[{"px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"py":[{"py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ps":[{"ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pe":[{"pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbs":[{"pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbe":[{"pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pt":[{"pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pr":[{"pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pb":[{"pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pl":[{"pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"m":[{"m":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mx":[{"mx":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"my":[{"my":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ms":[{"ms":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"me":[{"me":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbs":[{"mbs":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbe":[{"mbe":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mt":[{"mt":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mr":[{"mr":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mb":[{"mb":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ml":[{"ml":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x":[{"space-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-y-reverse":["space-y-reverse"],"size":[{"size":[{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inline-size":[{"inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"inline":[{"$t":"container"}]}],"min-inline-size":[{"min-inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"min-inline":[{"$t":"container"}]}],"max-inline-size":[{"max-inline":["none",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"max-inline":[{"$t":"container"}]}],"block-size":[{"block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-block-size":[{"min-block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-block-size":[{"max-block":["none",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"w":[{"w":[{"$t":"container"},"screen",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-w":[{"min-w":[{"$t":"container"},"screen","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-w":[{"max-w":[{"$t":"container"},"screen","none","prose",{"screen":[{"$t":"breakpoint"}]},{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"h":[{"h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-h":[{"min-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-h":[{"max-h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},"max-h-none"],"font-size":[{"text":["base",{"$t":"text"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{"font":[{"$t":"font-weight"},{"$v":"isArbitraryVariableWeight"},{"$v":"isArbitraryWeight"}]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",{"$v":"isPercent"},{"$v":"isArbitraryValue"}]}],"font-family":[{"font":[{"$v":"isArbitraryVariableFamilyName"},{"$v":"isArbitraryFamilyName"},{"$t":"font"}]}],"font-features":[{"font-features":[{"$v":"isArbitraryValue"}]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],"tracking":[{"tracking":[{"$t":"tracking"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"line-clamp":[{"line-clamp":[{"$v":"isNumber"},"none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryNumber"}]}],"leading":[{"leading":[{"$t":"leading"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"list-image":[{"list-image":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"list-style-position":[{"list":["inside","outside"]}],"list-style-type":[{"list":["disc","decimal","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-alignment":[{"text":["left","center","right","justify","start","end"]}],"placeholder-color":[{"placeholder":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-color":[{"text":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{"decoration":["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{"decoration":[{"$v":"isNumber"},"from-font","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryLength"}]}],"text-decoration-color":[{"decoration":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"underline-offset":[{"underline-offset":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{"text":["wrap","nowrap","balance","pretty"]}],"indent":[{"indent":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"tab-size":[{"tab":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"vertical-align":[{"align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"whitespace":[{"whitespace":["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],"break":[{"break":["normal","words","all","keep"]}],"wrap":[{"wrap":["break-word","anywhere","normal"]}],"hyphens":[{"hyphens":["none","manual","auto"]}],"content":[{"content":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"bg-attachment":[{"bg":["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{"bg":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-repeat":[{"bg":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"bg-size":[{"bg":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-image":[{"bg":["none",{"linear":[{"to":["t","tr","r","br","b","bl","l","tl"]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"radial":["",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"conic":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isArbitraryVariableImage"},{"$v":"isArbitraryImage"}]},{"bg-gradient-to":["t","tr","r","br","b","bl","l","tl"]},"bg-conic"],"bg-color":[{"bg":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-from-pos":[{"from":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-via-pos":[{"via":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-to-pos":[{"to":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-from":[{"from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-via":[{"via":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-to":[{"to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded":[{"rounded":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-s":[{"rounded-s":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-e":[{"rounded-e":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-t":[{"rounded-t":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-r":[{"rounded-r":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-b":[{"rounded-b":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-l":[{"rounded-l":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ss":[{"rounded-ss":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-se":[{"rounded-se":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ee":[{"rounded-ee":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-es":[{"rounded-es":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tl":[{"rounded-tl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tr":[{"rounded-tr":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-br":[{"rounded-br":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-bl":[{"rounded-bl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-w":[{"border":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-x":[{"border-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-y":[{"border-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-s":[{"border-s":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-e":[{"border-e":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-bs":[{"border-bs":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-be":[{"border-be":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-t":[{"border-t":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-r":[{"border-r":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-b":[{"border-b":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-l":[{"border-l":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x":[{"divide-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{"border":["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{"divide":["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{"border":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-x":[{"border-x":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-y":[{"border-y":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-s":[{"border-s":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-e":[{"border-e":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-bs":[{"border-bs":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-be":[{"border-be":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-t":[{"border-t":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-r":[{"border-r":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-b":[{"border-b":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-l":[{"border-l":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"divide-color":[{"divide":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-style":[{"outline":["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-w":[{"outline":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"outline-color":[{"outline":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shadow":[{"shadow":["","none",{"$t":"shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]},"shadow-inner"],"shadow-color":[{"shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-shadow":[{"inset-shadow":["none",{"$t":"inset-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"inset-shadow-color":[{"inset-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-w":[{"ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"ring-w-inset":["ring-inset"],"ring-color":[{"ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-offset-w":[{"ring-offset":[{"$v":"isNumber"},{"$v":"isArbitraryLength"}]}],"ring-offset-color":[{"ring-offset":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-ring-w":[{"inset-ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"inset-ring-color":[{"inset-ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-shadow":[{"text-shadow":["none",{"$t":"text-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"text-shadow-color":[{"text-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"opacity":[{"opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{"mask":["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[{"$v":"isNumber"}]}],"mask-image-linear-from-pos":[{"mask-linear-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-to-pos":[{"mask-linear-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-from-color":[{"mask-linear-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-linear-to-color":[{"mask-linear-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-from-pos":[{"mask-t-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-to-pos":[{"mask-t-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-from-color":[{"mask-t-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-to-color":[{"mask-t-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-from-pos":[{"mask-r-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-to-pos":[{"mask-r-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-from-color":[{"mask-r-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-to-color":[{"mask-r-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-from-pos":[{"mask-b-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-to-pos":[{"mask-b-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-from-color":[{"mask-b-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-to-color":[{"mask-b-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-from-pos":[{"mask-l-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-to-pos":[{"mask-l-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-from-color":[{"mask-l-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-to-color":[{"mask-l-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-from-pos":[{"mask-x-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-to-pos":[{"mask-x-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-from-color":[{"mask-x-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-to-color":[{"mask-x-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-from-pos":[{"mask-y-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-to-pos":[{"mask-y-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-from-color":[{"mask-y-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-to-color":[{"mask-y-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial":[{"mask-radial":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-from-pos":[{"mask-radial-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-to-pos":[{"mask-radial-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-from-color":[{"mask-radial-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-to-color":[{"mask-radial-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{"closest":["side","corner"],"farthest":["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[{"$v":"isNumber"}]}],"mask-image-conic-from-pos":[{"mask-conic-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-to-pos":[{"mask-conic-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-from-color":[{"mask-conic-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-conic-to-color":[{"mask-conic-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-mode":[{"mask":["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{"mask":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-repeat":[{"mask":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"mask-size":[{"mask":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{"mask":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"filter":[{"filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"blur":[{"blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"brightness":[{"brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contrast":[{"contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"drop-shadow":[{"drop-shadow":["","none",{"$t":"drop-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"drop-shadow-color":[{"drop-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grayscale":[{"grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"hue-rotate":[{"hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"invert":[{"invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"saturate":[{"saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"sepia":[{"sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-filter":[{"backdrop-filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-blur":[{"backdrop-blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-brightness":[{"backdrop-brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-contrast":[{"backdrop-contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-grayscale":[{"backdrop-grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-invert":[{"backdrop-invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-opacity":[{"backdrop-opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-saturate":[{"backdrop-saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-sepia":[{"backdrop-sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-collapse":[{"border":["collapse","separate"]}],"border-spacing":[{"border-spacing":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-x":[{"border-spacing-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-y":[{"border-spacing-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"table-layout":[{"table":["auto","fixed"]}],"caption":[{"caption":["top","bottom"]}],"transition":[{"transition":["","all","colors","opacity","shadow","transform","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transition-behavior":[{"transition":["normal","discrete"]}],"duration":[{"duration":[{"$v":"isNumber"},"initial",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ease":[{"ease":["linear","initial",{"$t":"ease"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"delay":[{"delay":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"animate":[{"animate":["none",{"$t":"animate"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backface":[{"backface":["hidden","visible"]}],"perspective":[{"perspective":[{"$t":"perspective"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"perspective-origin":[{"perspective-origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate":[{"rotate":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-x":[{"rotate-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-y":[{"rotate-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-z":[{"rotate-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale":[{"scale":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-x":[{"scale-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-y":[{"scale-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-z":[{"scale-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-3d":["scale-3d"],"skew":[{"skew":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-x":[{"skew-x":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-y":[{"skew-y":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform":[{"transform":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},"","none","gpu","cpu"]}],"transform-origin":[{"origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform-style":[{"transform":["3d","flat"]}],"translate":[{"translate":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-x":[{"translate-x":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-y":[{"translate-y":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-z":[{"translate-z":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-none":["translate-none"],"zoom":[{"zoom":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"accent":[{"accent":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"appearance":[{"appearance":["none","auto"]}],"caret-color":[{"caret":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"color-scheme":[{"scheme":["normal","dark","light","light-dark","only-dark","only-light"]}],"cursor":[{"cursor":["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],"resize":[{"resize":["none","","y","x"]}],"scroll-behavior":[{"scroll":["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-track-color":[{"scrollbar-track":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{"scrollbar":["auto","thin","none"]}],"scroll-m":[{"scroll-m":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mx":[{"scroll-mx":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-my":[{"scroll-my":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ms":[{"scroll-ms":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-me":[{"scroll-me":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbs":[{"scroll-mbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbe":[{"scroll-mbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mt":[{"scroll-mt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mr":[{"scroll-mr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mb":[{"scroll-mb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ml":[{"scroll-ml":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-p":[{"scroll-p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-px":[{"scroll-px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-py":[{"scroll-py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ps":[{"scroll-ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pe":[{"scroll-pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbs":[{"scroll-pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbe":[{"scroll-pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pt":[{"scroll-pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pr":[{"scroll-pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pb":[{"scroll-pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pl":[{"scroll-pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"snap-align":[{"snap":["start","end","center","align-none"]}],"snap-stop":[{"snap":["normal","always"]}],"snap-type":[{"snap":["none","x","y","both"]}],"snap-strictness":[{"snap":["mandatory","proximity"]}],"touch":[{"touch":["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],"select":[{"select":["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"fill":[{"fill":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"stroke-w":[{"stroke":[{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"},{"$v":"isArbitraryNumber"}]}],"stroke":[{"stroke":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}],"contain":[{"contain":["none","content","strict",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contain-size":[{"contain":["size","inline-size"]}],"contain-layout":["contain-layout"],"contain-paint":["contain-paint"],"contain-style":["contain-style"]},"conflictingClassGroups":{"container-named":["container-type"],"overflow":["overflow-x","overflow-y"],"overscroll":["overscroll-x","overscroll-y"],"inset":["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],"flex":["basis","grow","shrink"],"gap":["gap-x","gap-y"],"p":["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],"px":["pr","pl"],"py":["pt","pb"],"m":["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],"mx":["mr","ml"],"my":["mt","mb"],"size":["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],"rounded":["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"translate":["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],"touch":["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"],"contain":["contain-size","contain-layout","contain-paint","contain-style"],"contain-size":["contain"],"contain-layout":["contain"],"contain-paint":["contain"],"contain-style":["contain"]},"conflictingClassGroupModifiers":{"font-size":["leading"]},"orderSensitiveModifiers":["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"],"postfixLookupClassGroups":["container-type"]}`,sC=()=>JSON.parse(Lde),Rde=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,zde=e=>e===void 0?{config:sC()}:typeof e==`function`?{config:e(sC())}:Rde(e)?{config:e}:{config:Tde(sC(),e),cacheSize:e.cacheSize},Bde=e=>{let{config:t,cacheSize:n}=zde(e),{tables:r,validatorImpls:i,prefix:a}=jde(t);return Nde(r,i,{cacheSize:n,prefix:a})},cC=(e=>{let t=null,n=()=>t??=Bde(e);return Ide(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{theme:{spacing:[...Hue]}}}),lC=Object.freeze({reduced:!1,squish:90,fast:120,normal:180,slow:280,springDuration:320,bounce:.3,stretch:.28,distance:4,stagger:24,blur:0,shake:3,steps:0,fuse:1,pressDepth:.5,pressScale:1,ease:`cubic-bezier(0.2, 0, 0, 1)`,easeExit:`cubic-bezier(0.4, 0, 1, 1)`}),uC=`(prefers-reduced-motion: reduce)`;function dC(e){let t=e.ownerDocument.defaultView;if(!t)return lC;let n=t.getComputedStyle(e),r=(e,t)=>{let r=n.getPropertyValue(e).trim(),i=Number.parseFloat(r);return Number.isFinite(i)?Math.max(0,i):t},i=(e,t)=>{let i=n.getPropertyValue(e).trim();return r(e,t)*(i.endsWith(`s`)&&!i.endsWith(`ms`)?1e3:1)},a=t.matchMedia?.(uC).matches??!1,o=(e,t)=>a?120:i(`--stipe-motion-${e}`,t),s=(e,t)=>a?0:r(`--stipe-motion-${e}`,t);return{reduced:a,squish:o(`squish`,lC.squish),fast:o(`fast`,lC.fast),normal:o(`normal`,lC.normal),slow:o(`slow`,lC.slow),springDuration:o(`spring-duration`,lC.springDuration),bounce:Math.min(1,s(`bounce`,lC.bounce)),stretch:s(`stretch`,lC.stretch),distance:s(`distance`,lC.distance),stagger:a?0:i(`--stipe-motion-stagger`,lC.stagger),blur:s(`blur`,lC.blur),shake:s(`shake`,lC.shake),steps:Math.floor(s(`steps`,lC.steps)),fuse:r(`--stipe-motion-fuse`,lC.fuse),pressDepth:a?0:r(`--stipe-press-depth`,lC.pressDepth),pressScale:a?1:r(`--stipe-press-scale`,lC.pressScale),ease:n.getPropertyValue(`--stipe-motion-ease`).trim()||lC.ease,easeExit:n.getPropertyValue(`--stipe-motion-ease-exit`).trim()||lC.easeExit}}function fC(e){let[t,n]=(0,F.useState)(()=>({...lC,reduced:!0}));return(0,F.useLayoutEffect)(()=>{let t=e.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let i=()=>{let e=dC(t);n(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)};i();let a=new r.MutationObserver(i);for(let e=t;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`data-theme`,`class`,`style`]});let o=r.matchMedia?.(uC);return o?.addEventListener(`change`,i),()=>{a.disconnect(),o?.removeEventListener(`change`,i)}},[e]),t}function pC(e,t){return e.reduced?0:Math.round(t*e.normal/lC.normal)}function Vde(e,t){if(e.reduced)return 0;let n=t*e.bounce/lC.bounce;return Math.min(.9,Math.max(0,n))}function Hde(e,t){return e.reduced?0:Math.round(t*e.springDuration/lC.springDuration)}function mC(e,t){return e.steps>0?`steps(${String(e.steps)}, end)`:t}function hC(e){return`animate`in e}var gC=globalThis;function Ude(){return gC.matchMedia?.(uC).matches??!1}function Wde(e){let t=gC.matchMedia?.(uC);return t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}}function Gde(){return!0}function _C(){return(0,F.useSyncExternalStore)(Wde,Ude,Gde)}var vC=(0,F.forwardRef)(function({asChild:e=!1,className:t,...n},r){let i=cC(`absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]`,t);return e?(0,R.jsx)(ES,{...n,className:i,ref:r}):(0,R.jsx)(`span`,{...n,className:i,ref:r})}),yC=typeof window<`u`,bC=yC?window:null,xC=yC?document:null,SC={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},CC={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},wC={NONE:0,AUTO:1,FORCE:2},TC={replace:0,none:1,blend:2},EC=Symbol(),DC=Symbol(),OC=Symbol(),kC=Symbol(),Kde=Symbol(),AC=1e-11,jC=0xe8d4a51000,MC=1e3,NC=[],PC=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),FC=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],qde=FC.reduce((e,t)=>({...e,[t]:t+`(`}),{}),IC=()=>{},Jde=e=>e,Yde=/\)\s*[-.\d]/,Xde=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Zde=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,Qde=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,$de=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,efe=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,LC=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,tfe=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,RC=/([a-z])([A-Z])/g,zC=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,BC={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:MC,delay:0,loopDelay:0,ease:`out(2)`,composition:TC.replace,modifier:Jde,onBegin:IC,onBeforeUpdate:IC,onUpdate:IC,onLoop:IC,onPause:IC,onComplete:IC,onRender:IC},VC={current:null,root:xC},HC={defaults:BC,precision:4,timeScale:1,tickThreshold:200,editor:null},UC={version:`4.5.0`,engine:null};yC&&(bC.AnimeJS||=[],bC.AnimeJS.push(UC));var WC=e=>e.replace(RC,`$1-$2`).toLowerCase(),GC=(e,t)=>e.indexOf(t)===0,KC=Date.now,qC=Array.isArray,JC=e=>e&&e.constructor===Object,nfe=e=>typeof e==`number`&&!isNaN(e),YC=e=>typeof e==`string`,XC=e=>typeof e==`function`,ZC=e=>e===void 0,QC=e=>ZC(e)||e===null,$C=e=>yC&&e instanceof SVGElement,ew=e=>Xde.test(e),tw=e=>GC(e,`rgb`),nw=e=>GC(e,`hsl`),rfe=e=>ew(e)||(tw(e)||nw(e))&&(e[e.length-1]===`)`||!Yde.test(e)),rw=e=>!HC.defaults.hasOwnProperty(e),ife=[`opacity`,`rotate`,`overflow`,`color`],afe=(e,t)=>{if(ife.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},iw=Math.pow,aw=Math.sqrt,ow=Math.sin,sw=Math.cos,ofe=Math.abs,cw=Math.exp,sfe=Math.ceil,lw=Math.floor,cfe=Math.asin,uw=Math.PI,dw=Math.round,fw=(e,t,n)=>e<t?t:e>n?n:e,pw=(e,t)=>{if(t<0)return e;if(!t)return dw(e);let n=10**t;return dw(e*n)/n},mw=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,hw=e=>e===1/0?jC:e===-1/0?-jC:e,gw=e=>e<=1e-11?AC:hw(pw(e,11)),_w=e=>qC(e)?[...e]:e,lfe=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=ZC(i)?t[r]:i}return n},vw=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},yw=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},bw=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},ufe=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[kC],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!ZC(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:GC(t,`scale`)?`1`:GC(t,`rotate`)||GC(t,`skew`)?`0deg`:`0px`},xw=e=>{let t=``;for(let n=0,r=FC.length;n<r;n++){let r=FC[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${qde[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Sw=[];function Cw(e,t){if(!e)return null;let n=Sw.length;outer:for(let r=0;r<n;r++){let n=Sw[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=Sw[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var dfe=e=>{let t=Zde.exec(e)||Qde.exec(e),n=ZC(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},ffe=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},ww=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),pfe=e=>{let t=$de.exec(e)||efe.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=ZC(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=pw(ww(t,e,n+1/3)*255,0),s=pw(ww(t,e,n)*255,0),c=pw(ww(t,e,n-1/3)*255,0)}return[o,s,c,a]},mfe=e=>tw(e)?dfe(e):ew(e)?ffe(e):nw(e)?pfe(e):[0,0,0,1],Tw=(e,t)=>ZC(e)?t:e,Ew=(e,t)=>{let n=e.match(zC),r=t[DC]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Dw=(e,t,n,r,i,a)=>{if(XC(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(YC(e)&&GC(e,`var(`)){if(!i)return Ew(e,t);let n=()=>Ew(e,t);return i.func=n,n()}return e},Ow=(e,t)=>e[DC]?e[OC]&&afe(e,t)?SC.ATTRIBUTE:FC.includes(t)||PC.get(t)?SC.TRANSFORM:GC(t,`--`)?SC.CSS_VAR:t in e.style?SC.CSS:t in e?SC.OBJECT:SC.ATTRIBUTE:SC.OBJECT,kw=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[Kde]||e).getPropertyValue(t);return i===`auto`?`0`:i},Aw=(e,t,n,r)=>{let i=ZC(n)?Ow(e,t):n,a=Cw(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===SC.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===SC.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===SC.TRANSFORM?ufe(e,t,r):i===SC.CSS_VAR?kw(e,t,r).trimStart():kw(e,t,r)},jw=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,Mw=()=>({t:CC.NUMBER,n:0,u:null,o:null,d:null,s:null}),Nw=(e,t)=>{if(t.t=CC.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&tfe.exec(r);if(i)return t.t=CC.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(rfe(r))return t.t=CC.COLOR,t.d=mfe(r),t;{let e=r.match(LC);return t.t=CC.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(LC)||[],t}},Pw=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=_w(e._toNumbers),t.s=_w(e._strings),t),Fw=Mw(),Iw=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(pw(mw(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},Lw=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=fw(g,-h,o),b=fw(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=AC,T=i===wC.FORCE,E=0,D=v,O=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=fw(n,0,l),C&&e._currentIteration--,E=e._currentIteration%2,D=b-n*t||0}let k=f^(p&&E),A=e._ease,j=C?k?0:o:k?c-D:D;A&&(j=c*A(j/c)||0);let M=(a?a.backwards:v<g)?!k:!!k;if(e._currentTime=v,e._iterationTime=j,e.backwards=M,S&&!e.began?(e.began=!0,!n&&!(a&&(M||!a.began))&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===wC.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||j>=_&&y!==o||j<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(M?x*-1:x)>=HC.tickThreshold,i=pw(e._offset+(a?a._offset:0)+h+j,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==TC.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&j<p._startTime))&&(!m||_||j>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=fw(j-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===SC.OBJECT,g=f===CC.NUMBER,_=g&&m||n===0||n===1?-1:HC.precision,v,y;if(g)v=y=i(pw(mw(o._fromNumber,o._toNumber,n),_));else if(f===CC.UNIT)y=i(pw(mw(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===CC.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(mw(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${pw(e[0],0)},${pw(e[1],0)},${pw(e[2],0)},${e[3]})`)}else f===CC.COMPLEX&&(v=Iw(o,n,_));if(h&&(o._number=y),!r&&e!==TC.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===SC.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===SC.TRANSFORM?(s!==l&&(l=s,u=s[kC]),u[e]=v,d=1):p===SC.CSS?c[e]=v:p===SC.CSS_VAR&&c.setProperty(e,v)),S&&(O=1)}else o._value=v}else n&&m&&!_&&j<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=xw(u),d=0),o=o._next}!n&&O&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!M&&v>0&&!s||M&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!M):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&!(a&&(M||!a.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,O},Rw=(e,t,n,r,i)=>{let a=e._currentIteration;if(Lw(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=KC(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;vw(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&Lw(t,e,n,1,wC.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}vw(o,e=>{let t=pw((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=Lw(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},zw={},hfe=(e,t,n)=>{if(n===SC.TRANSFORM)return PC.get(e)||e;if(n===SC.CSS||n===SC.ATTRIBUTE&&$C(t)&&e in t.style){let t=zw[e];if(t)return t;{let t=e&&WC(e);return zw[e]=t,t}}return e},Bw=(e,t=!1)=>{if(e._hasChildren)vw(e,e=>Bw(e,t),!0);else{let n=e;n.pause(),vw(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=QC(o)||o===``;if(e._setter){if(!t&&!s){if(Nw(o,Fw),Fw.d){let t=Fw.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=Fw.n;e._setter(e.target,e._number,e)}}else if(a===SC.OBJECT)!t&&!s&&(i[r]=o);else if(i[DC]){if(a===SC.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===SC.TRANSFORM){let n=i[kC];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=xw(n):t.removeProperty(`transform`))}else s?t.removeProperty(WC(r)):t[r]=o}}i[DC]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Vw=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=MC/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?AC:t,r=MC/n;n>BC.frameRate&&(BC.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?AC:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?wC.NONE:(this._lastTickTime=n>=t?e-n%t:e,wC.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Hw={animation:null,update:IC},gfe=e=>{let t=Hw.animation;return t||(t={duration:AC,computeDeltaTime:IC,_offset:0,_delay:0,_head:null,_tail:null},Hw.animation=t,Hw.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===CC.COMPLEX||e===CC.COLOR?_w(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),Lw(t,1,1,0,wC.FORCE)}),t},Uw=yC?requestAnimationFrame:setImmediate,_fe=yC?cancelAnimationFrame:clearImmediate,vfe=class extends Vw{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=BC,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=KC();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(yw(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Rw(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):wC.AUTO),r=i}Hw.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(KC()),this.reqId=Uw(Gw)),this}pause(){if(this.reqId)return this.paused=!0,yfe()}resume(){if(this.paused)return this.paused=!1,vw(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(HC.timeScale===1?1:MC)}set speed(e){let t=e*HC.timeScale;this._speed!==t&&(this._speed=t,vw(this,e=>e.speed=e._speed))}get timeUnit(){return HC.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(HC.timeScale!==r){HC.timeScale=r,HC.tickThreshold=200*r;let e=n?t:MC;this.defaults.duration*=e,this._speed*=e}}get precision(){return HC.precision}set precision(e){HC.precision=e}},Ww=(()=>{let e=new vfe(KC());return yC&&(UC.engine=e,xC.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(xC.hidden?e.pause():e.resume())})),e})(),Gw=()=>{Ww._head?(Ww.reqId=Uw(Gw),Ww.update()):Ww.reqId=0},yfe=()=>(_fe(Ww.reqId),Ww.reqId=0,Ww),Kw={_rep:new WeakMap,_add:new Map},qw=(e,t,n=`_rep`)=>{let r=Kw[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},bfe=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Jw=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=AC,e._currentTime=AC},Yw=(e,t)=>{let n=e._composition;if(n===TC.replace){let n=e._absoluteStartTime;bw(t,e,bfe,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){Jw(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)Jw(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=pw(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&Jw(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(vw(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;vw(e,e=>{e!==t&&vw(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===TC.blend){let t=qw(e.target,e.property,`_add`),n=gfe(Kw._add),r=t._head;r||(r={...e},r._composition=TC.replace,r._updateDuration=AC,r._startTime=0,r._numbers=_w(e._fromNumbers),r._number=0,r._next=null,r._prev=null,bw(t,r),bw(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=_w(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=_w(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}bw(t,e,null,`_prevAdd`,`_nextAdd`)}return e},xfe=e=>{let t=e._composition;if(t!==TC.none){let n=e.target,r=e.property,i=Kw._rep.get(n)[r];if(yw(i,e,`_prevRep`,`_nextRep`),t===TC.blend){let t=Kw._add,i=t.get(n);if(!i)return;let a=i[r],o=Hw.animation;yw(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){yw(a,s,`_prevAdd`,`_nextAdd`),yw(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},Xw=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Zw=e=>e._cancelled?(e._hasChildren?vw(e,Zw):vw(e,e=>{e._composition!==TC.none&&Yw(e,qw(e.target,e.property))}),e._cancelled=0,e):e,Qw=0,Sfe=(e,t)=>e._priority>t._priority,Cfe=class extends Vw{constructor(e={},t=null,n=0){super(0),++Qw;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;VC.current&&VC.current.register(this);let b=t?0:Ww._lastTickTime,x=t?t.defaults:HC.defaults,S=XC(i)||ZC(i)?x.delay:+i,C=XC(a)||ZC(a)?1/0:+a,w=Tw(c,x.loop),T=Tw(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(Ww.reqId||Ww.requestTick(KC()),D=(Ww._lastTickTime-Ww._startTime)*HC.timeScale),this.id=ZC(r)?Qw:r,this.parent=t,this.duration=hw((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&Tw(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=IC,this._running=!1,this._reversed=+Tw(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Tw(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=Tw(d,x.frameRate),this._speed=Tw(f,x.playbackRate),this._priority=+Tw(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return fw(pw(this._currentTime,HC.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return fw(pw(this._iterationTime,HC.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return fw(pw(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return fw(pw(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*fw(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Zw(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Rw(this,0,1,~~e,wC.FORCE),Xw(this),this._hasChildren&&vw(this,Xw),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Rw(this,this.duration,1,~~e,wC.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!ZC(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*Ww._speed);return this._startTime=KC()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Rw(this,AC,0,0,wC.FORCE):(this._running||=(bw(Ww,this,Sfe),Ww._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,Ww.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){Zw(this),this.completed=!1;let r=this.paused;return this.paused=!0,Rw(this,e+this._delay,~~t,~~n,wC.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?lw(jC/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?vw(this,e=>e.cancel(),!0):vw(this,xfe),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=gw(e);if(t===n)return this;let r=e/t,i=e<=AC;return this.duration=i?AC:n,this.iterationDuration=i?AC:gw(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Rw(this,0,1,0,wC.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=IC){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=IC};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function $w(e){let t=YC(e)?VC.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function eT(e){if(QC(e))return[];if(!yC)return qC(e)&&e.flat(1/0)||[e];if(qC(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!QC(r)){let e=$w(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!QC(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=$w(e);return t?Array.from(t):[e]}function tT(e){let t=eT(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[EC]){n[EC]=!0;let e=$C(n);(n.nodeType||e)&&(n[DC]=!0,n[OC]=e,n[kC]={})}}return t}var nT={deg:1,rad:180/uw,turn:360},rT={},iT=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===CC.UNIT&&i===n)return t;let o=a+i+n,s=rT[o];if(!ZC(s)&&!r)t.n=s;else{let r;if(i in nT)r=a*nT[i]/nT[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==xC?o:xC.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,rT[o]=r}return t.t,CC.UNIT,t.u=n,t},aT=e=>e,oT=(e=1.68)=>t=>iw(t,+e),sT={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},wfe=uw/2,cT=uw*2,lT={"":oT,Quad:oT(2),Cubic:oT(3),Quart:oT(4),Quint:oT(5),Sine:e=>1-sw(e*wfe),Circ:e=>1-aw(1-e*e),Expo:e=>e?iw(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=iw(2,--n))-1)/11;);return 1/iw(4,3-n)-7.5625*iw((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=fw(+e,1,10),r=fw(+t,AC,2),i=r/cT*cfe(1/n),a=cT/r;return e=>e===0||e===1?e:-n*iw(2,-10*(1-e))*ow((1-e-i)*a)}},uT=(()=>{let e={linear:aT,none:aT};for(let t in sT)for(let n in lT){let r=lT[n],i=sT[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),dT={linear:aT,none:aT},Tfe=e=>{if(dT[e])return dT[e];if(e.indexOf(`(`)<=-1){let t=sT[e]||e.includes(`Back`)||e.includes(`Elastic`)?uT[e]():uT[e];return t?dT[e]=t:aT}{let t=e.slice(0,-1).split(`(`),n=uT[t[0]];return n?dT[e]=n(...t[1].split(`,`)):aT}},fT=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],pT=e=>{if(YC(e)){for(let t=0,n=fT.length;t<n;t++)if(GC(e,fT[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),aT}return XC(e)?e:YC(e)?Tfe(e):aT},mT=Mw(),hT=Mw(),gT={},_T={func:null},vT={func:null},yT=[null],bT=[null,null],xT={to:null},Efe=0,ST=0,CT,wT,Dfe=(e,t)=>{let n={};if(qC(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(rw);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];rw(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=Tw(t.duration,HC.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(rw(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},Ofe=class extends Cfe{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++ST;let s=tT(e),c=s.length,l=t.keyframes,u=l?lfe(Dfe(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:HC.defaults,b=Tw(m,y.ease),x=Tw(h,y.playbackEase),S=x?pT(x):null,C=!ZC(b.ease),w=C?b.ease:Tw(m,S?`linear`:y.ease),T=C?b.settlingDuration:Tw(p,y.duration),E=Tw(f,y.delay),D=g||y.modifier,O=ZC(_)&&c>=1e3?TC.none:ZC(_)?y.composition:_,k=this._offset+(n?n._offset:0);C&&(b.parent=this);let A=NaN,j=NaN,M=0,ee=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(rw(e)){let a=Ow(t,e),o=Cw(t,e),s=hfe(e,t,a),f=u[e],p=qC(f);if(i&&!p&&(bT[0]=f,bT[1]=f,f=bT),p){let e=f.length,t=!JC(f[0]);e===2&&t?(xT.to=f,yT[0]=xT,CT=yT):e>2&&t?(CT=[],f.forEach((e,t)=>{t?t===1?(bT[1]=e,CT.push(bT)):CT.push(e):bT[0]=e})):CT=f}else yT[0]=f,CT=yT;let m=null,h=null,g=NaN,_=0,v=0;for(let e=CT.length;v<e;v++){let i=CT[v];JC(i)?wT=i:(xT.to=i,wT=xT),_T.func=null,vT.func=null;let l=Dw(Tw(wT.composition,O),t,r,c,null,null),u=nfe(l)?l:TC[l];!m&&u!==TC.none&&(m=qw(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=Dw(wT.to,t,r,c,_T,f),y;JC(p)&&!ZC(p.to)?(wT=p,y=p.to):y=p;let b=Dw(wT.from,t,r,c,vT,f),x=wT.ease||w,S=Dw(x,t,r,c,null,f),C=XC(S)||YC(S)?S:x,A=!ZC(C)&&!ZC(C.ease),j=A?C.ease:C,N=A?C.settlingDuration:Dw(Tw(wT.duration,e>1?Dw(T,t,r,c,null,f)/e:T),t,r,c,null,f),te=Dw(Tw(wT.delay,v?0:E),t,r,c,null,f),ne=wT.modifier||D,re=!ZC(b),P=!ZC(y),ie=qC(y),ae=ie||re&&P,oe=h?_:0,se=h?_+te:te,ce=pw(k+se,12),le=pw(k+oe,12);!ee&&(re||ie)&&(ee=1);let ue=h;if(u!==TC.none){let e=m._head;for(;e&&e._absoluteStartTime<=ce;)if(e._isOverridden||(ue=e),e=e._nextRep,e&&e._absoluteStartTime>=ce)for(;e;)Jw(e),e=e._nextRep}if(ae){Nw(ie?Dw(y[0],t,r,c,vT,f):b,mT),Nw(ie?Dw(y[1],t,r,c,_T,f):y,hT);let e=Aw(t,s,a,gT);mT.t===CC.NUMBER&&(ue?ue._valueType===CC.UNIT&&(mT.t=CC.UNIT,mT.u=ue._unit):(Nw(e,Fw),Fw.t===CC.UNIT&&(mT.t=CC.UNIT,mT.u=Fw.u)))}else P?Nw(y,hT):h?Pw(h,hT):Nw(n&&ue&&ue.parent.parent===n?ue._value:Aw(t,s,a,gT),hT),re?Nw(b,mT):h?Pw(h,mT):Nw(n&&ue&&ue.parent.parent===n?ue._value:Aw(t,s,a,gT),mT);if(mT.o&&(mT.n=jw(ue?ue._toNumber:Nw(Aw(t,s,a,gT),Fw).n,mT.n,mT.o)),hT.o&&(hT.n=jw(mT.n,hT.n,hT.o)),mT.t!==hT.t){if(mT.t===CC.COMPLEX||hT.t===CC.COMPLEX){let e=mT.t===CC.COMPLEX?mT:hT,t=mT.t===CC.COMPLEX?hT:mT;t.t=CC.COMPLEX,t.s=_w(e.s),t.d=e.d.map(()=>t.n)}else if(mT.t===CC.UNIT||hT.t===CC.UNIT){let e=mT.t===CC.UNIT?mT:hT,t=mT.t===CC.UNIT?hT:mT;t.t=CC.UNIT,t.u=e.u}else if(mT.t===CC.COLOR||hT.t===CC.COLOR){let e=mT.t===CC.COLOR?mT:hT,t=mT.t===CC.COLOR?hT:mT;t.t=CC.COLOR,t.d=e.d.map(()=>0)}}if(mT.u!==hT.u){let e=hT.u?mT:hT;e=iT(t,e,hT.u?hT.u:mT.u,!1)}if(hT.d&&mT.d&&hT.d.length!==mT.d.length){let e=mT.d.length>hT.d.length?mT:hT,t=e===mT?hT:mT;t.d=e.d.map((e,n)=>ZC(t.d[n])?0:t.d[n]),t.s=_w(e.s)}let de=pw(+N||1e-11,12),fe=gT[s];QC(fe)||(gT[s]=null);let pe=o?o.set:null;_=pw(se+de,12);let me=mT.d,he=hT.d,ge=hT.s,_e={parent:this,id:Efe++,property:s,target:t,_value:null,_toFunc:_T.func,_fromFunc:vT.func,_ease:pT(j),_fromNumbers:me?_w(me):NC,_toNumbers:he?_w(he):NC,_strings:ge?_w(ge):NC,_fromNumber:mT.n,_toNumber:hT.n,_numbers:me?_w(me):NC,_number:mT.n,_unit:hT.u,_modifier:ne,_currentTime:0,_startTime:se,_delay:+te,_updateDuration:de,_changeDuration:de,_absoluteStartTime:ce,_absoluteUpdateStartTime:le,_absoluteEndTime:pw(k+_,12),_hasFromValue:re||ie?1:0,_tweenType:a,_setter:pe,_valueType:hT.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:fe,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==TC.none&&Yw(_e,m);let ve=_e._valueType;if(ve===CC.COMPLEX)_e._value=Iw(_e,1,-1);else if(ve===CC.UNIT)_e._value=`${ne(_e._toNumber)}${_e._unit}`;else if(ve===CC.COLOR){let e=hT.d;_e._value=`rgba(${pw(e[0],0)},${pw(e[1],0)},${pw(e[2],0)},${e[3]})`}else _e._value=ne(_e._toNumber);isNaN(g)&&(g=_e._startTime),h=_e,M++,bw(this,_e)}(isNaN(j)||g<j)&&(j=g),(isNaN(A)||_>A)&&(A=_),a===SC.TRANSFORM&&(l=M-v,d=M)}if(!isNaN(l)){let e=0;vw(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===TC.blend&&vw(Hw.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),j?(vw(this,e=>{e._startTime-e._delay||(e._delay-=j),e._startTime-=j}),A-=j):j=0,A||(A=AC,this.iterationCount=0),this.targets=s,this.id=ZC(d)?ST:d,this.duration=A===1e-11?AC:hw((A+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=j,this.iterationDuration=A,!this._autoplay&&ee&&this.onRender(this)}stretch(e){let t=this.duration;if(t===gw(e))return this;let n=e/t;return vw(this,e=>{e._updateDuration=gw(e._updateDuration*n),e._changeDuration=gw(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return vw(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Nw(n(),mT),mT.u!==e._unit&&e.target[DC]&&iT(e.target,mT,e._unit,!0),e._fromNumbers=_w(mT.d),e._fromNumber=mT.n):t&&(Nw(Aw(e.target,e.property,e._tweenType),Fw),e._fromNumbers=_w(Fw.d),e._fromNumber=Fw.n),t&&(Nw(t(),hT),e._toNumbers=_w(hT.d),e._strings=_w(hT.s),e._toNumber=hT.o?jw(e._fromNumber,hT.n,hT.o):hT.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Bw(this)}then(e){return super.then(e)}},TT=(e,t)=>HC.editor?HC.editor.addAnimation(e,t):new Ofe(e,t,null,0,!1).init(),ET=MC*10,kfe=class{constructor(e={}){let t=!ZC(e.bounce)||!ZC(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/MC,this.maxIterations=this.maxDuration/this.timeStep/MC,this.bn=fw(Tw(e.bounce,.5),-1,1),this.pd=fw(Tw(e.duration,628),10*HC.timeScale,ET*HC.timeScale),this.m=fw(Tw(e.mass,1),1,ET),this.s=fw(Tw(e.stiffness,100),AC,ET),this.d=fw(Tw(e.damping,10),AC,ET),this.v=fw(Tw(e.velocity,0),-ET,ET),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||IC,t&&this.calculateSDFromBD(),this.compute(),this.ease=e=>{let t=e*this.settlingDuration,n=this.completed,r=this.pd;return t>=r&&!n&&(this.completed=!0,this.onComplete(this.parent)),t<r&&n&&(this.completed=!1),e===0||e===1?e:this.solve(e*this.solverDuration)}}solve(e){let{zeta:t,w0:n,wd:r,b:i}=this,a=e;return a=t<1?cw(-a*t*n)*(1*sw(r*a)+i*ow(r*a)):t===1?(1+i*a)*cw(-a*n):((1+i)*cw((-t*n+r)*a)+(1-i)*cw((-t*n-r)*a))/2,1-a}calculateSDFromBD(){let e=HC.timeScale===1?this.pd/MC:this.pd;this.m=1,this.v=0,this.s=iw(2*uw/e,2),this.d=this.bn>=0?(1-this.bn)*4*uw/e:4*uw/(e*(1+this.bn)),this.s=pw(fw(this.s,AC,ET),3),this.d=pw(fw(this.d,AC,300),3)}calculateBDFromSD(){let e=2*uw/aw(this.s);this.pd=e*(HC.timeScale===1?MC:1),this.bn=this.d/(2*aw(this.s))<=1?1-this.d*e/(4*uw):4*uw/(this.d*e)-1,this.bn=pw(fw(this.bn,-1,1),3),this.pd=pw(fw(this.pd,10*HC.timeScale,ET*HC.timeScale),3)}compute(){let{maxRestSteps:e,maxIterations:t,restThreshold:n,timeStep:r,m:i,d:a,s:o,v:s}=this,c=this.w0=fw(aw(o/i),AC,MC),l=this.zeta=a/(2*aw(o*i));l<1?(this.wd=c*aw(1-l*l),this.b=(l*c+-s)/this.wd):l===1?(this.wd=0,this.b=-s+c):(this.wd=c*aw(l*l-1),this.b=(l*c+-s)/this.wd);let u=0,d=0,f=0;for(;d<=e&&f<=t;)ofe(1-this.solve(u))<n?d++:d=0,this.solverDuration=u,u+=r,f++;this.settlingDuration=pw(this.solverDuration*MC,0)*HC.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=fw(Tw(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=fw(Tw(e,1),10*HC.timeScale,ET*HC.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=fw(Tw(e,100),AC,ET),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=fw(Tw(e,10),AC,ET),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=fw(Tw(e,1),1,ET),this.compute()}get velocity(){return this.v}set velocity(e){this.v=fw(Tw(e,0),-ET,ET),this.compute()}},Afe=e=>new kfe(e),DT=(e=10,t)=>{let n=t?sfe:lw;return t=>n(fw(t,0,1)*e)*(1/e)},OT=(0,F.forwardRef)(function({id:e,transform:t},n){return(0,R.jsxs)(`radialGradient`,{ref:n,id:e,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`-1.6`,r:`5.6`,gradientTransform:t,children:[(0,R.jsx)(`stop`,{offset:`0`,stopColor:`color-mix(in oklab, var(--color-white) calc(var(--depth) * 50%), currentColor)`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`})]})});function kT({id:e}){return(0,R.jsx)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,R.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1`,floodColor:`currentColor`,style:{floodOpacity:`calc(var(--depth) * 0.6)`}})})}function AT({id:e}){return(0,R.jsxs)(`filter`,{id:e,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,R.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.3`,result:`soft-edge`}),(0,R.jsx)(`feOffset`,{in:`soft-edge`,dx:`0.25`,dy:`0.45`,result:`lower-edge`}),(0,R.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`lower-edge`,operator:`out`,result:`inner-shadow`}),(0,R.jsx)(`feFlood`,{floodColor:`var(--color-black)`,floodOpacity:`calc(var(--depth) * 0.28)`}),(0,R.jsx)(`feComposite`,{in2:`inner-shadow`,operator:`in`,result:`shade`}),(0,R.jsx)(`feOffset`,{in:`soft-edge`,dx:`-0.2`,dy:`-0.35`,result:`upper-edge`}),(0,R.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`upper-edge`,operator:`out`,result:`inner-highlight`}),(0,R.jsx)(`feFlood`,{floodColor:`var(--color-white)`,floodOpacity:`calc(var(--depth) * 0.7)`}),(0,R.jsx)(`feComposite`,{in2:`inner-highlight`,operator:`in`,result:`highlight`}),(0,R.jsxs)(`feMerge`,{children:[(0,R.jsx)(`feMergeNode`,{in:`SourceGraphic`}),(0,R.jsx)(`feMergeNode`,{in:`shade`}),(0,R.jsx)(`feMergeNode`,{in:`highlight`})]})]})}var jT=Object.freeze({alphaIntercept:-8,alphaSlope:18,blurStdDeviation:2});function MT({id:e,values:t=Lue}){return(0,R.jsxs)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,R.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t.blurStdDeviation,result:`blur`}),(0,R.jsx)(`feColorMatrix`,{in:`blur`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${String(t.alphaSlope)} ${String(t.alphaIntercept)}`,result:`gooey`}),(0,R.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`gooey`,operator:`atop`})]})}function NT(e,t){let n=e.ownerDocument,r=!0,i=()=>{t(r&&!n.hidden)},a=globalThis,o=`IntersectionObserver`in globalThis&&a.IntersectionObserver?new a.IntersectionObserver(t=>{let n=t.find(t=>t.target===e);n&&(r=n.isIntersecting,i())}):void 0;return o?.observe(e),n.addEventListener(`visibilitychange`,i),i(),()=>{o?.disconnect(),n.removeEventListener(`visibilitychange`,i)}}function PT(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function FT(e,t){let n=Math.max(0,Math.min(1,(t-(e-1)*.085)/.68));return Math.sin(n*Math.PI)**2}function IT(e,t,n){let r=n*Math.PI*2,i=t*2.1,a=Math.sin(r*2+i)*.15,o={rx:4*(1+a),ry:4/(1+a)};if(e===`line`){let e=7.5+4*Math.cos(r+(t===2?-.45:0));return{cx:(t-1)*e,cy:Math.sin(r+i)*.7,...o}}if(e===`square`){let e=4.7+2.7*Math.cos(r);return{cx:(t%2?1:-1)*e,cy:(t<2?-1:1)*e,...o}}if(e===`donut`){let e=PT(n/.66)*Math.PI*2,o=Math.min(e,t*Math.PI/8)-Math.PI/2,s=PT((n-.79)/.21),c=8+Math.sin(r*2+i)*.35*Math.sin(n*Math.PI);return{cx:Math.cos(o)*c*(1-s),cy:Math.sin(o)*c*(1-s)-8*s,rx:3.6*(1+a*Math.sin(n*Math.PI)),ry:3.6/(1+a*Math.sin(n*Math.PI))}}if(e===`bloom`){if(t===0){let e=[1,2,3,4].reduce((e,t)=>e+FT(t,n),0),t=Math.sqrt(49-e*4);return{cx:Math.sin(r)*.4,cy:Math.sin(r*2)*.4,rx:t*(1+a),ry:t/(1+a)}}let e=FT(t,n),i=(t-1)*Math.PI/2-Math.PI/4+Math.sin(r)*.22;return{cx:Math.cos(i)*14*e,cy:Math.sin(i)*14*e,rx:3.2*(1+a),ry:3.2/(1+a)}}return{cx:Math.sin(r+i)*6+Math.sin(r*3+i)*2.5,cy:Math.cos(r*2+i)*6,...o}}var jfe={line:1700,square:1900,donut:3e3,wander:4600,bloom:2800},Mfe=2;function Nfe({variant:e,pace:t=`working`}){let n=`caps-loader-${(0,F.useId)().replaceAll(`:`,``)}`,r=(0,F.useRef)(null),i=(0,F.useRef)(null),a=fC(i),{reduced:o}=a,s=e===`donut`?16:e===`bloom`?5:e===`square`?4:3;return(0,F.useLayoutEffect)(()=>{if(o||!r.current||!i.current)return;let n=[...r.current.querySelectorAll(`ellipse`)].map((n,r)=>TT(n,{keyframes:Array.from({length:48},(n,i)=>({...IT(e,r,(i+1)/48),duration:pC(a,jfe[e]*(t===`idle`?Mfe:1))/48})),ease:`linear`,loop:!0})),s=NT(i.current,e=>{for(let t of n)e?t.resume():t.pause()});return()=>{s();for(let e of n)e.revert()}},[e,t,o,a]),(0,R.jsxs)(`svg`,{ref:i,"aria-hidden":`true`,focusable:`false`,viewBox:e===`line`?`-20 -10 40 20`:`-20 -20 40 40`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(MT,{id:n,values:jT}),(0,R.jsx)(OT,{id:`${n}-surface`,transform:e===`line`?`matrix(3.4 0 0 1.4 0 0)`:`matrix(3 0 0 3 0 0)`}),(0,R.jsx)(kT,{id:`${n}-shadow`}),(0,R.jsx)(`mask`,{id:`${n}-mask`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`40`,height:`40`,style:{maskType:`alpha`},children:(0,R.jsx)(`g`,{ref:r,fill:`currentColor`,filter:`url(#${n})`,children:Array.from({length:s},(t,n)=>(0,R.jsx)(`ellipse`,{...IT(e,n,0)},n))})})]}),(0,R.jsx)(`g`,{filter:`url(#${n}-shadow)`,children:(0,R.jsx)(`rect`,{x:`-20`,y:`-20`,width:`40`,height:`40`,fill:`url(#${n}-surface)`,mask:`url(#${n}-mask)`})})]})}var Pfe={sm:`caps-loader-sm`,md:`caps-loader-md`,lg:`caps-loader-lg`,fill:`caps-loader-fill`},Ffe={neutral:`text-base-content`,accent:`text-accent`,primary:`text-primary`,success:`text-success`,current:`text-current`},LT=(0,F.forwardRef)(function({"aria-label":e,"aria-labelledby":t,className:n,decorative:r=!1,label:i=`Loading`,size:a=`md`,variant:o=`line`,pace:s=`working`,tone:c=`neutral`,...l},u){let d=`${(0,F.useId)()}-label`,f=!r&&e===void 0&&t===void 0;return(0,R.jsxs)(`span`,{...l,"aria-label":r?void 0:e,"aria-hidden":r||void 0,"aria-labelledby":r?void 0:t??(e===void 0?d:void 0),className:cC(`caps-loader`,Pfe[a],Ffe[c],n),"data-variant":o,"data-pace":s,role:r?void 0:`status`,ref:u,children:[(0,R.jsx)(Nfe,{variant:o,pace:s}),f?(0,R.jsx)(vC,{id:d,children:i}):null]})}),RT=`disabled:bg-base-200 disabled:text-base-content disabled:outline-1 disabled:outline-solid disabled:outline-base-content/25 aria-disabled:bg-base-200 aria-disabled:text-base-content aria-disabled:outline-1 aria-disabled:outline-solid aria-disabled:outline-base-content/25`,Ife=Wue(`btn caps-button disabled:pointer-events-none`,{variants:{variant:{primary:`btn-primary caps-button-filled`,secondary:`btn-secondary caps-button-filled`,accent:`btn-accent caps-button-filled`,destructive:`btn-error caps-button-filled`,outline:`btn-outline ${RT}`,ghost:`btn-ghost`,"ghost-destructive":`btn-ghost caps-button-ghost-destructive`,link:`btn-link ${RT}`},size:{xs:`btn-xs`,sm:`btn-sm`,default:`btn-md`,lg:`btn-lg`,icon:`btn-square btn-md`,menubar:`caps-button-menubar`}},defaultVariants:{variant:`primary`,size:`default`}}),zT=(0,F.forwardRef)(function({asChild:e=!1,children:t,className:n,disabled:r,loading:i=!1,result:a,resultLabel:o,onResultEnd:s,size:c=`default`,variant:l=`primary`,...u},d){let f=cC(Ife({size:c,variant:l}),n),p=(0,F.useRef)(a).current,m=(0,F.useRef)(null);return(0,F.useImperativeHandle)(d,()=>m.current),Lfe(m,i,a),e?(0,R.jsx)(ES,{...u,"aria-busy":i?!0:u[`aria-busy`],"aria-disabled":r===!0||i?!0:void 0,className:f,ref:m,children:t}):(0,R.jsx)(`button`,{...u,"aria-busy":i?!0:u[`aria-busy`],className:f,disabled:r===!0||i,ref:m,type:u.type??`button`,children:a===void 0&&o===void 0?(0,R.jsxs)(R.Fragment,{children:[i?(0,R.jsx)(LT,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,t]}):(0,R.jsx)(Vfe,{label:o,loading:i,onResultEnd:s,result:a,settled:p,children:t})})});function Lfe(e,t,n){let r=(0,F.useRef)(null),i=(0,F.useRef)(null),a=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let s=JSON.stringify([t,n??null,o.textContent]),c=s!==i.current;i.current=s;let l=a.current;if(!c&&l)return;let u=l?o.offsetWidth:r.current;l&&(a.current=null,l.cancel(),o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`));let d=o.offsetWidth;if(r.current=d>0?d:null,!c||u===null||d===0||Math.abs(u-d)<1||!hC(o))return;let f=dC(o);if(f.reduced)return;let p=o.animate([{width:`${String(u)}px`},{width:`${String(d)}px`}],{duration:f.normal,easing:mC(f,f.ease)});a.current=p,o.style.overflow=`clip`,o.style.whiteSpace=`nowrap`;let m=()=>{a.current===p&&(a.current=null,o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`))};p.onfinish=m,p.oncancel=m})}var Rfe=1100;function zfe(e,t){let n=t.bounce/.3,r=1+.05*Math.min(1.4,.4+n),i=1-.02*Math.min(1.4,n);return e.animate([{transform:`scale(1)`},{transform:`scale(${String(r)})`,offset:.35},{transform:`scale(${String(i)})`,offset:.7},{transform:`scale(1)`}],{duration:t.springDuration,easing:mC(t,`ease-out`)})}function Bfe(e,t){let n=t.shake;return e.animate([{transform:`none`},{transform:`translateX(${String(-n)}px)`},{transform:`translateX(${String(n)}px)`},{transform:`translateX(${String(-n*.6)}px)`},{transform:`translateX(${String(n*.3)}px)`},{transform:`none`}],{duration:t.slow*1.3,easing:mC(t,`linear`)})}function BT(e,t,n){let r=n.distance+2,i=`blur(${String(n.blur)}px)`;return[e.animate([{opacity:1,transform:`none`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${String(-r)}px)`,filter:i}],{duration:n.fast,easing:mC(n,n.ease)}),t.animate([{opacity:0,transform:`translateY(${String(r)}px)`,filter:i},{opacity:1,transform:`none`,filter:`blur(0px)`}],{duration:n.normal,easing:mC(n,n.ease),fill:`backwards`})]}function Vfe({children:e,label:t,loading:n,onResultEnd:r,result:i,settled:a}){let o=(0,F.useRef)(null),s=_C(),[c,l]=(0,F.useState)(!1),[u,d]=(0,F.useState)(!1);c&&!u&&d(!0);let f=(0,F.useRef)(a),p=(0,F.useRef)(r);(0,F.useEffect)(()=>{p.current=r},[r]),(0,F.useLayoutEffect)(()=>{let e=f.current;if(f.current=i,i===e)return;if(i===`done`){l(!0);let e=setTimeout(()=>{p.current?p.current():l(!1)},Rfe);return()=>{clearTimeout(e)}}l(!1);let t=o.current;if(i!==`failed`||!t||!hC(t))return;let n=dC(t);if(n.shake<=0)return;let r=Bfe(t,n);return()=>{r.cancel()}},[i,s]);let m=(0,F.useRef)(c);return(0,F.useLayoutEffect)(()=>{let e=o.current;if(!e||m.current===c)return;m.current=c;let t=e.querySelector(`[data-face="label"]`),n=e.querySelector(`[data-face="result"]`);if(!t||!n||!hC(e)){c||d(!1);return}let r=dC(e),i=c?BT(t,n,r):BT(n,t,r);if(c||i[0]?.addEventListener(`finish`,()=>{d(!1)}),c&&!r.reduced){i.push(zfe(e.closest(`button`)??e,r));let t=n.querySelector(`path`);t&&i.push(t.animate([{strokeDashoffset:1},{strokeDashoffset:0}],{duration:r.normal*1.4,delay:r.fast/2,easing:mC(r,r.ease),fill:`backwards`}))}return()=>{for(let e of i)e.cancel()}},[c,s]),(0,R.jsxs)(`span`,{ref:o,className:`caps-button-faces`,"data-showing":c?`result`:`label`,children:[(0,R.jsxs)(`span`,{className:`caps-button-face`,"data-face":`label`,"aria-hidden":c?!0:void 0,children:[n||c?(0,R.jsx)(LT,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,e]}),u?(0,R.jsxs)(`span`,{className:`caps-button-face`,"data-face":`result`,"aria-hidden":!c||void 0,children:[(0,R.jsx)(`svg`,{className:`caps-button-check`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,R.jsx)(`path`,{d:`M4.5 12.5 9.5 17.5 19.5 6.5`,pathLength:1})}),t===void 0?e:t]}):null]})}var VT=new Map([[`0`,[`###`,`#.#`,`#.#`,`#.#`,`###`]],[`1`,[`.#.`,`##.`,`.#.`,`.#.`,`###`]],[`2`,[`###`,`..#`,`###`,`#..`,`###`]],[`3`,[`###`,`..#`,`.##`,`..#`,`###`]],[`4`,[`#.#`,`#.#`,`###`,`..#`,`..#`]],[`5`,[`###`,`#..`,`###`,`..#`,`###`]],[`6`,[`###`,`#..`,`###`,`#.#`,`###`]],[`7`,[`###`,`..#`,`.#.`,`.#.`,`.#.`]],[`8`,[`###`,`#.#`,`###`,`#.#`,`###`]],[`9`,[`###`,`#.#`,`###`,`..#`,`###`]],[`:`,[`.`,`#`,`.`,`#`,`.`]],[`.`,[`.`,`.`,`.`,`.`,`#`]],[`+`,[`...`,`.#.`,`###`,`.#.`,`...`]],[`-`,[`...`,`...`,`###`,`...`,`...`]],[`/`,[`..#`,`..#`,`.#.`,`#..`,`#..`]],[`×`,[`...`,`#.#`,`.#.`,`#.#`,`...`]],[`%`,[`#.#`,`..#`,`.#.`,`#..`,`#.#`]],[` `,[`.`,`.`,`.`,`.`,`.`]]]),Hfe=[`.`,`.`,`.`,`.`,`.`],Ufe=Object.freeze([...VT.keys()]);function Wfe(e,t=0,n=!1){if(!Number.isFinite(e))throw RangeError(`PixelNumber needs a finite number`);let r=String(Math.trunc(Math.abs(e))).padStart(t,`0`),i=String(Math.abs(e)).split(`.`)[1];return HT(`${e<0?`-`:n&&e>0?`+`:``}${r}${i?`.${i}`:``}`)}function HT(e){for(let t of e)if(!VT.has(t))throw RangeError(`PixelNumber cannot draw "${t}"; use digits and ${Ufe.filter(e=>!/\d/.test(e)).join(` `)}`);return e}function Gfe(e,t){let n=new Set,r=t;for(let i of e){let e=VT.get(i)??Hfe;e.forEach((e,i)=>{for(let a=0;a<e.length;a++)e.charAt(a)===`#`&&n.add(`${String(r+a)},${String(i+t)}`)}),r+=(e.at(0)?.length??1)+1}return{lit:n,width:Math.max(1,r-1-t)+t*2}}function Kfe(e){let t=new Set;for(let n of e){let[r=0,i=0]=n.split(`,`).map(Number);for(let n=-1;n<=1;n++)for(let a=-1;a<=1;a++){let o=`${String(r+a)},${String(i+n)}`;e.has(o)||t.add(o)}}return t}function UT(e,t,n){let r=[];for(let i=0;i<n;i++){let n=-1;for(let a=0;a<=t;a++){let t=e.has(`${String(a)},${String(i)}`);t&&n<0&&(n=a),!t&&n>=0&&(r.push([n,i,a-n]),n=-1)}}return r}function WT({runs:e,className:t}){return(0,R.jsx)(`g`,{className:t,children:e.map(([e,t,n])=>(0,R.jsx)(`rect`,{x:e,y:t,width:n,height:1},`${String(e)}-${String(t)}`))})}var qfe=(0,F.forwardRef)(function({value:e,text:t,pad:n,signed:r,size:i=`md`,tone:a=`current`,outline:o=!1,className:s,...c},l){if(t===void 0&&e===void 0)throw TypeError(`PixelNumber needs a value or text`);let u=t===void 0?Wfe(e??NaN,n,r):HT(t),d=+!!o,{lit:f,width:p}=Gfe(u,d),m=5+d*2,h=Jfe[i];return(0,R.jsxs)(`span`,{...c,ref:l,className:cC(`caps-pixel-number`,s),"data-size":i,"data-tone":a,"data-outline":o,children:[(0,R.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,viewBox:`0 0 ${String(p)} ${String(m)}`,width:p*h,height:m*h,children:[o?(0,R.jsx)(WT,{className:`caps-pixel-number-outline`,runs:UT(Kfe(f),p,m)}):null,(0,R.jsx)(WT,{className:`caps-pixel-number-face`,runs:UT(f,p,m)})]}),(0,R.jsx)(`span`,{className:`sr-only`,children:u})]})}),Jfe={sm:2,md:3,lg:4,xl:6},GT=Object.freeze({ease:`linear`,duration:0});function KT(e,t){let n=Hde(e,t.duration);return n<=0?GT:e.steps>0?{ease:DT(e.steps),duration:n}:{ease:Afe({bounce:Vde(e,t.bounce),duration:n}),duration:n}}function qT(e,t){let n=pC(e,t.duration);return{ease:e.steps>0?DT(e.steps):t.ease,duration:n}}var JT={dot:{y:-4,height:8,cy:0},pill:{y:-16,height:32,cy:0},bang:{y:-16,height:20,cy:12}};function Yfe({className:e,glyph:t,motion:n}){let r=`caps-status-${(0,F.useId)().replaceAll(`:`,``)}`,i=(0,F.useRef)(null),a=(0,F.useRef)(null),o=(0,F.useRef)(null),s=(0,F.useRef)(null),c=(0,F.useRef)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(JT[t]).current,d=(0,F.useRef)(t===`dot`?1:4).current,f=(0,F.useRef)(+(t===`bang`)).current,p=(0,F.useRef)(t),m=fC(s),{reduced:h}=m;return(0,F.useLayoutEffect)(()=>{if(!i.current||!a.current||!c.current||!l.current)return;let e=JT[t],n=h||p.current===t;p.current=t;let r=dC(i.current),o=n?{duration:0}:KT(r,{bounce:.3,duration:360}),s=TT(i.current,{y:e.y,height:e.height,...o}),u=TT(a.current,{cy:e.cy,...n?{duration:0}:{delay:pC(r,35),...KT(r,{bounce:.3,duration:420})}}),d=TT(c.current,{gradientTransform:`matrix(1 0 0 ${t===`dot`?`1`:`4`} 0 0)`,...o}),f=TT(l.current,{opacity:+(t===`bang`),...n?GT:qT(r,{ease:`inOutSine`,duration:220})});return()=>{s.cancel(),u.cancel(),d.cancel(),f.cancel()}},[t,h]),(0,F.useLayoutEffect)(()=>{if(!o.current||!s.current||h||n===`none`)return;let e=n===`pulse`?TT(o.current,{opacity:[1,.45],...qT(m,{ease:`inOutSine`,duration:750}),alternate:!0,loop:!0}):TT(o.current,{keyframes:{"0%":{translateY:0,scaleX:1,scaleY:1},"18%":{translateY:.25,scaleX:1.1,scaleY:.91},"42%":{translateY:-1.3,scaleX:.94,scaleY:1.06},"62%":{translateY:-1.65,scaleX:1,scaleY:1},"82%":{translateY:.15,scaleX:1.06,scaleY:.95},"100%":{translateY:0,scaleX:1,scaleY:1}},...qT(m,{ease:`inOutSine`,duration:1e3}),loop:!0}),t=NT(s.current,t=>{t?e.resume():e.pause()});return()=>{t(),e.revert()}},[n,h,m]),(0,R.jsxs)(`svg`,{ref:s,"aria-hidden":`true`,className:`caps-status-bead ${e??``}`,width:`8`,height:`8`,viewBox:`-4 -4 8 8`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(MT,{id:r,values:jT}),(0,R.jsx)(OT,{ref:c,id:`${r}-surface`,transform:`matrix(1 0 0 ${String(d)} 0 0)`}),(0,R.jsxs)(`radialGradient`,{id:`${r}-drop-light`,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`10.4`,r:`5.6`,children:[(0,R.jsx)(`stop`,{offset:`0`,stopColor:`var(--color-white)`,style:{stopOpacity:`calc(var(--depth) * 0.5)`}}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--color-white)`,stopOpacity:`0`})]}),(0,R.jsx)(kT,{id:`${r}-shadow`}),(0,R.jsx)(`mask`,{id:`${r}-silhouette`,maskUnits:`userSpaceOnUse`,x:`-12`,y:`-24`,width:`24`,height:`48`,style:{maskType:`alpha`},children:(0,R.jsxs)(`g`,{fill:`var(--color-white)`,filter:`url(#${r})`,children:[(0,R.jsx)(`rect`,{ref:i,x:`-4`,y:u.y,width:`8`,height:u.height,rx:`4`}),(0,R.jsx)(`circle`,{ref:a,cx:`0`,cy:u.cy,r:`4`})]})})]}),(0,R.jsx)(`g`,{ref:o,filter:`url(#${r}-shadow)`,children:(0,R.jsxs)(`g`,{mask:`url(#${r}-silhouette)`,children:[(0,R.jsx)(`rect`,{x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-surface)`}),(0,R.jsx)(`rect`,{ref:l,x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-drop-light)`,opacity:f})]})})]})}var Xfe=.28;function YT(e,t){switch(e){case`ring`:return{dashes:1,track:0,arc:0,sweep:0,disc:0,tick:0,cross:0};case`arc`:return{dashes:0,track:1,arc:1,sweep:t===void 0?Xfe:Math.min(1,Math.max(0,t)),disc:0,tick:0,cross:0};case`check`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:1,cross:0};case`cross`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:0,cross:1}}}var XT=7.25;function Zfe({className:e,glyph:t,progress:n}){let r=`caps-status-mark-${(0,F.useId)().replaceAll(`:`,``)}`,i=(0,F.useRef)(null),a=(0,F.useRef)(null),o=(0,F.useRef)(null),s=(0,F.useRef)(null),c=(0,F.useRef)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(null),f=(0,F.useRef)(YT(t,n)).current,p=(0,F.useRef)(t),m=_C();(0,F.useLayoutEffect)(()=>{let e=i.current,r=a.current,c=o.current,f=s.current,h=l.current,g=u.current,_=d.current;if(!e||!r||!c||!f||!h||!g||!_)return;let v=YT(t,n),y=p.current;p.current=t;let b=dC(e),x=m||y===t&&t!==`arc`,S=x?m?{ease:b.ease,duration:b.fast}:GT:qT(b,{ease:`outQuad`,duration:160}),C=(t===`check`||t===`cross`)&&!x,w=qT(b,{ease:`inOutSine`,duration:220}),T=[TT(r,{opacity:v.dashes,...S}),TT(c,{opacity:v.track*.28,...S}),TT(f,{opacity:v.arc,"stroke-dasharray":`${String(v.sweep)} 1`,...x?m?GT:S:w}),TT(h,{r:v.disc*XT,...C?{delay:w.duration*.7,...KT(b,{bounce:.35,duration:360})}:m?GT:qT(b,{ease:`inCubic`,duration:140})}),TT(g,{"stroke-dashoffset":1-v.tick,...C&&v.tick>0?{delay:w.duration*.7+b.fast,...qT(b,{ease:`outCubic`,duration:240})}:GT}),TT(_,{"stroke-dashoffset":1-v.cross,...C&&v.cross>0?{delay:w.duration*.7+b.fast,...qT(b,{ease:`outCubic`,duration:240})}:GT})];return t===`cross`&&C&&b.shake>0&&T.push(TT(e,{translateX:[0,-b.shake,b.shake,-b.shake/2,0],delay:w.duration+b.fast,...qT(b,{ease:`linear`,duration:300})})),()=>{for(let e of T)e.cancel()}},[t,n,m]);let h=t===`arc`&&n===void 0&&!m;return(0,F.useLayoutEffect)(()=>{if(!h||!c.current||!i.current)return;let e=dC(i.current),t=TT(c.current,{rotate:[0,360],...qT(e,{ease:`linear`,duration:900}),loop:!0}),n=NT(i.current,e=>{e?t.resume():t.pause()});return()=>{n(),t.revert()}},[h]),(0,R.jsxs)(`svg`,{ref:i,"aria-hidden":`true`,className:`caps-status-mark ${e??``}`,viewBox:`0 0 16 16`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{id:`${r}-surface`,transform:`matrix(1.6 0 0 1.6 8 8)`}),(0,R.jsxs)(`mask`,{id:`${r}-knock`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`16`,height:`16`,children:[(0,R.jsx)(`rect`,{width:`16`,height:`16`,fill:`var(--color-white)`}),(0,R.jsx)(`path`,{ref:u,d:`M4.9 8.3 7.1 10.5 11.2 5.9`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,strokeLinejoin:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-f.tick}),(0,R.jsx)(`path`,{ref:d,d:`M5.4 5.4 10.6 10.6 M10.6 5.4 5.4 10.6`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-f.cross})]})]}),(0,R.jsx)(`circle`,{ref:a,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`1.7 2.2`,opacity:f.dashes}),(0,R.jsx)(`circle`,{ref:o,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,opacity:f.track*.28}),(0,R.jsx)(`g`,{ref:c,className:`caps-status-mark-spin`,children:(0,R.jsx)(`circle`,{ref:s,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`${String(f.sweep)} 1`,transform:`rotate(-90 8 8)`,opacity:f.arc})}),(0,R.jsx)(`circle`,{ref:l,cx:`8`,cy:`8`,r:f.disc*XT,fill:`url(#${r}-surface)`,mask:`url(#${r}-knock)`})]})}var Qfe=new Set([`ring`,`arc`,`check`,`cross`]);function $fe(e){return Qfe.has(e)}var ZT={neutral:`text-base-content`,primary:`text-primary`,secondary:`text-secondary`,accent:`text-accent`,success:`text-success`,info:`text-info`,warning:`text-warning`,error:`text-error`},QT=(0,F.forwardRef)(function({className:e,label:t,glyph:n=`dot`,motion:r=`none`,tone:i=`neutral`,size:a=`default`,appearance:o=`plain`,progress:s,...c},l){return(0,R.jsxs)(`span`,{...c,className:cC(`caps-status`,a===`compact`&&`caps-status-compact`,o===`chip`&&`caps-status-chip`,e),"data-tone":o===`chip`?i:void 0,"data-glyph":n,"data-motion":r,ref:l,children:[$fe(n)?(0,R.jsx)(Zfe,{className:ZT[i],glyph:n,progress:s}):(0,R.jsx)(Yfe,{className:ZT[i],glyph:n,motion:r}),t===void 0?null:(0,R.jsx)(`span`,{children:t})]})});function $T({icon:e,caption:t}){return(0,R.jsxs)(`span`,{className:`caps-icon-choice-mark`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`caps-icon-choice-art`,children:e}),t?(0,R.jsx)(`span`,{className:`caps-icon-choice-caption`,children:t}):null,(0,R.jsx)(`span`,{className:`caps-icon-choice-lamp`})]})}var epe=(0,F.forwardRef)(function({label:e,icon:t,caption:n,on:r,stateLabels:i=[`on`,`off`],className:a,...o},s){return(0,R.jsxs)(`span`,{...o,className:cC(`caps-icon-lamp`,a),"data-on":r,ref:s,children:[(0,R.jsx)($T,{icon:t,caption:n}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[e,`: `,r?i[0]:i[1]]})]})}),tpe=(0,F.forwardRef)(function({items:e,stateLabels:t,className:n,...r},i){return(0,R.jsx)(`ul`,{...r,className:cC(`caps-icon-lamps`,n),ref:i,children:e.map(({id:e,...n})=>(0,R.jsx)(`li`,{children:(0,R.jsx)(epe,{...n,...t===void 0?{}:{stateLabels:t}})},e))})}),npe=(0,F.forwardRef)(function({className:e,size:t=`md`,depth:n=`shallow`,placement:r=`standalone`,...i},a){return(0,R.jsx)(`div`,{...i,ref:a,"data-surface-size":t,"data-surface-depth":n,"data-surface-placement":r,className:cC(`caps-surface`,e)})}),rpe=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`div`,{...t,ref:n,className:cC(`caps-screen`,e)})}),eE=(0,F.forwardRef)(function({children:e,className:t,depth:n=`deep`,fit:r=`content`,density:i=`normal`,...a},o){let s=r===`fill`;return(0,R.jsx)(npe,{...a,className:cC(t,s&&`flex min-h-0 flex-1`),depth:n,ref:o,children:(0,R.jsx)(`div`,{className:cC(`caps-display-gasket`,s&&`flex min-h-0 min-w-0 flex-1`),"data-display-density":i,children:(0,R.jsx)(rpe,{className:cC(s&&`flex min-h-0 min-w-0 flex-1 overflow-hidden`),children:e})})})}),ipe=(0,F.forwardRef)(function({className:e,icon:t,status:n,title:r,...i},a){return(0,R.jsxs)(`header`,{...i,className:cC(`caps-screen-header`,e),ref:a,children:[t?(0,R.jsx)(`span`,{className:`caps-screen-header-icon`,"aria-hidden":`true`,children:t}):null,(0,R.jsx)(`span`,{className:`caps-screen-header-title`,children:r}),n?(0,R.jsx)(`span`,{className:`caps-screen-header-status`,children:n}):null]})}),ape=(0,F.forwardRef)(function({appearance:e,className:t,...n},r){return(0,R.jsx)(`div`,{...n,className:cC(`caps-screen-cells`,t),"data-appearance":e===`compact`?e:void 0,ref:r})}),tE=(0,F.forwardRef)(function({children:e,className:t,legend:n,readout:r,icon:i,appearance:a,wide:o=!1,...s},c){return(0,R.jsxs)(`div`,{...s,className:cC(`caps-screen-cell`,t),"data-wide":o||void 0,"data-appearance":a===`compact`?a:void 0,ref:c,children:[i?(0,R.jsx)(`span`,{className:`caps-screen-cell-icon`,children:i}):null,n?(0,R.jsx)(`span`,{className:`caps-screen-cell-legend`,children:n}):null,r?(0,R.jsx)(`span`,{className:`caps-screen-cell-readout`,children:r}):null,a===`compact`?(0,R.jsx)(`div`,{className:`caps-screen-cell-controls`,children:e}):e]})}),nE={coral:`var(--stipe-art-coral, #ff6558)`,blue:`var(--stipe-art-blue, #43a6f2)`,mint:`var(--stipe-art-mint, #63cfaa)`,grape:`var(--stipe-art-grape, #a66cc1)`,yellow:`var(--stipe-art-yellow, #ffd05d)`,cream:`var(--stipe-art-cream, #fff4de)`,ink:`var(--stipe-art-ink, #242c28)`,graphite:`var(--stipe-art-graphite, #49423f)`,inkcap:`var(--stipe-art-inkcap, #80499d)`},rE=`light-dark(var(--stipe-sketch-ink, #242c28), var(--stipe-art-cream, #fff4de))`,ope=`var(--color-base-100, light-dark(#fff4de, #242c28))`;function iE({transform:e,fill:t=rE}){return(0,R.jsx)(`path`,{transform:e,style:{fill:t},d:`M-1.264-9.479C-2.098-8.643-1.802-1.057-.907-.332.47.782 1.6-.446 1.618-3.075 1.623-3.888 1.691-5.398 1.77-6.429 1.979-9.202 1.596-10 .055-10-.588-10-.843-9.9-1.264-9.479Z`})}function spe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(iE,{transform:`translate(25.4 19.8) rotate(-39) scale(.95 .76)`}),(0,R.jsx)(iE,{transform:`translate(32.1 17.8) scale(.96 .95)`}),(0,R.jsx)(iE,{transform:`translate(38.8 19.9) rotate(39) scale(.95 .77)`})]})}function cpe(){return(0,R.jsxs)(`g`,{style:{fill:nE.blue},children:[(0,R.jsx)(`path`,{d:`M10.574 .604C9.804 1.375 9.867-.885 9.961 22.81 10.054 47.202 9.722 45.378 14.193 45.94 25.813 47.399 38.465 52.211 44.662 57.532 47.653 60.097 48.082 59.411 47.967 52.242L47.734 19.335C47.734 17.523 47.13 16.616 45.964 15.076 40.604 8.018 30.127 2.767 16.804 .462 13.045-.184 11.326-.148 10.574 .604Z`}),(0,R.jsx)(`path`,{d:`M81.571 .746C71.063 2.665 62.221 6.713 56.562 12.199 54.242 14.45 52 17.356 52.115 19.335L52.033 52.628C51.927 59.934 51.979 59.994 55.74 57.091 62.423 51.931 71.272 48.541 84.103 46.221 90.625 45.039 89.967 47.631 90.145 22.432 90.326-3.079 91.148-1 81.571 .746Z`}),(0,R.jsx)(`path`,{d:`M1.906 12.692C.1 13.42 .151 12.804 .151 33.825 .151 54.097 .163 54.302 1.447 55.498 2.71 56.674 3.384 56.81 7.937 56.816 20.943 56.834 30.647 58.293 38.776 61.45 45.964 64.242 46.435 61.924 39.526 57.773 32.296 53.429 26.656 51.544 14.943 49.553 5.958 48.027 6.535 49.414 6.408 29.003 6.32 14.74 6.263 13.103 5.816 12.764 5.254 12.335 2.9 12.293 1.906 12.692Z`}),(0,R.jsx)(`path`,{d:`M94.326 12.858C93.656 13.326 93.656 13.326 93.653 28.492 93.653 48.882 93.997 48.063 84.743 49.556 73.574 51.36 64.45 54.695 57.801 59.405 54.082 62.039 55.384 63.864 59.722 62.1 68.897 58.372 76.363 57.115 90.03 56.994 100.405 56.903 99.489 58.976 99.773 34.976 100.018 14.142 100.006 13.958 98.399 12.979 97.236 12.269 95.251 12.208 94.326 12.858Z`})]})}function aE(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M-8.572-25.123C-21.412-23.39-33.235-17.39-44.235-7.027-51.235-.433-51.251 .358-44.524 6.749-20.77 29.316 10.23 31.893 36.364 13.487 41.043 10.187 48.193 3.551 49.235 1.524 50.358-.642 49.471-2.102 43.738-7.497 29.257-21.128 9.968-27.631-8.572-25.123Z`}),(0,R.jsx)(`path`,{style:{fill:nE.ink},d:`M-6.225-16.807C-17.727-13.267-21.176 4.433-12.08 13.257-1.118 23.898 16.829 16.102 17.032 .604 17.209-12.412 6.219-20.642-6.225-16.807Z`})]})}function lpe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{style:{fill:nE.mint},d:`M540 342C520 340 497 355 477 374C450 399 440 421 456 444C465 458 480 462 492 464C503 466 500 477 494 486C487 500 508 496 522 478L530 468C557 468 578 464 591 451C601 442 599 429 585 427C572 425 556 432 547 418C538 403 550 390 568 385C579 382 589 380 584 368C576 352 557 341 540 342Z`}),(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M589 396C614 380 659 381 683 392C709 404 721 428 710 451C704 464 693 472 685 479C680 487 684 498 689 503C695 514 684 513 675 507C667 502 662 497 657 491C637 496 610 495 594 486C584 480 583 469 595 464C607 460 622 454 622 441C622 428 612 423 597 420C580 417 578 407 589 396Z`})]})}function oE({fill:e}){return(0,R.jsx)(`path`,{style:{fill:e},d:`M44.648 .288C26.645 1.615 13.263 8.266 5.942 19.529-4.299 35.277-.917 57.684 13.224 67.784 16.958 70.452 16.936 71.742 13.064 77.665 11.28 80.391 10.895 81.565 11.341 82.914 13.163 88.435 25.022 86.396 36.307 78.62L38.681 76.986 41.294 77.335C45.371 77.878 59.645 77.789 64.125 77.191 89.213 73.837 100.562 61.427 99.92 38.044 99.18 11.1 79.587-2.285 44.648 .288Z`})}function sE({onFigure:e=!1}){return(0,R.jsxs)(`g`,{style:{fill:e?ope:nE.ink},children:[(0,R.jsx)(`rect`,{x:`-15`,y:`-11`,width:`10`,height:`22`,rx:`5`}),(0,R.jsx)(`rect`,{x:`5`,y:`-11`,width:`10`,height:`22`,rx:`5`})]})}function upe(){return(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M18.125 .621C.039 1.574-2.575 4.791 2.264 20.133 17.454 68.284 77.345 69.396 96.119 21.875 100.749 10.154 100.318 4.348 94.605 1.513 91.981 .21 37.878-.421 18.125 .621Z`})}function dpe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M31.42 5.279C29.108 5.983 28.068 6.993 25.817 10.732 24.033 13.687 24.027 13.762 25.58 14.265 30.375 15.821 36.711 20.506 39.938 24.885 42.077 27.788 41.835 27.806 45.281 24.463 48.633 21.213 49.164 20.185 48.982 17.325 48.812 14.643 48.174 13.872 42.68 9.741 36.737 5.273 34.439 4.361 31.42 5.279Z`}),(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M22.538 16.207C22.093 16.652 19.732 20.231 13.309 30.196 10.737 34.188 10.723 33.911 13.589 35.351 16.461 36.798 19.778 39.28 21.825 41.523L22.6 42.37Q23.34 43.186 24.05 42.538L24.711 41.933C31.278 35.937 38.928 28.484 38.928 28.083 38.928 24.656 24.521 14.219 22.538 16.207Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M8.89 38.053C8.203 39.566 6.598 44.473 6.598 45.056 6.598 45.137 6.887 45.125 7.236 45.036 9.655 44.404 13.526 47.475 13.526 50.027 13.526 51.132 13.361 51.164 16.187 49.49 21.421 46.387 21.966 45.665 20.575 43.659 19.002 41.387 14.975 38.238 11.909 36.881 9.799 35.949 9.854 35.926 8.89 38.053Z`}),(0,R.jsx)(`path`,{style:{fill:nE.graphite},d:`M6.598 45.056C5.732 46.866 5.155 49.464 6.309 50.907 8.041 53.505 10.928 52.639 13.526 50.907 13.526 48.021 9.978 44.404 7.236 45.036Z`})]})}function fpe(){return(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M40.804 40.625C38.238 41.462 37.291 41.953 31.169 45.625 15.743 54.871 8.047 56.158 5.879 49.856 5.501 48.754 5.501 48.754 4.843 50.913 1.673 61.302 12.377 61.671 30.386 51.796 39.649 46.719 41.142 46.647 40.81 51.291 40.565 54.775 41.168 56.135 43.486 57.31 49.556 60.387 62.035 54.816 59.605 50.116 58.502 47.983 56.1 47.882 52.163 49.799 47.082 52.273 45.983 51.652 47.998 47.449 50.89 41.416 47.686 38.376 40.804 40.625Z`})}function cE({transform:e}){return(0,R.jsx)(`path`,{style:{fill:nE.mint},transform:e,d:`M0 0C3 -2 5 -5 5 -8 5 -10.5 3 -12 0 -12S-5 -10.5 -5 -8C-5 -5 -3 -2 0 0Z`})}function ppe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{fillRule:`evenodd`,style:{fill:rE},d:`M25.3 17.69C14.8 19.34 10.66 20.18 9.05 20.99 5.51 22.78 4.2 27.21 6.71 28.9 7.47 29.42 8.48 29.4 10.25 28.84 12.41 28.15 12.56 27.57 11.02 25.85 10 24.71 10.53 23.62 11.79 24.27 13.9 25.36 15.02 28.98 15.63 36.66 16.18 43.48 17.33 47.43 19.69 50.49 22.76 54.48 27.69 55.73 30.31 53.19 33 50.57 31.24 46.04 28.44 48.38 26.29 50.17 26.16 47.08 28.3 45.14 29.61 43.95 30.78 43.58 38.92 41.75 39.45 41.63 39.41 41.52 38.39 40.01 36.87 37.78 36.04 35.22 34.72 28.69 33.37 22 32.04 19.3 29.5 18.07 28.69 17.68 26.59 17.49 25.3 17.69M24.11 26.51C18.61 27.67 18.16 27.82 17.98 28.55 17.64 29.91 18.54 30.44 20.51 30.05 25.4 29.08 30.11 28.03 30.49 27.83 31.65 27.23 31 25.33 29.66 25.4 29.5 25.4 27 25.91 24.11 26.51M29.2 31.42C28.64 31.54 26.23 32.07 23.85 32.58 20.01 33.41 19.48 33.57 19.15 33.96 18.67 34.5 18.66 35.05 19.12 35.63 19.61 36.26 19.86 36.23 26.05 34.88 29.05 34.23 31.53 33.7 31.57 33.7 31.82 33.7 32.34 32.88 32.34 32.5 32.34 31.25 31.37 30.92 29.2 31.42M29.79 37.19C28.81 37.41 26.45 37.94 24.53 38.37 22.62 38.8 20.84 39.23 20.58 39.33 19.61 39.71 19.35 40.62 19.98 41.41 20.48 42.05 21 41.99 27.59 40.5 33.85 39.09 34.21 38.91 33.45 37.44 33.02 36.61 32.51 36.58 29.79 37.19M45.41 41.95C44.89 42.09 41.61 42.89 38.12 43.73 30.94 45.45 29.81 45.84 31.05 46.15 33.2 46.69 34.11 50.18 32.77 52.76 32.23 53.79 32.23 54.03 32.76 54.16 33.34 54.31 45.35 51.3 46.72 50.67 50.19 49.06 51.76 45.01 49.79 42.76 48.8 41.64 47.46 41.39 45.41 41.95`}),(0,R.jsx)(`path`,{style:{fill:nE.grape},d:`M48.21 10.15C47.92 10.41 47.5 11.27 46.96 12.74 45.52 16.61 45.24 16.99 43.01 18.15 39.18 20.15 39.05 20.99 42.28 22.73 45.37 24.39 45.68 24.79 47.12 28.95 48.3 32.32 49.28 32.2 50.65 28.52 52.23 24.25 52.26 24.22 55.2 22.56 57.53 21.24 57.79 21 57.79 20.16 57.79 19.49 57.55 19.31 55.01 18.06 52.16 16.66 52.2 16.72 50.31 11.56 49.7 9.89 49.03 9.44 48.21 10.15M32.59 13.92C31.78 14.73 32.28 15.89 33.58 16.22 35.07 16.6 36.19 17.1 37.17 17.84 38.42 18.77 39.23 18.86 39.79 18.15 39.99 17.9 40.15 17.53 40.15 17.32 40.15 15.29 33.99 12.52 32.59 13.92M42.48 34.38C40.96 35.96 40.65 36.88 41.39 37.57 42.2 38.33 43.36 37.74 44.55 35.95 45.2 34.97 45.22 34.35 44.62 33.88 43.89 33.31 43.41 33.42 42.48 34.38`}),(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M40.75 25.96C39.69 27.07 38.11 30.69 38.11 31.98 38.11 32.66 38.55 33.19 39.12 33.19 39.8 33.19 40.24 32.73 40.58 31.66 40.95 30.46 41.65 29.09 42.42 28.01 43.77 26.14 42.29 24.32 40.75 25.96M54.85 27.67C54.71 27.81 54.47 28.32 54.31 28.82 53.67 30.76 53.19 31.37 51.67 32.13 50.25 32.85 50.34 33.36 52.04 34.21 53.25 34.82 53.57 35.23 54.24 37.01 54.98 38.98 55.47 39.08 56.03 37.37 56.7 35.32 57.08 34.81 58.64 33.87 60.18 32.95 60.14 32.65 58.38 31.78 57.02 31.11 56.68 30.66 56.02 28.65 55.69 27.64 55.25 27.27 54.85 27.67`})]})}function mpe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{fillRule:`evenodd`,style:{fill:rE},d:`M42.24 14.07C41.52 14.24 40.53 14.54 35.06 16.26 33.33 16.8 31.2 17.47 30.34 17.74 29.47 18.01 27.86 18.52 26.75 18.88 25.64 19.23 24.03 19.74 23.16 20.01 20.16 20.94 19.45 21.4 18.97 22.71 18.71 23.44 18.45 26.33 17.83 35.41 17.64 38.25 17.44 41.03 17.41 41.58 17.32 42.77 17.24 42.69 18.79 42.84L20.01 42.95 21.98 39.97C24.69 35.88 24.85 35.82 27.05 37.9 27.9 38.7 28.43 39.08 28.61 39.02 28.76 38.96 28.91 38.91 28.94 38.91 28.98 38.91 29.38 38.38 29.84 37.73 30.3 37.08 31.47 35.48 32.43 34.17 33.4 32.86 34.86 30.85 35.67 29.71 36.49 28.56 37.5 27.29 37.91 26.88 39.73 25.07 41.01 26.43 43.32 32.67 43.76 33.84 44.3 35.28 44.52 35.86 44.74 36.44 44.97 37.28 45.04 37.74 45.19 38.71 45.17 38.71 46.63 38.03 47.69 37.53 47.77 37.46 47.68 37.02 47.58 36.52 46.97 30.64 46.79 28.41 46.73 27.69 46.62 26.43 46.53 25.61 46.44 24.79 46.24 22.87 46.09 21.32 45.61 16.44 45.5 15.66 45.22 15.12 44.72 14.15 43.59 13.76 42.24 14.07M29.38 22.45C26.04 23.47 24.49 27.62 26.6 29.91 29.17 32.7 34.15 30.16 34.16 26.05 34.16 23.38 31.9 21.68 29.38 22.45M46.7 41.5C39.3 44.23 28.33 46.04 20.1 45.88L17.21 45.82 17.16 46.88C17.08 48.22 17.33 49.03 18.01 49.68 18.73 50.37 19.73 50.35 23.77 49.53 25.46 49.19 29.12 48.47 31.91 47.93 46.31 45.14 46.9 44.99 47.57 43.91 47.95 43.3 48.25 41.29 47.99 41.15 47.91 41.11 47.33 41.26 46.7 41.5`}),(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M29.72 22.45C25.84 23.34 24.28 28.36 27.25 30.42 29.34 31.88 32.91 30.43 33.83 27.75 34.92 24.55 32.75 21.76 29.72 22.45`}),(0,R.jsx)(`path`,{style:{fill:nE.mint},d:`M12.96 14.29C12.87 14.41 12.7 15.03 12.58 15.68 12.37 16.82 11.59 18.26 11.18 18.26 11.08 18.26 10.88 18.46 10.72 18.7 10.36 19.25 10.59 19.58 11.45 19.74 12.18 19.88 13.08 20.63 13.54 21.49 14.23 22.76 14.75 22.53 15.15 20.79 15.39 19.71 15.51 19.51 16.4 18.66 17.54 17.58 17.51 17.36 16.18 16.85 15.16 16.47 14.84 16.19 14.14 15.1 13.56 14.2 13.22 13.96 12.96 14.29M49.04 24.13C48.56 24.86 48.91 25.31 50.59 26.09 53.89 27.64 54.85 29.82 53.45 32.6 52.01 35.43 46.84 38.54 40.51 40.39 39.73 40.62 38.88 40.89 38.62 40.99 37.24 41.52 30.85 42.64 27.54 42.93 20.72 43.52 13.63 42.49 10.57 40.46 5.81 37.3 7.51 32.32 14.74 28.24 15.84 27.61 16.17 27.1 15.9 26.4 15.66 25.78 15.35 25.84 13.19 26.94 6 30.61 2.97 35.32 4.95 39.74 7.86 46.21 22.78 47.8 40.05 43.46 51.97 40.47 58.57 36.38 59.47 31.43 60.09 27.97 57.74 25.34 52.93 24.12 50.6 23.53 49.43 23.54 49.04 24.13`}),(0,R.jsx)(`path`,{style:{fill:nE.grape},d:`M34.82 8.91C33.48 10.04 34.21 12.14 35.94 12.14 37.29 12.14 38.18 10.99 37.77 9.77 37.36 8.53 35.81 8.08 34.82 8.91M53.15 43.16C53 43.28 52.74 43.86 52.57 44.45 52.18 45.78 51.76 46.32 50.64 46.93 49.52 47.53 49.45 47.89 50.33 48.34 51.34 48.85 52.24 49.95 52.56 51.04 53.13 53.01 53.6 53 54.21 50.99 54.61 49.69 55.13 48.93 55.91 48.54 57.17 47.91 57.23 47.51 56.15 46.96 55.23 46.49 54.67 45.76 54.23 44.44 53.8 43.15 53.54 42.84 53.15 43.16M24.18 53.18C22.45 53.9 22.87 56.59 24.71 56.59 26.79 56.59 27.2 53.67 25.2 53.09 24.89 53.01 24.51 53.04 24.18 53.18`}),(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M51.76 11.04C51.21 12.77 50.56 13.61 49.24 14.34 48.6 14.69 48.72 15.07 49.59 15.48 50.54 15.93 51.11 16.69 51.62 18.22 52.06 19.57 52.26 19.54 52.79 18.08 53.29 16.69 53.87 15.91 54.86 15.31 55.76 14.77 55.77 14.48 54.92 14.02 53.91 13.46 53.5 12.99 52.89 11.66 52.23 10.21 52.06 10.12 51.76 11.04M11.06 48.22C10.99 48.35 10.71 48.88 10.46 49.41 9.95 50.48 9.45 50.99 8.59 51.33 7.89 51.61 7.85 52.1 8.52 52.37 9.51 52.79 10.3 53.85 10.89 55.58 11.09 56.18 11.48 55.88 11.87 54.84 12.24 53.87 13.33 52.56 13.79 52.56 14 52.56 14.5 52.06 14.5 51.85 14.5 51.77 14.19 51.54 13.81 51.34 12.98 50.92 12.36 50.14 11.93 48.99 11.6 48.09 11.31 47.83 11.06 48.22`})]})}function hpe(){return(0,R.jsxs)(`g`,{transform:`translate(2 8) scale(.114) translate(-125 -122)`,children:[(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M278 155 482 123C517 117 527 135 530 167L542 309Q543 329 561 341L631 404Q649 419 646 444 645 465 623 472L407 521Q374 531 345 519L156 436Q115 418 128 375L221 191Q238 163 278 155Z`}),(0,R.jsx)(`path`,{style:{fill:nE.ink},d:`M317 183 461 161Q493 155 497 188L504 288Q508 320 478 326L318 356Q289 362 286 331L281 226Q278 194 317 183Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M304 386 553 340Q562 337 570 346L631 404Q649 419 646 444Q645 448 629 452L411 483Q382 492 367 474Z`}),(0,R.jsxs)(`g`,{style:{fill:nE.cream},children:[(0,R.jsx)(`rect`,{x:`319`,y:`236`,width:`26`,height:`59`,rx:`13`}),(0,R.jsx)(`rect`,{x:`364`,y:`229`,width:`26`,height:`59`,rx:`13`})]}),(0,R.jsxs)(`g`,{style:{fill:nE.ink},transform:`rotate(-11 470 411)`,children:[(0,R.jsx)(`rect`,{x:`369`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`444`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`518`,y:`380`,width:`57`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`392`,y:`421`,width:`58`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`462`,y:`421`,width:`65`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`539`,y:`421`,width:`58`,height:`25`,rx:`13`})]})]})}function gpe(){return(0,R.jsxs)(`g`,{transform:`translate(3 10) scale(.114) translate(-760 -140)`,children:[(0,R.jsx)(`path`,{style:{fill:nE.blue},d:`M1226 153C1257 153 1273 195 1267 231Q1263 265 1237 268L1176 270V215C1176 178 1195 153 1226 153Z`}),(0,R.jsx)(`path`,{style:{fill:nE.blue},d:`M824 376Q908 372 871 400C842 427 866 442 902 450L1113 480Q1188 479 1199 392C1207 447 1204 497 1163 511Q1134 521 1097 516C1055 510 991 507 957 507S869 511 826 512C781 513 758 483 760 441Q760 385 824 376Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M824 376 857 184Q864 133 911 141C1039 169 1124 151 1226 153Q1179 159 1184 241L1199 377C1202 434 1174 482 1117 480L902 450C864 445 849 429 871 400Q908 372 824 376Z`}),(0,R.jsxs)(`g`,{style:{fill:nE.coral},children:[(0,R.jsx)(`path`,{d:`M982 198C1008 190 1030 197 1028 220L1023 265Q1020 295 1000 279C981 261 951 223 963 210Q970 202 982 198Z`}),(0,R.jsx)(`path`,{d:`M1063 220C1077 215 1100 237 1102 251Q1107 267 1084 282L1063 295Q1037 307 1040 278L1045 245Q1049 224 1063 220Z`}),(0,R.jsx)(`path`,{d:`M911 252C925 240 939 254 957 269L978 291Q995 311 961 316C938 318 907 316 898 308Q884 296 911 252Z`}),(0,R.jsx)(`path`,{d:`M1106 289Q1127 281 1134 304C1142 327 1146 352 1125 350Q1097 348 1073 335C1051 324 1072 311 1084 302Z`}),(0,R.jsx)(`path`,{d:`M927 338C946 334 972 334 985 343Q1004 353 984 384C970 408 957 418 940 403C922 389 896 356 913 345Z`}),(0,R.jsx)(`path`,{d:`M1010 375Q1025 363 1037 384C1049 407 1064 438 1044 442Q1025 448 1002 436C984 428 991 410 997 393Z`}),(0,R.jsx)(`path`,{d:`M1068 357C1084 359 1110 376 1120 389Q1130 402 1107 419C1090 432 1082 418 1073 401C1062 383 1043 355 1068 357Z`}),(0,R.jsx)(`path`,{d:`M1018 311C1037 312 1050 334 1034 343C1018 351 998 337 1005 320Q1009 311 1018 311Z`})]})]})}function _pe(){return(0,R.jsxs)(`g`,{transform:`translate(2 7) scale(.11) translate(-1380 -96)`,children:[(0,R.jsx)(`path`,{style:{fill:nE.inkcap},d:`M1384 276C1394 238 1445 200 1497 158C1547 119 1604 97 1647 97C1690 97 1720 109 1745 138C1772 170 1791 184 1833 194C1870 201 1919 220 1922 257C1923 307 1891 339 1853 336C1801 335 1767 299 1701 294C1666 291 1620 294 1642 303Q1670 307 1675 333C1681 367 1697 389 1717 413C1735 434 1738 443 1719 464C1700 485 1692 502 1686 520Q1682 541 1653 541L1626 541Q1598 541 1594 519C1590 495 1578 474 1563 458C1545 440 1544 429 1559 410C1585 377 1608 337 1572 326C1554 320 1529 333 1506 340C1461 356 1428 357 1402 340Q1371 319 1384 276Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M1634 362Q1641 346 1649 362C1660 390 1676 404 1705 424Q1721 435 1704 453C1685 475 1677 490 1671 513Q1670 526 1653 525L1626 525Q1611 525 1610 513C1606 492 1592 465 1575 449Q1562 437 1577 424C1604 404 1620 390 1634 362Z`}),(0,R.jsx)(`path`,{style:{fill:nE.inkcap},d:`M1634 456A18 18 0 1 1 1648 456V492Q1648 500 1641 500T1634 492Z`}),(0,R.jsx)(`path`,{style:{fill:nE.inkcap},d:`M1780 391Q1786 386 1793 396C1810 420 1828 444 1827 467C1826 508 1768 510 1753 480C1741 456 1762 413 1780 391Z`})]})}var{coral:lE,blue:uE,mint:dE,grape:fE,yellow:pE,cream:mE,ink:hE}=nE,vpe={bonsai:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,stroke:dE,strokeWidth:`3.7`,strokeLinecap:`round`,d:`M35 27.5C36 25 35.5 22.5 34 21S31.5 17.5 31.5 14M36 27C40 26.8 43 26 45 24S47 20.5 47.5 18.5M30.5 31C32.5 26.5 30.5 24.6 26.5 24 22 23.5 18.5 21.6 16.8 18.5M29 37C26.5 34.5 25 33.7 21.5 33.2S15.5 32 13 31.6M36 39.5C38 38 40 37.5 42 36.5S47 34 51 32.2`}),(0,R.jsx)(`path`,{fill:dE,d:`M25.5 43.5C28 40.5 28 37 27.5 33 27.3 29.5 29.5 27 33.5 26.3L37.5 26V29.5C35 29.8 34.2 31.5 34.3 34 34.5 37.5 37 39.5 41 43.5Z`}),(0,R.jsx)(`circle`,{fill:uE,cx:`31.5`,cy:`10.7`,r:`4.8`}),(0,R.jsx)(`circle`,{fill:fE,cx:`16.6`,cy:`18.3`,r:`4.6`}),(0,R.jsx)(`circle`,{fill:pE,cx:`47.9`,cy:`17.7`,r:`4.6`}),(0,R.jsx)(`circle`,{fill:pE,cx:`12.8`,cy:`31.5`,r:`4.6`}),(0,R.jsx)(`circle`,{fill:uE,cx:`50.9`,cy:`32.1`,r:`4.6`}),(0,R.jsx)(`path`,{fill:lE,d:`M16 46H47.5C47.5 54 44 58 38 58H25.5C19.5 58 16 54 16 46Z`}),(0,R.jsx)(`rect`,{fill:lE,x:`14`,y:`43`,width:`35.5`,height:`4.6`,rx:`2.3`})]}),computer:(0,R.jsx)(hpe,{}),prints:(0,R.jsx)(gpe,{}),inkcap:(0,R.jsx)(_pe,{}),vishnu:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{fill:lE},d:`M6 37C6 21 17.5 9 32 9s26 12 26 28c0 2.2-1.8 4-4 4H10c-2.2 0-4-1.8-4-4Z`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`19`,cy:`25`,r:`4`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`33`,cy:`19.5`,r:`4.8`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`46`,cy:`28`,r:`3.4`}),(0,R.jsx)(`rect`,{style:{fill:uE},x:`13`,y:`39`,width:`38`,height:`18`,rx:`9`}),(0,R.jsx)(`rect`,{style:{fill:mE},x:`18.5`,y:`46.2`,width:`10`,height:`3.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{style:{fill:mE},x:`21.7`,y:`43`,width:`3.6`,height:`10`,rx:`1.8`}),(0,R.jsx)(`circle`,{style:{fill:pE},cx:`39`,cy:`50.5`,r:`2.7`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`45`,cy:`45.5`,r:`2.7`})]}),generateText:(0,R.jsx)(ppe,{}),generateMedia:(0,R.jsx)(mpe,{}),buyApps:(0,R.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,R.jsx)(`circle`,{fill:pE,cx:`32`,cy:`20`,r:`12`}),(0,R.jsx)(`circle`,{stroke:mE,strokeWidth:`4`,cx:`32`,cy:`20`,r:`6`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(15.5 12) rotate(-60) scale(1.1 .85)`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(48.5 12) rotate(60) scale(1.1 .85)`}),(0,R.jsx)(`path`,{fill:uE,d:`M10 35H54L50 53Q49 58 44 58H20Q15 58 14 53Z`}),(0,R.jsx)(`rect`,{fill:lE,x:`5`,y:`27`,width:`54`,height:`10`,rx:`5`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`rect`,{x:`20`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,R.jsx)(`rect`,{x:`29.5`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,R.jsx)(`rect`,{x:`39`,y:`41`,width:`5`,height:`11`,rx:`2.5`})]})]}),browseBazaar:(0,R.jsxs)(`g`,{transform:`rotate(-5 32 32)`,children:[(0,R.jsx)(`rect`,{fill:uE,x:`10`,y:`14`,width:`44`,height:`38`,rx:`6`}),(0,R.jsx)(`rect`,{fill:uE,x:`5`,y:`47`,width:`54`,height:`12`,rx:`6`}),(0,R.jsx)(`rect`,{fill:mE,x:`12`,y:`50.5`,width:`40`,height:`4.5`,rx:`2.25`}),(0,R.jsx)(`rect`,{fill:lE,x:`2`,y:`4`,width:`60`,height:`9`,rx:`4.5`}),(0,R.jsx)(`path`,{fill:lE,d:`M3 9H14.6V18A5.8 5.8 0 0 1 3 18Z`}),(0,R.jsx)(`path`,{fill:mE,d:`M14.6 9H26.2V18A5.8 5.8 0 0 1 14.6 18Z`}),(0,R.jsx)(`path`,{fill:lE,d:`M26.2 9H37.8V18A5.8 5.8 0 0 1 26.2 18Z`}),(0,R.jsx)(`path`,{fill:mE,d:`M37.8 9H49.4V18A5.8 5.8 0 0 1 37.8 18Z`}),(0,R.jsx)(`path`,{fill:lE,d:`M49.4 9H61V18A5.8 5.8 0 0 1 49.4 18Z`}),(0,R.jsx)(`g`,{transform:`translate(32 36.5) scale(.34)`,children:(0,R.jsx)(aE,{})})]}),agent:(0,R.jsxs)(`g`,{transform:`translate(32 33) scale(2.02) translate(-47.2 -41.8)`,children:[(0,R.jsx)(`path`,{fill:uE,d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,R.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,R.jsx)(sE,{})})]}),list:(0,R.jsxs)(`g`,{transform:`rotate(-7 32 32)`,children:[(0,R.jsx)(`path`,{style:{fill:uE},d:`M12 13Q6 13 6 19V50Q6 57 13 57H47Q53 57 53 50V20Q53 13 47 13Z`}),(0,R.jsx)(`path`,{style:{fill:mE},d:`M19 7H39Q42 7 44 9L55 20Q57 22 57 26V44Q57 50 51 50H19Q13 50 13 44V13Q13 7 19 7Z`}),(0,R.jsx)(`path`,{style:{fill:lE},d:`M39 7V18Q39 24 45 24H57Q57 22 55 20L44 9Q42 7 39 7Z`}),(0,R.jsxs)(`g`,{style:{fill:lE},children:[(0,R.jsx)(`circle`,{cx:`22`,cy:`21`,r:`3`}),(0,R.jsx)(`circle`,{cx:`22`,cy:`31`,r:`3`}),(0,R.jsx)(`circle`,{cx:`22`,cy:`41`,r:`3`})]}),(0,R.jsx)(`path`,{style:{stroke:uE},strokeWidth:`5`,strokeLinecap:`round`,d:`M31 21H32M31 31H46M31 41H42`})]}),chat:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{transform:`translate(3 11) scale(.22) translate(-449 -327)`,children:(0,R.jsx)(lpe,{})}),(0,R.jsx)(iE,{transform:`translate(38.2 18) rotate(16) scale(.95 .6)`}),(0,R.jsx)(iE,{transform:`translate(44.4 20.5) rotate(47) scale(.95 .6)`})]}),read:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{transform:`translate(4 20.5) scale(.56)`,children:(0,R.jsx)(cpe,{})}),(0,R.jsx)(`g`,{transform:`translate(32 38.6) scale(.3164)`,children:(0,R.jsx)(aE,{})}),(0,R.jsx)(spe,{})]}),readConversations:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(.9) translate(-32 -32)`,children:[(0,R.jsx)(`g`,{transform:`translate(4 7.88) scale(.56)`,children:(0,R.jsx)(oE,{fill:uE})}),(0,R.jsx)(`g`,{transform:`translate(32.2 30.3) scale(.352)`,children:(0,R.jsx)(aE,{})})]}),listAgents:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(1.04) translate(-32 -32)`,children:[(0,R.jsx)(`path`,{style:{fill:rE},d:`M32.059 10.146C23.878 10.646 18.949 14.844 18.925 21.331 18.912 24.856 20.167 27.259 22.274 27.74 24.437 28.233 26.097 29.061 27.481 30.337 28.275 31.068 28.328 31.096 29.352 31.306 31.161 31.677 31.653 32.094 32.115 33.651 32.392 34.582 32.557 34.868 32.915 35.041 33.919 35.523 35.864 33.733 36.539 31.706L36.775 30.997 38.008 30.681C42.663 29.489 45.29 26.142 45.468 21.176 45.734 13.784 40.673 9.62 32.059 10.146Z`}),(0,R.jsx)(`g`,{transform:`translate(32.4 21.2) scale(.39)`,children:(0,R.jsx)(sE,{onFigure:!0})}),(0,R.jsx)(`path`,{style:{fill:lE},d:`M14.375 27.586C8.014 28.591 4.363 32.396 4.355 38.027 4.347 43.93 8.071 47.469 15.239 48.368L16.828 48.568 17.873 49.568C19.854 51.464 22.469 52.496 23.691 51.864 24.384 51.506 24.431 51.044 23.924 49.606 23.337 47.943 23.479 47.492 24.749 46.977 32.756 43.73 32.643 31.899 24.573 28.49 22.238 27.504 17.535 27.087 14.375 27.586Z`}),(0,R.jsx)(`g`,{transform:`translate(17.6 37.7) scale(.38 .36)`,children:(0,R.jsx)(sE,{})}),(0,R.jsx)(`path`,{style:{fill:uE},d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,R.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,R.jsx)(sE,{})})]}),createAgents:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,R.jsx)(`path`,{style:{fill:rE},d:`M20.436 24.499C13.35 25.216 7.504 28.799 5.442 33.687 3.114 39.208 4.438 45.791 8.593 49.358 10.446 50.949 10.34 50.831 10.34 51.301 10.34 51.796 10.106 52.294 9.281 53.558 7.191 56.76 12.108 56.905 16.701 53.777 17.517 53.221 17.715 53.135 18.015 53.201 20.013 53.639 25.739 53.051 28.595 52.113 35.47 49.857 39.129 44.162 37.83 37.738C37 31 33 26 26.717 24.428L24.075 24.413C22.623 24.405 20.985 24.444 20.436 24.499Z`}),(0,R.jsx)(`g`,{transform:`translate(21.9 40) scale(.46 .43)`,children:(0,R.jsx)(sE,{onFigure:!0})}),(0,R.jsx)(`path`,{style:{fill:dE},d:`M37.987 15.734C32.277 16.627 28.675 20.713 28.92 26.022 29.062 29.118 30.627 31.606 33.331 33.036 34.675 33.747 34.761 34.018 34.237 35.923 33.376 39.051 36.878 38.551 39.174 35.218 39.574 34.637 39.65 34.583 40.058 34.583 46.203 34.583 50.414 30.91 50.424 25.543 50.435 18.989 44.932 14.649 37.987 15.734Z`}),(0,R.jsx)(`g`,{transform:`translate(38.9 24.9) scale(.31)`,children:(0,R.jsx)(sE,{})}),(0,R.jsx)(iE,{fill:pE,transform:`translate(48.1 15.7) rotate(31) scale(1.25 .85)`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(52.2 19.8) rotate(70) scale(1.25 .85)`})]}),sendPrompts:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,R.jsx)(`g`,{transform:`translate(4 13.2) scale(.412 .436)`,children:(0,R.jsx)(oE,{fill:lE})}),(0,R.jsx)(`g`,{transform:`translate(17.1 28.7) scale(.19)`,children:(0,R.jsx)(upe,{})}),(0,R.jsx)(iE,{fill:dE,transform:`translate(48.1 26.4) rotate(65) scale(1.7 1.28)`}),(0,R.jsx)(iE,{fill:dE,transform:`translate(48.4 33.8) rotate(110) scale(1.7 1.28)`})]}),write:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(dpe,{}),(0,R.jsx)(fpe,{})]}),run:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{style:{fill:uE},x:`6`,y:`9`,width:`52`,height:`43`,rx:`7`}),(0,R.jsx)(`path`,{style:{stroke:mE},strokeWidth:`5`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m17 22 9 8-9 8m17 0h12`})]}),connected:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,style:{stroke:uE},strokeWidth:`12`,strokeLinecap:`round`,d:`M34 37Q43 21 26 20H18Q3 20 6 37q2 10 15 9`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:lE},strokeWidth:`12`,strokeLinecap:`round`,d:`M29 33Q20 50 38 53h8q16-1 12-17-2-11-14-10`}),(0,R.jsx)(`path`,{style:{stroke:pE},strokeWidth:`4`,strokeLinecap:`round`,d:`m27 4 2 6m10-5-2 7m12 0-5 4`})]}),working:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ellipse`,{style:{fill:dE},cx:`23`,cy:`14`,rx:`13`,ry:`8`,transform:`rotate(-30 23 14)`}),(0,R.jsx)(`ellipse`,{style:{fill:pE},cx:`48`,cy:`36`,rx:`13`,ry:`8`,transform:`rotate(35 48 36)`}),(0,R.jsx)(`ellipse`,{style:{fill:fE},cx:`22`,cy:`48`,rx:`13`,ry:`8`,transform:`rotate(45 22 48)`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:rE},strokeWidth:`3`,strokeLinecap:`round`,d:`M42 8q13 2 13 13M43 55q-5 5-12 4M5 39q-5-9 1-17`})]}),complete:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{fill:dE},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:hE},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m23 29 7 7 13-15`}),(0,R.jsx)(`path`,{style:{stroke:rE},strokeWidth:`3`,strokeLinecap:`round`,d:`m4 8 5 6m48-4 5-5M2 24l6 1`})]}),installApps:(0,R.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,R.jsx)(`rect`,{style:{fill:uE},x:`9`,y:`26`,width:`46`,height:`32`,rx:`10`}),(0,R.jsx)(`rect`,{style:{fill:mE},x:`17`,y:`33`,width:`30`,height:`18`,rx:`5`}),(0,R.jsx)(`path`,{style:{fill:dE},d:`M22 38h8v8h-8z`}),(0,R.jsx)(`path`,{style:{fill:fE},d:`M34 38h8v8h-8z`}),(0,R.jsx)(`path`,{style:{stroke:lE},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M32 4v17m-8-7 8 8 8-8`})]}),restricted:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,style:{stroke:lE},strokeWidth:`9`,strokeLinecap:`round`,d:`M16 23V19q0-17 16-17t16 17v4`}),(0,R.jsx)(`rect`,{style:{fill:lE},x:`8`,y:`26`,width:`48`,height:`36`,rx:`9`}),(0,R.jsx)(`path`,{style:{fill:mE},d:`M32 34a7 7 0 0 0-4 13v7h8v-7a7 7 0 0 0-4-13Z`})]}),error:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{fill:lE},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:mE},strokeWidth:`7`,strokeLinecap:`round`,d:`M32 18v15`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`32`,cy:`45`,r:`4`})]}),trellis:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`g`,{fill:pE,children:[(0,R.jsx)(`rect`,{x:`17.25`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,R.jsx)(`rect`,{x:`42.95`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`18`,width:`3.2`,height:`26`}),(0,R.jsx)(`rect`,{x:`14.8`,y:`15.75`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,R.jsx)(`rect`,{x:`14.8`,y:`28.85`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,R.jsx)(`rect`,{x:`14.8`,y:`42.55`,width:`34.4`,height:`3.1`,rx:`1.55`})]}),(0,R.jsx)(`path`,{fill:`none`,stroke:dE,strokeWidth:`3`,strokeLinecap:`round`,d:`M21.9 56.1C31.5 54.4 32.9 47 32.1 45.8`}),(0,R.jsx)(`path`,{fill:`none`,stroke:dE,strokeWidth:`3`,strokeLinecap:`round`,d:`M32 44.2C28.7 41.8 25.2 35.7 32 32.3 38.8 28 38.9 24 31.9 18.8 32.4 16.3 32.8 14.7 34.5 12.2`}),(0,R.jsx)(cE,{transform:`translate(32.1 14.1) rotate(45) scale(0.45 0.86)`}),(0,R.jsx)(cE,{transform:`translate(32.2 14.7) rotate(-60) scale(0.42 0.58)`}),(0,R.jsx)(cE,{transform:`translate(34.8 28.3) rotate(65) scale(0.38 0.8)`}),(0,R.jsx)(cE,{transform:`translate(28.2 33.1) rotate(-51) scale(0.5 0.57)`}),(0,R.jsx)(cE,{transform:`translate(28.6 53.3) rotate(-48) scale(0.47 0.6)`}),(0,R.jsx)(`circle`,{fill:lE,cx:`31.9`,cy:`18.8`,r:`4`}),(0,R.jsx)(`circle`,{fill:uE,cx:`32`,cy:`32.3`,r:`4`}),(0,R.jsx)(`circle`,{fill:fE,cx:`32`,cy:`44.2`,r:`4`})]}),games:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:uE,d:`M18.5 28.5H45.5C49.5 29.5 53 32 54 35 55 37.5 56.8 45.5 56.6 48 56.5 53 52.5 57.5 47 58H15C9.5 56.5 6.6 51 7.6 45.5 8.6 39.5 9.3 35 10.5 33 12 31 14.5 29.5 18.5 28.5Z`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`26.8`,cy:`37.9`,rx:`9.1`,ry:`5.6`}),(0,R.jsx)(`ellipse`,{fill:hE,cx:`27`,cy:`37.6`,rx:`4.7`,ry:`2.2`}),(0,R.jsx)(`path`,{fill:hE,d:`M23.1 26V35.4A4 4.2 0 0 0 31.1 35.4V26Z`}),(0,R.jsx)(`circle`,{fill:lE,cx:`27.1`,cy:`18.3`,r:`12.4`}),(0,R.jsx)(`circle`,{fill:mE,cx:`22.6`,cy:`14.3`,r:`3.05`}),(0,R.jsx)(`ellipse`,{fill:pE,cx:`45.1`,cy:`37.2`,rx:`5.6`,ry:`3.95`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`40.1`,cy:`46.6`,rx:`6.2`,ry:`4.4`})]}),oyster:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:fE,d:`M35.5 6C33.7 6.3 32.3 7.6 31.4 9.4 30.9 10.3 30.4 10.3 29.5 10 25.5 9 20.6 11.6 19.6 15.9 19.4 16.6 19 17 18 17.1 14.5 17.6 12 20.6 12.1 24.2 12.2 25.4 12 25.9 11.5 26.5 7.5 30 10.5 34.5 17.5 34.4 15.3 32.6 16 31 19 29 26 24 37 19.5 43.5 19 46 19 46 22 43 25.5 46.5 23.5 51.5 18.5 53.5 15 55 11 50 7 45 9 43.8 9.4 43.3 9.2 42.5 8 40.7 6.3 38 5.6 35.5 6Z`}),(0,R.jsx)(`circle`,{fill:mE,cx:`34.9`,cy:`41.9`,r:`11.3`}),(0,R.jsxs)(`g`,{fill:hE,children:[(0,R.jsx)(`rect`,{x:`29.9`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`}),(0,R.jsx)(`rect`,{x:`36.7`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`})]}),(0,R.jsx)(`path`,{fill:fE,d:`M49.5 39C47.9 39.3 46.5 40 46.1 41.6 45.8 43.2 45.5 43.5 44 43.5 38.5 43.5 35 48 39 49.5 40 50 39.5 50.5 38 51 35.5 52.5 32.5 52 30 51 29 50.5 28.5 50 29.5 50 33 47.5 30 43.5 24.5 43.5 23.3 43.5 22.9 43.3 22.5 43 20.5 40.5 19 40 17.5 39.5 13 39.5 13 44 17 47.5 18.3 48.4 18.6 48.7 19 49.5 20.5 53 23 55 26 55 26.8 55 27 55.3 27.5 56 31 58.5 36.5 58.5 40 56 40.8 55.2 41.2 55 42 55 45 55 47.5 53 49 49.5 49.6 48.5 50 48 50.5 47.5 56 43.5 55 38.5 49.5 39Z`}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`3`,strokeLinecap:`round`,d:`M46.6 31.8 49.2 27.8 M49.4 35.5 52.8 33.7 M21.5 32.5 22.9 33.5 M19.3 37.5 21.1 38.1`})]}),tourtois:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:mE,x:`11.07`,y:`35.73`,width:`26.8`,height:`9.7`,rx:`3.25`,transform:`rotate(-5 24.47 40.58)`}),(0,R.jsx)(`path`,{fill:pE,d:`M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z`}),(0,R.jsx)(`path`,{fill:lE,d:`M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z`}),(0,R.jsx)(`path`,{fill:uE,d:`M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z`}),(0,R.jsx)(`path`,{fill:mE,d:`M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`circle`,{cx:`14.7`,cy:`18.45`,r:`1`}),(0,R.jsx)(`circle`,{cx:`17.6`,cy:`17.65`,r:`1`}),(0,R.jsx)(`circle`,{cx:`20.5`,cy:`16.85`,r:`1`}),(0,R.jsx)(`circle`,{cx:`17.9`,cy:`22.2`,r:`1`}),(0,R.jsx)(`circle`,{cx:`21`,cy:`21.5`,r:`1`}),(0,R.jsx)(`circle`,{cx:`24.1`,cy:`20.75`,r:`1`}),(0,R.jsx)(`circle`,{cx:`28.2`,cy:`25.3`,r:`1`})]}),(0,R.jsx)(`circle`,{fill:lE,cx:`21.7`,cy:`26.6`,r:`1`}),(0,R.jsx)(`circle`,{fill:pE,cx:`24.9`,cy:`25.9`,r:`1.05`}),(0,R.jsxs)(`g`,{fill:dE,children:[(0,R.jsx)(`ellipse`,{cx:`8.8`,cy:`36.6`,rx:`3.6`,ry:`1.9`,transform:`rotate(22 8.8 36.6)`}),(0,R.jsx)(`path`,{d:`M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.5L12 41Z`}),(0,R.jsx)(`path`,{d:`M40 33C39 38 36 42 34.5 41.5 32.5 40.5 29.5 42 28.5 44 26 49 27.5 51.5 32.5 51 36 51 37 50 36 46.5 36 45 37 44.5 38 44.5 38.5 45.5 40.5 49 43.5 50 46.5 47.5 47.5 46.5 46 43.5 44 42 43 41.5 43.5 40.5 44.5 39.5 46 38 47 37.5L47 33Z`})]}),(0,R.jsx)(`ellipse`,{fill:dE,cx:`46.4`,cy:`30.6`,rx:`8.1`,ry:`8.3`}),(0,R.jsxs)(`g`,{fill:hE,children:[(0,R.jsx)(`rect`,{x:`45.05`,y:`26.95`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 46.2 29.3)`}),(0,R.jsx)(`rect`,{x:`49.25`,y:`26.4`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 50.4 28.7)`})]}),(0,R.jsx)(`path`,{fill:lE,d:`M46.8 32.2H51C51 34.3 50 35.4 48.9 35.4S46.8 34.3 46.8 32.2Z`,transform:`rotate(-8 48.9 33.5)`}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`3`,strokeLinecap:`round`,d:`M50.9 17.7 50.5 19.7 M55.2 20.1 53.4 21.9 M56.5 24.5 55.7 24.7`})]}),allApps:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:lE,x:`7`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 18.6 18.6)`}),(0,R.jsx)(`rect`,{fill:uE,x:`33.9`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 45.5 18.6)`}),(0,R.jsx)(`rect`,{fill:dE,x:`7`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 18.6 45.5)`}),(0,R.jsx)(`rect`,{fill:pE,x:`33.9`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 45.5 45.5)`})]}),search:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,stroke:uE,strokeWidth:`6.5`,d:`M37 37.5 43 43.5`}),(0,R.jsx)(`path`,{fill:`none`,stroke:lE,strokeWidth:`12.6`,strokeLinecap:`round`,d:`M44.2 43.8 51.4 51.8`}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`3`,strokeLinecap:`round`,d:`M47.2 42.4 52.8 47.8`}),(0,R.jsx)(`ellipse`,{fill:uE,cx:`25.6`,cy:`24.6`,rx:`19.25`,ry:`18.6`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`25.2`,cy:`24.1`,rx:`14.2`,ry:`13.6`})]}),browser:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:lE,x:`5.9`,y:`6.15`,width:`52.2`,height:`51.7`,rx:`5.5`}),(0,R.jsx)(`path`,{fill:mE,d:`M10 16.5H29.4C30.3 16.1 31 14.4 31.8 12.5 32.5 10.9 33.2 10 34.5 10H52.2C53.4 10 54 10.7 54 12V16.5C55.2 16.5 56 17.1 56 18.3V52.4C56 53.7 55.1 54.6 53.8 54.6H10.2C8.9 54.6 8 53.7 8 52.4V18.2C8 17.1 8.7 16.5 10 16.5Z`}),(0,R.jsx)(`circle`,{fill:pE,cx:`12.2`,cy:`11.9`,r:`1.95`}),(0,R.jsx)(`circle`,{fill:uE,cx:`18.6`,cy:`11.9`,r:`1.95`}),(0,R.jsx)(`circle`,{fill:fE,cx:`25.1`,cy:`11.9`,r:`1.95`}),(0,R.jsx)(`circle`,{fill:dE,cx:`32`,cy:`34.9`,r:`14.5`}),(0,R.jsxs)(`g`,{fill:`none`,stroke:mE,strokeWidth:`3`,children:[(0,R.jsx)(`ellipse`,{cx:`32`,cy:`34.9`,rx:`7.7`,ry:`13.3`}),(0,R.jsx)(`path`,{d:`M17.5 34.9H46.5`})]})]}),internet:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ellipse`,{fill:`none`,stroke:pE,strokeWidth:`4.4`,cx:`32.2`,cy:`30.2`,rx:`25.6`,ry:`8.1`,transform:`rotate(-20.8 32.2 30.2)`}),(0,R.jsx)(`circle`,{fill:uE,cx:`32`,cy:`32`,r:`21.1`}),(0,R.jsxs)(`g`,{fill:`none`,stroke:mE,strokeWidth:`3`,children:[(0,R.jsx)(`ellipse`,{cx:`32`,cy:`31.8`,rx:`12.2`,ry:`18.7`}),(0,R.jsx)(`path`,{d:`M32 13.1V50.5M15 20.4Q32 29 49 20.4M12.5 39Q32 44.6 51.5 39`})]}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`4.4`,d:`M6.6 30.2A25.6 8.1 0 0 0 57.8 30.2`,transform:`rotate(-20.8 32.2 30.2)`})]}),members:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`circle`,{fill:uE,cx:`41.9`,cy:`22.85`,r:`12.2`}),(0,R.jsx)(`path`,{fill:uE,d:`M36 34C33.8 34.8 32.2 35.8 31 37 37.5 39.5 40.5 43.5 40.5 49.5V53.5H54.5C57 53.5 58 51 58 47.5 58 40 55 35.5 49 34Z`}),(0,R.jsx)(`circle`,{fill:lE,cx:`22.95`,cy:`27.6`,r:`12.85`}),(0,R.jsx)(`path`,{fill:lE,d:`M15.5 38C10.5 39 7.5 42.5 6.5 47 5.5 50.5 6 53.5 8.5 53.5H38.5C42 52 40 43 36 40 34.5 39 32 38 31 38Z`}),(0,R.jsxs)(`g`,{fill:hE,children:[(0,R.jsx)(`circle`,{cx:`18.3`,cy:`28`,r:`1.6`}),(0,R.jsx)(`circle`,{cx:`27.9`,cy:`28`,r:`1.6`}),(0,R.jsx)(`circle`,{cx:`39.1`,cy:`23.05`,r:`1.55`}),(0,R.jsx)(`circle`,{cx:`47.25`,cy:`23.05`,r:`1.55`})]})]}),sell:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:pE,d:`M6.4 41.2V48.4C6.4 51.4 13.2 54 21.8 54S37.2 51.4 37.2 48.4V41.2C37.2 37.8 30.4 35 21.8 35S6.4 37.8 6.4 41.2Z`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`21.9`,cy:`40.8`,rx:`13.2`,ry:`3.6`}),(0,R.jsxs)(`g`,{transform:`rotate(-3 22.5 30) translate(0.5 0)`,children:[(0,R.jsx)(`path`,{fill:pE,d:`M7.5 26V34C7.5 37.3 14.2 40 22.5 40S37.5 37.3 37.5 34V26C37.5 22.7 30.8 20 22.5 20S7.5 22.7 7.5 26Z`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`23.7`,cy:`26.55`,rx:`13.05`,ry:`4.4`})]}),(0,R.jsxs)(`g`,{transform:`translate(46.3 40.3) rotate(-25)`,children:[(0,R.jsx)(`path`,{fill:lE,d:`M-8.5-10Q-8.5-12-7-13L-1.5-16.3Q0-17.2 1.5-16.3L7-13Q8.5-12 8.5-10V9Q8.5 12 5.5 12H-5.5Q-8.5 12-8.5 9Z`}),(0,R.jsx)(`circle`,{fill:mE,cx:`0`,cy:`-10.7`,r:`2.2`})]}),(0,R.jsx)(iE,{fill:pE,transform:`translate(38.2 18.6) scale(1.1 .86)`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(42.8 21.2) rotate(45) scale(1.1 .85)`})]}),schedule:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:mE,x:`6`,y:`11`,width:`47.6`,height:`44`,rx:`6`}),(0,R.jsx)(`path`,{fill:lE,d:`M12 11H47.6Q53.6 11 53.6 17V21.5H6V17Q6 11 12 11Z`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`circle`,{cx:`16.1`,cy:`16.15`,r:`3.4`}),(0,R.jsx)(`circle`,{cx:`43.4`,cy:`16.15`,r:`3.4`})]}),(0,R.jsxs)(`g`,{fill:uE,children:[(0,R.jsx)(`rect`,{x:`13.6`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`}),(0,R.jsx)(`rect`,{x:`40.9`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`})]}),(0,R.jsxs)(`g`,{fill:dE,children:[(0,R.jsx)(`rect`,{x:`11.1`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`20.7`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`20.7`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`11.1`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,R.jsxs)(`g`,{fill:fE,children:[(0,R.jsx)(`rect`,{x:`40.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`11.1`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`20.7`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,R.jsx)(`circle`,{fill:pE,cx:`45.5`,cy:`45.6`,r:`12.2`}),(0,R.jsx)(`path`,{fill:`none`,stroke:hE,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M45.1 39.3V46.2L51.3 49.8`}),(0,R.jsx)(`circle`,{fill:hE,cx:`45.1`,cy:`46.2`,r:`2.5`})]}),loop:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{stroke:lE},strokeWidth:`6`,strokeLinecap:`round`,d:`M47.5 14.5C43 11 37.5 9 32 9 19.5 9 9 19.5 9 32S19.5 55 32 55 55 44.5 55 32`}),(0,R.jsx)(`path`,{style:{fill:lE},d:`M53.5 21.5Q54.5 20 55 22L58 33Q58.5 35 56.5 34.5L48.5 32.5Q47 32 48 30.5Z`}),(0,R.jsx)(`g`,{transform:`translate(18 21) scale(.28)`,children:(0,R.jsx)(oE,{fill:uE})}),(0,R.jsxs)(`g`,{style:{fill:mE},children:[(0,R.jsx)(`rect`,{x:`25`,y:`27.5`,width:`14`,height:`3`,rx:`1.5`}),(0,R.jsx)(`rect`,{x:`25`,y:`33.5`,width:`9`,height:`3`,rx:`1.5`})]})]}),fungi:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ellipse`,{fill:mE,cx:`33.5`,cy:`43.6`,rx:`18.6`,ry:`14.4`,transform:`rotate(-6 33.5 43.6)`}),(0,R.jsx)(`path`,{fill:lE,d:`M29.5 6.5C22 7.5 16 11 11 18.5 4 29 4.6 39.6 13.5 42.2 24 45 44 40.5 54 34.6 57.6 32.6 58.6 29.2 57.5 25 56.5 20 53 16 48.5 13 43.5 8 37 5.5 29.5 6.5Z`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`ellipse`,{cx:`29`,cy:`15.7`,rx:`8.7`,ry:`6.3`,transform:`rotate(-15.5 29 15.7)`}),(0,R.jsx)(`ellipse`,{cx:`50.8`,cy:`20.1`,rx:`6.5`,ry:`3.5`,transform:`rotate(51.6 50.8 20.1)`}),(0,R.jsx)(`ellipse`,{cx:`13`,cy:`26.8`,rx:`4.2`,ry:`3.3`,transform:`rotate(-54.5 13 26.8)`})]}),(0,R.jsxs)(`g`,{fill:hE,transform:`translate(26.6 46.6) scale(1.1) translate(-33.7 -38.5)`,children:[(0,R.jsx)(`rect`,{x:`31.85`,y:`35.9`,width:`3.75`,height:`5.25`,rx:`1.85`}),(0,R.jsx)(`path`,{d:`M 47.4 34.3 C 46 35 44.6 35.8 43.5 36.7 42.9 37.2 43.2 38.3 44 38.4 45.2 38.6 46.5 38.6 47.7 38.4 48.4 38.3 48.3 37.3 47.6 37.3 46.6 37.4 45.7 37.4 45 37.3 45.9 36.7 46.9 36.1 48 35.6 48.7 35.3 48.2 34 47.4 34.3 Z`}),(0,R.jsx)(`path`,{d:`M 37.4 41.1 C 38.6 44.3 42.6 44.3 43.6 40.5 43.7 40 43.1 39.8 42.9 40.3 41.9 42.8 39.1 42.9 38.3 40.7 38.1 40.2 37.3 40.5 37.4 41.1 Z`})]})]})};function gE({name:e,size:t}){return(0,R.jsx)(`svg`,{viewBox:`0 0 64 64`,width:t,height:t,fill:`none`,stroke:`none`,"aria-hidden":`true`,focusable:`false`,"data-sigil":e,children:vpe[e]})}var ype=[{id:`list`,label:`List files`,contract:fue},{id:`read`,label:`Read files`,contract:xue},{id:`write`,label:`Write files`,contract:Sue},{id:`run`,label:`Run commands`,contract:wS}],bpe={loading:`Loading`,unavailable:`Unavailable`,error:`Refresh failed`};function xpe({app:e,terminal:t=null,processes:n,ports:r}){let[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),c=async()=>{if(e){a(!0),s(!1);try{await e.ui.requestAppPermissions({})}catch{s(!0)}finally{a(!1)}}};return{id:`access`,label:`Access`,title:`Computer access`,content:(0,R.jsxs)(`div`,{className:`shed-instrument`,children:[(0,R.jsxs)(eE,{size:`sm`,children:[(0,R.jsx)(ipe,{icon:(0,R.jsx)(gE,{name:`computer`}),title:t?.name??`Selected Computer`,status:t?(0,R.jsx)(QT,{size:`compact`,label:`Terminal ${t.state}`,tone:t.state===`open`?`success`:t.state===`failed`?`error`:`neutral`}):null}),(0,R.jsxs)(ape,{children:[(0,R.jsx)(tE,{legend:`Shed may`,wide:!0,children:(0,R.jsx)(tpe,{"aria-label":`Shed may`,stateLabels:[`allowed`,`not allowed`],items:ype.map(({id:t,label:n,contract:r})=>({id:t,label:n,caption:t,icon:(0,R.jsx)(gE,{name:t}),on:e?.capabilities.has(r)===!0}))})}),(0,R.jsx)(_E,{label:`Processes`,value:n}),(0,R.jsx)(_E,{label:`Ports open`,value:r})]})]}),e?(0,R.jsx)(`div`,{className:`shed-instrument-keys`,children:(0,R.jsx)(zT,{size:`sm`,variant:`ghost`,disabled:i,onClick:()=>void c(),children:i?`Opening permissions…`:`App permissions…`})}):null,o?(0,R.jsx)(`p`,{role:`alert`,className:`shed-instrument-detail`,children:`Could not open App permissions. Try again.`}):null]})}}function _E({label:e,value:t}){return(0,R.jsx)(tE,{legend:e,role:`group`,"aria-label":e,children:t.kind===`loaded`?(0,R.jsx)(qfe,{value:t.count,pad:2,size:`md`}):(0,R.jsx)(`span`,{className:`shed-instrument-note`,children:bpe[t.kind]})})}var Spe={2:`h2`,3:`h3`,4:`h4`};function Cpe(e,t){let{reduced:n}=t,r=e&&!n,i=pC(t,600),[a,o]=(0,F.useState)(r);return(0,F.useEffect)(()=>{if(o(r),!r)return;let e=globalThis.setTimeout(()=>{o(!1)},i);return()=>{globalThis.clearTimeout(e)}},[r,i]),a}var wpe=(0,R.jsx)(LT,{decorative:!0,pace:`idle`,size:`md`,tone:`primary`,variant:`wander`}),vE=(0,F.forwardRef)(function({actions:e,className:t,description:n,headingLevel:r=2,primaryAction:i,suggestions:a,thinking:o=!1,title:s,visual:c,renderVisual:l,variant:u=`plain`,...d},f){let p=(0,F.useId)(),m=(0,F.useRef)(null),h=fC(m),g=Cpe(u===`speech`,h)&&!o,_=Spe[r],v=c??(u===`panel`?`blobs`:void 0),y=l?l({speaking:g,thinking:o}):v===`blobs`?wpe:v,b=`${p}-reason`,x=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(_,{ref:m,className:`empty-state-title`,id:d[`aria-labelledby`]?void 0:p,children:s}),(0,R.jsx)(`p`,{children:n}),i?(0,R.jsxs)(`div`,{className:`empty-state-primary`,children:[(0,R.jsx)(zT,{"aria-describedby":i.disabled&&i.disabledReason?b:void 0,disabled:i.disabled,loading:i.pending===!0,onClick:i.onSelect,variant:`primary`,children:i.label}),i.disabled&&i.disabledReason?(0,R.jsx)(`span`,{className:`empty-state-reason`,id:b,children:i.disabledReason}):null]}):null,a&&a.length>0?(0,R.jsx)(`ul`,{"aria-label":`Try one of these`,className:`empty-state-suggestions`,children:a.map((e,t)=>(0,R.jsx)(`li`,{children:(0,R.jsx)(zT,{disabled:e.disabled,loading:e.pending===!0,size:`sm`,variant:`outline`,onClick:e.onSelect,children:e.label})},`${String(t)}:${e.label}`))}):null,e?(0,R.jsx)(`div`,{className:`empty-state-actions`,children:e}):null]});return(0,R.jsxs)(`section`,{...d,"aria-labelledby":d[`aria-labelledby`]??p,className:cC(`empty-state`,u!==`plain`&&`empty-state-${u}`,t),ref:f,children:[y?(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`empty-state-visual`,children:y}):null,u===`speech`?(0,R.jsx)(`div`,{className:`empty-state-bubble`,children:x}):x]})}),Tpe=(0,F.forwardRef)(function({className:e,orientation:t,variant:n=`grip`,value:r,min:i,max:a,onValueChange:o,onKeyDown:s,...c},l){return(0,R.jsx)(`div`,{...c,ref:l,className:cC(`caps-resize-handle`,e),"data-resize-variant":n,role:`separator`,"aria-orientation":t,"aria-valuemin":Math.round(i),"aria-valuemax":Math.round(a),"aria-valuenow":Math.round(r),tabIndex:c.tabIndex??0,onKeyDown:e=>{if(s?.(e),e.defaultPrevented)return;if(e.key===`Home`||e.key===`End`){e.preventDefault(),o(e.key===`Home`?i:a);return}let n=t===`horizontal`?e.key===`ArrowUp`?-32:e.key===`ArrowDown`?32:null:e.key===`ArrowLeft`?-32:e.key===`ArrowRight`?32:null;n!==null&&(e.preventDefault(),o(Math.min(a,Math.max(i,r+n))))},children:(0,R.jsx)(`span`,{className:`caps-resize-grip`,"aria-hidden":`true`})})});function yE(e){return`init`in e}function bE(e){return typeof e.write==`function`}function Epe(e){return!!e.onMount}function xE(e){return`v`in e||`e`in e}function SE(e){if(`e`in e)throw e.e;return e.v}function CE(e){return typeof e?.then==`function`}function wE(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function TE(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function EE(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function DE(e){return!!e.INTERNAL_onInit}var OE=(e,t,n,...r)=>n.read(...r),kE=(e,t,n,...r)=>n.write(...r),AE=(e,t,n)=>n.INTERNAL_onInit(t),jE=(e,t,n,r)=>n.onMount?.call(n,r),ME=(e,t,n)=>{var r;let i=e[0],a=i.get(n);if(!a){let o=e[6],s=e[9];a={d:new Map,p:new Set,n:0},i.set(n,a),(r=o.i)==null||r.call(o,n),DE(n)&&s(e,t,n)}return a},NE=(e,t)=>{let n=e[1],r=e[3],i=e[4],a=e[5],o=e[6],s=e[13];if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},PE=(e,t)=>{let n=e[1],r=e[2],i=e[3],a=e[11],o=e[14],s=e[17];if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o)){f.pop(),p.pop();continue}if(u.has(o)){r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();continue}u.add(o);for(let r of EE(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},FE=(e,t,n)=>{var r,i;let a=e[1],o=e[2],s=e[3],c=e[6],l=e[7],u=e[11],d=e[12],f=e[13],p=e[14],m=e[16],h=e[17],g=e[20],_=e[26],v=e[28],y=u(e,t,n),b=v[0];if(xE(y)){if(a.has(n)&&o.get(n)!==y.n||y.m===b)return y.m=b,y;let r=!1;for(let[n,i]of y.d)if(p(e,t,n).n!==i){r=!0;break}if(!r)return y.m=b,y}let x=!0,S=new Set(y.d.keys()),C=()=>{for(let e of S)y.d.delete(e)},w=()=>{if(a.has(n)){let r=!s.size;h(e,t,n),r&&(f(e,t),d(e,t))}},T=r=>{var i;if(r===n){let n=u(e,t,r);if(!xE(n)){if(yE(r))g(e,t,r,r.init);else throw Error(`no atom init`)}return SE(n)}let o=p(e,t,r);try{return SE(o)}finally{S.delete(r),y.d.set(r,o.n),CE(y.v)&&TE(n,y.v,o),a.has(n)&&((i=a.get(r))==null||i.t.add(n)),x||w()}},E,D,O={get signal(){return E||=new AbortController,E.signal},get setSelf(){return!D&&bE(n)&&(D=(...r)=>{if(!x)try{return m(e,t,n,r)}finally{f(e,t),d(e,t)}}),D}},k=y.n,A=o.get(n)===k;try{let i=l(e,t,n,T,O);if(g(e,t,n,i),CE(i)){_(e,t,i,()=>E?.abort());let n=()=>{C(),w()};i.then(n,n)}else C();return(r=c.r)==null||r.call(c,n),y.m=b,y}catch(e){if(wE(e))throw e;return delete y.v,y.e=e,++y.n,y.m=b,y}finally{x=!1,y.n!==k&&A&&(o.set(n,y.n),s.add(n),(i=c.c)==null||i.call(c,n))}},IE=(e,t,n)=>{let r=e[1],i=e[2],a=e[11],o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of EE(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},LE=(e,t,n,r)=>{let i=e[3],a=e[6],o=e[8],s=e[11],c=e[12],l=e[13],u=e[14],d=e[15],f=e[16],p=e[17],m=e[20],h=e[28],g=!0,_=n=>SE(u(e,t,n)),v=(r,...o)=>{var u;let _=s(e,t,r);try{if(r===n){if(!yE(r))throw Error(`atom not writable`);let n=_.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==_.n&&(++h[0],i.add(r),d(e,t,r),(u=a.c)==null||u.call(a,r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},RE=(e,t,n)=>{var r;let i=e[1],a=e[3],o=e[6],s=e[11],c=e[15],l=e[18],u=e[19],d=s(e,t,n),f=i.get(n);if(f&&d.d.size>0){for(let[i,u]of d.d)if(!f.d.has(i)){let d=s(e,t,i);l(e,t,i).t.add(n),f.d.add(i),u!==d.n&&(a.add(i),c(e,t,i),(r=o.c)==null||r.call(o,i))}for(let r of f.d)d.d.has(r)||(f.d.delete(r),u(e,t,r)?.t.delete(n))}},zE=(e,t,n)=>{var r;let i=e[1],a=e[4],o=e[6],s=e[10],c=e[11],l=e[12],u=e[13],d=e[14],f=e[16],p=e[18],m=c(e,t,n),h=i.get(n);if(!h){d(e,t,n);for(let r of m.d.keys())p(e,t,r).t.add(n);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(n,h),bE(n)&&Epe(n)&&a.add(()=>{let r=!0,i=(...i)=>{try{return f(e,t,n,i)}finally{r||(u(e,t),l(e,t))}};try{let a=s(e,t,n,i);a&&(h.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),(r=o.m)==null||r.call(o,n)}return h},BE=(e,t,n)=>{var r;let i=e[1],a=e[5],o=e[6],s=e[11],c=e[19],l=s(e,t,n),u=i.get(n);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(n)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(n);for(let r of l.d.keys())c(e,t,r)?.t.delete(n);(r=o.u)==null||r.call(o,n);return}return u},VE=(e,t,n,r)=>{let i=e[11],a=e[27],o=i(e,t,n),s=`v`in o,c=o.v;if(CE(r))for(let a of o.d.keys())TE(n,r,i(e,t,a));o.v=r,delete o.e,(!s||!Object.is(c,o.v))&&(++o.n,CE(c)&&a(e,t,c))},HE=(e,t,n)=>{let r=e[14];return SE(r(e,t,n))},UE=(e,t,n,...r)=>{let i=e[3],a=e[12],o=e[13],s=e[16],c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},WE=(e,t,n,r)=>{let i=e[12],a=e[13],o=e[18],s=e[19],c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},GE=(e,t,n,r)=>{let i=e[25],a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},KE=(e,t,n)=>{e[25].get(n)?.forEach(e=>e())},qE=new WeakMap;function JE(...e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},OE,kE,AE,jE,ME,NE,PE,FE,IE,LE,RE,zE,BE,VE,HE,UE,WE,void 0,new WeakMap,GE,KE,[0]].map((t,n)=>e[n]||t);qE.set(t,Object.freeze(n));let r=n[21],i=n[22],a=n[23];return t}var YE=0;function XE(e,t){let n=`atom${++YE}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=ZE,r.write=QE),t&&(r.write=t),r}function ZE(e){return e(this)}function QE(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}function $E(){return JE()}var eD=XE({frames:new Map,order:[],tiles:[],minima:new Map,participating:new Set,mainSize:void 0,zoomed:null,gesture:null,restore:new Map}),tD=(e,t,n)=>Math.min(Math.max(e,t),n),nD=(e,t,n)=>{let r=tD(e.width,n.width,Math.max(n.width,t.width)),i=tD(e.height,n.height,Math.max(n.height,t.height));return{width:r,height:i,x:tD(e.x,0,Math.max(0,t.width-r)),y:tD(e.y,0,Math.max(0,t.height-i))}},rD=(e,t,n)=>{let r=t.width/2,i=t.height/2;return nD(e===`left`?{x:0,y:0,width:r,height:t.height}:e===`right`?{x:r,y:0,width:r,height:t.height}:e===`top-left`?{x:0,y:0,width:r,height:i}:e===`top-right`?{x:r,y:0,width:r,height:i}:e===`bottom-left`?{x:0,y:i,width:r,height:i}:{x:r,y:i,width:r,height:i},t,n)},iD=()=>{let e=$E(),t=()=>e.get(eD),n=0,r=r=>{n+=1,e.set(eD,r(t()))},i=(e,t,n)=>{r(r=>{let i=new Map(r.frames);return i.set(e,t),{...r,frames:i,participating:new Set(r.participating).add(e),tiles:r.tiles.includes(e)?r.tiles:[...r.tiles,e],minima:new Map(r.minima).set(e,n),order:r.order.includes(e)?r.order:[...r.order.filter(e=>e!==r.zoomed),e,...r.zoomed?[r.zoomed]:[]]}})},a=e=>t().frames.has(e),o=(e,n)=>{let r=t().gesture;return r?.kind===`frame`&&r.id===e&&r.pointerId===n};return{get version(){return n},get frames(){return t().frames},get order(){return t().order},get tiles(){return t().tiles},get minima(){return t().minima},get participating(){return t().participating},get mainSize(){return t().mainSize},get zoomed(){return t().zoomed},get gesture(){return t().gesture},get restore(){return t().restore},subscribe:t=>e.sub(eD,t),register:i,setParticipation:(e,n)=>{t().frames.has(e)&&r(t=>{if(t.participating.has(e)===n)return t;let r=new Set(t.participating);n?r.add(e):r.delete(e);let i=n?t.tiles.includes(e)?t.tiles:[...t.tiles,e]:t.tiles.filter(t=>t!==e),a=n?t.order.includes(e)?t.order:[...t.order,e]:t.order.filter(t=>t!==e);return{...t,participating:r,tiles:i,order:a,zoomed:n||t.zoomed!==e?t.zoomed:null,gesture:!n&&t.gesture?.kind===`frame`&&t.gesture.id===e?null:t.gesture}})},setMinima:(e,n)=>{let i=t().minima.get(e);!i||i.width===n.width&&i.height===n.height||r(t=>({...t,minima:new Map(t.minima).set(e,n)}))},unregister:e=>{r(t=>{if(!t.frames.has(e))return t;let n=new Map(t.frames);n.delete(e);let r=new Map(t.restore);r.delete(e);let i=t.order.filter(t=>t!==e),a=t.tiles.filter(t=>t!==e),o=new Map(t.minima);o.delete(e);let s=new Set(t.participating);s.delete(e);let c=t.gesture?.kind===`frame`&&t.gesture.id===e?null:t.gesture;return{...t,frames:n,restore:r,order:i,tiles:a,minima:o,participating:s,gesture:c,zoomed:t.zoomed===e?null:t.zoomed}})},begin:(e,n)=>{!a(e)||!t().participating.has(e)||r(t=>({...t,gesture:{kind:`frame`,id:e,pointerId:n,start:t.frames.get(e)??{x:0,y:0,width:0,height:0}},order:[...t.order.filter(t=>t!==e),e]}))},move:(e,n,i,s,c,l=null)=>{a(e)&&t().participating.has(e)&&o(e,n)&&r(t=>({...t,frames:new Map(t.frames).set(e,nD(i,s,c)),gesture:t.gesture?.kind===`frame`?{...t.gesture,snap:l?{side:l,frame:rD(l,s,c)}:null}:t.gesture}))},end:(e,t)=>{o(e,t)&&r(t=>{let n=t.gesture;return n?.kind!==`frame`||!n.snap?{...t,gesture:null}:{...t,frames:new Map(t.frames).set(e,n.snap.frame),restore:new Map(t.restore).set(e,t.restore.get(e)??n.start),gesture:null}})},cancel:(e,n)=>{let i=t().gesture;i?.kind===`frame`&&i.id===e&&i.pointerId===n&&r(t=>{let n=new Map(t.frames);return n.set(e,i.start),{...t,frames:n,gesture:null}})},snap:(e,n,i,o)=>{!a(e)||!t().participating.has(e)||r(t=>{let r=new Map(t.restore);r.set(e,t.frames.get(e)??rD(n,i,o));let a=new Map(t.frames);return a.set(e,rD(n,i,o)),{...t,frames:a,restore:r,order:[...t.order.filter(t=>t!==e),e]}})},restoreFrame:(e,n,i)=>{!a(e)||!t().participating.has(e)||r(t=>{let r=t.restore.get(e);if(!r)return t;let a=new Map(t.frames);a.set(e,nD(r,n,i));let o=new Map(t.restore);return o.delete(e),{...t,frames:a,restore:o}})},focus:e=>{a(e)&&r(t=>({...t,order:[...t.order.filter(t=>t!==e),e],zoomed:t.zoomed===null?null:e}))},swap:(e,n)=>{!a(e)||!a(n)||!t().participating.has(e)||!t().participating.has(n)||r(t=>({...t,tiles:t.tiles.map(t=>t===e?n:t===n?e:t)}))},zoom:e=>{e!==null&&(!a(e)||!t().participating.has(e))||r(t=>({...t,zoomed:e,order:e===null?t.order:[...t.order.filter(t=>t!==e),e]}))},resizeMain:e=>{r(t=>({...t,mainSize:e}))},beginDivider:e=>!t().gesture&&(r(t=>({...t,gesture:{kind:`divider`,pointerId:e,start:t.mainSize}})),!0),finishDivider:(e,n)=>{let i=t().gesture;i?.kind===`divider`&&i.pointerId===e&&r(e=>({...e,gesture:null,mainSize:n?i.start:e.mainSize}))},destroy:()=>{r(e=>({...e,gesture:null,restore:new Map}))}}};function aD(e,t,n,r,i){let a=i.layout??`main-left`;if(a===`columns`||a===`rows`||a===`grid`)return oD(e,t,n,r,i,a);if(a===`main-top`){let a=sD(e,new Map([...t].map(([e,t])=>[e,{width:t.height,height:t.width}])),n,{width:r.height,height:r.width},i);return{frames:new Map([...a.frames].map(([e,t])=>[e,{x:t.y,y:t.x,width:t.height,height:t.width}])),tabGroups:a.tabGroups,divider:a.divider&&{...a.divider,axis:`y`}}}return sD(e,t,n,r,i)}function oD(e,t,n,r,i,a){let o=new Map,s=[];if(!e.length)return{frames:o,tabGroups:s,divider:null};let c=Math.max(0,i.gap??8),l=e.reduce((e,n)=>({width:Math.max(e.width,t.get(n)?.width??0),height:Math.max(e.height,t.get(n)?.height??0)}),{width:0,height:0}),u=(t,n)=>n+c===0?e.length:Math.min(e.length,Math.max(1,Math.floor((t+c)/(n+c)))),d=u(r.width,l.width),f=u(r.height,l.height),p=l.width>r.width||l.height>r.height?1:a===`columns`?d:a===`rows`?f:Math.min(e.length,d*f),m=a===`columns`?p:a===`rows`?1:Math.min(d,Math.max(Math.ceil(Math.sqrt(p)),Math.ceil(p/f))),h=Math.ceil(p/m),g=(r.width-c*(m-1))/m,_=(r.height-c*(h-1))/h;for(let t=0;t<p;t++){let r=e.slice(t,t===p-1?void 0:t+1),i=r.length===1?r[0]:[...n].reverse().find(e=>r.includes(e))??r[0];i&&o.set(i,{x:t%m*(g+c),y:Math.floor(t/m)*(_+c),width:g,height:_}),r.length>1&&s.push(r)}return{frames:o,tabGroups:s,divider:null}}function sD(e,t,n,r,i){let a=new Map,o=[],s={x:0,y:0,...r},[c,...l]=e,u=(e,t)=>{let r=[...n].reverse().find(t=>e.includes(t))??e[0];r&&a.set(r,t),e.length>1&&o.push(e)};if(!c)return{frames:a,tabGroups:o,divider:null};if(!l.length)return a.set(c,s),{frames:a,tabGroups:o,divider:null};let d=Math.max(0,i.gap??8),f=t.get(c)?.width??0,p=Math.max(...l.map(e=>t.get(e)?.width??0)),m=r.width-d-p;if(f>m)return u([...e],s),{frames:a,tabGroups:o,divider:null};let h=Math.min(m,Math.max(f,i.mainSize??r.width/2)),g={axis:`x`,position:h,min:f,max:m};a.set(c,{...s,width:h});let _={...s,x:h+d,width:r.width-h-d},v=l.map(e=>t.get(e)?.height??0).reduce((e,t)=>e+t,0)+d*(l.length-1);if(v>r.height)u(l,_);else{let e=(r.height-v)/l.length,n=0;for(let r of l){let i=(t.get(r)?.height??0)+e;a.set(r,{..._,y:n,height:i}),n+=i+d}}return{frames:a,tabGroups:o,divider:g}}function cD(e,t=!0,n){let r=(0,F.useRef)(e);r.current=e;let i=(0,F.useRef)(null);return(0,F.useEffect)(()=>(t||i.current?.release(!0),()=>i.current?.release(!0)),[t]),(0,F.useEffect)(()=>{let e=()=>{i.current?.release(!0)};return n?.addEventListener(`abort`,e),()=>{n?.removeEventListener(`abort`,e)}},[n]),{onPointerDown:e=>{if(!t||n?.aborted||i.current||e.pointerType===`mouse`&&e.button!==0)return;let{currentTarget:a,pointerId:o}=e;if(a.setPointerCapture(o),!r.current.begin(e)){a.releasePointerCapture(o);return}let s=r.current.end,c=()=>{l(!0)},l=e=>{a.removeEventListener(`lostpointercapture`,c),i.current=null,s(e),a.hasPointerCapture(o)&&a.releasePointerCapture(o)};i.current={id:o,element:a,x:e.clientX,y:e.clientY,release:l},a.addEventListener(`lostpointercapture`,c)},onPointerMove:e=>{let t=i.current;t?.id===e.pointerId&&(r.current.move(e.clientX-t.x,e.clientY-t.y,e),t.x=e.clientX,t.y=e.clientY)},onPointerUp:e=>{i.current?.id===e.pointerId&&i.current.release(!1)},onPointerCancel:e=>{i.current?.id===e.pointerId&&i.current.release(!0)}}}function lD(e,t){return e.x<20?e.y<20?`top-left`:e.y>t.height-20?`bottom-left`:`left`:e.x>t.width-20?e.y<20?`top-right`:e.y>t.height-20?`bottom-right`:`right`:null}var uD=(0,F.createContext)(null);function dD({bounds:e,tiling:t,containerRef:n,children:r}){let i=(0,F.useMemo)(iD,[]);(0,F.useSyncExternalStore)(i.subscribe,()=>i.version,()=>i.version),(0,F.useEffect)(()=>()=>{i.destroy()},[i]);let a={...t};i.mainSize!==void 0&&(a.mainSize=i.mainSize);let o=t?aD(i.tiles,i.minima,i.order,e,a):{frames:new Map([...i.frames].filter(([e])=>i.participating.has(e)).map(([t,n])=>[t,nD(n,e,i.minima.get(t)??{width:0,height:0})])),tabGroups:[],divider:null};return i.zoomed&&i.participating.has(i.zoomed)&&(o.frames=new Map([[i.zoomed,{x:0,y:0,...e}]]),o.divider=null,o.tabGroups=[]),(0,R.jsx)(uD.Provider,{value:{state:i,bounds:e,tiled:t!==void 0,arrangement:o,containerRef:n},children:r})}function fD(){let e=(0,F.useContext)(uD);if(!e)throw Error(`Maosaico hooks must be used within MaosaicoRoot`);return e}function pD(){let{state:e,arrangement:t,tiled:n,bounds:r}=fD(),i=e.tiles,a=(0,F.useRef)({pointer:0,position:0}),o=t.divider,s=cD({begin:t=>!o||!e.beginDivider(t.pointerId)?!1:(a.current={pointer:t.pointerId,position:o.position},!0),move:(t,n)=>{o&&(a.current.position=Math.min(o.max,Math.max(o.min,a.current.position+(o.axis===`x`?t:n))),e.resizeMain(a.current.position))},end:t=>{e.finishDivider(a.current.pointer,t)}},o!==null);return{bounds:r,stackingStyle:{zIndex:e.order.length},mode:n?`tiled`:`floating`,order:i,interacting:e.gesture!==null,snapPreview:!n&&!e.zoomed&&e.gesture?.kind===`frame`?e.gesture.snap??null:null,activeId:e.order.at(-1)??null,zoomedId:e.zoomed,tabGroups:t.tabGroups,divider:o&&{...o,props:s},focus:e.focus,swap:e.swap,zoom:e.zoom,resizeMain:t=>{o&&e.resizeMain(Math.min(o.max,Math.max(o.min,t)))}}}function mD(e,t={}){let{state:n,bounds:r,tiled:i,arrangement:a,containerRef:o}=fD();(0,F.useEffect)(()=>(n.register(e.id,e.frame,e.minima),()=>{n.unregister(e.id)}),[n,e.id]),(0,F.useEffect)(()=>{n.setMinima(e.id,e.minima)},[n,e.id,e.minima.width,e.minima.height]);let s=t.participating??!0;(0,F.useLayoutEffect)(()=>{n.setParticipation(e.id,s)},[n,e.id,s]);let c=(0,F.useRef)(0),l=cD({begin:t=>!n.frames.has(e.id)||n.gesture?!1:(c.current=t.pointerId,n.begin(e.id,t.pointerId),!0),move:(i,a,s)=>{let l=o?.current?.getBoundingClientRect(),u=l&&t.kind!==`resize`?lD({x:s.clientX-l.left,y:s.clientY-l.top},r):null,d=nD(n.frames.get(e.id)??e.frame,r,e.minima);n.move(e.id,c.current,t.kind===`resize`?{...d,width:d.width+i,height:d.height+a}:{...d,x:d.x+i,y:d.y+a},r,e.minima,u)},end:t=>{t?n.cancel(e.id,c.current):n.end(e.id,c.current)}},s&&!i&&!n.zoomed);return{frame:a.frames.get(e.id)??n.frames.get(e.id)??e.frame,stackingStyle:{zIndex:Math.max(0,n.order.indexOf(e.id))},visible:a.frames.has(e.id),active:s&&n.order.at(-1)===e.id,props:l,focus:()=>{s&&n.focus(e.id)},snap:t=>{s&&!i&&n.snap(e.id,t,r,e.minima)},restore:()=>{s&&!i&&n.restoreFrame(e.id,r,e.minima)}}}var hD=(0,F.createContext)(null);(0,F.forwardRef)(function({layer:e,style:t,children:n,...r},i){let a=(0,F.useContext)(hD),o=a?.update,s=a?.roots.get(`dialog`),[c,l]=(0,F.useState)(!1);(0,F.useEffect)(()=>{if(!s)return;let e=()=>{l(Array.from(s.querySelectorAll(`*`)).some(e=>{let t=e.getBoundingClientRect();return t.width>0&&t.height>0}))};e();let t=new MutationObserver(e);return t.observe(s,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[s]);let u=(0,F.useRef)(null);(0,F.useImperativeHandle)(i,()=>u.current);let d=(0,F.useCallback)(t=>{u.current=t,o?.(e,t)},[o,e]);return(0,F.createElement)(`div`,{...r,ref:d,onFocusCapture:t=>{e===`windows`&&t.target instanceof Node&&t.currentTarget.contains(t.target)&&a?.dismiss?.(),r.onFocusCapture?.(t)},"data-maosaico-layer":e,inert:e===`windows`&&c?``:void 0,style:{position:`relative`,...t,isolation:`isolate`,zIndex:`var(--stipe-layer-${e})`}},n)});var Dpe=cg(xS.fields.id);function Ope(e,t){let n=f_(),r=e?.context.get().computerId!=null&&e.capabilities.has(SS),i=Zx.of(e,`processes`),a=Q_({...Qx(e,SS,i,e=>e.list()),enabled:r,refetchInterval:t?1e4:!1}),o=r?e.capabilities.require(SS):null,s=tv({mutationKey:i,mutationFn:e=>{if(!o)throw new n_(`Processes are not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});return o.kill(e)},onSettled:()=>n.invalidateQueries({queryKey:i,exact:!0})}),c=(0,F.useRef)(null),l=tv({mutationKey:Zx.of(e,`process-start`),mutationFn:e=>{if(!o)throw new n_(`Processes are not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});return o.start(e)},onSettled:()=>Promise.all([n.invalidateQueries({queryKey:i,exact:!0}),n.invalidateQueries({queryKey:Zx.of(e,`ports`),exact:!0})])});async function u(e){let t=JSON.stringify(e),n=c.current?.input===t?c.current:{input:t,requestId:Yce()};c.current=n;try{return await l.mutateAsync({...e,requestId:n.requestId}),c.current===n&&(c.current=null),!0}catch(e){return console.error(`Shed process start failed`,vp(e)),!1}}let d=ev({filters:{mutationKey:i,exact:!0},select:({state:e})=>({id:Bu(Dpe(e.variables)),status:e.status})}),f=new Map;for(let{id:e,status:t}of d)e!==null&&(t===`pending`?f.set(e,`stopping`):t===`error`?f.set(e,`failed`):f.delete(e));return{query:a,stop:s,actions:f,enabled:r,startCommand:u}}var kpe=cg(L({port:yS.fields.port,expose:bg}));function Ape(e,t){let n=f_(),r=e?.context.get().computerId!=null&&e.capabilities.has(bS),i=Zx.of(e,`ports`),a=Q_({...Qx(e,bS,i,()=>{if(!e)throw new n_(`No App connection`,{code:`DISCONNECTED`,retryable:!0});return hue(e.capabilities)}),enabled:r,refetchInterval:e=>t&&!(e.state.data&&`error`in e.state.data)?1e4:!1}),o=r?e.capabilities.require(bS):null,s=tv({mutationKey:i,mutationFn:async({port:e,expose:t})=>{if(!o)throw new n_(`Ports are not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});t?await o.expose(e):await o.unexpose(e)},onSettled:()=>n.invalidateQueries({queryKey:i,exact:!0})}),c=ev({filters:{mutationKey:i,exact:!0},select:({state:e})=>({change:Bu(kpe(e.variables)),status:e.status})}),l=new Map;for(let{change:e,status:t}of c)e&&(t===`pending`||t===`error`?l.set(e.port,{expose:e.expose,status:t===`pending`?`pending`:`failed`}):l.delete(e.port));return{query:a,enabled:r,status:r?a.isPending?`loading`:a.isError?`error`:`error`in a.data?`not-configured`:a.isFetching?`loading`:`loaded`:`unavailable`,actions:l,ports:r&&a.data&&`ports`in a.data?a.data.ports:null,change:async(e,t)=>{try{return await s.mutateAsync({port:e,expose:t}),!0}catch{return!1}}}}var gD=(0,F.createContext)(null);function _D(){let e=(0,F.useContext)(gD);if(!e)throw Error(`Shed data requires a workspace provider`);return e}var jpe={neutral:`alert-neutral`,primary:`alert-primary`,secondary:`alert-secondary`,accent:`alert-accent`,success:`alert-success`,info:`alert-info`,warning:`alert-warning`,error:`alert-error`},vD=(0,F.forwardRef)(function({action:e,children:t,className:n,description:r,title:i,tone:a=`neutral`,...o},s){return(0,R.jsxs)(`div`,{...o,className:cC(`alert caps-alert`,jpe[a],n),"data-tone":a,role:o.role??`alert`,ref:s,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i?(0,R.jsx)(`h3`,{className:`font-semibold`,children:i}):null,r?(0,R.jsx)(`p`,{className:`text-sm`,children:r}):null,t]}),e?(0,R.jsx)(`div`,{className:`shrink-0`,children:e}):null]})});function Mpe({available:e,cause:t,className:n,fix:r,need:i,secondary:a,variant:o,visual:s,waitingFor:c=`setup`,...l}){let u=r.pending===!0,d=u?`Waiting for ${c}…`:r.label,f=e?(0,R.jsxs)(R.Fragment,{children:[t,` `,(0,R.jsx)(`span`,{className:`caps-setup-notice-available`,children:e})]}):t;return o===`panel`?(0,R.jsx)(vE,{...l,actions:a?(0,R.jsx)(zT,{size:`sm`,variant:`ghost`,onClick:a.onSelect,children:a.label}):void 0,className:cC(`caps-setup-notice`,n),"data-variant":`panel`,description:f,primaryAction:{label:d,onSelect:r.onSelect,pending:u},title:i,variant:`panel`,visual:s??(0,R.jsx)(QT,{className:`caps-setup-notice-dot`,glyph:`dot`,tone:`warning`})}):(0,R.jsx)(`div`,{className:`caps-setup-notice-frame`,children:(0,R.jsx)(vD,{...l,action:(0,R.jsxs)(`span`,{className:`caps-setup-notice-actions`,children:[a?(0,R.jsx)(zT,{size:`sm`,variant:`ghost`,onClick:a.onSelect,children:a.label}):null,(0,R.jsx)(zT,{loading:u,size:`sm`,variant:`outline`,onClick:r.onSelect,children:d})]}),className:cC(`caps-setup-notice`,n),"data-variant":o,description:f,role:`status`,title:(0,R.jsxs)(`span`,{className:`caps-setup-notice-title`,children:[(0,R.jsx)(QT,{glyph:`dot`,tone:`warning`}),i]}),tone:`warning`})})}function yD(e,t){console.error(JSON.stringify({source:`shed`,operation:e,failureKind:t instanceof Error?t.name:`NonErrorThrown`}),vp(t))}var bD=o((e=>{(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function n(e){return i(o(e),arguments)}function r(e,t){return n.apply(null,[e].concat(t||[]))}function i(e,r){var i=1,a=e.length,o,s=``,c,l,u,d,f,p,m,h;for(c=0;c<a;c++)if(typeof e[c]==`string`)s+=e[c];else if(typeof e[c]==`object`){if(u=e[c],u.keys)for(o=r[i],l=0;l<u.keys.length;l++){if(o==null)throw Error(n(`[sprintf] Cannot access property "%s" of undefined value "%s"`,u.keys[l],u.keys[l-1]));o=o[u.keys[l]]}else o=u.param_no?r[u.param_no]:r[i++];if(t.not_type.test(u.type)&&t.not_primitive.test(u.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(u.type)&&typeof o!=`number`&&isNaN(o))throw TypeError(n(`[sprintf] expecting number but found %T`,o));switch(t.number.test(u.type)&&(m=o>=0),u.type){case`b`:o=parseInt(o,10).toString(2);break;case`c`:o=String.fromCharCode(parseInt(o,10));break;case`d`:case`i`:o=parseInt(o,10);break;case`j`:o=JSON.stringify(o,null,u.width?parseInt(u.width):0);break;case`e`:o=u.precision?parseFloat(o).toExponential(u.precision):parseFloat(o).toExponential();break;case`f`:o=u.precision?parseFloat(o).toFixed(u.precision):parseFloat(o);break;case`g`:o=u.precision?String(Number(o.toPrecision(u.precision))):parseFloat(o);break;case`o`:o=(parseInt(o,10)>>>0).toString(8);break;case`s`:o=String(o),o=u.precision?o.substring(0,u.precision):o;break;case`t`:o=String(!!o),o=u.precision?o.substring(0,u.precision):o;break;case`T`:o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=u.precision?o.substring(0,u.precision):o;break;case`u`:o=parseInt(o,10)>>>0;break;case`v`:o=o.valueOf(),o=u.precision?o.substring(0,u.precision):o;break;case`x`:o=(parseInt(o,10)>>>0).toString(16);break;case`X`:o=(parseInt(o,10)>>>0).toString(16).toUpperCase()}t.json.test(u.type)?s+=o:(t.number.test(u.type)&&(!m||u.sign)?(h=m?`+`:`-`,o=o.toString().replace(t.sign,``)):h=``,f=u.pad_char?u.pad_char===`0`?`0`:u.pad_char.charAt(1):` `,p=u.width-(h+o).length,d=u.width&&p>0?f.repeat(p):``,s+=u.align?h+o+d:f===`0`?h+d+o:d+h+o)}return s}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var n=e,r,i=[],o=0;n;){if((r=t.text.exec(n))!==null)i.push(r[0]);else if((r=t.modulo.exec(n))!==null)i.push(`%`);else if((r=t.placeholder.exec(n))!==null){if(r[2]){o|=1;var s=[],c=r[2],l=[];if((l=t.key.exec(c))!==null)for(s.push(l[1]);(c=c.substring(l[0].length))!==``;)if((l=t.key_access.exec(c))!==null)s.push(l[1]);else if((l=t.index_access.exec(c))!==null)s.push(l[1]);else throw SyntaxError(`[sprintf] failed to parse named argument key`);else throw SyntaxError(`[sprintf] failed to parse named argument key`);r[2]=s}else o|=2;if(o===3)throw Error(`[sprintf] mixing positional and named placeholders is not (yet) supported`);i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}else throw SyntaxError(`[sprintf] unexpected placeholder`);n=n.substring(r[0].length)}return a[e]=i}e!==void 0&&(e.sprintf=n,e.vsprintf=r),typeof window<`u`&&(window.sprintf=n,window.vsprintf=r,typeof define==`function`&&define.amd&&define(function(){return{sprintf:n,vsprintf:r}}))})()}))(),xD=(e,t,n)=>{let r=e instanceof RegExp?SD(e,n):e,i=t instanceof RegExp?SD(t,n):t,a=r!==null&&i!=null&&Npe(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},SD=(e,t)=>{let n=t.match(e);return n?n[0]:null},Npe=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},CD=`\0SLASH`+Math.random()+`\0`,wD=`\0OPEN`+Math.random()+`\0`,TD=`\0CLOSE`+Math.random()+`\0`,ED=`\0COMMA`+Math.random()+`\0`,DD=`\0PERIOD`+Math.random()+`\0`,Ppe=new RegExp(CD,`g`),Fpe=new RegExp(wD,`g`),Ipe=new RegExp(TD,`g`),Lpe=new RegExp(ED,`g`),Rpe=new RegExp(DD,`g`),zpe=/\\\\/g,Bpe=/\\{/g,Vpe=/\\}/g,Hpe=/\\,/g,Upe=/\\\./g,Wpe=1e5,Gpe=4e6;function OD(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Kpe(e){return e.replace(zpe,CD).replace(Bpe,wD).replace(Vpe,TD).replace(Hpe,ED).replace(Upe,DD)}function qpe(e){return e.replace(Ppe,`\\`).replace(Fpe,`{`).replace(Ipe,`}`).replace(Lpe,`,`).replace(Rpe,`.`)}function kD(e){if(!e)return[``];let t=[],n=xD(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=kD(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function Jpe(e,t={}){if(!e)return[];let{max:n=Wpe,maxLength:r=Gpe}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),jD(Kpe(e),n,r,!0).map(qpe)}function Ype(e){return`{`+e+`}`}function Xpe(e){return/^-?0\d/.test(e)}function Zpe(e,t){return e<=t}function Qpe(e,t){return e>=t}function AD(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function $pe(e,t,n,r){let i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;let o=OD(i[0]),s=OD(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(OD(i[2])),1):1,u=Zpe;s<o&&(l*=-1,u=Qpe);let d=i.some(Xpe),f=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),d){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(f+n.length>r)break;a.push(n),f+=n.length}return a}function jD(e,t,n,r){let i=[``],a=!1,o=!0;for(;;){let s=xD(`{`,`}`,e);if(!s)return AD(i,e,[``],t,n,a);let c=s.pre;if(/\$$/.test(c)){if(i=AD(i,c+`{`+s.body+`}`,[``],t,n,a&&!s.post.length),o=!1,!s.post.length)break;e=s.post;continue}let l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=l||u,f=s.body.indexOf(`,`)>=0;if(!d&&!f){if(s.post.match(/,(?!,).*\}/)){e=s.pre+`{`+s.body+TD+s.post,r=!0;continue}return AD(i,c+`{`+s.body+`}`+s.post,[``],t,n,a)}o&&=(a=r&&!d,!1);let p;if(d)p=$pe(s.body,u,t,n);else{let r=kD(s.body);if(r.length===1&&r[0]!==void 0&&(r=jD(r[0],t,n,!1).map(Ype),r.length===1)){if(i=AD(i,c+r[0],[``],t,n,a&&!s.post.length),!s.post.length)break;e=s.post;continue}let o=a&&!s.post.length&&!c;for(let e=0;o&&e<i.length;e++)i[e]&&(o=!1);p=[];let l=0;outer:for(let e=0;e<r.length;e++){let i=jD(r[e],t,n,!1);for(let e=0;e<i.length;e++){let r=i[e];if(!(o&&!r)){if(p.length>=t||l+r.length>n)break outer;p.push(r),l+=r.length}}}}if(i=AD(i,c,p,t,n,a&&!s.post.length),!s.post.length)break;e=s.post}return i}var eme=65536,MD=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>eme)throw TypeError(`pattern is too long`)},tme={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},ND=e=>e.replace(/[[\]\\-]/g,`\\$&`),nme=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),PD=e=>e.join(``),rme=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(tme))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(ND(d)+`-`+ND(t)):t===d&&r.push(ND(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(ND(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(ND(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[nme(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+PD(r)+`]`,p=`[`+(l?``:`^`)+PD(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},FD=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`),ID,ime=new Set([`!`,`?`,`+`,`*`,`@`]),LD=e=>ime.has(e),RD=e=>LD(e.type),ame=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),ome=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),sme=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),zD=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),cme=`(?!(?:^|/)\\.\\.?(?:$|/))`,BD=`(?!\\.)`,lme=new Set([`[`,`.`]),ume=new Set([`..`,`.`]),dme=new Set(`().*{}+?[]^$\\!`),fme=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),pme=`[^/]`,mme=`[^/]*?`,VD=`[^/]+?`,hme=0,HD=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++hme;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.#l=this.type?this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof ID&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof ID&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new ID(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&LD(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new ID(n,t);u=ID.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new ID(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&LD(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new ID(n,d);d.push(o),u=ID.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new ID(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,ome)}#m(e,t=ame){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=sme){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new ID(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!zD.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=zD.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new ID(null,void 0,t);return ID.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!RD(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?ID.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&ume.has(this.#r[0]))){let n=lme,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?cme:o?BD:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,FD(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,FD(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?BD:``)+VD;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?BD:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,FD(i),this.#t=!!this.#t,this.#n]}#x(){if(RD(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(dme.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?VD:mme,t=!0;continue}if(o=!1,c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=rme(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=pme,t=!0;continue}i+=fme(c)}return[i,FD(e),!!t,a]}};ID=HD;var gme=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),UD=(e,t,n={})=>(MD(t),!n.nocomment&&t.charAt(0)===`#`?!1:new QD(t,n).match(e)),_me=/^\*+([^+@!?*[(]*)$/,vme=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),yme=e=>t=>t.endsWith(e),bme=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),xme=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Sme=/^\*+\.\*+$/,Cme=e=>!e.startsWith(`.`)&&e.includes(`.`),wme=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Tme=/^\.\*+$/,Eme=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Dme=/^\*+$/,Ome=e=>e.length!==0&&!e.startsWith(`.`),kme=e=>e.length!==0&&e!==`.`&&e!==`..`,Ame=/^\?+([^+@!?*[(]*)?$/,jme=([e,t=``])=>{let n=WD([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Mme=([e,t=``])=>{let n=GD([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Nme=([e,t=``])=>{let n=GD([e]);return t?e=>n(e)&&e.endsWith(t):n},Pme=([e,t=``])=>{let n=WD([e]);return t?e=>n(e)&&e.endsWith(t):n},WD=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},GD=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},KD=typeof process==`object`&&process?{}.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,qD={win32:{sep:`\\`},posix:{sep:`/`}};UD.sep=KD===`win32`?qD.win32.sep:qD.posix.sep;var JD=Symbol(`globstar **`);UD.GLOBSTAR=JD;var Fme=`[^/]*?`,Ime=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,Lme=`(?:(?!(?:\\/|^)\\.).)*?`;UD.filter=(e,t={})=>n=>UD(n,e,t);var YD=(e,t={})=>Object.assign({},e,t);UD.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return UD;let t=UD;return Object.assign((n,r,i={})=>t(n,r,YD(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,YD(e,n))}static defaults(n){return t.defaults(YD(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,YD(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,YD(e,r))}},unescape:(n,r={})=>t.unescape(n,YD(e,r)),escape:(n,r={})=>t.escape(n,YD(e,r)),filter:(n,r={})=>t.filter(n,YD(e,r)),defaults:n=>t.defaults(YD(e,n)),makeRe:(n,r={})=>t.makeRe(n,YD(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,YD(e,r)),match:(n,r,i={})=>t.match(n,r,YD(e,i)),sep:t.sep,GLOBSTAR:JD})};var XD=(e,t={})=>(MD(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Jpe(e,{max:t.braceExpandMax}));UD.braceExpand=XD,UD.makeRe=(e,t={})=>new QD(e,t).makeRe(),UD.match=(e,t,n={})=>{let r=new QD(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var ZD=/[?*]|[+@!]\(.*?\)|\[|\]/,Rme=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),QD=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){MD(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||KD,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!ZD.test(e[2]))&&!ZD.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];(n!==1||r!==``||e[0]!==``)&&(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];(e!==1||r!==``||n[0]!==``)&&(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(JD)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(JD,i),o=t.lastIndexOf(JD),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===JD?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===JD)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return XD(this.pattern,this.options)}parse(e){MD(e);let t=this.options;if(e===`**`)return JD;if(e===``)return``;let n,r=null;(n=e.match(Dme))?r=t.dot?kme:Ome:(n=e.match(_me))?r=(t.nocase?t.dot?xme:bme:t.dot?yme:vme)(n[1]):(n=e.match(Ame))?r=(t.nocase?t.dot?Mme:jme:t.dot?Nme:Pme)(n):(n=e.match(Sme))?r=t.dot?wme:Cme:(n=e.match(Tme))&&(r=Eme);let i=HD.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Fme:t.dot?Ime:Lme,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?Rme(e):e===JD?JD:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e===JD&&a!==JD&&(a===void 0?i!==void 0&&i!==JD?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==JD&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=JD))});let i=t.filter(e=>e!==JD);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return UD.defaults(e).Minimatch}};UD.AST=HD,UD.Minimatch=QD,UD.escape=gme,UD.unescape=FD;var $D=4,eO=0,tO=1,zme=2;function nO(e){let t=e.length;for(;--t>=0;)e[t]=0}var rO=29,iO=256,aO=286,oO=30,sO=19,cO=573,lO=15,uO=16,Bme=7,dO=256,Vme=16,Hme=17,Ume=18,fO=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),pO=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Wme=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mO=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gme=512,hO=Array(576);nO(hO);var gO=Array(oO*2);nO(gO);var _O=Array(Gme);nO(_O);var vO=Array(256);nO(vO);var yO=Array(rO);nO(yO);var bO=Array(oO);nO(bO);var xO=class{constructor(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}},SO,CO,wO,TO=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},EO=e=>e<256?_O[e]:_O[256+(e>>>7)],DO=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},OO=(e,t,n)=>{e.bi_valid>uO-n?(e.bi_buf|=t<<e.bi_valid&65535,DO(e,e.bi_buf),e.bi_buf=t>>uO-e.bi_valid,e.bi_valid+=n-uO):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},kO=(e,t,n)=>{OO(e,n[t*2],n[t*2+1])},AO=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Kme=e=>{e.bi_valid===16?(DO(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},qme=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=lO;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<cO;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},jO=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=lO;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=AO(r[t]++,t))}},Jme=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<rO-1;r++)for(yO[r]=n,e=0;e<1<<fO[r];e++)vO[n++]=r;for(vO[n-1]=r,i=0,r=0;r<16;r++)for(bO[r]=i,e=0;e<1<<pO[r];e++)_O[i++]=r;for(i>>=7;r<oO;r++)for(bO[r]=i<<7,e=0;e<1<<pO[r]-7;e++)_O[256+i++]=r;for(t=0;t<=lO;t++)a[t]=0;for(e=0;e<=143;)hO[e*2+1]=8,e++,a[8]++;for(;e<=255;)hO[e*2+1]=9,e++,a[9]++;for(;e<=279;)hO[e*2+1]=7,e++,a[7]++;for(;e<=287;)hO[e*2+1]=8,e++,a[8]++;for(jO(hO,287,a),e=0;e<oO;e++)gO[e*2+1]=5,gO[e*2]=AO(e,5);SO=new xO(hO,fO,257,aO,lO),CO=new xO(gO,pO,0,oO,lO),wO=new xO([],Wme,0,sO,Bme)},MO=e=>{let t;for(t=0;t<aO;t++)e.dyn_ltree[t*2]=0;for(t=0;t<oO;t++)e.dyn_dtree[t*2]=0;for(t=0;t<sO;t++)e.bl_tree[t*2]=0;e.dyn_ltree[dO*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},NO=e=>{e.bi_valid>8?DO(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},PO=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},FO=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&PO(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!PO(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},IO=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?kO(e,i,t):(o=vO[i],kO(e,o+iO+1,t),s=fO[o],s!==0&&(i-=yO[o],OO(e,i,s)),r--,o=EO(r),kO(e,o,n),s=pO[o],s!==0&&(r-=bO[o],OO(e,r,s)));while(a<e.sym_next);kO(e,dO,t)},LO=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=cO,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)FO(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],FO(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,FO(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qme(e,t),jO(n,c,e.bl_count)},RO=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},zO=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do kO(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(kO(e,Hme,e.bl_tree),OO(e,s-3,3)):(kO(e,Ume,e.bl_tree),OO(e,s-11,7)):(a!==i&&(kO(e,a,e.bl_tree),s--),kO(e,Vme,e.bl_tree),OO(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},Yme=e=>{let t;for(RO(e,e.dyn_ltree,e.l_desc.max_code),RO(e,e.dyn_dtree,e.d_desc.max_code),LO(e,e.bl_desc),t=18;t>=3&&e.bl_tree[mO[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Xme=(e,t,n,r)=>{let i;for(OO(e,t-257,5),OO(e,n-1,5),OO(e,r-4,4),i=0;i<r;i++)OO(e,e.bl_tree[mO[i]*2+1],3);zO(e,e.dyn_ltree,t-1),zO(e,e.dyn_dtree,n-1)},Zme=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return eO;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return tO;for(n=32;n<iO;n++)if(e.dyn_ltree[n*2]!==0)return tO;return eO},Qme=!1,$me=e=>{Qme||=(Jme(),!0),e.l_desc=new TO(e.dyn_ltree,SO),e.d_desc=new TO(e.dyn_dtree,CO),e.bl_desc=new TO(e.bl_tree,wO),e.bi_buf=0,e.bi_valid=0,MO(e)},BO=(e,t,n,r)=>{OO(e,0+ +!!r,3),NO(e),DO(e,n),DO(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},ehe=e=>{OO(e,2,3),kO(e,dO,hO),Kme(e)},the=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===zme&&(e.strm.data_type=Zme(e)),LO(e,e.l_desc),LO(e,e.d_desc),o=Yme(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,(a<=i||e.strategy===$D)&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?BO(e,t,n,r):e.strategy===$D||a===i?(OO(e,2+ +!!r,3),IO(e,hO,gO)):(OO(e,4+ +!!r,3),Xme(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),IO(e,e.dyn_ltree,e.dyn_dtree)),MO(e),r&&NO(e)},VO=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(vO[n]+iO+1)*2]++,e.dyn_dtree[EO(t)*2]++),e.sym_next===e.sym_end),HO=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},nhe=(()=>{let e=new Uint32Array(2048),t;for(let n=0;n<256;n++){t=n;for(let e=0;e<8;e++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}for(let n=0;n<256;n++){t=e[n];for(let r=256;r<2048;r+=256)t=e[t&255]^t>>>8,e[r+n]=t}return e})(),UO=(e,t,n,r)=>{let i=nhe,a=r+n,o=r;e^=-1;for(let n=a-7;o<n;o+=8)e^=t[o]|t[o+1]<<8|t[o+2]<<16|t[o+3]<<24,e=i[1792+(e&255)]^i[1536+(e>>>8&255)]^i[1280+(e>>>16&255)]^i[1024+(e>>>24)]^i[768+t[o+4]]^i[512+t[o+5]]^i[256+t[o+6]]^i[t[o+7]];for(;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1},WO={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},rhe=9,ihe=573,GO=3,KO=258,qO=262,ahe=32,JO=42,YO=57,XO=69,ZO=73,QO=91,$O=103,ek=113,tk=666,nk=1,rk=2,ik=3,ak=4,ohe=3,ok=(e,t)=>(e.msg=WO[t],t),sk=e=>e*2-(e>4?9:0),ck=e=>{let t=e.length;for(;--t>=0;)e[t]=0},she=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},lk=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,uk=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=lk(e,e.ins_h,e.window[t+GO-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},dk=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},fk=(e,t)=>{the(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,dk(e.strm)},pk=(e,t)=>{e.pending_buf[e.pending++]=t},mk=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},hk=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=HO(e.adler,t,i,n):e.state.wrap===2&&(e.adler=UO(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},gk=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-qO?e.strstart-(e.w_size-qO):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+KO,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=KO-(f-r),r=f-KO,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},_k=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qO)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),she(e),r+=t),e.strm.avail_in===0)break;if(n=hk(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>GO)for(i=e.strstart-e.insert;e.insert&&(uk(e,i),i++,e.insert--,!(e.lookahead+e.insert<=GO)););}else if(e.lookahead+e.insert>=GO)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=lk(e,e.ins_h,e.window[i+1]);e.insert&&(uk(e,i),i++,e.insert--,!(e.lookahead+e.insert<GO)););}while(e.lookahead<qO&&e.strm.avail_in!==0)},vk=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),BO(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,dk(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(hk(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?ak:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?rk:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(hk(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),BO(e,e.block_start,r,o),e.block_start+=r,dk(e.strm)),o?ik:nk)},yk=(e,t)=>{let n,r;for(;;){if(e.lookahead<qO){if(_k(e),e.lookahead<qO&&t===0)return nk;if(e.lookahead===0)break}if(n=0,e.lookahead>=GO&&(n=uk(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-qO&&(e.match_length=gk(e,n)),e.match_length>=GO){if(r=VO(e,e.strstart-e.match_start,e.match_length-GO),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=GO){e.match_length--;do e.strstart++,n=uk(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=lk(e,e.ins_h,e.window[e.strstart+1]))}else r=VO(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(fk(e,!1),e.strm.avail_out===0))return nk}return e.insert=e.strstart<GO-1?e.strstart:GO-1,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},bk=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<qO){if(_k(e),e.lookahead<qO&&t===0)return nk;if(e.lookahead===0)break}if(n=0,e.lookahead>=GO&&(n=uk(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=GO-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-qO&&(e.match_length=gk(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===GO&&e.strstart-e.match_start>4096)&&(e.match_length=GO-1)),e.prev_length>=GO&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-GO,r=VO(e,e.strstart-1-e.prev_match,e.prev_length-GO),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=uk(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=GO-1,e.strstart++,r&&(fk(e,!1),e.strm.avail_out===0))return nk}else if(e.match_available){if(r=VO(e,0,e.window[e.strstart-1]),r&&fk(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return nk}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=VO(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<GO-1?e.strstart:GO-1,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},che=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=KO){if(_k(e),e.lookahead<=KO&&t===0)return nk;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=GO&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+KO;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=KO-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=GO?(n=VO(e,1,e.match_length-GO),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=VO(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(fk(e,!1),e.strm.avail_out===0))return nk}return e.insert=0,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},lhe=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(_k(e),e.lookahead===0)){if(t===0)return nk;break}if(e.match_length=0,n=VO(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(fk(e,!1),e.strm.avail_out===0))return nk}return e.insert=0,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},xk=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}},Sk=[new xk(0,0,0,0,vk),new xk(4,4,8,4,yk),new xk(4,5,16,8,yk),new xk(4,6,32,32,yk),new xk(4,4,16,16,bk),new xk(8,16,32,32,bk),new xk(8,16,128,128,bk),new xk(8,32,128,256,bk),new xk(32,128,258,1024,bk),new xk(32,258,258,4096,bk)],uhe=e=>{e.window_size=2*e.w_size,ck(e.head),e.max_lazy_match=Sk[e.level].max_lazy,e.good_match=Sk[e.level].good_length,e.nice_match=Sk[e.level].nice_length,e.max_chain_length=Sk[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=GO-1,e.match_available=0,e.ins_h=0},dhe=class{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ihe*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ck(this.dyn_ltree),ck(this.dyn_dtree),ck(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ck(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ck(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}},Ck=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==JO&&t.status!==YO&&t.status!==XO&&t.status!==ZO&&t.status!==QO&&t.status!==$O&&t.status!==ek&&t.status!==tk)},fhe=e=>{if(Ck(e))return ok(e,-2);e.total_in=e.total_out=0,e.data_type=2;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?YO:t.wrap?JO:ek,e.adler=t.wrap===2?0:1,t.last_flush=-2,$me(t),0},phe=e=>{let t=fhe(e);return t===0&&uhe(e.state),t},mhe=(e,t,n,r,i,a,o)=>{if(!e)return-2;let s=1;if(t===-1&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>rhe||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return ok(e,-2);r===8&&(r=9);let c=new dhe;return e.state=c,c.strm=e,c.status=JO,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=+!!o,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+GO-1)/GO),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=a,c.method=n,phe(e)},hhe=(e,t)=>{if(Ck(e)||t>5||t<0)return e?ok(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===tk&&t!==4)return ok(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(dk(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&sk(t)<=sk(r)&&t!==4)return ok(e,-5);if(n.status===tk&&e.avail_in!==0)return ok(e,-5);if(n.status===JO&&n.wrap===0&&(n.status=ek),n.status===JO){let t=8+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=2||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=ahe),t+=31-t%31,mk(n,t),n.strstart!==0&&(mk(n,e.adler>>>16),mk(n,e.adler&65535)),e.adler=1,n.status=ek,dk(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===YO){if(e.adler=0,pk(n,31),pk(n,139),pk(n,8),n.gzhead)pk(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),pk(n,n.gzhead.time&255),pk(n,n.gzhead.time>>8&255),pk(n,n.gzhead.time>>16&255),pk(n,n.gzhead.time>>24&255),pk(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),pk(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(pk(n,n.gzhead.extra.length&255),pk(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=UO(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=XO;else if(pk(n,0),pk(n,0),pk(n,0),pk(n,0),pk(n,0),pk(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),pk(n,ohe),n.status=ek,dk(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===XO){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,dk(e),n.pending!==0)return n.last_flush=-1,0;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=ZO}if(n.status===ZO){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),dk(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,pk(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=QO}if(n.status===QO){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),dk(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,pk(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t))}n.status=$O}if(n.status===$O){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(dk(e),n.pending!==0))return n.last_flush=-1,0;pk(n,e.adler&255),pk(n,e.adler>>8&255),e.adler=0}if(n.status=ek,dk(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==tk){let r=n.level===0?vk(n,t):n.strategy===2?lhe(n,t):n.strategy===3?che(n,t):Sk[n.level].func(n,t);if((r===ik||r===ak)&&(n.status=tk),r===nk||r===ik)return e.avail_out===0&&(n.last_flush=-1),0;if(r===rk&&(t===1?ehe(n):t!==5&&(BO(n,0,0,!1),t===3&&(ck(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),dk(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(pk(n,e.adler&255),pk(n,e.adler>>8&255),pk(n,e.adler>>16&255),pk(n,e.adler>>24&255),pk(n,e.total_in&255),pk(n,e.total_in>>8&255),pk(n,e.total_in>>16&255),pk(n,e.total_in>>24&255)):(mk(n,e.adler>>>16),mk(n,e.adler&65535)),dk(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},ghe=e=>{if(Ck(e))return-2;let t=e.state.status;return e.state=null,t===ek?ok(e,-3):0},_he=(e,t)=>{let n=t.length;if(Ck(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==JO||r.lookahead)return-2;if(i===1&&(e.adler=HO(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ck(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,_k(r);r.lookahead>=GO;){let e=r.strstart,t=r.lookahead-(GO-1);do uk(r,e),e++;while(--t);r.strstart=e,r.lookahead=GO-1,_k(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=GO-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},wk=16209,vhe=16191;function yhe(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=wk;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=wk;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=wk;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=vhe;break top}else{e.msg=`invalid literal/length code`,E.mode=wk;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p}var Tk=15,Ek=852,Dk=592,Ok=0,kk=1,Ak=2,bhe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),xhe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),She=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Che=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),jk=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(16),D=new Uint16Array(16),O=null,k,A,j;for(l=0;l<=Tk;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=Tk;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=Tk;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===Ok||f!==1))return-1;for(D[1]=0,l=1;l<Tk;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===Ok?(w=O=o,T=20):e===kk?(w=bhe,O=xhe,T=257):(w=She,O=Che,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===kk&&_>Ek||e===Ak&&_>Dk)return 1;for(;;){k=l-h,o[u]+1<T?(A=0,j=o[u]):o[u]>=T?(A=O[o[u]-T],j=w[o[u]-T]):(A=96,j=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|A<<16|j|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===kk&&_>Ek||e===Ak&&_>Dk)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},whe=0,Mk=1,Nk=2,Pk=16180,Fk=16181,Ik=16182,Lk=16183,Rk=16184,zk=16185,Bk=16186,Vk=16187,Hk=16188,Uk=16189,Wk=16190,Gk=16191,Kk=16192,qk=16193,Jk=16194,Yk=16195,Xk=16196,Zk=16197,Qk=16198,$k=16199,eA=16200,tA=16201,nA=16202,rA=16203,iA=16204,aA=16205,oA=16206,sA=16207,cA=16208,lA=16209,uA=16210,dA=16211,The=852,Ehe=592,fA=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),Dhe=class{constructor(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},pA=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<Pk||t.mode>dA)},Ohe=e=>{if(pA(e))return-2;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=Pk,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(The),t.distcode=t.distdyn=new Int32Array(Ehe),t.sane=1,t.back=-1,0},mA=e=>{if(pA(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ohe(e)},khe=(e,t)=>{let n;if(pA(e))return-2;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?-2:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,mA(e))},Ahe=(e,t)=>{if(!e)return-2;let n=new Dhe;e.state=n,n.strm=e,n.window=null,n.mode=Pk;let r=khe(e,t);return r!==0&&(e.state=null),r},hA=!0,gA,_A,jhe=e=>{if(hA){gA=new Int32Array(512),_A=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(jk(Mk,e.lens,0,288,gA,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;jk(Nk,e.lens,0,32,_A,0,e.work,{bits:5}),hA=!1}e.lencode=gA,e.lenbits=9,e.distcode=_A,e.distbits=5},vA=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.window=new Uint8Array(1<<a.wbits)),a.wsize===0&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},yA=(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pA(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===Gk&&(n.mode=Kk),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=0;inf_leave:for(;;)switch(n.mode){case Pk:if(n.wrap===0){n.mode=Kk;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0),l=0,u=0,n.mode=Fk;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=lA;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=lA;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=lA;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?Uk:Gk,l=0,u=0;break;case Fk:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!=8){e.msg=`unknown compression method`,n.mode=lA;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=lA;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0)),l=0,u=0,n.mode=Ik;case Ik:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l>>>0),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=UO(n.check,T,4,0)),l=0,u=0,n.mode=Lk;case Lk:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0)),l=0,u=0,n.mode=Rk;case Rk:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=zk;case zk:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=UO(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=Bk;case Bk:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C),n.length++);while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=UO(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=Vk;case Vk:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C),n.length++);while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=UO(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Hk;case Hk:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=lA;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Gk;break;case Uk:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=fA(l),l=0,u=0,n.mode=Wk;case Wk:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,2;e.adler=n.check=1,n.mode=Gk;case Gk:if(t===5||t===6)break inf_leave;case Kk:if(n.last){l>>>=u&7,u-=u&7,n.mode=oA;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=qk;break;case 1:if(jhe(n),n.mode=$k,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Xk;break;case 3:e.msg=`invalid block type`,n.mode=lA}l>>>=2,u-=2;break;case qk:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=lA;break}if(n.length=l&65535,l=0,u=0,n.mode=Jk,t===6)break inf_leave;case Jk:n.mode=Yk;case Yk:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=Gk;break;case Xk:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=lA;break}n.have=0,n.mode=Zk;case Zk:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[O[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=jk(whe,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=lA;break}n.have=0,n.mode=Qk;case Qk:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=lA;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=lA;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===lA)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=lA;break}if(n.lenbits=9,E={bits:n.lenbits},w=jk(Mk,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=lA;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=jk(Nk,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=lA;break}if(n.mode=$k,t===6)break inf_leave;case $k:n.mode=eA;case eA:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,yhe(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===Gk&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=aA;break}if(v&32){n.back=-1,n.mode=Gk;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=lA;break}n.extra=v&15,n.mode=tA;case tA:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=nA;case nA:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=lA;break}n.offset=y,n.extra=v&15,n.mode=rA;case rA:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=lA;break}n.mode=iA;case iA:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=lA;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=eA);break;case aA:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=eA;break;case oA:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?UO(n.check,i,f,o-f):HO(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:fA(l))!==n.check){e.msg=`incorrect data check`,n.mode=lA;break}l=0,u=0}n.mode=sA;case sA:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=lA;break}l=0,u=0}n.mode=cA;case cA:w=1;break inf_leave;case lA:w=-3;break inf_leave;case uA:return-4;case dA:default:return-2}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<lA&&(n.mode<oA||t!==4))&&vA(e,e.output,e.next_out,f-e.avail_out)?(n.mode=uA,-4):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?UO(n.check,i,f,e.next_out-f):HO(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Gk?128:0)+(n.mode===$k||n.mode===Jk?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},bA=e=>{if(pA(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},xA=(e,t)=>{let n=t.length,r,i,a;return pA(e)||(r=e.state,r.wrap!==0&&r.mode!==Wk)?-2:r.mode===Wk&&(i=1,i=HO(i,t,n,0),i!==r.check)?-3:(a=vA(e,t,n,n),a?(r.mode=uA,-4):(r.havedict=1,0))},SA=class{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},CA=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},wA=Object.prototype.toString,Mhe={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:new Uint8Array},Nhe=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Mhe,e);let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new SA,this.strm.avail_out=0;let n=mhe(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(WO[n]);wA.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(r.length){if(t.gzip)throw Error(`dictionary is not supported with gzip`);if(n=_he(this.strm,r),n!==0)throw Error(WO[n])}}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=typeof t==`number`?t:t===!0?4:0,n.input=typeof e==`string`?new TextEncoder().encode(e):wA.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===2||a===3)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=hhe(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=ghe(this.strm);break}if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||WO[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=CA(this.chunks)),this.chunks=[]}},TA=Object.prototype.toString,Phe={chunkSize:65536,windowBits:15,raw:!1,dictionary:new Uint8Array},Fhe=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Phe,e);let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!e.windowBits&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new SA,this.strm.avail_out=0;let n=Ahe(this.strm,t.windowBits);if(n!==0)throw Error(WO[n]);TA.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=xA(this.strm,r),n!==0))throw Error(WO[n])}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a,o;if(this.ended)return this.err===0;for(a=typeof t==`number`?t:t===!0?4:0,n.input=TA.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=yA(n,a),i===2){let e=this.options.dictionary;e.length&&(i=xA(n,e),i===0?i=yA(n,a):i===-3&&(i=2))}for(;n.avail_in>0&&i===1&&n.state.wrap&2&&n.state.flags!==0&&n.input[n.next_in]!==0;)mA(n),i=yA(n,a);if(i===-2||i===-3||i===2||i===-4)break;if(o=n.avail_out,n.next_out&&(n.avail_out===0||i===1||a>0)&&(this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out)),n.avail_out=0,n.next_out=0),i!==0&&i!==-5||o!==0){if(i===1){i=bA(this.strm);break}if(n.avail_in===0){if(a===4){i=bA(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||WO[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=CA(this.chunks)),this.chunks=[]}};function EA(e,t,n){let r=0,i=e.onData;if(e.onData=function(e){if(e.byteLength>n-r)throw Error(`gzip output exceeds limit (${n} bytes)`);r+=e.byteLength,i.call(this,e)},!e.push(t,!0)||e.err||e.result===void 0)throw Error(e.msg||`Invalid or incomplete gzip stream`);return e.result}function DA(e){if(!Number.isSafeInteger(e)||e<=0)throw Error(`gzip output limit must be a positive safe integer`);return Math.min(e,65536)}function OA(e,t){return EA(new Fhe({windowBits:31,chunkSize:DA(t)}),e,t)}function Ihe(e,t,n){return EA(new Nhe({gzip:!0,level:n,chunkSize:DA(t)}),e,t)}var kA=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends kA{};function AA(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function jA(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function MA(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function NA(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function PA(e,t){return MA(e,t,``)}function FA(e,t){return NA(e,t,``)}function IA(e,t){return t.slice(0,Lhe(e,t))}function Lhe(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function LA(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function RA(e,t){if(t)return BA(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function zA(e,t){if(t)return BA(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function BA(e,t){if(!t)return[zA(e),RA(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=LA(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var VA=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Rhe=RegExp(`[${VA}]+|\\s+|[^${VA}]`,`ug`);new class extends kA{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=LA(e,r)}else n=e.match(Rhe)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&HA(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&HA(n,i,r,null,t.intlSegmenter),e}};function HA(e,t,n,r,i){if(t&&n){let[a,o]=BA(t.value,i),[s,c]=BA(n.value,i);if(e){let r=AA(a,s);e.value=NA(e.value,s,r),t.value=PA(t.value,r),n.value=PA(n.value,r)}if(r){let e=jA(o,c);r.value=MA(r.value,c,e),t.value=FA(t.value,e),n.value=FA(n.value,e)}}else if(n){if(e){let e=zA(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=zA(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=zA(r.value,i),[a,o]=BA(t.value,i),s=AA(n,a);t.value=PA(t.value,s);let c=jA(PA(n,s),o);t.value=FA(t.value,c),r.value=MA(r.value,n,c),e.value=NA(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=zA(r.value,i),n=IA(RA(t.value,i),e);t.value=FA(t.value,n)}else if(e){let n=IA(RA(e.value,i),zA(t.value,i));t.value=PA(t.value,n)}}new class extends kA{tokenize(e){let t=RegExp(`(\\r?\\n)|[${VA}]+|[^\\S\\n\\r]+|[^${VA}]`,`ug`);return e.match(t)||[]}};var zhe=new class extends kA{constructor(){super(...arguments),this.tokenize=WA}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
95
+ const term = new Terminal({ ghostty });`)}var pS;function mS(){return pS??=Gle.load(),pS}var uue=[``,`bold `,`italic `,`bold italic `];async function hS(e,t){await Promise.all(uue.map(n=>document.fonts.load(`${n}${String(e)}px ${t}`)))}var due=L({path:vg,entries:Cg(L({name:vg,type:Eg([`file`,`directory`,`symlink`]),size:yg,modifiedAt:yg})),nextOffset:Dg(yg)}),fue=Wx(`computer.list`,1,qo(()=>Gx({list:qx(Kx(to().transform(e=>ug(due)(e))))}))),gS=Tg([L({state:Eg([`running`,`sleeping`,`starting`,`start_failed`])}),L({state:mg(`queued`),position:yg.pipe(kg(Wg()),kg(Vg(0)))})]),_S=L({enabled:bg,effective:bg,blockedBy:Dg(Eg([`team`,`global`]))}),pue=L({computerId:Xg,name:Xg,runtime:gS,backends:Cg(L({id:Xg,kind:Eg([`platform-container`,`on-box-vm`,`local`]),status:Eg([`ready`,`queued`,`online`,`offline`]),queuePosition:Dg(yg.pipe(kg(Wg()),kg(Vg(0)))),hostId:Dg(vg),hostLabel:Dg(vg),folderLabel:Dg(vg),detachable:bg})),internet:_S});Wx(`computer.instrument.read`,1,qo(()=>Gx({read:qx(Kx(to().transform(e=>ug(pue)(e))))}))),Wx(`computer.instrument.control`,1,qo(()=>Gx({start:qx(Kx(to().transform(e=>ug(gS)(e)))),setInternetAccess:qx(Kx(to().transform(e=>ug(_S)(e)))),detachLocal:qx(Kx(to().transform(e=>ug(L({detached:bg}))(e))))})));var vS=Tg([L({ports:Cg(L({port:yg.pipe(kg(Wg()),kg(Ug({minimum:1,maximum:65535}))),previewUrl:Xg,openMode:Eg([`inline`,`external-only`]),expiresAt:yg.pipe(kg(Wg()),kg(Vg(0)))})).pipe(kg(Jg(64)))}),L({error:mg(`port_previews_not_configured`)})]),yS=L({port:yg.annotate({message:`Use a port from 1 to 65535.`}).check(Wg({message:`Use a port from 1 to 65535.`}),Ug({minimum:1,maximum:65535},{message:`Use a port from 1 to 65535.`})),exposed:bg}),mue=L({port:yg.pipe(kg(Wg()),kg(Ug({minimum:1,maximum:65535}))),removed:bg}),bS=Wx(`computer.ports`,2,qo(()=>Gx({list:qx(Kx(to().transform(e=>ug(vS)(e)))),expose:qx(Kx(to().transform(e=>ug(yS)(e)))),unexpose:qx(Kx(to().transform(e=>ug(mue)(e))))})));async function hue(e){let t=ug(vS)(await e.require(bS).list());if(`error`in t)return t;for(let{previewUrl:e,expiresAt:n}of t.ports){let t=new URL(e);if(t.protocol!==`https:`||t.username||t.password||n<=Date.now())throw Error(`Computer preview URL is invalid`)}return t}var gue=Eg([`synced`,`pending`,`unknown`]),xS=L({port:Dg(yS.fields.port),id:Xg,command:Xg,cwd:Dg(vg),startedAt:yg.pipe(kg(Wg()),kg(Hg(0))),state:Eg([`running`,`exited`,`uncertain`]),exitCode:Dg(yg.pipe(kg(Wg()))),sync:gue,endedAt:Dg(yg.pipe(kg(Wg()),kg(Hg(0))))}),_ue=L({processes:Cg(xS)}),vue=L({process:xS,signalled:bg}),yue=L({process:xS,lines:Cg(vg.pipe(kg(Jg(2e3)))).pipe(kg(Jg(200))),truncated:bg});L({requestId:Xg.pipe(kg(Jg(256))),command:Xg.pipe(kg(Jg(16384))),cwd:fg(vg),port:fg(yS.fields.port)});var SS=Wx(`computer.processes`,1,qo(()=>Gx({start:qx(Kx(to().transform(e=>ug(xS)(e)))),list:qx(Kx(to().transform(e=>ug(_ue)(e)))),kill:qx(Kx(to().transform(e=>ug(vue)(e)))),logs:qx(Kx(to().transform(e=>ug(yue)(e))))})));function bue(e){let t=o_(e);return t.action===`setup`?{reason:`no-runtime`,message:`No Computer is running to answer this yet.`,action:`setup`}:t.action===`grant`?{reason:`not-granted`,message:`This App needs permission to see this Computer.`,action:`grant`}:{reason:`failed`,message:t.message,action:`retry`}}var xue=Wx(`computer.readFile`,1,qo(()=>Gx({open:qx(Gx({response:qx(ns(Response)),close:Jx}))}))),Sue=Wx(`computer.writeFile`,3,qo(()=>Gx({open:qx(Gx({write:Jx,close:Jx})),mkdir:Jx,replace:qx(Kx(to().transform(e=>ug(Cue)(e))))}))),Cue=Tg([L({kind:mg(`replaced`),path:Xg,bytes:yg.pipe(kg(Wg()),kg(Hg(0)))}),L({kind:mg(`conflict`)})]),CS=L({computerName:Xg.pipe(kg(Jg(256))),teamName:Xg.pipe(kg(Jg(256))),modelDoor:Xg.pipe(kg(Jg(256))),uptimeSeconds:yg.pipe(kg(Wg()),kg(Hg(0))),version:Xg.pipe(kg(Jg(64)))}),wS=Wx(`computer.terminal`,2,qo(()=>Gx({open:qx(Gx({information:qx(Kx(to().transform(e=>ug(CS)(e)))),output:qx(ns(ReadableStream).transform(e=>e.pipeThrough(new TransformStream({transform(e,t){t.enqueue(ns(Uint8Array).parse(e))}})))),input:qx(ns(WritableStream)),resize:Jx,close:Jx}))})));async function wue(e,t,n={}){n.signal?.throwIfAborted();let r=await e.require(wS).open(t),i,a=()=>i===void 0?(n.signal?.removeEventListener(`abort`,o),i=Promise.resolve().then(async()=>{try{await r.close()}finally{r[Symbol.dispose]()}}),i):i,o=()=>{a().catch(e=>{rv(`computer.terminal.abort-close`,e)})};n.signal?.addEventListener(`abort`,o,{once:!0});try{let[e,t,o]=await Promise.all([r.output(),r.input(),r.information()]);n.signal?.throwIfAborted();let s=e,c=t;return{information:ug(CS)(o),output:s,input:c,resize:async e=>{if(n.signal?.throwIfAborted(),i!==void 0)throw Error(`Computer terminal is closed`);await r.resize(e)},close:a}}catch(e){throw await a().catch(e=>{rv(`computer.terminal.open-cleanup`,e)}),e}}function TS(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Tue(...e){return t=>{let n=!1,r=e.map(e=>{let r=TS(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():TS(e[t],null)}}}}function Eue(...e){return F.useCallback(Tue(...e),e)}function Due(e){let t=F.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];DS(r)&&typeof OS==`function`&&(r=OS(r._payload)),F.Children.forEach(r,e=>{if(Mue(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;DS(n)&&typeof OS==`function`&&(n=OS(n._payload)),a=kue(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=F.cloneElement(a,void 0,s):!o&&F.Children.count(r)===1&&F.isValidElement(r)&&(a=r);let c=a?jue(a):void 0,l=Eue(n,c);if(!a){if(r||r===0)throw Error(o?Iue(e):Fue(e));return r}let u=Aue(i,a.props??{});return a.type!==F.Fragment&&(u.ref=n?l:c),F.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var ES=Due(`Slot`),Oue=Symbol.for(`radix.slottable`),kue=(e,t)=>{if(`child`in e.props){let t=e.props.child;return F.isValidElement(t)?F.cloneElement(t,void 0,e.props.children(t.props.children)):null}return F.isValidElement(t)?t:null};function Aue(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function jue(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mue(e){return F.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Oue}var Nue=Symbol.for(`react.lazy`);function DS(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Nue&&`_payload`in e&&Pue(e._payload)}function Pue(e){return typeof e==`object`&&!!e&&`then`in e}var Fue=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Iue=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,OS=F.use,Lue=Object.freeze({alphaIntercept:-9,alphaSlope:19,blurStdDeviation:1.5}),Rue=Object.freeze({background:`#eff1f5`,foreground:`#4c4f69`,cursor:`#4c4f69`,cursorAccent:`#eff1f5`,surface:`#ccd0da`,selectionBackground:`#4c4f69`,selectionForeground:`#eff1f5`,primary:`#f98284`,accent:`#ea76cb`,success:`#40a02b`,info:`oklch(58% 0.158 241.966)`,warning:`#df8e1d`,error:`#d20f39`,black:`#5c5f77`,red:`#d20f39`,green:`#40a02b`,yellow:`#df8e1d`,blue:`#1e66f5`,magenta:`#ea76cb`,cyan:`#179299`,white:`#4c4f69`,brightBlack:`#6c6f85`,brightRed:`#d20f39`,brightGreen:`#40a02b`,brightYellow:`#df8e1d`,brightBlue:`#1e66f5`,brightMagenta:`#8839ef`,brightCyan:`#04a5e5`,brightWhite:`#4c4f69`}),zue=Object.freeze({background:`#1e1e2e`,foreground:`#cdd6f4`,cursor:`#cdd6f4`,cursorAccent:`#1e1e2e`,surface:`#45475a`,selectionBackground:`#cdd6f4`,selectionForeground:`#1e1e2e`,primary:`#f98284`,accent:`#f5c2e7`,success:`#a6e3a1`,info:`#89b4fa`,warning:`#f9e2af`,error:`#f38ba8`,black:`#45475a`,red:`#f38ba8`,green:`#a6e3a1`,yellow:`#f9e2af`,blue:`#89b4fa`,magenta:`#f5c2e7`,cyan:`#94e2d5`,white:`#cdd6f4`,brightBlack:`#585b70`,brightRed:`#f38ba8`,brightGreen:`#a6e3a1`,brightYellow:`#f9e2af`,brightBlue:`#89b4fa`,brightMagenta:`#cba6f7`,brightCyan:`#89dceb`,brightWhite:`#cdd6f4`}),Bue=Object.freeze({background:`#fbfbfa`,foreground:`#1a1b1e`,cursor:`#1a1b1e`,cursorAccent:`#fbfbfa`,surface:`#e6e6e1`,selectionBackground:`#1a1b1e`,selectionForeground:`#fbfbfa`,primary:`#e5534b`,accent:`#e5534b`,success:`#2f7a3e`,info:`#2659c4`,warning:`#9a6200`,error:`#c4383a`,black:`#5c5f66`,red:`#c4383a`,green:`#2f7a3e`,yellow:`#9a6200`,blue:`#2659c4`,magenta:`#933a88`,cyan:`#0f7079`,white:`#1a1b1e`,brightBlack:`#6b6f76`,brightRed:`#c4383a`,brightGreen:`#2f7a3e`,brightYellow:`#9a6200`,brightBlue:`#2659c4`,brightMagenta:`#933a88`,brightCyan:`#0f7079`,brightWhite:`#1a1b1e`}),Vue=Object.freeze({background:`#0e0f11`,foreground:`#e3e3df`,cursor:`#e3e3df`,cursorAccent:`#0e0f11`,surface:`#26292e`,selectionBackground:`#e3e3df`,selectionForeground:`#0e0f11`,primary:`#ff7b6b`,accent:`#ff7b6b`,success:`#8fd19e`,info:`#8ab4f8`,warning:`#e7c27a`,error:`#ff8a80`,black:`#9a9ea6`,red:`#ff8a80`,green:`#8fd19e`,yellow:`#e7c27a`,blue:`#8ab4f8`,magenta:`#dba6e8`,cyan:`#7fd3d3`,white:`#e3e3df`,brightBlack:`#7d828b`,brightRed:`#ff8a80`,brightGreen:`#8fd19e`,brightYellow:`#e7c27a`,brightBlue:`#8ab4f8`,brightMagenta:`#dba6e8`,brightCyan:`#7fd3d3`,brightWhite:`#e3e3df`});function kS(e){switch(e.trim()){case`readout`:return Bue;case`readout-night`:return Vue;case`latte`:return Rue;case`mocha`:return zue;default:return}}var Hue=Object.freeze([`2xs`,`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`]);Object.freeze(`--stipe-font-synthesis.--stipe-surface-frame-width.--stipe-surface-frame-image.--stipe-surface-molding-contrast.--stipe-shadow-raised.--stipe-shadow-inset.--stipe-shadow-edge.--stipe-display-gasket-face.--stipe-display-texture-image.--stipe-display-text-shadow.--stipe-canvas.--stipe-surface.--stipe-surface-raised.--stipe-surface-selected.--stipe-fg-muted.--stipe-linework.--stipe-hairline.--stipe-hairline-quiet.--stipe-figure-ink.--stipe-density-compact.--stipe-density-comfortable.--stipe-motion-spring.--stipe-motion-squish.--stipe-motion-fast.--stipe-motion-normal.--stipe-motion-slow.--stipe-motion-ease.--stipe-motion-ease-exit.--stipe-motion-bounce.--stipe-motion-spring-duration.--stipe-motion-stretch.--stipe-motion-distance.--stipe-motion-stagger.--stipe-motion-blur.--stipe-motion-shake.--stipe-motion-steps.--stipe-motion-fuse.--stipe-press-depth.--stipe-press-scale.--stipe-layer-desktop.--stipe-layer-windows.--stipe-layer-chrome.--stipe-layer-popover.--stipe-layer-dialog.--stipe-layer-toast.--stipe-layer-tooltip.--stipe-overlay-shadow-outset.--stipe-icon-size-sm.--stipe-icon-size-md.--stipe-icon-size-lg.--stipe-icon-stroke.--stipe-card-rim.--stipe-card-rim-edge.--stipe-card-face.--stipe-card-panel.--stipe-card-ink.--stipe-card-ink-muted.--stipe-card-accent.--stipe-card-shadow.--stipe-card-foil-highlight.--stipe-card-foil-warm.--stipe-card-foil-cool.--stipe-avatar-shadow.--stipe-art-coral.--stipe-art-blue.--stipe-art-mint.--stipe-art-grape.--stipe-art-yellow.--stipe-art-cream.--stipe-art-ink.--stipe-art-inkcap.--stipe-art-graphite.--stipe-sketch-ink`.split(`.`));function AS(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=AS(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Uue(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=AS(e))&&(r&&(r+=` `),r+=t);return r}var jS=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,MS=Uue,Wue=(e,t)=>n=>{if(t?.variants==null)return MS(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=jS(t)||jS(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return MS(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},NS=Object.defineProperty,Gue=((e,t)=>{let n={};for(var r in e)NS(n,r,{get:e[r],enumerable:!0});return t||NS(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>LS,isAnyNonArbitrary:()=>ade,isArbitraryFamilyName:()=>fde,isArbitraryImage:()=>mde,isArbitraryLength:()=>lde,isArbitraryNumber:()=>ude,isArbitraryPosition:()=>pde,isArbitraryShadow:()=>hde,isArbitrarySize:()=>cde,isArbitraryValue:()=>JS,isArbitraryVariable:()=>YS,isArbitraryVariableFamilyName:()=>_de,isArbitraryVariableImage:()=>bde,isArbitraryVariableLength:()=>gde,isArbitraryVariablePosition:()=>vde,isArbitraryVariableShadow:()=>xde,isArbitraryVariableSize:()=>yde,isArbitraryVariableWeight:()=>Sde,isArbitraryWeight:()=>dde,isFraction:()=>Que,isInteger:()=>$ue,isNamedContainerQuery:()=>ode,isNumber:()=>IS,isPercent:()=>ede,isTshirtSize:()=>tde}),PS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Kue=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,que=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jue=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Yue=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xue=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zue=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Que=e=>Kue.test(e),IS=e=>!!e&&!Number.isNaN(Number(e)),$ue=e=>!!e&&Number.isInteger(Number(e)),ede=e=>e.endsWith(`%`)&&IS(e.slice(0,-1)),tde=e=>que.test(e),LS=()=>!0,nde=e=>Jue.test(e)&&!Yue.test(e),RS=()=>!1,rde=e=>Xue.test(e),ide=e=>Zue.test(e),ade=e=>!JS(e)&&!YS(e),ode=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),zS=(e,t,n)=>{let r=PS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},BS=(e,t,n=!1)=>{let r=FS.exec(e);return r?r[1]?t(r[1]):n:!1},VS=e=>e===`position`||e===`percentage`,HS=e=>e===`image`||e===`url`,US=e=>e===`length`||e===`size`||e===`bg-size`,WS=e=>e===`length`,sde=e=>e===`number`,GS=e=>e===`family-name`,KS=e=>e===`number`||e===`weight`,qS=e=>e===`shadow`,cde=e=>zS(e,US,RS),JS=e=>PS.test(e),lde=e=>zS(e,WS,nde),ude=e=>zS(e,sde,IS),dde=e=>zS(e,KS,LS),fde=e=>zS(e,GS,RS),pde=e=>zS(e,VS,RS),mde=e=>zS(e,HS,ide),hde=e=>zS(e,qS,rde),YS=e=>FS.test(e),gde=e=>BS(e,WS),_de=e=>BS(e,GS),vde=e=>BS(e,VS),yde=e=>BS(e,US),bde=e=>BS(e,HS),xde=e=>BS(e,qS,!0),Sde=e=>BS(e,KS,!0),XS=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},Cde=e=>typeof e==`function`&&e.isThemeGetter===!0,wde=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),Tde=(e,t)=>{let n=wde(e);t.prefix!==void 0&&(n.prefix=t.prefix);let r=(e,t)=>{if(t)for(let n in t)t[n]!==void 0&&(e[n]=t[n])},i=t.override;i&&(i.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...i.orderSensitiveModifiers]),r(n.theme,i.theme),r(n.classGroups,i.classGroups),r(n.conflictingClassGroups,i.conflictingClassGroups),r(n.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers));let a=(e,t)=>{if(t)for(let n in t){let r=t[n];r&&(e[n]=(e[n]??[]).concat(r))}},o=t.extend;return o&&(o.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...n.orderSensitiveModifiers,...o.orderSensitiveModifiers]),a(n.theme,o.theme),a(n.classGroups,o.classGroups),a(n.conflictingClassGroups,o.conflictingClassGroups),a(n.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers)),n},ZS={isAny:0,isAnyNonArbitrary:1,isArbitraryValue:2,isArbitraryVariable:3,isFraction:4,isNumber:5,isInteger:6,isPercent:7,isTshirtSize:8,isNamedContainerQuery:9,isArbitraryLength:10,isArbitraryNumber:11,isArbitraryWeight:12,isArbitraryFamilyName:13,isArbitraryPosition:14,isArbitrarySize:15,isArbitraryImage:16,isArbitraryShadow:17,isArbitraryVariableLength:18,isArbitraryVariableFamilyName:19,isArbitraryVariablePosition:20,isArbitraryVariableSize:21,isArbitraryVariableImage:22,isArbitraryVariableShadow:23,isArbitraryVariableWeight:24},Ede=25,Dde=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),QS=(e,t,n)=>{let r=e.idByName.get(t);return r===void 0&&(r=e.names.length,e.names.push(t),e.idByName.set(t,r),e.classifierFns.set(t,n)),r},$S=(e,t)=>{if(typeof t==`function`){let n=e.fnName.get(t);return n===void 0&&(n=`$c`+e.fnName.size,e.fnName.set(t,n),e.impls[n]=t),QS(e,n,t)}let n=t.$v,r=Gue[n];if(ZS[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return QS(e,n,r)},eC=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),Ode=(e,t)=>e.theme[t]??[],kde=(e,t,n)=>{let r=eC(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=eC(),e.nextPart.set(n,t)),e=t}return e},a=(n,r,o)=>{if(typeof n==`string`){let e=n===``?r:i(r,n);e.classGroupId=o;return}if(typeof n==`function`){if(Cde(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:$S(t,n),groupId:o});return}if(XS(n,`$t`)){for(let t of Ode(e,n.$t))a(t,r,o);return}if(XS(n,`$v`)){(r.validators??=[]).push({validatorId:$S(t,n),groupId:o});return}for(let[e,t]of Object.entries(n)){let n=i(r,e);for(let e of t)a(e,n,o)}};for(let[t,i]of Object.entries(e.classGroups)){let e=n(t);for(let t of i)a(t,r,e)}return r},Ade=e=>{let t=Dde(),n=[],r=new Map,i=e=>{let t=r.get(e);return t===void 0&&(t=n.length,n.push(e),r.set(e,t)),t},a=kde(e,t,i),o=e=>{if(e.validators)return!1;for(let t of e.nextPart.values())if(!o(t))return!1;return!0},s=(e,t,n)=>{e.classGroupId>=0&&n.push({tail:t,gid:e.classGroupId});for(let[r,i]of e.nextPart)s(i,t+`-`+r,n)},c=e=>{for(let[t,n]of[...e.nextPart])o(n)?(s(n,t,e.lit),e.nextPart.delete(t)):c(n)};c(a);let l=[{edges:new Map,groupId:-1,vlist:-1}],u=()=>(l.push({edges:new Map,groupId:-1,vlist:-1}),l.length-1),d=[],f=new Map,p=e=>{let t=e.map(e=>e.validatorId+`:`+e.groupId).join(`,`),n=f.get(t);return n===void 0&&(n=d.length,d.push(e.map(e=>[e.validatorId,e.groupId])),f.set(t,n)),n},m=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),i=l[n].edges.get(r);i===void 0&&(i=u(),l[n].edges.set(r,i)),n=i}return n},h=[],g=(e,t,n)=>{e.classGroupId>=0&&(l[t].groupId=e.classGroupId),e.validators&&(l[t].vlist=p(e.validators));for(let{tail:n,gid:r}of e.lit)h.push({anchor:t,tail:n,gid:r});for(let[r,i]of e.nextPart){let e=t;if(!n){let n=l[t].edges.get(45);n===void 0&&(n=u(),l[t].edges.set(45,n)),e=n}let a=m(e,r);g(i,a,!1)}};g(a,0,!0);let _=new Set(h.map(e=>e.anchor)),v=e=>l[e].groupId>=0||l[e].vlist>=0||_.has(e),y=new Map,b=[],x=e=>{let t=b.length;y.set(e,t);let n={edges:[],groupId:l[e].groupId,vlist:l[e].vlist};b.push(n);let r=[...l[e].edges.entries()].sort((e,t)=>e[0]-t[0]);for(let[e,t]of r){let r=String.fromCharCode(e),i=t;for(;l[i].edges.size===1&&!v(i);){let[[e,t]]=l[i].edges.entries();r+=String.fromCharCode(e),i=t}n.edges.push({label:r,oldTarget:i})}for(let e of n.edges)x(e.oldTarget);return t};x(0);let S=b.length,C=0;for(let e of b)C+=e.edges.length;let w=new Int32Array(S),T=new Int32Array(C),E=``,D=new Int32Array(S),O=new Int32Array(S),k=[];{let e=0;for(let t=0;t<S;t++){let n=b[t];w[t]=n.edges.length;for(let t of n.edges)T[e]=t.label.length,E+=t.label,k.push(y.get(t.oldTarget)),e++;D[t]=n.groupId,O[t]=n.vlist}}{let e=new Int32Array(S);for(let t=S-1;t>=0;t--){let n=1,r=t+1;for(let i=0;i<w[t];i++)n+=e[r],r+=e[r];e[t]=n}let t=0;for(let n=0;n<S;n++){let r=n+1;for(let i=0;i<w[n];i++){if(r!==k[t])throw Error(`cn compiler: edge target mismatch at ${t}`);r+=e[r],t++}}}for(let e of h)e.anchor=y.get(e.anchor);{let e=new Int32Array(d.length).fill(-1),t=[];for(let n=0;n<S;n++){let r=O[n];r>=0&&(e[r]===-1&&(e[r]=t.length,t.push(d[r])),O[n]=e[r])}d.length=0,d.push(...t)}let A=0;for(let e of d)A+=e.length;let j=new Int32Array(A),M=new Int32Array(A);{let e=0;for(let t of d)for(let[n,r]of t)j[e]=n,M[e]=r,e++}h.sort((e,t)=>e.anchor-t.anchor||e.gid-t.gid||(e.tail<t.tail?-1:1));let ee=[];for(let e of h){let t=ee[ee.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):ee.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let N=new Map,te=[];for(let e of ee){let t=e.tails.join(` `),n=N.get(t);n===void 0&&(n=te.length,N.set(t,n),te.push(e.tails)),e.set=n}for(let e of te.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let ne=new Set(te.flat()).size;ee.sort((e,t)=>e.anchor-t.anchor||e.set-t.set);for(let t of Object.values(e.conflictingClassGroups))for(let e of t)i(e);for(let t of Object.values(e.conflictingClassGroupModifiers))for(let e of t)i(e);for(let t of e.postfixLookupClassGroups??[])i(t);let re=n.length,P=new Int32Array(re).fill(-1),ie=0,ae=e=>(P[e]===-1&&(P[e]=ie++),P[e]);for(let e=0;e<M.length;e++)M[e]=ae(M[e]);for(let e of ee)e.gid=ae(e.gid);for(let e=0;e<D.length;e++)D[e]>=0&&(D[e]=ae(D[e]));for(let e=0;e<re;e++)P[e]===-1&&(P[e]=ie++);let oe=Array(re);for(let e=0;e<re;e++)oe[P[e]]=n[e];let se=[],ce=[],le=[],ue=[],de=[];for(let t=0;t<re;t++){let n=oe[t],i=(e.conflictingClassGroups[n]??[]).map(e=>P[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>P[r.get(e)]);i.length&&(se.push(t),ce.push(i.length),le.push(...i));for(let e of a)ue.push(t),de.push(e)}let fe=(e.postfixLookupClassGroups??[]).map(e=>P[r.get(e)]),pe=[],me=new Int32Array(j.length);for(let e=0;e<j.length;e++){let n=t.names[j[e]],r=ZS[n];if(r!==void 0)me[e]=r;else{let t=pe.indexOf(n);t===-1&&(t=pe.length,pe.push(n)),me[e]=Ede+t}}let he=new Map,ge=[],_e=[],ve=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(me[e++]);let r=n.join(`,`),i=he.get(r);i===void 0&&(i=ge.length,he.set(r,i),ge.push(n.length),_e.push(...n)),ve.push(i)}}let ye={};for(let e of pe)ye[e]=t.classifierFns.get(e);return{G:re,customNames:pe,impls:ye,edgeCounts:w,edgeLabelLen:T,labelText:E,edgeTargetActual:k,nodeGroup:D,nodeVlist:O,nodeCount:S,totalEdges:C,patCounts:ge,patOps:_e,listPat:ve,vlistGroup:M,litEntries:h,sets:te,attachments:ee,uniqueTailCount:ne,adjGid:se,adjCnt:ce,adjTgt:le,patGid:ue,patTgt:de,postfixLookup:fe,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},tC=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},jde=e=>{let t=Ade(e),n=t.litEntries.length,r=new Int32Array(n),i=new Int32Array(n),a=new Int32Array(n),o=``,s=new Int32Array(t.uniqueTailCount*2);{let e=new Map,n=0,c=0;for(let l of t.attachments)for(let u of t.sets[l.set]){let t=e.get(u);t===void 0&&(t=n++,e.set(u,t),s[t*2]=o.length,s[t*2+1]=u.length,o+=u),r[c]=l.anchor,i[c]=l.gid,a[c]=t,c++}}return{tables:{GROUP_COUNT:t.G,edgeStart:tC(t.edgeCounts),labelStart:tC(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:tC(t.patCounts),vlistOps:Int32Array.from(t.patOps),vlistRef:Int32Array.from(t.listPat),vlistGroup:t.vlistGroup,litAnchor:r,litGroup:i,litPool:a,poolOffsets:s,poolText:o,adjGid:Int32Array.from(t.adjGid),adjStart:tC(t.adjCnt),adjTgt:Int32Array.from(t.adjTgt),patGid:Int32Array.from(t.patGid),patTgt:Int32Array.from(t.patTgt),postfixLookupGroups:Int32Array.from(t.postfixLookup),customValidatorNames:t.customNames,orderSensitiveModifiers:t.orderSensitiveModifiers},validatorImpls:t.impls,prefix:t.prefix}},Mde=`line`in Error(),nC=-1,rC=-1,iC=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},aC=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},Nde=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,ee=new Uint8Array(M),N=0,te=!0;for(let e=0;e<m.length;e++){ee[m[e]]=1;let t=_[g[e]*2+1];t>N&&(N=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(te=!1)}let ne=1;for(;ne<m.length*2;)ne<<=1;let re=new Int32Array(ne).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(iC(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&ne-1;for(;re[n]!==-1;)n=n+1&ne-1;re[n]=e}let P=(e,t,n,r)=>{let i=(iC(t,n,r)^Math.imul(e,2654435761)|0)&ne-1,a=r-n;for(;;){let r=re[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&ne-1}},ie=n.cacheSize??8192,ae=n.prefix??e.prefix??``,oe=ae===``?``:ae+`:`,se=oe.length,ce=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),le=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ue=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,de=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pe=0,me=-1,he=-1,ge=-1,_e=-1,ve=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ye=e=>/\s/.test(String.fromCharCode(e)),be=(e,t,n)=>{if(pe=0,me=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)pe=1;else if(r===40&&i===41)pe=2;else return;ge=t+1,_e=n-1;let a=t+1;if(ve(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ve(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(me=t+1,he=a,ge=a+1)}},xe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},Se=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ce=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,we=e=>!!e&&!Number.isNaN(Number(e)),Te=(e,t,n)=>{if(n-t<11||!xe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&xe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&xe(e,t+10,t+18,`-normal/`)},Ee=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],De=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),Oe=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ke=(e,t,n,r)=>{if(e>=10){if(e>=25)return ce[e-25](t.slice(n,r));let i=e-10;if(pe!==Ee[i])return!1;if(me>=0){for(let e of De[i])if(xe(t,me,he,e))return!0;return!1}switch(Oe[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ge,_e);return le.test(e)&&!ue.test(e)}case 3:return we(t.slice(ge,_e));case 4:return fe.test(t.slice(ge,_e));default:return de.test(t.slice(ge,_e))}}switch(e){case 0:return!0;case 1:return pe===0;case 2:return pe===1;case 3:return pe===2;case 4:return Se.test(t.slice(n,r));case 5:return we(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&we(t.slice(n,r-1));case 8:return Ce.test(t.slice(n,r));default:return Te(t,n,r)}},Ae=new Set(typeof E==`string`?E.split(` `):E),je=(e,t,n,r,i,a)=>{let o=iC(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Me=new Map,Ne=new Map,Pe=2,Fe=4096,Ie=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||Ae.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Ne.get(s);return c===void 0&&Ne.set(s,c=Pe++),c},Le=new Map,Re=r,ze=r+4096,Be=()=>Re++,Ve=2097152,He=8192,Ue=new Int32Array(He),We=Array(He).fill(null),Ge=new Int32Array(He),Ke=new Int32Array(He),qe=new Uint8Array(He),Je=0,Ye=(e,t,n,r,i,a,o,s)=>{let c=e;if(We[e]!==null){if(We[e|1]===null)c=e|1;else if(!(Je++&3))c=e|Je>>2&1;else return}We[c]=t.slice(n,r),Ue[c]=i,Ge[c]=a,Ke[c]=o,qe[c]=s},Xe=()=>We.fill(null),Ze=256,Qe=[new Int32Array(Ze),new Int32Array(Ze),new Int32Array(Ze),new Int32Array(Ze)],[$e,et,tt,nt]=Qe,rt=new Uint8Array(Ze),it=new Uint8Array(Ze),at=()=>{Ze*=2,Qe=Qe.map(e=>{let t=new Int32Array(Ze);return t.set(e),t}),[$e,et,tt,nt]=Qe;let e=new Uint8Array(Ze);e.set(rt),rt=e,it=new Uint8Array(Ze)},ot=64,st=new Int32Array(ot),ct=new Int32Array(ot),lt=new Int32Array(r),ut=2048,dt=21,ft=new Float64Array(ut),pt=new Int32Array(ut),mt=0,ht=(e,t)=>{if(e===0&&t<r)return lt[t]===mt?1:(lt[t]=mt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>dt;for(;pt[i]===mt;){if(ft[i]===n)return 1;i=i+1&ut-1}return ft[i]=n,pt[i]=mt,0},gt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?nC:je(Le,e,t+1,r,0,Be)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=ct[t];if(r>n)continue;let i=st[t],a=n-r;if(ee[i]===1&&a>0&&a<=N){let t=e.charCodeAt(r);if(te===!1||t!==91&&t!==40){let t=P(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;be(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ke(d[t],e,r,n))return p[h+t]}return nC},_t=e=>{let t=e.length,n=0,c=0,u=!1;(Pe>Fe||Me.size>Fe)&&(Me=new Map,Ne=new Map,Pe=2,Xe()),Re>ze&&(Le=new Map,Re=r,Xe());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ye(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ye(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ze&&at();let _=n++;$e[_]=p,et[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Ue[y]===v&&We[y]!==null&&We[y].length===g?t=y:Ue[y|1]===v&&We[y|1]!==null&&We[y|1].length===g&&(t=y|1),t>=0){let n=We[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){tt[_]=Ge[t],nt[_]=Ke[t],rt[_]=qe[t];continue}}}let b=p;if(se!==0){if(h-p<=se||!e.startsWith(oe,p)){tt[_]=nC,Ye(y,e,p,h,v,nC,0,0);continue}b=p+se}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let N=0,te=0,ne=0,re=-1,P=0;(l[0]>=0||ee[0]===1)&&(st[0]=0,ct[0]=M,P=1);let ie=rC,ae=0;for(let t=M;t<D;t++)if(t===A&&(ie=te<ne?rC:N,ae=P),N!==rC){let n=e.charCodeAt(t),r=-1;if(te<ne)o.charCodeAt(te)===n?(te++,te===ne&&(r=N=re)):N=rC;else{let e=i[N],t=i[N+1],c=rC;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(te=e+1,ne=a[i+1],re=s[i],c=N);break}}N=c}if(r>=0&&(l[r]>=0||ee[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(P===ot){ot*=2;let e=new Int32Array(ot);e.set(st),st=e;let t=new Int32Array(ot);t.set(ct),ct=t}st[P]=r,ct[P]=t+2,P++}}A===D&&(ie=te<ne?rC:N,ae=P);let ce=te<ne?rC:N,le,ue=!1;if(A>=0){if(ue=!0,le=gt(e,E,A,ie,ae),le!==nC&&le<r&&j[le]){let t=gt(e,E,D,ce,P);t!==nC&&t!==le&&(le=t,ue=!1)}else le===nC&&(le=gt(e,E,D,ce,P),ue=!1)}else le=gt(e,E,D,ce,P);let de=0,fe=0;le===nC?tt[_]=nC:(fe=+!!ue,de=b>=C?+!!O:je(Me,e,b,C,+!!O,e=>Ie(e,O)),tt[_]=le,rt[_]=fe,nt[_]=de),Ye(y,e,p,h,v,le,de,fe)}if(n===0)return``;if(n===1)return $e[0]===0&&et[0]===t?e:e.slice($e[0],et[0]);if(n*k>ut){for(;n*k>ut;)ut<<=1,dt--;ft=new Float64Array(ut),pt=new Int32Array(ut)}if(Pe>=Ve||Re>=Ve)throw Error(`cn: too many distinct classes in one merge`);mt=mt+1|0,mt===0&&(lt.fill(0),pt.fill(0),mt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=tt[e];if(t===nC){it[e]=1;continue}let n=nt[e];if(ht(n,t)===1){it[e]=0,f=!0;continue}if(it[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)ht(n,x[e]);if(rt[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&ht(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!it[m]){m++;continue}let t=$e[m],r=et[m],i=m+1;for(;i<n&&it[i]&&$e[i]===r+1&&e.charCodeAt(r)===32;)r=et[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},vt=16384,yt=new Int32Array(vt*2),bt=0,xt=1,St=Object.create(null),Ct=Object.create(null),wt=new Map,Tt=new Map,Et=0,Dt=0,Ot=()=>{bt^=vt,xt=xt+1|0,Dt=0},kt=e=>{let t=St[e];if(t!==void 0)return t;let n=aC(e,0,e.length),r=(n&16383)+bt,i=yt[r]===(n^xt)||yt[r^vt]===(n^xt-1);return i&&(t=Ct[e],t!==void 0)?(St[e]=t,t):(t=_t(e),i?(St[e]=t,++Et>ie&&(Et=0,Ct=St,St=Object.create(null),Ot())):(yt[r]=n^xt,++Dt>vt&&Ot()),t)},At=e=>{let t=wt.get(e);if(t!==void 0)return t;let n=aC(e,0,e.length),r=(n&16383)+bt,i=yt[r]===(n^xt)||yt[r^vt]===(n^xt-1);return i&&(t=Tt.get(e),t!==void 0)?(wt.set(e,t),t):(t=_t(e),i?(wt.set(e,t),++Et>ie&&(Et=0,Tt=wt,wt=new Map,Ot())):(yt[r]=n^xt,++Dt>vt&&Ot()),t)},jt=e=>{let t=aC(e,0,e.length),n=(t&16383)+bt;return yt[n]===(t^xt)||yt[n^vt]===(t^xt-1)||(yt[n]=t^xt,++Dt>vt&&Ot(),!1)},Mt=ie===0?_t:Mde?e=>{let t=wt.get(e);return t===void 0?At(e):t}:kt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Mt(arguments[0]):Mt(Fde.apply(null,arguments))},mergeString:Mt,seenBefore:ie===0?()=>!1:jt,mergeUncached:_t}},oC=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:oC(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Pde=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:oC(i,t);a&&(n&&(n+=` `),n+=a)}return n},Fde=function(){return Pde(arguments,!1)},Ide=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},l=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},u=(t,c)=>{let u=t.length,d=s===null?null:s.n;if(!c){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let f=``,p=-1,m=0,h=!1;for(let e=0;e<u;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=oC(n,!0),!n)continue;h=!0}p<0&&(f=n,p=e),m++}}if(m===0)return``;if(m===1)return e(f);if(h){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let g=i.get(f);g===void 0&&(g=a.get(f),g!==void 0&&i.set(f,g));let _=null;if(g!==void 0)outer:for(let e=0;e<g.length;e++){let n=g[e];if(n.t!==m)continue;let r=n.a,i=1;for(let e=p+1;e<u;e++){let n=t[e];if(n&&n!==r[i++])continue outer}_=n;break}if(_===null){let s=f,c=[f];for(let e=p+1;e<u;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);_={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},g===void 0&&i.set(f,g=[]),g.length>=256&&g.shift(),g.push(_),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==_&&(s.n=_),s=_,_.r},d=t=>Array.isArray(t)?u(t.slice(),!1):e(oC(t,!0));return function(t,n,r){let i=arguments.length;if((i|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&c(i,t,n,r))return s=i,i.r;if(e!==i&&c(e,t,n,r))return e.r}return u([t,n,r],!0)}if(i===1)return typeof t==`string`?e(t):d(t);let a=s;if(a!==null){let e=a.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<i;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(a!==e){let e=a.a,t=0,n=!0;for(let r=0;r<i;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===a.t)return a.r}}let o=[];for(let e=0;e<i;e++)o.push(arguments[e]);return u(o,!0)}},Lde=`{"theme":{"animate":[{"$v":"isAny"}],"aspect":["video"],"blur":[{"$v":"isTshirtSize"}],"breakpoint":[{"$v":"isTshirtSize"}],"color":[{"$v":"isAny"}],"container":[{"$v":"isTshirtSize"}],"drop-shadow":[{"$v":"isTshirtSize"}],"ease":["in","out","in-out"],"font":[{"$v":"isAnyNonArbitrary"}],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[{"$v":"isTshirtSize"}],"leading":["none","tight","snug","normal","relaxed","loose"],"perspective":["dramatic","near","normal","midrange","distant","none"],"radius":[{"$v":"isTshirtSize"}],"shadow":[{"$v":"isTshirtSize"}],"spacing":["px",{"$v":"isNumber"}],"text":[{"$v":"isTshirtSize"}],"text-shadow":[{"$v":"isTshirtSize"}],"tracking":["tighter","tight","normal","wide","wider","widest"]},"classGroups":{"aspect":[{"aspect":["auto","square",{"$v":"isFraction"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"aspect"}]}],"container":["container"],"container-type":[{"@container":["","normal","size",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"container-named":[{"$v":"isNamedContainerQuery"}],"columns":[{"columns":[{"$v":"isNumber"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"container"}]},"columns-auto"],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],"box":[{"box":["border","content"]}],"display":["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],"sr":["sr-only","not-sr-only"],"float":[{"float":["right","left","none","start","end"]}],"clear":[{"clear":["left","right","both","none","start","end"]}],"isolation":["isolate","isolation-auto"],"object-fit":[{"object":["contain","cover","fill","none","scale-down"]}],"object-position":[{"object":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"overflow":[{"overflow":["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],"overscroll":[{"overscroll":["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],"position":["static","fixed","absolute","relative","sticky"],"inset":[{"inset":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-x":[{"inset-x":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-y":[{"inset-y":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"start":[{"inset-s":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"start":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"end":[{"inset-e":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"end":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-bs":[{"inset-bs":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-be":[{"inset-be":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"top":[{"top":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"right":[{"right":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"bottom":[{"bottom":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"left":[{"left":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"visibility":["visible","invisible","collapse"],"z":[{"z":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"basis":[{"basis":[{"$v":"isFraction"},"full","auto",{"$t":"container"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"flex-direction":[{"flex":["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{"flex":["nowrap","wrap","wrap-reverse"]}],"flex":[{"flex":[{"$v":"isNumber"},{"$v":"isFraction"},"auto","initial","none",{"$v":"isArbitraryValue"}]}],"grow":[{"grow":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shrink":[{"shrink":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"order":[{"order":[{"$v":"isInteger"},"first","last","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-cols":[{"grid-cols":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start-end":[{"col":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start":[{"col-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-end":[{"col-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-rows":[{"grid-rows":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start-end":[{"row":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start":[{"row-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-end":[{"row-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-cols":[{"$t":"spacing"}]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-rows":[{"$t":"spacing"}]}],"gap":[{"gap":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-x":[{"gap-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-y":[{"gap-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"justify-content":[{"justify":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{"content":["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{"items":["start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"align-self":[{"self":["auto","start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"p":[{"p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"px":[{"px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"py":[{"py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ps":[{"ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pe":[{"pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbs":[{"pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbe":[{"pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pt":[{"pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pr":[{"pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pb":[{"pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pl":[{"pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"m":[{"m":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mx":[{"mx":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"my":[{"my":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ms":[{"ms":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"me":[{"me":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbs":[{"mbs":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbe":[{"mbe":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mt":[{"mt":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mr":[{"mr":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mb":[{"mb":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ml":[{"ml":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x":[{"space-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-y-reverse":["space-y-reverse"],"size":[{"size":[{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inline-size":[{"inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"inline":[{"$t":"container"}]}],"min-inline-size":[{"min-inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"min-inline":[{"$t":"container"}]}],"max-inline-size":[{"max-inline":["none",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"max-inline":[{"$t":"container"}]}],"block-size":[{"block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-block-size":[{"min-block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-block-size":[{"max-block":["none",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"w":[{"w":[{"$t":"container"},"screen",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-w":[{"min-w":[{"$t":"container"},"screen","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-w":[{"max-w":[{"$t":"container"},"screen","none","prose",{"screen":[{"$t":"breakpoint"}]},{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"h":[{"h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-h":[{"min-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-h":[{"max-h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},"max-h-none"],"font-size":[{"text":["base",{"$t":"text"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{"font":[{"$t":"font-weight"},{"$v":"isArbitraryVariableWeight"},{"$v":"isArbitraryWeight"}]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",{"$v":"isPercent"},{"$v":"isArbitraryValue"}]}],"font-family":[{"font":[{"$v":"isArbitraryVariableFamilyName"},{"$v":"isArbitraryFamilyName"},{"$t":"font"}]}],"font-features":[{"font-features":[{"$v":"isArbitraryValue"}]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],"tracking":[{"tracking":[{"$t":"tracking"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"line-clamp":[{"line-clamp":[{"$v":"isNumber"},"none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryNumber"}]}],"leading":[{"leading":[{"$t":"leading"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"list-image":[{"list-image":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"list-style-position":[{"list":["inside","outside"]}],"list-style-type":[{"list":["disc","decimal","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-alignment":[{"text":["left","center","right","justify","start","end"]}],"placeholder-color":[{"placeholder":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-color":[{"text":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{"decoration":["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{"decoration":[{"$v":"isNumber"},"from-font","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryLength"}]}],"text-decoration-color":[{"decoration":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"underline-offset":[{"underline-offset":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{"text":["wrap","nowrap","balance","pretty"]}],"indent":[{"indent":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"tab-size":[{"tab":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"vertical-align":[{"align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"whitespace":[{"whitespace":["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],"break":[{"break":["normal","words","all","keep"]}],"wrap":[{"wrap":["break-word","anywhere","normal"]}],"hyphens":[{"hyphens":["none","manual","auto"]}],"content":[{"content":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"bg-attachment":[{"bg":["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{"bg":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-repeat":[{"bg":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"bg-size":[{"bg":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-image":[{"bg":["none",{"linear":[{"to":["t","tr","r","br","b","bl","l","tl"]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"radial":["",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"conic":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isArbitraryVariableImage"},{"$v":"isArbitraryImage"}]},{"bg-gradient-to":["t","tr","r","br","b","bl","l","tl"]},"bg-conic"],"bg-color":[{"bg":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-from-pos":[{"from":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-via-pos":[{"via":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-to-pos":[{"to":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-from":[{"from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-via":[{"via":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-to":[{"to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded":[{"rounded":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-s":[{"rounded-s":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-e":[{"rounded-e":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-t":[{"rounded-t":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-r":[{"rounded-r":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-b":[{"rounded-b":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-l":[{"rounded-l":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ss":[{"rounded-ss":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-se":[{"rounded-se":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ee":[{"rounded-ee":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-es":[{"rounded-es":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tl":[{"rounded-tl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tr":[{"rounded-tr":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-br":[{"rounded-br":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-bl":[{"rounded-bl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-w":[{"border":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-x":[{"border-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-y":[{"border-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-s":[{"border-s":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-e":[{"border-e":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-bs":[{"border-bs":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-be":[{"border-be":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-t":[{"border-t":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-r":[{"border-r":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-b":[{"border-b":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-l":[{"border-l":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x":[{"divide-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{"border":["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{"divide":["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{"border":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-x":[{"border-x":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-y":[{"border-y":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-s":[{"border-s":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-e":[{"border-e":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-bs":[{"border-bs":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-be":[{"border-be":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-t":[{"border-t":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-r":[{"border-r":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-b":[{"border-b":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-l":[{"border-l":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"divide-color":[{"divide":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-style":[{"outline":["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-w":[{"outline":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"outline-color":[{"outline":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shadow":[{"shadow":["","none",{"$t":"shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]},"shadow-inner"],"shadow-color":[{"shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-shadow":[{"inset-shadow":["none",{"$t":"inset-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"inset-shadow-color":[{"inset-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-w":[{"ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"ring-w-inset":["ring-inset"],"ring-color":[{"ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-offset-w":[{"ring-offset":[{"$v":"isNumber"},{"$v":"isArbitraryLength"}]}],"ring-offset-color":[{"ring-offset":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-ring-w":[{"inset-ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"inset-ring-color":[{"inset-ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-shadow":[{"text-shadow":["none",{"$t":"text-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"text-shadow-color":[{"text-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"opacity":[{"opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{"mask":["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[{"$v":"isNumber"}]}],"mask-image-linear-from-pos":[{"mask-linear-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-to-pos":[{"mask-linear-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-from-color":[{"mask-linear-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-linear-to-color":[{"mask-linear-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-from-pos":[{"mask-t-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-to-pos":[{"mask-t-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-from-color":[{"mask-t-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-to-color":[{"mask-t-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-from-pos":[{"mask-r-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-to-pos":[{"mask-r-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-from-color":[{"mask-r-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-to-color":[{"mask-r-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-from-pos":[{"mask-b-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-to-pos":[{"mask-b-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-from-color":[{"mask-b-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-to-color":[{"mask-b-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-from-pos":[{"mask-l-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-to-pos":[{"mask-l-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-from-color":[{"mask-l-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-to-color":[{"mask-l-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-from-pos":[{"mask-x-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-to-pos":[{"mask-x-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-from-color":[{"mask-x-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-to-color":[{"mask-x-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-from-pos":[{"mask-y-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-to-pos":[{"mask-y-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-from-color":[{"mask-y-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-to-color":[{"mask-y-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial":[{"mask-radial":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-from-pos":[{"mask-radial-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-to-pos":[{"mask-radial-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-from-color":[{"mask-radial-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-to-color":[{"mask-radial-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{"closest":["side","corner"],"farthest":["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[{"$v":"isNumber"}]}],"mask-image-conic-from-pos":[{"mask-conic-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-to-pos":[{"mask-conic-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-from-color":[{"mask-conic-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-conic-to-color":[{"mask-conic-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-mode":[{"mask":["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{"mask":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-repeat":[{"mask":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"mask-size":[{"mask":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{"mask":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"filter":[{"filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"blur":[{"blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"brightness":[{"brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contrast":[{"contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"drop-shadow":[{"drop-shadow":["","none",{"$t":"drop-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"drop-shadow-color":[{"drop-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grayscale":[{"grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"hue-rotate":[{"hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"invert":[{"invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"saturate":[{"saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"sepia":[{"sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-filter":[{"backdrop-filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-blur":[{"backdrop-blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-brightness":[{"backdrop-brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-contrast":[{"backdrop-contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-grayscale":[{"backdrop-grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-invert":[{"backdrop-invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-opacity":[{"backdrop-opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-saturate":[{"backdrop-saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-sepia":[{"backdrop-sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-collapse":[{"border":["collapse","separate"]}],"border-spacing":[{"border-spacing":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-x":[{"border-spacing-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-y":[{"border-spacing-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"table-layout":[{"table":["auto","fixed"]}],"caption":[{"caption":["top","bottom"]}],"transition":[{"transition":["","all","colors","opacity","shadow","transform","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transition-behavior":[{"transition":["normal","discrete"]}],"duration":[{"duration":[{"$v":"isNumber"},"initial",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ease":[{"ease":["linear","initial",{"$t":"ease"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"delay":[{"delay":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"animate":[{"animate":["none",{"$t":"animate"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backface":[{"backface":["hidden","visible"]}],"perspective":[{"perspective":[{"$t":"perspective"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"perspective-origin":[{"perspective-origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate":[{"rotate":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-x":[{"rotate-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-y":[{"rotate-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-z":[{"rotate-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale":[{"scale":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-x":[{"scale-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-y":[{"scale-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-z":[{"scale-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-3d":["scale-3d"],"skew":[{"skew":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-x":[{"skew-x":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-y":[{"skew-y":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform":[{"transform":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},"","none","gpu","cpu"]}],"transform-origin":[{"origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform-style":[{"transform":["3d","flat"]}],"translate":[{"translate":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-x":[{"translate-x":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-y":[{"translate-y":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-z":[{"translate-z":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-none":["translate-none"],"zoom":[{"zoom":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"accent":[{"accent":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"appearance":[{"appearance":["none","auto"]}],"caret-color":[{"caret":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"color-scheme":[{"scheme":["normal","dark","light","light-dark","only-dark","only-light"]}],"cursor":[{"cursor":["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],"resize":[{"resize":["none","","y","x"]}],"scroll-behavior":[{"scroll":["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-track-color":[{"scrollbar-track":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{"scrollbar":["auto","thin","none"]}],"scroll-m":[{"scroll-m":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mx":[{"scroll-mx":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-my":[{"scroll-my":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ms":[{"scroll-ms":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-me":[{"scroll-me":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbs":[{"scroll-mbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbe":[{"scroll-mbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mt":[{"scroll-mt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mr":[{"scroll-mr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mb":[{"scroll-mb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ml":[{"scroll-ml":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-p":[{"scroll-p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-px":[{"scroll-px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-py":[{"scroll-py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ps":[{"scroll-ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pe":[{"scroll-pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbs":[{"scroll-pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbe":[{"scroll-pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pt":[{"scroll-pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pr":[{"scroll-pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pb":[{"scroll-pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pl":[{"scroll-pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"snap-align":[{"snap":["start","end","center","align-none"]}],"snap-stop":[{"snap":["normal","always"]}],"snap-type":[{"snap":["none","x","y","both"]}],"snap-strictness":[{"snap":["mandatory","proximity"]}],"touch":[{"touch":["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],"select":[{"select":["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"fill":[{"fill":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"stroke-w":[{"stroke":[{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"},{"$v":"isArbitraryNumber"}]}],"stroke":[{"stroke":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}],"contain":[{"contain":["none","content","strict",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contain-size":[{"contain":["size","inline-size"]}],"contain-layout":["contain-layout"],"contain-paint":["contain-paint"],"contain-style":["contain-style"]},"conflictingClassGroups":{"container-named":["container-type"],"overflow":["overflow-x","overflow-y"],"overscroll":["overscroll-x","overscroll-y"],"inset":["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],"flex":["basis","grow","shrink"],"gap":["gap-x","gap-y"],"p":["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],"px":["pr","pl"],"py":["pt","pb"],"m":["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],"mx":["mr","ml"],"my":["mt","mb"],"size":["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],"rounded":["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"translate":["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],"touch":["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"],"contain":["contain-size","contain-layout","contain-paint","contain-style"],"contain-size":["contain"],"contain-layout":["contain"],"contain-paint":["contain"],"contain-style":["contain"]},"conflictingClassGroupModifiers":{"font-size":["leading"]},"orderSensitiveModifiers":["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"],"postfixLookupClassGroups":["container-type"]}`,sC=()=>JSON.parse(Lde),Rde=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,zde=e=>e===void 0?{config:sC()}:typeof e==`function`?{config:e(sC())}:Rde(e)?{config:e}:{config:Tde(sC(),e),cacheSize:e.cacheSize},Bde=e=>{let{config:t,cacheSize:n}=zde(e),{tables:r,validatorImpls:i,prefix:a}=jde(t);return Nde(r,i,{cacheSize:n,prefix:a})},cC=(e=>{let t=null,n=()=>t??=Bde(e);return Ide(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{theme:{spacing:[...Hue]}}}),lC=Object.freeze({reduced:!1,squish:90,fast:120,normal:180,slow:280,springDuration:320,bounce:.3,stretch:.28,distance:4,stagger:24,blur:0,shake:3,steps:0,fuse:1,pressDepth:.5,pressScale:1,ease:`cubic-bezier(0.2, 0, 0, 1)`,easeExit:`cubic-bezier(0.4, 0, 1, 1)`}),uC=`(prefers-reduced-motion: reduce)`;function dC(e){let t=e.ownerDocument.defaultView;if(!t)return lC;let n=t.getComputedStyle(e),r=(e,t)=>{let r=n.getPropertyValue(e).trim(),i=Number.parseFloat(r);return Number.isFinite(i)?Math.max(0,i):t},i=(e,t)=>{let i=n.getPropertyValue(e).trim();return r(e,t)*(i.endsWith(`s`)&&!i.endsWith(`ms`)?1e3:1)},a=t.matchMedia?.(uC).matches??!1,o=(e,t)=>a?120:i(`--stipe-motion-${e}`,t),s=(e,t)=>a?0:r(`--stipe-motion-${e}`,t);return{reduced:a,squish:o(`squish`,lC.squish),fast:o(`fast`,lC.fast),normal:o(`normal`,lC.normal),slow:o(`slow`,lC.slow),springDuration:o(`spring-duration`,lC.springDuration),bounce:Math.min(1,s(`bounce`,lC.bounce)),stretch:s(`stretch`,lC.stretch),distance:s(`distance`,lC.distance),stagger:a?0:i(`--stipe-motion-stagger`,lC.stagger),blur:s(`blur`,lC.blur),shake:s(`shake`,lC.shake),steps:Math.floor(s(`steps`,lC.steps)),fuse:r(`--stipe-motion-fuse`,lC.fuse),pressDepth:a?0:r(`--stipe-press-depth`,lC.pressDepth),pressScale:a?1:r(`--stipe-press-scale`,lC.pressScale),ease:n.getPropertyValue(`--stipe-motion-ease`).trim()||lC.ease,easeExit:n.getPropertyValue(`--stipe-motion-ease-exit`).trim()||lC.easeExit}}function fC(e){let[t,n]=(0,F.useState)(()=>({...lC,reduced:!0}));return(0,F.useLayoutEffect)(()=>{let t=e.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let i=()=>{let e=dC(t);n(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)};i();let a=new r.MutationObserver(i);for(let e=t;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`data-theme`,`class`,`style`]});let o=r.matchMedia?.(uC);return o?.addEventListener(`change`,i),()=>{a.disconnect(),o?.removeEventListener(`change`,i)}},[e]),t}function pC(e,t){return e.reduced?0:Math.round(t*e.normal/lC.normal)}function Vde(e,t){if(e.reduced)return 0;let n=t*e.bounce/lC.bounce;return Math.min(.9,Math.max(0,n))}function Hde(e,t){return e.reduced?0:Math.round(t*e.springDuration/lC.springDuration)}function mC(e,t){return e.steps>0?`steps(${String(e.steps)}, end)`:t}function hC(e){return`animate`in e}var gC=globalThis;function Ude(){return gC.matchMedia?.(uC).matches??!1}function Wde(e){let t=gC.matchMedia?.(uC);return t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}}function Gde(){return!0}function _C(){return(0,F.useSyncExternalStore)(Wde,Ude,Gde)}var vC=(0,F.forwardRef)(function({asChild:e=!1,className:t,...n},r){let i=cC(`absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]`,t);return e?(0,R.jsx)(ES,{...n,className:i,ref:r}):(0,R.jsx)(`span`,{...n,className:i,ref:r})}),yC=typeof window<`u`,bC=yC?window:null,xC=yC?document:null,SC={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},CC={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},wC={NONE:0,AUTO:1,FORCE:2},TC={replace:0,none:1,blend:2},EC=Symbol(),DC=Symbol(),OC=Symbol(),kC=Symbol(),Kde=Symbol(),AC=1e-11,jC=0xe8d4a51000,MC=1e3,NC=[],PC=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),FC=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],qde=FC.reduce((e,t)=>({...e,[t]:t+`(`}),{}),IC=()=>{},Jde=e=>e,Yde=/\)\s*[-.\d]/,Xde=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Zde=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,Qde=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,$de=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,efe=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,LC=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,tfe=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,RC=/([a-z])([A-Z])/g,zC=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,BC={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:MC,delay:0,loopDelay:0,ease:`out(2)`,composition:TC.replace,modifier:Jde,onBegin:IC,onBeforeUpdate:IC,onUpdate:IC,onLoop:IC,onPause:IC,onComplete:IC,onRender:IC},VC={current:null,root:xC},HC={defaults:BC,precision:4,timeScale:1,tickThreshold:200,editor:null},UC={version:`4.5.0`,engine:null};yC&&(bC.AnimeJS||=[],bC.AnimeJS.push(UC));var WC=e=>e.replace(RC,`$1-$2`).toLowerCase(),GC=(e,t)=>e.indexOf(t)===0,KC=Date.now,qC=Array.isArray,JC=e=>e&&e.constructor===Object,nfe=e=>typeof e==`number`&&!isNaN(e),YC=e=>typeof e==`string`,XC=e=>typeof e==`function`,ZC=e=>e===void 0,QC=e=>ZC(e)||e===null,$C=e=>yC&&e instanceof SVGElement,ew=e=>Xde.test(e),tw=e=>GC(e,`rgb`),nw=e=>GC(e,`hsl`),rfe=e=>ew(e)||(tw(e)||nw(e))&&(e[e.length-1]===`)`||!Yde.test(e)),rw=e=>!HC.defaults.hasOwnProperty(e),ife=[`opacity`,`rotate`,`overflow`,`color`],afe=(e,t)=>{if(ife.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},iw=Math.pow,aw=Math.sqrt,ow=Math.sin,sw=Math.cos,ofe=Math.abs,cw=Math.exp,sfe=Math.ceil,lw=Math.floor,cfe=Math.asin,uw=Math.PI,dw=Math.round,fw=(e,t,n)=>e<t?t:e>n?n:e,pw=(e,t)=>{if(t<0)return e;if(!t)return dw(e);let n=10**t;return dw(e*n)/n},mw=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,hw=e=>e===1/0?jC:e===-1/0?-jC:e,gw=e=>e<=1e-11?AC:hw(pw(e,11)),_w=e=>qC(e)?[...e]:e,lfe=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=ZC(i)?t[r]:i}return n},vw=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},yw=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},bw=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},ufe=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[kC],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!ZC(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:GC(t,`scale`)?`1`:GC(t,`rotate`)||GC(t,`skew`)?`0deg`:`0px`},xw=e=>{let t=``;for(let n=0,r=FC.length;n<r;n++){let r=FC[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${qde[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Sw=[];function Cw(e,t){if(!e)return null;let n=Sw.length;outer:for(let r=0;r<n;r++){let n=Sw[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=Sw[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var dfe=e=>{let t=Zde.exec(e)||Qde.exec(e),n=ZC(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},ffe=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},ww=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),pfe=e=>{let t=$de.exec(e)||efe.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=ZC(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=pw(ww(t,e,n+1/3)*255,0),s=pw(ww(t,e,n)*255,0),c=pw(ww(t,e,n-1/3)*255,0)}return[o,s,c,a]},mfe=e=>tw(e)?dfe(e):ew(e)?ffe(e):nw(e)?pfe(e):[0,0,0,1],Tw=(e,t)=>ZC(e)?t:e,Ew=(e,t)=>{let n=e.match(zC),r=t[DC]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Dw=(e,t,n,r,i,a)=>{if(XC(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(YC(e)&&GC(e,`var(`)){if(!i)return Ew(e,t);let n=()=>Ew(e,t);return i.func=n,n()}return e},Ow=(e,t)=>e[DC]?e[OC]&&afe(e,t)?SC.ATTRIBUTE:FC.includes(t)||PC.get(t)?SC.TRANSFORM:GC(t,`--`)?SC.CSS_VAR:t in e.style?SC.CSS:t in e?SC.OBJECT:SC.ATTRIBUTE:SC.OBJECT,kw=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[Kde]||e).getPropertyValue(t);return i===`auto`?`0`:i},Aw=(e,t,n,r)=>{let i=ZC(n)?Ow(e,t):n,a=Cw(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===SC.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===SC.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===SC.TRANSFORM?ufe(e,t,r):i===SC.CSS_VAR?kw(e,t,r).trimStart():kw(e,t,r)},jw=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,Mw=()=>({t:CC.NUMBER,n:0,u:null,o:null,d:null,s:null}),Nw=(e,t)=>{if(t.t=CC.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&tfe.exec(r);if(i)return t.t=CC.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(rfe(r))return t.t=CC.COLOR,t.d=mfe(r),t;{let e=r.match(LC);return t.t=CC.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(LC)||[],t}},Pw=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=_w(e._toNumbers),t.s=_w(e._strings),t),Fw=Mw(),Iw=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(pw(mw(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},Lw=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=fw(g,-h,o),b=fw(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=AC,T=i===wC.FORCE,E=0,D=v,O=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=fw(n,0,l),C&&e._currentIteration--,E=e._currentIteration%2,D=b-n*t||0}let k=f^(p&&E),A=e._ease,j=C?k?0:o:k?c-D:D;A&&(j=c*A(j/c)||0);let M=(a?a.backwards:v<g)?!k:!!k;if(e._currentTime=v,e._iterationTime=j,e.backwards=M,S&&!e.began?(e.began=!0,!n&&!(a&&(M||!a.began))&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===wC.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||j>=_&&y!==o||j<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(M?x*-1:x)>=HC.tickThreshold,i=pw(e._offset+(a?a._offset:0)+h+j,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==TC.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&j<p._startTime))&&(!m||_||j>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=fw(j-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===SC.OBJECT,g=f===CC.NUMBER,_=g&&m||n===0||n===1?-1:HC.precision,v,y;if(g)v=y=i(pw(mw(o._fromNumber,o._toNumber,n),_));else if(f===CC.UNIT)y=i(pw(mw(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===CC.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(mw(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${pw(e[0],0)},${pw(e[1],0)},${pw(e[2],0)},${e[3]})`)}else f===CC.COMPLEX&&(v=Iw(o,n,_));if(h&&(o._number=y),!r&&e!==TC.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===SC.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===SC.TRANSFORM?(s!==l&&(l=s,u=s[kC]),u[e]=v,d=1):p===SC.CSS?c[e]=v:p===SC.CSS_VAR&&c.setProperty(e,v)),S&&(O=1)}else o._value=v}else n&&m&&!_&&j<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=xw(u),d=0),o=o._next}!n&&O&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!M&&v>0&&!s||M&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!M):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&!(a&&(M||!a.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,O},Rw=(e,t,n,r,i)=>{let a=e._currentIteration;if(Lw(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=KC(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;vw(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&Lw(t,e,n,1,wC.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}vw(o,e=>{let t=pw((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=Lw(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},zw={},hfe=(e,t,n)=>{if(n===SC.TRANSFORM)return PC.get(e)||e;if(n===SC.CSS||n===SC.ATTRIBUTE&&$C(t)&&e in t.style){let t=zw[e];if(t)return t;{let t=e&&WC(e);return zw[e]=t,t}}return e},Bw=(e,t=!1)=>{if(e._hasChildren)vw(e,e=>Bw(e,t),!0);else{let n=e;n.pause(),vw(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=QC(o)||o===``;if(e._setter){if(!t&&!s){if(Nw(o,Fw),Fw.d){let t=Fw.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=Fw.n;e._setter(e.target,e._number,e)}}else if(a===SC.OBJECT)!t&&!s&&(i[r]=o);else if(i[DC]){if(a===SC.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===SC.TRANSFORM){let n=i[kC];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=xw(n):t.removeProperty(`transform`))}else s?t.removeProperty(WC(r)):t[r]=o}}i[DC]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Vw=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=MC/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?AC:t,r=MC/n;n>BC.frameRate&&(BC.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?AC:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?wC.NONE:(this._lastTickTime=n>=t?e-n%t:e,wC.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Hw={animation:null,update:IC},gfe=e=>{let t=Hw.animation;return t||(t={duration:AC,computeDeltaTime:IC,_offset:0,_delay:0,_head:null,_tail:null},Hw.animation=t,Hw.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===CC.COMPLEX||e===CC.COLOR?_w(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),Lw(t,1,1,0,wC.FORCE)}),t},Uw=yC?requestAnimationFrame:setImmediate,_fe=yC?cancelAnimationFrame:clearImmediate,vfe=class extends Vw{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=BC,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=KC();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(yw(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Rw(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):wC.AUTO),r=i}Hw.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(KC()),this.reqId=Uw(Gw)),this}pause(){if(this.reqId)return this.paused=!0,yfe()}resume(){if(this.paused)return this.paused=!1,vw(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(HC.timeScale===1?1:MC)}set speed(e){let t=e*HC.timeScale;this._speed!==t&&(this._speed=t,vw(this,e=>e.speed=e._speed))}get timeUnit(){return HC.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(HC.timeScale!==r){HC.timeScale=r,HC.tickThreshold=200*r;let e=n?t:MC;this.defaults.duration*=e,this._speed*=e}}get precision(){return HC.precision}set precision(e){HC.precision=e}},Ww=(()=>{let e=new vfe(KC());return yC&&(UC.engine=e,xC.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(xC.hidden?e.pause():e.resume())})),e})(),Gw=()=>{Ww._head?(Ww.reqId=Uw(Gw),Ww.update()):Ww.reqId=0},yfe=()=>(_fe(Ww.reqId),Ww.reqId=0,Ww),Kw={_rep:new WeakMap,_add:new Map},qw=(e,t,n=`_rep`)=>{let r=Kw[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},bfe=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Jw=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=AC,e._currentTime=AC},Yw=(e,t)=>{let n=e._composition;if(n===TC.replace){let n=e._absoluteStartTime;bw(t,e,bfe,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){Jw(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)Jw(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=pw(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&Jw(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(vw(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;vw(e,e=>{e!==t&&vw(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===TC.blend){let t=qw(e.target,e.property,`_add`),n=gfe(Kw._add),r=t._head;r||(r={...e},r._composition=TC.replace,r._updateDuration=AC,r._startTime=0,r._numbers=_w(e._fromNumbers),r._number=0,r._next=null,r._prev=null,bw(t,r),bw(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=_w(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=_w(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}bw(t,e,null,`_prevAdd`,`_nextAdd`)}return e},xfe=e=>{let t=e._composition;if(t!==TC.none){let n=e.target,r=e.property,i=Kw._rep.get(n)[r];if(yw(i,e,`_prevRep`,`_nextRep`),t===TC.blend){let t=Kw._add,i=t.get(n);if(!i)return;let a=i[r],o=Hw.animation;yw(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){yw(a,s,`_prevAdd`,`_nextAdd`),yw(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},Xw=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Zw=e=>e._cancelled?(e._hasChildren?vw(e,Zw):vw(e,e=>{e._composition!==TC.none&&Yw(e,qw(e.target,e.property))}),e._cancelled=0,e):e,Qw=0,Sfe=(e,t)=>e._priority>t._priority,Cfe=class extends Vw{constructor(e={},t=null,n=0){super(0),++Qw;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;VC.current&&VC.current.register(this);let b=t?0:Ww._lastTickTime,x=t?t.defaults:HC.defaults,S=XC(i)||ZC(i)?x.delay:+i,C=XC(a)||ZC(a)?1/0:+a,w=Tw(c,x.loop),T=Tw(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(Ww.reqId||Ww.requestTick(KC()),D=(Ww._lastTickTime-Ww._startTime)*HC.timeScale),this.id=ZC(r)?Qw:r,this.parent=t,this.duration=hw((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&Tw(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=IC,this._running=!1,this._reversed=+Tw(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Tw(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=Tw(d,x.frameRate),this._speed=Tw(f,x.playbackRate),this._priority=+Tw(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return fw(pw(this._currentTime,HC.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return fw(pw(this._iterationTime,HC.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return fw(pw(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return fw(pw(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*fw(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Zw(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Rw(this,0,1,~~e,wC.FORCE),Xw(this),this._hasChildren&&vw(this,Xw),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Rw(this,this.duration,1,~~e,wC.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!ZC(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*Ww._speed);return this._startTime=KC()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Rw(this,AC,0,0,wC.FORCE):(this._running||=(bw(Ww,this,Sfe),Ww._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,Ww.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){Zw(this),this.completed=!1;let r=this.paused;return this.paused=!0,Rw(this,e+this._delay,~~t,~~n,wC.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?lw(jC/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?vw(this,e=>e.cancel(),!0):vw(this,xfe),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=gw(e);if(t===n)return this;let r=e/t,i=e<=AC;return this.duration=i?AC:n,this.iterationDuration=i?AC:gw(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Rw(this,0,1,0,wC.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=IC){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=IC};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function $w(e){let t=YC(e)?VC.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function eT(e){if(QC(e))return[];if(!yC)return qC(e)&&e.flat(1/0)||[e];if(qC(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!QC(r)){let e=$w(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!QC(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=$w(e);return t?Array.from(t):[e]}function tT(e){let t=eT(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[EC]){n[EC]=!0;let e=$C(n);(n.nodeType||e)&&(n[DC]=!0,n[OC]=e,n[kC]={})}}return t}var nT={deg:1,rad:180/uw,turn:360},rT={},iT=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===CC.UNIT&&i===n)return t;let o=a+i+n,s=rT[o];if(!ZC(s)&&!r)t.n=s;else{let r;if(i in nT)r=a*nT[i]/nT[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==xC?o:xC.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,rT[o]=r}return t.t,CC.UNIT,t.u=n,t},aT=e=>e,oT=(e=1.68)=>t=>iw(t,+e),sT={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},wfe=uw/2,cT=uw*2,lT={"":oT,Quad:oT(2),Cubic:oT(3),Quart:oT(4),Quint:oT(5),Sine:e=>1-sw(e*wfe),Circ:e=>1-aw(1-e*e),Expo:e=>e?iw(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=iw(2,--n))-1)/11;);return 1/iw(4,3-n)-7.5625*iw((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=fw(+e,1,10),r=fw(+t,AC,2),i=r/cT*cfe(1/n),a=cT/r;return e=>e===0||e===1?e:-n*iw(2,-10*(1-e))*ow((1-e-i)*a)}},uT=(()=>{let e={linear:aT,none:aT};for(let t in sT)for(let n in lT){let r=lT[n],i=sT[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),dT={linear:aT,none:aT},Tfe=e=>{if(dT[e])return dT[e];if(e.indexOf(`(`)<=-1){let t=sT[e]||e.includes(`Back`)||e.includes(`Elastic`)?uT[e]():uT[e];return t?dT[e]=t:aT}{let t=e.slice(0,-1).split(`(`),n=uT[t[0]];return n?dT[e]=n(...t[1].split(`,`)):aT}},fT=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],pT=e=>{if(YC(e)){for(let t=0,n=fT.length;t<n;t++)if(GC(e,fT[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),aT}return XC(e)?e:YC(e)?Tfe(e):aT},mT=Mw(),hT=Mw(),gT={},_T={func:null},vT={func:null},yT=[null],bT=[null,null],xT={to:null},Efe=0,ST=0,CT,wT,Dfe=(e,t)=>{let n={};if(qC(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(rw);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];rw(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=Tw(t.duration,HC.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(rw(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},Ofe=class extends Cfe{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++ST;let s=tT(e),c=s.length,l=t.keyframes,u=l?lfe(Dfe(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:HC.defaults,b=Tw(m,y.ease),x=Tw(h,y.playbackEase),S=x?pT(x):null,C=!ZC(b.ease),w=C?b.ease:Tw(m,S?`linear`:y.ease),T=C?b.settlingDuration:Tw(p,y.duration),E=Tw(f,y.delay),D=g||y.modifier,O=ZC(_)&&c>=1e3?TC.none:ZC(_)?y.composition:_,k=this._offset+(n?n._offset:0);C&&(b.parent=this);let A=NaN,j=NaN,M=0,ee=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(rw(e)){let a=Ow(t,e),o=Cw(t,e),s=hfe(e,t,a),f=u[e],p=qC(f);if(i&&!p&&(bT[0]=f,bT[1]=f,f=bT),p){let e=f.length,t=!JC(f[0]);e===2&&t?(xT.to=f,yT[0]=xT,CT=yT):e>2&&t?(CT=[],f.forEach((e,t)=>{t?t===1?(bT[1]=e,CT.push(bT)):CT.push(e):bT[0]=e})):CT=f}else yT[0]=f,CT=yT;let m=null,h=null,g=NaN,_=0,v=0;for(let e=CT.length;v<e;v++){let i=CT[v];JC(i)?wT=i:(xT.to=i,wT=xT),_T.func=null,vT.func=null;let l=Dw(Tw(wT.composition,O),t,r,c,null,null),u=nfe(l)?l:TC[l];!m&&u!==TC.none&&(m=qw(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=Dw(wT.to,t,r,c,_T,f),y;JC(p)&&!ZC(p.to)?(wT=p,y=p.to):y=p;let b=Dw(wT.from,t,r,c,vT,f),x=wT.ease||w,S=Dw(x,t,r,c,null,f),C=XC(S)||YC(S)?S:x,A=!ZC(C)&&!ZC(C.ease),j=A?C.ease:C,N=A?C.settlingDuration:Dw(Tw(wT.duration,e>1?Dw(T,t,r,c,null,f)/e:T),t,r,c,null,f),te=Dw(Tw(wT.delay,v?0:E),t,r,c,null,f),ne=wT.modifier||D,re=!ZC(b),P=!ZC(y),ie=qC(y),ae=ie||re&&P,oe=h?_:0,se=h?_+te:te,ce=pw(k+se,12),le=pw(k+oe,12);!ee&&(re||ie)&&(ee=1);let ue=h;if(u!==TC.none){let e=m._head;for(;e&&e._absoluteStartTime<=ce;)if(e._isOverridden||(ue=e),e=e._nextRep,e&&e._absoluteStartTime>=ce)for(;e;)Jw(e),e=e._nextRep}if(ae){Nw(ie?Dw(y[0],t,r,c,vT,f):b,mT),Nw(ie?Dw(y[1],t,r,c,_T,f):y,hT);let e=Aw(t,s,a,gT);mT.t===CC.NUMBER&&(ue?ue._valueType===CC.UNIT&&(mT.t=CC.UNIT,mT.u=ue._unit):(Nw(e,Fw),Fw.t===CC.UNIT&&(mT.t=CC.UNIT,mT.u=Fw.u)))}else P?Nw(y,hT):h?Pw(h,hT):Nw(n&&ue&&ue.parent.parent===n?ue._value:Aw(t,s,a,gT),hT),re?Nw(b,mT):h?Pw(h,mT):Nw(n&&ue&&ue.parent.parent===n?ue._value:Aw(t,s,a,gT),mT);if(mT.o&&(mT.n=jw(ue?ue._toNumber:Nw(Aw(t,s,a,gT),Fw).n,mT.n,mT.o)),hT.o&&(hT.n=jw(mT.n,hT.n,hT.o)),mT.t!==hT.t){if(mT.t===CC.COMPLEX||hT.t===CC.COMPLEX){let e=mT.t===CC.COMPLEX?mT:hT,t=mT.t===CC.COMPLEX?hT:mT;t.t=CC.COMPLEX,t.s=_w(e.s),t.d=e.d.map(()=>t.n)}else if(mT.t===CC.UNIT||hT.t===CC.UNIT){let e=mT.t===CC.UNIT?mT:hT,t=mT.t===CC.UNIT?hT:mT;t.t=CC.UNIT,t.u=e.u}else if(mT.t===CC.COLOR||hT.t===CC.COLOR){let e=mT.t===CC.COLOR?mT:hT,t=mT.t===CC.COLOR?hT:mT;t.t=CC.COLOR,t.d=e.d.map(()=>0)}}if(mT.u!==hT.u){let e=hT.u?mT:hT;e=iT(t,e,hT.u?hT.u:mT.u,!1)}if(hT.d&&mT.d&&hT.d.length!==mT.d.length){let e=mT.d.length>hT.d.length?mT:hT,t=e===mT?hT:mT;t.d=e.d.map((e,n)=>ZC(t.d[n])?0:t.d[n]),t.s=_w(e.s)}let de=pw(+N||1e-11,12),fe=gT[s];QC(fe)||(gT[s]=null);let pe=o?o.set:null;_=pw(se+de,12);let me=mT.d,he=hT.d,ge=hT.s,_e={parent:this,id:Efe++,property:s,target:t,_value:null,_toFunc:_T.func,_fromFunc:vT.func,_ease:pT(j),_fromNumbers:me?_w(me):NC,_toNumbers:he?_w(he):NC,_strings:ge?_w(ge):NC,_fromNumber:mT.n,_toNumber:hT.n,_numbers:me?_w(me):NC,_number:mT.n,_unit:hT.u,_modifier:ne,_currentTime:0,_startTime:se,_delay:+te,_updateDuration:de,_changeDuration:de,_absoluteStartTime:ce,_absoluteUpdateStartTime:le,_absoluteEndTime:pw(k+_,12),_hasFromValue:re||ie?1:0,_tweenType:a,_setter:pe,_valueType:hT.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:fe,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==TC.none&&Yw(_e,m);let ve=_e._valueType;if(ve===CC.COMPLEX)_e._value=Iw(_e,1,-1);else if(ve===CC.UNIT)_e._value=`${ne(_e._toNumber)}${_e._unit}`;else if(ve===CC.COLOR){let e=hT.d;_e._value=`rgba(${pw(e[0],0)},${pw(e[1],0)},${pw(e[2],0)},${e[3]})`}else _e._value=ne(_e._toNumber);isNaN(g)&&(g=_e._startTime),h=_e,M++,bw(this,_e)}(isNaN(j)||g<j)&&(j=g),(isNaN(A)||_>A)&&(A=_),a===SC.TRANSFORM&&(l=M-v,d=M)}if(!isNaN(l)){let e=0;vw(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===TC.blend&&vw(Hw.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),j?(vw(this,e=>{e._startTime-e._delay||(e._delay-=j),e._startTime-=j}),A-=j):j=0,A||(A=AC,this.iterationCount=0),this.targets=s,this.id=ZC(d)?ST:d,this.duration=A===1e-11?AC:hw((A+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=j,this.iterationDuration=A,!this._autoplay&&ee&&this.onRender(this)}stretch(e){let t=this.duration;if(t===gw(e))return this;let n=e/t;return vw(this,e=>{e._updateDuration=gw(e._updateDuration*n),e._changeDuration=gw(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return vw(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Nw(n(),mT),mT.u!==e._unit&&e.target[DC]&&iT(e.target,mT,e._unit,!0),e._fromNumbers=_w(mT.d),e._fromNumber=mT.n):t&&(Nw(Aw(e.target,e.property,e._tweenType),Fw),e._fromNumbers=_w(Fw.d),e._fromNumber=Fw.n),t&&(Nw(t(),hT),e._toNumbers=_w(hT.d),e._strings=_w(hT.s),e._toNumber=hT.o?jw(e._fromNumber,hT.n,hT.o):hT.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Bw(this)}then(e){return super.then(e)}},TT=(e,t)=>HC.editor?HC.editor.addAnimation(e,t):new Ofe(e,t,null,0,!1).init(),ET=MC*10,kfe=class{constructor(e={}){let t=!ZC(e.bounce)||!ZC(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/MC,this.maxIterations=this.maxDuration/this.timeStep/MC,this.bn=fw(Tw(e.bounce,.5),-1,1),this.pd=fw(Tw(e.duration,628),10*HC.timeScale,ET*HC.timeScale),this.m=fw(Tw(e.mass,1),1,ET),this.s=fw(Tw(e.stiffness,100),AC,ET),this.d=fw(Tw(e.damping,10),AC,ET),this.v=fw(Tw(e.velocity,0),-ET,ET),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||IC,t&&this.calculateSDFromBD(),this.compute(),this.ease=e=>{let t=e*this.settlingDuration,n=this.completed,r=this.pd;return t>=r&&!n&&(this.completed=!0,this.onComplete(this.parent)),t<r&&n&&(this.completed=!1),e===0||e===1?e:this.solve(e*this.solverDuration)}}solve(e){let{zeta:t,w0:n,wd:r,b:i}=this,a=e;return a=t<1?cw(-a*t*n)*(1*sw(r*a)+i*ow(r*a)):t===1?(1+i*a)*cw(-a*n):((1+i)*cw((-t*n+r)*a)+(1-i)*cw((-t*n-r)*a))/2,1-a}calculateSDFromBD(){let e=HC.timeScale===1?this.pd/MC:this.pd;this.m=1,this.v=0,this.s=iw(2*uw/e,2),this.d=this.bn>=0?(1-this.bn)*4*uw/e:4*uw/(e*(1+this.bn)),this.s=pw(fw(this.s,AC,ET),3),this.d=pw(fw(this.d,AC,300),3)}calculateBDFromSD(){let e=2*uw/aw(this.s);this.pd=e*(HC.timeScale===1?MC:1),this.bn=this.d/(2*aw(this.s))<=1?1-this.d*e/(4*uw):4*uw/(this.d*e)-1,this.bn=pw(fw(this.bn,-1,1),3),this.pd=pw(fw(this.pd,10*HC.timeScale,ET*HC.timeScale),3)}compute(){let{maxRestSteps:e,maxIterations:t,restThreshold:n,timeStep:r,m:i,d:a,s:o,v:s}=this,c=this.w0=fw(aw(o/i),AC,MC),l=this.zeta=a/(2*aw(o*i));l<1?(this.wd=c*aw(1-l*l),this.b=(l*c+-s)/this.wd):l===1?(this.wd=0,this.b=-s+c):(this.wd=c*aw(l*l-1),this.b=(l*c+-s)/this.wd);let u=0,d=0,f=0;for(;d<=e&&f<=t;)ofe(1-this.solve(u))<n?d++:d=0,this.solverDuration=u,u+=r,f++;this.settlingDuration=pw(this.solverDuration*MC,0)*HC.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=fw(Tw(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=fw(Tw(e,1),10*HC.timeScale,ET*HC.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=fw(Tw(e,100),AC,ET),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=fw(Tw(e,10),AC,ET),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=fw(Tw(e,1),1,ET),this.compute()}get velocity(){return this.v}set velocity(e){this.v=fw(Tw(e,0),-ET,ET),this.compute()}},Afe=e=>new kfe(e),DT=(e=10,t)=>{let n=t?sfe:lw;return t=>n(fw(t,0,1)*e)*(1/e)},OT=(0,F.forwardRef)(function({id:e,transform:t},n){return(0,R.jsxs)(`radialGradient`,{ref:n,id:e,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`-1.6`,r:`5.6`,gradientTransform:t,children:[(0,R.jsx)(`stop`,{offset:`0`,stopColor:`color-mix(in oklab, var(--color-white) calc(var(--depth) * 50%), currentColor)`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`})]})});function kT({id:e}){return(0,R.jsx)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,R.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1`,floodColor:`currentColor`,style:{floodOpacity:`calc(var(--depth) * 0.6)`}})})}function AT({id:e}){return(0,R.jsxs)(`filter`,{id:e,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,R.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.3`,result:`soft-edge`}),(0,R.jsx)(`feOffset`,{in:`soft-edge`,dx:`0.25`,dy:`0.45`,result:`lower-edge`}),(0,R.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`lower-edge`,operator:`out`,result:`inner-shadow`}),(0,R.jsx)(`feFlood`,{floodColor:`var(--color-black)`,floodOpacity:`calc(var(--depth) * 0.28)`}),(0,R.jsx)(`feComposite`,{in2:`inner-shadow`,operator:`in`,result:`shade`}),(0,R.jsx)(`feOffset`,{in:`soft-edge`,dx:`-0.2`,dy:`-0.35`,result:`upper-edge`}),(0,R.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`upper-edge`,operator:`out`,result:`inner-highlight`}),(0,R.jsx)(`feFlood`,{floodColor:`var(--color-white)`,floodOpacity:`calc(var(--depth) * 0.7)`}),(0,R.jsx)(`feComposite`,{in2:`inner-highlight`,operator:`in`,result:`highlight`}),(0,R.jsxs)(`feMerge`,{children:[(0,R.jsx)(`feMergeNode`,{in:`SourceGraphic`}),(0,R.jsx)(`feMergeNode`,{in:`shade`}),(0,R.jsx)(`feMergeNode`,{in:`highlight`})]})]})}var jT=Object.freeze({alphaIntercept:-8,alphaSlope:18,blurStdDeviation:2});function MT({id:e,values:t=Lue}){return(0,R.jsxs)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,R.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t.blurStdDeviation,result:`blur`}),(0,R.jsx)(`feColorMatrix`,{in:`blur`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${String(t.alphaSlope)} ${String(t.alphaIntercept)}`,result:`gooey`}),(0,R.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`gooey`,operator:`atop`})]})}function NT(e,t){let n=e.ownerDocument,r=!0,i=()=>{t(r&&!n.hidden)},a=globalThis,o=`IntersectionObserver`in globalThis&&a.IntersectionObserver?new a.IntersectionObserver(t=>{let n=t.find(t=>t.target===e);n&&(r=n.isIntersecting,i())}):void 0;return o?.observe(e),n.addEventListener(`visibilitychange`,i),i(),()=>{o?.disconnect(),n.removeEventListener(`visibilitychange`,i)}}function PT(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function FT(e,t){let n=Math.max(0,Math.min(1,(t-(e-1)*.085)/.68));return Math.sin(n*Math.PI)**2}function IT(e,t,n){let r=n*Math.PI*2,i=t*2.1,a=Math.sin(r*2+i)*.15,o={rx:4*(1+a),ry:4/(1+a)};if(e===`line`){let e=7.5+4*Math.cos(r+(t===2?-.45:0));return{cx:(t-1)*e,cy:Math.sin(r+i)*.7,...o}}if(e===`square`){let e=4.7+2.7*Math.cos(r);return{cx:(t%2?1:-1)*e,cy:(t<2?-1:1)*e,...o}}if(e===`donut`){let e=PT(n/.66)*Math.PI*2,o=Math.min(e,t*Math.PI/8)-Math.PI/2,s=PT((n-.79)/.21),c=8+Math.sin(r*2+i)*.35*Math.sin(n*Math.PI);return{cx:Math.cos(o)*c*(1-s),cy:Math.sin(o)*c*(1-s)-8*s,rx:3.6*(1+a*Math.sin(n*Math.PI)),ry:3.6/(1+a*Math.sin(n*Math.PI))}}if(e===`bloom`){if(t===0){let e=[1,2,3,4].reduce((e,t)=>e+FT(t,n),0),t=Math.sqrt(49-e*4);return{cx:Math.sin(r)*.4,cy:Math.sin(r*2)*.4,rx:t*(1+a),ry:t/(1+a)}}let e=FT(t,n),i=(t-1)*Math.PI/2-Math.PI/4+Math.sin(r)*.22;return{cx:Math.cos(i)*14*e,cy:Math.sin(i)*14*e,rx:3.2*(1+a),ry:3.2/(1+a)}}return{cx:Math.sin(r+i)*6+Math.sin(r*3+i)*2.5,cy:Math.cos(r*2+i)*6,...o}}var jfe={line:1700,square:1900,donut:3e3,wander:4600,bloom:2800},Mfe=2;function Nfe({variant:e,pace:t=`working`}){let n=`caps-loader-${(0,F.useId)().replaceAll(`:`,``)}`,r=(0,F.useRef)(null),i=(0,F.useRef)(null),a=fC(i),{reduced:o}=a,s=e===`donut`?16:e===`bloom`?5:e===`square`?4:3;return(0,F.useLayoutEffect)(()=>{if(o||!r.current||!i.current)return;let n=[...r.current.querySelectorAll(`ellipse`)].map((n,r)=>TT(n,{keyframes:Array.from({length:48},(n,i)=>({...IT(e,r,(i+1)/48),duration:pC(a,jfe[e]*(t===`idle`?Mfe:1))/48})),ease:`linear`,loop:!0})),s=NT(i.current,e=>{for(let t of n)e?t.resume():t.pause()});return()=>{s();for(let e of n)e.revert()}},[e,t,o,a]),(0,R.jsxs)(`svg`,{ref:i,"aria-hidden":`true`,focusable:`false`,viewBox:e===`line`?`-20 -10 40 20`:`-20 -20 40 40`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(MT,{id:n,values:jT}),(0,R.jsx)(OT,{id:`${n}-surface`,transform:e===`line`?`matrix(3.4 0 0 1.4 0 0)`:`matrix(3 0 0 3 0 0)`}),(0,R.jsx)(kT,{id:`${n}-shadow`}),(0,R.jsx)(`mask`,{id:`${n}-mask`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`40`,height:`40`,style:{maskType:`alpha`},children:(0,R.jsx)(`g`,{ref:r,fill:`currentColor`,filter:`url(#${n})`,children:Array.from({length:s},(t,n)=>(0,R.jsx)(`ellipse`,{...IT(e,n,0)},n))})})]}),(0,R.jsx)(`g`,{filter:`url(#${n}-shadow)`,children:(0,R.jsx)(`rect`,{x:`-20`,y:`-20`,width:`40`,height:`40`,fill:`url(#${n}-surface)`,mask:`url(#${n}-mask)`})})]})}var Pfe={sm:`caps-loader-sm`,md:`caps-loader-md`,lg:`caps-loader-lg`,fill:`caps-loader-fill`},Ffe={neutral:`text-base-content`,accent:`text-accent`,primary:`text-primary`,success:`text-success`,current:`text-current`},LT=(0,F.forwardRef)(function({"aria-label":e,"aria-labelledby":t,className:n,decorative:r=!1,label:i=`Loading`,size:a=`md`,variant:o=`line`,pace:s=`working`,tone:c=`neutral`,...l},u){let d=`${(0,F.useId)()}-label`,f=!r&&e===void 0&&t===void 0;return(0,R.jsxs)(`span`,{...l,"aria-label":r?void 0:e,"aria-hidden":r||void 0,"aria-labelledby":r?void 0:t??(e===void 0?d:void 0),className:cC(`caps-loader`,Pfe[a],Ffe[c],n),"data-variant":o,"data-pace":s,role:r?void 0:`status`,ref:u,children:[(0,R.jsx)(Nfe,{variant:o,pace:s}),f?(0,R.jsx)(vC,{id:d,children:i}):null]})}),RT=`disabled:bg-base-200 disabled:text-base-content disabled:outline-1 disabled:outline-solid disabled:outline-base-content/25 aria-disabled:bg-base-200 aria-disabled:text-base-content aria-disabled:outline-1 aria-disabled:outline-solid aria-disabled:outline-base-content/25`,Ife=Wue(`btn caps-button disabled:pointer-events-none`,{variants:{variant:{primary:`btn-primary caps-button-filled`,secondary:`btn-secondary caps-button-filled`,accent:`btn-accent caps-button-filled`,destructive:`btn-error caps-button-filled`,outline:`btn-outline ${RT}`,ghost:`btn-ghost`,"ghost-destructive":`btn-ghost caps-button-ghost-destructive`,link:`btn-link ${RT}`},size:{xs:`btn-xs`,sm:`btn-sm`,default:`btn-md`,lg:`btn-lg`,icon:`btn-square btn-md`,menubar:`caps-button-menubar`}},defaultVariants:{variant:`primary`,size:`default`}}),zT=(0,F.forwardRef)(function({asChild:e=!1,children:t,className:n,disabled:r,loading:i=!1,result:a,resultLabel:o,onResultEnd:s,size:c=`default`,variant:l=`primary`,...u},d){let f=cC(Ife({size:c,variant:l}),n),p=(0,F.useRef)(a).current,m=(0,F.useRef)(null);return(0,F.useImperativeHandle)(d,()=>m.current),Lfe(m,i,a),e?(0,R.jsx)(ES,{...u,"aria-busy":i?!0:u[`aria-busy`],"aria-disabled":r===!0||i?!0:void 0,className:f,ref:m,children:t}):(0,R.jsx)(`button`,{...u,"aria-busy":i?!0:u[`aria-busy`],className:f,disabled:r===!0||i,ref:m,type:u.type??`button`,children:a===void 0&&o===void 0?(0,R.jsxs)(R.Fragment,{children:[i?(0,R.jsx)(LT,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,t]}):(0,R.jsx)(Vfe,{label:o,loading:i,onResultEnd:s,result:a,settled:p,children:t})})});function Lfe(e,t,n){let r=(0,F.useRef)(null),i=(0,F.useRef)(null),a=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let s=JSON.stringify([t,n??null,o.textContent]),c=s!==i.current;i.current=s;let l=a.current;if(!c&&l)return;let u=l?o.offsetWidth:r.current;l&&(a.current=null,l.cancel(),o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`));let d=o.offsetWidth;if(r.current=d>0?d:null,!c||u===null||d===0||Math.abs(u-d)<1||!hC(o))return;let f=dC(o);if(f.reduced)return;let p=o.animate([{width:`${String(u)}px`},{width:`${String(d)}px`}],{duration:f.normal,easing:mC(f,f.ease)});a.current=p,o.style.overflow=`clip`,o.style.whiteSpace=`nowrap`;let m=()=>{a.current===p&&(a.current=null,o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`))};p.onfinish=m,p.oncancel=m})}var Rfe=1100;function zfe(e,t){let n=t.bounce/.3,r=1+.05*Math.min(1.4,.4+n),i=1-.02*Math.min(1.4,n);return e.animate([{transform:`scale(1)`},{transform:`scale(${String(r)})`,offset:.35},{transform:`scale(${String(i)})`,offset:.7},{transform:`scale(1)`}],{duration:t.springDuration,easing:mC(t,`ease-out`)})}function Bfe(e,t){let n=t.shake;return e.animate([{transform:`none`},{transform:`translateX(${String(-n)}px)`},{transform:`translateX(${String(n)}px)`},{transform:`translateX(${String(-n*.6)}px)`},{transform:`translateX(${String(n*.3)}px)`},{transform:`none`}],{duration:t.slow*1.3,easing:mC(t,`linear`)})}function BT(e,t,n){let r=n.distance+2,i=`blur(${String(n.blur)}px)`;return[e.animate([{opacity:1,transform:`none`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${String(-r)}px)`,filter:i}],{duration:n.fast,easing:mC(n,n.ease)}),t.animate([{opacity:0,transform:`translateY(${String(r)}px)`,filter:i},{opacity:1,transform:`none`,filter:`blur(0px)`}],{duration:n.normal,easing:mC(n,n.ease),fill:`backwards`})]}function Vfe({children:e,label:t,loading:n,onResultEnd:r,result:i,settled:a}){let o=(0,F.useRef)(null),s=_C(),[c,l]=(0,F.useState)(!1),[u,d]=(0,F.useState)(!1);c&&!u&&d(!0);let f=(0,F.useRef)(a),p=(0,F.useRef)(r);(0,F.useEffect)(()=>{p.current=r},[r]),(0,F.useLayoutEffect)(()=>{let e=f.current;if(f.current=i,i===e)return;if(i===`done`){l(!0);let e=setTimeout(()=>{p.current?p.current():l(!1)},Rfe);return()=>{clearTimeout(e)}}l(!1);let t=o.current;if(i!==`failed`||!t||!hC(t))return;let n=dC(t);if(n.shake<=0)return;let r=Bfe(t,n);return()=>{r.cancel()}},[i,s]);let m=(0,F.useRef)(c);return(0,F.useLayoutEffect)(()=>{let e=o.current;if(!e||m.current===c)return;m.current=c;let t=e.querySelector(`[data-face="label"]`),n=e.querySelector(`[data-face="result"]`);if(!t||!n||!hC(e)){c||d(!1);return}let r=dC(e),i=c?BT(t,n,r):BT(n,t,r);if(c||i[0]?.addEventListener(`finish`,()=>{d(!1)}),c&&!r.reduced){i.push(zfe(e.closest(`button`)??e,r));let t=n.querySelector(`path`);t&&i.push(t.animate([{strokeDashoffset:1},{strokeDashoffset:0}],{duration:r.normal*1.4,delay:r.fast/2,easing:mC(r,r.ease),fill:`backwards`}))}return()=>{for(let e of i)e.cancel()}},[c,s]),(0,R.jsxs)(`span`,{ref:o,className:`caps-button-faces`,"data-showing":c?`result`:`label`,children:[(0,R.jsxs)(`span`,{className:`caps-button-face`,"data-face":`label`,"aria-hidden":c?!0:void 0,children:[n||c?(0,R.jsx)(LT,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,e]}),u?(0,R.jsxs)(`span`,{className:`caps-button-face`,"data-face":`result`,"aria-hidden":!c||void 0,children:[(0,R.jsx)(`svg`,{className:`caps-button-check`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,R.jsx)(`path`,{d:`M4.5 12.5 9.5 17.5 19.5 6.5`,pathLength:1})}),t===void 0?e:t]}):null]})}var VT=new Map([[`0`,[`###`,`#.#`,`#.#`,`#.#`,`###`]],[`1`,[`.#.`,`##.`,`.#.`,`.#.`,`###`]],[`2`,[`###`,`..#`,`###`,`#..`,`###`]],[`3`,[`###`,`..#`,`.##`,`..#`,`###`]],[`4`,[`#.#`,`#.#`,`###`,`..#`,`..#`]],[`5`,[`###`,`#..`,`###`,`..#`,`###`]],[`6`,[`###`,`#..`,`###`,`#.#`,`###`]],[`7`,[`###`,`..#`,`.#.`,`.#.`,`.#.`]],[`8`,[`###`,`#.#`,`###`,`#.#`,`###`]],[`9`,[`###`,`#.#`,`###`,`..#`,`###`]],[`:`,[`.`,`#`,`.`,`#`,`.`]],[`.`,[`.`,`.`,`.`,`.`,`#`]],[`+`,[`...`,`.#.`,`###`,`.#.`,`...`]],[`-`,[`...`,`...`,`###`,`...`,`...`]],[`/`,[`..#`,`..#`,`.#.`,`#..`,`#..`]],[`×`,[`...`,`#.#`,`.#.`,`#.#`,`...`]],[`%`,[`#.#`,`..#`,`.#.`,`#..`,`#.#`]],[` `,[`.`,`.`,`.`,`.`,`.`]]]),Hfe=[`.`,`.`,`.`,`.`,`.`],Ufe=Object.freeze([...VT.keys()]);function Wfe(e,t=0,n=!1){if(!Number.isFinite(e))throw RangeError(`PixelNumber needs a finite number`);let r=String(Math.trunc(Math.abs(e))).padStart(t,`0`),i=String(Math.abs(e)).split(`.`)[1];return HT(`${e<0?`-`:n&&e>0?`+`:``}${r}${i?`.${i}`:``}`)}function HT(e){for(let t of e)if(!VT.has(t))throw RangeError(`PixelNumber cannot draw "${t}"; use digits and ${Ufe.filter(e=>!/\d/.test(e)).join(` `)}`);return e}function Gfe(e,t){let n=new Set,r=t;for(let i of e){let e=VT.get(i)??Hfe;e.forEach((e,i)=>{for(let a=0;a<e.length;a++)e.charAt(a)===`#`&&n.add(`${String(r+a)},${String(i+t)}`)}),r+=(e.at(0)?.length??1)+1}return{lit:n,width:Math.max(1,r-1-t)+t*2}}function Kfe(e){let t=new Set;for(let n of e){let[r=0,i=0]=n.split(`,`).map(Number);for(let n=-1;n<=1;n++)for(let a=-1;a<=1;a++){let o=`${String(r+a)},${String(i+n)}`;e.has(o)||t.add(o)}}return t}function UT(e,t,n){let r=[];for(let i=0;i<n;i++){let n=-1;for(let a=0;a<=t;a++){let t=e.has(`${String(a)},${String(i)}`);t&&n<0&&(n=a),!t&&n>=0&&(r.push([n,i,a-n]),n=-1)}}return r}function WT({runs:e,className:t}){return(0,R.jsx)(`g`,{className:t,children:e.map(([e,t,n])=>(0,R.jsx)(`rect`,{x:e,y:t,width:n,height:1},`${String(e)}-${String(t)}`))})}var qfe=(0,F.forwardRef)(function({value:e,text:t,pad:n,signed:r,size:i=`md`,tone:a=`current`,outline:o=!1,className:s,...c},l){if(t===void 0&&e===void 0)throw TypeError(`PixelNumber needs a value or text`);let u=t===void 0?Wfe(e??NaN,n,r):HT(t),d=+!!o,{lit:f,width:p}=Gfe(u,d),m=5+d*2,h=Jfe[i];return(0,R.jsxs)(`span`,{...c,ref:l,className:cC(`caps-pixel-number`,s),"data-size":i,"data-tone":a,"data-outline":o,children:[(0,R.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,viewBox:`0 0 ${String(p)} ${String(m)}`,width:p*h,height:m*h,children:[o?(0,R.jsx)(WT,{className:`caps-pixel-number-outline`,runs:UT(Kfe(f),p,m)}):null,(0,R.jsx)(WT,{className:`caps-pixel-number-face`,runs:UT(f,p,m)})]}),(0,R.jsx)(`span`,{className:`sr-only`,children:u})]})}),Jfe={sm:2,md:3,lg:4,xl:6},GT=Object.freeze({ease:`linear`,duration:0});function KT(e,t){let n=Hde(e,t.duration);return n<=0?GT:e.steps>0?{ease:DT(e.steps),duration:n}:{ease:Afe({bounce:Vde(e,t.bounce),duration:n}),duration:n}}function qT(e,t){let n=pC(e,t.duration);return{ease:e.steps>0?DT(e.steps):t.ease,duration:n}}var JT={dot:{y:-4,height:8,cy:0},pill:{y:-16,height:32,cy:0},bang:{y:-16,height:20,cy:12}};function Yfe({className:e,glyph:t,motion:n}){let r=`caps-status-${(0,F.useId)().replaceAll(`:`,``)}`,i=(0,F.useRef)(null),a=(0,F.useRef)(null),o=(0,F.useRef)(null),s=(0,F.useRef)(null),c=(0,F.useRef)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(JT[t]).current,d=(0,F.useRef)(t===`dot`?1:4).current,f=(0,F.useRef)(+(t===`bang`)).current,p=(0,F.useRef)(t),m=fC(s),{reduced:h}=m;return(0,F.useLayoutEffect)(()=>{if(!i.current||!a.current||!c.current||!l.current)return;let e=JT[t],n=h||p.current===t;p.current=t;let r=dC(i.current),o=n?{duration:0}:KT(r,{bounce:.3,duration:360}),s=TT(i.current,{y:e.y,height:e.height,...o}),u=TT(a.current,{cy:e.cy,...n?{duration:0}:{delay:pC(r,35),...KT(r,{bounce:.3,duration:420})}}),d=TT(c.current,{gradientTransform:`matrix(1 0 0 ${t===`dot`?`1`:`4`} 0 0)`,...o}),f=TT(l.current,{opacity:+(t===`bang`),...n?GT:qT(r,{ease:`inOutSine`,duration:220})});return()=>{s.cancel(),u.cancel(),d.cancel(),f.cancel()}},[t,h]),(0,F.useLayoutEffect)(()=>{if(!o.current||!s.current||h||n===`none`)return;let e=n===`pulse`?TT(o.current,{opacity:[1,.45],...qT(m,{ease:`inOutSine`,duration:750}),alternate:!0,loop:!0}):TT(o.current,{keyframes:{"0%":{translateY:0,scaleX:1,scaleY:1},"18%":{translateY:.25,scaleX:1.1,scaleY:.91},"42%":{translateY:-1.3,scaleX:.94,scaleY:1.06},"62%":{translateY:-1.65,scaleX:1,scaleY:1},"82%":{translateY:.15,scaleX:1.06,scaleY:.95},"100%":{translateY:0,scaleX:1,scaleY:1}},...qT(m,{ease:`inOutSine`,duration:1e3}),loop:!0}),t=NT(s.current,t=>{t?e.resume():e.pause()});return()=>{t(),e.revert()}},[n,h,m]),(0,R.jsxs)(`svg`,{ref:s,"aria-hidden":`true`,className:`caps-status-bead ${e??``}`,width:`8`,height:`8`,viewBox:`-4 -4 8 8`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(MT,{id:r,values:jT}),(0,R.jsx)(OT,{ref:c,id:`${r}-surface`,transform:`matrix(1 0 0 ${String(d)} 0 0)`}),(0,R.jsxs)(`radialGradient`,{id:`${r}-drop-light`,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`10.4`,r:`5.6`,children:[(0,R.jsx)(`stop`,{offset:`0`,stopColor:`var(--color-white)`,style:{stopOpacity:`calc(var(--depth) * 0.5)`}}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--color-white)`,stopOpacity:`0`})]}),(0,R.jsx)(kT,{id:`${r}-shadow`}),(0,R.jsx)(`mask`,{id:`${r}-silhouette`,maskUnits:`userSpaceOnUse`,x:`-12`,y:`-24`,width:`24`,height:`48`,style:{maskType:`alpha`},children:(0,R.jsxs)(`g`,{fill:`var(--color-white)`,filter:`url(#${r})`,children:[(0,R.jsx)(`rect`,{ref:i,x:`-4`,y:u.y,width:`8`,height:u.height,rx:`4`}),(0,R.jsx)(`circle`,{ref:a,cx:`0`,cy:u.cy,r:`4`})]})})]}),(0,R.jsx)(`g`,{ref:o,filter:`url(#${r}-shadow)`,children:(0,R.jsxs)(`g`,{mask:`url(#${r}-silhouette)`,children:[(0,R.jsx)(`rect`,{x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-surface)`}),(0,R.jsx)(`rect`,{ref:l,x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-drop-light)`,opacity:f})]})})]})}var Xfe=.28;function YT(e,t){switch(e){case`ring`:return{dashes:1,track:0,arc:0,sweep:0,disc:0,tick:0,cross:0};case`arc`:return{dashes:0,track:1,arc:1,sweep:t===void 0?Xfe:Math.min(1,Math.max(0,t)),disc:0,tick:0,cross:0};case`check`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:1,cross:0};case`cross`:return{dashes:0,track:0,arc:1,sweep:1,disc:1,tick:0,cross:1}}}var XT=7.25;function Zfe({className:e,glyph:t,progress:n}){let r=`caps-status-mark-${(0,F.useId)().replaceAll(`:`,``)}`,i=(0,F.useRef)(null),a=(0,F.useRef)(null),o=(0,F.useRef)(null),s=(0,F.useRef)(null),c=(0,F.useRef)(null),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(null),f=(0,F.useRef)(YT(t,n)).current,p=(0,F.useRef)(t),m=_C();(0,F.useLayoutEffect)(()=>{let e=i.current,r=a.current,c=o.current,f=s.current,h=l.current,g=u.current,_=d.current;if(!e||!r||!c||!f||!h||!g||!_)return;let v=YT(t,n),y=p.current;p.current=t;let b=dC(e),x=m||y===t&&t!==`arc`,S=x?m?{ease:b.ease,duration:b.fast}:GT:qT(b,{ease:`outQuad`,duration:160}),C=(t===`check`||t===`cross`)&&!x,w=qT(b,{ease:`inOutSine`,duration:220}),T=[TT(r,{opacity:v.dashes,...S}),TT(c,{opacity:v.track*.28,...S}),TT(f,{opacity:v.arc,"stroke-dasharray":`${String(v.sweep)} 1`,...x?m?GT:S:w}),TT(h,{r:v.disc*XT,...C?{delay:w.duration*.7,...KT(b,{bounce:.35,duration:360})}:m?GT:qT(b,{ease:`inCubic`,duration:140})}),TT(g,{"stroke-dashoffset":1-v.tick,...C&&v.tick>0?{delay:w.duration*.7+b.fast,...qT(b,{ease:`outCubic`,duration:240})}:GT}),TT(_,{"stroke-dashoffset":1-v.cross,...C&&v.cross>0?{delay:w.duration*.7+b.fast,...qT(b,{ease:`outCubic`,duration:240})}:GT})];return t===`cross`&&C&&b.shake>0&&T.push(TT(e,{translateX:[0,-b.shake,b.shake,-b.shake/2,0],delay:w.duration+b.fast,...qT(b,{ease:`linear`,duration:300})})),()=>{for(let e of T)e.cancel()}},[t,n,m]);let h=t===`arc`&&n===void 0&&!m;return(0,F.useLayoutEffect)(()=>{if(!h||!c.current||!i.current)return;let e=dC(i.current),t=TT(c.current,{rotate:[0,360],...qT(e,{ease:`linear`,duration:900}),loop:!0}),n=NT(i.current,e=>{e?t.resume():t.pause()});return()=>{n(),t.revert()}},[h]),(0,R.jsxs)(`svg`,{ref:i,"aria-hidden":`true`,className:`caps-status-mark ${e??``}`,viewBox:`0 0 16 16`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{id:`${r}-surface`,transform:`matrix(1.6 0 0 1.6 8 8)`}),(0,R.jsxs)(`mask`,{id:`${r}-knock`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`16`,height:`16`,children:[(0,R.jsx)(`rect`,{width:`16`,height:`16`,fill:`var(--color-white)`}),(0,R.jsx)(`path`,{ref:u,d:`M4.9 8.3 7.1 10.5 11.2 5.9`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,strokeLinejoin:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-f.tick}),(0,R.jsx)(`path`,{ref:d,d:`M5.4 5.4 10.6 10.6 M10.6 5.4 5.4 10.6`,fill:`none`,stroke:`var(--color-black)`,strokeWidth:`1.9`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`1 1`,strokeDashoffset:1-f.cross})]})]}),(0,R.jsx)(`circle`,{ref:a,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`1.7 2.2`,opacity:f.dashes}),(0,R.jsx)(`circle`,{ref:o,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,opacity:f.track*.28}),(0,R.jsx)(`g`,{ref:c,className:`caps-status-mark-spin`,children:(0,R.jsx)(`circle`,{ref:s,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`${String(f.sweep)} 1`,transform:`rotate(-90 8 8)`,opacity:f.arc})}),(0,R.jsx)(`circle`,{ref:l,cx:`8`,cy:`8`,r:f.disc*XT,fill:`url(#${r}-surface)`,mask:`url(#${r}-knock)`})]})}var Qfe=new Set([`ring`,`arc`,`check`,`cross`]);function $fe(e){return Qfe.has(e)}var ZT={neutral:`text-base-content`,primary:`text-primary`,secondary:`text-secondary`,accent:`text-accent`,success:`text-success`,info:`text-info`,warning:`text-warning`,error:`text-error`},QT=(0,F.forwardRef)(function({className:e,label:t,glyph:n=`dot`,motion:r=`none`,tone:i=`neutral`,size:a=`default`,appearance:o=`plain`,progress:s,...c},l){return(0,R.jsxs)(`span`,{...c,className:cC(`caps-status`,a===`compact`&&`caps-status-compact`,o===`chip`&&`caps-status-chip`,e),"data-tone":o===`chip`?i:void 0,"data-glyph":n,"data-motion":r,ref:l,children:[$fe(n)?(0,R.jsx)(Zfe,{className:ZT[i],glyph:n,progress:s}):(0,R.jsx)(Yfe,{className:ZT[i],glyph:n,motion:r}),t===void 0?null:(0,R.jsx)(`span`,{children:t})]})});function $T({icon:e,caption:t}){return(0,R.jsxs)(`span`,{className:`caps-icon-choice-mark`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`caps-icon-choice-art`,children:e}),t?(0,R.jsx)(`span`,{className:`caps-icon-choice-caption`,children:t}):null,(0,R.jsx)(`span`,{className:`caps-icon-choice-lamp`})]})}var epe=(0,F.forwardRef)(function({label:e,icon:t,caption:n,on:r,stateLabels:i=[`on`,`off`],className:a,...o},s){return(0,R.jsxs)(`span`,{...o,className:cC(`caps-icon-lamp`,a),"data-on":r,ref:s,children:[(0,R.jsx)($T,{icon:t,caption:n}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[e,`: `,r?i[0]:i[1]]})]})}),tpe=(0,F.forwardRef)(function({items:e,stateLabels:t,className:n,...r},i){return(0,R.jsx)(`ul`,{...r,className:cC(`caps-icon-lamps`,n),ref:i,children:e.map(({id:e,...n})=>(0,R.jsx)(`li`,{children:(0,R.jsx)(epe,{...n,...t===void 0?{}:{stateLabels:t}})},e))})}),npe=(0,F.forwardRef)(function({className:e,size:t=`md`,depth:n=`shallow`,placement:r=`standalone`,...i},a){return(0,R.jsx)(`div`,{...i,ref:a,"data-surface-size":t,"data-surface-depth":n,"data-surface-placement":r,className:cC(`caps-surface`,e)})}),rpe=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`div`,{...t,ref:n,className:cC(`caps-screen`,e)})}),eE=(0,F.forwardRef)(function({children:e,className:t,depth:n=`deep`,fit:r=`content`,density:i=`normal`,...a},o){let s=r===`fill`;return(0,R.jsx)(npe,{...a,className:cC(t,s&&`flex min-h-0 flex-1`),depth:n,ref:o,children:(0,R.jsx)(`div`,{className:cC(`caps-display-gasket`,s&&`flex min-h-0 min-w-0 flex-1`),"data-display-density":i,children:(0,R.jsx)(rpe,{className:cC(s&&`flex min-h-0 min-w-0 flex-1 overflow-hidden`),children:e})})})}),ipe=(0,F.forwardRef)(function({className:e,icon:t,status:n,title:r,...i},a){return(0,R.jsxs)(`header`,{...i,className:cC(`caps-screen-header`,e),ref:a,children:[t?(0,R.jsx)(`span`,{className:`caps-screen-header-icon`,"aria-hidden":`true`,children:t}):null,(0,R.jsx)(`span`,{className:`caps-screen-header-title`,children:r}),n?(0,R.jsx)(`span`,{className:`caps-screen-header-status`,children:n}):null]})}),ape=(0,F.forwardRef)(function({appearance:e,className:t,...n},r){return(0,R.jsx)(`div`,{...n,className:cC(`caps-screen-cells`,t),"data-appearance":e===`compact`?e:void 0,ref:r})}),tE=(0,F.forwardRef)(function({children:e,className:t,legend:n,readout:r,icon:i,appearance:a,wide:o=!1,...s},c){return(0,R.jsxs)(`div`,{...s,className:cC(`caps-screen-cell`,t),"data-wide":o||void 0,"data-appearance":a===`compact`?a:void 0,ref:c,children:[i?(0,R.jsx)(`span`,{className:`caps-screen-cell-icon`,children:i}):null,n?(0,R.jsx)(`span`,{className:`caps-screen-cell-legend`,children:n}):null,r?(0,R.jsx)(`span`,{className:`caps-screen-cell-readout`,children:r}):null,a===`compact`?(0,R.jsx)(`div`,{className:`caps-screen-cell-controls`,children:e}):e]})}),nE={coral:`var(--stipe-art-coral, #ff6558)`,blue:`var(--stipe-art-blue, #43a6f2)`,mint:`var(--stipe-art-mint, #63cfaa)`,grape:`var(--stipe-art-grape, #a66cc1)`,yellow:`var(--stipe-art-yellow, #ffd05d)`,cream:`var(--stipe-art-cream, #fff4de)`,ink:`var(--stipe-art-ink, #242c28)`,graphite:`var(--stipe-art-graphite, #49423f)`,inkcap:`var(--stipe-art-inkcap, #80499d)`},rE=`light-dark(var(--stipe-sketch-ink, #242c28), var(--stipe-art-cream, #fff4de))`,ope=`var(--color-base-100, light-dark(#fff4de, #242c28))`;function iE({transform:e,fill:t=rE}){return(0,R.jsx)(`path`,{transform:e,style:{fill:t},d:`M-1.264-9.479C-2.098-8.643-1.802-1.057-.907-.332.47.782 1.6-.446 1.618-3.075 1.623-3.888 1.691-5.398 1.77-6.429 1.979-9.202 1.596-10 .055-10-.588-10-.843-9.9-1.264-9.479Z`})}function spe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(iE,{transform:`translate(25.4 19.8) rotate(-39) scale(.95 .76)`}),(0,R.jsx)(iE,{transform:`translate(32.1 17.8) scale(.96 .95)`}),(0,R.jsx)(iE,{transform:`translate(38.8 19.9) rotate(39) scale(.95 .77)`})]})}function cpe(){return(0,R.jsxs)(`g`,{style:{fill:nE.blue},children:[(0,R.jsx)(`path`,{d:`M10.574 .604C9.804 1.375 9.867-.885 9.961 22.81 10.054 47.202 9.722 45.378 14.193 45.94 25.813 47.399 38.465 52.211 44.662 57.532 47.653 60.097 48.082 59.411 47.967 52.242L47.734 19.335C47.734 17.523 47.13 16.616 45.964 15.076 40.604 8.018 30.127 2.767 16.804 .462 13.045-.184 11.326-.148 10.574 .604Z`}),(0,R.jsx)(`path`,{d:`M81.571 .746C71.063 2.665 62.221 6.713 56.562 12.199 54.242 14.45 52 17.356 52.115 19.335L52.033 52.628C51.927 59.934 51.979 59.994 55.74 57.091 62.423 51.931 71.272 48.541 84.103 46.221 90.625 45.039 89.967 47.631 90.145 22.432 90.326-3.079 91.148-1 81.571 .746Z`}),(0,R.jsx)(`path`,{d:`M1.906 12.692C.1 13.42 .151 12.804 .151 33.825 .151 54.097 .163 54.302 1.447 55.498 2.71 56.674 3.384 56.81 7.937 56.816 20.943 56.834 30.647 58.293 38.776 61.45 45.964 64.242 46.435 61.924 39.526 57.773 32.296 53.429 26.656 51.544 14.943 49.553 5.958 48.027 6.535 49.414 6.408 29.003 6.32 14.74 6.263 13.103 5.816 12.764 5.254 12.335 2.9 12.293 1.906 12.692Z`}),(0,R.jsx)(`path`,{d:`M94.326 12.858C93.656 13.326 93.656 13.326 93.653 28.492 93.653 48.882 93.997 48.063 84.743 49.556 73.574 51.36 64.45 54.695 57.801 59.405 54.082 62.039 55.384 63.864 59.722 62.1 68.897 58.372 76.363 57.115 90.03 56.994 100.405 56.903 99.489 58.976 99.773 34.976 100.018 14.142 100.006 13.958 98.399 12.979 97.236 12.269 95.251 12.208 94.326 12.858Z`})]})}function aE(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M-8.572-25.123C-21.412-23.39-33.235-17.39-44.235-7.027-51.235-.433-51.251 .358-44.524 6.749-20.77 29.316 10.23 31.893 36.364 13.487 41.043 10.187 48.193 3.551 49.235 1.524 50.358-.642 49.471-2.102 43.738-7.497 29.257-21.128 9.968-27.631-8.572-25.123Z`}),(0,R.jsx)(`path`,{style:{fill:nE.ink},d:`M-6.225-16.807C-17.727-13.267-21.176 4.433-12.08 13.257-1.118 23.898 16.829 16.102 17.032 .604 17.209-12.412 6.219-20.642-6.225-16.807Z`})]})}function lpe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{style:{fill:nE.mint},d:`M540 342C520 340 497 355 477 374C450 399 440 421 456 444C465 458 480 462 492 464C503 466 500 477 494 486C487 500 508 496 522 478L530 468C557 468 578 464 591 451C601 442 599 429 585 427C572 425 556 432 547 418C538 403 550 390 568 385C579 382 589 380 584 368C576 352 557 341 540 342Z`}),(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M589 396C614 380 659 381 683 392C709 404 721 428 710 451C704 464 693 472 685 479C680 487 684 498 689 503C695 514 684 513 675 507C667 502 662 497 657 491C637 496 610 495 594 486C584 480 583 469 595 464C607 460 622 454 622 441C622 428 612 423 597 420C580 417 578 407 589 396Z`})]})}function oE({fill:e}){return(0,R.jsx)(`path`,{style:{fill:e},d:`M44.648 .288C26.645 1.615 13.263 8.266 5.942 19.529-4.299 35.277-.917 57.684 13.224 67.784 16.958 70.452 16.936 71.742 13.064 77.665 11.28 80.391 10.895 81.565 11.341 82.914 13.163 88.435 25.022 86.396 36.307 78.62L38.681 76.986 41.294 77.335C45.371 77.878 59.645 77.789 64.125 77.191 89.213 73.837 100.562 61.427 99.92 38.044 99.18 11.1 79.587-2.285 44.648 .288Z`})}function sE({onFigure:e=!1}){return(0,R.jsxs)(`g`,{style:{fill:e?ope:nE.ink},children:[(0,R.jsx)(`rect`,{x:`-15`,y:`-11`,width:`10`,height:`22`,rx:`5`}),(0,R.jsx)(`rect`,{x:`5`,y:`-11`,width:`10`,height:`22`,rx:`5`})]})}function upe(){return(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M18.125 .621C.039 1.574-2.575 4.791 2.264 20.133 17.454 68.284 77.345 69.396 96.119 21.875 100.749 10.154 100.318 4.348 94.605 1.513 91.981 .21 37.878-.421 18.125 .621Z`})}function dpe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M31.42 5.279C29.108 5.983 28.068 6.993 25.817 10.732 24.033 13.687 24.027 13.762 25.58 14.265 30.375 15.821 36.711 20.506 39.938 24.885 42.077 27.788 41.835 27.806 45.281 24.463 48.633 21.213 49.164 20.185 48.982 17.325 48.812 14.643 48.174 13.872 42.68 9.741 36.737 5.273 34.439 4.361 31.42 5.279Z`}),(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M22.538 16.207C22.093 16.652 19.732 20.231 13.309 30.196 10.737 34.188 10.723 33.911 13.589 35.351 16.461 36.798 19.778 39.28 21.825 41.523L22.6 42.37Q23.34 43.186 24.05 42.538L24.711 41.933C31.278 35.937 38.928 28.484 38.928 28.083 38.928 24.656 24.521 14.219 22.538 16.207Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M8.89 38.053C8.203 39.566 6.598 44.473 6.598 45.056 6.598 45.137 6.887 45.125 7.236 45.036 9.655 44.404 13.526 47.475 13.526 50.027 13.526 51.132 13.361 51.164 16.187 49.49 21.421 46.387 21.966 45.665 20.575 43.659 19.002 41.387 14.975 38.238 11.909 36.881 9.799 35.949 9.854 35.926 8.89 38.053Z`}),(0,R.jsx)(`path`,{style:{fill:nE.graphite},d:`M6.598 45.056C5.732 46.866 5.155 49.464 6.309 50.907 8.041 53.505 10.928 52.639 13.526 50.907 13.526 48.021 9.978 44.404 7.236 45.036Z`})]})}function fpe(){return(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M40.804 40.625C38.238 41.462 37.291 41.953 31.169 45.625 15.743 54.871 8.047 56.158 5.879 49.856 5.501 48.754 5.501 48.754 4.843 50.913 1.673 61.302 12.377 61.671 30.386 51.796 39.649 46.719 41.142 46.647 40.81 51.291 40.565 54.775 41.168 56.135 43.486 57.31 49.556 60.387 62.035 54.816 59.605 50.116 58.502 47.983 56.1 47.882 52.163 49.799 47.082 52.273 45.983 51.652 47.998 47.449 50.89 41.416 47.686 38.376 40.804 40.625Z`})}function cE({transform:e}){return(0,R.jsx)(`path`,{style:{fill:nE.mint},transform:e,d:`M0 0C3 -2 5 -5 5 -8 5 -10.5 3 -12 0 -12S-5 -10.5 -5 -8C-5 -5 -3 -2 0 0Z`})}function ppe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{fillRule:`evenodd`,style:{fill:rE},d:`M25.3 17.69C14.8 19.34 10.66 20.18 9.05 20.99 5.51 22.78 4.2 27.21 6.71 28.9 7.47 29.42 8.48 29.4 10.25 28.84 12.41 28.15 12.56 27.57 11.02 25.85 10 24.71 10.53 23.62 11.79 24.27 13.9 25.36 15.02 28.98 15.63 36.66 16.18 43.48 17.33 47.43 19.69 50.49 22.76 54.48 27.69 55.73 30.31 53.19 33 50.57 31.24 46.04 28.44 48.38 26.29 50.17 26.16 47.08 28.3 45.14 29.61 43.95 30.78 43.58 38.92 41.75 39.45 41.63 39.41 41.52 38.39 40.01 36.87 37.78 36.04 35.22 34.72 28.69 33.37 22 32.04 19.3 29.5 18.07 28.69 17.68 26.59 17.49 25.3 17.69M24.11 26.51C18.61 27.67 18.16 27.82 17.98 28.55 17.64 29.91 18.54 30.44 20.51 30.05 25.4 29.08 30.11 28.03 30.49 27.83 31.65 27.23 31 25.33 29.66 25.4 29.5 25.4 27 25.91 24.11 26.51M29.2 31.42C28.64 31.54 26.23 32.07 23.85 32.58 20.01 33.41 19.48 33.57 19.15 33.96 18.67 34.5 18.66 35.05 19.12 35.63 19.61 36.26 19.86 36.23 26.05 34.88 29.05 34.23 31.53 33.7 31.57 33.7 31.82 33.7 32.34 32.88 32.34 32.5 32.34 31.25 31.37 30.92 29.2 31.42M29.79 37.19C28.81 37.41 26.45 37.94 24.53 38.37 22.62 38.8 20.84 39.23 20.58 39.33 19.61 39.71 19.35 40.62 19.98 41.41 20.48 42.05 21 41.99 27.59 40.5 33.85 39.09 34.21 38.91 33.45 37.44 33.02 36.61 32.51 36.58 29.79 37.19M45.41 41.95C44.89 42.09 41.61 42.89 38.12 43.73 30.94 45.45 29.81 45.84 31.05 46.15 33.2 46.69 34.11 50.18 32.77 52.76 32.23 53.79 32.23 54.03 32.76 54.16 33.34 54.31 45.35 51.3 46.72 50.67 50.19 49.06 51.76 45.01 49.79 42.76 48.8 41.64 47.46 41.39 45.41 41.95`}),(0,R.jsx)(`path`,{style:{fill:nE.grape},d:`M48.21 10.15C47.92 10.41 47.5 11.27 46.96 12.74 45.52 16.61 45.24 16.99 43.01 18.15 39.18 20.15 39.05 20.99 42.28 22.73 45.37 24.39 45.68 24.79 47.12 28.95 48.3 32.32 49.28 32.2 50.65 28.52 52.23 24.25 52.26 24.22 55.2 22.56 57.53 21.24 57.79 21 57.79 20.16 57.79 19.49 57.55 19.31 55.01 18.06 52.16 16.66 52.2 16.72 50.31 11.56 49.7 9.89 49.03 9.44 48.21 10.15M32.59 13.92C31.78 14.73 32.28 15.89 33.58 16.22 35.07 16.6 36.19 17.1 37.17 17.84 38.42 18.77 39.23 18.86 39.79 18.15 39.99 17.9 40.15 17.53 40.15 17.32 40.15 15.29 33.99 12.52 32.59 13.92M42.48 34.38C40.96 35.96 40.65 36.88 41.39 37.57 42.2 38.33 43.36 37.74 44.55 35.95 45.2 34.97 45.22 34.35 44.62 33.88 43.89 33.31 43.41 33.42 42.48 34.38`}),(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M40.75 25.96C39.69 27.07 38.11 30.69 38.11 31.98 38.11 32.66 38.55 33.19 39.12 33.19 39.8 33.19 40.24 32.73 40.58 31.66 40.95 30.46 41.65 29.09 42.42 28.01 43.77 26.14 42.29 24.32 40.75 25.96M54.85 27.67C54.71 27.81 54.47 28.32 54.31 28.82 53.67 30.76 53.19 31.37 51.67 32.13 50.25 32.85 50.34 33.36 52.04 34.21 53.25 34.82 53.57 35.23 54.24 37.01 54.98 38.98 55.47 39.08 56.03 37.37 56.7 35.32 57.08 34.81 58.64 33.87 60.18 32.95 60.14 32.65 58.38 31.78 57.02 31.11 56.68 30.66 56.02 28.65 55.69 27.64 55.25 27.27 54.85 27.67`})]})}function mpe(){return(0,R.jsxs)(`g`,{children:[(0,R.jsx)(`path`,{fillRule:`evenodd`,style:{fill:rE},d:`M42.24 14.07C41.52 14.24 40.53 14.54 35.06 16.26 33.33 16.8 31.2 17.47 30.34 17.74 29.47 18.01 27.86 18.52 26.75 18.88 25.64 19.23 24.03 19.74 23.16 20.01 20.16 20.94 19.45 21.4 18.97 22.71 18.71 23.44 18.45 26.33 17.83 35.41 17.64 38.25 17.44 41.03 17.41 41.58 17.32 42.77 17.24 42.69 18.79 42.84L20.01 42.95 21.98 39.97C24.69 35.88 24.85 35.82 27.05 37.9 27.9 38.7 28.43 39.08 28.61 39.02 28.76 38.96 28.91 38.91 28.94 38.91 28.98 38.91 29.38 38.38 29.84 37.73 30.3 37.08 31.47 35.48 32.43 34.17 33.4 32.86 34.86 30.85 35.67 29.71 36.49 28.56 37.5 27.29 37.91 26.88 39.73 25.07 41.01 26.43 43.32 32.67 43.76 33.84 44.3 35.28 44.52 35.86 44.74 36.44 44.97 37.28 45.04 37.74 45.19 38.71 45.17 38.71 46.63 38.03 47.69 37.53 47.77 37.46 47.68 37.02 47.58 36.52 46.97 30.64 46.79 28.41 46.73 27.69 46.62 26.43 46.53 25.61 46.44 24.79 46.24 22.87 46.09 21.32 45.61 16.44 45.5 15.66 45.22 15.12 44.72 14.15 43.59 13.76 42.24 14.07M29.38 22.45C26.04 23.47 24.49 27.62 26.6 29.91 29.17 32.7 34.15 30.16 34.16 26.05 34.16 23.38 31.9 21.68 29.38 22.45M46.7 41.5C39.3 44.23 28.33 46.04 20.1 45.88L17.21 45.82 17.16 46.88C17.08 48.22 17.33 49.03 18.01 49.68 18.73 50.37 19.73 50.35 23.77 49.53 25.46 49.19 29.12 48.47 31.91 47.93 46.31 45.14 46.9 44.99 47.57 43.91 47.95 43.3 48.25 41.29 47.99 41.15 47.91 41.11 47.33 41.26 46.7 41.5`}),(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M29.72 22.45C25.84 23.34 24.28 28.36 27.25 30.42 29.34 31.88 32.91 30.43 33.83 27.75 34.92 24.55 32.75 21.76 29.72 22.45`}),(0,R.jsx)(`path`,{style:{fill:nE.mint},d:`M12.96 14.29C12.87 14.41 12.7 15.03 12.58 15.68 12.37 16.82 11.59 18.26 11.18 18.26 11.08 18.26 10.88 18.46 10.72 18.7 10.36 19.25 10.59 19.58 11.45 19.74 12.18 19.88 13.08 20.63 13.54 21.49 14.23 22.76 14.75 22.53 15.15 20.79 15.39 19.71 15.51 19.51 16.4 18.66 17.54 17.58 17.51 17.36 16.18 16.85 15.16 16.47 14.84 16.19 14.14 15.1 13.56 14.2 13.22 13.96 12.96 14.29M49.04 24.13C48.56 24.86 48.91 25.31 50.59 26.09 53.89 27.64 54.85 29.82 53.45 32.6 52.01 35.43 46.84 38.54 40.51 40.39 39.73 40.62 38.88 40.89 38.62 40.99 37.24 41.52 30.85 42.64 27.54 42.93 20.72 43.52 13.63 42.49 10.57 40.46 5.81 37.3 7.51 32.32 14.74 28.24 15.84 27.61 16.17 27.1 15.9 26.4 15.66 25.78 15.35 25.84 13.19 26.94 6 30.61 2.97 35.32 4.95 39.74 7.86 46.21 22.78 47.8 40.05 43.46 51.97 40.47 58.57 36.38 59.47 31.43 60.09 27.97 57.74 25.34 52.93 24.12 50.6 23.53 49.43 23.54 49.04 24.13`}),(0,R.jsx)(`path`,{style:{fill:nE.grape},d:`M34.82 8.91C33.48 10.04 34.21 12.14 35.94 12.14 37.29 12.14 38.18 10.99 37.77 9.77 37.36 8.53 35.81 8.08 34.82 8.91M53.15 43.16C53 43.28 52.74 43.86 52.57 44.45 52.18 45.78 51.76 46.32 50.64 46.93 49.52 47.53 49.45 47.89 50.33 48.34 51.34 48.85 52.24 49.95 52.56 51.04 53.13 53.01 53.6 53 54.21 50.99 54.61 49.69 55.13 48.93 55.91 48.54 57.17 47.91 57.23 47.51 56.15 46.96 55.23 46.49 54.67 45.76 54.23 44.44 53.8 43.15 53.54 42.84 53.15 43.16M24.18 53.18C22.45 53.9 22.87 56.59 24.71 56.59 26.79 56.59 27.2 53.67 25.2 53.09 24.89 53.01 24.51 53.04 24.18 53.18`}),(0,R.jsx)(`path`,{style:{fill:nE.yellow},d:`M51.76 11.04C51.21 12.77 50.56 13.61 49.24 14.34 48.6 14.69 48.72 15.07 49.59 15.48 50.54 15.93 51.11 16.69 51.62 18.22 52.06 19.57 52.26 19.54 52.79 18.08 53.29 16.69 53.87 15.91 54.86 15.31 55.76 14.77 55.77 14.48 54.92 14.02 53.91 13.46 53.5 12.99 52.89 11.66 52.23 10.21 52.06 10.12 51.76 11.04M11.06 48.22C10.99 48.35 10.71 48.88 10.46 49.41 9.95 50.48 9.45 50.99 8.59 51.33 7.89 51.61 7.85 52.1 8.52 52.37 9.51 52.79 10.3 53.85 10.89 55.58 11.09 56.18 11.48 55.88 11.87 54.84 12.24 53.87 13.33 52.56 13.79 52.56 14 52.56 14.5 52.06 14.5 51.85 14.5 51.77 14.19 51.54 13.81 51.34 12.98 50.92 12.36 50.14 11.93 48.99 11.6 48.09 11.31 47.83 11.06 48.22`})]})}function hpe(){return(0,R.jsxs)(`g`,{transform:`translate(2 8) scale(.114) translate(-125 -122)`,children:[(0,R.jsx)(`path`,{style:{fill:nE.coral},d:`M278 155 482 123C517 117 527 135 530 167L542 309Q543 329 561 341L631 404Q649 419 646 444 645 465 623 472L407 521Q374 531 345 519L156 436Q115 418 128 375L221 191Q238 163 278 155Z`}),(0,R.jsx)(`path`,{style:{fill:nE.ink},d:`M317 183 461 161Q493 155 497 188L504 288Q508 320 478 326L318 356Q289 362 286 331L281 226Q278 194 317 183Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M304 386 553 340Q562 337 570 346L631 404Q649 419 646 444Q645 448 629 452L411 483Q382 492 367 474Z`}),(0,R.jsxs)(`g`,{style:{fill:nE.cream},children:[(0,R.jsx)(`rect`,{x:`319`,y:`236`,width:`26`,height:`59`,rx:`13`}),(0,R.jsx)(`rect`,{x:`364`,y:`229`,width:`26`,height:`59`,rx:`13`})]}),(0,R.jsxs)(`g`,{style:{fill:nE.ink},transform:`rotate(-11 470 411)`,children:[(0,R.jsx)(`rect`,{x:`369`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`444`,y:`380`,width:`61`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`518`,y:`380`,width:`57`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`392`,y:`421`,width:`58`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`462`,y:`421`,width:`65`,height:`25`,rx:`13`}),(0,R.jsx)(`rect`,{x:`539`,y:`421`,width:`58`,height:`25`,rx:`13`})]})]})}function gpe(){return(0,R.jsxs)(`g`,{transform:`translate(3 10) scale(.114) translate(-760 -140)`,children:[(0,R.jsx)(`path`,{style:{fill:nE.blue},d:`M1226 153C1257 153 1273 195 1267 231Q1263 265 1237 268L1176 270V215C1176 178 1195 153 1226 153Z`}),(0,R.jsx)(`path`,{style:{fill:nE.blue},d:`M824 376Q908 372 871 400C842 427 866 442 902 450L1113 480Q1188 479 1199 392C1207 447 1204 497 1163 511Q1134 521 1097 516C1055 510 991 507 957 507S869 511 826 512C781 513 758 483 760 441Q760 385 824 376Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M824 376 857 184Q864 133 911 141C1039 169 1124 151 1226 153Q1179 159 1184 241L1199 377C1202 434 1174 482 1117 480L902 450C864 445 849 429 871 400Q908 372 824 376Z`}),(0,R.jsxs)(`g`,{style:{fill:nE.coral},children:[(0,R.jsx)(`path`,{d:`M982 198C1008 190 1030 197 1028 220L1023 265Q1020 295 1000 279C981 261 951 223 963 210Q970 202 982 198Z`}),(0,R.jsx)(`path`,{d:`M1063 220C1077 215 1100 237 1102 251Q1107 267 1084 282L1063 295Q1037 307 1040 278L1045 245Q1049 224 1063 220Z`}),(0,R.jsx)(`path`,{d:`M911 252C925 240 939 254 957 269L978 291Q995 311 961 316C938 318 907 316 898 308Q884 296 911 252Z`}),(0,R.jsx)(`path`,{d:`M1106 289Q1127 281 1134 304C1142 327 1146 352 1125 350Q1097 348 1073 335C1051 324 1072 311 1084 302Z`}),(0,R.jsx)(`path`,{d:`M927 338C946 334 972 334 985 343Q1004 353 984 384C970 408 957 418 940 403C922 389 896 356 913 345Z`}),(0,R.jsx)(`path`,{d:`M1010 375Q1025 363 1037 384C1049 407 1064 438 1044 442Q1025 448 1002 436C984 428 991 410 997 393Z`}),(0,R.jsx)(`path`,{d:`M1068 357C1084 359 1110 376 1120 389Q1130 402 1107 419C1090 432 1082 418 1073 401C1062 383 1043 355 1068 357Z`}),(0,R.jsx)(`path`,{d:`M1018 311C1037 312 1050 334 1034 343C1018 351 998 337 1005 320Q1009 311 1018 311Z`})]})]})}function _pe(){return(0,R.jsxs)(`g`,{transform:`translate(2 7) scale(.11) translate(-1380 -96)`,children:[(0,R.jsx)(`path`,{style:{fill:nE.inkcap},d:`M1384 276C1394 238 1445 200 1497 158C1547 119 1604 97 1647 97C1690 97 1720 109 1745 138C1772 170 1791 184 1833 194C1870 201 1919 220 1922 257C1923 307 1891 339 1853 336C1801 335 1767 299 1701 294C1666 291 1620 294 1642 303Q1670 307 1675 333C1681 367 1697 389 1717 413C1735 434 1738 443 1719 464C1700 485 1692 502 1686 520Q1682 541 1653 541L1626 541Q1598 541 1594 519C1590 495 1578 474 1563 458C1545 440 1544 429 1559 410C1585 377 1608 337 1572 326C1554 320 1529 333 1506 340C1461 356 1428 357 1402 340Q1371 319 1384 276Z`}),(0,R.jsx)(`path`,{style:{fill:nE.cream},d:`M1634 362Q1641 346 1649 362C1660 390 1676 404 1705 424Q1721 435 1704 453C1685 475 1677 490 1671 513Q1670 526 1653 525L1626 525Q1611 525 1610 513C1606 492 1592 465 1575 449Q1562 437 1577 424C1604 404 1620 390 1634 362Z`}),(0,R.jsx)(`path`,{style:{fill:nE.inkcap},d:`M1634 456A18 18 0 1 1 1648 456V492Q1648 500 1641 500T1634 492Z`}),(0,R.jsx)(`path`,{style:{fill:nE.inkcap},d:`M1780 391Q1786 386 1793 396C1810 420 1828 444 1827 467C1826 508 1768 510 1753 480C1741 456 1762 413 1780 391Z`})]})}var{coral:lE,blue:uE,mint:dE,grape:fE,yellow:pE,cream:mE,ink:hE}=nE,vpe={bonsai:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,stroke:dE,strokeWidth:`3.7`,strokeLinecap:`round`,d:`M35 27.5C36 25 35.5 22.5 34 21S31.5 17.5 31.5 14M36 27C40 26.8 43 26 45 24S47 20.5 47.5 18.5M30.5 31C32.5 26.5 30.5 24.6 26.5 24 22 23.5 18.5 21.6 16.8 18.5M29 37C26.5 34.5 25 33.7 21.5 33.2S15.5 32 13 31.6M36 39.5C38 38 40 37.5 42 36.5S47 34 51 32.2`}),(0,R.jsx)(`path`,{fill:dE,d:`M25.5 43.5C28 40.5 28 37 27.5 33 27.3 29.5 29.5 27 33.5 26.3L37.5 26V29.5C35 29.8 34.2 31.5 34.3 34 34.5 37.5 37 39.5 41 43.5Z`}),(0,R.jsx)(`circle`,{fill:uE,cx:`31.5`,cy:`10.7`,r:`4.8`}),(0,R.jsx)(`circle`,{fill:fE,cx:`16.6`,cy:`18.3`,r:`4.6`}),(0,R.jsx)(`circle`,{fill:pE,cx:`47.9`,cy:`17.7`,r:`4.6`}),(0,R.jsx)(`circle`,{fill:pE,cx:`12.8`,cy:`31.5`,r:`4.6`}),(0,R.jsx)(`circle`,{fill:uE,cx:`50.9`,cy:`32.1`,r:`4.6`}),(0,R.jsx)(`path`,{fill:lE,d:`M16 46H47.5C47.5 54 44 58 38 58H25.5C19.5 58 16 54 16 46Z`}),(0,R.jsx)(`rect`,{fill:lE,x:`14`,y:`43`,width:`35.5`,height:`4.6`,rx:`2.3`})]}),computer:(0,R.jsx)(hpe,{}),prints:(0,R.jsx)(gpe,{}),inkcap:(0,R.jsx)(_pe,{}),vishnu:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{fill:lE},d:`M6 37C6 21 17.5 9 32 9s26 12 26 28c0 2.2-1.8 4-4 4H10c-2.2 0-4-1.8-4-4Z`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`19`,cy:`25`,r:`4`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`33`,cy:`19.5`,r:`4.8`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`46`,cy:`28`,r:`3.4`}),(0,R.jsx)(`rect`,{style:{fill:uE},x:`13`,y:`39`,width:`38`,height:`18`,rx:`9`}),(0,R.jsx)(`rect`,{style:{fill:mE},x:`18.5`,y:`46.2`,width:`10`,height:`3.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{style:{fill:mE},x:`21.7`,y:`43`,width:`3.6`,height:`10`,rx:`1.8`}),(0,R.jsx)(`circle`,{style:{fill:pE},cx:`39`,cy:`50.5`,r:`2.7`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`45`,cy:`45.5`,r:`2.7`})]}),generateText:(0,R.jsx)(ppe,{}),generateMedia:(0,R.jsx)(mpe,{}),buyApps:(0,R.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,R.jsx)(`circle`,{fill:pE,cx:`32`,cy:`20`,r:`12`}),(0,R.jsx)(`circle`,{stroke:mE,strokeWidth:`4`,cx:`32`,cy:`20`,r:`6`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(15.5 12) rotate(-60) scale(1.1 .85)`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(48.5 12) rotate(60) scale(1.1 .85)`}),(0,R.jsx)(`path`,{fill:uE,d:`M10 35H54L50 53Q49 58 44 58H20Q15 58 14 53Z`}),(0,R.jsx)(`rect`,{fill:lE,x:`5`,y:`27`,width:`54`,height:`10`,rx:`5`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`rect`,{x:`20`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,R.jsx)(`rect`,{x:`29.5`,y:`41`,width:`5`,height:`11`,rx:`2.5`}),(0,R.jsx)(`rect`,{x:`39`,y:`41`,width:`5`,height:`11`,rx:`2.5`})]})]}),browseBazaar:(0,R.jsxs)(`g`,{transform:`rotate(-5 32 32)`,children:[(0,R.jsx)(`rect`,{fill:uE,x:`10`,y:`14`,width:`44`,height:`38`,rx:`6`}),(0,R.jsx)(`rect`,{fill:uE,x:`5`,y:`47`,width:`54`,height:`12`,rx:`6`}),(0,R.jsx)(`rect`,{fill:mE,x:`12`,y:`50.5`,width:`40`,height:`4.5`,rx:`2.25`}),(0,R.jsx)(`rect`,{fill:lE,x:`2`,y:`4`,width:`60`,height:`9`,rx:`4.5`}),(0,R.jsx)(`path`,{fill:lE,d:`M3 9H14.6V18A5.8 5.8 0 0 1 3 18Z`}),(0,R.jsx)(`path`,{fill:mE,d:`M14.6 9H26.2V18A5.8 5.8 0 0 1 14.6 18Z`}),(0,R.jsx)(`path`,{fill:lE,d:`M26.2 9H37.8V18A5.8 5.8 0 0 1 26.2 18Z`}),(0,R.jsx)(`path`,{fill:mE,d:`M37.8 9H49.4V18A5.8 5.8 0 0 1 37.8 18Z`}),(0,R.jsx)(`path`,{fill:lE,d:`M49.4 9H61V18A5.8 5.8 0 0 1 49.4 18Z`}),(0,R.jsx)(`g`,{transform:`translate(32 36.5) scale(.34)`,children:(0,R.jsx)(aE,{})})]}),agent:(0,R.jsxs)(`g`,{transform:`translate(32 33) scale(2.02) translate(-47.2 -41.8)`,children:[(0,R.jsx)(`path`,{fill:uE,d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,R.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,R.jsx)(sE,{})})]}),list:(0,R.jsxs)(`g`,{transform:`rotate(-7 32 32)`,children:[(0,R.jsx)(`path`,{style:{fill:uE},d:`M12 13Q6 13 6 19V50Q6 57 13 57H47Q53 57 53 50V20Q53 13 47 13Z`}),(0,R.jsx)(`path`,{style:{fill:mE},d:`M19 7H39Q42 7 44 9L55 20Q57 22 57 26V44Q57 50 51 50H19Q13 50 13 44V13Q13 7 19 7Z`}),(0,R.jsx)(`path`,{style:{fill:lE},d:`M39 7V18Q39 24 45 24H57Q57 22 55 20L44 9Q42 7 39 7Z`}),(0,R.jsxs)(`g`,{style:{fill:lE},children:[(0,R.jsx)(`circle`,{cx:`22`,cy:`21`,r:`3`}),(0,R.jsx)(`circle`,{cx:`22`,cy:`31`,r:`3`}),(0,R.jsx)(`circle`,{cx:`22`,cy:`41`,r:`3`})]}),(0,R.jsx)(`path`,{style:{stroke:uE},strokeWidth:`5`,strokeLinecap:`round`,d:`M31 21H32M31 31H46M31 41H42`})]}),chat:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{transform:`translate(3 11) scale(.22) translate(-449 -327)`,children:(0,R.jsx)(lpe,{})}),(0,R.jsx)(iE,{transform:`translate(38.2 18) rotate(16) scale(.95 .6)`}),(0,R.jsx)(iE,{transform:`translate(44.4 20.5) rotate(47) scale(.95 .6)`})]}),read:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{transform:`translate(4 20.5) scale(.56)`,children:(0,R.jsx)(cpe,{})}),(0,R.jsx)(`g`,{transform:`translate(32 38.6) scale(.3164)`,children:(0,R.jsx)(aE,{})}),(0,R.jsx)(spe,{})]}),readConversations:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(.9) translate(-32 -32)`,children:[(0,R.jsx)(`g`,{transform:`translate(4 7.88) scale(.56)`,children:(0,R.jsx)(oE,{fill:uE})}),(0,R.jsx)(`g`,{transform:`translate(32.2 30.3) scale(.352)`,children:(0,R.jsx)(aE,{})})]}),listAgents:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(1.04) translate(-32 -32)`,children:[(0,R.jsx)(`path`,{style:{fill:rE},d:`M32.059 10.146C23.878 10.646 18.949 14.844 18.925 21.331 18.912 24.856 20.167 27.259 22.274 27.74 24.437 28.233 26.097 29.061 27.481 30.337 28.275 31.068 28.328 31.096 29.352 31.306 31.161 31.677 31.653 32.094 32.115 33.651 32.392 34.582 32.557 34.868 32.915 35.041 33.919 35.523 35.864 33.733 36.539 31.706L36.775 30.997 38.008 30.681C42.663 29.489 45.29 26.142 45.468 21.176 45.734 13.784 40.673 9.62 32.059 10.146Z`}),(0,R.jsx)(`g`,{transform:`translate(32.4 21.2) scale(.39)`,children:(0,R.jsx)(sE,{onFigure:!0})}),(0,R.jsx)(`path`,{style:{fill:lE},d:`M14.375 27.586C8.014 28.591 4.363 32.396 4.355 38.027 4.347 43.93 8.071 47.469 15.239 48.368L16.828 48.568 17.873 49.568C19.854 51.464 22.469 52.496 23.691 51.864 24.384 51.506 24.431 51.044 23.924 49.606 23.337 47.943 23.479 47.492 24.749 46.977 32.756 43.73 32.643 31.899 24.573 28.49 22.238 27.504 17.535 27.087 14.375 27.586Z`}),(0,R.jsx)(`g`,{transform:`translate(17.6 37.7) scale(.38 .36)`,children:(0,R.jsx)(sE,{})}),(0,R.jsx)(`path`,{style:{fill:uE},d:`M46.666 29.533C39.623 30.116 34.627 34.849 34.603 40.96 34.585 45.387 36.412 47.971 40.602 49.445 42.036 49.95 42.076 50.049 41.491 51.666 40.968 53.111 41.167 53.761 42.201 53.988 43.463 54.265 46.679 52.293 47.929 50.475 48.134 50.178 48.268 50.13 49.332 49.977 56.938 48.882 60.956 43.889 59.582 37.237 58.622 32.59 53.42 29.07 48.034 29.424 47.904 29.432 47.289 29.482 46.666 29.533Z`}),(0,R.jsx)(`g`,{transform:`translate(47.3 40) scale(.36 .34)`,children:(0,R.jsx)(sE,{})})]}),createAgents:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,R.jsx)(`path`,{style:{fill:rE},d:`M20.436 24.499C13.35 25.216 7.504 28.799 5.442 33.687 3.114 39.208 4.438 45.791 8.593 49.358 10.446 50.949 10.34 50.831 10.34 51.301 10.34 51.796 10.106 52.294 9.281 53.558 7.191 56.76 12.108 56.905 16.701 53.777 17.517 53.221 17.715 53.135 18.015 53.201 20.013 53.639 25.739 53.051 28.595 52.113 35.47 49.857 39.129 44.162 37.83 37.738C37 31 33 26 26.717 24.428L24.075 24.413C22.623 24.405 20.985 24.444 20.436 24.499Z`}),(0,R.jsx)(`g`,{transform:`translate(21.9 40) scale(.46 .43)`,children:(0,R.jsx)(sE,{onFigure:!0})}),(0,R.jsx)(`path`,{style:{fill:dE},d:`M37.987 15.734C32.277 16.627 28.675 20.713 28.92 26.022 29.062 29.118 30.627 31.606 33.331 33.036 34.675 33.747 34.761 34.018 34.237 35.923 33.376 39.051 36.878 38.551 39.174 35.218 39.574 34.637 39.65 34.583 40.058 34.583 46.203 34.583 50.414 30.91 50.424 25.543 50.435 18.989 44.932 14.649 37.987 15.734Z`}),(0,R.jsx)(`g`,{transform:`translate(38.9 24.9) scale(.31)`,children:(0,R.jsx)(sE,{})}),(0,R.jsx)(iE,{fill:pE,transform:`translate(48.1 15.7) rotate(31) scale(1.25 .85)`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(52.2 19.8) rotate(70) scale(1.25 .85)`})]}),sendPrompts:(0,R.jsxs)(`g`,{transform:`translate(32 32) scale(1.08) translate(-32 -32)`,children:[(0,R.jsx)(`g`,{transform:`translate(4 13.2) scale(.412 .436)`,children:(0,R.jsx)(oE,{fill:lE})}),(0,R.jsx)(`g`,{transform:`translate(17.1 28.7) scale(.19)`,children:(0,R.jsx)(upe,{})}),(0,R.jsx)(iE,{fill:dE,transform:`translate(48.1 26.4) rotate(65) scale(1.7 1.28)`}),(0,R.jsx)(iE,{fill:dE,transform:`translate(48.4 33.8) rotate(110) scale(1.7 1.28)`})]}),write:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(dpe,{}),(0,R.jsx)(fpe,{})]}),run:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{style:{fill:uE},x:`6`,y:`9`,width:`52`,height:`43`,rx:`7`}),(0,R.jsx)(`path`,{style:{stroke:mE},strokeWidth:`5`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m17 22 9 8-9 8m17 0h12`})]}),connected:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,style:{stroke:uE},strokeWidth:`12`,strokeLinecap:`round`,d:`M34 37Q43 21 26 20H18Q3 20 6 37q2 10 15 9`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:lE},strokeWidth:`12`,strokeLinecap:`round`,d:`M29 33Q20 50 38 53h8q16-1 12-17-2-11-14-10`}),(0,R.jsx)(`path`,{style:{stroke:pE},strokeWidth:`4`,strokeLinecap:`round`,d:`m27 4 2 6m10-5-2 7m12 0-5 4`})]}),working:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ellipse`,{style:{fill:dE},cx:`23`,cy:`14`,rx:`13`,ry:`8`,transform:`rotate(-30 23 14)`}),(0,R.jsx)(`ellipse`,{style:{fill:pE},cx:`48`,cy:`36`,rx:`13`,ry:`8`,transform:`rotate(35 48 36)`}),(0,R.jsx)(`ellipse`,{style:{fill:fE},cx:`22`,cy:`48`,rx:`13`,ry:`8`,transform:`rotate(45 22 48)`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:rE},strokeWidth:`3`,strokeLinecap:`round`,d:`M42 8q13 2 13 13M43 55q-5 5-12 4M5 39q-5-9 1-17`})]}),complete:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{fill:dE},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:hE},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`m23 29 7 7 13-15`}),(0,R.jsx)(`path`,{style:{stroke:rE},strokeWidth:`3`,strokeLinecap:`round`,d:`m4 8 5 6m48-4 5-5M2 24l6 1`})]}),installApps:(0,R.jsxs)(`g`,{transform:`rotate(-6 32 32)`,children:[(0,R.jsx)(`rect`,{style:{fill:uE},x:`9`,y:`26`,width:`46`,height:`32`,rx:`10`}),(0,R.jsx)(`rect`,{style:{fill:mE},x:`17`,y:`33`,width:`30`,height:`18`,rx:`5`}),(0,R.jsx)(`path`,{style:{fill:dE},d:`M22 38h8v8h-8z`}),(0,R.jsx)(`path`,{style:{fill:fE},d:`M34 38h8v8h-8z`}),(0,R.jsx)(`path`,{style:{stroke:lE},strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M32 4v17m-8-7 8 8 8-8`})]}),restricted:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,style:{stroke:lE},strokeWidth:`9`,strokeLinecap:`round`,d:`M16 23V19q0-17 16-17t16 17v4`}),(0,R.jsx)(`rect`,{style:{fill:lE},x:`8`,y:`26`,width:`48`,height:`36`,rx:`9`}),(0,R.jsx)(`path`,{style:{fill:mE},d:`M32 34a7 7 0 0 0-4 13v7h8v-7a7 7 0 0 0-4-13Z`})]}),error:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{fill:lE},d:`M32 6q5-8 10 0 9-3 10 6 9 2 5 11 8 6 0 12 3 9-6 11-1 9-10 6-6 8-12 0-9 3-11-6-9-2-6-11-8-6 0-12-3-9 6-11 1-9 10-6Z`}),(0,R.jsx)(`path`,{fill:`none`,style:{stroke:mE},strokeWidth:`7`,strokeLinecap:`round`,d:`M32 18v15`}),(0,R.jsx)(`circle`,{style:{fill:mE},cx:`32`,cy:`45`,r:`4`})]}),trellis:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`g`,{fill:pE,children:[(0,R.jsx)(`rect`,{x:`17.25`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,R.jsx)(`rect`,{x:`42.95`,y:`9`,width:`3.9`,height:`49.2`,rx:`1.95`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`18`,width:`3.2`,height:`26`}),(0,R.jsx)(`rect`,{x:`14.8`,y:`15.75`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,R.jsx)(`rect`,{x:`14.8`,y:`28.85`,width:`34.4`,height:`3.1`,rx:`1.55`}),(0,R.jsx)(`rect`,{x:`14.8`,y:`42.55`,width:`34.4`,height:`3.1`,rx:`1.55`})]}),(0,R.jsx)(`path`,{fill:`none`,stroke:dE,strokeWidth:`3`,strokeLinecap:`round`,d:`M21.9 56.1C31.5 54.4 32.9 47 32.1 45.8`}),(0,R.jsx)(`path`,{fill:`none`,stroke:dE,strokeWidth:`3`,strokeLinecap:`round`,d:`M32 44.2C28.7 41.8 25.2 35.7 32 32.3 38.8 28 38.9 24 31.9 18.8 32.4 16.3 32.8 14.7 34.5 12.2`}),(0,R.jsx)(cE,{transform:`translate(32.1 14.1) rotate(45) scale(0.45 0.86)`}),(0,R.jsx)(cE,{transform:`translate(32.2 14.7) rotate(-60) scale(0.42 0.58)`}),(0,R.jsx)(cE,{transform:`translate(34.8 28.3) rotate(65) scale(0.38 0.8)`}),(0,R.jsx)(cE,{transform:`translate(28.2 33.1) rotate(-51) scale(0.5 0.57)`}),(0,R.jsx)(cE,{transform:`translate(28.6 53.3) rotate(-48) scale(0.47 0.6)`}),(0,R.jsx)(`circle`,{fill:lE,cx:`31.9`,cy:`18.8`,r:`4`}),(0,R.jsx)(`circle`,{fill:uE,cx:`32`,cy:`32.3`,r:`4`}),(0,R.jsx)(`circle`,{fill:fE,cx:`32`,cy:`44.2`,r:`4`})]}),games:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:uE,d:`M18.5 28.5H45.5C49.5 29.5 53 32 54 35 55 37.5 56.8 45.5 56.6 48 56.5 53 52.5 57.5 47 58H15C9.5 56.5 6.6 51 7.6 45.5 8.6 39.5 9.3 35 10.5 33 12 31 14.5 29.5 18.5 28.5Z`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`26.8`,cy:`37.9`,rx:`9.1`,ry:`5.6`}),(0,R.jsx)(`ellipse`,{fill:hE,cx:`27`,cy:`37.6`,rx:`4.7`,ry:`2.2`}),(0,R.jsx)(`path`,{fill:hE,d:`M23.1 26V35.4A4 4.2 0 0 0 31.1 35.4V26Z`}),(0,R.jsx)(`circle`,{fill:lE,cx:`27.1`,cy:`18.3`,r:`12.4`}),(0,R.jsx)(`circle`,{fill:mE,cx:`22.6`,cy:`14.3`,r:`3.05`}),(0,R.jsx)(`ellipse`,{fill:pE,cx:`45.1`,cy:`37.2`,rx:`5.6`,ry:`3.95`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`40.1`,cy:`46.6`,rx:`6.2`,ry:`4.4`})]}),oyster:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:fE,d:`M35.5 6C33.7 6.3 32.3 7.6 31.4 9.4 30.9 10.3 30.4 10.3 29.5 10 25.5 9 20.6 11.6 19.6 15.9 19.4 16.6 19 17 18 17.1 14.5 17.6 12 20.6 12.1 24.2 12.2 25.4 12 25.9 11.5 26.5 7.5 30 10.5 34.5 17.5 34.4 15.3 32.6 16 31 19 29 26 24 37 19.5 43.5 19 46 19 46 22 43 25.5 46.5 23.5 51.5 18.5 53.5 15 55 11 50 7 45 9 43.8 9.4 43.3 9.2 42.5 8 40.7 6.3 38 5.6 35.5 6Z`}),(0,R.jsx)(`circle`,{fill:mE,cx:`34.9`,cy:`41.9`,r:`11.3`}),(0,R.jsxs)(`g`,{fill:hE,children:[(0,R.jsx)(`rect`,{x:`29.9`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`}),(0,R.jsx)(`rect`,{x:`36.7`,y:`33.2`,width:`3.2`,height:`5.6`,rx:`1.6`})]}),(0,R.jsx)(`path`,{fill:fE,d:`M49.5 39C47.9 39.3 46.5 40 46.1 41.6 45.8 43.2 45.5 43.5 44 43.5 38.5 43.5 35 48 39 49.5 40 50 39.5 50.5 38 51 35.5 52.5 32.5 52 30 51 29 50.5 28.5 50 29.5 50 33 47.5 30 43.5 24.5 43.5 23.3 43.5 22.9 43.3 22.5 43 20.5 40.5 19 40 17.5 39.5 13 39.5 13 44 17 47.5 18.3 48.4 18.6 48.7 19 49.5 20.5 53 23 55 26 55 26.8 55 27 55.3 27.5 56 31 58.5 36.5 58.5 40 56 40.8 55.2 41.2 55 42 55 45 55 47.5 53 49 49.5 49.6 48.5 50 48 50.5 47.5 56 43.5 55 38.5 49.5 39Z`}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`3`,strokeLinecap:`round`,d:`M46.6 31.8 49.2 27.8 M49.4 35.5 52.8 33.7 M21.5 32.5 22.9 33.5 M19.3 37.5 21.1 38.1`})]}),tourtois:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:mE,x:`11.07`,y:`35.73`,width:`26.8`,height:`9.7`,rx:`3.25`,transform:`rotate(-5 24.47 40.58)`}),(0,R.jsx)(`path`,{fill:pE,d:`M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z`}),(0,R.jsx)(`path`,{fill:lE,d:`M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z`}),(0,R.jsx)(`path`,{fill:uE,d:`M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z`}),(0,R.jsx)(`path`,{fill:mE,d:`M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`circle`,{cx:`14.7`,cy:`18.45`,r:`1`}),(0,R.jsx)(`circle`,{cx:`17.6`,cy:`17.65`,r:`1`}),(0,R.jsx)(`circle`,{cx:`20.5`,cy:`16.85`,r:`1`}),(0,R.jsx)(`circle`,{cx:`17.9`,cy:`22.2`,r:`1`}),(0,R.jsx)(`circle`,{cx:`21`,cy:`21.5`,r:`1`}),(0,R.jsx)(`circle`,{cx:`24.1`,cy:`20.75`,r:`1`}),(0,R.jsx)(`circle`,{cx:`28.2`,cy:`25.3`,r:`1`})]}),(0,R.jsx)(`circle`,{fill:lE,cx:`21.7`,cy:`26.6`,r:`1`}),(0,R.jsx)(`circle`,{fill:pE,cx:`24.9`,cy:`25.9`,r:`1.05`}),(0,R.jsxs)(`g`,{fill:dE,children:[(0,R.jsx)(`ellipse`,{cx:`8.8`,cy:`36.6`,rx:`3.6`,ry:`1.9`,transform:`rotate(22 8.8 36.6)`}),(0,R.jsx)(`path`,{d:`M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.5L12 41Z`}),(0,R.jsx)(`path`,{d:`M40 33C39 38 36 42 34.5 41.5 32.5 40.5 29.5 42 28.5 44 26 49 27.5 51.5 32.5 51 36 51 37 50 36 46.5 36 45 37 44.5 38 44.5 38.5 45.5 40.5 49 43.5 50 46.5 47.5 47.5 46.5 46 43.5 44 42 43 41.5 43.5 40.5 44.5 39.5 46 38 47 37.5L47 33Z`})]}),(0,R.jsx)(`ellipse`,{fill:dE,cx:`46.4`,cy:`30.6`,rx:`8.1`,ry:`8.3`}),(0,R.jsxs)(`g`,{fill:hE,children:[(0,R.jsx)(`rect`,{x:`45.05`,y:`26.95`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 46.2 29.3)`}),(0,R.jsx)(`rect`,{x:`49.25`,y:`26.4`,width:`2.25`,height:`4.6`,rx:`1.1`,transform:`rotate(-6 50.4 28.7)`})]}),(0,R.jsx)(`path`,{fill:lE,d:`M46.8 32.2H51C51 34.3 50 35.4 48.9 35.4S46.8 34.3 46.8 32.2Z`,transform:`rotate(-8 48.9 33.5)`}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`3`,strokeLinecap:`round`,d:`M50.9 17.7 50.5 19.7 M55.2 20.1 53.4 21.9 M56.5 24.5 55.7 24.7`})]}),allApps:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:lE,x:`7`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 18.6 18.6)`}),(0,R.jsx)(`rect`,{fill:uE,x:`33.9`,y:`7.25`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 45.5 18.6)`}),(0,R.jsx)(`rect`,{fill:dE,x:`7`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(6.2 18.6 45.5)`}),(0,R.jsx)(`rect`,{fill:pE,x:`33.9`,y:`34.15`,width:`23.2`,height:`22.7`,rx:`4.6`,transform:`rotate(-6.2 45.5 45.5)`})]}),search:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:`none`,stroke:uE,strokeWidth:`6.5`,d:`M37 37.5 43 43.5`}),(0,R.jsx)(`path`,{fill:`none`,stroke:lE,strokeWidth:`12.6`,strokeLinecap:`round`,d:`M44.2 43.8 51.4 51.8`}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`3`,strokeLinecap:`round`,d:`M47.2 42.4 52.8 47.8`}),(0,R.jsx)(`ellipse`,{fill:uE,cx:`25.6`,cy:`24.6`,rx:`19.25`,ry:`18.6`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`25.2`,cy:`24.1`,rx:`14.2`,ry:`13.6`})]}),browser:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:lE,x:`5.9`,y:`6.15`,width:`52.2`,height:`51.7`,rx:`5.5`}),(0,R.jsx)(`path`,{fill:mE,d:`M10 16.5H29.4C30.3 16.1 31 14.4 31.8 12.5 32.5 10.9 33.2 10 34.5 10H52.2C53.4 10 54 10.7 54 12V16.5C55.2 16.5 56 17.1 56 18.3V52.4C56 53.7 55.1 54.6 53.8 54.6H10.2C8.9 54.6 8 53.7 8 52.4V18.2C8 17.1 8.7 16.5 10 16.5Z`}),(0,R.jsx)(`circle`,{fill:pE,cx:`12.2`,cy:`11.9`,r:`1.95`}),(0,R.jsx)(`circle`,{fill:uE,cx:`18.6`,cy:`11.9`,r:`1.95`}),(0,R.jsx)(`circle`,{fill:fE,cx:`25.1`,cy:`11.9`,r:`1.95`}),(0,R.jsx)(`circle`,{fill:dE,cx:`32`,cy:`34.9`,r:`14.5`}),(0,R.jsxs)(`g`,{fill:`none`,stroke:mE,strokeWidth:`3`,children:[(0,R.jsx)(`ellipse`,{cx:`32`,cy:`34.9`,rx:`7.7`,ry:`13.3`}),(0,R.jsx)(`path`,{d:`M17.5 34.9H46.5`})]})]}),internet:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ellipse`,{fill:`none`,stroke:pE,strokeWidth:`4.4`,cx:`32.2`,cy:`30.2`,rx:`25.6`,ry:`8.1`,transform:`rotate(-20.8 32.2 30.2)`}),(0,R.jsx)(`circle`,{fill:uE,cx:`32`,cy:`32`,r:`21.1`}),(0,R.jsxs)(`g`,{fill:`none`,stroke:mE,strokeWidth:`3`,children:[(0,R.jsx)(`ellipse`,{cx:`32`,cy:`31.8`,rx:`12.2`,ry:`18.7`}),(0,R.jsx)(`path`,{d:`M32 13.1V50.5M15 20.4Q32 29 49 20.4M12.5 39Q32 44.6 51.5 39`})]}),(0,R.jsx)(`path`,{fill:`none`,stroke:pE,strokeWidth:`4.4`,d:`M6.6 30.2A25.6 8.1 0 0 0 57.8 30.2`,transform:`rotate(-20.8 32.2 30.2)`})]}),members:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`circle`,{fill:uE,cx:`41.9`,cy:`22.85`,r:`12.2`}),(0,R.jsx)(`path`,{fill:uE,d:`M36 34C33.8 34.8 32.2 35.8 31 37 37.5 39.5 40.5 43.5 40.5 49.5V53.5H54.5C57 53.5 58 51 58 47.5 58 40 55 35.5 49 34Z`}),(0,R.jsx)(`circle`,{fill:lE,cx:`22.95`,cy:`27.6`,r:`12.85`}),(0,R.jsx)(`path`,{fill:lE,d:`M15.5 38C10.5 39 7.5 42.5 6.5 47 5.5 50.5 6 53.5 8.5 53.5H38.5C42 52 40 43 36 40 34.5 39 32 38 31 38Z`}),(0,R.jsxs)(`g`,{fill:hE,children:[(0,R.jsx)(`circle`,{cx:`18.3`,cy:`28`,r:`1.6`}),(0,R.jsx)(`circle`,{cx:`27.9`,cy:`28`,r:`1.6`}),(0,R.jsx)(`circle`,{cx:`39.1`,cy:`23.05`,r:`1.55`}),(0,R.jsx)(`circle`,{cx:`47.25`,cy:`23.05`,r:`1.55`})]})]}),sell:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{fill:pE,d:`M6.4 41.2V48.4C6.4 51.4 13.2 54 21.8 54S37.2 51.4 37.2 48.4V41.2C37.2 37.8 30.4 35 21.8 35S6.4 37.8 6.4 41.2Z`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`21.9`,cy:`40.8`,rx:`13.2`,ry:`3.6`}),(0,R.jsxs)(`g`,{transform:`rotate(-3 22.5 30) translate(0.5 0)`,children:[(0,R.jsx)(`path`,{fill:pE,d:`M7.5 26V34C7.5 37.3 14.2 40 22.5 40S37.5 37.3 37.5 34V26C37.5 22.7 30.8 20 22.5 20S7.5 22.7 7.5 26Z`}),(0,R.jsx)(`ellipse`,{fill:mE,cx:`23.7`,cy:`26.55`,rx:`13.05`,ry:`4.4`})]}),(0,R.jsxs)(`g`,{transform:`translate(46.3 40.3) rotate(-25)`,children:[(0,R.jsx)(`path`,{fill:lE,d:`M-8.5-10Q-8.5-12-7-13L-1.5-16.3Q0-17.2 1.5-16.3L7-13Q8.5-12 8.5-10V9Q8.5 12 5.5 12H-5.5Q-8.5 12-8.5 9Z`}),(0,R.jsx)(`circle`,{fill:mE,cx:`0`,cy:`-10.7`,r:`2.2`})]}),(0,R.jsx)(iE,{fill:pE,transform:`translate(38.2 18.6) scale(1.1 .86)`}),(0,R.jsx)(iE,{fill:pE,transform:`translate(42.8 21.2) rotate(45) scale(1.1 .85)`})]}),schedule:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:mE,x:`6`,y:`11`,width:`47.6`,height:`44`,rx:`6`}),(0,R.jsx)(`path`,{fill:lE,d:`M12 11H47.6Q53.6 11 53.6 17V21.5H6V17Q6 11 12 11Z`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`circle`,{cx:`16.1`,cy:`16.15`,r:`3.4`}),(0,R.jsx)(`circle`,{cx:`43.4`,cy:`16.15`,r:`3.4`})]}),(0,R.jsxs)(`g`,{fill:uE,children:[(0,R.jsx)(`rect`,{x:`13.6`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`}),(0,R.jsx)(`rect`,{x:`40.9`,y:`6`,width:`5`,height:`11.2`,rx:`2.5`})]}),(0,R.jsxs)(`g`,{fill:dE,children:[(0,R.jsx)(`rect`,{x:`11.1`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`20.7`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`20.7`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`11.1`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`30.4`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,R.jsxs)(`g`,{fill:fE,children:[(0,R.jsx)(`rect`,{x:`40.4`,y:`25.1`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`11.1`,y:`33.9`,width:`6.9`,height:`6.6`,rx:`1.8`}),(0,R.jsx)(`rect`,{x:`20.7`,y:`42.7`,width:`6.9`,height:`6.6`,rx:`1.8`})]}),(0,R.jsx)(`circle`,{fill:pE,cx:`45.5`,cy:`45.6`,r:`12.2`}),(0,R.jsx)(`path`,{fill:`none`,stroke:hE,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M45.1 39.3V46.2L51.3 49.8`}),(0,R.jsx)(`circle`,{fill:hE,cx:`45.1`,cy:`46.2`,r:`2.5`})]}),loop:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{style:{stroke:lE},strokeWidth:`6`,strokeLinecap:`round`,d:`M47.5 14.5C43 11 37.5 9 32 9 19.5 9 9 19.5 9 32S19.5 55 32 55 55 44.5 55 32`}),(0,R.jsx)(`path`,{style:{fill:lE},d:`M53.5 21.5Q54.5 20 55 22L58 33Q58.5 35 56.5 34.5L48.5 32.5Q47 32 48 30.5Z`}),(0,R.jsx)(`g`,{transform:`translate(18 21) scale(.28)`,children:(0,R.jsx)(oE,{fill:uE})}),(0,R.jsxs)(`g`,{style:{fill:mE},children:[(0,R.jsx)(`rect`,{x:`25`,y:`27.5`,width:`14`,height:`3`,rx:`1.5`}),(0,R.jsx)(`rect`,{x:`25`,y:`33.5`,width:`9`,height:`3`,rx:`1.5`})]})]}),fungi:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ellipse`,{fill:mE,cx:`33.5`,cy:`43.6`,rx:`18.6`,ry:`14.4`,transform:`rotate(-6 33.5 43.6)`}),(0,R.jsx)(`path`,{fill:lE,d:`M29.5 6.5C22 7.5 16 11 11 18.5 4 29 4.6 39.6 13.5 42.2 24 45 44 40.5 54 34.6 57.6 32.6 58.6 29.2 57.5 25 56.5 20 53 16 48.5 13 43.5 8 37 5.5 29.5 6.5Z`}),(0,R.jsxs)(`g`,{fill:mE,children:[(0,R.jsx)(`ellipse`,{cx:`29`,cy:`15.7`,rx:`8.7`,ry:`6.3`,transform:`rotate(-15.5 29 15.7)`}),(0,R.jsx)(`ellipse`,{cx:`50.8`,cy:`20.1`,rx:`6.5`,ry:`3.5`,transform:`rotate(51.6 50.8 20.1)`}),(0,R.jsx)(`ellipse`,{cx:`13`,cy:`26.8`,rx:`4.2`,ry:`3.3`,transform:`rotate(-54.5 13 26.8)`})]}),(0,R.jsxs)(`g`,{fill:hE,transform:`translate(26.6 46.6) scale(1.1) translate(-33.7 -38.5)`,children:[(0,R.jsx)(`rect`,{x:`31.85`,y:`35.9`,width:`3.75`,height:`5.25`,rx:`1.85`}),(0,R.jsx)(`path`,{d:`M 47.4 34.3 C 46 35 44.6 35.8 43.5 36.7 42.9 37.2 43.2 38.3 44 38.4 45.2 38.6 46.5 38.6 47.7 38.4 48.4 38.3 48.3 37.3 47.6 37.3 46.6 37.4 45.7 37.4 45 37.3 45.9 36.7 46.9 36.1 48 35.6 48.7 35.3 48.2 34 47.4 34.3 Z`}),(0,R.jsx)(`path`,{d:`M 37.4 41.1 C 38.6 44.3 42.6 44.3 43.6 40.5 43.7 40 43.1 39.8 42.9 40.3 41.9 42.8 39.1 42.9 38.3 40.7 38.1 40.2 37.3 40.5 37.4 41.1 Z`})]})]})};function gE({name:e,size:t}){return(0,R.jsx)(`svg`,{viewBox:`0 0 64 64`,width:t,height:t,fill:`none`,stroke:`none`,"aria-hidden":`true`,focusable:`false`,"data-sigil":e,children:vpe[e]})}var ype=[{id:`list`,label:`List files`,contract:fue},{id:`read`,label:`Read files`,contract:xue},{id:`write`,label:`Write files`,contract:Sue},{id:`run`,label:`Run commands`,contract:wS}],bpe={loading:`Loading`,unavailable:`Unavailable`,error:`Refresh failed`};function xpe({app:e,terminal:t=null,processes:n,ports:r}){let[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),c=async()=>{if(e){a(!0),s(!1);try{await e.ui.requestAppPermissions({})}catch{s(!0)}finally{a(!1)}}};return{id:`access`,label:`Access`,title:`Computer access`,content:(0,R.jsxs)(`div`,{className:`shed-instrument`,children:[(0,R.jsxs)(eE,{size:`sm`,children:[(0,R.jsx)(ipe,{icon:(0,R.jsx)(gE,{name:`computer`}),title:t?.name??`Selected Computer`,status:t?(0,R.jsx)(QT,{size:`compact`,label:`Terminal ${t.state}`,tone:t.state===`open`?`success`:t.state===`failed`?`error`:`neutral`}):null}),(0,R.jsxs)(ape,{children:[(0,R.jsx)(tE,{legend:`Shed may`,wide:!0,children:(0,R.jsx)(tpe,{"aria-label":`Shed may`,stateLabels:[`allowed`,`not allowed`],items:ype.map(({id:t,label:n,contract:r})=>({id:t,label:n,caption:t,icon:(0,R.jsx)(gE,{name:t}),on:e?.capabilities.has(r)===!0}))})}),(0,R.jsx)(_E,{label:`Processes`,value:n}),(0,R.jsx)(_E,{label:`Ports open`,value:r})]})]}),e?(0,R.jsx)(`div`,{className:`shed-instrument-keys`,children:(0,R.jsx)(zT,{size:`sm`,variant:`ghost`,disabled:i,onClick:()=>void c(),children:i?`Opening permissions…`:`App permissions…`})}):null,o?(0,R.jsx)(`p`,{role:`alert`,className:`shed-instrument-detail`,children:`Could not open App permissions. Try again.`}):null]})}}function _E({label:e,value:t}){return(0,R.jsx)(tE,{legend:e,role:`group`,"aria-label":e,children:t.kind===`loaded`?(0,R.jsx)(qfe,{value:t.count,pad:2,size:`md`}):(0,R.jsx)(`span`,{className:`shed-instrument-note`,children:bpe[t.kind]})})}var Spe={2:`h2`,3:`h3`,4:`h4`};function Cpe(e,t){let{reduced:n}=t,r=e&&!n,i=pC(t,600),[a,o]=(0,F.useState)(r);return(0,F.useEffect)(()=>{if(o(r),!r)return;let e=globalThis.setTimeout(()=>{o(!1)},i);return()=>{globalThis.clearTimeout(e)}},[r,i]),a}var wpe=(0,R.jsx)(LT,{decorative:!0,pace:`idle`,size:`md`,tone:`primary`,variant:`wander`}),vE=(0,F.forwardRef)(function({actions:e,className:t,description:n,headingLevel:r=2,primaryAction:i,suggestions:a,thinking:o=!1,title:s,visual:c,renderVisual:l,variant:u=`plain`,...d},f){let p=(0,F.useId)(),m=(0,F.useRef)(null),h=fC(m),g=Cpe(u===`speech`,h)&&!o,_=Spe[r],v=c??(u===`panel`?`blobs`:void 0),y=l?l({speaking:g,thinking:o}):v===`blobs`?wpe:v,b=`${p}-reason`,x=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(_,{ref:m,className:`empty-state-title`,id:d[`aria-labelledby`]?void 0:p,children:s}),(0,R.jsx)(`p`,{children:n}),i?(0,R.jsxs)(`div`,{className:`empty-state-primary`,children:[(0,R.jsx)(zT,{"aria-describedby":i.disabled&&i.disabledReason?b:void 0,disabled:i.disabled,loading:i.pending===!0,onClick:i.onSelect,variant:`primary`,children:i.label}),i.disabled&&i.disabledReason?(0,R.jsx)(`span`,{className:`empty-state-reason`,id:b,children:i.disabledReason}):null]}):null,a&&a.length>0?(0,R.jsx)(`ul`,{"aria-label":`Try one of these`,className:`empty-state-suggestions`,children:a.map((e,t)=>(0,R.jsx)(`li`,{children:(0,R.jsx)(zT,{disabled:e.disabled,loading:e.pending===!0,size:`sm`,variant:`outline`,onClick:e.onSelect,children:e.label})},`${String(t)}:${e.label}`))}):null,e?(0,R.jsx)(`div`,{className:`empty-state-actions`,children:e}):null]});return(0,R.jsxs)(`section`,{...d,"aria-labelledby":d[`aria-labelledby`]??p,className:cC(`empty-state`,u!==`plain`&&`empty-state-${u}`,t),ref:f,children:[y?(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`empty-state-visual`,children:y}):null,u===`speech`?(0,R.jsx)(`div`,{className:`empty-state-bubble`,children:x}):x]})}),Tpe=(0,F.forwardRef)(function({className:e,orientation:t,variant:n=`grip`,value:r,min:i,max:a,onValueChange:o,onKeyDown:s,...c},l){return(0,R.jsx)(`div`,{...c,ref:l,className:cC(`caps-resize-handle`,e),"data-resize-variant":n,role:`separator`,"aria-orientation":t,"aria-valuemin":Math.round(i),"aria-valuemax":Math.round(a),"aria-valuenow":Math.round(r),tabIndex:c.tabIndex??0,onKeyDown:e=>{if(s?.(e),e.defaultPrevented)return;if(e.key===`Home`||e.key===`End`){e.preventDefault(),o(e.key===`Home`?i:a);return}let n=t===`horizontal`?e.key===`ArrowUp`?-32:e.key===`ArrowDown`?32:null:e.key===`ArrowLeft`?-32:e.key===`ArrowRight`?32:null;n!==null&&(e.preventDefault(),o(Math.min(a,Math.max(i,r+n))))},children:(0,R.jsx)(`span`,{className:`caps-resize-grip`,"aria-hidden":`true`})})});function yE(e){return`init`in e}function bE(e){return typeof e.write==`function`}function Epe(e){return!!e.onMount}function xE(e){return`v`in e||`e`in e}function SE(e){if(`e`in e)throw e.e;return e.v}function CE(e){return typeof e?.then==`function`}function wE(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function TE(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function EE(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function DE(e){return!!e.INTERNAL_onInit}var OE=(e,t,n,...r)=>n.read(...r),kE=(e,t,n,...r)=>n.write(...r),AE=(e,t,n)=>n.INTERNAL_onInit(t),jE=(e,t,n,r)=>n.onMount?.call(n,r),ME=(e,t,n)=>{var r;let i=e[0],a=i.get(n);if(!a){let o=e[6],s=e[9];a={d:new Map,p:new Set,n:0},i.set(n,a),(r=o.i)==null||r.call(o,n),DE(n)&&s(e,t,n)}return a},NE=(e,t)=>{let n=e[1],r=e[3],i=e[4],a=e[5],o=e[6],s=e[13];if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},PE=(e,t)=>{let n=e[1],r=e[2],i=e[3],a=e[11],o=e[14],s=e[17];if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o)){f.pop(),p.pop();continue}if(u.has(o)){r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();continue}u.add(o);for(let r of EE(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},FE=(e,t,n)=>{var r,i;let a=e[1],o=e[2],s=e[3],c=e[6],l=e[7],u=e[11],d=e[12],f=e[13],p=e[14],m=e[16],h=e[17],g=e[20],_=e[26],v=e[28],y=u(e,t,n),b=v[0];if(xE(y)){if(a.has(n)&&o.get(n)!==y.n||y.m===b)return y.m=b,y;let r=!1;for(let[n,i]of y.d)if(p(e,t,n).n!==i){r=!0;break}if(!r)return y.m=b,y}let x=!0,S=new Set(y.d.keys()),C=()=>{for(let e of S)y.d.delete(e)},w=()=>{if(a.has(n)){let r=!s.size;h(e,t,n),r&&(f(e,t),d(e,t))}},T=r=>{var i;if(r===n){let n=u(e,t,r);if(!xE(n)){if(yE(r))g(e,t,r,r.init);else throw Error(`no atom init`)}return SE(n)}let o=p(e,t,r);try{return SE(o)}finally{S.delete(r),y.d.set(r,o.n),CE(y.v)&&TE(n,y.v,o),a.has(n)&&((i=a.get(r))==null||i.t.add(n)),x||w()}},E,D,O={get signal(){return E||=new AbortController,E.signal},get setSelf(){return!D&&bE(n)&&(D=(...r)=>{if(!x)try{return m(e,t,n,r)}finally{f(e,t),d(e,t)}}),D}},k=y.n,A=o.get(n)===k;try{let i=l(e,t,n,T,O);if(g(e,t,n,i),CE(i)){_(e,t,i,()=>E?.abort());let n=()=>{C(),w()};i.then(n,n)}else C();return(r=c.r)==null||r.call(c,n),y.m=b,y}catch(e){if(wE(e))throw e;return delete y.v,y.e=e,++y.n,y.m=b,y}finally{x=!1,y.n!==k&&A&&(o.set(n,y.n),s.add(n),(i=c.c)==null||i.call(c,n))}},IE=(e,t,n)=>{let r=e[1],i=e[2],a=e[11],o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of EE(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},LE=(e,t,n,r)=>{let i=e[3],a=e[6],o=e[8],s=e[11],c=e[12],l=e[13],u=e[14],d=e[15],f=e[16],p=e[17],m=e[20],h=e[28],g=!0,_=n=>SE(u(e,t,n)),v=(r,...o)=>{var u;let _=s(e,t,r);try{if(r===n){if(!yE(r))throw Error(`atom not writable`);let n=_.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==_.n&&(++h[0],i.add(r),d(e,t,r),(u=a.c)==null||u.call(a,r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},RE=(e,t,n)=>{var r;let i=e[1],a=e[3],o=e[6],s=e[11],c=e[15],l=e[18],u=e[19],d=s(e,t,n),f=i.get(n);if(f&&d.d.size>0){for(let[i,u]of d.d)if(!f.d.has(i)){let d=s(e,t,i);l(e,t,i).t.add(n),f.d.add(i),u!==d.n&&(a.add(i),c(e,t,i),(r=o.c)==null||r.call(o,i))}for(let r of f.d)d.d.has(r)||(f.d.delete(r),u(e,t,r)?.t.delete(n))}},zE=(e,t,n)=>{var r;let i=e[1],a=e[4],o=e[6],s=e[10],c=e[11],l=e[12],u=e[13],d=e[14],f=e[16],p=e[18],m=c(e,t,n),h=i.get(n);if(!h){d(e,t,n);for(let r of m.d.keys())p(e,t,r).t.add(n);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(n,h),bE(n)&&Epe(n)&&a.add(()=>{let r=!0,i=(...i)=>{try{return f(e,t,n,i)}finally{r||(u(e,t),l(e,t))}};try{let a=s(e,t,n,i);a&&(h.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),(r=o.m)==null||r.call(o,n)}return h},BE=(e,t,n)=>{var r;let i=e[1],a=e[5],o=e[6],s=e[11],c=e[19],l=s(e,t,n),u=i.get(n);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(n)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(n);for(let r of l.d.keys())c(e,t,r)?.t.delete(n);(r=o.u)==null||r.call(o,n);return}return u},VE=(e,t,n,r)=>{let i=e[11],a=e[27],o=i(e,t,n),s=`v`in o,c=o.v;if(CE(r))for(let a of o.d.keys())TE(n,r,i(e,t,a));o.v=r,delete o.e,(!s||!Object.is(c,o.v))&&(++o.n,CE(c)&&a(e,t,c))},HE=(e,t,n)=>{let r=e[14];return SE(r(e,t,n))},UE=(e,t,n,...r)=>{let i=e[3],a=e[12],o=e[13],s=e[16],c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},WE=(e,t,n,r)=>{let i=e[12],a=e[13],o=e[18],s=e[19],c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},GE=(e,t,n,r)=>{let i=e[25],a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},KE=(e,t,n)=>{e[25].get(n)?.forEach(e=>e())},qE=new WeakMap;function JE(...e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},OE,kE,AE,jE,ME,NE,PE,FE,IE,LE,RE,zE,BE,VE,HE,UE,WE,void 0,new WeakMap,GE,KE,[0]].map((t,n)=>e[n]||t);qE.set(t,Object.freeze(n));let r=n[21],i=n[22],a=n[23];return t}var YE=0;function XE(e,t){let n=`atom${++YE}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=ZE,r.write=QE),t&&(r.write=t),r}function ZE(e){return e(this)}function QE(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}function $E(){return JE()}var eD=XE({frames:new Map,order:[],tiles:[],minima:new Map,participating:new Set,mainSize:void 0,zoomed:null,gesture:null,restore:new Map}),tD=(e,t,n)=>Math.min(Math.max(e,t),n),nD=(e,t,n)=>{let r=tD(e.width,n.width,Math.max(n.width,t.width)),i=tD(e.height,n.height,Math.max(n.height,t.height));return{width:r,height:i,x:tD(e.x,0,Math.max(0,t.width-r)),y:tD(e.y,0,Math.max(0,t.height-i))}},rD=(e,t,n)=>{let r=t.width/2,i=t.height/2;return nD(e===`left`?{x:0,y:0,width:r,height:t.height}:e===`right`?{x:r,y:0,width:r,height:t.height}:e===`top-left`?{x:0,y:0,width:r,height:i}:e===`top-right`?{x:r,y:0,width:r,height:i}:e===`bottom-left`?{x:0,y:i,width:r,height:i}:{x:r,y:i,width:r,height:i},t,n)},iD=()=>{let e=$E(),t=()=>e.get(eD),n=0,r=r=>{n+=1,e.set(eD,r(t()))},i=(e,t,n)=>{r(r=>{let i=new Map(r.frames);return i.set(e,t),{...r,frames:i,participating:new Set(r.participating).add(e),tiles:r.tiles.includes(e)?r.tiles:[...r.tiles,e],minima:new Map(r.minima).set(e,n),order:r.order.includes(e)?r.order:[...r.order.filter(e=>e!==r.zoomed),e,...r.zoomed?[r.zoomed]:[]]}})},a=e=>t().frames.has(e),o=(e,n)=>{let r=t().gesture;return r?.kind===`frame`&&r.id===e&&r.pointerId===n};return{get version(){return n},get frames(){return t().frames},get order(){return t().order},get tiles(){return t().tiles},get minima(){return t().minima},get participating(){return t().participating},get mainSize(){return t().mainSize},get zoomed(){return t().zoomed},get gesture(){return t().gesture},get restore(){return t().restore},subscribe:t=>e.sub(eD,t),register:i,setParticipation:(e,n)=>{t().frames.has(e)&&r(t=>{if(t.participating.has(e)===n)return t;let r=new Set(t.participating);n?r.add(e):r.delete(e);let i=n?t.tiles.includes(e)?t.tiles:[...t.tiles,e]:t.tiles.filter(t=>t!==e),a=n?t.order.includes(e)?t.order:[...t.order,e]:t.order.filter(t=>t!==e);return{...t,participating:r,tiles:i,order:a,zoomed:n||t.zoomed!==e?t.zoomed:null,gesture:!n&&t.gesture?.kind===`frame`&&t.gesture.id===e?null:t.gesture}})},setMinima:(e,n)=>{let i=t().minima.get(e);!i||i.width===n.width&&i.height===n.height||r(t=>({...t,minima:new Map(t.minima).set(e,n)}))},unregister:e=>{r(t=>{if(!t.frames.has(e))return t;let n=new Map(t.frames);n.delete(e);let r=new Map(t.restore);r.delete(e);let i=t.order.filter(t=>t!==e),a=t.tiles.filter(t=>t!==e),o=new Map(t.minima);o.delete(e);let s=new Set(t.participating);s.delete(e);let c=t.gesture?.kind===`frame`&&t.gesture.id===e?null:t.gesture;return{...t,frames:n,restore:r,order:i,tiles:a,minima:o,participating:s,gesture:c,zoomed:t.zoomed===e?null:t.zoomed}})},begin:(e,n)=>{!a(e)||!t().participating.has(e)||r(t=>({...t,gesture:{kind:`frame`,id:e,pointerId:n,start:t.frames.get(e)??{x:0,y:0,width:0,height:0}},order:[...t.order.filter(t=>t!==e),e]}))},move:(e,n,i,s,c,l=null)=>{a(e)&&t().participating.has(e)&&o(e,n)&&r(t=>({...t,frames:new Map(t.frames).set(e,nD(i,s,c)),gesture:t.gesture?.kind===`frame`?{...t.gesture,snap:l?{side:l,frame:rD(l,s,c)}:null}:t.gesture}))},end:(e,t)=>{o(e,t)&&r(t=>{let n=t.gesture;return n?.kind!==`frame`||!n.snap?{...t,gesture:null}:{...t,frames:new Map(t.frames).set(e,n.snap.frame),restore:new Map(t.restore).set(e,t.restore.get(e)??n.start),gesture:null}})},cancel:(e,n)=>{let i=t().gesture;i?.kind===`frame`&&i.id===e&&i.pointerId===n&&r(t=>{let n=new Map(t.frames);return n.set(e,i.start),{...t,frames:n,gesture:null}})},snap:(e,n,i,o)=>{!a(e)||!t().participating.has(e)||r(t=>{let r=new Map(t.restore);r.set(e,t.frames.get(e)??rD(n,i,o));let a=new Map(t.frames);return a.set(e,rD(n,i,o)),{...t,frames:a,restore:r,order:[...t.order.filter(t=>t!==e),e]}})},restoreFrame:(e,n,i)=>{!a(e)||!t().participating.has(e)||r(t=>{let r=t.restore.get(e);if(!r)return t;let a=new Map(t.frames);a.set(e,nD(r,n,i));let o=new Map(t.restore);return o.delete(e),{...t,frames:a,restore:o}})},focus:e=>{a(e)&&r(t=>({...t,order:[...t.order.filter(t=>t!==e),e],zoomed:t.zoomed===null?null:e}))},swap:(e,n)=>{!a(e)||!a(n)||!t().participating.has(e)||!t().participating.has(n)||r(t=>({...t,tiles:t.tiles.map(t=>t===e?n:t===n?e:t)}))},zoom:e=>{e!==null&&(!a(e)||!t().participating.has(e))||r(t=>({...t,zoomed:e,order:e===null?t.order:[...t.order.filter(t=>t!==e),e]}))},resizeMain:e=>{r(t=>({...t,mainSize:e}))},beginDivider:e=>!t().gesture&&(r(t=>({...t,gesture:{kind:`divider`,pointerId:e,start:t.mainSize}})),!0),finishDivider:(e,n)=>{let i=t().gesture;i?.kind===`divider`&&i.pointerId===e&&r(e=>({...e,gesture:null,mainSize:n?i.start:e.mainSize}))},destroy:()=>{r(e=>({...e,gesture:null,restore:new Map}))}}};function aD(e,t,n,r,i){let a=i.layout??`main-left`;if(a===`columns`||a===`rows`||a===`grid`)return oD(e,t,n,r,i,a);if(a===`main-top`){let a=sD(e,new Map([...t].map(([e,t])=>[e,{width:t.height,height:t.width}])),n,{width:r.height,height:r.width},i);return{frames:new Map([...a.frames].map(([e,t])=>[e,{x:t.y,y:t.x,width:t.height,height:t.width}])),tabGroups:a.tabGroups,divider:a.divider&&{...a.divider,axis:`y`}}}return sD(e,t,n,r,i)}function oD(e,t,n,r,i,a){let o=new Map,s=[];if(!e.length)return{frames:o,tabGroups:s,divider:null};let c=Math.max(0,i.gap??8),l=e.reduce((e,n)=>({width:Math.max(e.width,t.get(n)?.width??0),height:Math.max(e.height,t.get(n)?.height??0)}),{width:0,height:0}),u=(t,n)=>n+c===0?e.length:Math.min(e.length,Math.max(1,Math.floor((t+c)/(n+c)))),d=u(r.width,l.width),f=u(r.height,l.height),p=l.width>r.width||l.height>r.height?1:a===`columns`?d:a===`rows`?f:Math.min(e.length,d*f),m=a===`columns`?p:a===`rows`?1:Math.min(d,Math.max(Math.ceil(Math.sqrt(p)),Math.ceil(p/f))),h=Math.ceil(p/m),g=(r.width-c*(m-1))/m,_=(r.height-c*(h-1))/h;for(let t=0;t<p;t++){let r=e.slice(t,t===p-1?void 0:t+1),i=r.length===1?r[0]:[...n].reverse().find(e=>r.includes(e))??r[0];i&&o.set(i,{x:t%m*(g+c),y:Math.floor(t/m)*(_+c),width:g,height:_}),r.length>1&&s.push(r)}return{frames:o,tabGroups:s,divider:null}}function sD(e,t,n,r,i){let a=new Map,o=[],s={x:0,y:0,...r},[c,...l]=e,u=(e,t)=>{let r=[...n].reverse().find(t=>e.includes(t))??e[0];r&&a.set(r,t),e.length>1&&o.push(e)};if(!c)return{frames:a,tabGroups:o,divider:null};if(!l.length)return a.set(c,s),{frames:a,tabGroups:o,divider:null};let d=Math.max(0,i.gap??8),f=t.get(c)?.width??0,p=Math.max(...l.map(e=>t.get(e)?.width??0)),m=r.width-d-p;if(f>m)return u([...e],s),{frames:a,tabGroups:o,divider:null};let h=Math.min(m,Math.max(f,i.mainSize??r.width/2)),g={axis:`x`,position:h,min:f,max:m};a.set(c,{...s,width:h});let _={...s,x:h+d,width:r.width-h-d},v=l.map(e=>t.get(e)?.height??0).reduce((e,t)=>e+t,0)+d*(l.length-1);if(v>r.height)u(l,_);else{let e=(r.height-v)/l.length,n=0;for(let r of l){let i=(t.get(r)?.height??0)+e;a.set(r,{..._,y:n,height:i}),n+=i+d}}return{frames:a,tabGroups:o,divider:g}}function cD(e,t=!0,n){let r=(0,F.useRef)(e);r.current=e;let i=(0,F.useRef)(null);return(0,F.useEffect)(()=>(t||i.current?.release(!0),()=>i.current?.release(!0)),[t]),(0,F.useEffect)(()=>{let e=()=>{i.current?.release(!0)};return n?.addEventListener(`abort`,e),()=>{n?.removeEventListener(`abort`,e)}},[n]),{onPointerDown:e=>{if(!t||n?.aborted||i.current||e.pointerType===`mouse`&&e.button!==0)return;let{currentTarget:a,pointerId:o}=e;if(a.setPointerCapture(o),!r.current.begin(e)){a.releasePointerCapture(o);return}let s=r.current.end,c=()=>{l(!0)},l=e=>{a.removeEventListener(`lostpointercapture`,c),i.current=null,s(e),a.hasPointerCapture(o)&&a.releasePointerCapture(o)};i.current={id:o,element:a,x:e.clientX,y:e.clientY,release:l},a.addEventListener(`lostpointercapture`,c)},onPointerMove:e=>{let t=i.current;t?.id===e.pointerId&&(r.current.move(e.clientX-t.x,e.clientY-t.y,e),t.x=e.clientX,t.y=e.clientY)},onPointerUp:e=>{i.current?.id===e.pointerId&&i.current.release(!1)},onPointerCancel:e=>{i.current?.id===e.pointerId&&i.current.release(!0)}}}function lD(e,t){return e.x<20?e.y<20?`top-left`:e.y>t.height-20?`bottom-left`:`left`:e.x>t.width-20?e.y<20?`top-right`:e.y>t.height-20?`bottom-right`:`right`:null}var uD=(0,F.createContext)(null);function dD({bounds:e,tiling:t,containerRef:n,children:r}){let i=(0,F.useMemo)(iD,[]);(0,F.useSyncExternalStore)(i.subscribe,()=>i.version,()=>i.version),(0,F.useEffect)(()=>()=>{i.destroy()},[i]);let a={...t};i.mainSize!==void 0&&(a.mainSize=i.mainSize);let o=t?aD(i.tiles,i.minima,i.order,e,a):{frames:new Map([...i.frames].filter(([e])=>i.participating.has(e)).map(([t,n])=>[t,nD(n,e,i.minima.get(t)??{width:0,height:0})])),tabGroups:[],divider:null};return i.zoomed&&i.participating.has(i.zoomed)&&(o.frames=new Map([[i.zoomed,{x:0,y:0,...e}]]),o.divider=null,o.tabGroups=[]),(0,R.jsx)(uD.Provider,{value:{state:i,bounds:e,tiled:t!==void 0,arrangement:o,containerRef:n},children:r})}function fD(){let e=(0,F.useContext)(uD);if(!e)throw Error(`Maosaico hooks must be used within MaosaicoRoot`);return e}function pD(){let{state:e,arrangement:t,tiled:n,bounds:r}=fD(),i=e.tiles,a=(0,F.useRef)({pointer:0,position:0}),o=t.divider,s=cD({begin:t=>!o||!e.beginDivider(t.pointerId)?!1:(a.current={pointer:t.pointerId,position:o.position},!0),move:(t,n)=>{o&&(a.current.position=Math.min(o.max,Math.max(o.min,a.current.position+(o.axis===`x`?t:n))),e.resizeMain(a.current.position))},end:t=>{e.finishDivider(a.current.pointer,t)}},o!==null);return{bounds:r,stackingStyle:{zIndex:e.order.length},mode:n?`tiled`:`floating`,order:i,interacting:e.gesture!==null,snapPreview:!n&&!e.zoomed&&e.gesture?.kind===`frame`?e.gesture.snap??null:null,activeId:e.order.at(-1)??null,zoomedId:e.zoomed,tabGroups:t.tabGroups,divider:o&&{...o,props:s},focus:e.focus,swap:e.swap,zoom:e.zoom,resizeMain:t=>{o&&e.resizeMain(Math.min(o.max,Math.max(o.min,t)))}}}function mD(e,t={}){let{state:n,bounds:r,tiled:i,arrangement:a,containerRef:o}=fD();(0,F.useLayoutEffect)(()=>(n.register(e.id,e.frame,e.minima),()=>{n.unregister(e.id)}),[n,e.id]),(0,F.useEffect)(()=>{n.setMinima(e.id,e.minima)},[n,e.id,e.minima.width,e.minima.height]);let s=t.participating??!0;(0,F.useLayoutEffect)(()=>{n.setParticipation(e.id,s)},[n,e.id,s]);let c=(0,F.useRef)(0),l=cD({begin:t=>!n.frames.has(e.id)||n.gesture?!1:(c.current=t.pointerId,n.begin(e.id,t.pointerId),!0),move:(i,a,s)=>{let l=o?.current?.getBoundingClientRect(),u=l&&t.kind!==`resize`?lD({x:s.clientX-l.left,y:s.clientY-l.top},r):null,d=nD(n.frames.get(e.id)??e.frame,r,e.minima);n.move(e.id,c.current,t.kind===`resize`?{...d,width:d.width+i,height:d.height+a}:{...d,x:d.x+i,y:d.y+a},r,e.minima,u)},end:t=>{t?n.cancel(e.id,c.current):n.end(e.id,c.current)}},s&&!i&&!n.zoomed);return{frame:a.frames.get(e.id)??n.frames.get(e.id)??e.frame,stackingStyle:{zIndex:Math.max(0,n.order.indexOf(e.id))},visible:a.frames.has(e.id),active:s&&n.order.at(-1)===e.id,props:l,focus:()=>{s&&n.focus(e.id)},snap:t=>{s&&!i&&n.snap(e.id,t,r,e.minima)},restore:()=>{s&&!i&&n.restoreFrame(e.id,r,e.minima)}}}var hD=(0,F.createContext)(null);(0,F.forwardRef)(function({layer:e,style:t,children:n,...r},i){let a=(0,F.useContext)(hD),o=a?.update,s=a?.roots.get(`dialog`),[c,l]=(0,F.useState)(!1);(0,F.useEffect)(()=>{if(!s)return;let e=()=>{l(Array.from(s.querySelectorAll(`*`)).some(e=>{let t=e.getBoundingClientRect();return t.width>0&&t.height>0}))};e();let t=new MutationObserver(e);return t.observe(s,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[s]);let u=(0,F.useRef)(null);(0,F.useImperativeHandle)(i,()=>u.current);let d=(0,F.useCallback)(t=>{u.current=t,o?.(e,t)},[o,e]);return(0,F.createElement)(`div`,{...r,ref:d,onFocusCapture:t=>{e===`windows`&&t.target instanceof Node&&t.currentTarget.contains(t.target)&&a?.dismiss?.(),r.onFocusCapture?.(t)},"data-maosaico-layer":e,inert:e===`windows`&&c?``:void 0,style:{position:`relative`,...t,isolation:`isolate`,zIndex:`var(--stipe-layer-${e})`}},n)});var Dpe=cg(xS.fields.id);function Ope(e,t){let n=f_(),r=e?.context.get().computerId!=null&&e.capabilities.has(SS),i=Zx.of(e,`processes`),a=Q_({...Qx(e,SS,i,e=>e.list()),enabled:r,refetchInterval:t?1e4:!1}),o=r?e.capabilities.require(SS):null,s=tv({mutationKey:i,mutationFn:e=>{if(!o)throw new n_(`Processes are not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});return o.kill(e)},onSettled:()=>n.invalidateQueries({queryKey:i,exact:!0})}),c=(0,F.useRef)(null),l=tv({mutationKey:Zx.of(e,`process-start`),mutationFn:e=>{if(!o)throw new n_(`Processes are not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});return o.start(e)},onSettled:()=>Promise.all([n.invalidateQueries({queryKey:i,exact:!0}),n.invalidateQueries({queryKey:Zx.of(e,`ports`),exact:!0})])});async function u(e){let t=JSON.stringify(e),n=c.current?.input===t?c.current:{input:t,requestId:Yce()};c.current=n;try{return await l.mutateAsync({...e,requestId:n.requestId}),c.current===n&&(c.current=null),!0}catch(e){return console.error(`Shed process start failed`,vp(e)),!1}}let d=ev({filters:{mutationKey:i,exact:!0},select:({state:e})=>({id:Bu(Dpe(e.variables)),status:e.status})}),f=new Map;for(let{id:e,status:t}of d)e!==null&&(t===`pending`?f.set(e,`stopping`):t===`error`?f.set(e,`failed`):f.delete(e));return{query:a,stop:s,actions:f,enabled:r,startCommand:u}}var kpe=cg(L({port:yS.fields.port,expose:bg}));function Ape(e,t){let n=f_(),r=e?.context.get().computerId!=null&&e.capabilities.has(bS),i=Zx.of(e,`ports`),a=Q_({...Qx(e,bS,i,()=>{if(!e)throw new n_(`No App connection`,{code:`DISCONNECTED`,retryable:!0});return hue(e.capabilities)}),enabled:r,refetchInterval:e=>t&&!(e.state.data&&`error`in e.state.data)?1e4:!1}),o=r?e.capabilities.require(bS):null,s=tv({mutationKey:i,mutationFn:async({port:e,expose:t})=>{if(!o)throw new n_(`Ports are not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});t?await o.expose(e):await o.unexpose(e)},onSettled:()=>n.invalidateQueries({queryKey:i,exact:!0})}),c=ev({filters:{mutationKey:i,exact:!0},select:({state:e})=>({change:Bu(kpe(e.variables)),status:e.status})}),l=new Map;for(let{change:e,status:t}of c)e&&(t===`pending`||t===`error`?l.set(e.port,{expose:e.expose,status:t===`pending`?`pending`:`failed`}):l.delete(e.port));return{query:a,enabled:r,status:r?a.isPending?`loading`:a.isError?`error`:`error`in a.data?`not-configured`:a.isFetching?`loading`:`loaded`:`unavailable`,actions:l,ports:r&&a.data&&`ports`in a.data?a.data.ports:null,change:async(e,t)=>{try{return await s.mutateAsync({port:e,expose:t}),!0}catch{return!1}}}}var gD=(0,F.createContext)(null);function _D(){let e=(0,F.useContext)(gD);if(!e)throw Error(`Shed data requires a workspace provider`);return e}var jpe={neutral:`alert-neutral`,primary:`alert-primary`,secondary:`alert-secondary`,accent:`alert-accent`,success:`alert-success`,info:`alert-info`,warning:`alert-warning`,error:`alert-error`},vD=(0,F.forwardRef)(function({action:e,children:t,className:n,description:r,title:i,tone:a=`neutral`,...o},s){return(0,R.jsxs)(`div`,{...o,className:cC(`alert caps-alert`,jpe[a],n),"data-tone":a,role:o.role??`alert`,ref:s,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i?(0,R.jsx)(`h3`,{className:`font-semibold`,children:i}):null,r?(0,R.jsx)(`p`,{className:`text-sm`,children:r}):null,t]}),e?(0,R.jsx)(`div`,{className:`shrink-0`,children:e}):null]})});function Mpe({available:e,cause:t,className:n,fix:r,need:i,secondary:a,variant:o,visual:s,waitingFor:c=`setup`,...l}){let u=r.pending===!0,d=u?`Waiting for ${c}…`:r.label,f=e?(0,R.jsxs)(R.Fragment,{children:[t,` `,(0,R.jsx)(`span`,{className:`caps-setup-notice-available`,children:e})]}):t;return o===`panel`?(0,R.jsx)(vE,{...l,actions:a?(0,R.jsx)(zT,{size:`sm`,variant:`ghost`,onClick:a.onSelect,children:a.label}):void 0,className:cC(`caps-setup-notice`,n),"data-variant":`panel`,description:f,primaryAction:{label:d,onSelect:r.onSelect,pending:u},title:i,variant:`panel`,visual:s??(0,R.jsx)(QT,{className:`caps-setup-notice-dot`,glyph:`dot`,tone:`warning`})}):(0,R.jsx)(`div`,{className:`caps-setup-notice-frame`,children:(0,R.jsx)(vD,{...l,action:(0,R.jsxs)(`span`,{className:`caps-setup-notice-actions`,children:[a?(0,R.jsx)(zT,{size:`sm`,variant:`ghost`,onClick:a.onSelect,children:a.label}):null,(0,R.jsx)(zT,{loading:u,size:`sm`,variant:`outline`,onClick:r.onSelect,children:d})]}),className:cC(`caps-setup-notice`,n),"data-variant":o,description:f,role:`status`,title:(0,R.jsxs)(`span`,{className:`caps-setup-notice-title`,children:[(0,R.jsx)(QT,{glyph:`dot`,tone:`warning`}),i]}),tone:`warning`})})}function yD(e,t){console.error(JSON.stringify({source:`shed`,operation:e,failureKind:t instanceof Error?t.name:`NonErrorThrown`}),vp(t))}var bD=o((e=>{(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function n(e){return i(o(e),arguments)}function r(e,t){return n.apply(null,[e].concat(t||[]))}function i(e,r){var i=1,a=e.length,o,s=``,c,l,u,d,f,p,m,h;for(c=0;c<a;c++)if(typeof e[c]==`string`)s+=e[c];else if(typeof e[c]==`object`){if(u=e[c],u.keys)for(o=r[i],l=0;l<u.keys.length;l++){if(o==null)throw Error(n(`[sprintf] Cannot access property "%s" of undefined value "%s"`,u.keys[l],u.keys[l-1]));o=o[u.keys[l]]}else o=u.param_no?r[u.param_no]:r[i++];if(t.not_type.test(u.type)&&t.not_primitive.test(u.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(u.type)&&typeof o!=`number`&&isNaN(o))throw TypeError(n(`[sprintf] expecting number but found %T`,o));switch(t.number.test(u.type)&&(m=o>=0),u.type){case`b`:o=parseInt(o,10).toString(2);break;case`c`:o=String.fromCharCode(parseInt(o,10));break;case`d`:case`i`:o=parseInt(o,10);break;case`j`:o=JSON.stringify(o,null,u.width?parseInt(u.width):0);break;case`e`:o=u.precision?parseFloat(o).toExponential(u.precision):parseFloat(o).toExponential();break;case`f`:o=u.precision?parseFloat(o).toFixed(u.precision):parseFloat(o);break;case`g`:o=u.precision?String(Number(o.toPrecision(u.precision))):parseFloat(o);break;case`o`:o=(parseInt(o,10)>>>0).toString(8);break;case`s`:o=String(o),o=u.precision?o.substring(0,u.precision):o;break;case`t`:o=String(!!o),o=u.precision?o.substring(0,u.precision):o;break;case`T`:o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=u.precision?o.substring(0,u.precision):o;break;case`u`:o=parseInt(o,10)>>>0;break;case`v`:o=o.valueOf(),o=u.precision?o.substring(0,u.precision):o;break;case`x`:o=(parseInt(o,10)>>>0).toString(16);break;case`X`:o=(parseInt(o,10)>>>0).toString(16).toUpperCase()}t.json.test(u.type)?s+=o:(t.number.test(u.type)&&(!m||u.sign)?(h=m?`+`:`-`,o=o.toString().replace(t.sign,``)):h=``,f=u.pad_char?u.pad_char===`0`?`0`:u.pad_char.charAt(1):` `,p=u.width-(h+o).length,d=u.width&&p>0?f.repeat(p):``,s+=u.align?h+o+d:f===`0`?h+d+o:d+h+o)}return s}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var n=e,r,i=[],o=0;n;){if((r=t.text.exec(n))!==null)i.push(r[0]);else if((r=t.modulo.exec(n))!==null)i.push(`%`);else if((r=t.placeholder.exec(n))!==null){if(r[2]){o|=1;var s=[],c=r[2],l=[];if((l=t.key.exec(c))!==null)for(s.push(l[1]);(c=c.substring(l[0].length))!==``;)if((l=t.key_access.exec(c))!==null)s.push(l[1]);else if((l=t.index_access.exec(c))!==null)s.push(l[1]);else throw SyntaxError(`[sprintf] failed to parse named argument key`);else throw SyntaxError(`[sprintf] failed to parse named argument key`);r[2]=s}else o|=2;if(o===3)throw Error(`[sprintf] mixing positional and named placeholders is not (yet) supported`);i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}else throw SyntaxError(`[sprintf] unexpected placeholder`);n=n.substring(r[0].length)}return a[e]=i}e!==void 0&&(e.sprintf=n,e.vsprintf=r),typeof window<`u`&&(window.sprintf=n,window.vsprintf=r,typeof define==`function`&&define.amd&&define(function(){return{sprintf:n,vsprintf:r}}))})()}))(),xD=(e,t,n)=>{let r=e instanceof RegExp?SD(e,n):e,i=t instanceof RegExp?SD(t,n):t,a=r!==null&&i!=null&&Npe(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},SD=(e,t)=>{let n=t.match(e);return n?n[0]:null},Npe=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},CD=`\0SLASH`+Math.random()+`\0`,wD=`\0OPEN`+Math.random()+`\0`,TD=`\0CLOSE`+Math.random()+`\0`,ED=`\0COMMA`+Math.random()+`\0`,DD=`\0PERIOD`+Math.random()+`\0`,Ppe=new RegExp(CD,`g`),Fpe=new RegExp(wD,`g`),Ipe=new RegExp(TD,`g`),Lpe=new RegExp(ED,`g`),Rpe=new RegExp(DD,`g`),zpe=/\\\\/g,Bpe=/\\{/g,Vpe=/\\}/g,Hpe=/\\,/g,Upe=/\\\./g,Wpe=1e5,Gpe=4e6;function OD(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Kpe(e){return e.replace(zpe,CD).replace(Bpe,wD).replace(Vpe,TD).replace(Hpe,ED).replace(Upe,DD)}function qpe(e){return e.replace(Ppe,`\\`).replace(Fpe,`{`).replace(Ipe,`}`).replace(Lpe,`,`).replace(Rpe,`.`)}function kD(e){if(!e)return[``];let t=[],n=xD(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=kD(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function Jpe(e,t={}){if(!e)return[];let{max:n=Wpe,maxLength:r=Gpe}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),jD(Kpe(e),n,r,!0).map(qpe)}function Ype(e){return`{`+e+`}`}function Xpe(e){return/^-?0\d/.test(e)}function Zpe(e,t){return e<=t}function Qpe(e,t){return e>=t}function AD(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function $pe(e,t,n,r){let i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;let o=OD(i[0]),s=OD(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(OD(i[2])),1):1,u=Zpe;s<o&&(l*=-1,u=Qpe);let d=i.some(Xpe),f=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),d){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(f+n.length>r)break;a.push(n),f+=n.length}return a}function jD(e,t,n,r){let i=[``],a=!1,o=!0;for(;;){let s=xD(`{`,`}`,e);if(!s)return AD(i,e,[``],t,n,a);let c=s.pre;if(/\$$/.test(c)){if(i=AD(i,c+`{`+s.body+`}`,[``],t,n,a&&!s.post.length),o=!1,!s.post.length)break;e=s.post;continue}let l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=l||u,f=s.body.indexOf(`,`)>=0;if(!d&&!f){if(s.post.match(/,(?!,).*\}/)){e=s.pre+`{`+s.body+TD+s.post,r=!0;continue}return AD(i,c+`{`+s.body+`}`+s.post,[``],t,n,a)}o&&=(a=r&&!d,!1);let p;if(d)p=$pe(s.body,u,t,n);else{let r=kD(s.body);if(r.length===1&&r[0]!==void 0&&(r=jD(r[0],t,n,!1).map(Ype),r.length===1)){if(i=AD(i,c+r[0],[``],t,n,a&&!s.post.length),!s.post.length)break;e=s.post;continue}let o=a&&!s.post.length&&!c;for(let e=0;o&&e<i.length;e++)i[e]&&(o=!1);p=[];let l=0;outer:for(let e=0;e<r.length;e++){let i=jD(r[e],t,n,!1);for(let e=0;e<i.length;e++){let r=i[e];if(!(o&&!r)){if(p.length>=t||l+r.length>n)break outer;p.push(r),l+=r.length}}}}if(i=AD(i,c,p,t,n,a&&!s.post.length),!s.post.length)break;e=s.post}return i}var eme=65536,MD=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>eme)throw TypeError(`pattern is too long`)},tme={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},ND=e=>e.replace(/[[\]\\-]/g,`\\$&`),nme=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),PD=e=>e.join(``),rme=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(tme))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(ND(d)+`-`+ND(t)):t===d&&r.push(ND(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(ND(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(ND(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[nme(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+PD(r)+`]`,p=`[`+(l?``:`^`)+PD(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},FD=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`),ID,ime=new Set([`!`,`?`,`+`,`*`,`@`]),LD=e=>ime.has(e),RD=e=>LD(e.type),ame=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),ome=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),sme=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),zD=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),cme=`(?!(?:^|/)\\.\\.?(?:$|/))`,BD=`(?!\\.)`,lme=new Set([`[`,`.`]),ume=new Set([`..`,`.`]),dme=new Set(`().*{}+?[]^$\\!`),fme=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),pme=`[^/]`,mme=`[^/]*?`,VD=`[^/]+?`,hme=0,HD=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++hme;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.#l=this.type?this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof ID&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof ID&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new ID(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&LD(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new ID(n,t);u=ID.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new ID(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&LD(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new ID(n,d);d.push(o),u=ID.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new ID(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,ome)}#m(e,t=ame){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=sme){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new ID(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!zD.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=zD.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new ID(null,void 0,t);return ID.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!RD(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?ID.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&ume.has(this.#r[0]))){let n=lme,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?cme:o?BD:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,FD(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,FD(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?BD:``)+VD;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?BD:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,FD(i),this.#t=!!this.#t,this.#n]}#x(){if(RD(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(dme.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?VD:mme,t=!0;continue}if(o=!1,c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=rme(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=pme,t=!0;continue}i+=fme(c)}return[i,FD(e),!!t,a]}};ID=HD;var gme=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),UD=(e,t,n={})=>(MD(t),!n.nocomment&&t.charAt(0)===`#`?!1:new QD(t,n).match(e)),_me=/^\*+([^+@!?*[(]*)$/,vme=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),yme=e=>t=>t.endsWith(e),bme=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),xme=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Sme=/^\*+\.\*+$/,Cme=e=>!e.startsWith(`.`)&&e.includes(`.`),wme=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Tme=/^\.\*+$/,Eme=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Dme=/^\*+$/,Ome=e=>e.length!==0&&!e.startsWith(`.`),kme=e=>e.length!==0&&e!==`.`&&e!==`..`,Ame=/^\?+([^+@!?*[(]*)?$/,jme=([e,t=``])=>{let n=WD([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Mme=([e,t=``])=>{let n=GD([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Nme=([e,t=``])=>{let n=GD([e]);return t?e=>n(e)&&e.endsWith(t):n},Pme=([e,t=``])=>{let n=WD([e]);return t?e=>n(e)&&e.endsWith(t):n},WD=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},GD=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},KD=typeof process==`object`&&process?{}.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,qD={win32:{sep:`\\`},posix:{sep:`/`}};UD.sep=KD===`win32`?qD.win32.sep:qD.posix.sep;var JD=Symbol(`globstar **`);UD.GLOBSTAR=JD;var Fme=`[^/]*?`,Ime=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,Lme=`(?:(?!(?:\\/|^)\\.).)*?`;UD.filter=(e,t={})=>n=>UD(n,e,t);var YD=(e,t={})=>Object.assign({},e,t);UD.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return UD;let t=UD;return Object.assign((n,r,i={})=>t(n,r,YD(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,YD(e,n))}static defaults(n){return t.defaults(YD(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,YD(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,YD(e,r))}},unescape:(n,r={})=>t.unescape(n,YD(e,r)),escape:(n,r={})=>t.escape(n,YD(e,r)),filter:(n,r={})=>t.filter(n,YD(e,r)),defaults:n=>t.defaults(YD(e,n)),makeRe:(n,r={})=>t.makeRe(n,YD(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,YD(e,r)),match:(n,r,i={})=>t.match(n,r,YD(e,i)),sep:t.sep,GLOBSTAR:JD})};var XD=(e,t={})=>(MD(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Jpe(e,{max:t.braceExpandMax}));UD.braceExpand=XD,UD.makeRe=(e,t={})=>new QD(e,t).makeRe(),UD.match=(e,t,n={})=>{let r=new QD(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};var ZD=/[?*]|[+@!]\(.*?\)|\[|\]/,Rme=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),QD=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){MD(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||KD,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!ZD.test(e[2]))&&!ZD.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];(n!==1||r!==``||e[0]!==``)&&(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];(e!==1||r!==``||n[0]!==``)&&(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(JD)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(JD,i),o=t.lastIndexOf(JD),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===JD?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===JD)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return XD(this.pattern,this.options)}parse(e){MD(e);let t=this.options;if(e===`**`)return JD;if(e===``)return``;let n,r=null;(n=e.match(Dme))?r=t.dot?kme:Ome:(n=e.match(_me))?r=(t.nocase?t.dot?xme:bme:t.dot?yme:vme)(n[1]):(n=e.match(Ame))?r=(t.nocase?t.dot?Mme:jme:t.dot?Nme:Pme)(n):(n=e.match(Sme))?r=t.dot?wme:Cme:(n=e.match(Tme))&&(r=Eme);let i=HD.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Fme:t.dot?Ime:Lme,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?Rme(e):e===JD?JD:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e===JD&&a!==JD&&(a===void 0?i!==void 0&&i!==JD?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==JD&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=JD))});let i=t.filter(e=>e!==JD);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return UD.defaults(e).Minimatch}};UD.AST=HD,UD.Minimatch=QD,UD.escape=gme,UD.unescape=FD;var $D=4,eO=0,tO=1,zme=2;function nO(e){let t=e.length;for(;--t>=0;)e[t]=0}var rO=29,iO=256,aO=286,oO=30,sO=19,cO=573,lO=15,uO=16,Bme=7,dO=256,Vme=16,Hme=17,Ume=18,fO=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),pO=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Wme=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mO=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gme=512,hO=Array(576);nO(hO);var gO=Array(oO*2);nO(gO);var _O=Array(Gme);nO(_O);var vO=Array(256);nO(vO);var yO=Array(rO);nO(yO);var bO=Array(oO);nO(bO);var xO=class{constructor(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}},SO,CO,wO,TO=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},EO=e=>e<256?_O[e]:_O[256+(e>>>7)],DO=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},OO=(e,t,n)=>{e.bi_valid>uO-n?(e.bi_buf|=t<<e.bi_valid&65535,DO(e,e.bi_buf),e.bi_buf=t>>uO-e.bi_valid,e.bi_valid+=n-uO):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},kO=(e,t,n)=>{OO(e,n[t*2],n[t*2+1])},AO=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Kme=e=>{e.bi_valid===16?(DO(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},qme=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=lO;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<cO;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},jO=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=lO;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=AO(r[t]++,t))}},Jme=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<rO-1;r++)for(yO[r]=n,e=0;e<1<<fO[r];e++)vO[n++]=r;for(vO[n-1]=r,i=0,r=0;r<16;r++)for(bO[r]=i,e=0;e<1<<pO[r];e++)_O[i++]=r;for(i>>=7;r<oO;r++)for(bO[r]=i<<7,e=0;e<1<<pO[r]-7;e++)_O[256+i++]=r;for(t=0;t<=lO;t++)a[t]=0;for(e=0;e<=143;)hO[e*2+1]=8,e++,a[8]++;for(;e<=255;)hO[e*2+1]=9,e++,a[9]++;for(;e<=279;)hO[e*2+1]=7,e++,a[7]++;for(;e<=287;)hO[e*2+1]=8,e++,a[8]++;for(jO(hO,287,a),e=0;e<oO;e++)gO[e*2+1]=5,gO[e*2]=AO(e,5);SO=new xO(hO,fO,257,aO,lO),CO=new xO(gO,pO,0,oO,lO),wO=new xO([],Wme,0,sO,Bme)},MO=e=>{let t;for(t=0;t<aO;t++)e.dyn_ltree[t*2]=0;for(t=0;t<oO;t++)e.dyn_dtree[t*2]=0;for(t=0;t<sO;t++)e.bl_tree[t*2]=0;e.dyn_ltree[dO*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},NO=e=>{e.bi_valid>8?DO(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},PO=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},FO=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&PO(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!PO(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},IO=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?kO(e,i,t):(o=vO[i],kO(e,o+iO+1,t),s=fO[o],s!==0&&(i-=yO[o],OO(e,i,s)),r--,o=EO(r),kO(e,o,n),s=pO[o],s!==0&&(r-=bO[o],OO(e,r,s)));while(a<e.sym_next);kO(e,dO,t)},LO=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=cO,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)FO(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],FO(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,FO(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qme(e,t),jO(n,c,e.bl_count)},RO=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},zO=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do kO(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(kO(e,Hme,e.bl_tree),OO(e,s-3,3)):(kO(e,Ume,e.bl_tree),OO(e,s-11,7)):(a!==i&&(kO(e,a,e.bl_tree),s--),kO(e,Vme,e.bl_tree),OO(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},Yme=e=>{let t;for(RO(e,e.dyn_ltree,e.l_desc.max_code),RO(e,e.dyn_dtree,e.d_desc.max_code),LO(e,e.bl_desc),t=18;t>=3&&e.bl_tree[mO[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Xme=(e,t,n,r)=>{let i;for(OO(e,t-257,5),OO(e,n-1,5),OO(e,r-4,4),i=0;i<r;i++)OO(e,e.bl_tree[mO[i]*2+1],3);zO(e,e.dyn_ltree,t-1),zO(e,e.dyn_dtree,n-1)},Zme=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return eO;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return tO;for(n=32;n<iO;n++)if(e.dyn_ltree[n*2]!==0)return tO;return eO},Qme=!1,$me=e=>{Qme||=(Jme(),!0),e.l_desc=new TO(e.dyn_ltree,SO),e.d_desc=new TO(e.dyn_dtree,CO),e.bl_desc=new TO(e.bl_tree,wO),e.bi_buf=0,e.bi_valid=0,MO(e)},BO=(e,t,n,r)=>{OO(e,0+ +!!r,3),NO(e),DO(e,n),DO(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},ehe=e=>{OO(e,2,3),kO(e,dO,hO),Kme(e)},the=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===zme&&(e.strm.data_type=Zme(e)),LO(e,e.l_desc),LO(e,e.d_desc),o=Yme(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,(a<=i||e.strategy===$D)&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?BO(e,t,n,r):e.strategy===$D||a===i?(OO(e,2+ +!!r,3),IO(e,hO,gO)):(OO(e,4+ +!!r,3),Xme(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),IO(e,e.dyn_ltree,e.dyn_dtree)),MO(e),r&&NO(e)},VO=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(vO[n]+iO+1)*2]++,e.dyn_dtree[EO(t)*2]++),e.sym_next===e.sym_end),HO=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},nhe=(()=>{let e=new Uint32Array(2048),t;for(let n=0;n<256;n++){t=n;for(let e=0;e<8;e++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}for(let n=0;n<256;n++){t=e[n];for(let r=256;r<2048;r+=256)t=e[t&255]^t>>>8,e[r+n]=t}return e})(),UO=(e,t,n,r)=>{let i=nhe,a=r+n,o=r;e^=-1;for(let n=a-7;o<n;o+=8)e^=t[o]|t[o+1]<<8|t[o+2]<<16|t[o+3]<<24,e=i[1792+(e&255)]^i[1536+(e>>>8&255)]^i[1280+(e>>>16&255)]^i[1024+(e>>>24)]^i[768+t[o+4]]^i[512+t[o+5]]^i[256+t[o+6]]^i[t[o+7]];for(;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1},WO={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},rhe=9,ihe=573,GO=3,KO=258,qO=262,ahe=32,JO=42,YO=57,XO=69,ZO=73,QO=91,$O=103,ek=113,tk=666,nk=1,rk=2,ik=3,ak=4,ohe=3,ok=(e,t)=>(e.msg=WO[t],t),sk=e=>e*2-(e>4?9:0),ck=e=>{let t=e.length;for(;--t>=0;)e[t]=0},she=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},lk=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,uk=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=lk(e,e.ins_h,e.window[t+GO-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},dk=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},fk=(e,t)=>{the(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,dk(e.strm)},pk=(e,t)=>{e.pending_buf[e.pending++]=t},mk=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},hk=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=HO(e.adler,t,i,n):e.state.wrap===2&&(e.adler=UO(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},gk=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-qO?e.strstart-(e.w_size-qO):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+KO,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=KO-(f-r),r=f-KO,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},_k=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qO)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),she(e),r+=t),e.strm.avail_in===0)break;if(n=hk(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>GO)for(i=e.strstart-e.insert;e.insert&&(uk(e,i),i++,e.insert--,!(e.lookahead+e.insert<=GO)););}else if(e.lookahead+e.insert>=GO)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=lk(e,e.ins_h,e.window[i+1]);e.insert&&(uk(e,i),i++,e.insert--,!(e.lookahead+e.insert<GO)););}while(e.lookahead<qO&&e.strm.avail_in!==0)},vk=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),BO(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,dk(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(hk(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?ak:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?rk:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(hk(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),BO(e,e.block_start,r,o),e.block_start+=r,dk(e.strm)),o?ik:nk)},yk=(e,t)=>{let n,r;for(;;){if(e.lookahead<qO){if(_k(e),e.lookahead<qO&&t===0)return nk;if(e.lookahead===0)break}if(n=0,e.lookahead>=GO&&(n=uk(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-qO&&(e.match_length=gk(e,n)),e.match_length>=GO){if(r=VO(e,e.strstart-e.match_start,e.match_length-GO),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=GO){e.match_length--;do e.strstart++,n=uk(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=lk(e,e.ins_h,e.window[e.strstart+1]))}else r=VO(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(fk(e,!1),e.strm.avail_out===0))return nk}return e.insert=e.strstart<GO-1?e.strstart:GO-1,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},bk=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<qO){if(_k(e),e.lookahead<qO&&t===0)return nk;if(e.lookahead===0)break}if(n=0,e.lookahead>=GO&&(n=uk(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=GO-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-qO&&(e.match_length=gk(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===GO&&e.strstart-e.match_start>4096)&&(e.match_length=GO-1)),e.prev_length>=GO&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-GO,r=VO(e,e.strstart-1-e.prev_match,e.prev_length-GO),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=uk(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=GO-1,e.strstart++,r&&(fk(e,!1),e.strm.avail_out===0))return nk}else if(e.match_available){if(r=VO(e,0,e.window[e.strstart-1]),r&&fk(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return nk}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=VO(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<GO-1?e.strstart:GO-1,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},che=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=KO){if(_k(e),e.lookahead<=KO&&t===0)return nk;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=GO&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+KO;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=KO-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=GO?(n=VO(e,1,e.match_length-GO),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=VO(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(fk(e,!1),e.strm.avail_out===0))return nk}return e.insert=0,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},lhe=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(_k(e),e.lookahead===0)){if(t===0)return nk;break}if(e.match_length=0,n=VO(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(fk(e,!1),e.strm.avail_out===0))return nk}return e.insert=0,t===4?(fk(e,!0),e.strm.avail_out===0?ik:ak):e.sym_next&&(fk(e,!1),e.strm.avail_out===0)?nk:rk},xk=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}},Sk=[new xk(0,0,0,0,vk),new xk(4,4,8,4,yk),new xk(4,5,16,8,yk),new xk(4,6,32,32,yk),new xk(4,4,16,16,bk),new xk(8,16,32,32,bk),new xk(8,16,128,128,bk),new xk(8,32,128,256,bk),new xk(32,128,258,1024,bk),new xk(32,258,258,4096,bk)],uhe=e=>{e.window_size=2*e.w_size,ck(e.head),e.max_lazy_match=Sk[e.level].max_lazy,e.good_match=Sk[e.level].good_length,e.nice_match=Sk[e.level].nice_length,e.max_chain_length=Sk[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=GO-1,e.match_available=0,e.ins_h=0},dhe=class{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ihe*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ck(this.dyn_ltree),ck(this.dyn_dtree),ck(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ck(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ck(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}},Ck=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==JO&&t.status!==YO&&t.status!==XO&&t.status!==ZO&&t.status!==QO&&t.status!==$O&&t.status!==ek&&t.status!==tk)},fhe=e=>{if(Ck(e))return ok(e,-2);e.total_in=e.total_out=0,e.data_type=2;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?YO:t.wrap?JO:ek,e.adler=t.wrap===2?0:1,t.last_flush=-2,$me(t),0},phe=e=>{let t=fhe(e);return t===0&&uhe(e.state),t},mhe=(e,t,n,r,i,a,o)=>{if(!e)return-2;let s=1;if(t===-1&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>rhe||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return ok(e,-2);r===8&&(r=9);let c=new dhe;return e.state=c,c.strm=e,c.status=JO,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=+!!o,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+GO-1)/GO),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=a,c.method=n,phe(e)},hhe=(e,t)=>{if(Ck(e)||t>5||t<0)return e?ok(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===tk&&t!==4)return ok(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(dk(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&sk(t)<=sk(r)&&t!==4)return ok(e,-5);if(n.status===tk&&e.avail_in!==0)return ok(e,-5);if(n.status===JO&&n.wrap===0&&(n.status=ek),n.status===JO){let t=8+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=2||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=ahe),t+=31-t%31,mk(n,t),n.strstart!==0&&(mk(n,e.adler>>>16),mk(n,e.adler&65535)),e.adler=1,n.status=ek,dk(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===YO){if(e.adler=0,pk(n,31),pk(n,139),pk(n,8),n.gzhead)pk(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),pk(n,n.gzhead.time&255),pk(n,n.gzhead.time>>8&255),pk(n,n.gzhead.time>>16&255),pk(n,n.gzhead.time>>24&255),pk(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),pk(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(pk(n,n.gzhead.extra.length&255),pk(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=UO(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=XO;else if(pk(n,0),pk(n,0),pk(n,0),pk(n,0),pk(n,0),pk(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),pk(n,ohe),n.status=ek,dk(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===XO){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,dk(e),n.pending!==0)return n.last_flush=-1,0;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=ZO}if(n.status===ZO){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),dk(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,pk(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=QO}if(n.status===QO){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t)),dk(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,pk(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=UO(e.adler,n.pending_buf,n.pending-t,t))}n.status=$O}if(n.status===$O){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(dk(e),n.pending!==0))return n.last_flush=-1,0;pk(n,e.adler&255),pk(n,e.adler>>8&255),e.adler=0}if(n.status=ek,dk(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==tk){let r=n.level===0?vk(n,t):n.strategy===2?lhe(n,t):n.strategy===3?che(n,t):Sk[n.level].func(n,t);if((r===ik||r===ak)&&(n.status=tk),r===nk||r===ik)return e.avail_out===0&&(n.last_flush=-1),0;if(r===rk&&(t===1?ehe(n):t!==5&&(BO(n,0,0,!1),t===3&&(ck(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),dk(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(pk(n,e.adler&255),pk(n,e.adler>>8&255),pk(n,e.adler>>16&255),pk(n,e.adler>>24&255),pk(n,e.total_in&255),pk(n,e.total_in>>8&255),pk(n,e.total_in>>16&255),pk(n,e.total_in>>24&255)):(mk(n,e.adler>>>16),mk(n,e.adler&65535)),dk(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},ghe=e=>{if(Ck(e))return-2;let t=e.state.status;return e.state=null,t===ek?ok(e,-3):0},_he=(e,t)=>{let n=t.length;if(Ck(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==JO||r.lookahead)return-2;if(i===1&&(e.adler=HO(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ck(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,_k(r);r.lookahead>=GO;){let e=r.strstart,t=r.lookahead-(GO-1);do uk(r,e),e++;while(--t);r.strstart=e,r.lookahead=GO-1,_k(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=GO-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},wk=16209,vhe=16191;function yhe(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=wk;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=wk;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=wk;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=vhe;break top}else{e.msg=`invalid literal/length code`,E.mode=wk;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p}var Tk=15,Ek=852,Dk=592,Ok=0,kk=1,Ak=2,bhe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),xhe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),She=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Che=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),jk=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(16),D=new Uint16Array(16),O=null,k,A,j;for(l=0;l<=Tk;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=Tk;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=Tk;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===Ok||f!==1))return-1;for(D[1]=0,l=1;l<Tk;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===Ok?(w=O=o,T=20):e===kk?(w=bhe,O=xhe,T=257):(w=She,O=Che,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===kk&&_>Ek||e===Ak&&_>Dk)return 1;for(;;){k=l-h,o[u]+1<T?(A=0,j=o[u]):o[u]>=T?(A=O[o[u]-T],j=w[o[u]-T]):(A=96,j=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|A<<16|j|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===kk&&_>Ek||e===Ak&&_>Dk)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},whe=0,Mk=1,Nk=2,Pk=16180,Fk=16181,Ik=16182,Lk=16183,Rk=16184,zk=16185,Bk=16186,Vk=16187,Hk=16188,Uk=16189,Wk=16190,Gk=16191,Kk=16192,qk=16193,Jk=16194,Yk=16195,Xk=16196,Zk=16197,Qk=16198,$k=16199,eA=16200,tA=16201,nA=16202,rA=16203,iA=16204,aA=16205,oA=16206,sA=16207,cA=16208,lA=16209,uA=16210,dA=16211,The=852,Ehe=592,fA=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),Dhe=class{constructor(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},pA=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<Pk||t.mode>dA)},Ohe=e=>{if(pA(e))return-2;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=Pk,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(The),t.distcode=t.distdyn=new Int32Array(Ehe),t.sane=1,t.back=-1,0},mA=e=>{if(pA(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ohe(e)},khe=(e,t)=>{let n;if(pA(e))return-2;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?-2:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,mA(e))},Ahe=(e,t)=>{if(!e)return-2;let n=new Dhe;e.state=n,n.strm=e,n.window=null,n.mode=Pk;let r=khe(e,t);return r!==0&&(e.state=null),r},hA=!0,gA,_A,jhe=e=>{if(hA){gA=new Int32Array(512),_A=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(jk(Mk,e.lens,0,288,gA,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;jk(Nk,e.lens,0,32,_A,0,e.work,{bits:5}),hA=!1}e.lencode=gA,e.lenbits=9,e.distcode=_A,e.distbits=5},vA=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.window=new Uint8Array(1<<a.wbits)),a.wsize===0&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},yA=(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pA(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===Gk&&(n.mode=Kk),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=0;inf_leave:for(;;)switch(n.mode){case Pk:if(n.wrap===0){n.mode=Kk;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0),l=0,u=0,n.mode=Fk;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=lA;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=lA;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=lA;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?Uk:Gk,l=0,u=0;break;case Fk:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!=8){e.msg=`unknown compression method`,n.mode=lA;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=lA;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0)),l=0,u=0,n.mode=Ik;case Ik:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l>>>0),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=UO(n.check,T,4,0)),l=0,u=0,n.mode=Lk;case Lk:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0)),l=0,u=0,n.mode=Rk;case Rk:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=UO(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=zk;case zk:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=UO(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=Bk;case Bk:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C),n.length++);while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=UO(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=Vk;case Vk:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C),n.length++);while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=UO(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Hk;case Hk:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=lA;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Gk;break;case Uk:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=fA(l),l=0,u=0,n.mode=Wk;case Wk:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,2;e.adler=n.check=1,n.mode=Gk;case Gk:if(t===5||t===6)break inf_leave;case Kk:if(n.last){l>>>=u&7,u-=u&7,n.mode=oA;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=qk;break;case 1:if(jhe(n),n.mode=$k,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Xk;break;case 3:e.msg=`invalid block type`,n.mode=lA}l>>>=2,u-=2;break;case qk:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=lA;break}if(n.length=l&65535,l=0,u=0,n.mode=Jk,t===6)break inf_leave;case Jk:n.mode=Yk;case Yk:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=Gk;break;case Xk:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=lA;break}n.have=0,n.mode=Zk;case Zk:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[O[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=jk(whe,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=lA;break}n.have=0,n.mode=Qk;case Qk:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=lA;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=lA;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===lA)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=lA;break}if(n.lenbits=9,E={bits:n.lenbits},w=jk(Mk,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=lA;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=jk(Nk,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=lA;break}if(n.mode=$k,t===6)break inf_leave;case $k:n.mode=eA;case eA:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,yhe(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===Gk&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=aA;break}if(v&32){n.back=-1,n.mode=Gk;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=lA;break}n.extra=v&15,n.mode=tA;case tA:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=nA;case nA:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=lA;break}n.offset=y,n.extra=v&15,n.mode=rA;case rA:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=lA;break}n.mode=iA;case iA:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=lA;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=eA);break;case aA:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=eA;break;case oA:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?UO(n.check,i,f,o-f):HO(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:fA(l))!==n.check){e.msg=`incorrect data check`,n.mode=lA;break}l=0,u=0}n.mode=sA;case sA:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=lA;break}l=0,u=0}n.mode=cA;case cA:w=1;break inf_leave;case lA:w=-3;break inf_leave;case uA:return-4;case dA:default:return-2}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<lA&&(n.mode<oA||t!==4))&&vA(e,e.output,e.next_out,f-e.avail_out)?(n.mode=uA,-4):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?UO(n.check,i,f,e.next_out-f):HO(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Gk?128:0)+(n.mode===$k||n.mode===Jk?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},bA=e=>{if(pA(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},xA=(e,t)=>{let n=t.length,r,i,a;return pA(e)||(r=e.state,r.wrap!==0&&r.mode!==Wk)?-2:r.mode===Wk&&(i=1,i=HO(i,t,n,0),i!==r.check)?-3:(a=vA(e,t,n,n),a?(r.mode=uA,-4):(r.havedict=1,0))},SA=class{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},CA=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},wA=Object.prototype.toString,Mhe={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:new Uint8Array},Nhe=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Mhe,e);let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new SA,this.strm.avail_out=0;let n=mhe(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(WO[n]);wA.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(r.length){if(t.gzip)throw Error(`dictionary is not supported with gzip`);if(n=_he(this.strm,r),n!==0)throw Error(WO[n])}}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=typeof t==`number`?t:t===!0?4:0,n.input=typeof e==`string`?new TextEncoder().encode(e):wA.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===2||a===3)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=hhe(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=ghe(this.strm);break}if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||WO[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=CA(this.chunks)),this.chunks=[]}},TA=Object.prototype.toString,Phe={chunkSize:65536,windowBits:15,raw:!1,dictionary:new Uint8Array},Fhe=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},Phe,e);let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!e.windowBits&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new SA,this.strm.avail_out=0;let n=Ahe(this.strm,t.windowBits);if(n!==0)throw Error(WO[n]);TA.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=xA(this.strm,r),n!==0))throw Error(WO[n])}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a,o;if(this.ended)return this.err===0;for(a=typeof t==`number`?t:t===!0?4:0,n.input=TA.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=yA(n,a),i===2){let e=this.options.dictionary;e.length&&(i=xA(n,e),i===0?i=yA(n,a):i===-3&&(i=2))}for(;n.avail_in>0&&i===1&&n.state.wrap&2&&n.state.flags!==0&&n.input[n.next_in]!==0;)mA(n),i=yA(n,a);if(i===-2||i===-3||i===2||i===-4)break;if(o=n.avail_out,n.next_out&&(n.avail_out===0||i===1||a>0)&&(this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out)),n.avail_out=0,n.next_out=0),i!==0&&i!==-5||o!==0){if(i===1){i=bA(this.strm);break}if(n.avail_in===0){if(a===4){i=bA(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||WO[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=CA(this.chunks)),this.chunks=[]}};function EA(e,t,n){let r=0,i=e.onData;if(e.onData=function(e){if(e.byteLength>n-r)throw Error(`gzip output exceeds limit (${n} bytes)`);r+=e.byteLength,i.call(this,e)},!e.push(t,!0)||e.err||e.result===void 0)throw Error(e.msg||`Invalid or incomplete gzip stream`);return e.result}function DA(e){if(!Number.isSafeInteger(e)||e<=0)throw Error(`gzip output limit must be a positive safe integer`);return Math.min(e,65536)}function OA(e,t){return EA(new Fhe({windowBits:31,chunkSize:DA(t)}),e,t)}function Ihe(e,t,n){return EA(new Nhe({gzip:!0,level:n,chunkSize:DA(t)}),e,t)}var kA=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends kA{};function AA(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function jA(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function MA(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function NA(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function PA(e,t){return MA(e,t,``)}function FA(e,t){return NA(e,t,``)}function IA(e,t){return t.slice(0,Lhe(e,t))}function Lhe(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function LA(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function RA(e,t){if(t)return BA(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function zA(e,t){if(t)return BA(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function BA(e,t){if(!t)return[zA(e),RA(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=LA(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var VA=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Rhe=RegExp(`[${VA}]+|\\s+|[^${VA}]`,`ug`);new class extends kA{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=LA(e,r)}else n=e.match(Rhe)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&HA(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&HA(n,i,r,null,t.intlSegmenter),e}};function HA(e,t,n,r,i){if(t&&n){let[a,o]=BA(t.value,i),[s,c]=BA(n.value,i);if(e){let r=AA(a,s);e.value=NA(e.value,s,r),t.value=PA(t.value,r),n.value=PA(n.value,r)}if(r){let e=jA(o,c);r.value=MA(r.value,c,e),t.value=FA(t.value,e),n.value=FA(n.value,e)}}else if(n){if(e){let e=zA(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=zA(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=zA(r.value,i),[a,o]=BA(t.value,i),s=AA(n,a);t.value=PA(t.value,s);let c=jA(PA(n,s),o);t.value=FA(t.value,c),r.value=MA(r.value,n,c),e.value=NA(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=zA(r.value,i),n=IA(RA(t.value,i),e);t.value=FA(t.value,n)}else if(e){let n=IA(RA(e.value,i),zA(t.value,i));t.value=PA(t.value,n)}}new class extends kA{tokenize(e){let t=RegExp(`(\\r?\\n)|[${VA}]+|[^\\S\\n\\r]+|[^${VA}]`,`ug`);return e.match(t)||[]}};var zhe=new class extends kA{constructor(){super(...arguments),this.tokenize=WA}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
96
96
  `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
97
97
  `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
98
98
  `)&&(e=e.slice(0,-1)),t.endsWith(`
@@ -1738,4 +1738,4 @@ ${e.join(`
1738
1738
  `),this.draw()],{kind:`interrupt`},`^C`);let t=this.#w();return this.#t={text:``,cursor:0},this.#p([b4(this.#S()),x4(`${t.ansi}^C\r\n`),this.draw()],g4,`${t.plain}^C`)}#v(e,t){let n=this.#n??``;if(e.key===`Escape`)return this.#n=null,this.#m();if(e.key===`Enter`||t===`r`&&!e.shiftKey){let t=this.#e.search(n,this.#t.text);return t!==null&&(this.#t={text:t,cursor:t.length}),e.key===`Enter`&&(this.#n=null),this.#m()}return e.key===`Backspace`?(this.#n=f4({text:n,cursor:n.length},{type:`backspace`}).text,this.#m()):this.#f()}#y(){let{text:e,cursor:t}=this.#t;if(t!==e.length)return this.#f();let n=Bke(e);return n===null?this.#f():`kind`in n?this.#b(n.message):n.length===1?(this.#i=null,this.#h(`${n[0].name} `)):this.#i===e?(this.#i=null,this.#b(n.map(e=>`${e.name}${e.where===`full`?` ⚡`:``}`).join(` · `))):(this.#i=e,this.#f())}#b(e){let t=this.#w();return this.#p([b4(this.#S()),x4(`${t.ansi}\r\n${y4(e)}\r\n`),this.draw()],g4,`${t.plain}\n${e}`)}#x(){let{text:e}=this.#t,t=this.#w(),n=b4(this.#S());if(e.trim().length===0)return this.#p([n,x4(`${t.ansi}\r\n`),this.draw()]);let r=R2(e);if(r.kind!==`command`&&r.kind!==`invalid`){if(this.#t={text:``,cursor:0},r.kind===`light`){let e=`Already in the light shell.`;return this.#p([n,x4(`${t.ansi}\r\n${e}\r\n`),this.draw()],g4,`${t.plain}\n${e}`)}return this.#e=new u4,this.#r=`closed`,this.#p([n,x4(`${t.ansi}\r\n`)],{kind:`exit`},t.plain)}let i=r.kind===`command`?r.route:{where:`invalid`,message:r.message};if(i.where===`invalid`)return this.#p([n,x4(`${t.ansi}\r\n${y4(i.message)}\r\n`),this.draw()],g4,`${t.plain}\n${i.message}`);this.#e.record(e),this.#t={text:``,cursor:0};let a=r.kind===`command`?r.command:e,o={command:a,cwd:this.#a,env:this.#o};if(i.where===`full`){if(this.#r=`full`,this.#u)return this.#p([n],{kind:`escalate`,request:o},t.plain);let e=`Starting the full shell for ${a}…`;return this.#p([n,x4(`${t.ansi}\r\n${e}\r\n`)],{kind:`escalate`,request:o},`${t.plain}\n${e}`)}return this.#r=`busy`,this.#p([n,x4(`${t.ansi}\r\n`)],{kind:`run`,request:o},t.plain)}#S(){let e=this.#c>0?`${p4}[${String(this.#c)}A`:``;return this.#c=0,`${e}\r${p4}[J`}#C(){let e=this.#s===0?`✓`:`✗ ${String(this.#s)}`,t=` fungi@${this.#d} ${this.#a} `;return{ansi:`${v4(this.#s===0?`32`:`31`,e)}${t}${v4(`36`,`◦light`)} ➜ `,plain:`${e}${t}◦light ➜ `}}#w(){let e=this.#C();return{ansi:e.ansi+this.#t.text,plain:e.plain+this.#t.text}}#T(e){let t=this.#l,{text:n,cursor:r}=this.#t,i,a,o=``;if(this.#n!==null){let e=`(reverse-i-search)'${this.#n}': `;i={ansi:v4(`2`,e),plain:e},a=n}else{i=this.#C();let e=this.route,t=e.where===`invalid`?`31;4:3`:e.where===`full`?`33`:`32`;a=n.length>0?v4(t,n):``,o=this.#g()??``}let s=l4(i.plain),c=s+l4(n)+l4(o),l=s+l4(n.slice(0,r)),u=i.ansi+a+(o?v4(`2`,o):``);c>0&&c%t===0&&(u+=` \r`);let d=S4(c,t),f=S4(l,t);return e&&(d.row>f.row&&(u+=`${p4}[${String(d.row-f.row)}A`),u+=`${p4}[${String(f.col+1)}G`),this.#c=f.row,u}},NAe=300,PAe=262144,FAe=class{#e;#t;#n=`light`;#r=[];#i=0;#a=!1;#o=null;#s;#c=!1;#l=!1;#u=new TextEncoder;constructor(e,{computerName:t,columns:n}){this.#e=e,this.#t=new MAe({computerName:t,columns:n})}start(){this.#e.live(this.#t.draw().text),this.#g()}repaint(e){this.#t.setColumns(e),this.#n===`light`&&this.#t.phase===`idle`&&this.#e.live(this.#t.draw().text)}setColumns(e){this.#t.setColumns(e)}setSessionOpen(e){this.#a=e,this.#t.setFullReady(e)}key(e){if(this.#n!==`light`)return!1;let t=this.#t.key(e);return this.#f(t),t.consumed}input(e){return this.#n===`light`&&(this.#f(this.#t.input(e)),!0)}output(e){if(this.#n===`full`){this.#e.commit(e);return}for(this.#r.push(e),this.#i+=e.byteLength;this.#i>PAe&&this.#r.length>1;)this.#i-=this.#r.shift()?.byteLength??0}ptyEnded(){this.setSessionOpen(!1),this.#d(),this.#n===`full`&&(this.#n=`light`,this.#f(this.#t.returnFromFull()),this.#e.connect().catch(e=>{yD(`light-shell.reconnect`,e)}))}reopen(){this.#f(this.#t.reopen())}dispose(){this.#l=!0,this.#o?.abort(),clearTimeout(this.#s)}#d(){this.#r=[],this.#i=0}#f(e){if(!this.#l){e.effect.kind===`clear`&&this.#e.forget();for(let t of e.chunks)t.record?this.#e.commit(this.#u.encode(t.text)):this.#e.live(t.text);switch(e.log.length>0&&this.#e.log(e.log),e.effect.kind){case`run`:this.#p(e.effect.request);break;case`escalate`:this.#m(e.effect.request.command);break;case`interrupt`:this.#o?.abort(),this.#h(!1)}this.#g()}}#p(e){let t=new AbortController;this.#o=t,this.#s=setTimeout(()=>{this.#h(!0)},NAe),this.#e.runLight(e,t.signal).then(e=>{t.signal.aborted||this.#f(this.#t.finish(e))}).catch(e=>{yD(`light-shell.command`,e),t.signal.aborted||this.#f(this.#t.fail(`light`))}).finally(()=>{this.#o===t&&(this.#o=null,this.#h(!1))})}#m(e){this.#n=`full`;let t=()=>this.#e.send(`${e}\n`),n=e=>{yD(`light-shell.full`,e),this.#n===`full`&&(this.#n=`light`,this.#d(),this.#f(this.#t.fail(`full`)))};if(this.#a){for(let e of this.#r)this.#e.commit(e);this.#d(),t().catch(n);return}this.#d(),this.#e.connect().then(t).catch(n)}#h(e){clearTimeout(this.#s),this.#c!==e&&(this.#c=e,this.#g())}#g(){if(this.#l)return;let e=this.#t.route;this.#e.view({phase:this.#t.phase,route:e.where,routeLabel:e.where===`invalid`?`invalid: ${e.message}`:e.where===`full`?`full shell`:`light shell`,busy:this.#c&&this.#t.phase===`busy`})}};function C4(e){return e.replace(/\p{Cc}/gu,` `)}function w4(e,t){let n=[],r=``;for(let i of e){let e=r?`${r} · ${i}`:i;r&&e.length>t?(n.push(r),r=i):r=e}return n.push(r),n.join(`
1739
1739
  `)}function IAe({cols:e,information:t,light:n=!1}){let r=t.teamName!==`unconfigured`,i=[C4(t.computerName)];return r&&i.push(`Team ${C4(t.teamName)}`),t.modelDoor!==`unconfigured`&&t.modelDoor!==t.computerName&&i.push(`model: ${C4(t.modelDoor)}`),i.push(`up ${String(Math.floor(t.uptimeSeconds/60))}m`),t.version!==`0.0.0`&&i.push(`${r?`Fungi`:`Computer`} ${C4(t.version)}`),`${w4(i,e)}\n${n?w4([`light shell`,`instant`,`try: ls`,`rg TODO`,`jq . package.json`],e):`try: ls · pwd · node -v · exit`}\n\n`.replace(/\r?\n/g,`\r
1740
1740
  `)}function LAe(e){return`Connecting to ${C4(e)}…\r\n`}var RAe=4194304,T4=13,E4={phase:`idle`,route:`light`,routeLabel:`light shell`,busy:!1};function zAe({app:e,computerId:t,screen:n,light:r,onStatusChange:i,onTerminalReady:a,openRuntimeSetup:o}){let[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(!1),d=(0,F.useRef)(null),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(null),h=(0,F.useRef)(null),g=(0,F.useRef)([]),_=(0,F.useRef)(0),v=(0,F.useRef)(null),y=(0,F.useRef)(null),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(`starting`),[w,T]=(0,F.useState)(0),[E,D]=(0,F.useState)(null),[O,k]=(0,F.useState)(null);(0,F.useEffect)(()=>{i?.({name:E,state:S,information:O})},[E,S,O,i]),(0,F.useEffect)(()=>{if(!b||!a)return;let e=()=>{let e=p.current;if(!e)throw Error(`Shed terminal is no longer mounted`);return e};h.current??={write:(t,n)=>{e().write(t,n)},reset:()=>{let t=e();t.reset(),t.write(`\x1B[2J\x1B[3J\x1B[H`)},resize:(t,n)=>{e().resize(t,n)},paint:()=>Promise.resolve().then(()=>{let t=e(),{renderer:n,wasmTerm:r}=t;if(!n||!r)throw Error(`Shed terminal renderer is unavailable`);n.render(r,!0,t.getViewportY(),t)})},a(h.current)},[b,a]);let A=(0,F.useRef)(r);A.current=r;let j=(0,F.useRef)(null),[M,ee]=(0,F.useState)(E4),[N,te]=(0,F.useState)([]),ne=(0,F.useRef)(0),re=r!==void 0,P=(0,F.useCallback)(e=>{for(g.current.push(e),_.current+=e.byteLength;_.current>RAe&&g.current.length>1;){let e=g.current.shift();_.current-=e?.byteLength??0}p.current?.write(e)},[]);(0,F.useEffect)(()=>{let e=!0,t=0,n,r,i,a=()=>{let t=p.current,n=m.current,r=d.current,a=f.current;if(!e||!t||!n||!r||!a||r.clientWidth===0||r.clientHeight===0)return;let o=getComputedStyle(a),s=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),c=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom);if(a.clientWidth<=s||a.clientHeight<=c)return;let l=n.proposeDimensions();if(!l)return;if(t.cols!==l.cols||t.rows!==l.rows){if(t.cols!==l.cols&&_.current>0&&i){i(l);return}t.resize(l.cols,l.rows),j.current?.setColumns(t.cols)}x(!0);let u=y.current;u&&u.resize({cols:Math.max(2,t.cols),rows:Math.max(2,t.rows)}).catch(e=>{console.error(`Shed terminal operation failed`,e)})},o=()=>p.current?.blur(),s=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>{!e||document.visibilityState!==`visible`||(a(),p.current?.focus())})},c=()=>{document.visibilityState===`hidden`?o():s()},l=f.current,u=d.current;if(!l||!u)return;let h=e=>{if(e.isComposing)return;let t=j.current,n=e=>{v.current?.write(new TextEncoder().encode(e)).catch(e=>{console.error(`Shed terminal operation failed`,e)})},r=e=>t?.key({key:e,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isComposing:!1})??!1;switch(e.inputType){case`deleteContentBackward`:e.preventDefault(),r(`Backspace`)||n(``);break;case`insertLineBreak`:case`insertParagraph`:e.preventDefault(),r(`Enter`)||n(`\r`);break;case`insertText`:if(!e.data)return;e.preventDefault(),t?.input(e.data)||n(e.data)}};l.addEventListener(`beforeinput`,h);let b=l.closest(`[data-theme]`)??document.documentElement,S=()=>getComputedStyle(l).getPropertyValue(`--font-mono`)||`Maple Mono, ui-monospace, monospace`;return Promise.all([mS(),hS(T4,S())]).then(([t])=>{if(!e)return;let d=u_(b)??`mocha`,f=(e,n)=>{p.current?.dispose(),l.replaceChildren();let r=kS(e),i=new rue({ghostty:t,cursorBlink:!0,cursorStyle:`block`,fontSize:T4,fontFamily:S(),theme:r,...n});p.current=i,i.open(l);let o=new cue;i.loadAddon(o),m.current=o;let s=new TextEncoder;i.onData(e=>{j.current?.input(e)||v.current?.write(s.encode(e)).catch(e=>{console.error(`Shed terminal operation failed`,e)})}),i.attachCustomKeyEventHandler(e=>j.current?.key(e)??!1),i.write(`\x1B[2J\x1B[3J\x1B[H`);for(let e of g.current)i.write(e);j.current?.repaint(i.cols),document.fonts.ready.then(a),a()};i=e=>{f(d,e)},f(d),r=Vre(t=>{t===d||!kS(t)||(d=t,hS(T4,S()).then(()=>{if(!e||t!==d)return;let n=p.current;f(t,n?{cols:n.cols,rows:n.rows}:void 0)}).catch(t=>{console.error(`Shed terminal operation failed`,t),e&&C(`failed`)}))},b),n=new ResizeObserver(a),n.observe(u),document.addEventListener(`visibilitychange`,c),window.addEventListener(`blur`,o),window.addEventListener(`focus`,s)}).catch(t=>{console.error(`Shed terminal operation failed`,t),e&&C(`failed`)}),()=>{e=!1,cancelAnimationFrame(t),l.removeEventListener(`beforeinput`,h),n?.disconnect(),r?.(),document.removeEventListener(`visibilitychange`,c),window.removeEventListener(`blur`,o),window.removeEventListener(`focus`,s),y.current?.close().catch(e=>{console.error(`Shed terminal operation failed`,e)});try{p.current?.dispose()}catch(e){console.error(`Shed terminal operation failed`,e)}p.current=null,m.current=null}},[]),(0,F.useEffect)(()=>{if(!b)return;let n=!0,r,i,a,o=null,s=null,c=null,l=new AbortController,u=new TextEncoder;C(`starting`),D(null),k(null),ee(E4),te([]);let d=async()=>{let t=p.current;if(!t)return null;let r=await wue(e.capabilities,{cols:Math.max(2,t.cols),rows:Math.max(2,t.rows)},{signal:l.signal});return n?r:(await r.close(),null)},f=e=>(a=e,y.current=e,r=e.output.getReader(),i=e.input.getWriter(),v.current=i,s?.setSessionOpen(!0),r),m=()=>{v.current===i&&(v.current=null),i?.releaseLock(),y.current===a&&(y.current=null),a?.close().catch(e=>{console.error(`Shed terminal operation failed`,e)})},h=async(e,t)=>{try{for(;;){let e=await t.read();if(l.signal.aborted||e.done)break;let n=e.value.slice();s?s.output(n):P(n)}}catch(e){if(console.error(`Shed terminal operation failed`,e),!s){l.signal.aborted||C(`failed`);return}}l.signal.aborted||y.current!==e||(m(),s?s.ptyEnded():C(`closed`))},x=()=>y.current?Promise.resolve():(o??=(async()=>{let e=await d();e&&h(e,f(e))})().finally(()=>{o=null}),o);return(async()=>{let e=p.current;if(e){g.current=[],_.current=0,e.reset(),e.write(`\x1B[2J\x1B[3J\x1B[H`),P(u.encode(LAe(t)));try{let t=await d();if(!t)return;g.current=[],_.current=0,p.current?.reset(),p.current?.write(`\x1B[2J\x1B[3J\x1B[H`);let n=Math.max(2,p.current?.cols??e.cols);if(P(u.encode(IAe({cols:n,information:t.information,light:A.current!==void 0}))),A.current){let e=new FAe({live:e=>p.current?.write(e),commit:P,forget:()=>{g.current=[],_.current=0},send:e=>{let t=v.current;return t?t.write(u.encode(e)):Promise.reject(Error(`The full shell is not open`))},connect:x,runLight:(e,t)=>{let n=A.current;return n?n.runLight(e,t):Promise.reject(Error(`The light shell is unavailable`))},view:ee,log:e=>{let t=e.split(`
1741
- `).map(e=>({id:ne.current+=1,text:e}));te(e=>[...e,...t].slice(-500))}},{computerName:t.information.computerName,columns:n});s=e,c={key:t=>e.key(t),input:t=>e.input(t),repaint:t=>{e.repaint(t)},setColumns:t=>{e.setColumns(t)},reopen:()=>{e.reopen()}},j.current=c,e.start()}D(t.information.computerName),k(t.information);let r=f(t);C(`open`),await h(t,r)}catch(e){console.error(`Shed terminal operation failed`,e),l.signal.aborted||C(`failed`)}}})(),()=>{n=!1,l.abort(),s?.dispose(),j.current===c&&(j.current=null),r?.cancel().catch(e=>{console.error(`Shed terminal operation failed`,e)}),v.current===i&&(v.current=null),i?.releaseLock(),y.current===a&&(y.current=null),a?.close().catch(e=>{console.error(`Shed terminal operation failed`,e)})}},[e,t,w,b,P]),(0,F.useEffect)(()=>{let e=requestAnimationFrame(()=>{n?p.current?.blur():p.current?.focus()});return()=>{cancelAnimationFrame(e)}},[!!n]);let ie=M.phase===`idle`?`light`:M.phase;return(0,R.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,"data-shell-state":re?ie:void 0,"data-route":re?M.route:void 0,children:[(0,R.jsx)(eE,{size:`sm`,placement:`embedded`,fit:`fill`,density:`compact`,children:(0,R.jsxs)(`div`,{ref:d,className:`relative min-h-0 flex-1 overflow-hidden`,children:[(0,R.jsx)(`div`,{ref:f,className:`terminal-host absolute inset-0 overflow-hidden px-2 pt-1 pb-0.5${n?` opacity-0`:``}`,"aria-hidden":n?!0:void 0}),n?(0,R.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:n}):null,re&&!n&&M.busy?(0,R.jsx)(`div`,{className:`pointer-events-none absolute right-3 bottom-2`,children:(0,R.jsx)(LT,{"data-shell-busy":`true`,size:`sm`,tone:`primary`,label:`Running command`})}):null,re&&!n&&M.phase===`closed`?(0,R.jsx)(`div`,{className:`absolute bottom-2 left-2`,children:(0,R.jsx)(zT,{size:`sm`,variant:`accent`,onClick:()=>{j.current?.reopen(),p.current?.focus()},children:`Reopen shell`})}):null]})}),re?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{role:`log`,"aria-label":`Shell output`,className:`sr-only`,children:N.map(e=>(0,R.jsx)(`div`,{children:e.text},e.id))}),(0,R.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:M.routeLabel})]}):null,!n&&S===`failed`&&(0,R.jsx)(`div`,{className:`absolute inset-0 flex overflow-auto bg-base-200 p-4`,children:(0,R.jsx)(Mpe,{className:`m-auto max-w-[28rem]`,variant:`panel`,need:b?`Shed needs a Computer runtime`:`Terminal display could not start`,cause:b?l?`Open System Settings, then Computers, to set one up.`:`This Oyster could not start a terminal on its Computer, so commands have nowhere to run.`:`Reload Shed to retry.`,fix:{label:o?`Set up a Computer`:`Reopen terminal`,pending:s,onSelect:()=>{if(!o){T(e=>e+1);return}c(!0),u(!1),o().then(e=>{e===`unavailable`&&(c(!1),u(!0))},e=>{c(!1),console.error(`Shed runtime setup failed`,e)})}},secondary:b&&o?{label:`Reopen terminal`,onSelect:()=>{c(!1),T(e=>e+1)}}:void 0,waitingFor:`a Computer`})}),!n&&S===`closed`&&(0,R.jsxs)(`div`,{className:`absolute inset-0 grid content-center justify-items-center gap-2 bg-base-200 p-4 text-center`,children:[(0,R.jsx)(`p`,{className:`m-0 text-sm`,children:`Terminal session ended.`}),b&&(0,R.jsx)(zT,{className:`terminal-reopen`,size:`sm`,variant:`accent`,onClick:()=>{T(e=>e+1)},children:`Reopen terminal`})]})]})}Wx(`app.backend`,1,qo(()=>Gx({request:qx(Kx(to().transform(e=>cs(e))))})));var D4=Wx(`app.methods`,1,qo(()=>Gx({call:qx(Kx(to().transform(e=>cs(e))))}))),O4=uo({error:Co([`not_granted`,`revoked`,`grantor_lost_authority`,`unavailable`,`invalid`,`invalid_path`,`too_large`,`conflict`,`not_found`])}),k4=uo({error:To(`attachment_budget_exceeded`),kind:Co([`exec`,`write`]),retryAfterMs:qa().int().min(1).max(864e5)}),A4=uo({error:To(`timeout`),requestId:$2.shape.requestId});po([O4,k4,A4]);var BAe=G2.refine(e=>!e.split(`/`).includes(`..`),`Parent path segments are not allowed`),VAe=$ke({maximumTimeMs:45e3}).omit({requestId:!0,backend:!0}).extend({cwd:BAe.optional()}),j4=Gke+2,HAe=po([X2.pick({stdout:!0,stderr:!0,exitCode:!0}).extend({stdout:Ca().max(j4),stderr:Ca().max(j4),stdoutTruncated:Za(),stderrTruncated:Za()}).refine(e=>new TextEncoder().encode(e.stdout).byteLength<=j4&&new TextEncoder().encode(e.stderr).byteLength<=j4,`Command stream exceeds the native Computer output bound`),O4,k4,A4.pick({error:!0}),uo({error:To(`output_unavailable`)})]),UAe=`export FORCE_COLOR=1 CLICOLOR_FORCE=1 COLORTERM=truecolor TERM=xterm-256color; `;function WAe(e){return 79+e.length<=16384?`${UAe}${e}`:e}async function GAe(e,t,n){let r=Vke(t.command);if(r)return{stdout:``,stderr:`light: ${r.name} does not persist here yet; run \`full ${t.command}\` instead.\n`,exitCode:1,cwd:t.cwd,env:t.env};if(!e.has(D4))throw new n_(`Computer execution is not available`,{code:`CAPABILITY_DENIED`,retryable:!1});let i=VAe.parse({command:WAe(t.command),cwd:t.cwd}),a=await e.require(D4).call(`runCommand`,JSON.stringify(i));n.throwIfAborted();let o=HAe.parse(a);if(`error`in o&&o.error===`output_unavailable`)throw new n_(`The command produced no result`,{code:`DISCONNECTED`,retryable:!0});if(`error`in o)throw new n_(`The Computer declined this command: ${o.error}`,{code:`CAPABILITY_DENIED`,retryable:o.error===`unavailable`});return{stdout:o.stdout,stderr:o.stderr,exitCode:o.exitCode,cwd:t.cwd,env:t.env}}function KAe({app:e,computerId:t,screen:n,onStatusChange:r,openRuntimeSetup:i}){let[a,o]=(0,F.useState)(`starting`),[s,c]=(0,F.useState)(!1),l=(0,F.useCallback)(e=>{r?.({name:e.name,state:e.state}),c(e.information!==null),o(e.state)},[r]);return(0,R.jsx)(zAe,{app:e,computerId:t,screen:n??(!s&&a===`starting`?(0,R.jsx)(`div`,{className:`grid h-full min-h-0 flex-1 place-items-center`,children:(0,R.jsx)(LT,{size:`sm`,tone:`primary`,label:`Starting shell`})}):void 0),light:{runLight:(t,n)=>GAe(e.capabilities,t,n)},onStatusChange:l,openRuntimeSetup:i})}var qAe=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),M4=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),JAe={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},YAe=(0,F.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,F.createElement)(`svg`,{ref:c,...JAe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:M4(`lucide`,i),...s},[...o.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(a)?a:[a]])),N4=(e,t)=>{let n=(0,F.forwardRef)(({className:n,...r},i)=>(0,F.createElement)(YAe,{ref:i,iconNode:t,className:M4(`lucide-${qAe(e)}`,n),...r}));return n.displayName=`${e}`,n},P4=N4(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),XAe=N4(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),F4=N4(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ZAe=N4(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),QAe=N4(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),$Ae=N4(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),eje=N4(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),tje=N4(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),nje=N4(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),I4=N4(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),rje=N4(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),L4=N4(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ije={xs:`size-3`,sm:`size-[var(--stipe-icon-size-sm)]`,md:`size-[var(--stipe-icon-size-md)]`,lg:`size-[var(--stipe-icon-size-lg)]`},R4=(0,F.forwardRef)(function({active:e=!1,icon:t,iconSize:n=`xs`,className:r,reveal:i=!1,size:a=`xs`,tone:o=`default`,variant:s=`ghost`,...c},l){let u=a===`responsive`;return(0,R.jsx)(zT,{...c,resultLabel:c.result===void 0?void 0:null,ref:l,size:u?`sm`:a,variant:s,className:cC(`caps-icon-button btn-circle`,u&&`caps-icon-button-responsive md:btn-xs`,e&&`text-accent`,i&&`scale-0 transition-transform group-hover:scale-100 focus-visible:scale-100`,o===`destructive`&&`hover:text-error`,r),children:(0,R.jsx)(`span`,{"aria-hidden":`true`,className:cC(`inline-flex shrink-0 [&>svg]:size-full [&>svg]:[stroke-width:var(--stipe-icon-stroke)]`,ije[n]),children:t})})}),aje=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`div`,{...t,ref:n,className:cC(`caps-popover-anchor`,e)})}),oje=(0,F.forwardRef)(function({className:e,open:t,side:n=`top`,...r},i){return t?(0,R.jsx)(`div`,{...r,ref:i,className:cC(`caps-popover`,e),"data-side":n}):null});(0,F.forwardRef)(function({active:e,className:t,onMouseDown:n,...r},i){return(0,R.jsx)(`div`,{role:`option`,"aria-selected":e,...r,ref:i,className:cC(`caps-popover-option`,t),"data-active":e,onMouseDown:e=>{e.preventDefault(),n?.(e)}})});function sje({items:e,openId:t,onOpenChange:n,leading:r,trailing:i,renderTrigger:a,placement:o=`housing`,align:s=`end`,hostInset:c,className:l,...u}){let d=(0,F.useId)(),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(new Map),h=e.find(e=>e.id===t&&!e.disabled),g=h?.id,_=()=>{g&&m.current.get(g)?.focus(),n(null)};return(0,F.useEffect)(()=>{g&&p.current?.focus()},[g]),(0,F.useEffect)(()=>{c===void 0?f.current?.style.removeProperty(`--caps-status-tray-host-inset`):f.current?.style.setProperty(`--caps-status-tray-host-inset`,`${String(Math.max(0,c))}px`)},[c]),(0,F.useEffect)(()=>{if(!g)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),m.current.get(g)?.focus(),n(null))},t=e=>{e.target instanceof Node&&!f.current?.contains(e.target)&&n(null)};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[g,n]),(0,R.jsxs)(aje,{...u,ref:f,className:cC(`caps-status-tray`,l),"data-placement":o,"data-align":s,children:[h?(0,R.jsxs)(oje,{open:!0,ref:p,tabIndex:-1,side:`top`,id:`${d}-${h.id}`,role:`dialog`,"aria-labelledby":`${d}-title`,className:`caps-status-tray-panel`,"data-status-tray-panel":h.id,children:[(0,R.jsxs)(`div`,{className:`caps-status-tray-head`,children:[h.tone?(0,R.jsx)(QT,{size:`compact`,tone:h.tone,glyph:h.glyph??`dot`}):null,(0,R.jsx)(`span`,{id:`${d}-title`,className:`caps-status-tray-title`,children:h.title??h.label}),h.actions,(0,R.jsx)(R4,{"aria-label":`Close tray`,icon:(0,R.jsx)(L4,{"aria-hidden":`true`}),onClick:_})]}),(0,R.jsx)(`div`,{className:`caps-status-tray-body`,children:h.content})]}):null,o===`host`?null:(0,R.jsxs)(`div`,{className:`caps-status-tray-row`,children:[r,(0,R.jsx)(`div`,{className:`caps-status-tray-chips`,children:e.map(e=>{let r={ref:t=>{t?m.current.set(e.id,t):m.current.delete(e.id)},type:`button`,className:a?void 0:`caps-status-tray-chip`,"aria-expanded":g===e.id,"aria-controls":g===e.id?`${d}-${e.id}`:void 0,"aria-label":e.accessibleLabel,disabled:e.disabled,title:e.disabled?e.accessibleLabel:void 0,"aria-haspopup":`dialog`,"data-status-tray-chip":e.id,onClick:()=>{n(t===e.id?null:e.id)},children:(0,R.jsxs)(R.Fragment,{children:[e.tone?(0,R.jsx)(QT,{size:`compact`,glyph:e.glyph??`dot`,motion:e.motion??`none`,tone:e.tone}):null,(0,R.jsx)(`span`,{className:`caps-status-tray-label`,children:e.label}),e.count!==void 0&&e.count>0?(0,R.jsx)(`span`,{className:`caps-status-tray-count`,children:e.count}):null]})};return(0,R.jsxs)(F.Fragment,{children:[a?a(r):(0,R.jsx)(`button`,{...r}),e.after]},e.id)})}),i]})]})}function cje({children:e,className:t,...n}){return(0,R.jsx)(`div`,{...n,className:cC(`caps-status-tray-list`,t),children:e})}function z4({icon:e,primary:t,secondary:n,actions:r,className:i,...a}){return(0,R.jsxs)(`div`,{...a,className:cC(`caps-status-tray-item`,i),children:[e?(0,R.jsx)(`span`,{className:`caps-status-tray-icon`,children:e}):null,(0,R.jsxs)(`span`,{className:`caps-status-tray-text`,children:[(0,R.jsx)(`span`,{className:`caps-status-tray-primary`,children:t}),n?(0,R.jsx)(`span`,{className:`caps-status-tray-secondary`,children:n}):null]}),r?(0,R.jsx)(`span`,{className:`caps-status-tray-actions`,children:r}):null]})}function B4({children:e=`All caught up.`,title:t}){return(0,R.jsxs)(`div`,{className:`caps-status-tray-note`,children:[t?(0,R.jsx)(`strong`,{className:`caps-status-tray-note-title`,children:t}):null,(0,R.jsx)(`p`,{children:e})]})}function lje({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function V4(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var H4=[],U4=0,{link:W4,unlink:uje,propagate:dje,checkDirty:G4,shallowPropagate:K4}=lje({update(e){return e._update()},notify(e){H4[J4++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Q4(e))}}),q4=0,J4=0,Y4,X4=0;function Z4(e){try{++X4,e()}finally{--X4||$4()}}function Q4(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=uje(n,e)}function $4(){if(!(X4>0)){for(;q4<J4;){let e=H4[q4];H4[q4++]=void 0,e.notify()}q4=0,J4=0}}function e3(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return Y4!==void 0&&W4(i,Y4,U4),i._snapshot},subscribe(e){let t=V4(e),n={current:!1},r=fje(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Y4,o=t?.compare??Object.is;if(n)Y4=i,++U4,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Y4=a,n&&(i.flags&=-5),Q4(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&G4(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&K4(e)}}else e&32&&(i.flags=e&-33);return Y4!==void 0&&W4(i,Y4,U4),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(dje(e),K4(e),$4())}},i}function fje(e){let t=()=>{let t=Y4;Y4=n,++U4,n.depsTail=void 0,n.flags=6;try{return e()}finally{Y4=t,n.flags&=-5,Q4(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&G4(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Q4(this)}};return t(),n}var t3=class{constructor(e,t){this.atom=e3(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(V4(e))}},pje=class{constructor(e){this.atom=e3(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(V4(e))}};function n3(e,t){return typeof e==`function`?new pje(e):t?new t3(e,t):new t3(e)}var mje=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function hje(e,t){return new mje(e,t).maybeExecute}var gje=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},r3=new class extends gje{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function i3(e,t){return typeof e==`function`?e(t):e}function a3(e,t){return d3(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function o3(e,t,n){let r=d3(t);function i(e){if(!r.length)return i3(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function _je(e,t){let n=d3(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var s3=46,c3=91,l3=93,u3=48,vje=57;function d3(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===c3),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===s3||s===c3||s===l3){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==u3),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==l3&&(a!==-1||s!==l3)&&(a!==s||s!==s3&&s!==c3)&&n.push(``);r=o+1,i=!0}else(s<u3||s>vje)&&(i=!1);a=s}return n.length||n.push(``),n}function yje(e){return!(Array.isArray(e)&&e.length===0)}function f3(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function p3(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var m3=e=>!!e&&typeof e==`object`&&`fields`in e;function h3(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!h3(e[i],t[i]))return!1;return!0}var g3=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},_3=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function v3(e,t){return e==null?t:{...e,...t}}for(var y3=256,b3=[],x3;y3--;)b3[y3]=(y3+256).toString(16).substring(1);function S3(){let e=0,t,n=``;if(!x3||y3+16>256){for(x3=Array(256),e=256;e--;)x3[e]=256*Math.random()|0;e=0,y3=0}for(;e<16;e++)t=x3[y3+e],n+=e===6?b3[t&15|64]:e===8?b3[t&63|128]:b3[t],e&1&&e>1&&e<11&&(n+=`-`);return y3++,n}var bje=hje(e=>r3.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function C3(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=C3(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,C3(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(C3(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=C3(e[n]));return t}function w3(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var T3=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function xje(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var E3=(e,t)=>{let n=xje(e,t);return{form:n,fields:n}},D3={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:E3(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:E3(r.issues,e)}},O3=e=>!!e&&`~standard`in e,k3={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function A3(e){function t(t){let n=e.getFieldMeta(t)??k3;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>k3;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function j3(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var M3=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{bje(this)}),t=r3.on(`request-form-state`,e=>{e.payload.id===this._formId&&r3.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=r3.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=r3.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),r3.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return r3.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!h3(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!h3(e.defaultState,t.defaultState)&&!this.state.isTouched;if(!(!n&&!r)){if(Z4(()=>{this.baseStore.setState(()=>j3(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=A3(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}r3.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=o3(t,e.instance.name,e.instance.options.defaultValue))}),j3({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return Z4(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return Z4(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=f3(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||T3}),r=!1,i={};return Z4(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=N3(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=P3(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??k3,r=a?.[e],{newErrorValue:s,newSource:c}=g3({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=k3)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=P3(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=P3(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=p3(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||T3});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=P3(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=N3(r);s&&(i=i?{...i,...s}:s);let c=P3(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??k3,r=i?.[e],{newErrorValue:a,newSource:o}=g3({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=k3)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Z4(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}Z4(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),Z4(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>a3(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:i3(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=k3,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;Z4(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:o3(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t!==n&&t.startsWith(n)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=_je(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),A3(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],v3(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),A3(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),v3(r,{dontValidate:!0})),A3(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),v3(n,{dontValidate:!0})),A3(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return o3(o3(e,`${t}`,i),`${n}`,r)},v3(r,{dontValidate:!0})),A3(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},v3(r,{dontValidate:!0})),A3(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],v3(t,{dontValidate:!0})),A3(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=a3(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:k3},values:i===void 0?t.values:o3(t.values,e,i)}})},this.setErrorMap=e=>{Z4(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(m3(t)){let{formError:e,fieldErrors:r}=N3(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>D3.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>D3.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??S3(),this._devtoolsSubmissionOverride=!1;let t=j3({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(!(n===void 0||!m3(n)))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=n3(t);let n;this.fieldMetaDerived=n3(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=a3(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!yje(u),f=!o.isDirty,p=h3(l,this.getFieldInfo(a)?.instance?.options.defaultValue??a3(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=n3(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!w3(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&w3(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=n3(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&m3(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&h3(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return O3(e.validate)?D3[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function N3(e){return e?m3(e)?{formError:N3(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function P3(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var F3=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...k3,isTouched:e.fieldMetaBase[this.name]?.isTouched??k3.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??k3.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??k3.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(h3(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,v3(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,v3(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,v3(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,v3(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=f3(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||T3}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=f3(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;Z4(()=>{let e=(e,n)=>{let r=L3(n.cause),a=n.validate?I3(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=_3({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=L3(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=p3(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||T3}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=p3(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));Z4(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=L3(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=I3(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=_3({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),Z4(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>w3(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[L3(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[L3(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)a.get(t)&&!t.options.asyncAlways||c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>D3.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>D3.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)w3(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=n3(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...k3,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!h3(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return O3(e.validate)?D3[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function I3(e){if(e)return e}function L3(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function R3(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function Sje(e){return{...k3,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var z3=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??R3({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(h3(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...k3,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??R3({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;V3(t)&&(n=t.group,r=t.fields);let i=B3(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:R3({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,v3(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof F3&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&w3(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=g3({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=k3)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=f3(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||T3}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=f3(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;Z4(()=>{let t=(t,r)=>{let i=U3(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&V3(s)&&(c=s.group,l=s.fields);let u=B3(c),d=n[i],{newErrorValue:f,newSource:p}=_3({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=U3(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=p3(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||T3}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=p3(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=U3(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&V3(o)&&(l=o.group,u=o.fields);let d=B3(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=_3({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return Z4(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>w3(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[U3(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>w3(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Z4(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}Z4(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),Z4(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=n3(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??Sje(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!h3(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(O3(e.validate)){let t=D3[e.type](e.value,e.validate);return e.type===`validate`?H3(t):t.then(H3)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function B3(e){if(e)return e}function V3(e){return!!e&&typeof e==`object`&&`fields`in e}function H3(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function U3(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function Cje(e,t){if(!t)return;let n=Object.assign({},e,{state:C3(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return Z4(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var wje=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),W3=o(((e,t)=>{t.exports=wje()})),Tje=o((e=>{var t=u(),n=W3();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),G3=o(((e,t)=>{t.exports=Tje()}))();function Eje(e,t){return e===t}function K3(e,t=e=>e,n){let r=n?.compare??Eje,i=(0,F.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,F.useCallback)(()=>e.get(),[e]);return(0,G3.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var q3=typeof window<`u`?F.useLayoutEffect:F.useEffect;function J3(e){let[t,n]=(0,F.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,F.useState)(()=>new F3({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new F3({...e}),i(a),n({form:e.form,name:e.name}));let o=K3(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=K3(a.store,e=>e.meta.isTouched),c=K3(a.store,e=>e.meta.isBlurred),l=K3(a.store,e=>e.meta.isDirty),u=K3(a.store,e=>e.meta.errorMap),d=K3(a.store,e=>e.meta.errorSourceMap),f=K3(a.store,e=>e.meta.isValidating),p=(0,F.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return q3(a.mount,[a]),q3(()=>{a.update(e)}),p}var Dje=(({children:e,...t})=>{let n=J3(t),r=(0,F.useMemo)(()=>i3(e,n),[e,n]);return(0,R.jsx)(R.Fragment,{children:r})});function Oje(){return(0,F.useState)(()=>S3())[0]}var kje=F,Aje=`18.3.1`.split(`.`)[0]===`17`?Oje:kje.useId;function jje(e){let[t,n]=(0,F.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,F.useState)(()=>new z3({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new z3({...e})),n({form:e.form,name:e.name}));let a=K3(r.store,e=>e.value),o=K3(r.store,e=>e.meta.isTouched),s=K3(r.store,e=>e.meta.isBlurred),c=K3(r.store,e=>e.meta.isDirty),l=K3(r.store,e=>e.meta.errorMap),u=K3(r.store,e=>e.meta.errorSourceMap),d=K3(r.store,e=>e.meta.isValidating),f=K3(r.store,e=>e.meta.isSubmitting),p=K3(r.store,e=>e.meta.isSubmitted),m=K3(r.store,e=>e.meta.submissionAttempts),h=K3(r.store,e=>e.meta.isSubmitSuccessful),g=K3(r.store,e=>e.meta.canSubmit),_=K3(r.store,e=>e.meta.isValid),v=K3(r.store,e=>e.meta.isFieldsValid),y=K3(r.store,e=>e.meta.isFieldsValidating),b=K3(r.store,e=>e.meta.isGroupValid),x=(0,F.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return q3(r.mount,[r]),q3(()=>{r.update(e)}),x}var Mje=(({children:e,...t})=>{let n=jje(t),r=(0,F.useMemo)(()=>i3(e,n),[e,n]);return(0,R.jsx)(R.Fragment,{children:r})});function Nje({form:e,selector:t=e=>e,children:n}){let r=K3(e.store,t);return(0,R.jsx)(R.Fragment,{children:i3(n,r)})}function Pje(e){let t=Aje(),[n,r]=(0,F.useState)(e?.formId),[i,a]=(0,F.useState)(()=>new M3({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new M3({...e,formId:n})),r(n)}let o=(0,F.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,R.jsx)(Dje,{...e,form:i})},e.FormGroup=function(e){return(0,R.jsx)(Mje,{...e,form:i})},e.Subscribe=function(e){return(0,R.jsx)(Nje,{form:i,selector:e.selector,children:e.children})},e},[i]);q3(i.mount,[]),q3(()=>{i.update(e)});let s=(0,F.useRef)(!1);return q3(()=>{s.current&&e?.transform&&Cje(i,e.transform)},[i,e?.transform]),q3(()=>{s.current=!0}),o}var Fje=cg(vg),Ije=cg(L({message:vg}));function Lje(e){for(let t of e.errors){let e=Vu(nee(ree(Ije(t),e=>e.message),()=>Fje(t)));if(e!==void 0&&e.length>0)return e}}var Rje=(0,F.forwardRef)(function({children:e,className:t,optional:n,required:r,...i},a){return(0,R.jsxs)(`label`,{...i,className:cC(`label caps-label cursor-pointer justify-start gap-sm text-sm font-semibold text-base-content`,t),ref:a,children:[e,r?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`text-error`,children:`*`}):null,n&&!r?(0,R.jsx)(`span`,{className:`caps-label-optional`,children:`Optional`}):null]})}),Y3=(0,F.forwardRef)(function({children:e,className:t,...n},r){return(0,R.jsx)(`div`,{...n,className:cC(`caps-input-group join flex w-full items-stretch [&>*]:join-item [&>*:first-child]:rounded-e-none [&>*:last-child]:rounded-s-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>.btn]:shrink-0 [&>.input]:min-w-0 [&>.input]:flex-1 [&>.select]:min-w-0 [&>.select]:flex-1`,t),ref:r,children:F.Children.map(e,e=>(0,F.isValidElement)(e)?(0,F.cloneElement)(e,{className:cC(`join-item caps-input-group-control`,e.props.className)}):e)})}),X3=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`div`,{...t,className:cC(`join-item flex items-center border border-base-300 bg-base-200 px-md text-sm text-base-content`,e),ref:n})});function zje(e){let t=e.parentElement;if(!t||e.previousElementSibling===null)return 0;let n=getComputedStyle(t);if(!(n.display.includes(`grid`)||n.display.includes(`flex`)&&n.flexDirection.startsWith(`column`)))return 0;let r=Number.parseFloat(n.rowGap);return Number.isFinite(r)?r:0}(0,F.forwardRef)(function({show:e,appear:t=!1,children:n,className:r,...i},a){let o=(0,F.useRef)(null);(0,F.useImperativeHandle)(a,()=>o.current);let s=_C(),[c,l]=(0,F.useState)(e),u=(0,F.useRef)(!0);return e&&!c&&l(!0),(0,F.useLayoutEffect)(()=>{let n=o.current,r=u.current;if(u.current=!1,!n||r&&!t)return;if(!hC(n)){e||l(!1);return}let i=dC(n),a=`translateY(${String(i.distance)}px)`,c=mC(i,i.ease),d=n.getBoundingClientRect().height,f=zje(n),p=(e,t)=>{n.style.overflow=`clip`;let r=e=>({height:`${String(e)}px`,marginBlockStart:`${String(e===0?-f:0)}px`}),a=n.animate([r(e),r(t)],{duration:i.normal,easing:c}),o=()=>{n.style.removeProperty(`overflow`)};return a.addEventListener(`finish`,o),a.addEventListener(`cancel`,o),a};if(e){let e=[n.animate([{opacity:0,transform:a},{opacity:1,transform:`none`}],{duration:i.normal,easing:c})];return!s&&d>0&&e.push(p(0,d)),()=>{for(let t of e)t.cancel()}}let m=n.animate([{opacity:1,transform:`none`},{opacity:0,transform:a}],{duration:i.fast,easing:mC(i,i.easeExit),fill:`forwards`}),h=!s&&d>0?p(d,0):m;return h!==m&&h.effect?.updateTiming({fill:`forwards`}),h.addEventListener(`finish`,()=>{l(!1)}),()=>{m.cancel(),h.cancel()}},[e,t,s]),c?(0,R.jsx)(`div`,{...i,ref:o,className:cC(`caps-presence`,r),"data-present":e,"aria-hidden":!e||void 0,children:n}):null});var Bje=(0,F.forwardRef)(function({open:e,children:t,className:n,...r},i){return(0,R.jsx)(`div`,{...r,ref:i,className:cC(`caps-collapse`,n),"data-open":e,"aria-hidden":!e||void 0,children:(0,R.jsx)(`div`,{className:`caps-collapse-clip`,children:t})})});(0,F.forwardRef)(function({swapKey:e,anchor:t=`start`,children:n,className:r,...i},a){let o=(0,F.useRef)(null);(0,F.useImperativeHandle)(a,()=>o.current);let s=_C(),[c,l]=(0,F.useState)({key:e,content:n}),[u,d]=(0,F.useState)([]);c.key===e?c.content!==n&&l({key:e,content:n}):(d([...u.filter(t=>t.key!==e&&t.key!==c.key),c]),l({key:e,content:n}));let f=(0,F.useRef)(null);return(0,F.useLayoutEffect)(()=>{let e=o.current;if(!e||!(`ResizeObserver`in globalThis))return;f.current=e.getBoundingClientRect();let t=new ResizeObserver(()=>{e.getAnimations().length===0&&(f.current=e.getBoundingClientRect())});return t.observe(e),()=>{t.disconnect()}},[]),(0,F.useLayoutEffect)(()=>{let e=o.current;if(!e)return;let t=[...e.querySelectorAll(`:scope > [data-swap-leaving]`)],n=e.querySelector(`:scope > [data-swap-current]`);if(n===null||t.length===0)return;if(!hC(e)){d([]);return}let r=f.current,i=e.getBoundingClientRect(),a=dC(e),c=[n.animate([{opacity:0,filter:`blur(${String(a.blur)}px)`,transform:`translateY(${String(a.distance/2)}px)`},{opacity:1,filter:`blur(0px)`,transform:`none`}],{duration:a.normal,easing:mC(a,a.ease)})];for(let e of t){let t=e.animate([{opacity:1,filter:`blur(0px)`,transform:`none`},{opacity:0,filter:`blur(${String(a.blur)}px)`,transform:`translateY(${String(-a.distance/2)}px)`}],{duration:a.fast,easing:mC(a,a.easeExit),fill:`forwards`}),n=e.dataset.swapLeaving;t.onfinish=()=>{d(e=>e.filter(e=>e.key!==n))},c.push(t)}let l=r!==null&&(Math.abs(r.height-i.height)>.5||Math.abs(r.width-i.width)>.5);return!s&&l&&c.push(e.animate([{width:`${String(r.width)}px`,height:`${String(r.height)}px`},{width:`${String(i.width)}px`,height:`${String(i.height)}px`}],{duration:a.normal,easing:mC(a,a.ease)})),()=>{for(let e of c)e.cancel()}},[e,s]),(0,R.jsx)(`div`,{...i,ref:o,className:cC(`caps-swap`,r),"data-anchor":t,children:[...u.map(e=>(0,R.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-leaving":e.key,"aria-hidden":`true`,children:e.content},e.key)),(0,R.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-current":``,children:n},e)]})});function Z3({children:e,...t}){let[n,r]=(0,F.useState)(e);return e&&e!==n&&r(e),(0,R.jsx)(Bje,{...t,className:cC(`caps-field-error-reveal`,t.className),open:!!e,children:(0,R.jsx)(`div`,{className:`caps-field-error`,role:`alert`,"aria-hidden":!e,children:n})})}function Vje({children:e,divider:t=!0,error:n,layout:r=`end`,status:i,...a}){return(0,R.jsxs)(`footer`,{...a,className:cC(`caps-form-footer`,a.className),"data-divider":t,"data-layout":r,children:[(0,R.jsx)(Z3,{children:n}),(0,R.jsxs)(`div`,{className:`caps-form-footer-row`,children:[i?(0,R.jsx)(`div`,{className:`caps-form-footer-status`,role:`status`,children:i}):null,(0,R.jsx)(`div`,{className:`caps-form-footer-actions`,children:e})]})]})}var Hje=(0,F.forwardRef)(function({busy:e=!1,children:t,className:n,layout:r,...i},a){return(0,R.jsx)(`form`,{...i,"aria-busy":e||void 0,className:cC(`caps-form`,n),"data-layout":r,ref:a,children:(0,R.jsx)(`fieldset`,{className:`caps-form-body`,disabled:e,children:t})})}),Uje={2:`h2`,3:`h3`,4:`h4`},Wje=(0,F.forwardRef)(function({children:e,className:t,description:n,layout:r,level:i=3,title:a,...o},s){let c=(0,F.useId)(),l=Uje[i];return(0,R.jsxs)(`section`,{...o,"aria-labelledby":`${c}-title`,className:cC(`caps-form-section`,t),"data-layout":r,ref:s,children:[(0,R.jsxs)(`header`,{className:`caps-form-section-copy`,children:[(0,R.jsx)(l,{className:`caps-form-section-title`,id:`${c}-title`,children:a}),n?(0,R.jsx)(`p`,{className:`caps-form-section-description`,children:n}):null]}),(0,R.jsx)(`div`,{className:`caps-form-section-fields`,children:e})]})}),Q3=(0,F.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,layout:a,legend:o,legendTitle:s,...c},l){let u=(0,F.useId)(),d=[n?`${u}-description`:c[`aria-describedby`],r?`${u}-error`:null].filter(Boolean).join(` `)||void 0;return(0,R.jsxs)(`fieldset`,{...c,"aria-describedby":d,"aria-invalid":r?!0:c[`aria-invalid`],className:cC(`caps-fieldset`,t),"data-layout":a,ref:l,children:[(0,R.jsxs)(`legend`,{className:`caps-fieldset-legend`,title:s,children:[i?(0,R.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}):null,o]}),n?(0,R.jsx)(`p`,{className:`caps-fieldset-description`,id:`${u}-description`,children:n}):null,(0,R.jsx)(`div`,{className:`caps-fieldset-fields`,children:e}),r===void 0?null:(0,R.jsx)(Z3,{id:`${u}-error`,children:r})]})});function Gje(e){let t=[];return F.Children.forEach(e.props.children,e=>{(0,F.isValidElement)(e)&&e.type!==X3&&t.push(e)}),t[0]??null}var $3=(0,F.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,label:a,labelTitle:o,optional:s,orientation:c=`vertical`,readout:l=!1,required:u,...d},f){let p=(0,F.useId)(),m=(0,F.isValidElement)(e)?e:null,h=m?.type===Y3,g=h?Gje(m):m,_=g?.props.id??p,v=`${_}-description`,y=`${_}-error`,b=[g?.props[`aria-describedby`],n?v:null,r?y:null].filter(Boolean).join(` `)||void 0,x=u===!0||g?.props.required,S=r?!0:g?.props[`aria-invalid`],C=u===!0||g?.props[`aria-required`],w={id:_};x!==void 0&&(w.required=x),b!==void 0&&(w[`aria-describedby`]=b),S!==void 0&&(w[`aria-invalid`]=S),C!==void 0&&(w[`aria-required`]=C);let T=m&&g&&!l?h?(0,F.cloneElement)(m,void 0,F.Children.map(m.props.children,e=>e===g?(0,F.cloneElement)(g,w):e)):(0,F.cloneElement)(m,w):e,E=a?(0,R.jsx)(Rje,{htmlFor:l?void 0:_,title:o,className:c===`inline`?`font-normal`:void 0,...u===void 0?{}:{required:u},...s===void 0?{}:{optional:s},children:a}):null,D=a||n?(0,R.jsxs)(`div`,{className:`caps-field-copy`,children:[E,n?(0,R.jsx)(`p`,{className:`caps-field-description`,id:v,children:n}):null]}):null,O=i?(0,R.jsxs)(`div`,{className:`caps-field-lead`,children:[(0,R.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}),D]}):D;return(0,R.jsxs)(`div`,{...d,className:cC(`caps-field`,t),"data-orientation":c,ref:f,children:[c===`horizontal`?(0,R.jsxs)(`div`,{className:`caps-field-row`,children:[O,T]}):c===`inline`?(0,R.jsxs)(`div`,{className:`caps-field-row`,children:[T,O]}):(0,R.jsxs)(R.Fragment,{children:[O,T]}),(0,R.jsx)(Z3,{id:y,children:r})]})});function Kje(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}var e6=`M 9.86 38.14 A 20 20 0 1 1 38.14 38.14`,qje=6,Jje=new Map([[`ArrowUp`,1],[`ArrowDown`,-1],[`PageUp`,10],[`PageDown`,-10]]),Yje=(0,F.forwardRef)(function({className:e,decrementLabel:t=`Decrease`,defaultValue:n=null,disabled:r,incrementLabel:i=`Increase`,invalid:a,max:o,min:s,onBlur:c,onKeyDown:l,onValueChange:u,step:d=1,unit:f,value:p,wrap:m=!1,...h},g){let[_,v]=(0,F.useState)(n),[y,b]=(0,F.useState)(null),x=p===void 0?_:p,S=Kje(d),C=e=>{let t=Number(e.toFixed(S));return s!==void 0&&t<s?s:o!==void 0&&t>o?o:t},w=e=>{let t=e===null?null:C(e);v(t),b(null),t!==x&&u?.(t)},T=()=>{if(y===null)return;let e=Number(y);w(y.trim()===``||!Number.isFinite(e)?null:e)},E=e=>{let t=(x??s??0)+e*d;if(m&&s!==void 0&&o!==void 0){if(t>o){w(s);return}if(t<s){w(o);return}}w(t)},D=s!==void 0&&x!==null&&x<=s,O=o!==void 0&&x!==null&&x>=o,k=r===!0,A=(0,F.useRef)(null),j=s!==void 0&&o!==void 0&&o>s?((x??s)-s)/(o-s):null,M=e=>{k||(e.currentTarget.setPointerCapture(e.pointerId),A.current={y:e.clientY,value:x??s??0})},ee=e=>{if(!A.current)return;let t=Math.trunc((A.current.y-e.clientY)/qje),n=C(A.current.value+t*d);n!==x&&w(n)},N=()=>{A.current=null};return(0,R.jsxs)(`span`,{className:cC(`caps-number-field`,e),"data-at-max":O||void 0,"data-at-min":D||void 0,"data-disabled":k||void 0,"data-wrap":m||void 0,children:[j===null?null:(0,R.jsxs)(`svg`,{className:`caps-number-field-dial`,viewBox:`0 0 48 48`,"aria-hidden":`true`,focusable:`false`,onPointerDown:M,onPointerMove:ee,onPointerUp:N,onPointerCancel:N,children:[(0,R.jsx)(`path`,{className:`caps-number-field-dial-track`,d:e6,pathLength:100}),(0,R.jsx)(`path`,{className:`caps-number-field-dial-level`,d:e6,pathLength:100,strokeDasharray:`${String(Math.max(.5,j*100))} 100`})]}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-decrement`,"aria-label":t,"aria-controls":h.id,tabIndex:-1,disabled:k||D&&!m,onClick:()=>{E(-1)},children:(0,R.jsx)(tje,{"aria-hidden":`true`})}),(0,R.jsxs)(`span`,{className:`caps-number-field-readout`,children:[(0,R.jsx)(`input`,{...h,"aria-invalid":a?!0:h[`aria-invalid`]===!1?void 0:h[`aria-invalid`],className:`input caps-input caps-number-field-input`,disabled:r,inputMode:h.inputMode??(S>0?`decimal`:`numeric`),max:o,min:s,onBlur:e=>{T(),c?.(e)},onChange:e=>{b(e.target.value)},onKeyDown:e=>{if(l?.(e),e.defaultPrevented)return;let t=Jje.get(e.key);t===void 0?e.key===`Home`&&s!==void 0?(e.preventDefault(),w(s)):e.key===`End`&&o!==void 0?(e.preventDefault(),w(o)):e.key===`Enter`&&T():(e.preventDefault(),E(t))},ref:g,step:d,type:`number`,value:y??(x===null?``:String(x))}),f?(0,R.jsx)(`span`,{className:`caps-number-field-unit`,"aria-hidden":`true`,children:f}):null]}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-increment`,"aria-label":i,"aria-controls":h.id,tabIndex:-1,disabled:k||O&&!m,onClick:()=>{E(1)},children:(0,R.jsx)(nje,{"aria-hidden":`true`})})]})}),Xje={neutral:`progress-neutral`,primary:`progress-primary`,secondary:`progress-secondary`,accent:`progress-accent`,success:`progress-success`,info:`progress-info`,warning:`progress-warning`,error:`progress-error`},t6=(0,F.forwardRef)(function({className:e,tone:t=`primary`,...n},r){return(0,R.jsx)(`progress`,{...n,"data-complete":n.value!==void 0&&Number(n.value)>=Number(n.max??1)?`true`:void 0,className:cC(`progress caps-gooey-motion caps-gooey-progress w-full`,Xje[t],e),ref:r})});(0,F.forwardRef)(function({label:e,value:t,max:n,tone:r=`info`,className:i,...a},o){return(0,R.jsxs)(`div`,{...a,ref:o,className:cC(`caps-game-meter`,i),children:[(0,R.jsxs)(`div`,{className:`caps-game-meter-readout`,children:[(0,R.jsx)(`span`,{children:e}),(0,R.jsxs)(`span`,{className:`caps-game-meter-value`,children:[t,` / `,n]})]}),(0,R.jsx)(t6,{"aria-label":e,value:t,max:n,tone:r})]})});function Zje({className:e,items:t,onCancel:n,onRemove:r,onRetry:i,rowClassName:a}){return t.length?(0,R.jsx)(`div`,{"aria-live":`polite`,className:`caps-upload-queue flex w-full min-w-0 flex-col gap-sm ${e??``}`,"data-upload-rows":!0,children:t.map(e=>(0,R.jsx)($je,{item:e,onCancel:n,onRemove:r,onRetry:i,...a===void 0?{}:{rowClassName:a}},e.id))}):null}function n6({action:e,id:t,onAction:n,retry:r=!1}){return e?(0,R.jsx)(R4,{"aria-label":e.accessibleLabel,title:e.label,variant:`ghost`,size:`xs`,className:`motion-reduce:transition-none`,icon:r?(0,R.jsx)(rje,{}):(0,R.jsx)(L4,{}),onClick:()=>void n(t),type:`button`}):null}function Qje({item:e}){return(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block min-w-0 truncate`,title:e.name,children:e.name}),(0,R.jsx)(`div`,{className:`caps-upload-details`,children:(0,R.jsxs)(`span`,{"aria-live":e.alert?`assertive`:void 0,className:`caps-upload-status min-w-0 break-words`,"data-upload-status":!0,role:e.alert?`alert`:void 0,children:[e.alert??e.statusLabel,` `,e.progressLabel]})})]})}function $je({item:e,onCancel:t,onRemove:n,onRetry:r,rowClassName:i}){return(0,R.jsxs)(`div`,{className:`caps-upload-row grid w-full min-w-0 max-w-full grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-sm p-sm text-xs ${i??``}`,children:[e.preview.kind===`image`?(0,R.jsx)(`img`,{alt:``,className:`caps-upload-preview mask mask-squircle size-8 shrink-0 object-cover`,src:e.preview.url}):(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`caps-upload-preview mask mask-squircle flex size-8 shrink-0 items-center justify-center bg-base-300`,children:(0,R.jsx)(eje,{className:`size-4`})}),(0,R.jsx)(Qje,{item:e}),(0,R.jsx)(eMe,{actions:e.actions,id:e.id,onCancel:t,onRemove:n,onRetry:r}),(0,R.jsx)(t6,{"aria-label":`${e.name} progress`,className:`caps-upload-progress`,tone:e.alert?`error`:e.progress===100?`success`:`accent`,max:100,value:e.progress??(e.alert?0:void 0)})]})}function eMe({actions:e,id:t,onCancel:n,onRemove:r,onRetry:i}){return(0,R.jsxs)(`div`,{className:`caps-upload-actions flex min-w-0 flex-wrap justify-end gap-xs`,children:[(0,R.jsx)(n6,{action:e.retry,id:t,onAction:i,retry:!0}),(0,R.jsx)(n6,{action:e.cancel,id:t,onAction:n}),(0,R.jsx)(n6,{action:e.remove,id:t,onAction:r})]})}var r6={unchecked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,checked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,mixed:`M3.4 6 L6 6 L8.6 6`},tMe={blurStdDeviation:.22,alphaSlope:18,alphaIntercept:-8};function nMe({state:e}){let t=`caps-checkbox-${(0,F.useId)().replaceAll(`:`,``)}`,n=(0,F.useRef)(null),r=(0,F.useRef)(e).current,i=(0,F.useRef)(e),a=_C();return(0,F.useLayoutEffect)(()=>{if(!n.current)return;let t=e!==`unchecked`,r=i.current!==`unchecked`,o=a||i.current===e;i.current=e;let s=dC(n.current),c=qT(s,{ease:`inCubic`,duration:160}),l=TT(n.current,{d:{to:r6[e],...o?GT:qT(s,{ease:`outCubic`,duration:200})},"stroke-dashoffset":{to:+!t,...o?GT:t?qT(s,{ease:`inOutSine`,duration:260}):c},"stroke-width":o?{to:t?2.4:0,duration:0}:t&&!r?[{to:2.2,...qT(s,{ease:`outCubic`,duration:65})},{to:2.4,delay:pC(s,120),...KT(s,{bounce:.35,duration:220})}]:{to:t?2.4:0,...c}});return()=>{l.cancel()}},[e,a]),(0,R.jsxs)(`svg`,{className:`caps-checkbox-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,R.jsx)(kT,{id:`${t}-shadow`}),(0,R.jsx)(AT,{id:`${t}-inset`}),(0,R.jsx)(MT,{id:`${t}-goo`,values:tMe}),(0,R.jsxs)(`filter`,{id:`${t}-relief`,x:`-25%`,y:`-25%`,width:`150%`,height:`150%`,colorInterpolationFilters:`sRGB`,children:[(0,R.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.28`,result:`relief`}),(0,R.jsx)(`feSpecularLighting`,{in:`relief`,surfaceScale:`1.2`,specularConstant:`0.55`,specularExponent:`18`,lightingColor:`color-mix(in srgb, var(--color-white) calc(var(--depth) * 100%), var(--color-black))`,result:`light`,children:(0,R.jsx)(`feDistantLight`,{azimuth:`225`,elevation:`55`})}),(0,R.jsx)(`feComposite`,{in:`light`,in2:`SourceAlpha`,operator:`in`,result:`clipped-light`}),(0,R.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`clipped-light`,mode:`screen`})]}),(0,R.jsx)(`mask`,{id:`${t}-contour`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`12`,height:`12`,style:{maskType:`alpha`},children:(0,R.jsx)(`path`,{ref:n,d:r6[r],fill:`none`,stroke:`var(--color-white)`,strokeWidth:r===`unchecked`?0:2.4,pathLength:`1`,strokeDasharray:`1`,strokeDashoffset:+(r===`unchecked`),strokeLinecap:`round`,strokeLinejoin:`round`,filter:e===`mixed`?void 0:`url(#${t}-goo)`})}),(0,R.jsx)(`clipPath`,{id:`${t}-well`,children:(0,R.jsx)(`rect`,{x:`1`,y:`1`,width:`10`,height:`10`,rx:`2.5`})})]}),(0,R.jsx)(`rect`,{className:`caps-checkbox-track`,x:`0.5`,y:`0.5`,width:`11`,height:`11`,rx:`3`,filter:`url(#${t}-inset)`}),(0,R.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,R.jsx)(`g`,{filter:`url(#${t}-shadow)`,children:(0,R.jsx)(`g`,{filter:`url(#${t}-relief)`,children:(0,R.jsx)(`g`,{mask:`url(#${t}-contour)`,children:(0,R.jsx)(`rect`,{x:`0`,y:`0`,width:`12`,height:`12`,fill:`url(#${t}-surface)`})})})})})]})}var i6=(0,F.forwardRef)(function({className:e,appearance:t,indicator:n,invalid:r,indeterminate:i=!1,checked:a,defaultChecked:o=!1,onChange:s,...c},l){let u=(0,F.useRef)(null),[d,f]=(0,F.useState)(o),p=a??d,m=i?`mixed`:p?`checked`:`unchecked`;return(0,F.useImperativeHandle)(l,()=>{if(!u.current)throw Error(`Checkbox input is not mounted`);return u.current},[]),(0,F.useLayoutEffect)(()=>{u.current&&(u.current.indeterminate=i)},[i]),(0,F.useEffect)(()=>{let e=u.current?.form;if(!e||a!==void 0)return;let t=e=>{queueMicrotask(()=>{!e.defaultPrevented&&u.current&&f(o)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[a,o,c.form]),(0,R.jsxs)(`span`,{className:`caps-checkbox`,"data-appearance":t===`compact`?t:void 0,"data-state":m,"data-custom-indicator":n!==void 0||void 0,children:[(0,R.jsx)(`input`,{...c,checked:p,"aria-checked":i?`mixed`:p,"aria-invalid":r?!0:c[`aria-invalid`]===!1?void 0:c[`aria-invalid`],className:cC(`caps-checkbox-input`,e),onChange:e=>{a===void 0&&f(e.target.checked),s?.(e),e.currentTarget.indeterminate=i},ref:u,type:`checkbox`}),n===void 0?(0,R.jsx)(nMe,{state:m}):n]})}),rMe=Ile({keyCode:Rle(229)});function iMe(e){return e.nativeEvent.isComposing||Ae(rMe,e.nativeEvent).success}var a6={};function o6(e,t){let n=F.useRef(a6);return n.current===a6&&(n.current=e(t)),n}var s6=[],c6=void 0;function aMe(){return c6}function oMe(e){s6.push(e)}function l6(e){let t=(t,n)=>{let r=o6(cMe).current,i;try{c6=r;for(let e of s6)e.before(r);i=e(t,n);for(let e of s6)e.after(r);r.didInitialize=!0}finally{c6=void 0}return i};return t.displayName=e.displayName||e.name,t}function sMe(e){return F.forwardRef(l6(e))}function cMe(){return{didInitialize:!1}}function u6(){}var lMe=Object.freeze([]),d6=Object.freeze({});function f6(e){F.useEffect(e,lMe)}var p6=0,m6=class e{static create(){return new e}currentId=p6;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=p6,t()},e)}isStarted(){return this.currentId!==p6}clear=()=>{this.currentId!==p6&&(clearTimeout(this.currentId),this.currentId=p6)};disposeEffect=()=>this.clear};function h6(){let e=o6(m6.create).current;return f6(e.disposeEffect),e}var g6=typeof document<`u`?F.useLayoutEffect:()=>{};function uMe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:dMe,platform:fMe,maxTouchPoints:pMe}=uMe(),_6=dMe.toLowerCase(),v6=fMe.toLowerCase(),y6=/^i(os$|p)/.test(v6)||v6===`macintel`&&pMe>1,b6=`android`,x6=v6===b6||_6.includes(b6),mMe=!y6&&v6.startsWith(`mac`);v6.startsWith(`win`),!x6&&/^(linux|chrome os)/.test(v6);var hMe=mMe||y6,S6=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!S6&&_6.includes(`firefox`),!S6&&_6.includes(`chrom`);var gMe=hMe,_Me=/jsdom|happydom/.test(_6);function vMe(e){e.preventDefault(),e.stopPropagation()}function yMe(e){return`nativeEvent`in e}function C6(e){return e.pointerType===``&&e.isTrusted?!0:x6&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function w6(e){return _Me?!1:!x6&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(x6||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function T6(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function bMe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function E6(){return typeof window<`u`}function D6(e){return A6(e)?(e.nodeName||``).toLowerCase():`#document`}function O6(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function k6(e){return((A6(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function A6(e){return E6()?e instanceof Node||e instanceof O6(e).Node:!1}function j6(e){return E6()?e instanceof Element||e instanceof O6(e).Element:!1}function M6(e){return E6()?e instanceof HTMLElement||e instanceof O6(e).HTMLElement:!1}function N6(e){return!E6()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof O6(e).ShadowRoot}function P6(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=V6(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xMe(e){return/^(table|td|th)$/.test(D6(e))}function F6(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var SMe=/transform|translate|scale|rotate|perspective|filter/,CMe=/paint|layout|strict|content/,I6=e=>!!e&&e!==`none`,L6;function R6(e){let t=j6(e)?V6(e):e;return I6(t.transform)||I6(t.translate)||I6(t.scale)||I6(t.rotate)||I6(t.perspective)||!z6()&&(I6(t.backdropFilter)||I6(t.filter))||SMe.test(t.willChange||``)||CMe.test(t.contain||``)}function wMe(e){let t=U6(e);for(;M6(t)&&!B6(t);){if(R6(t))return t;if(F6(t))return null;t=U6(t)}return null}function z6(){return L6??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),L6}function B6(e){return/^(html|body|#document)$/.test(D6(e))}function V6(e){return O6(e).getComputedStyle(e)}function H6(e){return j6(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function U6(e){if(D6(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||N6(e)&&e.host||k6(e);return N6(t)?t.host:t}function W6(e){let t=U6(e);return B6(t)?(e.ownerDocument||e).body:M6(t)&&P6(t)?t:W6(t)}function G6(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=W6(e),i=r===e.ownerDocument?.body,a=O6(r);if(i){let e=K6(a);return t.concat(a,a.visualViewport||[],P6(r)?r:[],e&&n?G6(e):[])}return t.concat(r,G6(r,[],n))}function K6(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q6(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function J6(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&N6(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Y6(e,t){let n=e;for(;n;){if(j6(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(N6(n)?n.host:null)}return null}function X6(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var TMe=`data-base-ui-focusable`,EMe=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Z6=`data-starting-style`,DMe=`data-ending-style`,OMe={[Z6]:``},kMe={[DMe]:``},AMe={transitionStatus(e){return e===`starting`?OMe:e===`ending`?kMe:null}},jMe=`data-open`,MMe=`data-closed`,NMe=`data-anchor-hidden`,Q6=`data-popup-open`,PMe=`data-pressed`,FMe={[Q6]:``},IMe={[Q6]:``,[PMe]:``},LMe={[jMe]:``},RMe={[MMe]:``},zMe={[NMe]:``},BMe={open(e){return e?FMe:null}},VMe={open(e){return e?IMe:null}},$6={open(e){return e?LMe:RMe},anchorHidden(e){return e?zMe:null}},HMe={...$6,...AMe},e8=`data-trigger-disabled`;function t8(e,t){if(!j6(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(e8);for(let[,e]of t.entries())if(J6(e,n))return!e.hasAttribute(e8);return!1}function n8(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function UMe(e){return e.matches(`html,body`)}function r8(e){return M6(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function WMe(e){return Y6(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${EMe}`)!=null}function i8(e){return e?e.getAttribute(`role`)===`combobox`&&r8(e):!1}function a8(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function GMe(e,t){return t!=null&&!T6(t)?0:typeof e==`function`?e():e}function o8(e,t,n){let r=GMe(e,n);return typeof r==`number`?r:r?.[t]}function s8(e){return typeof e==`function`?e():e}function c8(e,t){return t||e===`click`||e===`mousedown`}function KMe(e){return e?.includes(`mouse`)&&e!==`mousedown`}function l8(e,t,n,r){let i=!1,a=!1,o=r??d6;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var qMe=`none`,u8=`trigger-press`,d8=`trigger-hover`,JMe=`outside-press`,f8=`focus-out`,YMe=`escape-key`,XMe=`imperative-action`;function p8(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function m8(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function h8(e,t,n,r){let i=o6(g8).current;return QMe(i,e,t,n,r)&&_8(i,[e,t,n,r]),i.callback}function ZMe(e){let t=o6(g8).current;return $Me(t,e)&&_8(t,e),t.callback}function g8(){return{callback:null,cleanup:null,refs:[]}}function QMe(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function $Me(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function _8(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function v8(e){let t=o6(eNe,e).current;return t.next=e,g6(t.effect),t}function eNe(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var y8={...F},b8=y8.useInsertionEffect,tNe=b8&&b8!==y8.useLayoutEffect?b8:e=>e();function x8(e){let t=o6(nNe).current;return t.next=e,tNe(t.effect),t.trampoline}function nNe(){let e={next:void 0,callback:rNe,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function rNe(){}var S8=null;globalThis.requestAnimationFrame;var C8=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},w8=class e{static create(){return new e}static request(e){return C8.request(e)}static cancel(e){return C8.cancel(e)}currentId=S8;request(e){this.cancel(),this.currentId=C8.request(()=>{this.currentId=S8,e()})}cancel=()=>{this.currentId!==S8&&(C8.cancel(this.currentId),this.currentId=S8)};disposeEffect=()=>this.cancel};function T8(){let e=o6(w8.create).current;return f6(e.disposeEffect),e}function E8(e){return e?.ownerDocument||document}var D8={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},iNe={...D8,position:`fixed`,margin:0,top:0,left:0};({...D8});var O8=F.forwardRef(function(e,t){let[n,r]=F.useState();g6(()=>{gMe&&S6&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,R.jsx)(`span`,{...e,ref:t,style:iNe,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),k8=Math.min,A8=Math.max,j8=Math.round,M8=Math.floor,N8=e=>({x:e,y:e}),aNe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function P8(e,t,n){return A8(e,k8(t,n))}function F8(e,t){return typeof e==`function`?e(t):e}function I8(e){return e.split(`-`)[0]}function L8(e){return e.split(`-`)[1]}function R8(e){return e===`x`?`y`:`x`}function z8(e){return e===`y`?`height`:`width`}function B8(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function V8(e){return R8(B8(e))}function oNe(e,t,n){n===void 0&&(n=!1);let r=L8(e),i=V8(e),a=z8(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=G8(o)),[o,G8(o)]}function sNe(e){let t=G8(e);return[H8(e),t,H8(t)]}function H8(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var U8=[`left`,`right`],W8=[`right`,`left`],cNe=[`top`,`bottom`],lNe=[`bottom`,`top`];function uNe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?W8:U8:t?U8:W8;case`left`:case`right`:return t?cNe:lNe;default:return[]}}function dNe(e,t,n,r){let i=L8(e),a=uNe(I8(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(H8)))),a}function G8(e){let t=I8(e);return aNe[t]+e.slice(t.length)}function fNe(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function K8(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:fNe(e)}function q8(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 pNe(e){return e.visibility===`hidden`||e.visibility===`collapse`}function J8(e,t=e?V6(e):null){return!e||!e.isConnected||!t||pNe(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var mNe=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function hNe(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return N6(n)?n.host:null}function Y8(e){for(let t of Array.from(e.children))if(D6(t)===`summary`)return t;return null}function gNe(e,t){let n=Y8(t);return!!n&&(e===n||J6(n,e))}function X8(e){let t=e?D6(e):``;return e!=null&&e.matches(mNe)&&(t!==`summary`||e.parentElement!=null&&D6(e.parentElement)===`details`&&Y8(e.parentElement)===e)&&(t!==`details`||Y8(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Z8(e){if(!X8(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=hNe(t)){let n=t!==e,r=D6(t)===`slot`;if(t.hasAttribute(`inert`)||n&&D6(t)===`details`&&!t.open&&!gNe(e,t)||t.hasAttribute(`hidden`)||!r&&!_Ne(t,n))return!1}return!0}function _Ne(e,t){let n=V6(e);return t?n.display!==`none`:J8(e,n)}function Q8(e){let t=e.tabIndex;if(t<0){let t=D6(e);if(t===`details`||t===`audio`||t===`video`||M6(e)&&e.isContentEditable)return 0}return t}function $8(e){if(D6(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function e5(e,t){let n=$8(e);if(!n)return!0;let r=t.find(e=>{let t=$8(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=$8(e);return t?.name===n.name&&t.form===n.form})===n}function t5(e){if(M6(e)&&D6(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return M6(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function n5(e,t){t5(e).forEach(e=>{X8(e)&&t.push(e),n5(e,t)})}function r5(e,t,n){t5(e).forEach(e=>{M6(e)&&e.matches(t)&&n.push(e),r5(e,t,n)})}function i5(e){return Z8(e)&&Q8(e)>=0}function a5(e){let t=[];return n5(e,t),t.filter(Z8)}function o5(e){let t=a5(e);return t.filter(e=>Q8(e)>=0&&e5(e,t))}function s5(e,t){let n=o5(e),r=n.length;if(r===0)return;let i=q6(E8(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function c5(e){return s5(E8(e).body,1)||e}function l5(e){return s5(E8(e).body,-1)||e}function vNe(e,t,n){if(!e)return null;let r=[];n5(E8(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Z8);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!J6(n,o)&&i5(o)&&e5(o,a))return o}return r[i]}function u5(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!J6(n,r)}function yNe(e){o5(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function d5(e){let t=[];r5(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function f5(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...f5(e,t.id,n)])}function p5(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function m5(e){return`data-base-ui-${e}`}var h5=0;function g5(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(h5);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),u6;let o=requestAnimationFrame(a);return h5=o,()=>{h5===o&&(cancelAnimationFrame(o),h5=0)}}var _5=`data-base-ui-inert`,v5=new WeakMap,y5=new WeakSet,b5=new WeakMap,x5=0;function S5(e){return e?N6(e)?e.host:S5(e.parentNode):null}var C5=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=S5(t);return e.contains(n)?n:null}).filter(e=>e!=null),w5=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},T5=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{D6(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function bNe(e,t,n,{mark:r=!0}){let i=C5(t,e),a=r?T5(t,w5(i),new Set(i)):[],o=[],s=[];if(n){let e=C5(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);T5(t,w5(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(v5.get(e)||0)+1;v5.set(e,r),o.push(e),r===1&&n&&y5.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(b5.get(e)||0)+1;b5.set(e,t),s.push(e),t===1&&e.setAttribute(_5,``)}),x5+=1,()=>{o.forEach(e=>{let t=(v5.get(e)||0)-1;v5.set(e,t),t||(y5.has(e)||e.removeAttribute(`aria-hidden`),y5.delete(e))}),r&&s.forEach(e=>{let t=(b5.get(e)||0)-1;b5.set(e,t),t||e.removeAttribute(_5)}),--x5,x5||(v5=new WeakMap,y5=new WeakSet,b5=new WeakMap)}}function E5(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=E8(e[0]).body;return bNe(e,i,n,{mark:r})}function D5(){let[,e]=F.useState({});return F.useCallback(()=>{e({})},[])}var O5=0;function xNe(e,t=`mui`){let n=F.useRef(void 0),r=D5(),i=e??n.current;return F.useEffect(()=>{n.current??(O5+=1,n.current=`${t}-${O5}`,e??r())},[e,t,r]),i}var k5=y8.useId;function A5(e,t){if(k5!==void 0){let n=k5();return e??(t?`${t}-${n}`:n)}return xNe(e,t)}var SNe=18;function j5(e){return SNe>=e}function M5(e){if(!F.isValidElement(e))return null;let t=e,n=t.props;return(j5(19)?n?.ref:t.ref)??null}function N5(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function CNe(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function wNe(e,t){return typeof e==`function`?e(t):e}function TNe(e,t){return typeof e==`function`?e(t):e}var P5={};function F5(e,t,n,r,i){if(!n&&!r&&!i&&!e)return I5(t);let a=I5(e);return t&&(a=L5(a,t)),n&&(a=L5(a,n)),r&&(a=L5(a,r)),i&&(a=L5(a,i)),a}function ENe(e){if(e.length===0)return P5;if(e.length===1)return I5(e[0]);let t=I5(e[0]);for(let n=1;n<e.length;n+=1)t=L5(t,e[n]);return t}function I5(e){return z5(e)?{...e(P5)}:DNe(e)}function L5(e,t){return z5(t)?t(e):ONe(e,t)}function DNe(e){let t={...e};for(let e in t){let n=t[e];R5(e,n)&&(t[e]=B5(n))}return t}function ONe(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=N5(e.style,r);break;case`className`:e[n]=H5(e.className,r);break;default:e[n]=R5(n,r)?kNe(e[n],r):r}}return e}function R5(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function z5(e){return typeof e==`function`}function kNe(e,t){return t?e?(...n)=>{let r=n[0];if(U5(r)){let i=r;V5(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:B5(t):e}function B5(e){return e&&((...t)=>{let n=t[0];return U5(n)&&V5(n),e(...t)})}function V5(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function H5(e,t){return t?e?t+` `+e:t:e}function U5(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function W5(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=NNe(r));let i=ANe(t,n,r);if(n.enabled===!1)return null;let a=n.state??d6;return PNe(e,r,i,a)}function ANe(e,t,n){let{className:r,style:i}=e,{state:a=d6,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?wNe(r,a):void 0,d=l?TNe(i,a):void 0,f=l?CNe(a,c):d6,p=l&&s?jNe(s):void 0,m=l?N5(f,p)??{}:d6;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ZMe([m.ref,M5(n),...o]):h8(m.ref,M5(n),o):h8(null,null)),l?(u!==void 0&&(m.className=H5(m.className,u)),d!==void 0&&(m.style=N5(m.style,d)),m):d6}function jNe(e){return Array.isArray(e)?ENe(e):F5(void 0,e)}var MNe=Symbol.for(`react.lazy`);function NNe(e){if(e?.$$typeof!==MNe)return e;let t=F.Children.toArray(e)[0];return F.isValidElement(t)?t:e}function PNe(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=F5(n,t.props);return e.ref=n.ref,F.cloneElement(t,e)}return FNe(e,n)}function FNe(e,t){return e===`button`?(0,F.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,F.createElement)(`img`,{alt:``,...t,key:t.key}):F.createElement(e,t)}var INe={style:{transition:`none`}},LNe=`data-base-ui-click-trigger`,RNe={fallbackAxisSide:`end`},zNe={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},G5=c(nv(),1),K5=F.createContext(null),q5=()=>F.useContext(K5),BNe=m5(`portal`);function VNe(e={}){let{ref:t,container:n,componentProps:r=d6,elementProps:i}=e,a=A5(),o=q5()?.portalNode,[s,c]=F.useState(null),[l,u]=F.useState(null),d=x8(e=>{e!==null&&u(e)}),f=F.useRef(null);g6(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(A6(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=W5(`div`,r,{ref:[t,d],props:[{id:a,[BNe]:``},i]}),m=s&&p?G5.createPortal(p,s):null;return{node:l,nodeId:F.isValidElement(p)?p.props.id:void 0,subtree:m}}var HNe=F.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=VNe({container:o,ref:t,componentProps:e,elementProps:c}),f=F.useRef(null),p=F.useRef(null),m=F.useRef(null),h=F.useRef(null),[g,_]=F.useState(null),v=F.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;F.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&u5(e)&&(e.type===`focusin`?v.current&&=(d5(l),!1):(yNe(l),v.current=!0))}return m8(p8(l,`focusin`,e,!0),p8(l,`focusout`,e,!0))},[l,y]),g6(()=>{!l||b!==!0||!v.current||(d5(l),v.current=!1)},[b,l]);let S=F.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,R.jsxs)(F.Fragment,{children:[d,(0,R.jsxs)(K5.Provider,{value:S,children:[x&&l&&(0,R.jsx)(O8,{"data-type":`outside`,ref:f,onFocus:e=>{u5(e,l)?m.current?.focus():l5(g?g.domReference:null)?.focus()}}),x&&l&&(0,R.jsx)(`span`,{role:s,"aria-owns":u,style:zNe}),l&&G5.createPortal(a,l),x&&l&&(0,R.jsx)(O8,{"data-type":`outside`,ref:p,onFocus:e=>{u5(e,l)?h.current?.focus():(c5(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,l8(`focus-out`,e.nativeEvent)))}})]})]})});function J5(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var UNe=class{nodesRef={current:[]};events=J5();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Y5=F.createContext(null),X5=F.createContext(null),Z5=()=>F.useContext(Y5)?.id||null,Q5=e=>{let t=F.useContext(X5);return e??t};function WNe(e){let t=A5(),n=Q5(e),r=Z5();return g6(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function GNe(e){let{children:t,id:n}=e,r=Z5();return(0,R.jsx)(Y5.Provider,{value:F.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function KNe(e){let{children:t,externalTree:n}=e,r=o6(()=>n??new UNe).current;return(0,R.jsx)(X5.Provider,{value:r,children:t})}function $5(e){return e==null?e:`current`in e?e.current:e}function qNe(e,t){let n=O6(X6(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(C6(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var JNe=20,e7=[];function t7(){e7=e7.filter(e=>e.deref()?.isConnected)}function n7(e){t7(),e&&D6(e)!==`body`&&(e7.push(new WeakRef(e)),e7.length>JNe&&(e7=e7.slice(-20)))}function r7(){return t7(),e7[e7.length-1]?.deref()}function YNe(e){return e?i5(e)?e:o5(e)[0]||e:null}function i7(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=a5(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return i5(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function XNe(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=x8(()=>b.current.floatingContext?.nodeId),S=i===!1,C=i8(_)&&S,w=v8(i),T=v8(a),E=v8(o),D=v8(u),O=v8(g),k=Q5(m),A=q5(),j=F.useRef(!1),M=F.useRef(!1),ee=F.useRef(!1),N=F.useRef(null),te=F.useRef(``),ne=F.useRef(``),re=F.useRef(null),P=F.useRef(null),ie=h8(re,p,A?.beforeInsideRef),ae=h8(P,A?.afterInsideRef),oe=h6(),se=h6(),ce=T8(),le=A!=null,ue=a8(v),de=x8((e=ue)=>e?o5(e):[]),fe=x8(()=>h?.().filter(e=>e!=null)??[]);F.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&J6(ue,q6(E8(ue)))&&de().length===0&&!C&&vMe(e)}return p8(E8(ue),`keydown`,e)},[r,ue,c,C,de]),F.useEffect(()=>{if(r||!g)return;let e=E8(ue);function t(){ee.current=!1}function n(e){let t=X6(e),n=fe(),r=J6(v,t)||J6(_,t)||J6(A?.portalNode,t)||n.some(e=>e===t||J6(e,t));ee.current=!r,ne.current=e.pointerType||`keyboard`,Y6(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,se.start(0,()=>{M.current=!1}))}function i(){ne.current=`keyboard`}return m8(p8(e,`pointerdown`,n,!0),p8(e,`pointerup`,t,!0),p8(e,`pointercancel`,t,!0),p8(e,`keydown`,i,!0),t)},[r,v,_,ue,g,A,se,fe]),F.useEffect(()=>{if(r||!l)return;let e=E8(ue);function n(){M.current=!0,se.start(0,()=>{M.current=!1})}function i(e){let t=X6(e);i5(t)&&(N.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=X6(n);c&&r==null&&a!=null&&J6(v,a)&&n7(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=fe(),p=r?.hasAttribute(m5(`focus-guard`))&&[re.current,P.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,$5(f),$5(d)].includes(r),m=!(J6(_,r)||J6(v,r)||J6(r,v)||J6(A?.portalNode,r)||u.some(e=>e===r||J6(e,r))||l.hasMatchingElement(e=>J6(e,r))||p||k&&(f5(k.nodesRef.current,o).find(e=>J6(e.context?.elements.floating,r)||J6(e.context?.elements.domReference,r))||p5(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,a8(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&ue&&i7(ue),s&&i!==_&&!J8(a)&&q6(e)===e.body){if(M6(ue)&&(ue.focus(),s===`popup`)){ce.request(()=>{ue.focus()});return}let e=de(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ue;M6(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!c)&&r&&m&&!M.current&&(C||r!==r7())&&(j.current=!0,t.setOpen(!1,l8(f8,n)))})}function o(){ee.current||(b.current.insideReactTree=!0,oe.start(0,()=>{b.current.insideReactTree=!1}))}let u=M6(_)?_:null;if(!(!v&&!u))return m8(u&&p8(u,`focusout`,a),u&&p8(u,`pointerdown`,n),v&&p8(v,`focusin`,i),v&&p8(v,`focusout`,a),v&&A&&p8(v,`focusout`,o,!0))},[r,_,v,ue,c,k,A,t,l,s,de,C,x,b,oe,se,ce,d,f,fe]),F.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${m5(`portal`)}]`)||[]),t=(k?p5(k.nodesRef.current,x()):[]).find(e=>i8(e.context?.elements.domReference||null))?.context?.elements.domReference,n=E5([v,...e,re.current,P.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...fe(),t,$5(f),$5(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=E5([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,fe]),g6(()=>{if(!g||r||!M6(ue))return;te.current=``,ne.current=``;let e=E8(ue),t=q6(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||J6(ue,t))return;let i=null,a=()=>(i??=de(ue),i[0]||ue),o;o=r===!0||r===null?a():$5(r),o||=a();let s=J6(ue,q6(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&C6(c);g5(o,{sync:l,preventScroll:o===ue,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=q6(e);return!(t!==o&&J6(ue,t))}})})},[r,g,ue,de,w,D,O,b]);let pe=F.useRef(null);g6(()=>{if(r||!ue){pe.current=null;return}pe.current&&=(pe.current.cancelled=!0,null);let e=E8(ue),t=q6(e),n=D.current==null;n7(t);function i(e){if(e.open||(te.current=qNe(e.nativeEvent,ne.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(m5(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(C6(e.nativeEvent)||w6(e.nativeEvent))j.current=!1;else{let e=!1;E8(ue).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&D6(t)!==`body`?t:null,s=n?o||a:a||o;return s||=r7()||null,typeof i==`boolean`?s:$5(i)||s||null}return()=>{y.off(`openchange`,i);let t=q6(e),n=fe(),r=J6(v,t)||n.some(e=>e===t||J6(e,t))||k&&f5(k.nodesRef.current,x(),!1).some(e=>J6(e.context?.elements.floating,t)),o=T.current,s=te.current,c=a(s),l={cancelled:!1};pe.current=l,queueMicrotask(()=>{pe.current===l&&(pe.current=null);let n=YNe(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&M6(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,ue,T,E,D,y,k,_,x,fe]),g6(()=>{if(!S6||g||!v)return;let e=q6(E8(v));!M6(e)||!r8(e)||J6(v,e)&&e.blur()},[g,v]),g6(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),g6(()=>{if(!(r||!ue))return i7(ue),()=>{queueMicrotask(t7)}},[r,ue]);let me=!r&&(!c||!C)&&(le||c);return(0,R.jsxs)(F.Fragment,{children:[me&&(0,R.jsx)(O8,{"data-type":`inside`,ref:ie,onFocus:e=>{if(c){let e=de();g5(e[e.length-1])}else A?.portalNode&&(j.current=!1,u5(e,A.portalNode)?c5(_)?.focus():$5(f??A.beforeOutsideRef)?.focus())}}),n,me&&(0,R.jsx)(O8,{"data-type":`inside`,ref:ae,onFocus:e=>{c?g5(de()[0]):A?.portalNode&&(l&&(j.current=!0),u5(e,A.portalNode)?l5(_)?.focus():$5(d??A.afterOutsideRef)?.focus())}})]})}function ZNe(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=u8}=t,l=e.context.dataRef,u=F.useRef(void 0),d=T8(),f=h6(),p=F.useMemo(()=>{function t(t,n,r,i){let a=l8(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=T6(e.pointerType,!0)&&w6(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||T6(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=X6(s),p=r8(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;if(r===`mousedown`&&o){u.current=void 0;return}T6(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return F.useMemo(()=>n?{reference:p}:d6,[n,p])}function QNe(){return!1}function $Ne(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ePe(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=QNe,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Q5(c),m=x8(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=x8(()=>a),{escapeKey:v,outsidePress:y}=$Ne(s),b=F.useRef(!1),x=F.useRef(!1),S=F.useRef(!1),C=F.useRef(!1),w=F.useRef(!1),T=F.useRef(``),E=F.useRef(null),D=h6(),O=h6(),k=h6(),A=x8(()=>{O.clear(),d.current.insideReactTree=!1}),j=x8(e=>{let t=d.current.floatingContext?.nodeId;return(p?f5(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=x8(t=>n8(t,e.select(`floatingElement`))||n8(t,e.select(`domReferenceElement`))),ee=x8(t=>{o()&&e.setOpen(!1,l8(u8,t.nativeEvent))}),N=x8(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=yMe(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=l8(YMe,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),te=x8(()=>{d.current.insideReactTree=!0,O.start(0,A)}),ne=x8(t=>{if(!l||!n||t.button!==0)return;let r=X6(t.nativeEvent);J6(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),re=x8(e=>{!l||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});F.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),F.useEffect(()=>A,[A]),F.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new m6,i=E8(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(S6?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&f5(p.nodesRef.current,t).some(t=>n8(e,t.context?.elements.floating));return M(e)||n}function ee(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=X6(n),i=`[${m5(`inert`)}]`,a=j6(r)?r.getRootNode():null,o=Array.from((N6(a)?a:E8(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>J6(e,r))))return;let c=j6(r)?r:null;for(;c&&!B6(c);){let e=U6(c);if(B6(e)||!j6(e))break;c=e}if(!(o.length&&j6(r)&&!UMe(r)&&!J6(r,e.select(`floatingElement`))&&o.every(e=>!J6(c,e)))){if(M6(r)&&!(`touches`in n)){let e=B6(r),t=V6(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!C6(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,l8(JMe,n)),A())}}}function te(t){f()!==`sloppy`||t.pointerType===`touch`||!e.select(`open`)||!n||M(t)||ee(t)}function ne(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function re(e,t){let n=X6(e);if(!n)return;let r=p8(n,e.type,()=>{t(e),r()})}function P(e){T.current=`touch`,re(e,ne)}function ie(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&re(e,e=>{e.type===`pointerdown`?te(e):ee(e)})}function ae(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;if(c(),f()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!O(e)){if(n){s();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,A())}}}function oe(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(ee(e),D.clear(),E.current=null)}function se(e){re(e,oe)}function ce(e){f()!==`sloppy`||!E.current||M(e)||(E.current.dismissOnTouchEnd&&ee(e),D.clear(),E.current=null)}function le(e){re(e,ce)}let ue=m8(r&&m8(p8(i,`keydown`,N),p8(i,`compositionstart`,a),p8(i,`compositionend`,o)),g&&m8(p8(i,`click`,ie,!0),p8(i,`pointerdown`,ie,!0),p8(i,`pointerup`,ae,!0),p8(i,`pointercancel`,ae,!0),p8(i,`mousedown`,ie,!0),p8(i,`mouseup`,ae,!0),p8(i,`touchstart`,P,{capture:!0,passive:!0}),p8(i,`touchmove`,se,{capture:!0,passive:!0}),p8(i,`touchend`,le,{capture:!0,passive:!0})));return()=>{ue(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,N,A,_,j,M,p,e,D,k]);let P=F.useMemo(()=>({onKeyDown:N,onPointerDown:ee,onClick:ee}),[N,ee]),ie=F.useMemo(()=>({onKeyDown:N,onPointerDown:re,onMouseDown:re,onClickCapture:te,onMouseDownCapture(e){te(),ne(e)},onPointerDownCapture(e){te(),ne(e)},onMouseUpCapture:te,onTouchEndCapture:te,onTouchMoveCapture:te}),[N,te,ne,re]);return F.useMemo(()=>n?{reference:P,floating:ie,trigger:P}:{},[n,P,ie])}function tPe(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var a7=tPe(`https://base-ui.com/production-error`,`Base UI`);function nPe(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),g6(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};j6(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function rPe(e,t=!1,n=!1,r=!1){let[i,a]=F.useState(e&&t?`idle`:void 0),[o,s]=F.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),g6(()=>{if(!e&&o&&i!==`ending`&&n){let e=w8.request(()=>{a(`ending`)});return()=>{w8.cancel(e)}}},[e,o,i,n]),g6(()=>{if(!e||t||i===void 0)return;let n=w8.request(()=>{a(void 0)});return()=>{w8.cancel(n)}},[t,e,i]),g6(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=w8.request(()=>{a(`idle`)});return()=>{w8.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function o7(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var s7=null;function iPe(e){if(!s7){let e=[];s7=e,queueMicrotask(()=>{s7=null,G5.flushSync(()=>{for(let t of e)t()})})}s7.push(e)}function c7(e,t=!1,n=!1){let r=T8();return x8((i,a=null)=>{r.cancel();let o=$5(e);if(o==null)return;let s=o,c=()=>{if(!n){G5.flushSync(i);return}iPe(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(o7(s).map(e=>e.finished.then(u6))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(o7(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Z6;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function l7(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=x8(a),s=c7(r,n,i);F.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function aPe(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=x8(i),{mounted:c,setMounted:l,transitionStatus:u}=rPe(t,!1,!1,o),d=!t&&r;g6(()=>{t&&s(!1)},[t,s]);let f=F.useRef(c),p=F.useRef(!1),m=D5(),h=()=>{f.current=!1,l(!1),a()};g6(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=x8(()=>{if(f.current){if(t){p.current=!0,m();return}h()}});return l7({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var oPe={tabIndex:-1,[TMe]:``};function sPe(e){return t=>t!==`touch`||e.current}function cPe(e,t=!1){let n=A5(),r=Z5()!=null,i=o6(()=>e(n,r)).current;return nPe({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function lPe({handle:e,store:t}){return g6(()=>e.attachStore(t),[e,t]),null}function u7(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function uPe(e,t){let n=F.useRef(null);return x8(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),u7(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),u7(t))})}function dPe(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function fPe(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function pPe(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=uPe(e,n),o=x8(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=x8(e=>{a(e),e&&o(e)});return g6(()=>(s(t.current),()=>s(null)),[s,t,n,e]),g6(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function mPe(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=F.useRef(null),i=e.useState(`open`);g6(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=l8(qMe);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function hPe(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=aPe({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return o6(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function gPe(e,t){e.useSyncedValues(t),g6(()=>()=>{e.update({activeTriggerProps:d6,inactiveTriggerProps:d6,popupProps:d6})},[e])}function _Pe(e,t){g6(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),g6(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var vPe=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},d7=W3(),yPe=j5(19)?xPe:SPe;function f7(e,t,n,r,i){return yPe(e,t,n,r,i)}function bPe(e,t,n,r,i){let a=F.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,d7.useSyncExternalStore)(e.subscribe,a,a)}oMe({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,d7.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function xPe(e,t,n,r,i){let a=aMe();if(!a)return bPe(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function SPe(e,t,n,r,i){return(0,G3.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var CPe=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return f7(this,e,t,n,r)}},p7=class extends CPe{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){F.useDebugValue(e);let n=this;g6(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;g6(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;g6(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){F.useDebugValue(e);let n=this,r=t!==void 0;g6(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return F.useDebugValue(e),f7(this,this.selectors[e],t,n,r)}useContextCallback(e,t){F.useDebugValue(e);let n=x8(t??u6);this.context[e]=n}useStateSetter(e){let t=F.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},wPe={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},TPe=class extends p7{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:J5(),nested:n,triggerElements:i},wPe),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&bMe(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function EPe(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new TPe({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:d6,inactiveTriggerProps:d6,popupProps:d6}}var m7=e=>e.triggerIdProp??e.activeTriggerId,h7=e=>e.openProp??e.open,g7=e=>(e.popupElement?.id??e.floatingId)||void 0;function _7(e,t){return t!==void 0&&h7(e)&&m7(e)===t}function DPe(e,t){return _7(e,t)?!0:t!==void 0&&h7(e)&&m7(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var v7={open:h7,mounted:e=>e.mounted,transitionStatus:e=>h7(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:m7,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:g7,isTriggerActive:(e,t)=>t!==void 0&&m7(e)===t,isOpenedByTrigger:(e,t)=>_7(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&m7(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>DPe(e,t)?g7(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function OPe(e){let t=F.useCallback(t=>e===void 0?u6:e.subscribeStore(t),[e]),n=F.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,d7.useSyncExternalStore)(t,n,()=>e?.serverStore)}var kPe=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new m6;restTimeout=new m6;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},y7=new WeakMap;function b7(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&y7.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),y7.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function x7(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=y7.get(n);a&&a!==e&&b7(a),b7(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,y7.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function S7(e){let t=e.context.dataRef.current,n=o6(()=>t.hoverInteractionState??kPe.create()).current;return t.hoverInteractionState||=n,f6(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function APe(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Q5(),u=Z5(),d=S7(e),f=h6(),p=x8(()=>c8(c.current.openEvent?.type,d.interactedInside)),m=x8(()=>KMe(c.current.openEvent?.type)),h=x8(()=>{b7(d)});g6(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),F.useEffect(()=>h,[h]),g6(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&j6(s)&&o){let e=s,t=o,n=E8(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Y6(e,`[data-rootownerid]`)??n.body;return x7(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),F.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&f5(l.nodesRef.current,u).length>0)}function a(t){let n=o8(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,l8(d8,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=X6(e);if(!WMe(t)){d.interactedInside=!1;return}d.interactedInside=Y6(t,`[aria-haspopup]`)!=null}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(t8(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(l&&r&&j6(o)&&f5(l.nodesRef.current,r,!1).some(e=>J6(e.context?.elements.floating,o)))){if(d.handler){d.handler(n);return}h(),m()&&!p()&&a(n)}}function v(n){!l||!u||t()||f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,l8(d8,n)),l.events.emit(`floating.closed`,n)})}let y=o;return m8(y&&p8(y,`mouseenter`,g),y&&p8(y,`mouseleave`,_),y&&p8(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var jPe={current:null};function MPe(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=jPe,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Q5(l),v=S7(e),y=F.useRef(!1),b=v8(i),x=v8(r),S=v8(o),C=v8(n),w=v8(p),T=v8(f),E=x8(()=>c8(h.current.openEvent?.type,v.interactedInside)),D=x8(()=>w.current?.()!==!1),O=x8((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!J6(t,n);if(!j6(r))return!1;let a=r;return i.hasMatchingElement(e=>J6(e,a))&&(!t||!J6(t,a))}),k=x8(()=>{v.handler&&=(E8(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=x8(()=>{b7(v)});return u&&(v.handleCloseOptions=i?.__options),F.useEffect(()=>k,[k]),F.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===d8,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),F.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=o8(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,l8(d8,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,l8(d8,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!j6(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!T6(v.pointerType))return;let n=s8(S.current),r=o8(x.current,`open`,v.pointerType),i=X6(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(j6(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(J6(t,i)){c=t;break}}j6(o)&&j6(s)&&!e.context.triggerElements.hasElement(o)&&J6(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&j6(c)&&j6(s)&&J6(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){D()&&e.setOpen(!0,l8(d8,t,c));return}m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,l8(d8,t,c))}):g&&D()&&e.setOpen(!0,l8(d8,t,c)))}function o(n){if(E()){A();return}k();let r=E8(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!t8(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n);return}(v.pointerType!==`touch`||!J6(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){J6(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?p8(r,`mouseout`,l):void 0;return s?m8(p8(r,`mousemove`,i,{once:!0}),p8(r,`mouseenter`,i),p8(r,`mouseleave`,o),f):m8(p8(r,`mouseenter`,i),p8(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),F.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!T6(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;x7(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=s8(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,l8(d8,n,r))}v.pointerType===`touch`?G5.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}var C7=.1,NPe=C7*C7,w7=.5;function T7(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function E7(e,t,n,r,i,a,o,s,c,l){let u=!1;return T7(e,t,n,r,i,a)&&(u=!u),T7(e,t,i,a,o,s)&&(u=!u),T7(e,t,o,s,c,l)&&(u=!u),T7(e,t,c,l,n,r)&&(u=!u),u}function PPe(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function D7(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function FPe(e={}){let{blockPointerEvents:t=!1}=e,n=new m6,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*NPe;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=X6(r),g=r.type===`mouseleave`,_=J6(u,h),v=J6(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&j6(r.relatedTarget)&&J6(u,r.relatedTarget))return;function y(){return!!(s&&f5(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=D7(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=D7(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=D7(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=D7(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!PPe(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?w7/2:w7*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+w7+1,o=C||T?S.bottom-w7:S.top,s=C?T?S.bottom-w7:S.top:S.bottom-w7;M=E7(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?w7/2:w7*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-w7,o=C||T?S.top+w7:S.bottom,s=C?T?S.top+w7:S.bottom:S.top+w7;M=E7(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?w7/2:w7*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+w7+1,o=w||E?S.right-w7:S.left,s=w?E?S.right-w7:S.left:S.right-w7;M=E7(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?w7/2:w7*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-w7,o=w||E?S.left+w7:S.right,s=w?E?S.left+w7:S.right:S.left+w7;M=E7(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function O7(e,t,n){let{reference:r,floating:i}=e,a=B8(t),o=V8(t),s=z8(o),c=I8(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=L8(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function IPe(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}=F8(t,e),p=K8(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=q8(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=q8(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 LPe=50,RPe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:IPe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=O7(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<LPe&&(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}=O7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},zPe=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}=F8(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=I8(r),_=B8(o),v=I8(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[G8(o)]:sNe(o)),x=p!==`none`;!d&&x&&b.push(...dNe(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=oNe(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`||_===B8(t)||T.every(e=>B8(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=B8(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{}}}},k7=new Set([`left`,`top`]);async function BPe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=I8(n),s=L8(n),c=B8(n)===`y`,l=k7.has(o)?-1:1,u=a&&c?-1:1,d=F8(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 VPe=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 BPe(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}}}}},HPe=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}=F8(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=B8(i),p=R8(f),m=u[p],h=u[f],g=(e,t)=>P8(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}}}}}},UPe=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}=F8(e,t),u={x:n,y:r},d=B8(i),f=R8(d),p=u[f],m=u[d],h=F8(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=k7.has(I8(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}}}},WPe=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}=F8(e,t),c=await i.detectOverflow(t,s),l=I8(n),u=L8(n),d=B8(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=k8(p-c[m],g),y=k8(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*A8(c.left,c.right):S=p-2*A8(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 A7(e){let t=V6(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=M6(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=j8(n)!==a||j8(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function j7(e){return j6(e)?e:e.contextElement}function M7(e){let t=j7(e);if(!M6(t))return N8(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=A7(t),o=(a?j8(n.width):n.width)/r,s=(a?j8(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var GPe=N8(0);function N7(e){let t=O6(e);return!z6()||!t.visualViewport?GPe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function KPe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===O6(e)}function P7(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=j7(e),o=N8(1);t&&(r?j6(r)&&(o=M7(r)):o=M7(e));let s=KPe(a,n,r)?N7(a):N8(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=O6(a),t=j6(r)?O6(r):r,n=e,i=K6(n);for(;i&&t!==n;){let e=M7(i),t=i.getBoundingClientRect(),r=V6(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=O6(i),i=K6(n)}}return q8({width:u,height:d,x:c,y:l})}function F7(e,t){let n=H6(e).scrollLeft;return t?t.left+n:P7(k6(e)).left+n}function I7(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-F7(e,n),y:n.top+t.scrollTop}}function qPe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k6(r),s=t?F6(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=N8(1),u=N8(0),d=M6(r);if((d||!a)&&((D6(r)!==`body`||P6(o))&&(c=H6(r)),d)){let e=P7(r);l=M7(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?I7(o,c):N8(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 JPe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function YPe(e){let t=H6(e),n=e.ownerDocument.body,r=A8(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=A8(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+F7(e),o=-t.scrollTop;return V6(n).direction===`rtl`&&(a+=A8(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var XPe=25;function ZPe(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=O6(e),a=k6(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!z6()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(F7(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<=XPe&&(s-=o)}return{width:s,height:c,x:l,y:u}}function QPe(e,t){let n=P7(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=M7(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function L7(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ZPe(e,n,t);else if(t===`document`)r=YPe(k6(e));else if(j6(t))r=QPe(t,n);else{let n=N7(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return q8(r)}function $Pe(e,t){let n=t.get(e);if(n)return n;let r=G6(e,[],!1).filter(e=>j6(e)&&D6(e)!==`body`),i=null,a=V6(e).position===`fixed`,o=a?U6(e):e;for(;j6(o)&&!B6(o);){let e=V6(o),t=R6(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=U6(o)}return t.set(e,r),r}function eFe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?F6(t)?[]:$Pe(t,this._c):[].concat(n),r],o=L7(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=L7(t,a[e],i);s=A8(n.top,s),c=k8(n.right,c),l=k8(n.bottom,l),u=A8(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function tFe(e){let{width:t,height:n}=A7(e);return{width:t,height:n}}function nFe(e,t,n){let r=M6(t),i=k6(t),a=n===`fixed`,o=P7(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=N8(0);if((r||!a)&&((D6(t)!==`body`||P6(i))&&(s=H6(t)),r)){let e=P7(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=F7(i));let l=i&&!r&&!a?I7(i,s):N8(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 R7(e){return V6(e).position===`static`}function z7(e,t){if(!M6(e)||V6(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k6(e)===n&&(n=n.ownerDocument.body),n}function B7(e,t){let n=O6(e);if(F6(e))return n;if(!M6(e)){let t=U6(e);for(;t&&!B6(t);){if(j6(t)&&!R7(t))return t;t=U6(t)}return n}let r=z7(e,t);for(;r&&xMe(r)&&R7(r);)r=z7(r,t);return r&&B6(r)&&R7(r)&&!R6(r)?n:r||wMe(e)||n}var rFe=async function(e){let t=this.getOffsetParent||B7,n=this.getDimensions,r=await n(e.floating);return{reference:nFe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iFe(e){return V6(e).direction===`rtl`}var aFe={convertOffsetParentRelativeRectToViewportRelativeRect:qPe,getDocumentElement:k6,getClippingRect:eFe,getOffsetParent:B7,getElementRects:rFe,getClientRects:JPe,getDimensions:tFe,getScale:M7,isElement:j6,isRTL:iFe};function V7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oFe(e,t,n){let r=null,i,a=k6(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=M8(d),h=M8(a.clientWidth-(u+f)),g=M8(a.clientHeight-(d+p)),_=M8(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:A8(0,k8(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!V7(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=O6(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function H7(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=j7(e),u=i||a?[...l?G6(l):[],...t?G6(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?oFe(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?P7(e):null;c&&g();function g(){let t=P7(e);h&&!V7(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 sFe=VPe,cFe=HPe,lFe=zPe,uFe=WPe,dFe=UPe,fFe=(e,t,n)=>{let r=new Map,i=n??{},a={...aFe,...i.platform,_c:r};return RPe(e,t,{...i,platform:a})},U7=typeof document<`u`?F.useLayoutEffect:function(){};function W7(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(!W7(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)&&!W7(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function G7(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function K7(e,t){let n=G7(e);return Math.round(t*n)/n}function q7(e){let t=F.useRef(e);return U7(()=>{t.current=e}),t}function pFe(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]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=F.useState(r);W7(f,r)||p(r);let[m,h]=F.useState(null),[g,_]=F.useState(null),v=F.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=F.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=F.useRef(null),C=F.useRef(null),w=F.useRef(u),T=c!=null,E=q7(c),D=q7(i),O=q7(l),k=F.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),fFe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!W7(w.current,t)&&(w.current=t,G5.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);U7(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=F.useRef(!1);U7(()=>(A.current=!0,()=>{A.current=!1}),[]),U7(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=F.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=F.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=F.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=K7(M.floating,u.x),r=K7(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...G7(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return F.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:ee}),[u,k,j,M,ee])}var mFe=(e,t)=>{let n=sFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},hFe=(e,t)=>{let n=cFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},gFe=(e,t)=>({fn:dFe(e).fn,options:[e,t]}),_Fe=(e,t)=>{let n=lFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},vFe=(e,t)=>{let n=uFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},J7=F.createContext(void 0);function Y7(e){let t=F.useContext(J7);if(t===void 0&&!e)throw Error(a7(47));return t}var yFe={...v7,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!v7.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&v7.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>v7.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bFe=class extends p7{constructor(e,t,n){let r=new vPe;super(xFe(e,r,t,n),SFe(r),yFe)}setOpen=(e,t)=>{let n=t.reason===d8,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=fPe(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=dPe(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),G5.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function xFe(e,t,n,r=!1){let i={...EPe(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function SFe(e){return{popupRef:F.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:F.createRef(),beforeTriggerFocusGuardRef:F.createRef(),beforeContentFocusGuardRef:F.createRef(),stickIfOpenTimeout:new m6,stickIfOpen:!0,triggerElements:e}}var X7=l6(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=wFe(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),_Pe(u,d),mPe(u);let{forceUnmount:m}=hPe(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),F.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),F.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,l8(XMe))}),[m,u]);let h=d||f||s!=null;return(0,R.jsxs)(J7.Provider,{value:u,children:[s&&(0,R.jsx)(lPe,{handle:s,store:u}),h&&(0,R.jsx)(TFe,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function CFe(e){return Y7(!0)?(0,R.jsx)(X7,{props:e}):(0,R.jsx)(KNe,{children:(0,R.jsx)(X7,{props:e})})}function wFe(e,t){let n=cPe((e,n)=>new bFe(t,e,n));return F.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function TFe({store:e,modal:t}){let n=ePe(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return gPe(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var EFe=F.createContext(void 0);function DFe(e=!1){let t=F.useContext(EFe);if(t===void 0&&!e)throw Error(a7(16));return t}function OFe(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:F.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Z7(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(O6(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function kFe(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=F.useRef(null),s=DFe(!0),c=a??s!==void 0,{props:l}=OFe({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=F.useCallback(()=>{let e=o.current;Q7(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return g6(u,[u]),{getButtonProps:F.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return F5({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(V5(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Q7(r),s=!i&&AFe(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Z7(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Z7(r,e)))},onKeyUp(e){if(!t){if(V5(e),a?.(e),e.target===e.currentTarget&&i&&c&&Q7(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Z7(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:x8(e=>{o.current=e,u()})}}function Q7(e){return M6(e)&&e.tagName===`BUTTON`}function AFe(e){return M6(e)&&e.tagName===`A`&&!!e.href}function jFe(e){return A5(e,`base-ui`)}function MFe(e,t){function n(n,r,i){let a=n.currentTarget;G5.flushSync(()=>{e.setOpen(!1,l8(f8,n.nativeEvent,a))}),vNe(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&u5(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function NFe(e){let t=F.useRef(``),n=F.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:F.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function PFe(e,t){let{onClick:n,onPointerDown:r}=NFe(x8((n,r)=>{(typeof e==`function`?e():e)||t(r||(y6?`touch`:``))}));return F.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var FFe=sMe(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=Y7(!0),h=OPe(s)??m;if(!h)throw Error(a7(74));let g=jFe(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=F.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=pPe(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=MPe(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:FPe(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=ZNe(v,{stickIfOpen:x8(()=>h.context.stickIfOpen)}),k=PFe(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=kFe({disabled:a,native:o}),ee={open(e){return w?VMe.open(e):BMe.open(e)}},{handlePreFocusGuardFocus:N,handleFocusTargetFocus:te}=MFe(h,x),ne=W5(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[LNe]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:ee}),re=(0,R.jsx)(F.Fragment,{children:ne},g);return E?(0,R.jsxs)(F.Fragment,{children:[(0,R.jsx)(O8,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:N}),re,(0,R.jsx)(O8,{ref:h.context.triggerFocusTargetRef,onFocus:te})]}):re}),$7=F.createContext(void 0);function IFe(){let e=F.useContext($7);if(e===void 0)throw Error(a7(45));return e}var LFe=F.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Y7().useState(`mounted`)||n?(0,R.jsx)($7.Provider,{value:n,children:(0,R.jsx)(HNe,{ref:t,...r})}):null});function RFe(e){return j5(19)?e:e?`true`:void 0}var e9=F.createContext(void 0);function zFe(){let e=F.useContext(e9);if(!e)throw Error(a7(46));return e}function BFe(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=F.useState(null),d=F.useRef(null),f=Q5(n),p=F.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=pFe({...e,elements:{...p,...l&&{reference:l}}}),h=F.useCallback(e=>{let t=j6(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=F.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=F.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=F.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return g6(()=>{o&&(d.current=o)},[o]),g6(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),F.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var VFe=F.createContext(void 0);function HFe(){return F.useContext(VFe)?.direction??`ltr`}var UFe=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}=F8(e,t)||{};if(l==null)return{};let d=K8(u),f={x:n,y:r},p=V8(i),m=z8(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=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=P8(D,k,O),j=!c.arrow&&L8(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),WFe=(e,t)=>{let{name:n,fn:r}=UFe(e);return{name:n,fn:r,options:[e,t]}},GFe={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},KFe={sideX:`left`,sideY:`top`},qFe=`--available-width`,JFe=`--available-height`,YFe=`--anchor-width`,XFe=`--anchor-height`,ZFe=`--transform-origin`,t9=qFe,n9=JFe;function r9(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function i9(e,t,n){let{rects:r,placement:i}=e;return{side:r9(t,I8(i),n),align:L8(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function QFe(e){return $Fe(e,BFe)}function $Fe(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=x8(O),A=O?k:n,j=v8(n),M=v8(g),ee=HFe()===`rtl`,[N,te]=F.useState(null);!g&&N!==null&&te(null);let ne=x===`placement`,re=N?I8(N):null,P=N&&ne?L8(N)||`center`:null,ie=re||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":ee?`left`:`right`,"inline-start":ee?`right`:`left`}[i],ae=P||o,oe=ae===`center`?ie:`${ie}-${ae}`,se=l;typeof se==`number`?se={top:se,right:se,bottom:se,left:se}:se&&={top:se.top||0,right:se.right||0,bottom:se.bottom||0,left:se.left||0};let ce=+(i===`bottom`),le=+(i===`top`),ue=+(i===`right`),de=+(i===`left`),fe={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:se},pe=F.useRef(null),me=v8(a),he=v8(s),ge=typeof a==`function`?0:a,_e=typeof s==`function`?0:s,ve=[];p&&ve.push(p),ve.push(mFe(e=>{let t=i9(e,i,ee),n=typeof me.current==`function`?me.current(t):me.current,r=typeof he.current==`function`?he.current(t):he.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ge,_e,ee,i]));let ye=w===`none`&&C!==`shift`,be=!ye&&(u||E||C===`shift`),xe=C===`none`?null:_Fe({...fe,padding:{top:se.top+1+ce,right:se.right+1+de,bottom:se.bottom+1+le,left:se.left+1+ue},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),Se=ye?null:hFe({...fe,rootBoundary:D,mainAxis:w!==`none`,crossAxis:be,limiter:u||E?void 0:gFe(e=>{if(!pe.current)return{};let{width:t,height:n}=pe.current.getBoundingClientRect(),r=B8(I8(e.placement)),i=r===`y`?t:n,a=r===`y`?se.left+se.right:se.top+se.bottom;return{offset:i/2+a/2}})},[fe,u,E,D,se,w]);C===`shift`||w===`shift`||ae===`center`?ve.push(Se,xe):ve.push(xe,Se),ve.push(vFe({...fe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(t9,`${t}px`),i.setProperty(n9,`${n}px`);let a=O6(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(YFe,`${u}px`),i.setProperty(XFe,`${d}px`)}}),WFe(e=>({element:pe.current||E8(e.elements.floating).createElement(`div`),padding:pe.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=I8(r),u=L8(r),d=B8(l)===`y`,f=pe.current,p=typeof a==`function`?a(i9(e,i,ee)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return be&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(ZFe,d?`${m} ${h}`:`${h} ${m}`),{}}},GFe,b),g6(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let Ce=F.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:we,elements:Te,x:Ee,y:De,middlewareData:Oe,update:ke,placement:Ae,context:je,isPositioned:Me,floatingStyles:Ne}=t({rootContext:h,open:m?g:void 0,placement:oe,middleware:ve,strategy:r,whileElementsMounted:m?void 0:(...e)=>H7(...e,Ce),nodeId:y,externalTree:S}),{sideX:Pe,sideY:Fe}=Oe.adaptiveOrigin||KFe,Ie=Me?r:`fixed`,Le=F.useMemo(()=>{let e;return e=Me?b?{position:Ie,[Pe]:Ee,[Fe]:De}:{...Ne,position:Ie}:{position:Ie,top:0,left:0},e[t9]=`100vw`,e[n9]=`100vh`,Me||(e.opacity=0),e},[b,Ie,Pe,Ee,Fe,De,Ne,Me]),Re=F.useRef(null);g6(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(a9(t)?t.current:t)||null;n!==Re.current&&(we.setPositionReference(n),Re.current=n)},[g,we,A,j]),F.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&a9(e)&&e.current!==Re.current&&(we.setPositionReference(e.current),Re.current=e.current)},[g,we,A,j]),F.useEffect(()=>{if(m&&g&&Te.reference&&Te.floating)return H7(Te.reference,Te.floating,ke,Ce)},[m,g,Te,ke,Ce]);let ze=I8(Ae),Be=r9(i,ze,ee),Ve=L8(Ae)||`center`,He=!!Oe.hide?.referenceHidden;g6(()=>{x&&g&&Me&&(ze!==ie||ne&&Ve!==ae)&&te(Ae)},[x,ne,g,Me,Ae,ze,Ve,ie,ae]);let Ue=F.useMemo(()=>({position:`absolute`,top:Oe.arrow?.y,left:Oe.arrow?.x}),[Oe.arrow]),We=Oe.arrow?.centerOffset!==0;return F.useMemo(()=>({positionerStyles:Le,arrowStyles:Ue,arrowRef:pe,arrowUncentered:We,side:Be,align:Ve,physicalSide:ze,anchorHidden:He,refs:we,context:je,isPositioned:Me,update:ke}),[Le,Ue,pe,We,Be,Ve,ze,He,we,je,Me,ke])}function a9(e){return e!=null&&`current`in e}var eIe=F.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,R.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function tIe(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=F.useRef(null),o=F.useRef(null),s=c7(r);g6(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),g6(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function o9(e){return e===`starting`?INe:d6}function nIe(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),W5(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},o9(r),i],stateAttributesMapping:$6})}var s9={},c9={},l9=``;function u9(e,t){return P6(e)?e:t}function d9(e,t,n){return/hidden|clip/.test(e.getComputedStyle(u9(t,n)).overflowY)}function rIe(e){if(typeof document>`u`)return!1;let t=E8(e);return O6(t).innerWidth-t.documentElement.clientWidth>0}function iIe(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=E8(e),n=t.documentElement,r=t.body,i=u9(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function aIe(e){let t=E8(e),n=t.documentElement,r=t.body,i=u9(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function oIe(e){let t=E8(e),n=t.documentElement,r=t.body,i=O6(n),a=0,o=0,s=!1,c=w8.create();if(S6&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,s9={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},l9=n.style.scrollBehavior,c9={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=u9(n,r);if(s=iIe(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,s9),Object.assign(r.style,c9),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=l9)}function d(){u(),c.request(l)}l();let f=p8(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var sIe=new class{lockCount=0;restore=null;timeoutLock=m6.create();timeoutUnlock=m6.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=E8(e),n=t.documentElement,r=t.body,i=O6(n);if(d9(i,n,r)){let t=new i.MutationObserver(()=>{d9(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=y6||!rIe(e);this.restore=a?aIe(e):oIe(e)}};function cIe(e=!0,t=null){g6(()=>{if(e)return sIe.acquire(t)},[e,t])}var lIe=20;function uIe(e,t,n,r){let[i,a]=F.useState(!1);g6(()=>{if(!e||!t||n==null){a(!1);return}let r=E8(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-lIe)},[e,t,n]),cIe(e&&(!t||i),r)}var dIe=F.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=RNe,..._}=e,v=Y7(),y=IFe(),b=WNe(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=QFe({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});tIe({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;uIe(C&&M,D===`touch`,O,T);let ee=v.useStateSetter(`positionerElement`),N=nIe(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,ee],hidden:!S,inert:!C});return(0,R.jsxs)(e9.Provider,{value:j,children:[S&&M&&(0,R.jsx)(eIe,{inert:RFe(!C),cutout:T}),(0,R.jsx)(GNe,{id:b,children:N})]})}),fIe=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),pIe=F.createContext(void 0);function mIe(e){let t=F.useContext(pIe);if(t===void 0&&!e)throw Error(a7(69));return t}var hIe=F.createContext(void 0);function gIe(){let[e,t]=F.useState(0),n=x8(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:F.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var _Ie=F.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Y7(),l=zFe(),u=mIe(!0)!=null,{context:d,hasClosePart:f}=gIe(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);l7({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),APe(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?sPe(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=W5(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...oPe,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&fIe.has(e.key)&&e.stopPropagation()}},o9(g),s],stateAttributesMapping:HMe});return(0,R.jsx)(XNe,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:M6(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,R.jsx)(hIe.Provider,{value:d,children:M})})}),f9=`data-glide-stand-in`;function p9(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left+e.scrollLeft-e.clientLeft,y:r.top-n.top+e.scrollTop-e.clientTop,width:r.width,height:r.height}}function m9(e){return{transform:`translate(${String(e.x)}px, ${String(e.y)}px)`,width:`${String(e.width)}px`,height:`${String(e.height)}px`}}function vIe(e){let t=(0,F.useRef)(null);return(0,F.useCallback)(n=>{t.current?.(),t.current=n?yIe(n,e):null},[e])}function yIe(e,t){if(!hC(e))return()=>void 0;let n=e.ownerDocument,r=e.querySelector(t),i=r?p9(e,r):null,a=null,o=null,s=new Set,c=()=>{for(let e of s)e.removeAttribute(f9);s.clear(),a&&(a.hidden=!0),o=null},l=()=>{if(a)return a;let t=n.createElement(`span`);return t.className=`caps-glide`,t.setAttribute(`aria-hidden`,`true`),e.prepend(t),e.classList.add(`caps-glide-host`),getComputedStyle(e).position===`static`&&e.classList.add(`caps-glide-anchor`),a=t,t},u=(t,n)=>{let r=dC(e),u=p9(e,t),d=o&&a?p9(e,a):i;if(i=u,o?.cancel(),c(),r.reduced||d===null||Math.abs(d.y-u.y)<1&&Math.abs(d.x-u.x)<1)return;t.setAttribute(f9,`measure`);let f=getComputedStyle(t),p=f.backgroundColor,m=f.borderRadius;for(let e of[t,n])e&&(e.setAttribute(f9,``),s.add(e));let h=l();h.hidden=!1,h.style.backgroundColor=p,h.style.borderRadius=m;let g=h.animate([m9(d),m9(u)],{duration:r.normal,easing:mC(r,r.ease),fill:`forwards`});o=g,g.addEventListener(`finish`,()=>{o===g&&c()})},d=()=>{let n=e.querySelector(t);if(n===r)return;let i=r;r=n,n&&u(n,i)},f=new MutationObserver(d);return f.observe(e,{subtree:!0,attributes:!0,attributeFilter:[`data-highlighted`,`data-active`,`data-navigation`,`aria-selected`]}),e.addEventListener(`pointerover`,d),e.addEventListener(`pointerout`,d),()=>{f.disconnect(),e.removeEventListener(`pointerover`,d),e.removeEventListener(`pointerout`,d),o?.cancel(),c(),a?.remove()}}var bIe=(0,F.createContext)(void 0),xIe=(0,F.createContext)(null);function SIe(e){let t=(0,F.useContext)(xIe);return t===null?Object.hasOwn(globalThis,`document`)?document.body:null:t[e]}function CIe(e){let t=(0,F.useContext)(bIe),n=(0,F.useRef)(e);n.current=e,(0,F.useEffect)(()=>t?.(()=>{n.current()}),[t])}var h9=(0,F.forwardRef)(function({className:e,invalid:t,...n},r){return(0,R.jsx)(`input`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:cC(`input caps-input w-full`,e),ref:r})});(0,F.forwardRef)(function({leading:e,className:t,...n},r){return(0,R.jsxs)(`span`,{className:`caps-search-input`,"data-leading":e?`true`:void 0,children:[e?(0,R.jsx)(`span`,{className:`caps-search-leading`,"aria-hidden":`true`,children:e}):null,(0,R.jsx)(h9,{...n,type:`search`,className:t,ref:r})]})});function wIe({getKey:e,isDisabled:t=()=>!1,items:n}){let r=(0,F.useMemo)(()=>{let r=n.map(e);if(r.some(e=>!e))throw Error(`Selectable items require non-empty keys`);if(new Set(r).size!==r.length)throw Error(`Selectable items require unique keys`);return n.filter(e=>!t(e))},[e,t,n]),[i,a]=(0,F.useState)(null);(0,F.useEffect)(()=>{i!==null&&!r.some(t=>e(t)===i)&&a(null)},[i,r,e]);let o=r.find(t=>e(t)===i),s=o?r.findIndex(t=>e(t)===i):-1;return{activeIndex:s,activeItem:o,activeKey:i,enabledItems:r,move:(t,n)=>{if(r.length===0)return;let i=n?n===`start`?0:r.length-1:s<0?t>0?0:r.length-1:(s+t+r.length)%r.length,o=r[i];o&&a(e(o))},setActiveKey:a}}var TIe=(0,F.forwardRef)(function({children:e,className:t,type:n=`button`,...r},i){return(0,R.jsxs)(`button`,{...r,ref:i,type:n,className:cC(`select caps-select caps-combobox-trigger w-full`,t),children:[(0,R.jsx)(`span`,{children:e}),(0,R.jsx)(F4,{className:`caps-select-chevron`,"aria-hidden":`true`})]})});function EIe({defaultOpen:e,defaultValue:t,getKey:n,getSearchText:r,groupBy:i,id:a,isDisabled:o,items:s,onOpenChange:c,onCommit:l,multiple:u,controlledOpen:d,controlledKeys:f,trigger:p}){let m=`${a}-listbox`,[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(t),[x,S]=(0,F.useState)(e),C=f??(y===null?[]:[y]),w=p?d??x:!0,T=(0,F.useMemo)(()=>{let e=h.trim().toLowerCase();return e?s.filter(t=>r(t).toLowerCase().includes(e)):s},[r,s,h]),E=wIe({getKey:n,isDisabled:o,items:T});(0,F.useEffect)(()=>{if(E.activeKey!==null)return;let e=E.enabledItems.find(e=>C.includes(n(e)))??E.enabledItems[0];e&&E.setActiveKey(n(e))},[E.activeKey,E.enabledItems,E.setActiveKey,n,C]);let D=e=>{v(!1),e||g(``),d===void 0&&S(e),c?.(e)},O=e=>`${m}-option-${encodeURIComponent(e)}`,k=e=>{let t=n(e);f===void 0&&b(t),l(e),p&&!u&&D(!1)},A=e=>{v(!0),g(e.target.value),E.setActiveKey(null)},j=e=>{if(iMe(e))return;let t;switch(e.key){case`ArrowDown`:t=[1,void 0];break;case`ArrowUp`:t=[-1,void 0];break;case`End`:t=[1,`end`];break;case`Home`:t=[-1,`start`]}t?(v(!0),e.preventDefault(),E.move(t[0],t[1])):e.key===`Enter`&&E.activeItem&&(e.preventDefault(),k(E.activeItem))},M=(0,F.useMemo)(()=>{if(!i)return[{label:``,items:T}];let e=new Map;for(let t of T){let n=i(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e].map(([e,t])=>({label:e,items:t}))},[T,i]);return{keyboardNavigation:_,onPointerMove:()=>{v(!1)},activeKey:E.activeKey,activeItem:E.activeItem,groups:M,inputValue:h,listboxId:m,onInputChange:A,onInputKeyDown:j,optionId:O,open:w,commit:k,selectedKeys:C,setOpen:D}}function DIe(e){let{"aria-describedby":t,"aria-invalid":n,"aria-label":r,"aria-labelledby":i,"aria-required":a,activeTone:o=`neutral`,container:s,contentClassName:c,defaultOpen:l=!1,defaultValue:u=null,emptyMessage:d=`No matches`,getKey:f,getLabel:p,getSearchText:m=p,groupBy:h,id:g,inputProps:_,inputRef:v,isDisabled:y=()=>!1,items:b,onOpenChange:x,onValueChange:S,multiple:C,open:w,placeholder:T=`Search…`,renderItem:E,rootRef:D,trigger:O,triggerRef:k,value:A,...j}=e,M=e=>{let t=f(e);if(C){let e=A.includes(t)?A.filter(e=>e!==t):[...A,t];S?.(e,b.filter(t=>e.includes(f(t))))}else S?.(t,e)},ee;C?ee=A:A!==void 0&&(ee=A===null?[]:[A]);let N=(0,F.useId)(),te=O?.props??_,ne=g??te?.id??N,re={id:ne,"aria-describedby":[t,te?.[`aria-describedby`]].filter(Boolean).join(` `)||void 0,"aria-invalid":n??te?.[`aria-invalid`],"aria-label":te?.[`aria-label`]??r,"aria-labelledby":te?.[`aria-labelledby`]??i,"aria-required":a??te?.[`aria-required`]},{keyboardNavigation:P,onPointerMove:ie,activeItem:ae,activeKey:oe,commit:se,groups:ce,inputValue:le,listboxId:ue,onInputChange:de,onInputKeyDown:fe,open:pe,optionId:me,selectedKeys:he,setOpen:ge}=EIe({defaultOpen:l,defaultValue:u,getKey:f,getSearchText:m,groupBy:h,id:ne,isDisabled:y,items:b,onOpenChange:x,onCommit:M,multiple:C??!1,controlledOpen:w,controlledKeys:ee,trigger:O});CIe(()=>{O&&ge(!1)});let _e=SIe(`popover`),ve=s===void 0?_e:s,ye=vIe(`.caps-combobox-option[data-active="true"]:not(:disabled), [data-navigation="pointer"] .caps-combobox-option:hover:not(:disabled)`),be=(0,R.jsx)(h9,{..._,...O?{}:re,"aria-activedescendant":ae?me(f(ae)):void 0,"aria-autocomplete":`list`,"aria-controls":ue,"aria-expanded":!0,className:cC(`input-sm`,_?.className),id:O?_?.id??`${ne}-input`:ne,onChange:e=>{_?.onChange?.(e),de(e)},onKeyDown:e=>{_?.onKeyDown?.(e),e.defaultPrevented||fe(e)},placeholder:_?.placeholder??T,ref:v,role:`combobox`,value:le}),xe=(0,R.jsx)(`div`,{id:ue,ref:ye,className:`caps-combobox-list`,"data-navigation":P?`keyboard`:`pointer`,onPointerMove:ie,role:`listbox`,"aria-multiselectable":C??void 0,children:ce.every(e=>e.items.length===0)?(0,R.jsx)(`div`,{className:`px-md py-md text-sm text-base-content`,children:d}):ce.map(e=>(0,R.jsxs)(`div`,{"aria-label":e.label||void 0,role:e.label?`group`:void 0,children:[e.label?(0,R.jsx)(`div`,{className:`px-md pb-xs pt-sm text-xs text-base-content uppercase tracking-wider`,children:e.label}):null,e.items.map(e=>{let t=f(e),n=y(e),r=oe===t,i={active:r,disabled:n,selected:he.includes(t)};return(0,R.jsxs)(`button`,{"aria-disabled":n||void 0,"aria-selected":i.selected,className:`caps-combobox-option`,"data-active":r&&P,disabled:n,id:me(t),onClick:()=>{se(e)},onMouseDown:e=>{e.preventDefault()},role:`option`,tabIndex:-1,type:`button`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`caps-combobox-check`,children:i.selected?(0,R.jsx)(XAe,{}):null}),E?.(e,r,i)??p(e)]},t)})]},e.label))});return O?(0,R.jsx)(`div`,{...j,className:cC(j.className),ref:D,children:(0,R.jsxs)(CFe,{modal:!0,onOpenChange:ge,open:pe,children:[(0,R.jsx)(FFe,{...re,"aria-haspopup":`dialog`,className:`btn`,ref:k,render:O}),ve===null?null:(0,R.jsx)(LFe,{container:ve,children:(0,R.jsx)(dIe,{align:`start`,side:`bottom`,sideOffset:4,children:(0,R.jsxs)(_Ie,{"data-active-tone":o,className:cC(`min-w-40 rounded-box border border-base-300 bg-base-100 p-xs shadow-lg outline-none caps-combobox-panel caps-combobox-popup`,c),children:[(0,R.jsx)(`div`,{className:`caps-combobox-search`,children:be}),xe]})})})]})}):(0,R.jsx)(`div`,{...j,className:cC(j.className),ref:D,children:(0,R.jsxs)(`div`,{className:cC(`caps-combobox-panel`,c),"data-active-tone":o,children:[(0,R.jsx)(`div`,{className:`caps-combobox-search`,children:be}),xe]})})}var OIe=(0,F.forwardRef)(function({label:e,icon:t,caption:n,appearance:r,className:i,...a},o){return(0,R.jsx)(`label`,{className:`caps-icon-choice`,"data-appearance":r===`compact`?r:void 0,children:(0,R.jsx)(i6,{...a,appearance:r??`default`,"aria-label":e,className:cC(`caps-icon-choice-input`,i),indicator:(0,R.jsx)($T,{icon:t,caption:n}),ref:o})})}),kIe=(0,F.forwardRef)(function({label:e,icon:t,hint:n,className:r,...i},a){let o=(0,F.useId)(),s=[i[`aria-describedby`],n?o:null].filter(Boolean).join(` `)||void 0;return(0,R.jsx)(`label`,{className:`caps-check-key`,children:(0,R.jsx)(i6,{...i,"aria-label":e,"aria-describedby":s,className:cC(`caps-check-key-input`,r),indicator:(0,R.jsxs)(`span`,{className:`caps-check-key-face`,"aria-hidden":`true`,children:[t?(0,R.jsx)(`span`,{className:`caps-check-key-icon`,children:t}):null,(0,R.jsxs)(`span`,{className:`caps-check-key-copy`,children:[(0,R.jsx)(`span`,{className:`caps-check-key-label`,children:e}),n?(0,R.jsx)(`span`,{className:`caps-check-key-hint`,id:o,children:n}):null]}),(0,R.jsx)(`span`,{className:`caps-check-key-lamp`})]}),ref:a})})});function AIe({className:e,...t}){return(0,R.jsx)(`div`,{...t,className:cC(`caps-check-keys`,e)})}function jIe({checked:e}){let t=`caps-radio-${(0,F.useId)().replaceAll(`:`,``)}`,n=(0,F.useRef)(null),r=(0,F.useRef)(e).current,i=(0,F.useRef)(e),a=(0,F.useRef)(null),o=fC(a),{reduced:s}=o;return(0,F.useLayoutEffect)(()=>{if(!n.current)return;let t=s||i.current===e;i.current=e;let r=e?4:0,a=qT(o,{ease:`outCubic`,duration:75}),c=e?KT(o,{bounce:.65,duration:300}):qT(o,{ease:`inCubic`,duration:100}),l=TT(n.current,t?{rx:r,ry:r,cy:6,duration:0}:{rx:[{to:e?3.5:4.15,...a},{to:r,...c}],ry:[{to:e?4.5:3.85,...a},{to:r,...c}],cy:[{to:e?5.85:6.1,...a},{to:6,...c}]});return()=>{l.cancel()}},[e,s,o]),(0,R.jsxs)(`svg`,{ref:a,className:`caps-radio-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,R.jsx)(kT,{id:`${t}-shadow`}),(0,R.jsx)(AT,{id:`${t}-inset`}),(0,R.jsx)(`clipPath`,{id:`${t}-well`,children:(0,R.jsx)(`circle`,{cx:`6`,cy:`6`,r:`5`})})]}),(0,R.jsx)(`circle`,{className:`caps-radio-track`,cx:`6`,cy:`6`,r:`5.5`,filter:`url(#${t}-inset)`}),(0,R.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,R.jsx)(`ellipse`,{ref:n,cx:`6`,cy:`6`,rx:r?4:0,ry:r?4:0,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var g9=(0,F.createContext)(null),MIe=(0,F.forwardRef)(function({children:e,className:t,defaultValue:n,disabled:r=!1,name:i,onValueChange:a,orientation:o=`vertical`,value:s,...c},l){let u=(0,F.useId)(),d=(0,F.useRef)(null);(0,F.useImperativeHandle)(l,()=>{if(!d.current)throw Error(`RadioGroup is not mounted`);return d.current},[]);let f=i??`radio-group-${u}`,[p,m]=(0,F.useState)(n),h=s??p;return(0,F.useEffect)(()=>{let e=d.current?.form;if(!e||s!==void 0)return;let t=e=>{queueMicrotask(()=>{e.defaultPrevented||m(n)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[s,n,c.form]),(0,R.jsx)(g9.Provider,{value:{disabled:r,name:f,onValueChange:e=>{s===void 0&&m(e),a?.(e)},value:h},children:(0,R.jsx)(`fieldset`,{...c,className:cC(`flex gap-md`,o===`horizontal`?`flex-row flex-wrap`:`flex-col`,t),disabled:r,role:c.role??`radiogroup`,ref:d,children:e})})}),_9=(0,F.forwardRef)(function({className:e,indicator:t,onChange:n,onClick:r,value:i,...a},o){let s=(0,F.useContext)(g9);if(!s)throw Error(`RadioGroupItem must be used inside <RadioGroup>`);let c=s.value===i,l=e=>{n?.(e),e.target.checked&&s.onValueChange?.(i)};return(0,R.jsxs)(`span`,{className:`caps-radio`,"data-checked":c,"data-custom-indicator":t!==void 0||void 0,children:[(0,R.jsx)(`input`,{...a,"aria-checked":c,checked:c,className:cC(`caps-radio-input`,e),disabled:s.disabled||a.disabled,name:s.name,onChange:l,onClick:r,ref:o,type:`radio`,value:i}),t===void 0?(0,R.jsx)(jIe,{checked:c}):t]})}),NIe=(0,F.forwardRef)(function({description:e,id:t,meta:n,title:r,...i},a){let o=(0,F.useContext)(g9),s=(0,F.useId)(),c=t??s,l=o?.value===i.value,u=o?.disabled===!0||i.disabled===!0;return(0,R.jsxs)(`label`,{className:`caps-choice-card`,"data-checked":l,"data-disabled":u||void 0,htmlFor:c,children:[(0,R.jsx)(_9,{...i,"aria-describedby":e?`${c}-description`:void 0,"aria-labelledby":`${c}-title`,id:c,ref:a}),(0,R.jsxs)(`span`,{className:`caps-choice-card-copy`,children:[(0,R.jsx)(`span`,{className:`caps-choice-card-title`,id:`${c}-title`,children:r}),e?(0,R.jsx)(`span`,{className:`caps-choice-card-description`,id:`${c}-description`,children:e}):null]}),n?(0,R.jsx)(`span`,{className:`caps-choice-card-meta`,children:n}):null]})}),PIe=(0,F.forwardRef)(function({label:e,icon:t,caption:n,art:r=`dim`,className:i,...a},o){return(0,R.jsx)(`label`,{className:`caps-icon-choice`,"data-art":r===`color`?r:void 0,children:(0,R.jsx)(_9,{...a,"aria-label":e,className:cC(`caps-icon-choice-input`,i),indicator:(0,R.jsx)($T,{icon:t,caption:n}),ref:o})})});(0,F.forwardRef)(function({label:e,color:t,className:n,...r},i){return(0,R.jsx)(`label`,{className:`caps-icon-choice`,"data-art":`color`,"data-swatch":``,title:e,children:(0,R.jsx)(_9,{...r,"aria-label":e,className:cC(`caps-icon-choice-input`,n),indicator:(0,R.jsx)($T,{icon:(0,R.jsx)(`span`,{className:`caps-swatch-dot`,style:{backgroundColor:t}})}),ref:i})})});var FIe=(0,F.forwardRef)(function({className:e,invalid:t,...n},r){return(0,R.jsxs)(`span`,{className:`caps-select-shell`,children:[(0,R.jsx)(`select`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:cC(`select select-bordered caps-select w-full`,t&&`select-error`,e),ref:r}),!n.multiple&&(!n.size||n.size<=1)?(0,R.jsx)(F4,{className:`caps-select-chevron`,"aria-hidden":`true`}):null]})});function IIe({checked:e}){let t=`caps-switch-${(0,F.useId)().replaceAll(`:`,``)}`,n=(0,F.useRef)(null),r=(0,F.useRef)(null),i=(0,F.useRef)(e).current,a=(0,F.useRef)(e),o=_C();return(0,F.useLayoutEffect)(()=>{if(!n.current||!r.current)return;let t=o||a.current===e;a.current=e;let i=e?16:8,s=dC(n.current),c=KT(s,{bounce:.25,duration:440}),l=qT(s,{ease:`inOutSine`,duration:100}),u=TT(n.current,t?{x:2,y:2,width:i,height:8,duration:0}:{x:[{to:e?2.5:1.5,...l},{to:2,...c}],y:[{to:1.5,...l},{to:2,...c}],height:[{to:9,...l},{to:8,...c}],width:[{to:e?7:16.5,...l},{to:i,...c}]}),d=TT(r.current,{gradientTransform:e?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`,...t?{duration:0}:{delay:l.duration,...c}});return()=>{u.cancel(),d.cancel()}},[e,o]),(0,R.jsxs)(`svg`,{className:`caps-switch-visual`,width:`40`,height:`24`,viewBox:`0 0 20 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{ref:r,id:`${t}-surface`,transform:i?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`}),(0,R.jsx)(kT,{id:`${t}-shadow`}),(0,R.jsx)(AT,{id:`${t}-inset`}),(0,R.jsx)(`clipPath`,{id:`${t}-track`,children:(0,R.jsx)(`rect`,{x:`1`,y:`1`,width:`18`,height:`10`,rx:`5`})})]}),(0,R.jsx)(`rect`,{className:`caps-switch-track`,filter:`url(#${t}-inset)`,x:`0.5`,y:`0.5`,width:`19`,height:`11`,rx:`5.5`}),(0,R.jsx)(`g`,{clipPath:`url(#${t}-track)`,children:(0,R.jsx)(`rect`,{ref:n,x:`2`,y:`2`,width:i?16:8,height:`8`,rx:`4`,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var LIe=(0,F.forwardRef)(function({className:e,checked:t,defaultChecked:n=!1,onChange:r,onCheckedChange:i,...a},o){let s=(0,F.useRef)(null),[c,l]=(0,F.useState)(n),u=t??c;return(0,F.useImperativeHandle)(o,()=>{if(!s.current)throw Error(`Switch input is not mounted`);return s.current},[]),(0,F.useEffect)(()=>{let e=s.current?.form;if(!e||t!==void 0)return;let r=e=>{queueMicrotask(()=>{!e.defaultPrevented&&s.current&&l(n)})};return e.addEventListener(`reset`,r),()=>{e.removeEventListener(`reset`,r)}},[t,n,a.form]),(0,R.jsxs)(`span`,{className:`caps-switch`,"data-checked":u,children:[(0,R.jsx)(`input`,{...a,checked:u,className:cC(`caps-switch-input`,e),onChange:e=>{t===void 0&&l(e.target.checked),r?.(e),i?.(e.target.checked)},ref:s,role:`switch`,type:`checkbox`}),(0,R.jsx)(IIe,{checked:u})]})}),RIe=(0,F.forwardRef)(function({className:e,invalid:t,...n},r){return(0,R.jsx)(`textarea`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:cC(`textarea textarea-bordered w-full`,t&&`textarea-error`,e),ref:r})}),zIe=cg(vg),BIe=cg(bg),VIe=cg(Dg(Ig)),HIe=cg(Cg(vg)),v9=Cg(Mg(File)),UIe=cg(v9),y9=Tg([vg,Ig,bg,gg,_g,Cg(vg),v9]),WIe=cg(y9),b9=e=>zu(zIe(e.state.value),()=>``),x9=e=>zu(BIe(e.state.value),()=>!1),GIe=e=>zu(VIe(e.state.value),()=>null),KIe=e=>zu(HIe(e.state.value),()=>[]),qIe=e=>zu(UIe(e.state.value),()=>[]),JIe=e=>zu(WIe(e.state.value),()=>null);function YIe({field:e,spec:t,locked:n,...r}){let[i,a]=(0,F.useState)(!1);return(0,R.jsxs)(Y3,{children:[(0,R.jsx)(h9,{...r,name:t.name,disabled:n,type:i?`text`:`password`,autoComplete:`off`,spellCheck:!1,className:`caps-field-secret`,placeholder:t.placeholder,readOnly:t.readOnly,value:b9(e),onBlur:e.handleBlur,onChange:t=>{e.handleChange(t.currentTarget.value)}}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,size:`icon`,"aria-label":i?`Hide`:`Show`,"aria-pressed":i,disabled:n,onClick:()=>{a(e=>!e)},children:i?(0,R.jsx)(QAe,{"aria-hidden":`true`}):(0,R.jsx)($Ae,{"aria-hidden":`true`})})]})}var XIe={text:`text`,email:`email`,url:`url`,tel:`tel`};function ZIe({spec:e,field:t,locked:n,...r}){let i=qIe(t),a=n||e.readOnly===!0,o=(0,F.useRef)(null);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[(0,R.jsx)(vC,{asChild:!0,children:(0,R.jsx)(`input`,{...r,ref:o,type:`file`,tabIndex:-1,required:r.required===!0&&i.length===0,name:e.name,accept:e.accept,multiple:e.multiple,disabled:a,onBlur:t.handleBlur,onChange:e=>{t.handleChange(Array.from(e.currentTarget.files??[])),e.currentTarget.value=``}})}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,"aria-label":`Choose files for ${e.label}`,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],disabled:a,onBlur:t.handleBlur,onClick:()=>{o.current?.click()},children:`Choose files`}),(0,R.jsx)(Zje,{items:i.map((e,t)=>({id:String(t),name:e.name,preview:{kind:`file`},progress:0,progressLabel:`${String(e.size)} bytes`,statusLabel:`Selected`,actions:a?{}:{remove:{label:`Remove`,accessibleLabel:`Remove ${e.name}`}}})),onRemove:e=>{t.handleChange(i.filter((t,n)=>String(n)!==e))},onCancel:()=>void 0,onRetry:()=>void 0})]})}function QIe({spec:e,field:t,locked:n,...r}){let i=e=>{t.handleChange(e)},a={...r,name:e.name,disabled:n,onBlur:t.handleBlur};switch(e.kind){case`text`:case`email`:case`url`:case`tel`:return(0,R.jsx)(h9,{...a,type:XIe[e.kind],inputMode:e.kind===`text`?void 0:e.kind,autoComplete:e.autoComplete,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}});case`textarea`:return(0,R.jsx)(RIe,{...a,rows:e.rows??3,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}});case`secret`:return(0,R.jsx)(YIe,{...r,field:t,spec:e,locked:n});case`money`:return(0,R.jsxs)(Y3,{children:[(0,R.jsx)(X3,{className:`caps-field-currency`,children:e.currency??`USD`}),(0,R.jsx)(h9,{...a,inputMode:`decimal`,autoComplete:`off`,className:`caps-field-amount`,placeholder:e.placeholder??`0.00`,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}})]});case`date`:return(0,R.jsx)(h9,{...a,type:`date`,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}});case`number`:return(0,R.jsx)(Yje,{...a,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},...e.unit===void 0?{}:{unit:e.unit},...e.wrap===void 0?{}:{wrap:e.wrap},disabled:n||e.readOnly===!0,decrementLabel:`Decrease ${e.label}`,incrementLabel:`Increase ${e.label}`,value:GIe(t),onValueChange:e=>{t.handleChange(e)}});case`select`:return(0,R.jsxs)(FIe,{...a,value:b9(t),onChange:e=>{i(e.currentTarget.value)},children:[e.placeholder===void 0?null:(0,R.jsx)(`option`,{value:``,disabled:!0,children:e.placeholder}),e.options.map(e=>(0,R.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]});case`combobox`:return(0,R.jsx)(DIe,{id:r.id??e.name,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],"aria-required":r[`aria-required`],items:e.options,getKey:e=>e.value,getLabel:e=>e.label,isDisabled:t=>t.disabled||n||e.readOnly===!0,value:b9(t),...e.placeholder===void 0?{}:{placeholder:e.placeholder},trigger:(0,R.jsx)(TIe,{name:e.name,disabled:n||e.readOnly===!0,onBlur:t.handleBlur,children:e.options.find(e=>e.value===b9(t))?.label??e.placeholder??`Choose…`}),inputProps:{"aria-label":`Search ${e.label}`,disabled:n||e.readOnly===!0},onValueChange:e=>{i(e??``),t.handleBlur()}});case`file`:return(0,R.jsx)(ZIe,{...r,spec:e,field:t,locked:n});case`checkbox`:return(0,R.jsx)(i6,{...a,disabled:n||e.readOnly===!0,checked:x9(t),onChange:e=>{t.handleChange(e.currentTarget.checked)}});case`switch`:return(0,R.jsx)(LIe,{...a,disabled:n||e.readOnly===!0,checked:x9(t),onCheckedChange:e=>{t.handleChange(e)}});case`radio`:case`icon-radio`:case`checkboxes`:case`icon-checkboxes`:return null}}var $Ie=new Set([`radio`,`icon-radio`,`checkboxes`,`icon-checkboxes`]);function eLe({spec:e,field:t,locked:n,error:r,layout:i}){let a=n||e.readOnly===!0,o=e.label;if(e.kind===`checkboxes`||e.kind===`icon-checkboxes`){let n=KIe(t),s=(e,r)=>{t.handleChange(r?[...n,e]:n.filter(t=>t!==e))};return(0,R.jsx)(Q3,{legend:o,icon:e.icon,layout:i,...i===`columns`?{legendTitle:o}:{},description:e.help,disabled:a,error:r??null,children:e.kind===`icon-checkboxes`?(0,R.jsx)(`div`,{className:`caps-field-icon-choices`,children:e.options.map(r=>(0,R.jsx)(OIe,{name:e.name,value:r.value,label:r.label,...r.caption===void 0?{}:{caption:r.caption},icon:r.icon,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{s(r.value,e.currentTarget.checked)}},r.value))}):(0,R.jsx)(AIe,{children:e.options.map(r=>(0,R.jsx)(kIe,{name:e.name,value:r.value,label:r.label,icon:r.icon,hint:r.description,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{s(r.value,e.currentTarget.checked)}},r.value))})})}let s=e.options.some(e=>e.description!==void 0||e.meta!==void 0);return(0,R.jsx)(Q3,{legend:o,icon:e.icon,layout:i,...i===`columns`?{legendTitle:o}:{},description:e.help,disabled:a,error:r??null,children:(0,R.jsx)(MIe,{name:e.name,"aria-label":o,value:b9(t),onValueChange:e=>{t.handleChange(e),t.handleBlur()},orientation:e.kind===`icon-radio`||s?`horizontal`:`vertical`,children:e.options.map(t=>e.kind===`icon-radio`?(0,R.jsx)(PIe,{value:t.value,label:t.label,...t.caption===void 0?{}:{caption:t.caption},icon:t.icon,disabled:t.disabled},t.value):s?(0,R.jsx)(NIe,{value:t.value,title:t.label,description:t.description,meta:t.meta,disabled:t.disabled},t.value):(0,R.jsx)($3,{label:t.label,orientation:`inline`,children:(0,R.jsx)(_9,{value:t.value,disabled:t.disabled})},t.value))})})}function tLe({spec:e,field:t,locked:n,error:r,render:i,...a}){return i({name:e.name,label:e.label,help:e.help,value:JIe(t),onChange:e=>{t.handleChange(e)},onBlur:t.handleBlur,error:r,disabled:n,id:a.id??e.name,"aria-describedby":a[`aria-describedby`],"aria-invalid":r!==void 0})}function nLe({form:e,spec:t,locked:n,layout:r}){let i=J3({form:e,name:t.name}),a=K3(e.store,e=>e.submissionAttempts>0),o=i.state.meta.isBlurred||a?Lje(i.state.meta):void 0;if(t.render===void 0&&$Ie.has(t.kind))return(0,R.jsx)(eLe,{spec:t,field:i,locked:n,error:o,layout:r});let s=r===`columns`?t.kind===`switch`||t.kind===`checkbox`?`horizontal`:`vertical`:t.kind===`checkbox`?`inline`:(t.layout??(t.kind===`switch`?`row`:`stacked`))===`row`?`horizontal`:`vertical`;return(0,R.jsx)($3,{label:t.label,...r===`columns`?{labelTitle:t.label}:{},description:t.help,icon:t.icon,orientation:s,error:o,...t.required===void 0?{}:{required:t.required},...t.optional===void 0?{}:{optional:t.optional},children:t.render===void 0?(0,R.jsx)(QIe,{spec:t,field:i,locked:n}):(0,R.jsx)(tLe,{spec:t,field:i,locked:n,error:o,render:t.render})})}var rLe=cg(Sg(vg,y9));function S9({form:e,spec:t,locked:n,layout:r}){let i=t.when;return K3(e.store,e=>i===void 0||i(zu(rLe(e.values),()=>({}))))?(0,R.jsx)(nLe,{form:e,spec:t,locked:n,layout:r}):null}function iLe({form:e,section:t,locked:n,layout:r}){let i=t.fields.map(t=>(0,R.jsx)(S9,{form:e,spec:t,locked:n,layout:r},t.name));return t.title===void 0?i:(0,R.jsx)(Wje,{title:t.title,description:t.description,layout:r,children:i})}function C9({model:e,names:t,disabled:n=!1,layout:r}){let i=e.form;return t===void 0?e.description.sections.map(e=>(0,R.jsx)(iLe,{form:i,section:e,locked:n,layout:r},e.id??``)):t.map(t=>{let a=e.description.fields.find(e=>e.name===t);return a===void 0?null:(0,R.jsx)(S9,{form:i,spec:a,locked:n,layout:r},t)})}var w9=class{annotation;constructor(e){this.annotation=e}},aLe=class{sections;constructor(e){this.sections=e}},T9=`caps/form`,E9=0;function D9(e){E9+=1;let t={[`${T9}:${String(E9)}`]:new w9(e)};return e.label!==void 0&&(t.title=e.label),e.help!==void 0&&(t.description=e.help),t}vg.annotate(D9({kind:`secret`})).pipe(Ag(`Secret`));var O9=e=>{let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)};function oLe(e){return Object.values(e??{}).reduce((e,t)=>t instanceof w9?{...e,...t.annotation}:e,{})}function k9(e){return e.reduce((e,t)=>({...e,...oLe(t)}),{})}function A9(e){let t=e?.[T9];return t instanceof aLe?t.sections:{}}var j9=cg(vg);function M9(e){if(fm(e))return tee(j9(e.literal),{onNone:()=>null,onSome:e=>[e]});if(!gm(e))return null;let t=[];for(let n of e.types){if(um(n))continue;let e=M9(n);if(e===null)return null;t.push(...e)}return t}function N9(e){if(dm(e))return{type:`string`,literals:[]};if(Tne(e))return{type:`number`,nullable:!1};if(Ene(e))return{type:`boolean`};let t=M9(e);if(t!==null)return{type:`string`,literals:t};if(mm(e)){let[t]=e.rest;if(t===void 0)return null;if(dm(t))return{type:`strings`,literals:[]};let n=M9(t);return n===null?null:{type:`strings`,literals:n}}if(gm(e)){let t=e.types.filter(e=>!um(e)&&!lm(e)),n=e.types.some(e=>lm(e)),[r]=t;if(t.length!==1||r===void 0)return null;let i=N9(r);return i?.type===`number`?{type:`number`,nullable:n}:n?null:i}return null}function sLe(e){let t=e.ast;if(!hm(t))throw Error(`A schema form needs a Schema.Struct.`);return{fields:t.propertySignatures.map(e=>{let t=String(e.name),n=jh(e.type),r=k9([e.type.annotations,...(e.type.checks??[]).map(e=>e.annotations)]),i=r.kind===`file`?{type:`files`}:N9(n);if(i===null)throw Error(`Schema field "${t}" has no form control. Annotate it with field({ render }) or a kind.`);return{name:t,valueType:i,optional:e.type.context?.isOptional===!0,annotation:r,title:ire(e.type),description:are(e.type)}}),sections:A9(rre(t))}}function P9(e){let t=e,n=!1,r=!1;for(;;)if(t instanceof Oo)n=!0,t=t.unwrap();else if(t instanceof Mo)r=!0,t=t.unwrap();else if(t instanceof Po)t=t.unwrap();else if(t instanceof Ho)t=t.in;else return{node:t,optional:n,nullable:r}}function F9(e){if(e instanceof fo){let t=e.options.map(e=>F9(e));return t.some(e=>e===null)?null:t.flatMap(e=>e??[])}let t=e instanceof So?e.options:e instanceof wo?[...e.values]:null;if(t===null)return null;let n=t.map(e=>j9(e));return n.every(eee)?n.map(e=>e.value):null}function cLe(e){let{node:t,nullable:n}=P9(e);if(t instanceof Sa)return{type:`string`,literals:[]};if(t instanceof Ka)return{type:`number`,nullable:n};if(t instanceof Xa)return{type:`boolean`};let r=F9(t);if(r!==null)return{type:`string`,literals:r};if(t instanceof oo){let e=P9(t.element).node;if(e instanceof Sa)return{type:`strings`,literals:[]};let n=F9(e);return n===null?null:{type:`strings`,literals:n}}return null}function I9(e){let t=[e];for(;;){let e=t[t.length-1];if(e===void 0)break;let n=e instanceof Oo||e instanceof Mo||e instanceof Po?e.unwrap():e instanceof Ho?e.in:e;if(n===e)break;t.push(n)}return t.reverse().map(e=>ur.get(e))}function L9(e){return I9(e).reduce((e,t)=>({...e,...t}),{})}function lLe(e){return Object.entries(e.shape)}function uLe(e){let t=P9(e).node;if(!(t instanceof co))throw Error(`A schema form needs a z.object.`);return{fields:lLe(t).map(([e,t])=>{let n=k9(I9(t)),r=n.kind===`file`?{type:`files`}:cLe(t);if(r===null)throw Error(`Schema field "${e}" has no form control. Annotate it with field({ render }) or a kind.`);let i=L9(t);return{name:e,valueType:r,optional:P9(t).optional,annotation:n,title:i.title,description:i.description}}),sections:A9(L9(e))}}function dLe(e,t){let n=t.options??{};return(e.length>0?e:Object.keys(n)).map(e=>{let t=n[e],r=t===void 0?{}:t instanceof Object?t:{label:t};return{value:e,label:r.label??O9(e),description:r.description,meta:r.meta,icon:r.icon,caption:r.caption,disabled:r.disabled===!0}})}function fLe(e,t){let n=t.some(e=>e.icon!==void 0);switch(e.type){case`boolean`:return`switch`;case`number`:return`number`;case`strings`:return n?`icon-checkboxes`:`checkboxes`;case`files`:return`file`;case`string`:return t.length===0?`text`:t.length>12?`combobox`:n?`icon-radio`:t.some(e=>e.description!==void 0||e.meta!==void 0)||t.length<=3?`radio`:`select`}}function pLe(e,t){switch(e.type){case`boolean`:return!1;case`number`:return e.nullable?null:0;case`strings`:case`files`:return[];case`string`:return t[0]?.value??``}}function mLe(e){let t=e instanceof ba?uLe(e):sLe(e),n=t.fields.map((e,t)=>{let{kind:n,...r}=e.annotation,i=dLe(e.valueType.type===`string`||e.valueType.type===`strings`?e.valueType.literals:[],e.annotation),a=r.help??e.description;return{...r,name:e.name,label:r.label??e.title??O9(e.name),help:a,kind:n??fLe(e.valueType,i),options:i,optionalInSchema:e.optional,index:t}}),r={};t.fields.forEach((e,t)=>{let i=n[t];i&&(r[e.name]=pLe(e.valueType,i.options))});let i=e=>e.order??e.index,a=e=>e.section!==void 0&&Object.hasOwn(t.sections,e.section)?e.section:null,o=e=>n.filter(t=>a(t)===e).sort((e,t)=>i(e)-i(t)),s=Object.entries(t.sections).map(([e,t])=>({id:e,title:t.title,description:t.description,fields:o(e)}));return{fields:n,sections:[{id:null,title:void 0,description:void 0,fields:o(null)},...s].filter(e=>e.fields.length>0),defaults:r}}function R9(e){let t=e instanceof ba?e:Lre(e);return{"~standard":{...t[`~standard`],validate:e=>{let n=t[`~standard`].validate(e);return n instanceof Promise?n.then(e=>z9(e)):z9(n)}}}}function z9(e){return e.issues===void 0?e:{issues:e.issues.map(e=>e.path===void 0?e:{...e,path:e.path.slice(0,1)})}}var B9=`onServer`;function V9(e){let t=e.querySelector(`[aria-invalid="true"]`),n=t?.matches(`input, select, textarea, button, [tabindex]`)?t:t?.querySelector(`input, select, textarea, button`);return n?.focus(),n!=null}function hLe(e){if(V9(e))return()=>void 0;let t=new MutationObserver(()=>{V9(e)&&t.disconnect()});return t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-invalid`]}),()=>{t.disconnect()}}function gLe(e){return e.state.meta.errorMap.onServer!==void 0}function _Le(e){e.setMeta(e=>({...e,errorMap:{...e.errorMap,[B9]:void 0}}))}function vLe(e,t,n){e.setFieldMeta(t,e=>({...e,isBlurred:!0,errorMap:{...e.errorMap,[B9]:n}}))}function H9(e){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(e.defaultValues),[s,c]=(0,F.useState)(null);h3(a,e.defaultValues)||(o(e.defaultValues),c(null));let{schema:l}=e,u=(0,F.useMemo)(()=>mLe(l),[l]),d=(0,F.useMemo)(()=>R9(l),[l]),f=Pje({defaultValues:s??a,validators:{onChange:d,onSubmit:d},listeners:{onChange:({fieldApi:e})=>{n(null),i(null),gLe(e)&&_Le(e)}},onSubmit:async({value:t,formApi:r})=>{n(null),i(null);let a=await R9(l)[`~standard`].validate(t);if(a.issues){n(a.issues[0]?.message??`Check the form and try again.`);return}let o;try{o=await e.onSubmit(a.value,t)??{kind:`saved`}}catch(t){console.error(`SchemaForm submit failed`,t),n(e.failure??`Couldn't save changes. Try again.`);return}if(o.kind===`refused`){n(o.error??null);let e=r;for(let[t,n]of Object.entries(o.fields??{}))n!==void 0&&n.length>0&&vLe(e,t,n);return}let s=o.values??t;c(s),r.reset(s),i(o.message??`Saved`),e.onSaved?.(s)}});return{description:u,form:f,error:t,saved:r,discard:()=>{n(null),i(null),f.reset()},submit:()=>f.handleSubmit()}}function U9(e){return{dirty:K3(e.form.store,e=>!e.isDefaultValue),submitting:K3(e.form.store,e=>e.isSubmitting),canSubmit:K3(e.form.store,e=>e.canSubmit)}}function W9({model:e,submitLabel:t=`Save changes`,discardLabel:n,onCancel:r,cancelLabel:i,allowClean:a,layout:o,footer:s,children:c,disabled:l=!1,...u}){let{submitting:d}=U9(e),f=(0,F.useRef)(null),p=(0,F.useRef)(()=>void 0);return(0,F.useEffect)(()=>()=>{p.current()},[]),(0,R.jsxs)(Hje,{...u,ref:f,layout:o,busy:d,noValidate:!0,onSubmit:t=>{t.preventDefault(),e.form.state.isSubmitting||e.submit().then(()=>{p.current();let t=f.current;t!==null&&!e.form.state.isValid&&(p.current=hLe(t))})},children:[c??(0,R.jsx)(C9,{model:e,disabled:l,layout:o}),s===void 0?(0,R.jsx)(bLe,{model:e,label:t,discardLabel:r===void 0?n:void 0,onCancel:r,cancelLabel:i,allowClean:a??r!==void 0,divider:r===void 0}):s]})}function yLe({schema:e,defaultValues:t,onSubmit:n,onSaved:r,failure:i,...a}){let o=H9({schema:e,defaultValues:t,onSubmit:n,onSaved:r,failure:i});return(0,R.jsx)(W9,{...a,model:o})}function G9(e){return`model`in e?(0,R.jsx)(W9,{...e}):(0,R.jsx)(yLe,{...e})}function bLe({model:e,label:t,discardLabel:n,onCancel:r,cancelLabel:i=`Cancel`,allowClean:a=!1,dirtyLabel:o=`Unsaved changes`,buttonProps:s,...c}){let{dirty:l,submitting:u}=U9(e),d=u?null:e.saved&&!l?(0,R.jsx)(QT,{tone:`success`,size:`compact`,label:e.saved}):l?(0,R.jsx)(QT,{tone:`neutral`,size:`compact`,label:o}):null;return(0,R.jsxs)(Vje,{...c,error:e.error,status:d,children:[r?(0,R.jsx)(zT,{type:`button`,variant:`ghost`,disabled:u,onClick:r,children:i}):n&&l?(0,R.jsx)(zT,{type:`button`,variant:`ghost`,disabled:u,onClick:e.discard,children:n}):null,(0,R.jsx)(zT,{...s,type:`submit`,loading:u,disabled:u||!l&&!a,title:!l&&!a?`No changes to save`:void 0,children:t})]})}function xLe({duration:e,paused:t=!1,onBurnt:n,className:r}){let i=(0,F.useRef)(null),a=(0,F.useRef)(null),o=(0,F.useRef)(n);return(0,F.useEffect)(()=>{o.current=n},[n]),(0,F.useLayoutEffect)(()=>{let t=i.current;if(!t)return;if(!hC(t)){let t=setTimeout(()=>{o.current()},e);return()=>{clearTimeout(t)}}let n=dC(t),r=Math.max(1,Math.round(e/1e3)),s=t.animate([{transform:`scaleX(1)`},{transform:`scaleX(0)`}],{duration:e,easing:n.reduced?`steps(${String(r)}, end)`:mC(n,`linear`),fill:`forwards`});return s.addEventListener(`finish`,()=>{o.current()}),a.current=s,()=>{s.cancel(),a.current=null}},[e]),(0,F.useEffect)(()=>{let e=a.current;e&&(t?e.pause():e.playState===`paused`&&e.play())},[t]),(0,R.jsx)(`span`,{ref:i,"aria-hidden":`true`,className:cC(`caps-fuse`,r)})}var SLe=(0,F.forwardRef)(function({children:e,onCommit:t,armedAnnouncement:n,undoneAnnouncement:r,undoLabel:i=`Undo`,undoMs:a=5e3,className:o,onKeyDown:s,onPointerEnter:c,onPointerLeave:l,...u},d){let[f,p]=(0,F.useState)(!1),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(``),v=(0,F.useId)(),y=()=>{p(!1),_(r)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(zT,{...u,ref:d,"aria-label":f?void 0:u[`aria-label`],"aria-labelledby":f?void 0:u[`aria-labelledby`],"aria-describedby":f?v:u[`aria-describedby`],className:cC(`caps-undo-action`,o),"data-armed":f?``:void 0,onClick:()=>{if(f){y();return}p(!0),_(n)},onKeyDown:e=>{s?.(e),f&&e.key===`Escape`&&(e.preventDefault(),y())},onPointerEnter:e=>{c?.(e),h(!0)},onPointerLeave:e=>{l?.(e),h(!1)},children:[f?i:e,f?(0,R.jsx)(xLe,{duration:a,paused:m,onBurnt:()=>{p(!1),_(``),t()}}):null]}),(0,R.jsx)(vC,{id:v,children:`Press Escape to undo.`}),(0,R.jsx)(vC,{role:`status`,children:g})]})}),K9=new Set([`Enter`,` `]),CLe=(0,F.forwardRef)(function({children:e,onConfirm:t,holdMs:n=900,holdHint:r=`Press and hold to confirm.`,className:i,disabled:a,loading:o=!1,result:s,resultLabel:c,onBlur:l,onKeyDown:u,onKeyUp:d,onPointerDown:f,onPointerUp:p,onPointerLeave:m,onPointerCancel:h,...g},_){let v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(null),x=(0,F.useRef)(null),S=(0,F.useRef)(t),C=(0,F.useId)();(0,F.useEffect)(()=>{S.current=t},[t]),(0,F.useEffect)(()=>()=>{y.current?.cancel(),b.current!==null&&clearTimeout(b.current)},[]);let w=()=>{y.current=null,b.current=null,x.current=null,S.current();let e=v.current;if(!e||!hC(e))return;let t=dC(e);e.animate([{opacity:1},{opacity:0}],{duration:t.normal,easing:mC(t,t.easeExit)})},T=e=>{let t=v.current;if(a===!0||o||!t||y.current||b.current)return;if(x.current=e,!hC(t)){b.current=setTimeout(w,n);return}let r=dC(t),i=t.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:n,easing:r.reduced?`steps(3, end)`:mC(r,`cubic-bezier(0.3, 0, 0.7, 1)`)});i.addEventListener(`finish`,w),y.current=i},E=e=>{if(e!==void 0&&x.current!==e)return;x.current=null,b.current!==null&&(clearTimeout(b.current),b.current=null);let t=y.current,n=v.current;if(!t||!n)return;y.current=null;let r=getComputedStyle(n).transform;t.cancel();let i=dC(n);n.animate([{transform:r===`none`?`scaleY(0)`:r},{transform:`scaleY(0)`}],{duration:i.fast,easing:mC(i,i.ease)})};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(zT,{...g,ref:_,disabled:a,loading:o,result:s,resultLabel:c??(s===void 0?void 0:e),"aria-describedby":C,className:cC(`caps-hold-button`,i),onBlur:e=>{E(),l?.(e)},onPointerDown:e=>{f?.(e),e.button===0&&T(e.pointerId)},onPointerUp:e=>{p?.(e),E(e.pointerId)},onPointerLeave:e=>{m?.(e),E(e.pointerId)},onPointerCancel:e=>{h?.(e),E(e.pointerId)},onKeyDown:e=>{u?.(e),e.key===`Escape`&&E(),K9.has(e.key)&&(e.preventDefault(),e.repeat||T(`key`))},onKeyUp:e=>{d?.(e),K9.has(e.key)&&(e.preventDefault(),E(`key`))},children:[(0,R.jsx)(`span`,{ref:v,"aria-hidden":`true`,className:`caps-hold-fill`}),e]}),(0,R.jsx)(vC,{id:C,children:r})]})}),q9=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`code`,{...t,className:cC(`caps-inline-code`,e),ref:n})}),J9=`data-reorder-key`;function wLe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{element:t,top:r.top-n.top+e.scrollTop,left:r.left-n.left+e.scrollLeft,width:r.width,height:r.height}}function TLe(e,t,n){e.forEach((e,r)=>{e.animate(t.reduced?[{opacity:0},{opacity:1}]:[{opacity:0,transform:`translateY(${String(t.distance)}px)`},{opacity:1,transform:`none`}],{duration:t.normal,delay:n+r*t.stagger,easing:mC(t,t.ease),fill:`backwards`})})}function ELe(e,t,n){let r=t.element.cloneNode(!0);if(!(r instanceof HTMLElement))return;r.removeAttribute(J9),r.removeAttribute(`id`),r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`inert`,``),Object.assign(r.style,{position:`absolute`,top:`${String(t.top-e.clientTop)}px`,left:`${String(t.left-e.clientLeft)}px`,width:`${String(t.width)}px`,height:`${String(t.height)}px`,margin:`0`,pointerEvents:`none`});let i=getComputedStyle(e).position!==`static`;i||(e.style.position=`relative`),e.append(r);let a=r.animate(n.reduced?[{opacity:1},{opacity:0}]:[{opacity:1,transform:`none`},{opacity:0,transform:`translateY(${String(-n.distance)}px)`}],{duration:n.fast,easing:mC(n,n.easeExit),fill:`forwards`}),o=()=>{r.remove(),!i&&e.querySelector(`:scope > [inert]`)===null&&e.style.removeProperty(`position`)};a.addEventListener(`finish`,o),a.addEventListener(`cancel`,o)}function DLe(e,t,n,r){let i=e.style.overflow;e.style.overflow=`clip`;let a=e.animate([{height:`${String(t)}px`},{height:`${String(n)}px`}],r),o=()=>{e.style.overflow=i};return a.addEventListener(`finish`,o),a.addEventListener(`cancel`,o),a}function OLe(e,t){let n=(0,F.useRef)(null),r=(0,F.useRef)(0),i=(0,F.useRef)(null),a=t.join(`\0`);(0,F.useLayoutEffect)(()=>{let o=e.current;if(o===null){n.current=null;return}let s=n.current,c=s?.order!==a,l=i.current?o.getBoundingClientRect().height:r.current;c&&(i.current?.cancel(),i.current=null);let u=c?o.getBoundingClientRect().height:r.current;r.current=u;let d=new Map;for(let e of o.querySelectorAll(`:scope [${J9}]`)){let t=e.getAttribute(J9);if(t===null)continue;let n=s?.rows.get(t);d.set(t,!c&&n?.element===e?n:wLe(o,e))}let f=new Set(t);if(n.current={order:a,keys:f,rows:d},s===null||!c||!hC(o))return;let p=dC(o),m=[...s.rows].filter(([e,t])=>!f.has(e)&&!t.element.isConnected),h={duration:p.slow,delay:m.length>0?p.fast:0,easing:mC(p,p.ease),fill:`backwards`},g=[],_=[];for(let[e,t]of d){let n=s.rows.get(e);if(n===void 0){s.keys.has(e)||g.push(t.element);continue}let r=n.left-t.left,i=n.top-t.top;(r!==0||i!==0)&&(_.push(t.element),!(p.reduced||p.slow<=0)&&t.element.animate([{transform:`translate(${String(r)}px, ${String(i)}px)`},{transform:`none`}],h))}if(p.reduced)for(let e of _)e.animate([{opacity:.3},{opacity:1}],{duration:p.fast,easing:p.ease});else for(let[,e]of m)ELe(o,e,p);if(TLe(g,p,_.length>0&&!p.reduced?p.fast:0),!p.reduced&&Math.abs(l-u)>.5){let e=DLe(o,l,u,h);i.current=e,e.addEventListener(`finish`,()=>{i.current===e&&(i.current=null)})}})}var kLe=L({port:yS.fields.port.annotate(D9({label:`Port`,min:1,max:65535}))}),ALe=L({command:Xg.pipe(kg(Jg(16384))).annotate(D9({label:`Command`,required:!0})),port:Dg(yS.fields.port).annotate(D9({label:`Port (optional)`,min:1,max:65535,render:e=>(0,R.jsx)(h9,{name:e.name,id:e.id,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:e.value??``,disabled:e.disabled,"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],onBlur:()=>{e.onBlur()},onChange:t=>{let n=t.currentTarget;e.onChange(n.value===``?null:n.valueAsNumber)}})}))}),Y9=[{command:`npm run dev`,port:3e3},{command:`python3 -m http.server 8000`,port:8e3}];function jLe({openPreview:e,openId:t,onOpenChange:n,processNavigation:r=null,leading:i,trailing:a,placement:o=`housing`,extraItems:s=[],hostInset:c}){let{ports:{items:l,status:u,actions:d,refresh:f,expose:p,unexpose:m},processes:{items:h,loading:g,error:_,fix:v,actions:y,refresh:b,stop:x,start:S}}=_D(),C=(0,F.useRef)(null),w=(0,F.useRef)(0),[T,E]=(0,F.useState)(null),D=e=>{Date.now()-w.current<900&&E(e)},O=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(t!==`processes`||!r||O.current===r.requestId||!C.current)return;let e=[...C.current.querySelectorAll(`[${J9}]`)].find(e=>e.getAttribute(J9)===r.processId);e&&(e.focus(),O.current=r.requestId)},[t,r,h]);let k=H9({schema:kLe,defaultValues:{port:5173},onSubmit:async({port:e})=>await p?.(e)?{kind:`saved`}:{kind:`refused`,fields:{port:`Couldn't expose port ${String(e)}. Try again.`}}}),A=H9({schema:ALe,defaultValues:{command:``,port:null},onSubmit:async({command:e,port:t})=>await S?.(t===null?{command:e}:{command:e,port:t})?{kind:`saved`}:{kind:`refused`,fields:{command:`Couldn’t confirm the process start. Try again.`}}}),j=()=>{k.form.setFieldMeta(`port`,e=>({...e,errorMap:{...e.errorMap,onServer:void 0}}))},M=async e=>{await p?.(e)&&k.form.state.values.port===e&&j()},ee=l?.length??0,N=new Map;for(let e of l??[])N.set(e.port,e);for(let[e,t]of d??[])t.expose&&!N.has(e)&&N.set(e,null);let te=h!==null||g||_!==null,ne=u===`not-configured`?(0,R.jsx)(B4,{title:`Preview service isn't configured`,children:`You can still work in the terminal.`}):l===null&&u===`unavailable`?(0,R.jsx)(B4,{title:`Port listing isn't available`,children:`You can still work in the terminal.`}):l===null&&u===`loading`?(0,R.jsx)(B4,{title:`Loading exposed ports`,children:`Checking which ports this Computer has exposed.`}):l===null&&u===`error`?(0,R.jsx)(B4,{title:`Couldn't load exposed ports`,children:`Check the Computer connection, then refresh to try again.`}):(0,R.jsxs)(R.Fragment,{children:[N.size>0?(0,R.jsx)(Z9,{label:`Exposed ports`,order:Array.from(N.keys(),String),children:Array.from(N,([t,n])=>{let r=d?.get(t),i=r?.status===`pending`,a=r?.status===`failed`?r.expose?`Couldn't expose port ${String(t)}. Try again.`:`Couldn't remove exposure. Try again.`:null;return(0,R.jsx)(z4,{[J9]:String(t),role:`listitem`,"data-shed-port":t,icon:(0,R.jsx)(ZAe,{size:16,"aria-hidden":`true`}),primary:a?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`block`,children:[`Port `,t]}),(0,R.jsx)(`span`,{role:`status`,className:`block whitespace-normal text-xs font-normal text-error`,children:a})]}):`Port ${String(t)}`,actions:n?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(zT,{size:`xs`,variant:`ghost`,disabled:i,onClick:()=>{e(n)},"aria-label":`Open preview of port ${String(t)}`,children:[(0,R.jsx)(P4,{size:14,"aria-hidden":`true`}),`Open preview`]}),(0,R.jsx)(SLe,{"aria-label":`Stop exposing port ${String(t)}`,armedAnnouncement:`Port ${String(t)} closes in 5 seconds.`,undoneAnnouncement:`Port ${String(t)} stays open.`,size:`xs`,variant:`ghost`,className:`hover:text-error`,disabled:!m||i,onCommit:()=>{m?.(t)},children:i?r.expose?`Exposing…`:`Removing…`:`Remove exposure`})]}):(0,R.jsx)(zT,{size:`xs`,variant:`ghost`,disabled:!p||i,"aria-label":`Expose port ${String(t)}`,onClick:()=>{M(t)},children:i?`Exposing…`:`Try again`})},t)})}):(0,R.jsx)(B4,{title:u===`error`?`Couldn't load exposed ports`:`No exposed ports`,children:u===`error`?`Check the Computer connection, then refresh to try again.`:`Expose a port from this Computer to see it here.`}),(0,R.jsx)(k.form.Subscribe,{selector:e=>({submitting:e.isSubmitting,port:e.values.port}),children:({submitting:e,port:t})=>{let n=e||d?.get(t)?.status===`pending`,r=p===void 0||n;return(0,R.jsx)(G9,{model:k,className:`mt-3 px-2`,"aria-label":`Expose a port`,disabled:r,footer:null,children:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(C9,{model:k,disabled:r})}),(0,R.jsx)(zT,{className:`self-end`,type:`submit`,size:`sm`,disabled:r,loading:n,onClick:j,children:`Expose`})]})})}}),u===`loading`&&l!==null?(0,R.jsx)(`p`,{className:`mt-2 text-xs text-base-content/60`,role:`status`,children:`Refreshing exposed ports…`}):null,u===`error`&&l!==null?(0,R.jsx)(`p`,{className:`mt-2 text-xs text-error`,role:`status`,children:`Couldn't refresh exposed ports. The list may be out of date.`}):null]}),re=te?g&&h===null?(0,R.jsx)(B4,{title:`Loading processes`,children:`Checking this Computer's process inventory.`}):_!==null&&h===null?(0,R.jsx)(`div`,{className:`px-2 pb-3`,children:(0,R.jsx)(vD,{tone:_.reason===`failed`?`error`:`warning`,role:`status`,title:`Can't run commands`,description:_.message,action:v===void 0?void 0:(0,R.jsx)(zT,{size:`xs`,variant:`outline`,onClick:()=>void v(),children:_.action===`grant`?`Allow access`:`Try again`})})}):h===null||h.length===0?(0,R.jsx)(`div`,{className:`px-2 pb-3`,children:(0,R.jsx)(vE,{variant:`quiet`,headingLevel:3,title:`Nothing running`,description:(0,R.jsxs)(R.Fragment,{children:[`Start a dev server, for example`,` `,(0,R.jsx)(q9,{children:`npm run dev`}),`.`]}),actions:(0,R.jsx)(`ul`,{"aria-label":`Try one of these`,className:`m-0 flex list-none flex-wrap gap-2 p-0`,children:Y9.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(zT,{size:`sm`,variant:`outline`,onClick:()=>{A.form.setFieldValue(`command`,e.command),A.form.setFieldValue(`port`,e.port),document.querySelector(`[aria-label="Start a process"] button[type="submit"]`)?.focus()},children:(0,R.jsx)(q9,{children:e.command})})},e.command))})})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`px-1`,children:(0,R.jsx)(Z9,{label:`Computer process inventory`,order:h.map(({id:e})=>e),listRoot:C,children:h.map(t=>{let n=y?.get(t.id),r=t.state===`running`?l?.find(e=>e.port===t.port):void 0,i=t.state===`exited`&&t.exitCode!==null&&t.exitCode!==0,a=`neutral`,o=`Finished`;t.state===`exited`&&t.exitCode===null?(a=`warning`,o=`Ended · exit not recorded`):t.state===`running`?(a=`success`,o=`Running`):t.state===`uncertain`?(a=`warning`,o=`Status unknown`):i&&(a=`error`,o=`Failed · exit ${String(t.exitCode)}`);let s=t.state===`exited`&&t.sync===`pending`;return(0,R.jsx)(z4,{[J9]:t.id,role:`listitem`,"data-process-state":t.state,"data-process-sync":t.sync,className:`py-2`,tabIndex:-1,primary:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(q9,{className:`block truncate`,"data-process-command":!0,children:t.command}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-normal`,children:[(0,R.jsx)(QT,{size:`compact`,tone:a,label:n===`stopping`?`Stopping`:o}),t.port===null?null:(0,R.jsxs)(`span`,{"data-process-port":!0,children:[`Port `,t.port]})]}),n===`failed`?(0,R.jsxs)(`span`,{role:`status`,className:`block whitespace-normal text-xs font-normal text-error`,children:[`Couldn't stop `,t.command,`. Try again.`]}):(0,R.jsxs)(R.Fragment,{children:[T===t.id?(0,R.jsx)(`span`,{role:`status`,className:`block text-xs font-normal text-(--stipe-fg-muted)`,children:`Hold to stop`}):null,s?(0,R.jsx)(`span`,{className:`block truncate text-xs font-normal text-(--stipe-fg-muted)`,children:`Changes still copying to your files`}):null,t.cwd===null?null:(0,R.jsx)(`span`,{className:`block truncate text-xs font-normal text-(--stipe-fg-muted)`,children:t.cwd})]})]}),actions:(0,R.jsxs)(R.Fragment,{children:[r?(0,R.jsxs)(zT,{size:`xs`,variant:`ghost`,"aria-label":`Open preview of port ${String(r.port)}`,onClick:()=>{e(r)},children:[(0,R.jsx)(P4,{size:14,"aria-hidden":`true`}),` Open`]}):null,t.state===`running`&&x?(0,R.jsx)(CLe,{holdHint:`A stopped process cannot be resumed. Press and hold to stop it.`,size:`xs`,variant:`ghost`,className:`hover:text-error`,disabled:n===`stopping`,"aria-label":`Stop process ${t.command}`,onPointerDown:()=>{w.current=Date.now(),E(null)},onPointerUp:()=>{D(t.id)},onConfirm:()=>{E(null),x(t.id)},children:n===`stopping`?`Stopping…`:`Stop`}):null]})},t.id)})})}),g?(0,R.jsx)(`p`,{className:`mt-2 text-xs text-base-content/60`,role:`status`,children:`Refreshing processes…`}):null,_===null?null:(0,R.jsx)(`p`,{className:`mt-2 text-xs text-error`,role:`status`,children:`Couldn't refresh processes. The list may be out of date.`})]}):(0,R.jsx)(B4,{title:`Processes can't be listed yet`,children:`You can still run things in the terminal.`}),P=[{id:`ports`,label:`Ports`,count:ee,title:`Exposed ports`,actions:(0,R.jsx)(R4,{"aria-label":`Refresh exposed ports`,title:`Refresh exposed ports`,icon:(0,R.jsx)(I4,{}),size:`xs`,iconSize:`xs`,disabled:!f||u===`loading`,onClick:()=>{f?.()}}),content:ne},{id:`processes`,label:`Processes`,count:h?.filter(e=>e.state===`running`).length,title:`Processes`,disabled:!te,accessibleLabel:te?void 0:`Processes can't be listed yet`,actions:(0,R.jsx)(R4,{"aria-label":`Refresh processes`,title:`Refresh processes`,icon:(0,R.jsx)(I4,{}),size:`xs`,iconSize:`xs`,disabled:!b||g,onClick:()=>{b?.()}}),content:(0,R.jsxs)(R.Fragment,{children:[re,S&&(_===null||_.reason===`failed`)?(0,R.jsx)(A.form.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,R.jsx)(G9,{model:A,"aria-label":`Start a process`,className:`mt-3 px-2`,disabled:e,footer:(0,R.jsx)(`div`,{className:`flex justify-end`,children:(0,R.jsx)(zT,{type:`submit`,variant:`primary`,size:`sm`,loading:e,disabled:e,onClick:()=>{A.form.setFieldMeta(`command`,e=>({...e,errorMap:{...e.errorMap,onServer:void 0}}))},children:`Start`})}),children:(0,R.jsx)(C9,{model:A,disabled:e})})}):null]})},...s];return(0,R.jsx)(sje,{items:P,openId:t,onOpenChange:n,leading:i,trailing:a,placement:o,...c===void 0?{}:{hostInset:c},align:o===`host`?`start`:`end`})}function X9({port:e,onClose:t,onPopOut:n}){let[r,i]=(0,F.useState)(0);return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden rounded-field bg-base-100`,"aria-label":`Preview port ${String(e.port)}`,children:[(0,R.jsxs)(`div`,{className:`shed-browser-controls flex h-8 shrink-0 items-center gap-1 border-b border-base-300 px-1`,children:[(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 truncate px-2 font-mono text-xs`,children:[`:`,e.port]}),(0,R.jsx)(R4,{"aria-label":`Open preview in new window`,title:`Open preview in new window`,icon:(0,R.jsx)(P4,{}),size:`xs`,iconSize:`xs`,onClick:n}),(0,R.jsx)(R4,{"aria-label":`Reload preview`,title:`Reload preview`,icon:(0,R.jsx)(I4,{}),size:`xs`,iconSize:`xs`,onClick:()=>{i(e=>e+1)}}),(0,R.jsx)(R4,{"aria-label":`Close preview`,title:`Close preview`,icon:(0,R.jsx)(L4,{"aria-hidden":`true`}),size:`xs`,iconSize:`xs`,onClick:t})]}),(0,R.jsx)(`iframe`,{className:`shed-preview-frame block min-h-0 w-full flex-1 border-0 bg-base-100`,sandbox:`allow-scripts allow-same-origin allow-popups`,src:e.previewUrl,title:`Preview · port ${String(e.port)}`},`${String(e.port)}:${String(r)}`)]})}function Z9({label:e,order:t,children:n,listRoot:r}){let i=(0,F.useRef)(null),a=r??i;return OLe(a,t),(0,R.jsx)(`div`,{ref:a,children:(0,R.jsx)(cje,{role:`list`,"aria-label":e,children:n})})}var MLe=cg(xS.fields.id);function NLe({app:e}){let t=Ux(e?.context)??null;return(0,R.jsx)(PLe,{app:e,appContext:t},JSON.stringify([e?.identity.surfaceId,t?.computerId]))}function PLe({app:e,appContext:t}){let n=t?.computerId??null,{query:r,ports:i,status:a,actions:o,enabled:s,change:c}=Ape(e,t?.visibility===`visible`),l=(0,F.useCallback)(async()=>{await r.refetch()},[r.refetch]),{query:u,stop:d,startCommand:f,actions:p,enabled:m}=Ope(e,t?.visibility===`visible`),h=(0,F.useCallback)(async()=>{await u.refetch()},[u.refetch]),g=(0,F.useRef)({refreshPorts:l,refreshProcesses:h});if(g.current={refreshPorts:l,refreshProcesses:h},(0,F.useEffect)(()=>{if(e)return js(e.commands,ILe(()=>g.current.refreshPorts(),()=>g.current.refreshProcesses()))},[e]),t?.teamHasComputers===!1)return(0,R.jsx)(FLe,{onAllowAccess:e&&!t.computerAccessGranted?()=>void e.ui.requestAppPermissions({computers:[`computer.execute`]}).catch(e=>{console.error(`Shed Computer operation failed`,e)}):void 0});let _=m&&u.isError?bue(u.error):null,v=_?.action===`retry`?h:_?.action===`grant`&&e?()=>void e.ui.requestAppPermissions({computers:[`computer.execute`]}).catch(e=>{console.error(`Shed Computer operation failed`,e)}):void 0;return(0,R.jsx)(gD.Provider,{value:{ports:{items:i,status:a,actions:o,refresh:s?l:void 0,expose:s?e=>c(e,!0):void 0,unexpose:s?e=>{c(e,!1)}:void 0},processes:{items:m?u.data?.processes??null:null,loading:m&&u.isFetching,error:_,fix:v,actions:p,refresh:m?h:void 0,start:m?f:void 0,stop:m?e=>{d.mutate(e)}:void 0}},children:(0,R.jsx)(LLe,{app:e,computerId:n,computerAccessGranted:t?.computerAccessGranted===!0},n)})}function FLe({onAllowAccess:e}){return(0,R.jsx)(`main`,{className:`grid h-full min-h-0 grid-cols-1 place-items-center bg-base-200 p-6 text-base-content`,children:(0,R.jsx)(vE,{className:`w-full max-w-[460px]`,"data-absence":`team-computers-empty`,variant:`panel`,visual:(0,R.jsx)(`span`,{className:`inline-grid size-16 place-items-center rounded-full bg-base-200 text-primary`,children:(0,R.jsx)(gE,{name:`computer`,size:48})}),title:`No Computer yet.`,description:e?`No Computer is attached to this window. Allow Computer access to use one here.`:`No Computer is attached to this window.`,actions:e?(0,R.jsx)(zT,{size:`sm`,onClick:e,children:`Allow Computer access`}):null})})}function ILe(e,t){return[{id:`refresh-processes`,title:`Refresh processes`,category:`Computer`,description:`Refresh the running processes on this Computer.`,projections:{palette:{}},handler:t},{id:`refresh-ports`,title:`Refresh forwarded ports`,category:`Computer`,description:`Refresh the forwarded ports on this Computer.`,projections:{palette:{}},handler:e}]}function LLe({app:e,computerId:t,computerAccessGranted:n=!1}){let r=(0,F.useRef)(null),[i,a]=(0,F.useState)({width:0,height:0});(0,F.useEffect)(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(([e])=>{a({width:e.contentRect.width,height:e.contentRect.height})});return t.observe(e),()=>{t.disconnect()}},[]);let o=t!==null&&e?.capabilities.has(wS)===!0,{ports:{items:s,status:c},processes:{items:l,loading:u,error:d}}=_D(),[f,p]=(0,F.useState)(null),m=Ux(e?.context)?.openRequest??null,h=(0,F.useRef)(null),[g,_]=(0,F.useState)(null);(0,F.useEffect)(()=>{if(t===null||m?.kind!==`navigate`||h.current===m.requestId)return;let e=m.params.filter(({key:e})=>e===`process`);if(e.length!==1)return;let n=Bu(MLe(e[0]?.value));n!==null&&(h.current=m.requestId,_({requestId:m.requestId,processId:n}),p(`processes`))},[t,m]);let[v,y]=(0,F.useState)(void 0),[b,x]=(0,F.useState)(null),[S,C]=(0,F.useState)(!1),[w,T]=(0,F.useState)(null),E=(0,F.useCallback)(e=>{t!==null&&T({...e,computerId:t})},[t]),D=o&&w?.computerId===t?w:null,O=i.width<540,k=s?.find(e=>e.port===b)??null,A=e=>{if(e.openMode===`external-only`){window.open(e.previewUrl,`_blank`,`noopener,noreferrer`);return}x(e.port),C(!0),p(null)},j=l!==null||u||d!==null,M=xpe({app:e,terminal:D,processes:d===null?l===null?u?{kind:`loading`}:{kind:`unavailable`}:{kind:`loaded`,count:l.length}:{kind:`error`},ports:c===`error`?{kind:`error`}:c===`loaded`&&s!==null?{kind:`loaded`,count:s.length}:c===`loading`?{kind:`loading`}:{kind:`unavailable`}});return Nle(e,t===null?[]:[...D?[{kind:`text`,id:`terminal`,text:`Terminal ${D.state}`,tone:zLe(D.state)}]:o?[]:[{kind:`text`,id:`terminal`,text:`Terminal unavailable`,tone:`warning`}],...c===`not-configured`?[]:[{kind:`button`,id:`ports`,text:`Ports`,icon:`ports`,count:s?.length??0,opens:`dialog`,expanded:f===`ports`}],{kind:`button`,id:`processes`,text:`Processes`,icon:`processes`,opens:`dialog`,expanded:f===`processes`,count:l?.filter(e=>e.state===`running`).length??0,disabled:!j,title:j?`Processes on this Computer`:`Processes can't be listed yet`},...O&&k?[{kind:`toggle`,id:`screen`,text:`:${String(k.port)}`,pressed:S}]:[],{kind:`button`,id:`access`,text:`Access`,icon:`access`,opens:`dialog`,expanded:f===`access`,title:o?`Shed can run commands on this Computer`:`Shed can't run commands on this Computer`}],e=>e.itemId===`screen`?(C(e=>!e),!0):[`ports`,`processes`,`access`].includes(e.itemId)?(y(e.anchor?.start),p(t=>t===e.itemId?null:e.itemId),!0):!1),(0,R.jsxs)(`main`,{className:`shed-workspace flex h-full min-h-0 w-full flex-col overflow-hidden bg-base-200 font-sans text-base-content`,"aria-label":`Shed Computers workspace`,children:[(0,R.jsx)(`div`,{ref:r,className:`relative min-h-0 flex-1`,children:(0,R.jsx)(dD,{bounds:i,tiling:{layout:`main-top`,mainSize:i.width>=540?i.height*.5:i.height,gap:8},children:(0,R.jsx)(RLe,{app:e,computerId:t,computerAccessGranted:n,terminalAvailable:o,bounds:i,narrow:O,preview:k,previewVisible:S,onClosePreview:()=>{C(!1),x(null)},onTerminalStatus:E})})}),t===null?null:(0,R.jsx)(jLe,{placement:`host`,openPreview:A,openId:f,onOpenChange:p,processNavigation:g,extraItems:[M],...v===void 0?{}:{hostInset:v}})]})}function RLe({app:e,computerId:t,computerAccessGranted:n,terminalAvailable:r,bounds:i,narrow:a,preview:o,previewVisible:s,onClosePreview:c,onTerminalStatus:l}){let u=pD(),d=o!==null&&s&&!a,f=(0,F.useRef)(!1);(0,F.useEffect)(()=>{if(!d){f.current=!1;return}f.current||(f.current=!0,requestAnimationFrame(()=>{u.swap(`terminal`,`preview`)}))},[u,d]);let p=()=>{c(),u.zoomedId===`preview`&&u.zoom(null)},m=()=>{o&&window.open(o.previewUrl,`_blank`,`noopener,noreferrer`)};return(0,R.jsxs)(R.Fragment,{children:[d?(0,R.jsx)(Q9,{id:`preview`,children:(0,R.jsx)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col`,children:(0,R.jsx)(X9,{port:o,onClose:p,onPopOut:m})})}):null,(0,R.jsx)(Q9,{id:`terminal`,children:(0,R.jsx)(`section`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,"aria-label":`Terminal`,children:t!==null&&e&&r?(0,R.jsx)(KAe,{app:e,computerId:t,onStatusChange:l,openRuntimeSetup:()=>e.ui.openSetup(`computer`),screen:a&&o&&s?(0,R.jsx)(X9,{port:o,onClose:p,onPopOut:m}):void 0},t):(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(vE,{className:`grid min-h-0 flex-1 content-center justify-items-center p-4 text-center`,"data-absence":t?`terminal-permission`:`computer-context`,role:`status`,variant:`hint`,title:t?`Terminal unavailable`:`No Computer selected`,description:t?`Shed can’t run commands on this Computer yet. Allow Computer access in the window controls.`:n?`No Computer is attached to this window.`:`No Computer is attached to this window. Allow Computer access to use one here.`,actions:e&&t===null&&!n?(0,R.jsx)(zT,{size:`sm`,onClick:()=>void e.ui.requestAppPermissions({computers:[`computer.execute`]}).catch(e=>{console.error(`Shed Computer operation failed`,e)}),children:`Allow Computer access`}):null})})})}),d?(0,R.jsx)(`div`,{className:`absolute inset-x-0 z-20 -translate-y-1/2`,style:{top:(u.divider?.position??i.height/2)+8},children:u.divider?(0,R.jsx)(Tpe,{className:`absolute left-1/2 -translate-x-1/2`,"aria-label":`Preview and terminal size`,orientation:`horizontal`,variant:`notch`,value:u.divider.position,min:u.divider.min,max:u.divider.max,onValueChange:u.resizeMain,onDoubleClick:()=>{u.resizeMain(i.height/2)},...u.divider.props}):null}):null]})}function Q9({id:e,children:t}){let n=mD({id:e,frame:{x:0,y:0,width:560,height:180},minima:{width:240,height:e===`preview`?140:120}});return(0,R.jsx)(`div`,{className:`shed-pane absolute flex min-h-0 min-w-0 p-1`,"data-shed-pane":e,hidden:!n.visible,style:{left:n.frame.x,top:n.frame.y,width:n.frame.width,height:n.frame.height},children:t})}function zLe(e){return e===`open`?`success`:e===`failed`?`error`:e===`starting`?`warning`:`neutral`}var $9=document.getElementById(`shed-root`);if(!$9)throw Error(`Shed root is missing`);mS().catch(e=>{console.error(`Shed terminal operation failed`,e)}),jle($9,{name:`Shed`,queryClient:Vle()},({app:e})=>(0,F.createElement)(NLe,{app:e}));
1741
+ `).map(e=>({id:ne.current+=1,text:e}));te(e=>[...e,...t].slice(-500))}},{computerName:t.information.computerName,columns:n});s=e,c={key:t=>e.key(t),input:t=>e.input(t),repaint:t=>{e.repaint(t)},setColumns:t=>{e.setColumns(t)},reopen:()=>{e.reopen()}},j.current=c,e.start()}D(t.information.computerName),k(t.information);let r=f(t);C(`open`),await h(t,r)}catch(e){console.error(`Shed terminal operation failed`,e),l.signal.aborted||C(`failed`)}}})(),()=>{n=!1,l.abort(),s?.dispose(),j.current===c&&(j.current=null),r?.cancel().catch(e=>{console.error(`Shed terminal operation failed`,e)}),v.current===i&&(v.current=null),i?.releaseLock(),y.current===a&&(y.current=null),a?.close().catch(e=>{console.error(`Shed terminal operation failed`,e)})}},[e,t,w,b,P]),(0,F.useEffect)(()=>{let e=requestAnimationFrame(()=>{n?p.current?.blur():p.current?.focus()});return()=>{cancelAnimationFrame(e)}},[!!n]);let ie=M.phase===`idle`?`light`:M.phase;return(0,R.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,"data-shell-state":re?ie:void 0,"data-route":re?M.route:void 0,children:[(0,R.jsx)(eE,{size:`sm`,placement:`embedded`,fit:`fill`,density:`compact`,children:(0,R.jsxs)(`div`,{ref:d,className:`relative min-h-0 flex-1 overflow-hidden`,children:[(0,R.jsx)(`div`,{ref:f,className:`terminal-host absolute inset-0 overflow-hidden px-2 pt-1 pb-0.5${n?` opacity-0`:``}`,"aria-hidden":n?!0:void 0}),n?(0,R.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:n}):null,re&&!n&&M.busy?(0,R.jsx)(`div`,{className:`pointer-events-none absolute right-3 bottom-2`,children:(0,R.jsx)(LT,{"data-shell-busy":`true`,size:`sm`,tone:`primary`,label:`Running command`})}):null,re&&!n&&M.phase===`closed`?(0,R.jsx)(`div`,{className:`absolute bottom-2 left-2`,children:(0,R.jsx)(zT,{size:`sm`,variant:`accent`,onClick:()=>{j.current?.reopen(),p.current?.focus()},children:`Reopen shell`})}):null]})}),re?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{role:`log`,"aria-label":`Shell output`,className:`sr-only`,children:N.map(e=>(0,R.jsx)(`div`,{children:e.text},e.id))}),(0,R.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:M.routeLabel})]}):null,!n&&S===`failed`&&(0,R.jsx)(`div`,{className:`absolute inset-0 flex overflow-auto bg-base-200 p-4`,children:(0,R.jsx)(Mpe,{className:`m-auto max-w-[28rem]`,variant:`panel`,need:b?`Shed needs a Computer runtime`:`Terminal display could not start`,cause:b?l?`Open System Settings → Computers from the desktop menu to set one up.`:`This Oyster could not start a terminal. Open System Settings → Computers to set one up.`:`Reload Shed to retry.`,fix:{label:o?`Open Computers`:`Reopen terminal`,pending:s,onSelect:()=>{if(!o){T(e=>e+1);return}c(!0),u(!1),o().then(e=>{e===`unavailable`&&(c(!1),u(!0))},e=>{c(!1),console.error(`Shed runtime setup failed`,e)})}},secondary:b&&o?{label:`Reopen terminal`,onSelect:()=>{c(!1),T(e=>e+1)}}:void 0,waitingFor:`a Computer`})}),!n&&S===`closed`&&(0,R.jsxs)(`div`,{className:`absolute inset-0 grid content-center justify-items-center gap-2 bg-base-200 p-4 text-center`,children:[(0,R.jsx)(`p`,{className:`m-0 text-sm`,children:`Terminal session ended.`}),b&&(0,R.jsx)(zT,{className:`terminal-reopen`,size:`sm`,variant:`accent`,onClick:()=>{T(e=>e+1)},children:`Reopen terminal`})]})]})}Wx(`app.backend`,1,qo(()=>Gx({request:qx(Kx(to().transform(e=>cs(e))))})));var D4=Wx(`app.methods`,1,qo(()=>Gx({call:qx(Kx(to().transform(e=>cs(e))))}))),O4=uo({error:Co([`not_granted`,`revoked`,`grantor_lost_authority`,`unavailable`,`invalid`,`invalid_path`,`too_large`,`conflict`,`not_found`])}),k4=uo({error:To(`attachment_budget_exceeded`),kind:Co([`exec`,`write`]),retryAfterMs:qa().int().min(1).max(864e5)}),A4=uo({error:To(`timeout`),requestId:$2.shape.requestId});po([O4,k4,A4]);var BAe=G2.refine(e=>!e.split(`/`).includes(`..`),`Parent path segments are not allowed`),VAe=$ke({maximumTimeMs:45e3}).omit({requestId:!0,backend:!0}).extend({cwd:BAe.optional()}),j4=Gke+2,HAe=po([X2.pick({stdout:!0,stderr:!0,exitCode:!0}).extend({stdout:Ca().max(j4),stderr:Ca().max(j4),stdoutTruncated:Za(),stderrTruncated:Za()}).refine(e=>new TextEncoder().encode(e.stdout).byteLength<=j4&&new TextEncoder().encode(e.stderr).byteLength<=j4,`Command stream exceeds the native Computer output bound`),O4,k4,A4.pick({error:!0}),uo({error:To(`output_unavailable`)})]),UAe=`export FORCE_COLOR=1 CLICOLOR_FORCE=1 COLORTERM=truecolor TERM=xterm-256color; `;function WAe(e){return 79+e.length<=16384?`${UAe}${e}`:e}async function GAe(e,t,n){let r=Vke(t.command);if(r)return{stdout:``,stderr:`light: ${r.name} does not persist here yet; run \`full ${t.command}\` instead.\n`,exitCode:1,cwd:t.cwd,env:t.env};if(!e.has(D4))throw new n_(`Computer execution is not available`,{code:`CAPABILITY_DENIED`,retryable:!1});let i=VAe.parse({command:WAe(t.command),cwd:t.cwd}),a=await e.require(D4).call(`runCommand`,JSON.stringify(i));n.throwIfAborted();let o=HAe.parse(a);if(`error`in o&&o.error===`output_unavailable`)throw new n_(`The command produced no result`,{code:`DISCONNECTED`,retryable:!0});if(`error`in o)throw new n_(`The Computer declined this command: ${o.error}`,{code:`CAPABILITY_DENIED`,retryable:o.error===`unavailable`});return{stdout:o.stdout,stderr:o.stderr,exitCode:o.exitCode,cwd:t.cwd,env:t.env}}function KAe({app:e,computerId:t,screen:n,onStatusChange:r,openRuntimeSetup:i}){let[a,o]=(0,F.useState)(`starting`),[s,c]=(0,F.useState)(!1),l=(0,F.useCallback)(e=>{r?.({name:e.name,state:e.state}),c(e.information!==null),o(e.state)},[r]);return(0,R.jsx)(zAe,{app:e,computerId:t,screen:n??(!s&&a===`starting`?(0,R.jsx)(`div`,{className:`grid h-full min-h-0 flex-1 place-items-center`,children:(0,R.jsx)(LT,{size:`sm`,tone:`primary`,label:`Starting shell`})}):void 0),light:{runLight:(t,n)=>GAe(e.capabilities,t,n)},onStatusChange:l,openRuntimeSetup:i})}var qAe=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),M4=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),JAe={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},YAe=(0,F.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,F.createElement)(`svg`,{ref:c,...JAe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:M4(`lucide`,i),...s},[...o.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(a)?a:[a]])),N4=(e,t)=>{let n=(0,F.forwardRef)(({className:n,...r},i)=>(0,F.createElement)(YAe,{ref:i,iconNode:t,className:M4(`lucide-${qAe(e)}`,n),...r}));return n.displayName=`${e}`,n},P4=N4(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),XAe=N4(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),F4=N4(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ZAe=N4(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),QAe=N4(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),$Ae=N4(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),eje=N4(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),tje=N4(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),nje=N4(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),I4=N4(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),rje=N4(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),L4=N4(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ije={xs:`size-3`,sm:`size-[var(--stipe-icon-size-sm)]`,md:`size-[var(--stipe-icon-size-md)]`,lg:`size-[var(--stipe-icon-size-lg)]`},R4=(0,F.forwardRef)(function({active:e=!1,icon:t,iconSize:n=`xs`,className:r,reveal:i=!1,size:a=`xs`,tone:o=`default`,variant:s=`ghost`,...c},l){let u=a===`responsive`;return(0,R.jsx)(zT,{...c,resultLabel:c.result===void 0?void 0:null,ref:l,size:u?`sm`:a,variant:s,className:cC(`caps-icon-button btn-circle`,u&&`caps-icon-button-responsive md:btn-xs`,e&&`text-accent`,i&&`scale-0 transition-transform group-hover:scale-100 focus-visible:scale-100`,o===`destructive`&&`hover:text-error`,r),children:(0,R.jsx)(`span`,{"aria-hidden":`true`,className:cC(`inline-flex shrink-0 [&>svg]:size-full [&>svg]:[stroke-width:var(--stipe-icon-stroke)]`,ije[n]),children:t})})}),aje=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`div`,{...t,ref:n,className:cC(`caps-popover-anchor`,e)})}),oje=(0,F.forwardRef)(function({className:e,open:t,side:n=`top`,...r},i){return t?(0,R.jsx)(`div`,{...r,ref:i,className:cC(`caps-popover`,e),"data-side":n}):null});(0,F.forwardRef)(function({active:e,className:t,onMouseDown:n,...r},i){return(0,R.jsx)(`div`,{role:`option`,"aria-selected":e,...r,ref:i,className:cC(`caps-popover-option`,t),"data-active":e,onMouseDown:e=>{e.preventDefault(),n?.(e)}})});function sje({items:e,openId:t,onOpenChange:n,leading:r,trailing:i,renderTrigger:a,placement:o=`housing`,align:s=`end`,hostInset:c,className:l,...u}){let d=(0,F.useId)(),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(new Map),h=e.find(e=>e.id===t&&!e.disabled),g=h?.id,_=()=>{g&&m.current.get(g)?.focus(),n(null)};return(0,F.useEffect)(()=>{g&&p.current?.focus()},[g]),(0,F.useEffect)(()=>{c===void 0?f.current?.style.removeProperty(`--caps-status-tray-host-inset`):f.current?.style.setProperty(`--caps-status-tray-host-inset`,`${String(Math.max(0,c))}px`)},[c]),(0,F.useEffect)(()=>{if(!g)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),m.current.get(g)?.focus(),n(null))},t=e=>{e.target instanceof Node&&!f.current?.contains(e.target)&&n(null)};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[g,n]),(0,R.jsxs)(aje,{...u,ref:f,className:cC(`caps-status-tray`,l),"data-placement":o,"data-align":s,children:[h?(0,R.jsxs)(oje,{open:!0,ref:p,tabIndex:-1,side:`top`,id:`${d}-${h.id}`,role:`dialog`,"aria-labelledby":`${d}-title`,className:`caps-status-tray-panel`,"data-status-tray-panel":h.id,children:[(0,R.jsxs)(`div`,{className:`caps-status-tray-head`,children:[h.tone?(0,R.jsx)(QT,{size:`compact`,tone:h.tone,glyph:h.glyph??`dot`}):null,(0,R.jsx)(`span`,{id:`${d}-title`,className:`caps-status-tray-title`,children:h.title??h.label}),h.actions,(0,R.jsx)(R4,{"aria-label":`Close tray`,icon:(0,R.jsx)(L4,{"aria-hidden":`true`}),onClick:_})]}),(0,R.jsx)(`div`,{className:`caps-status-tray-body`,children:h.content})]}):null,o===`host`?null:(0,R.jsxs)(`div`,{className:`caps-status-tray-row`,children:[r,(0,R.jsx)(`div`,{className:`caps-status-tray-chips`,children:e.map(e=>{let r={ref:t=>{t?m.current.set(e.id,t):m.current.delete(e.id)},type:`button`,className:a?void 0:`caps-status-tray-chip`,"aria-expanded":g===e.id,"aria-controls":g===e.id?`${d}-${e.id}`:void 0,"aria-label":e.accessibleLabel,disabled:e.disabled,title:e.disabled?e.accessibleLabel:void 0,"aria-haspopup":`dialog`,"data-status-tray-chip":e.id,onClick:()=>{n(t===e.id?null:e.id)},children:(0,R.jsxs)(R.Fragment,{children:[e.tone?(0,R.jsx)(QT,{size:`compact`,glyph:e.glyph??`dot`,motion:e.motion??`none`,tone:e.tone}):null,(0,R.jsx)(`span`,{className:`caps-status-tray-label`,children:e.label}),e.count!==void 0&&e.count>0?(0,R.jsx)(`span`,{className:`caps-status-tray-count`,children:e.count}):null]})};return(0,R.jsxs)(F.Fragment,{children:[a?a(r):(0,R.jsx)(`button`,{...r}),e.after]},e.id)})}),i]})]})}function cje({children:e,className:t,...n}){return(0,R.jsx)(`div`,{...n,className:cC(`caps-status-tray-list`,t),children:e})}function z4({icon:e,primary:t,secondary:n,actions:r,className:i,...a}){return(0,R.jsxs)(`div`,{...a,className:cC(`caps-status-tray-item`,i),children:[e?(0,R.jsx)(`span`,{className:`caps-status-tray-icon`,children:e}):null,(0,R.jsxs)(`span`,{className:`caps-status-tray-text`,children:[(0,R.jsx)(`span`,{className:`caps-status-tray-primary`,children:t}),n?(0,R.jsx)(`span`,{className:`caps-status-tray-secondary`,children:n}):null]}),r?(0,R.jsx)(`span`,{className:`caps-status-tray-actions`,children:r}):null]})}function B4({children:e=`All caught up.`,title:t}){return(0,R.jsxs)(`div`,{className:`caps-status-tray-note`,children:[t?(0,R.jsx)(`strong`,{className:`caps-status-tray-note-title`,children:t}):null,(0,R.jsx)(`p`,{children:e})]})}function lje({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function V4(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var H4=[],U4=0,{link:W4,unlink:uje,propagate:dje,checkDirty:G4,shallowPropagate:K4}=lje({update(e){return e._update()},notify(e){H4[J4++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Q4(e))}}),q4=0,J4=0,Y4,X4=0;function Z4(e){try{++X4,e()}finally{--X4||$4()}}function Q4(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=uje(n,e)}function $4(){if(!(X4>0)){for(;q4<J4;){let e=H4[q4];H4[q4++]=void 0,e.notify()}q4=0,J4=0}}function e3(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return Y4!==void 0&&W4(i,Y4,U4),i._snapshot},subscribe(e){let t=V4(e),n={current:!1},r=fje(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Y4,o=t?.compare??Object.is;if(n)Y4=i,++U4,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Y4=a,n&&(i.flags&=-5),Q4(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&G4(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&K4(e)}}else e&32&&(i.flags=e&-33);return Y4!==void 0&&W4(i,Y4,U4),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(dje(e),K4(e),$4())}},i}function fje(e){let t=()=>{let t=Y4;Y4=n,++U4,n.depsTail=void 0,n.flags=6;try{return e()}finally{Y4=t,n.flags&=-5,Q4(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&G4(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Q4(this)}};return t(),n}var t3=class{constructor(e,t){this.atom=e3(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(V4(e))}},pje=class{constructor(e){this.atom=e3(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(V4(e))}};function n3(e,t){return typeof e==`function`?new pje(e):t?new t3(e,t):new t3(e)}var mje=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function hje(e,t){return new mje(e,t).maybeExecute}var gje=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},r3=new class extends gje{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function i3(e,t){return typeof e==`function`?e(t):e}function a3(e,t){return d3(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function o3(e,t,n){let r=d3(t);function i(e){if(!r.length)return i3(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function _je(e,t){let n=d3(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var s3=46,c3=91,l3=93,u3=48,vje=57;function d3(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===c3),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===s3||s===c3||s===l3){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==u3),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==l3&&(a!==-1||s!==l3)&&(a!==s||s!==s3&&s!==c3)&&n.push(``);r=o+1,i=!0}else(s<u3||s>vje)&&(i=!1);a=s}return n.length||n.push(``),n}function yje(e){return!(Array.isArray(e)&&e.length===0)}function f3(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function p3(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var m3=e=>!!e&&typeof e==`object`&&`fields`in e;function h3(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!h3(e[i],t[i]))return!1;return!0}var g3=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},_3=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function v3(e,t){return e==null?t:{...e,...t}}for(var y3=256,b3=[],x3;y3--;)b3[y3]=(y3+256).toString(16).substring(1);function S3(){let e=0,t,n=``;if(!x3||y3+16>256){for(x3=Array(256),e=256;e--;)x3[e]=256*Math.random()|0;e=0,y3=0}for(;e<16;e++)t=x3[y3+e],n+=e===6?b3[t&15|64]:e===8?b3[t&63|128]:b3[t],e&1&&e>1&&e<11&&(n+=`-`);return y3++,n}var bje=hje(e=>r3.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function C3(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=C3(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,C3(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(C3(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=C3(e[n]));return t}function w3(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var T3=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function xje(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var E3=(e,t)=>{let n=xje(e,t);return{form:n,fields:n}},D3={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:E3(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:E3(r.issues,e)}},O3=e=>!!e&&`~standard`in e,k3={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function A3(e){function t(t){let n=e.getFieldMeta(t)??k3;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>k3;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function j3(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var M3=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{bje(this)}),t=r3.on(`request-form-state`,e=>{e.payload.id===this._formId&&r3.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=r3.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=r3.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),r3.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return r3.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!h3(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!h3(e.defaultState,t.defaultState)&&!this.state.isTouched;if(!(!n&&!r)){if(Z4(()=>{this.baseStore.setState(()=>j3(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=A3(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}r3.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=o3(t,e.instance.name,e.instance.options.defaultValue))}),j3({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return Z4(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return Z4(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=f3(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||T3}),r=!1,i={};return Z4(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=N3(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=P3(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??k3,r=a?.[e],{newErrorValue:s,newSource:c}=g3({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=k3)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=P3(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=P3(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=p3(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||T3});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=P3(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=N3(r);s&&(i=i?{...i,...s}:s);let c=P3(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??k3,r=i?.[e],{newErrorValue:a,newSource:o}=g3({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=k3)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Z4(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}Z4(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),Z4(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),r3.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>a3(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:i3(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=k3,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;Z4(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:o3(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t!==n&&t.startsWith(n)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=_je(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),A3(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],v3(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),A3(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),v3(r,{dontValidate:!0})),A3(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),v3(n,{dontValidate:!0})),A3(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return o3(o3(e,`${t}`,i),`${n}`,r)},v3(r,{dontValidate:!0})),A3(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},v3(r,{dontValidate:!0})),A3(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],v3(t,{dontValidate:!0})),A3(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=a3(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:k3},values:i===void 0?t.values:o3(t.values,e,i)}})},this.setErrorMap=e=>{Z4(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(m3(t)){let{formError:e,fieldErrors:r}=N3(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>D3.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>D3.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??S3(),this._devtoolsSubmissionOverride=!1;let t=j3({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(!(n===void 0||!m3(n)))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=n3(t);let n;this.fieldMetaDerived=n3(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=a3(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!yje(u),f=!o.isDirty,p=h3(l,this.getFieldInfo(a)?.instance?.options.defaultValue??a3(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=n3(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!w3(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&w3(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=n3(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&m3(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&h3(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return O3(e.validate)?D3[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function N3(e){return e?m3(e)?{formError:N3(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function P3(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var F3=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...k3,isTouched:e.fieldMetaBase[this.name]?.isTouched??k3.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??k3.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??k3.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(h3(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,v3(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,v3(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,v3(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,v3(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,v3(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=f3(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||T3}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=f3(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;Z4(()=>{let e=(e,n)=>{let r=L3(n.cause),a=n.validate?I3(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=_3({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=L3(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=p3(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||T3}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=p3(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));Z4(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=L3(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=I3(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=_3({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),Z4(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>w3(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[L3(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[L3(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)a.get(t)&&!t.options.asyncAlways||c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>D3.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>D3.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)w3(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=n3(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...k3,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!h3(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return O3(e.validate)?D3[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function I3(e){if(e)return e}function L3(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function R3(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function Sje(e){return{...k3,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var z3=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??R3({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(h3(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...k3,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??R3({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;V3(t)&&(n=t.group,r=t.fields);let i=B3(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:R3({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,v3(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof F3&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&w3(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=g3({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=k3)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=f3(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||T3}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=f3(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;Z4(()=>{let t=(t,r)=>{let i=U3(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&V3(s)&&(c=s.group,l=s.fields);let u=B3(c),d=n[i],{newErrorValue:f,newSource:p}=_3({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=U3(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=p3(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||T3}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=p3(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||T3});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=U3(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&V3(o)&&(l=o.group,u=o.fields);let d=B3(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=_3({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return Z4(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>w3(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[U3(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>w3(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Z4(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}Z4(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),Z4(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=n3(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??Sje(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!h3(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(O3(e.validate)){let t=D3[e.type](e.value,e.validate);return e.type===`validate`?H3(t):t.then(H3)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function B3(e){if(e)return e}function V3(e){return!!e&&typeof e==`object`&&`fields`in e}function H3(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function U3(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function Cje(e,t){if(!t)return;let n=Object.assign({},e,{state:C3(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return Z4(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var wje=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),W3=o(((e,t)=>{t.exports=wje()})),Tje=o((e=>{var t=u(),n=W3();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),G3=o(((e,t)=>{t.exports=Tje()}))();function Eje(e,t){return e===t}function K3(e,t=e=>e,n){let r=n?.compare??Eje,i=(0,F.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,F.useCallback)(()=>e.get(),[e]);return(0,G3.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var q3=typeof window<`u`?F.useLayoutEffect:F.useEffect;function J3(e){let[t,n]=(0,F.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,F.useState)(()=>new F3({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new F3({...e}),i(a),n({form:e.form,name:e.name}));let o=K3(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=K3(a.store,e=>e.meta.isTouched),c=K3(a.store,e=>e.meta.isBlurred),l=K3(a.store,e=>e.meta.isDirty),u=K3(a.store,e=>e.meta.errorMap),d=K3(a.store,e=>e.meta.errorSourceMap),f=K3(a.store,e=>e.meta.isValidating),p=(0,F.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return q3(a.mount,[a]),q3(()=>{a.update(e)}),p}var Dje=(({children:e,...t})=>{let n=J3(t),r=(0,F.useMemo)(()=>i3(e,n),[e,n]);return(0,R.jsx)(R.Fragment,{children:r})});function Oje(){return(0,F.useState)(()=>S3())[0]}var kje=F,Aje=`18.3.1`.split(`.`)[0]===`17`?Oje:kje.useId;function jje(e){let[t,n]=(0,F.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,F.useState)(()=>new z3({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new z3({...e})),n({form:e.form,name:e.name}));let a=K3(r.store,e=>e.value),o=K3(r.store,e=>e.meta.isTouched),s=K3(r.store,e=>e.meta.isBlurred),c=K3(r.store,e=>e.meta.isDirty),l=K3(r.store,e=>e.meta.errorMap),u=K3(r.store,e=>e.meta.errorSourceMap),d=K3(r.store,e=>e.meta.isValidating),f=K3(r.store,e=>e.meta.isSubmitting),p=K3(r.store,e=>e.meta.isSubmitted),m=K3(r.store,e=>e.meta.submissionAttempts),h=K3(r.store,e=>e.meta.isSubmitSuccessful),g=K3(r.store,e=>e.meta.canSubmit),_=K3(r.store,e=>e.meta.isValid),v=K3(r.store,e=>e.meta.isFieldsValid),y=K3(r.store,e=>e.meta.isFieldsValidating),b=K3(r.store,e=>e.meta.isGroupValid),x=(0,F.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return q3(r.mount,[r]),q3(()=>{r.update(e)}),x}var Mje=(({children:e,...t})=>{let n=jje(t),r=(0,F.useMemo)(()=>i3(e,n),[e,n]);return(0,R.jsx)(R.Fragment,{children:r})});function Nje({form:e,selector:t=e=>e,children:n}){let r=K3(e.store,t);return(0,R.jsx)(R.Fragment,{children:i3(n,r)})}function Pje(e){let t=Aje(),[n,r]=(0,F.useState)(e?.formId),[i,a]=(0,F.useState)(()=>new M3({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new M3({...e,formId:n})),r(n)}let o=(0,F.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,R.jsx)(Dje,{...e,form:i})},e.FormGroup=function(e){return(0,R.jsx)(Mje,{...e,form:i})},e.Subscribe=function(e){return(0,R.jsx)(Nje,{form:i,selector:e.selector,children:e.children})},e},[i]);q3(i.mount,[]),q3(()=>{i.update(e)});let s=(0,F.useRef)(!1);return q3(()=>{s.current&&e?.transform&&Cje(i,e.transform)},[i,e?.transform]),q3(()=>{s.current=!0}),o}var Fje=cg(vg),Ije=cg(L({message:vg}));function Lje(e){for(let t of e.errors){let e=Vu(nee(ree(Ije(t),e=>e.message),()=>Fje(t)));if(e!==void 0&&e.length>0)return e}}var Rje=(0,F.forwardRef)(function({children:e,className:t,optional:n,required:r,...i},a){return(0,R.jsxs)(`label`,{...i,className:cC(`label caps-label cursor-pointer justify-start gap-sm text-sm font-semibold text-base-content`,t),ref:a,children:[e,r?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`text-error`,children:`*`}):null,n&&!r?(0,R.jsx)(`span`,{className:`caps-label-optional`,children:`Optional`}):null]})}),Y3=(0,F.forwardRef)(function({children:e,className:t,...n},r){return(0,R.jsx)(`div`,{...n,className:cC(`caps-input-group join flex w-full items-stretch [&>*]:join-item [&>*:first-child]:rounded-e-none [&>*:last-child]:rounded-s-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>.btn]:shrink-0 [&>.input]:min-w-0 [&>.input]:flex-1 [&>.select]:min-w-0 [&>.select]:flex-1`,t),ref:r,children:F.Children.map(e,e=>(0,F.isValidElement)(e)?(0,F.cloneElement)(e,{className:cC(`join-item caps-input-group-control`,e.props.className)}):e)})}),X3=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`div`,{...t,className:cC(`join-item flex items-center border border-base-300 bg-base-200 px-md text-sm text-base-content`,e),ref:n})});function zje(e){let t=e.parentElement;if(!t||e.previousElementSibling===null)return 0;let n=getComputedStyle(t);if(!(n.display.includes(`grid`)||n.display.includes(`flex`)&&n.flexDirection.startsWith(`column`)))return 0;let r=Number.parseFloat(n.rowGap);return Number.isFinite(r)?r:0}(0,F.forwardRef)(function({show:e,appear:t=!1,children:n,className:r,...i},a){let o=(0,F.useRef)(null);(0,F.useImperativeHandle)(a,()=>o.current);let s=_C(),[c,l]=(0,F.useState)(e),u=(0,F.useRef)(!0);return e&&!c&&l(!0),(0,F.useLayoutEffect)(()=>{let n=o.current,r=u.current;if(u.current=!1,!n||r&&!t)return;if(!hC(n)){e||l(!1);return}let i=dC(n),a=`translateY(${String(i.distance)}px)`,c=mC(i,i.ease),d=n.getBoundingClientRect().height,f=zje(n),p=(e,t)=>{n.style.overflow=`clip`;let r=e=>({height:`${String(e)}px`,marginBlockStart:`${String(e===0?-f:0)}px`}),a=n.animate([r(e),r(t)],{duration:i.normal,easing:c}),o=()=>{n.style.removeProperty(`overflow`)};return a.addEventListener(`finish`,o),a.addEventListener(`cancel`,o),a};if(e){let e=[n.animate([{opacity:0,transform:a},{opacity:1,transform:`none`}],{duration:i.normal,easing:c})];return!s&&d>0&&e.push(p(0,d)),()=>{for(let t of e)t.cancel()}}let m=n.animate([{opacity:1,transform:`none`},{opacity:0,transform:a}],{duration:i.fast,easing:mC(i,i.easeExit),fill:`forwards`}),h=!s&&d>0?p(d,0):m;return h!==m&&h.effect?.updateTiming({fill:`forwards`}),h.addEventListener(`finish`,()=>{l(!1)}),()=>{m.cancel(),h.cancel()}},[e,t,s]),c?(0,R.jsx)(`div`,{...i,ref:o,className:cC(`caps-presence`,r),"data-present":e,"aria-hidden":!e||void 0,children:n}):null});var Bje=(0,F.forwardRef)(function({open:e,children:t,className:n,...r},i){return(0,R.jsx)(`div`,{...r,ref:i,className:cC(`caps-collapse`,n),"data-open":e,"aria-hidden":!e||void 0,children:(0,R.jsx)(`div`,{className:`caps-collapse-clip`,children:t})})});(0,F.forwardRef)(function({swapKey:e,anchor:t=`start`,children:n,className:r,...i},a){let o=(0,F.useRef)(null);(0,F.useImperativeHandle)(a,()=>o.current);let s=_C(),[c,l]=(0,F.useState)({key:e,content:n}),[u,d]=(0,F.useState)([]);c.key===e?c.content!==n&&l({key:e,content:n}):(d([...u.filter(t=>t.key!==e&&t.key!==c.key),c]),l({key:e,content:n}));let f=(0,F.useRef)(null);return(0,F.useLayoutEffect)(()=>{let e=o.current;if(!e||!(`ResizeObserver`in globalThis))return;f.current=e.getBoundingClientRect();let t=new ResizeObserver(()=>{e.getAnimations().length===0&&(f.current=e.getBoundingClientRect())});return t.observe(e),()=>{t.disconnect()}},[]),(0,F.useLayoutEffect)(()=>{let e=o.current;if(!e)return;let t=[...e.querySelectorAll(`:scope > [data-swap-leaving]`)],n=e.querySelector(`:scope > [data-swap-current]`);if(n===null||t.length===0)return;if(!hC(e)){d([]);return}let r=f.current,i=e.getBoundingClientRect(),a=dC(e),c=[n.animate([{opacity:0,filter:`blur(${String(a.blur)}px)`,transform:`translateY(${String(a.distance/2)}px)`},{opacity:1,filter:`blur(0px)`,transform:`none`}],{duration:a.normal,easing:mC(a,a.ease)})];for(let e of t){let t=e.animate([{opacity:1,filter:`blur(0px)`,transform:`none`},{opacity:0,filter:`blur(${String(a.blur)}px)`,transform:`translateY(${String(-a.distance/2)}px)`}],{duration:a.fast,easing:mC(a,a.easeExit),fill:`forwards`}),n=e.dataset.swapLeaving;t.onfinish=()=>{d(e=>e.filter(e=>e.key!==n))},c.push(t)}let l=r!==null&&(Math.abs(r.height-i.height)>.5||Math.abs(r.width-i.width)>.5);return!s&&l&&c.push(e.animate([{width:`${String(r.width)}px`,height:`${String(r.height)}px`},{width:`${String(i.width)}px`,height:`${String(i.height)}px`}],{duration:a.normal,easing:mC(a,a.ease)})),()=>{for(let e of c)e.cancel()}},[e,s]),(0,R.jsx)(`div`,{...i,ref:o,className:cC(`caps-swap`,r),"data-anchor":t,children:[...u.map(e=>(0,R.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-leaving":e.key,"aria-hidden":`true`,children:e.content},e.key)),(0,R.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-current":``,children:n},e)]})});function Z3({children:e,...t}){let[n,r]=(0,F.useState)(e);return e&&e!==n&&r(e),(0,R.jsx)(Bje,{...t,className:cC(`caps-field-error-reveal`,t.className),open:!!e,children:(0,R.jsx)(`div`,{className:`caps-field-error`,role:`alert`,"aria-hidden":!e,children:n})})}function Vje({children:e,divider:t=!0,error:n,layout:r=`end`,status:i,...a}){return(0,R.jsxs)(`footer`,{...a,className:cC(`caps-form-footer`,a.className),"data-divider":t,"data-layout":r,children:[(0,R.jsx)(Z3,{children:n}),(0,R.jsxs)(`div`,{className:`caps-form-footer-row`,children:[i?(0,R.jsx)(`div`,{className:`caps-form-footer-status`,role:`status`,children:i}):null,(0,R.jsx)(`div`,{className:`caps-form-footer-actions`,children:e})]})]})}var Hje=(0,F.forwardRef)(function({busy:e=!1,children:t,className:n,layout:r,...i},a){return(0,R.jsx)(`form`,{...i,"aria-busy":e||void 0,className:cC(`caps-form`,n),"data-layout":r,ref:a,children:(0,R.jsx)(`fieldset`,{className:`caps-form-body`,disabled:e,children:t})})}),Uje={2:`h2`,3:`h3`,4:`h4`},Wje=(0,F.forwardRef)(function({children:e,className:t,description:n,layout:r,level:i=3,title:a,...o},s){let c=(0,F.useId)(),l=Uje[i];return(0,R.jsxs)(`section`,{...o,"aria-labelledby":`${c}-title`,className:cC(`caps-form-section`,t),"data-layout":r,ref:s,children:[(0,R.jsxs)(`header`,{className:`caps-form-section-copy`,children:[(0,R.jsx)(l,{className:`caps-form-section-title`,id:`${c}-title`,children:a}),n?(0,R.jsx)(`p`,{className:`caps-form-section-description`,children:n}):null]}),(0,R.jsx)(`div`,{className:`caps-form-section-fields`,children:e})]})}),Q3=(0,F.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,layout:a,legend:o,legendTitle:s,...c},l){let u=(0,F.useId)(),d=[n?`${u}-description`:c[`aria-describedby`],r?`${u}-error`:null].filter(Boolean).join(` `)||void 0;return(0,R.jsxs)(`fieldset`,{...c,"aria-describedby":d,"aria-invalid":r?!0:c[`aria-invalid`],className:cC(`caps-fieldset`,t),"data-layout":a,ref:l,children:[(0,R.jsxs)(`legend`,{className:`caps-fieldset-legend`,title:s,children:[i?(0,R.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}):null,o]}),n?(0,R.jsx)(`p`,{className:`caps-fieldset-description`,id:`${u}-description`,children:n}):null,(0,R.jsx)(`div`,{className:`caps-fieldset-fields`,children:e}),r===void 0?null:(0,R.jsx)(Z3,{id:`${u}-error`,children:r})]})});function Gje(e){let t=[];return F.Children.forEach(e.props.children,e=>{(0,F.isValidElement)(e)&&e.type!==X3&&t.push(e)}),t[0]??null}var $3=(0,F.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,label:a,labelTitle:o,optional:s,orientation:c=`vertical`,readout:l=!1,required:u,...d},f){let p=(0,F.useId)(),m=(0,F.isValidElement)(e)?e:null,h=m?.type===Y3,g=h?Gje(m):m,_=g?.props.id??p,v=`${_}-description`,y=`${_}-error`,b=[g?.props[`aria-describedby`],n?v:null,r?y:null].filter(Boolean).join(` `)||void 0,x=u===!0||g?.props.required,S=r?!0:g?.props[`aria-invalid`],C=u===!0||g?.props[`aria-required`],w={id:_};x!==void 0&&(w.required=x),b!==void 0&&(w[`aria-describedby`]=b),S!==void 0&&(w[`aria-invalid`]=S),C!==void 0&&(w[`aria-required`]=C);let T=m&&g&&!l?h?(0,F.cloneElement)(m,void 0,F.Children.map(m.props.children,e=>e===g?(0,F.cloneElement)(g,w):e)):(0,F.cloneElement)(m,w):e,E=a?(0,R.jsx)(Rje,{htmlFor:l?void 0:_,title:o,className:c===`inline`?`font-normal`:void 0,...u===void 0?{}:{required:u},...s===void 0?{}:{optional:s},children:a}):null,D=a||n?(0,R.jsxs)(`div`,{className:`caps-field-copy`,children:[E,n?(0,R.jsx)(`p`,{className:`caps-field-description`,id:v,children:n}):null]}):null,O=i?(0,R.jsxs)(`div`,{className:`caps-field-lead`,children:[(0,R.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}),D]}):D;return(0,R.jsxs)(`div`,{...d,className:cC(`caps-field`,t),"data-orientation":c,ref:f,children:[c===`horizontal`?(0,R.jsxs)(`div`,{className:`caps-field-row`,children:[O,T]}):c===`inline`?(0,R.jsxs)(`div`,{className:`caps-field-row`,children:[T,O]}):(0,R.jsxs)(R.Fragment,{children:[O,T]}),(0,R.jsx)(Z3,{id:y,children:r})]})});function Kje(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}var e6=`M 9.86 38.14 A 20 20 0 1 1 38.14 38.14`,qje=6,Jje=new Map([[`ArrowUp`,1],[`ArrowDown`,-1],[`PageUp`,10],[`PageDown`,-10]]),Yje=(0,F.forwardRef)(function({className:e,decrementLabel:t=`Decrease`,defaultValue:n=null,disabled:r,incrementLabel:i=`Increase`,invalid:a,max:o,min:s,onBlur:c,onKeyDown:l,onValueChange:u,step:d=1,unit:f,value:p,wrap:m=!1,...h},g){let[_,v]=(0,F.useState)(n),[y,b]=(0,F.useState)(null),x=p===void 0?_:p,S=Kje(d),C=e=>{let t=Number(e.toFixed(S));return s!==void 0&&t<s?s:o!==void 0&&t>o?o:t},w=e=>{let t=e===null?null:C(e);v(t),b(null),t!==x&&u?.(t)},T=()=>{if(y===null)return;let e=Number(y);w(y.trim()===``||!Number.isFinite(e)?null:e)},E=e=>{let t=(x??s??0)+e*d;if(m&&s!==void 0&&o!==void 0){if(t>o){w(s);return}if(t<s){w(o);return}}w(t)},D=s!==void 0&&x!==null&&x<=s,O=o!==void 0&&x!==null&&x>=o,k=r===!0,A=(0,F.useRef)(null),j=s!==void 0&&o!==void 0&&o>s?((x??s)-s)/(o-s):null,M=e=>{k||(e.currentTarget.setPointerCapture(e.pointerId),A.current={y:e.clientY,value:x??s??0})},ee=e=>{if(!A.current)return;let t=Math.trunc((A.current.y-e.clientY)/qje),n=C(A.current.value+t*d);n!==x&&w(n)},N=()=>{A.current=null};return(0,R.jsxs)(`span`,{className:cC(`caps-number-field`,e),"data-at-max":O||void 0,"data-at-min":D||void 0,"data-disabled":k||void 0,"data-wrap":m||void 0,children:[j===null?null:(0,R.jsxs)(`svg`,{className:`caps-number-field-dial`,viewBox:`0 0 48 48`,"aria-hidden":`true`,focusable:`false`,onPointerDown:M,onPointerMove:ee,onPointerUp:N,onPointerCancel:N,children:[(0,R.jsx)(`path`,{className:`caps-number-field-dial-track`,d:e6,pathLength:100}),(0,R.jsx)(`path`,{className:`caps-number-field-dial-level`,d:e6,pathLength:100,strokeDasharray:`${String(Math.max(.5,j*100))} 100`})]}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-decrement`,"aria-label":t,"aria-controls":h.id,tabIndex:-1,disabled:k||D&&!m,onClick:()=>{E(-1)},children:(0,R.jsx)(tje,{"aria-hidden":`true`})}),(0,R.jsxs)(`span`,{className:`caps-number-field-readout`,children:[(0,R.jsx)(`input`,{...h,"aria-invalid":a?!0:h[`aria-invalid`]===!1?void 0:h[`aria-invalid`],className:`input caps-input caps-number-field-input`,disabled:r,inputMode:h.inputMode??(S>0?`decimal`:`numeric`),max:o,min:s,onBlur:e=>{T(),c?.(e)},onChange:e=>{b(e.target.value)},onKeyDown:e=>{if(l?.(e),e.defaultPrevented)return;let t=Jje.get(e.key);t===void 0?e.key===`Home`&&s!==void 0?(e.preventDefault(),w(s)):e.key===`End`&&o!==void 0?(e.preventDefault(),w(o)):e.key===`Enter`&&T():(e.preventDefault(),E(t))},ref:g,step:d,type:`number`,value:y??(x===null?``:String(x))}),f?(0,R.jsx)(`span`,{className:`caps-number-field-unit`,"aria-hidden":`true`,children:f}):null]}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-increment`,"aria-label":i,"aria-controls":h.id,tabIndex:-1,disabled:k||O&&!m,onClick:()=>{E(1)},children:(0,R.jsx)(nje,{"aria-hidden":`true`})})]})}),Xje={neutral:`progress-neutral`,primary:`progress-primary`,secondary:`progress-secondary`,accent:`progress-accent`,success:`progress-success`,info:`progress-info`,warning:`progress-warning`,error:`progress-error`},t6=(0,F.forwardRef)(function({className:e,tone:t=`primary`,...n},r){return(0,R.jsx)(`progress`,{...n,"data-complete":n.value!==void 0&&Number(n.value)>=Number(n.max??1)?`true`:void 0,className:cC(`progress caps-gooey-motion caps-gooey-progress w-full`,Xje[t],e),ref:r})});(0,F.forwardRef)(function({label:e,value:t,max:n,tone:r=`info`,className:i,...a},o){return(0,R.jsxs)(`div`,{...a,ref:o,className:cC(`caps-game-meter`,i),children:[(0,R.jsxs)(`div`,{className:`caps-game-meter-readout`,children:[(0,R.jsx)(`span`,{children:e}),(0,R.jsxs)(`span`,{className:`caps-game-meter-value`,children:[t,` / `,n]})]}),(0,R.jsx)(t6,{"aria-label":e,value:t,max:n,tone:r})]})});function Zje({className:e,items:t,onCancel:n,onRemove:r,onRetry:i,rowClassName:a}){return t.length?(0,R.jsx)(`div`,{"aria-live":`polite`,className:`caps-upload-queue flex w-full min-w-0 flex-col gap-sm ${e??``}`,"data-upload-rows":!0,children:t.map(e=>(0,R.jsx)($je,{item:e,onCancel:n,onRemove:r,onRetry:i,...a===void 0?{}:{rowClassName:a}},e.id))}):null}function n6({action:e,id:t,onAction:n,retry:r=!1}){return e?(0,R.jsx)(R4,{"aria-label":e.accessibleLabel,title:e.label,variant:`ghost`,size:`xs`,className:`motion-reduce:transition-none`,icon:r?(0,R.jsx)(rje,{}):(0,R.jsx)(L4,{}),onClick:()=>void n(t),type:`button`}):null}function Qje({item:e}){return(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block min-w-0 truncate`,title:e.name,children:e.name}),(0,R.jsx)(`div`,{className:`caps-upload-details`,children:(0,R.jsxs)(`span`,{"aria-live":e.alert?`assertive`:void 0,className:`caps-upload-status min-w-0 break-words`,"data-upload-status":!0,role:e.alert?`alert`:void 0,children:[e.alert??e.statusLabel,` `,e.progressLabel]})})]})}function $je({item:e,onCancel:t,onRemove:n,onRetry:r,rowClassName:i}){return(0,R.jsxs)(`div`,{className:`caps-upload-row grid w-full min-w-0 max-w-full grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-sm p-sm text-xs ${i??``}`,children:[e.preview.kind===`image`?(0,R.jsx)(`img`,{alt:``,className:`caps-upload-preview mask mask-squircle size-8 shrink-0 object-cover`,src:e.preview.url}):(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`caps-upload-preview mask mask-squircle flex size-8 shrink-0 items-center justify-center bg-base-300`,children:(0,R.jsx)(eje,{className:`size-4`})}),(0,R.jsx)(Qje,{item:e}),(0,R.jsx)(eMe,{actions:e.actions,id:e.id,onCancel:t,onRemove:n,onRetry:r}),(0,R.jsx)(t6,{"aria-label":`${e.name} progress`,className:`caps-upload-progress`,tone:e.alert?`error`:e.progress===100?`success`:`accent`,max:100,value:e.progress??(e.alert?0:void 0)})]})}function eMe({actions:e,id:t,onCancel:n,onRemove:r,onRetry:i}){return(0,R.jsxs)(`div`,{className:`caps-upload-actions flex min-w-0 flex-wrap justify-end gap-xs`,children:[(0,R.jsx)(n6,{action:e.retry,id:t,onAction:i,retry:!0}),(0,R.jsx)(n6,{action:e.cancel,id:t,onAction:n}),(0,R.jsx)(n6,{action:e.remove,id:t,onAction:r})]})}var r6={unchecked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,checked:`M3.25 5.9 L5.1 7.9 L8.8 3.8`,mixed:`M3.4 6 L6 6 L8.6 6`},tMe={blurStdDeviation:.22,alphaSlope:18,alphaIntercept:-8};function nMe({state:e}){let t=`caps-checkbox-${(0,F.useId)().replaceAll(`:`,``)}`,n=(0,F.useRef)(null),r=(0,F.useRef)(e).current,i=(0,F.useRef)(e),a=_C();return(0,F.useLayoutEffect)(()=>{if(!n.current)return;let t=e!==`unchecked`,r=i.current!==`unchecked`,o=a||i.current===e;i.current=e;let s=dC(n.current),c=qT(s,{ease:`inCubic`,duration:160}),l=TT(n.current,{d:{to:r6[e],...o?GT:qT(s,{ease:`outCubic`,duration:200})},"stroke-dashoffset":{to:+!t,...o?GT:t?qT(s,{ease:`inOutSine`,duration:260}):c},"stroke-width":o?{to:t?2.4:0,duration:0}:t&&!r?[{to:2.2,...qT(s,{ease:`outCubic`,duration:65})},{to:2.4,delay:pC(s,120),...KT(s,{bounce:.35,duration:220})}]:{to:t?2.4:0,...c}});return()=>{l.cancel()}},[e,a]),(0,R.jsxs)(`svg`,{className:`caps-checkbox-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,R.jsx)(kT,{id:`${t}-shadow`}),(0,R.jsx)(AT,{id:`${t}-inset`}),(0,R.jsx)(MT,{id:`${t}-goo`,values:tMe}),(0,R.jsxs)(`filter`,{id:`${t}-relief`,x:`-25%`,y:`-25%`,width:`150%`,height:`150%`,colorInterpolationFilters:`sRGB`,children:[(0,R.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.28`,result:`relief`}),(0,R.jsx)(`feSpecularLighting`,{in:`relief`,surfaceScale:`1.2`,specularConstant:`0.55`,specularExponent:`18`,lightingColor:`color-mix(in srgb, var(--color-white) calc(var(--depth) * 100%), var(--color-black))`,result:`light`,children:(0,R.jsx)(`feDistantLight`,{azimuth:`225`,elevation:`55`})}),(0,R.jsx)(`feComposite`,{in:`light`,in2:`SourceAlpha`,operator:`in`,result:`clipped-light`}),(0,R.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`clipped-light`,mode:`screen`})]}),(0,R.jsx)(`mask`,{id:`${t}-contour`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`12`,height:`12`,style:{maskType:`alpha`},children:(0,R.jsx)(`path`,{ref:n,d:r6[r],fill:`none`,stroke:`var(--color-white)`,strokeWidth:r===`unchecked`?0:2.4,pathLength:`1`,strokeDasharray:`1`,strokeDashoffset:+(r===`unchecked`),strokeLinecap:`round`,strokeLinejoin:`round`,filter:e===`mixed`?void 0:`url(#${t}-goo)`})}),(0,R.jsx)(`clipPath`,{id:`${t}-well`,children:(0,R.jsx)(`rect`,{x:`1`,y:`1`,width:`10`,height:`10`,rx:`2.5`})})]}),(0,R.jsx)(`rect`,{className:`caps-checkbox-track`,x:`0.5`,y:`0.5`,width:`11`,height:`11`,rx:`3`,filter:`url(#${t}-inset)`}),(0,R.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,R.jsx)(`g`,{filter:`url(#${t}-shadow)`,children:(0,R.jsx)(`g`,{filter:`url(#${t}-relief)`,children:(0,R.jsx)(`g`,{mask:`url(#${t}-contour)`,children:(0,R.jsx)(`rect`,{x:`0`,y:`0`,width:`12`,height:`12`,fill:`url(#${t}-surface)`})})})})})]})}var i6=(0,F.forwardRef)(function({className:e,appearance:t,indicator:n,invalid:r,indeterminate:i=!1,checked:a,defaultChecked:o=!1,onChange:s,...c},l){let u=(0,F.useRef)(null),[d,f]=(0,F.useState)(o),p=a??d,m=i?`mixed`:p?`checked`:`unchecked`;return(0,F.useImperativeHandle)(l,()=>{if(!u.current)throw Error(`Checkbox input is not mounted`);return u.current},[]),(0,F.useLayoutEffect)(()=>{u.current&&(u.current.indeterminate=i)},[i]),(0,F.useEffect)(()=>{let e=u.current?.form;if(!e||a!==void 0)return;let t=e=>{queueMicrotask(()=>{!e.defaultPrevented&&u.current&&f(o)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[a,o,c.form]),(0,R.jsxs)(`span`,{className:`caps-checkbox`,"data-appearance":t===`compact`?t:void 0,"data-state":m,"data-custom-indicator":n!==void 0||void 0,children:[(0,R.jsx)(`input`,{...c,checked:p,"aria-checked":i?`mixed`:p,"aria-invalid":r?!0:c[`aria-invalid`]===!1?void 0:c[`aria-invalid`],className:cC(`caps-checkbox-input`,e),onChange:e=>{a===void 0&&f(e.target.checked),s?.(e),e.currentTarget.indeterminate=i},ref:u,type:`checkbox`}),n===void 0?(0,R.jsx)(nMe,{state:m}):n]})}),rMe=Ile({keyCode:Rle(229)});function iMe(e){return e.nativeEvent.isComposing||Ae(rMe,e.nativeEvent).success}var a6={};function o6(e,t){let n=F.useRef(a6);return n.current===a6&&(n.current=e(t)),n}var s6=[],c6=void 0;function aMe(){return c6}function oMe(e){s6.push(e)}function l6(e){let t=(t,n)=>{let r=o6(cMe).current,i;try{c6=r;for(let e of s6)e.before(r);i=e(t,n);for(let e of s6)e.after(r);r.didInitialize=!0}finally{c6=void 0}return i};return t.displayName=e.displayName||e.name,t}function sMe(e){return F.forwardRef(l6(e))}function cMe(){return{didInitialize:!1}}function u6(){}var lMe=Object.freeze([]),d6=Object.freeze({});function f6(e){F.useEffect(e,lMe)}var p6=0,m6=class e{static create(){return new e}currentId=p6;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=p6,t()},e)}isStarted(){return this.currentId!==p6}clear=()=>{this.currentId!==p6&&(clearTimeout(this.currentId),this.currentId=p6)};disposeEffect=()=>this.clear};function h6(){let e=o6(m6.create).current;return f6(e.disposeEffect),e}var g6=typeof document<`u`?F.useLayoutEffect:()=>{};function uMe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:dMe,platform:fMe,maxTouchPoints:pMe}=uMe(),_6=dMe.toLowerCase(),v6=fMe.toLowerCase(),y6=/^i(os$|p)/.test(v6)||v6===`macintel`&&pMe>1,b6=`android`,x6=v6===b6||_6.includes(b6),mMe=!y6&&v6.startsWith(`mac`);v6.startsWith(`win`),!x6&&/^(linux|chrome os)/.test(v6);var hMe=mMe||y6,S6=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!S6&&_6.includes(`firefox`),!S6&&_6.includes(`chrom`);var gMe=hMe,_Me=/jsdom|happydom/.test(_6);function vMe(e){e.preventDefault(),e.stopPropagation()}function yMe(e){return`nativeEvent`in e}function C6(e){return e.pointerType===``&&e.isTrusted?!0:x6&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function w6(e){return _Me?!1:!x6&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(x6||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function T6(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function bMe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function E6(){return typeof window<`u`}function D6(e){return A6(e)?(e.nodeName||``).toLowerCase():`#document`}function O6(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function k6(e){return((A6(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function A6(e){return E6()?e instanceof Node||e instanceof O6(e).Node:!1}function j6(e){return E6()?e instanceof Element||e instanceof O6(e).Element:!1}function M6(e){return E6()?e instanceof HTMLElement||e instanceof O6(e).HTMLElement:!1}function N6(e){return!E6()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof O6(e).ShadowRoot}function P6(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=V6(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xMe(e){return/^(table|td|th)$/.test(D6(e))}function F6(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var SMe=/transform|translate|scale|rotate|perspective|filter/,CMe=/paint|layout|strict|content/,I6=e=>!!e&&e!==`none`,L6;function R6(e){let t=j6(e)?V6(e):e;return I6(t.transform)||I6(t.translate)||I6(t.scale)||I6(t.rotate)||I6(t.perspective)||!z6()&&(I6(t.backdropFilter)||I6(t.filter))||SMe.test(t.willChange||``)||CMe.test(t.contain||``)}function wMe(e){let t=U6(e);for(;M6(t)&&!B6(t);){if(R6(t))return t;if(F6(t))return null;t=U6(t)}return null}function z6(){return L6??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),L6}function B6(e){return/^(html|body|#document)$/.test(D6(e))}function V6(e){return O6(e).getComputedStyle(e)}function H6(e){return j6(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function U6(e){if(D6(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||N6(e)&&e.host||k6(e);return N6(t)?t.host:t}function W6(e){let t=U6(e);return B6(t)?(e.ownerDocument||e).body:M6(t)&&P6(t)?t:W6(t)}function G6(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=W6(e),i=r===e.ownerDocument?.body,a=O6(r);if(i){let e=K6(a);return t.concat(a,a.visualViewport||[],P6(r)?r:[],e&&n?G6(e):[])}return t.concat(r,G6(r,[],n))}function K6(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q6(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function J6(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&N6(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Y6(e,t){let n=e;for(;n;){if(j6(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(N6(n)?n.host:null)}return null}function X6(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var TMe=`data-base-ui-focusable`,EMe=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Z6=`data-starting-style`,DMe=`data-ending-style`,OMe={[Z6]:``},kMe={[DMe]:``},AMe={transitionStatus(e){return e===`starting`?OMe:e===`ending`?kMe:null}},jMe=`data-open`,MMe=`data-closed`,NMe=`data-anchor-hidden`,Q6=`data-popup-open`,PMe=`data-pressed`,FMe={[Q6]:``},IMe={[Q6]:``,[PMe]:``},LMe={[jMe]:``},RMe={[MMe]:``},zMe={[NMe]:``},BMe={open(e){return e?FMe:null}},VMe={open(e){return e?IMe:null}},$6={open(e){return e?LMe:RMe},anchorHidden(e){return e?zMe:null}},HMe={...$6,...AMe},e8=`data-trigger-disabled`;function t8(e,t){if(!j6(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(e8);for(let[,e]of t.entries())if(J6(e,n))return!e.hasAttribute(e8);return!1}function n8(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function UMe(e){return e.matches(`html,body`)}function r8(e){return M6(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function WMe(e){return Y6(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${EMe}`)!=null}function i8(e){return e?e.getAttribute(`role`)===`combobox`&&r8(e):!1}function a8(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function GMe(e,t){return t!=null&&!T6(t)?0:typeof e==`function`?e():e}function o8(e,t,n){let r=GMe(e,n);return typeof r==`number`?r:r?.[t]}function s8(e){return typeof e==`function`?e():e}function c8(e,t){return t||e===`click`||e===`mousedown`}function KMe(e){return e?.includes(`mouse`)&&e!==`mousedown`}function l8(e,t,n,r){let i=!1,a=!1,o=r??d6;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var qMe=`none`,u8=`trigger-press`,d8=`trigger-hover`,JMe=`outside-press`,f8=`focus-out`,YMe=`escape-key`,XMe=`imperative-action`;function p8(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function m8(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function h8(e,t,n,r){let i=o6(g8).current;return QMe(i,e,t,n,r)&&_8(i,[e,t,n,r]),i.callback}function ZMe(e){let t=o6(g8).current;return $Me(t,e)&&_8(t,e),t.callback}function g8(){return{callback:null,cleanup:null,refs:[]}}function QMe(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function $Me(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function _8(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function v8(e){let t=o6(eNe,e).current;return t.next=e,g6(t.effect),t}function eNe(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var y8={...F},b8=y8.useInsertionEffect,tNe=b8&&b8!==y8.useLayoutEffect?b8:e=>e();function x8(e){let t=o6(nNe).current;return t.next=e,tNe(t.effect),t.trampoline}function nNe(){let e={next:void 0,callback:rNe,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function rNe(){}var S8=null;globalThis.requestAnimationFrame;var C8=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},w8=class e{static create(){return new e}static request(e){return C8.request(e)}static cancel(e){return C8.cancel(e)}currentId=S8;request(e){this.cancel(),this.currentId=C8.request(()=>{this.currentId=S8,e()})}cancel=()=>{this.currentId!==S8&&(C8.cancel(this.currentId),this.currentId=S8)};disposeEffect=()=>this.cancel};function T8(){let e=o6(w8.create).current;return f6(e.disposeEffect),e}function E8(e){return e?.ownerDocument||document}var D8={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},iNe={...D8,position:`fixed`,margin:0,top:0,left:0};({...D8});var O8=F.forwardRef(function(e,t){let[n,r]=F.useState();g6(()=>{gMe&&S6&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,R.jsx)(`span`,{...e,ref:t,style:iNe,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),k8=Math.min,A8=Math.max,j8=Math.round,M8=Math.floor,N8=e=>({x:e,y:e}),aNe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function P8(e,t,n){return A8(e,k8(t,n))}function F8(e,t){return typeof e==`function`?e(t):e}function I8(e){return e.split(`-`)[0]}function L8(e){return e.split(`-`)[1]}function R8(e){return e===`x`?`y`:`x`}function z8(e){return e===`y`?`height`:`width`}function B8(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function V8(e){return R8(B8(e))}function oNe(e,t,n){n===void 0&&(n=!1);let r=L8(e),i=V8(e),a=z8(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=G8(o)),[o,G8(o)]}function sNe(e){let t=G8(e);return[H8(e),t,H8(t)]}function H8(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var U8=[`left`,`right`],W8=[`right`,`left`],cNe=[`top`,`bottom`],lNe=[`bottom`,`top`];function uNe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?W8:U8:t?U8:W8;case`left`:case`right`:return t?cNe:lNe;default:return[]}}function dNe(e,t,n,r){let i=L8(e),a=uNe(I8(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(H8)))),a}function G8(e){let t=I8(e);return aNe[t]+e.slice(t.length)}function fNe(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function K8(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:fNe(e)}function q8(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 pNe(e){return e.visibility===`hidden`||e.visibility===`collapse`}function J8(e,t=e?V6(e):null){return!e||!e.isConnected||!t||pNe(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var mNe=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function hNe(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return N6(n)?n.host:null}function Y8(e){for(let t of Array.from(e.children))if(D6(t)===`summary`)return t;return null}function gNe(e,t){let n=Y8(t);return!!n&&(e===n||J6(n,e))}function X8(e){let t=e?D6(e):``;return e!=null&&e.matches(mNe)&&(t!==`summary`||e.parentElement!=null&&D6(e.parentElement)===`details`&&Y8(e.parentElement)===e)&&(t!==`details`||Y8(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Z8(e){if(!X8(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=hNe(t)){let n=t!==e,r=D6(t)===`slot`;if(t.hasAttribute(`inert`)||n&&D6(t)===`details`&&!t.open&&!gNe(e,t)||t.hasAttribute(`hidden`)||!r&&!_Ne(t,n))return!1}return!0}function _Ne(e,t){let n=V6(e);return t?n.display!==`none`:J8(e,n)}function Q8(e){let t=e.tabIndex;if(t<0){let t=D6(e);if(t===`details`||t===`audio`||t===`video`||M6(e)&&e.isContentEditable)return 0}return t}function $8(e){if(D6(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function e5(e,t){let n=$8(e);if(!n)return!0;let r=t.find(e=>{let t=$8(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=$8(e);return t?.name===n.name&&t.form===n.form})===n}function t5(e){if(M6(e)&&D6(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return M6(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function n5(e,t){t5(e).forEach(e=>{X8(e)&&t.push(e),n5(e,t)})}function r5(e,t,n){t5(e).forEach(e=>{M6(e)&&e.matches(t)&&n.push(e),r5(e,t,n)})}function i5(e){return Z8(e)&&Q8(e)>=0}function a5(e){let t=[];return n5(e,t),t.filter(Z8)}function o5(e){let t=a5(e);return t.filter(e=>Q8(e)>=0&&e5(e,t))}function s5(e,t){let n=o5(e),r=n.length;if(r===0)return;let i=q6(E8(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function c5(e){return s5(E8(e).body,1)||e}function l5(e){return s5(E8(e).body,-1)||e}function vNe(e,t,n){if(!e)return null;let r=[];n5(E8(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Z8);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!J6(n,o)&&i5(o)&&e5(o,a))return o}return r[i]}function u5(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!J6(n,r)}function yNe(e){o5(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function d5(e){let t=[];r5(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function f5(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...f5(e,t.id,n)])}function p5(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function m5(e){return`data-base-ui-${e}`}var h5=0;function g5(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(h5);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),u6;let o=requestAnimationFrame(a);return h5=o,()=>{h5===o&&(cancelAnimationFrame(o),h5=0)}}var _5=`data-base-ui-inert`,v5=new WeakMap,y5=new WeakSet,b5=new WeakMap,x5=0;function S5(e){return e?N6(e)?e.host:S5(e.parentNode):null}var C5=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=S5(t);return e.contains(n)?n:null}).filter(e=>e!=null),w5=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},T5=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{D6(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function bNe(e,t,n,{mark:r=!0}){let i=C5(t,e),a=r?T5(t,w5(i),new Set(i)):[],o=[],s=[];if(n){let e=C5(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);T5(t,w5(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(v5.get(e)||0)+1;v5.set(e,r),o.push(e),r===1&&n&&y5.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(b5.get(e)||0)+1;b5.set(e,t),s.push(e),t===1&&e.setAttribute(_5,``)}),x5+=1,()=>{o.forEach(e=>{let t=(v5.get(e)||0)-1;v5.set(e,t),t||(y5.has(e)||e.removeAttribute(`aria-hidden`),y5.delete(e))}),r&&s.forEach(e=>{let t=(b5.get(e)||0)-1;b5.set(e,t),t||e.removeAttribute(_5)}),--x5,x5||(v5=new WeakMap,y5=new WeakSet,b5=new WeakMap)}}function E5(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=E8(e[0]).body;return bNe(e,i,n,{mark:r})}function D5(){let[,e]=F.useState({});return F.useCallback(()=>{e({})},[])}var O5=0;function xNe(e,t=`mui`){let n=F.useRef(void 0),r=D5(),i=e??n.current;return F.useEffect(()=>{n.current??(O5+=1,n.current=`${t}-${O5}`,e??r())},[e,t,r]),i}var k5=y8.useId;function A5(e,t){if(k5!==void 0){let n=k5();return e??(t?`${t}-${n}`:n)}return xNe(e,t)}var SNe=18;function j5(e){return SNe>=e}function M5(e){if(!F.isValidElement(e))return null;let t=e,n=t.props;return(j5(19)?n?.ref:t.ref)??null}function N5(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function CNe(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function wNe(e,t){return typeof e==`function`?e(t):e}function TNe(e,t){return typeof e==`function`?e(t):e}var P5={};function F5(e,t,n,r,i){if(!n&&!r&&!i&&!e)return I5(t);let a=I5(e);return t&&(a=L5(a,t)),n&&(a=L5(a,n)),r&&(a=L5(a,r)),i&&(a=L5(a,i)),a}function ENe(e){if(e.length===0)return P5;if(e.length===1)return I5(e[0]);let t=I5(e[0]);for(let n=1;n<e.length;n+=1)t=L5(t,e[n]);return t}function I5(e){return z5(e)?{...e(P5)}:DNe(e)}function L5(e,t){return z5(t)?t(e):ONe(e,t)}function DNe(e){let t={...e};for(let e in t){let n=t[e];R5(e,n)&&(t[e]=B5(n))}return t}function ONe(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=N5(e.style,r);break;case`className`:e[n]=H5(e.className,r);break;default:e[n]=R5(n,r)?kNe(e[n],r):r}}return e}function R5(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function z5(e){return typeof e==`function`}function kNe(e,t){return t?e?(...n)=>{let r=n[0];if(U5(r)){let i=r;V5(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:B5(t):e}function B5(e){return e&&((...t)=>{let n=t[0];return U5(n)&&V5(n),e(...t)})}function V5(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function H5(e,t){return t?e?t+` `+e:t:e}function U5(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function W5(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=NNe(r));let i=ANe(t,n,r);if(n.enabled===!1)return null;let a=n.state??d6;return PNe(e,r,i,a)}function ANe(e,t,n){let{className:r,style:i}=e,{state:a=d6,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?wNe(r,a):void 0,d=l?TNe(i,a):void 0,f=l?CNe(a,c):d6,p=l&&s?jNe(s):void 0,m=l?N5(f,p)??{}:d6;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ZMe([m.ref,M5(n),...o]):h8(m.ref,M5(n),o):h8(null,null)),l?(u!==void 0&&(m.className=H5(m.className,u)),d!==void 0&&(m.style=N5(m.style,d)),m):d6}function jNe(e){return Array.isArray(e)?ENe(e):F5(void 0,e)}var MNe=Symbol.for(`react.lazy`);function NNe(e){if(e?.$$typeof!==MNe)return e;let t=F.Children.toArray(e)[0];return F.isValidElement(t)?t:e}function PNe(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=F5(n,t.props);return e.ref=n.ref,F.cloneElement(t,e)}return FNe(e,n)}function FNe(e,t){return e===`button`?(0,F.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,F.createElement)(`img`,{alt:``,...t,key:t.key}):F.createElement(e,t)}var INe={style:{transition:`none`}},LNe=`data-base-ui-click-trigger`,RNe={fallbackAxisSide:`end`},zNe={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},G5=c(nv(),1),K5=F.createContext(null),q5=()=>F.useContext(K5),BNe=m5(`portal`);function VNe(e={}){let{ref:t,container:n,componentProps:r=d6,elementProps:i}=e,a=A5(),o=q5()?.portalNode,[s,c]=F.useState(null),[l,u]=F.useState(null),d=x8(e=>{e!==null&&u(e)}),f=F.useRef(null);g6(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(A6(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=W5(`div`,r,{ref:[t,d],props:[{id:a,[BNe]:``},i]}),m=s&&p?G5.createPortal(p,s):null;return{node:l,nodeId:F.isValidElement(p)?p.props.id:void 0,subtree:m}}var HNe=F.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=VNe({container:o,ref:t,componentProps:e,elementProps:c}),f=F.useRef(null),p=F.useRef(null),m=F.useRef(null),h=F.useRef(null),[g,_]=F.useState(null),v=F.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;F.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&u5(e)&&(e.type===`focusin`?v.current&&=(d5(l),!1):(yNe(l),v.current=!0))}return m8(p8(l,`focusin`,e,!0),p8(l,`focusout`,e,!0))},[l,y]),g6(()=>{!l||b!==!0||!v.current||(d5(l),v.current=!1)},[b,l]);let S=F.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,R.jsxs)(F.Fragment,{children:[d,(0,R.jsxs)(K5.Provider,{value:S,children:[x&&l&&(0,R.jsx)(O8,{"data-type":`outside`,ref:f,onFocus:e=>{u5(e,l)?m.current?.focus():l5(g?g.domReference:null)?.focus()}}),x&&l&&(0,R.jsx)(`span`,{role:s,"aria-owns":u,style:zNe}),l&&G5.createPortal(a,l),x&&l&&(0,R.jsx)(O8,{"data-type":`outside`,ref:p,onFocus:e=>{u5(e,l)?h.current?.focus():(c5(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,l8(`focus-out`,e.nativeEvent)))}})]})]})});function J5(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var UNe=class{nodesRef={current:[]};events=J5();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Y5=F.createContext(null),X5=F.createContext(null),Z5=()=>F.useContext(Y5)?.id||null,Q5=e=>{let t=F.useContext(X5);return e??t};function WNe(e){let t=A5(),n=Q5(e),r=Z5();return g6(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function GNe(e){let{children:t,id:n}=e,r=Z5();return(0,R.jsx)(Y5.Provider,{value:F.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function KNe(e){let{children:t,externalTree:n}=e,r=o6(()=>n??new UNe).current;return(0,R.jsx)(X5.Provider,{value:r,children:t})}function $5(e){return e==null?e:`current`in e?e.current:e}function qNe(e,t){let n=O6(X6(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(C6(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var JNe=20,e7=[];function t7(){e7=e7.filter(e=>e.deref()?.isConnected)}function n7(e){t7(),e&&D6(e)!==`body`&&(e7.push(new WeakRef(e)),e7.length>JNe&&(e7=e7.slice(-20)))}function r7(){return t7(),e7[e7.length-1]?.deref()}function YNe(e){return e?i5(e)?e:o5(e)[0]||e:null}function i7(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=a5(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return i5(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function XNe(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=x8(()=>b.current.floatingContext?.nodeId),S=i===!1,C=i8(_)&&S,w=v8(i),T=v8(a),E=v8(o),D=v8(u),O=v8(g),k=Q5(m),A=q5(),j=F.useRef(!1),M=F.useRef(!1),ee=F.useRef(!1),N=F.useRef(null),te=F.useRef(``),ne=F.useRef(``),re=F.useRef(null),P=F.useRef(null),ie=h8(re,p,A?.beforeInsideRef),ae=h8(P,A?.afterInsideRef),oe=h6(),se=h6(),ce=T8(),le=A!=null,ue=a8(v),de=x8((e=ue)=>e?o5(e):[]),fe=x8(()=>h?.().filter(e=>e!=null)??[]);F.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&J6(ue,q6(E8(ue)))&&de().length===0&&!C&&vMe(e)}return p8(E8(ue),`keydown`,e)},[r,ue,c,C,de]),F.useEffect(()=>{if(r||!g)return;let e=E8(ue);function t(){ee.current=!1}function n(e){let t=X6(e),n=fe(),r=J6(v,t)||J6(_,t)||J6(A?.portalNode,t)||n.some(e=>e===t||J6(e,t));ee.current=!r,ne.current=e.pointerType||`keyboard`,Y6(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,se.start(0,()=>{M.current=!1}))}function i(){ne.current=`keyboard`}return m8(p8(e,`pointerdown`,n,!0),p8(e,`pointerup`,t,!0),p8(e,`pointercancel`,t,!0),p8(e,`keydown`,i,!0),t)},[r,v,_,ue,g,A,se,fe]),F.useEffect(()=>{if(r||!l)return;let e=E8(ue);function n(){M.current=!0,se.start(0,()=>{M.current=!1})}function i(e){let t=X6(e);i5(t)&&(N.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=X6(n);c&&r==null&&a!=null&&J6(v,a)&&n7(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=fe(),p=r?.hasAttribute(m5(`focus-guard`))&&[re.current,P.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,$5(f),$5(d)].includes(r),m=!(J6(_,r)||J6(v,r)||J6(r,v)||J6(A?.portalNode,r)||u.some(e=>e===r||J6(e,r))||l.hasMatchingElement(e=>J6(e,r))||p||k&&(f5(k.nodesRef.current,o).find(e=>J6(e.context?.elements.floating,r)||J6(e.context?.elements.domReference,r))||p5(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,a8(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&ue&&i7(ue),s&&i!==_&&!J8(a)&&q6(e)===e.body){if(M6(ue)&&(ue.focus(),s===`popup`)){ce.request(()=>{ue.focus()});return}let e=de(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ue;M6(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!c)&&r&&m&&!M.current&&(C||r!==r7())&&(j.current=!0,t.setOpen(!1,l8(f8,n)))})}function o(){ee.current||(b.current.insideReactTree=!0,oe.start(0,()=>{b.current.insideReactTree=!1}))}let u=M6(_)?_:null;if(!(!v&&!u))return m8(u&&p8(u,`focusout`,a),u&&p8(u,`pointerdown`,n),v&&p8(v,`focusin`,i),v&&p8(v,`focusout`,a),v&&A&&p8(v,`focusout`,o,!0))},[r,_,v,ue,c,k,A,t,l,s,de,C,x,b,oe,se,ce,d,f,fe]),F.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${m5(`portal`)}]`)||[]),t=(k?p5(k.nodesRef.current,x()):[]).find(e=>i8(e.context?.elements.domReference||null))?.context?.elements.domReference,n=E5([v,...e,re.current,P.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...fe(),t,$5(f),$5(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=E5([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,fe]),g6(()=>{if(!g||r||!M6(ue))return;te.current=``,ne.current=``;let e=E8(ue),t=q6(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||J6(ue,t))return;let i=null,a=()=>(i??=de(ue),i[0]||ue),o;o=r===!0||r===null?a():$5(r),o||=a();let s=J6(ue,q6(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&C6(c);g5(o,{sync:l,preventScroll:o===ue,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=q6(e);return!(t!==o&&J6(ue,t))}})})},[r,g,ue,de,w,D,O,b]);let pe=F.useRef(null);g6(()=>{if(r||!ue){pe.current=null;return}pe.current&&=(pe.current.cancelled=!0,null);let e=E8(ue),t=q6(e),n=D.current==null;n7(t);function i(e){if(e.open||(te.current=qNe(e.nativeEvent,ne.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(m5(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(C6(e.nativeEvent)||w6(e.nativeEvent))j.current=!1;else{let e=!1;E8(ue).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&D6(t)!==`body`?t:null,s=n?o||a:a||o;return s||=r7()||null,typeof i==`boolean`?s:$5(i)||s||null}return()=>{y.off(`openchange`,i);let t=q6(e),n=fe(),r=J6(v,t)||n.some(e=>e===t||J6(e,t))||k&&f5(k.nodesRef.current,x(),!1).some(e=>J6(e.context?.elements.floating,t)),o=T.current,s=te.current,c=a(s),l={cancelled:!1};pe.current=l,queueMicrotask(()=>{pe.current===l&&(pe.current=null);let n=YNe(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&M6(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,ue,T,E,D,y,k,_,x,fe]),g6(()=>{if(!S6||g||!v)return;let e=q6(E8(v));!M6(e)||!r8(e)||J6(v,e)&&e.blur()},[g,v]),g6(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),g6(()=>{if(!(r||!ue))return i7(ue),()=>{queueMicrotask(t7)}},[r,ue]);let me=!r&&(!c||!C)&&(le||c);return(0,R.jsxs)(F.Fragment,{children:[me&&(0,R.jsx)(O8,{"data-type":`inside`,ref:ie,onFocus:e=>{if(c){let e=de();g5(e[e.length-1])}else A?.portalNode&&(j.current=!1,u5(e,A.portalNode)?c5(_)?.focus():$5(f??A.beforeOutsideRef)?.focus())}}),n,me&&(0,R.jsx)(O8,{"data-type":`inside`,ref:ae,onFocus:e=>{c?g5(de()[0]):A?.portalNode&&(l&&(j.current=!0),u5(e,A.portalNode)?l5(_)?.focus():$5(d??A.afterOutsideRef)?.focus())}})]})}function ZNe(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=u8}=t,l=e.context.dataRef,u=F.useRef(void 0),d=T8(),f=h6(),p=F.useMemo(()=>{function t(t,n,r,i){let a=l8(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=T6(e.pointerType,!0)&&w6(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||T6(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=X6(s),p=r8(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;if(r===`mousedown`&&o){u.current=void 0;return}T6(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return F.useMemo(()=>n?{reference:p}:d6,[n,p])}function QNe(){return!1}function $Ne(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ePe(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=QNe,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Q5(c),m=x8(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=x8(()=>a),{escapeKey:v,outsidePress:y}=$Ne(s),b=F.useRef(!1),x=F.useRef(!1),S=F.useRef(!1),C=F.useRef(!1),w=F.useRef(!1),T=F.useRef(``),E=F.useRef(null),D=h6(),O=h6(),k=h6(),A=x8(()=>{O.clear(),d.current.insideReactTree=!1}),j=x8(e=>{let t=d.current.floatingContext?.nodeId;return(p?f5(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=x8(t=>n8(t,e.select(`floatingElement`))||n8(t,e.select(`domReferenceElement`))),ee=x8(t=>{o()&&e.setOpen(!1,l8(u8,t.nativeEvent))}),N=x8(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=yMe(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=l8(YMe,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),te=x8(()=>{d.current.insideReactTree=!0,O.start(0,A)}),ne=x8(t=>{if(!l||!n||t.button!==0)return;let r=X6(t.nativeEvent);J6(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),re=x8(e=>{!l||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});F.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),F.useEffect(()=>A,[A]),F.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new m6,i=E8(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(S6?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&f5(p.nodesRef.current,t).some(t=>n8(e,t.context?.elements.floating));return M(e)||n}function ee(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=X6(n),i=`[${m5(`inert`)}]`,a=j6(r)?r.getRootNode():null,o=Array.from((N6(a)?a:E8(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>J6(e,r))))return;let c=j6(r)?r:null;for(;c&&!B6(c);){let e=U6(c);if(B6(e)||!j6(e))break;c=e}if(!(o.length&&j6(r)&&!UMe(r)&&!J6(r,e.select(`floatingElement`))&&o.every(e=>!J6(c,e)))){if(M6(r)&&!(`touches`in n)){let e=B6(r),t=V6(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!C6(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,l8(JMe,n)),A())}}}function te(t){f()!==`sloppy`||t.pointerType===`touch`||!e.select(`open`)||!n||M(t)||ee(t)}function ne(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function re(e,t){let n=X6(e);if(!n)return;let r=p8(n,e.type,()=>{t(e),r()})}function P(e){T.current=`touch`,re(e,ne)}function ie(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&re(e,e=>{e.type===`pointerdown`?te(e):ee(e)})}function ae(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;if(c(),f()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!O(e)){if(n){s();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,A())}}}function oe(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(ee(e),D.clear(),E.current=null)}function se(e){re(e,oe)}function ce(e){f()!==`sloppy`||!E.current||M(e)||(E.current.dismissOnTouchEnd&&ee(e),D.clear(),E.current=null)}function le(e){re(e,ce)}let ue=m8(r&&m8(p8(i,`keydown`,N),p8(i,`compositionstart`,a),p8(i,`compositionend`,o)),g&&m8(p8(i,`click`,ie,!0),p8(i,`pointerdown`,ie,!0),p8(i,`pointerup`,ae,!0),p8(i,`pointercancel`,ae,!0),p8(i,`mousedown`,ie,!0),p8(i,`mouseup`,ae,!0),p8(i,`touchstart`,P,{capture:!0,passive:!0}),p8(i,`touchmove`,se,{capture:!0,passive:!0}),p8(i,`touchend`,le,{capture:!0,passive:!0})));return()=>{ue(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,N,A,_,j,M,p,e,D,k]);let P=F.useMemo(()=>({onKeyDown:N,onPointerDown:ee,onClick:ee}),[N,ee]),ie=F.useMemo(()=>({onKeyDown:N,onPointerDown:re,onMouseDown:re,onClickCapture:te,onMouseDownCapture(e){te(),ne(e)},onPointerDownCapture(e){te(),ne(e)},onMouseUpCapture:te,onTouchEndCapture:te,onTouchMoveCapture:te}),[N,te,ne,re]);return F.useMemo(()=>n?{reference:P,floating:ie,trigger:P}:{},[n,P,ie])}function tPe(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var a7=tPe(`https://base-ui.com/production-error`,`Base UI`);function nPe(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),g6(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};j6(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function rPe(e,t=!1,n=!1,r=!1){let[i,a]=F.useState(e&&t?`idle`:void 0),[o,s]=F.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),g6(()=>{if(!e&&o&&i!==`ending`&&n){let e=w8.request(()=>{a(`ending`)});return()=>{w8.cancel(e)}}},[e,o,i,n]),g6(()=>{if(!e||t||i===void 0)return;let n=w8.request(()=>{a(void 0)});return()=>{w8.cancel(n)}},[t,e,i]),g6(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=w8.request(()=>{a(`idle`)});return()=>{w8.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function o7(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var s7=null;function iPe(e){if(!s7){let e=[];s7=e,queueMicrotask(()=>{s7=null,G5.flushSync(()=>{for(let t of e)t()})})}s7.push(e)}function c7(e,t=!1,n=!1){let r=T8();return x8((i,a=null)=>{r.cancel();let o=$5(e);if(o==null)return;let s=o,c=()=>{if(!n){G5.flushSync(i);return}iPe(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(o7(s).map(e=>e.finished.then(u6))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(o7(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Z6;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function l7(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=x8(a),s=c7(r,n,i);F.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function aPe(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=x8(i),{mounted:c,setMounted:l,transitionStatus:u}=rPe(t,!1,!1,o),d=!t&&r;g6(()=>{t&&s(!1)},[t,s]);let f=F.useRef(c),p=F.useRef(!1),m=D5(),h=()=>{f.current=!1,l(!1),a()};g6(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=x8(()=>{if(f.current){if(t){p.current=!0,m();return}h()}});return l7({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var oPe={tabIndex:-1,[TMe]:``};function sPe(e){return t=>t!==`touch`||e.current}function cPe(e,t=!1){let n=A5(),r=Z5()!=null,i=o6(()=>e(n,r)).current;return nPe({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function lPe({handle:e,store:t}){return g6(()=>e.attachStore(t),[e,t]),null}function u7(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function uPe(e,t){let n=F.useRef(null);return x8(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),u7(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),u7(t))})}function dPe(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function fPe(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function pPe(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=uPe(e,n),o=x8(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=x8(e=>{a(e),e&&o(e)});return g6(()=>(s(t.current),()=>s(null)),[s,t,n,e]),g6(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function mPe(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=F.useRef(null),i=e.useState(`open`);g6(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=l8(qMe);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function hPe(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=aPe({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return o6(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function gPe(e,t){e.useSyncedValues(t),g6(()=>()=>{e.update({activeTriggerProps:d6,inactiveTriggerProps:d6,popupProps:d6})},[e])}function _Pe(e,t){g6(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),g6(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var vPe=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},d7=W3(),yPe=j5(19)?xPe:SPe;function f7(e,t,n,r,i){return yPe(e,t,n,r,i)}function bPe(e,t,n,r,i){let a=F.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,d7.useSyncExternalStore)(e.subscribe,a,a)}oMe({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,d7.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function xPe(e,t,n,r,i){let a=aMe();if(!a)return bPe(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function SPe(e,t,n,r,i){return(0,G3.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var CPe=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return f7(this,e,t,n,r)}},p7=class extends CPe{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){F.useDebugValue(e);let n=this;g6(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;g6(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;g6(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){F.useDebugValue(e);let n=this,r=t!==void 0;g6(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return F.useDebugValue(e),f7(this,this.selectors[e],t,n,r)}useContextCallback(e,t){F.useDebugValue(e);let n=x8(t??u6);this.context[e]=n}useStateSetter(e){let t=F.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},wPe={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},TPe=class extends p7{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:J5(),nested:n,triggerElements:i},wPe),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&bMe(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function EPe(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new TPe({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:d6,inactiveTriggerProps:d6,popupProps:d6}}var m7=e=>e.triggerIdProp??e.activeTriggerId,h7=e=>e.openProp??e.open,g7=e=>(e.popupElement?.id??e.floatingId)||void 0;function _7(e,t){return t!==void 0&&h7(e)&&m7(e)===t}function DPe(e,t){return _7(e,t)?!0:t!==void 0&&h7(e)&&m7(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var v7={open:h7,mounted:e=>e.mounted,transitionStatus:e=>h7(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:m7,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:g7,isTriggerActive:(e,t)=>t!==void 0&&m7(e)===t,isOpenedByTrigger:(e,t)=>_7(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&m7(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>DPe(e,t)?g7(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function OPe(e){let t=F.useCallback(t=>e===void 0?u6:e.subscribeStore(t),[e]),n=F.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,d7.useSyncExternalStore)(t,n,()=>e?.serverStore)}var kPe=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new m6;restTimeout=new m6;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},y7=new WeakMap;function b7(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&y7.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),y7.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function x7(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=y7.get(n);a&&a!==e&&b7(a),b7(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,y7.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function S7(e){let t=e.context.dataRef.current,n=o6(()=>t.hoverInteractionState??kPe.create()).current;return t.hoverInteractionState||=n,f6(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function APe(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Q5(),u=Z5(),d=S7(e),f=h6(),p=x8(()=>c8(c.current.openEvent?.type,d.interactedInside)),m=x8(()=>KMe(c.current.openEvent?.type)),h=x8(()=>{b7(d)});g6(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),F.useEffect(()=>h,[h]),g6(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&j6(s)&&o){let e=s,t=o,n=E8(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Y6(e,`[data-rootownerid]`)??n.body;return x7(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),F.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&f5(l.nodesRef.current,u).length>0)}function a(t){let n=o8(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,l8(d8,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=X6(e);if(!WMe(t)){d.interactedInside=!1;return}d.interactedInside=Y6(t,`[aria-haspopup]`)!=null}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(t8(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(l&&r&&j6(o)&&f5(l.nodesRef.current,r,!1).some(e=>J6(e.context?.elements.floating,o)))){if(d.handler){d.handler(n);return}h(),m()&&!p()&&a(n)}}function v(n){!l||!u||t()||f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,l8(d8,n)),l.events.emit(`floating.closed`,n)})}let y=o;return m8(y&&p8(y,`mouseenter`,g),y&&p8(y,`mouseleave`,_),y&&p8(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var jPe={current:null};function MPe(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=jPe,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Q5(l),v=S7(e),y=F.useRef(!1),b=v8(i),x=v8(r),S=v8(o),C=v8(n),w=v8(p),T=v8(f),E=x8(()=>c8(h.current.openEvent?.type,v.interactedInside)),D=x8(()=>w.current?.()!==!1),O=x8((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!J6(t,n);if(!j6(r))return!1;let a=r;return i.hasMatchingElement(e=>J6(e,a))&&(!t||!J6(t,a))}),k=x8(()=>{v.handler&&=(E8(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=x8(()=>{b7(v)});return u&&(v.handleCloseOptions=i?.__options),F.useEffect(()=>k,[k]),F.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===d8,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),F.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=o8(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,l8(d8,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,l8(d8,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!j6(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!T6(v.pointerType))return;let n=s8(S.current),r=o8(x.current,`open`,v.pointerType),i=X6(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(j6(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(J6(t,i)){c=t;break}}j6(o)&&j6(s)&&!e.context.triggerElements.hasElement(o)&&J6(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&j6(c)&&j6(s)&&J6(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){D()&&e.setOpen(!0,l8(d8,t,c));return}m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,l8(d8,t,c))}):g&&D()&&e.setOpen(!0,l8(d8,t,c)))}function o(n){if(E()){A();return}k();let r=E8(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!t8(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n);return}(v.pointerType!==`touch`||!J6(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){J6(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?p8(r,`mouseout`,l):void 0;return s?m8(p8(r,`mousemove`,i,{once:!0}),p8(r,`mouseenter`,i),p8(r,`mouseleave`,o),f):m8(p8(r,`mouseenter`,i),p8(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),F.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!T6(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;x7(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=s8(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,l8(d8,n,r))}v.pointerType===`touch`?G5.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}var C7=.1,NPe=C7*C7,w7=.5;function T7(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function E7(e,t,n,r,i,a,o,s,c,l){let u=!1;return T7(e,t,n,r,i,a)&&(u=!u),T7(e,t,i,a,o,s)&&(u=!u),T7(e,t,o,s,c,l)&&(u=!u),T7(e,t,c,l,n,r)&&(u=!u),u}function PPe(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function D7(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function FPe(e={}){let{blockPointerEvents:t=!1}=e,n=new m6,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*NPe;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=X6(r),g=r.type===`mouseleave`,_=J6(u,h),v=J6(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&j6(r.relatedTarget)&&J6(u,r.relatedTarget))return;function y(){return!!(s&&f5(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=D7(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=D7(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=D7(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=D7(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!PPe(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?w7/2:w7*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+w7+1,o=C||T?S.bottom-w7:S.top,s=C?T?S.bottom-w7:S.top:S.bottom-w7;M=E7(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?w7/2:w7*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-w7,o=C||T?S.top+w7:S.bottom,s=C?T?S.top+w7:S.bottom:S.top+w7;M=E7(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?w7/2:w7*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+w7+1,o=w||E?S.right-w7:S.left,s=w?E?S.right-w7:S.left:S.right-w7;M=E7(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?w7/2:w7*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-w7,o=w||E?S.left+w7:S.right,s=w?E?S.left+w7:S.right:S.left+w7;M=E7(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function O7(e,t,n){let{reference:r,floating:i}=e,a=B8(t),o=V8(t),s=z8(o),c=I8(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=L8(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function IPe(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}=F8(t,e),p=K8(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=q8(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=q8(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 LPe=50,RPe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:IPe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=O7(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<LPe&&(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}=O7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},zPe=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}=F8(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=I8(r),_=B8(o),v=I8(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[G8(o)]:sNe(o)),x=p!==`none`;!d&&x&&b.push(...dNe(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=oNe(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`||_===B8(t)||T.every(e=>B8(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=B8(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{}}}},k7=new Set([`left`,`top`]);async function BPe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=I8(n),s=L8(n),c=B8(n)===`y`,l=k7.has(o)?-1:1,u=a&&c?-1:1,d=F8(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 VPe=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 BPe(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}}}}},HPe=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}=F8(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=B8(i),p=R8(f),m=u[p],h=u[f],g=(e,t)=>P8(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}}}}}},UPe=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}=F8(e,t),u={x:n,y:r},d=B8(i),f=R8(d),p=u[f],m=u[d],h=F8(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=k7.has(I8(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}}}},WPe=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}=F8(e,t),c=await i.detectOverflow(t,s),l=I8(n),u=L8(n),d=B8(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=k8(p-c[m],g),y=k8(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*A8(c.left,c.right):S=p-2*A8(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 A7(e){let t=V6(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=M6(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=j8(n)!==a||j8(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function j7(e){return j6(e)?e:e.contextElement}function M7(e){let t=j7(e);if(!M6(t))return N8(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=A7(t),o=(a?j8(n.width):n.width)/r,s=(a?j8(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var GPe=N8(0);function N7(e){let t=O6(e);return!z6()||!t.visualViewport?GPe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function KPe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===O6(e)}function P7(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=j7(e),o=N8(1);t&&(r?j6(r)&&(o=M7(r)):o=M7(e));let s=KPe(a,n,r)?N7(a):N8(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=O6(a),t=j6(r)?O6(r):r,n=e,i=K6(n);for(;i&&t!==n;){let e=M7(i),t=i.getBoundingClientRect(),r=V6(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=O6(i),i=K6(n)}}return q8({width:u,height:d,x:c,y:l})}function F7(e,t){let n=H6(e).scrollLeft;return t?t.left+n:P7(k6(e)).left+n}function I7(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-F7(e,n),y:n.top+t.scrollTop}}function qPe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k6(r),s=t?F6(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=N8(1),u=N8(0),d=M6(r);if((d||!a)&&((D6(r)!==`body`||P6(o))&&(c=H6(r)),d)){let e=P7(r);l=M7(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?I7(o,c):N8(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 JPe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function YPe(e){let t=H6(e),n=e.ownerDocument.body,r=A8(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=A8(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+F7(e),o=-t.scrollTop;return V6(n).direction===`rtl`&&(a+=A8(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var XPe=25;function ZPe(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=O6(e),a=k6(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!z6()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(F7(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<=XPe&&(s-=o)}return{width:s,height:c,x:l,y:u}}function QPe(e,t){let n=P7(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=M7(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function L7(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ZPe(e,n,t);else if(t===`document`)r=YPe(k6(e));else if(j6(t))r=QPe(t,n);else{let n=N7(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return q8(r)}function $Pe(e,t){let n=t.get(e);if(n)return n;let r=G6(e,[],!1).filter(e=>j6(e)&&D6(e)!==`body`),i=null,a=V6(e).position===`fixed`,o=a?U6(e):e;for(;j6(o)&&!B6(o);){let e=V6(o),t=R6(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=U6(o)}return t.set(e,r),r}function eFe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?F6(t)?[]:$Pe(t,this._c):[].concat(n),r],o=L7(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=L7(t,a[e],i);s=A8(n.top,s),c=k8(n.right,c),l=k8(n.bottom,l),u=A8(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function tFe(e){let{width:t,height:n}=A7(e);return{width:t,height:n}}function nFe(e,t,n){let r=M6(t),i=k6(t),a=n===`fixed`,o=P7(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=N8(0);if((r||!a)&&((D6(t)!==`body`||P6(i))&&(s=H6(t)),r)){let e=P7(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=F7(i));let l=i&&!r&&!a?I7(i,s):N8(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 R7(e){return V6(e).position===`static`}function z7(e,t){if(!M6(e)||V6(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k6(e)===n&&(n=n.ownerDocument.body),n}function B7(e,t){let n=O6(e);if(F6(e))return n;if(!M6(e)){let t=U6(e);for(;t&&!B6(t);){if(j6(t)&&!R7(t))return t;t=U6(t)}return n}let r=z7(e,t);for(;r&&xMe(r)&&R7(r);)r=z7(r,t);return r&&B6(r)&&R7(r)&&!R6(r)?n:r||wMe(e)||n}var rFe=async function(e){let t=this.getOffsetParent||B7,n=this.getDimensions,r=await n(e.floating);return{reference:nFe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iFe(e){return V6(e).direction===`rtl`}var aFe={convertOffsetParentRelativeRectToViewportRelativeRect:qPe,getDocumentElement:k6,getClippingRect:eFe,getOffsetParent:B7,getElementRects:rFe,getClientRects:JPe,getDimensions:tFe,getScale:M7,isElement:j6,isRTL:iFe};function V7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oFe(e,t,n){let r=null,i,a=k6(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=M8(d),h=M8(a.clientWidth-(u+f)),g=M8(a.clientHeight-(d+p)),_=M8(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:A8(0,k8(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!V7(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=O6(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function H7(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=j7(e),u=i||a?[...l?G6(l):[],...t?G6(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?oFe(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?P7(e):null;c&&g();function g(){let t=P7(e);h&&!V7(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 sFe=VPe,cFe=HPe,lFe=zPe,uFe=WPe,dFe=UPe,fFe=(e,t,n)=>{let r=new Map,i=n??{},a={...aFe,...i.platform,_c:r};return RPe(e,t,{...i,platform:a})},U7=typeof document<`u`?F.useLayoutEffect:function(){};function W7(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(!W7(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)&&!W7(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function G7(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function K7(e,t){let n=G7(e);return Math.round(t*n)/n}function q7(e){let t=F.useRef(e);return U7(()=>{t.current=e}),t}function pFe(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]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=F.useState(r);W7(f,r)||p(r);let[m,h]=F.useState(null),[g,_]=F.useState(null),v=F.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=F.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=F.useRef(null),C=F.useRef(null),w=F.useRef(u),T=c!=null,E=q7(c),D=q7(i),O=q7(l),k=F.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),fFe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!W7(w.current,t)&&(w.current=t,G5.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);U7(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=F.useRef(!1);U7(()=>(A.current=!0,()=>{A.current=!1}),[]),U7(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=F.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=F.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=F.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=K7(M.floating,u.x),r=K7(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...G7(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return F.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:ee}),[u,k,j,M,ee])}var mFe=(e,t)=>{let n=sFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},hFe=(e,t)=>{let n=cFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},gFe=(e,t)=>({fn:dFe(e).fn,options:[e,t]}),_Fe=(e,t)=>{let n=lFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},vFe=(e,t)=>{let n=uFe(e);return{name:n.name,fn:n.fn,options:[e,t]}},J7=F.createContext(void 0);function Y7(e){let t=F.useContext(J7);if(t===void 0&&!e)throw Error(a7(47));return t}var yFe={...v7,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!v7.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&v7.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>v7.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bFe=class extends p7{constructor(e,t,n){let r=new vPe;super(xFe(e,r,t,n),SFe(r),yFe)}setOpen=(e,t)=>{let n=t.reason===d8,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=fPe(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=dPe(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),G5.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function xFe(e,t,n,r=!1){let i={...EPe(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function SFe(e){return{popupRef:F.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:F.createRef(),beforeTriggerFocusGuardRef:F.createRef(),beforeContentFocusGuardRef:F.createRef(),stickIfOpenTimeout:new m6,stickIfOpen:!0,triggerElements:e}}var X7=l6(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=wFe(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),_Pe(u,d),mPe(u);let{forceUnmount:m}=hPe(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),F.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),F.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,l8(XMe))}),[m,u]);let h=d||f||s!=null;return(0,R.jsxs)(J7.Provider,{value:u,children:[s&&(0,R.jsx)(lPe,{handle:s,store:u}),h&&(0,R.jsx)(TFe,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function CFe(e){return Y7(!0)?(0,R.jsx)(X7,{props:e}):(0,R.jsx)(KNe,{children:(0,R.jsx)(X7,{props:e})})}function wFe(e,t){let n=cPe((e,n)=>new bFe(t,e,n));return F.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function TFe({store:e,modal:t}){let n=ePe(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return gPe(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var EFe=F.createContext(void 0);function DFe(e=!1){let t=F.useContext(EFe);if(t===void 0&&!e)throw Error(a7(16));return t}function OFe(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:F.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Z7(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(O6(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function kFe(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=F.useRef(null),s=DFe(!0),c=a??s!==void 0,{props:l}=OFe({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=F.useCallback(()=>{let e=o.current;Q7(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return g6(u,[u]),{getButtonProps:F.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return F5({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(V5(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Q7(r),s=!i&&AFe(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Z7(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Z7(r,e)))},onKeyUp(e){if(!t){if(V5(e),a?.(e),e.target===e.currentTarget&&i&&c&&Q7(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Z7(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:x8(e=>{o.current=e,u()})}}function Q7(e){return M6(e)&&e.tagName===`BUTTON`}function AFe(e){return M6(e)&&e.tagName===`A`&&!!e.href}function jFe(e){return A5(e,`base-ui`)}function MFe(e,t){function n(n,r,i){let a=n.currentTarget;G5.flushSync(()=>{e.setOpen(!1,l8(f8,n.nativeEvent,a))}),vNe(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&u5(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function NFe(e){let t=F.useRef(``),n=F.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:F.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function PFe(e,t){let{onClick:n,onPointerDown:r}=NFe(x8((n,r)=>{(typeof e==`function`?e():e)||t(r||(y6?`touch`:``))}));return F.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var FFe=sMe(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=Y7(!0),h=OPe(s)??m;if(!h)throw Error(a7(74));let g=jFe(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=F.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=pPe(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=MPe(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:FPe(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=ZNe(v,{stickIfOpen:x8(()=>h.context.stickIfOpen)}),k=PFe(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=kFe({disabled:a,native:o}),ee={open(e){return w?VMe.open(e):BMe.open(e)}},{handlePreFocusGuardFocus:N,handleFocusTargetFocus:te}=MFe(h,x),ne=W5(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[LNe]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:ee}),re=(0,R.jsx)(F.Fragment,{children:ne},g);return E?(0,R.jsxs)(F.Fragment,{children:[(0,R.jsx)(O8,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:N}),re,(0,R.jsx)(O8,{ref:h.context.triggerFocusTargetRef,onFocus:te})]}):re}),$7=F.createContext(void 0);function IFe(){let e=F.useContext($7);if(e===void 0)throw Error(a7(45));return e}var LFe=F.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Y7().useState(`mounted`)||n?(0,R.jsx)($7.Provider,{value:n,children:(0,R.jsx)(HNe,{ref:t,...r})}):null});function RFe(e){return j5(19)?e:e?`true`:void 0}var e9=F.createContext(void 0);function zFe(){let e=F.useContext(e9);if(!e)throw Error(a7(46));return e}function BFe(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=F.useState(null),d=F.useRef(null),f=Q5(n),p=F.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=pFe({...e,elements:{...p,...l&&{reference:l}}}),h=F.useCallback(e=>{let t=j6(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=F.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=F.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=F.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return g6(()=>{o&&(d.current=o)},[o]),g6(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),F.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var VFe=F.createContext(void 0);function HFe(){return F.useContext(VFe)?.direction??`ltr`}var UFe=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}=F8(e,t)||{};if(l==null)return{};let d=K8(u),f={x:n,y:r},p=V8(i),m=z8(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=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=P8(D,k,O),j=!c.arrow&&L8(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),WFe=(e,t)=>{let{name:n,fn:r}=UFe(e);return{name:n,fn:r,options:[e,t]}},GFe={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},KFe={sideX:`left`,sideY:`top`},qFe=`--available-width`,JFe=`--available-height`,YFe=`--anchor-width`,XFe=`--anchor-height`,ZFe=`--transform-origin`,t9=qFe,n9=JFe;function r9(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function i9(e,t,n){let{rects:r,placement:i}=e;return{side:r9(t,I8(i),n),align:L8(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function QFe(e){return $Fe(e,BFe)}function $Fe(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=x8(O),A=O?k:n,j=v8(n),M=v8(g),ee=HFe()===`rtl`,[N,te]=F.useState(null);!g&&N!==null&&te(null);let ne=x===`placement`,re=N?I8(N):null,P=N&&ne?L8(N)||`center`:null,ie=re||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":ee?`left`:`right`,"inline-start":ee?`right`:`left`}[i],ae=P||o,oe=ae===`center`?ie:`${ie}-${ae}`,se=l;typeof se==`number`?se={top:se,right:se,bottom:se,left:se}:se&&={top:se.top||0,right:se.right||0,bottom:se.bottom||0,left:se.left||0};let ce=+(i===`bottom`),le=+(i===`top`),ue=+(i===`right`),de=+(i===`left`),fe={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:se},pe=F.useRef(null),me=v8(a),he=v8(s),ge=typeof a==`function`?0:a,_e=typeof s==`function`?0:s,ve=[];p&&ve.push(p),ve.push(mFe(e=>{let t=i9(e,i,ee),n=typeof me.current==`function`?me.current(t):me.current,r=typeof he.current==`function`?he.current(t):he.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ge,_e,ee,i]));let ye=w===`none`&&C!==`shift`,be=!ye&&(u||E||C===`shift`),xe=C===`none`?null:_Fe({...fe,padding:{top:se.top+1+ce,right:se.right+1+de,bottom:se.bottom+1+le,left:se.left+1+ue},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),Se=ye?null:hFe({...fe,rootBoundary:D,mainAxis:w!==`none`,crossAxis:be,limiter:u||E?void 0:gFe(e=>{if(!pe.current)return{};let{width:t,height:n}=pe.current.getBoundingClientRect(),r=B8(I8(e.placement)),i=r===`y`?t:n,a=r===`y`?se.left+se.right:se.top+se.bottom;return{offset:i/2+a/2}})},[fe,u,E,D,se,w]);C===`shift`||w===`shift`||ae===`center`?ve.push(Se,xe):ve.push(xe,Se),ve.push(vFe({...fe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(t9,`${t}px`),i.setProperty(n9,`${n}px`);let a=O6(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(YFe,`${u}px`),i.setProperty(XFe,`${d}px`)}}),WFe(e=>({element:pe.current||E8(e.elements.floating).createElement(`div`),padding:pe.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=I8(r),u=L8(r),d=B8(l)===`y`,f=pe.current,p=typeof a==`function`?a(i9(e,i,ee)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return be&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(ZFe,d?`${m} ${h}`:`${h} ${m}`),{}}},GFe,b),g6(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let Ce=F.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:we,elements:Te,x:Ee,y:De,middlewareData:Oe,update:ke,placement:Ae,context:je,isPositioned:Me,floatingStyles:Ne}=t({rootContext:h,open:m?g:void 0,placement:oe,middleware:ve,strategy:r,whileElementsMounted:m?void 0:(...e)=>H7(...e,Ce),nodeId:y,externalTree:S}),{sideX:Pe,sideY:Fe}=Oe.adaptiveOrigin||KFe,Ie=Me?r:`fixed`,Le=F.useMemo(()=>{let e;return e=Me?b?{position:Ie,[Pe]:Ee,[Fe]:De}:{...Ne,position:Ie}:{position:Ie,top:0,left:0},e[t9]=`100vw`,e[n9]=`100vh`,Me||(e.opacity=0),e},[b,Ie,Pe,Ee,Fe,De,Ne,Me]),Re=F.useRef(null);g6(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(a9(t)?t.current:t)||null;n!==Re.current&&(we.setPositionReference(n),Re.current=n)},[g,we,A,j]),F.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&a9(e)&&e.current!==Re.current&&(we.setPositionReference(e.current),Re.current=e.current)},[g,we,A,j]),F.useEffect(()=>{if(m&&g&&Te.reference&&Te.floating)return H7(Te.reference,Te.floating,ke,Ce)},[m,g,Te,ke,Ce]);let ze=I8(Ae),Be=r9(i,ze,ee),Ve=L8(Ae)||`center`,He=!!Oe.hide?.referenceHidden;g6(()=>{x&&g&&Me&&(ze!==ie||ne&&Ve!==ae)&&te(Ae)},[x,ne,g,Me,Ae,ze,Ve,ie,ae]);let Ue=F.useMemo(()=>({position:`absolute`,top:Oe.arrow?.y,left:Oe.arrow?.x}),[Oe.arrow]),We=Oe.arrow?.centerOffset!==0;return F.useMemo(()=>({positionerStyles:Le,arrowStyles:Ue,arrowRef:pe,arrowUncentered:We,side:Be,align:Ve,physicalSide:ze,anchorHidden:He,refs:we,context:je,isPositioned:Me,update:ke}),[Le,Ue,pe,We,Be,Ve,ze,He,we,je,Me,ke])}function a9(e){return e!=null&&`current`in e}var eIe=F.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,R.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function tIe(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=F.useRef(null),o=F.useRef(null),s=c7(r);g6(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),g6(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function o9(e){return e===`starting`?INe:d6}function nIe(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),W5(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},o9(r),i],stateAttributesMapping:$6})}var s9={},c9={},l9=``;function u9(e,t){return P6(e)?e:t}function d9(e,t,n){return/hidden|clip/.test(e.getComputedStyle(u9(t,n)).overflowY)}function rIe(e){if(typeof document>`u`)return!1;let t=E8(e);return O6(t).innerWidth-t.documentElement.clientWidth>0}function iIe(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=E8(e),n=t.documentElement,r=t.body,i=u9(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function aIe(e){let t=E8(e),n=t.documentElement,r=t.body,i=u9(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function oIe(e){let t=E8(e),n=t.documentElement,r=t.body,i=O6(n),a=0,o=0,s=!1,c=w8.create();if(S6&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,s9={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},l9=n.style.scrollBehavior,c9={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=u9(n,r);if(s=iIe(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,s9),Object.assign(r.style,c9),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=l9)}function d(){u(),c.request(l)}l();let f=p8(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var sIe=new class{lockCount=0;restore=null;timeoutLock=m6.create();timeoutUnlock=m6.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=E8(e),n=t.documentElement,r=t.body,i=O6(n);if(d9(i,n,r)){let t=new i.MutationObserver(()=>{d9(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=y6||!rIe(e);this.restore=a?aIe(e):oIe(e)}};function cIe(e=!0,t=null){g6(()=>{if(e)return sIe.acquire(t)},[e,t])}var lIe=20;function uIe(e,t,n,r){let[i,a]=F.useState(!1);g6(()=>{if(!e||!t||n==null){a(!1);return}let r=E8(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-lIe)},[e,t,n]),cIe(e&&(!t||i),r)}var dIe=F.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=RNe,..._}=e,v=Y7(),y=IFe(),b=WNe(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=QFe({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});tIe({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;uIe(C&&M,D===`touch`,O,T);let ee=v.useStateSetter(`positionerElement`),N=nIe(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,ee],hidden:!S,inert:!C});return(0,R.jsxs)(e9.Provider,{value:j,children:[S&&M&&(0,R.jsx)(eIe,{inert:RFe(!C),cutout:T}),(0,R.jsx)(GNe,{id:b,children:N})]})}),fIe=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),pIe=F.createContext(void 0);function mIe(e){let t=F.useContext(pIe);if(t===void 0&&!e)throw Error(a7(69));return t}var hIe=F.createContext(void 0);function gIe(){let[e,t]=F.useState(0),n=x8(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:F.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var _Ie=F.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Y7(),l=zFe(),u=mIe(!0)!=null,{context:d,hasClosePart:f}=gIe(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);l7({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),APe(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?sPe(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=W5(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...oPe,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&fIe.has(e.key)&&e.stopPropagation()}},o9(g),s],stateAttributesMapping:HMe});return(0,R.jsx)(XNe,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:M6(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,R.jsx)(hIe.Provider,{value:d,children:M})})}),f9=`data-glide-stand-in`;function p9(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left+e.scrollLeft-e.clientLeft,y:r.top-n.top+e.scrollTop-e.clientTop,width:r.width,height:r.height}}function m9(e){return{transform:`translate(${String(e.x)}px, ${String(e.y)}px)`,width:`${String(e.width)}px`,height:`${String(e.height)}px`}}function vIe(e){let t=(0,F.useRef)(null);return(0,F.useCallback)(n=>{t.current?.(),t.current=n?yIe(n,e):null},[e])}function yIe(e,t){if(!hC(e))return()=>void 0;let n=e.ownerDocument,r=e.querySelector(t),i=r?p9(e,r):null,a=null,o=null,s=new Set,c=()=>{for(let e of s)e.removeAttribute(f9);s.clear(),a&&(a.hidden=!0),o=null},l=()=>{if(a)return a;let t=n.createElement(`span`);return t.className=`caps-glide`,t.setAttribute(`aria-hidden`,`true`),e.prepend(t),e.classList.add(`caps-glide-host`),getComputedStyle(e).position===`static`&&e.classList.add(`caps-glide-anchor`),a=t,t},u=(t,n)=>{let r=dC(e),u=p9(e,t),d=o&&a?p9(e,a):i;if(i=u,o?.cancel(),c(),r.reduced||d===null||Math.abs(d.y-u.y)<1&&Math.abs(d.x-u.x)<1)return;t.setAttribute(f9,`measure`);let f=getComputedStyle(t),p=f.backgroundColor,m=f.borderRadius;for(let e of[t,n])e&&(e.setAttribute(f9,``),s.add(e));let h=l();h.hidden=!1,h.style.backgroundColor=p,h.style.borderRadius=m;let g=h.animate([m9(d),m9(u)],{duration:r.normal,easing:mC(r,r.ease),fill:`forwards`});o=g,g.addEventListener(`finish`,()=>{o===g&&c()})},d=()=>{let n=e.querySelector(t);if(n===r)return;let i=r;r=n,n&&u(n,i)},f=new MutationObserver(d);return f.observe(e,{subtree:!0,attributes:!0,attributeFilter:[`data-highlighted`,`data-active`,`data-navigation`,`aria-selected`]}),e.addEventListener(`pointerover`,d),e.addEventListener(`pointerout`,d),()=>{f.disconnect(),e.removeEventListener(`pointerover`,d),e.removeEventListener(`pointerout`,d),o?.cancel(),c(),a?.remove()}}var bIe=(0,F.createContext)(void 0),xIe=(0,F.createContext)(null);function SIe(e){let t=(0,F.useContext)(xIe);return t===null?Object.hasOwn(globalThis,`document`)?document.body:null:t[e]}function CIe(e){let t=(0,F.useContext)(bIe),n=(0,F.useRef)(e);n.current=e,(0,F.useEffect)(()=>t?.(()=>{n.current()}),[t])}var h9=(0,F.forwardRef)(function({className:e,invalid:t,...n},r){return(0,R.jsx)(`input`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:cC(`input caps-input w-full`,e),ref:r})});(0,F.forwardRef)(function({leading:e,className:t,...n},r){return(0,R.jsxs)(`span`,{className:`caps-search-input`,"data-leading":e?`true`:void 0,children:[e?(0,R.jsx)(`span`,{className:`caps-search-leading`,"aria-hidden":`true`,children:e}):null,(0,R.jsx)(h9,{...n,type:`search`,className:t,ref:r})]})});function wIe({getKey:e,isDisabled:t=()=>!1,items:n}){let r=(0,F.useMemo)(()=>{let r=n.map(e);if(r.some(e=>!e))throw Error(`Selectable items require non-empty keys`);if(new Set(r).size!==r.length)throw Error(`Selectable items require unique keys`);return n.filter(e=>!t(e))},[e,t,n]),[i,a]=(0,F.useState)(null);(0,F.useEffect)(()=>{i!==null&&!r.some(t=>e(t)===i)&&a(null)},[i,r,e]);let o=r.find(t=>e(t)===i),s=o?r.findIndex(t=>e(t)===i):-1;return{activeIndex:s,activeItem:o,activeKey:i,enabledItems:r,move:(t,n)=>{if(r.length===0)return;let i=n?n===`start`?0:r.length-1:s<0?t>0?0:r.length-1:(s+t+r.length)%r.length,o=r[i];o&&a(e(o))},setActiveKey:a}}var TIe=(0,F.forwardRef)(function({children:e,className:t,type:n=`button`,...r},i){return(0,R.jsxs)(`button`,{...r,ref:i,type:n,className:cC(`select caps-select caps-combobox-trigger w-full`,t),children:[(0,R.jsx)(`span`,{children:e}),(0,R.jsx)(F4,{className:`caps-select-chevron`,"aria-hidden":`true`})]})});function EIe({defaultOpen:e,defaultValue:t,getKey:n,getSearchText:r,groupBy:i,id:a,isDisabled:o,items:s,onOpenChange:c,onCommit:l,multiple:u,controlledOpen:d,controlledKeys:f,trigger:p}){let m=`${a}-listbox`,[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(t),[x,S]=(0,F.useState)(e),C=f??(y===null?[]:[y]),w=p?d??x:!0,T=(0,F.useMemo)(()=>{let e=h.trim().toLowerCase();return e?s.filter(t=>r(t).toLowerCase().includes(e)):s},[r,s,h]),E=wIe({getKey:n,isDisabled:o,items:T});(0,F.useEffect)(()=>{if(E.activeKey!==null)return;let e=E.enabledItems.find(e=>C.includes(n(e)))??E.enabledItems[0];e&&E.setActiveKey(n(e))},[E.activeKey,E.enabledItems,E.setActiveKey,n,C]);let D=e=>{v(!1),e||g(``),d===void 0&&S(e),c?.(e)},O=e=>`${m}-option-${encodeURIComponent(e)}`,k=e=>{let t=n(e);f===void 0&&b(t),l(e),p&&!u&&D(!1)},A=e=>{v(!0),g(e.target.value),E.setActiveKey(null)},j=e=>{if(iMe(e))return;let t;switch(e.key){case`ArrowDown`:t=[1,void 0];break;case`ArrowUp`:t=[-1,void 0];break;case`End`:t=[1,`end`];break;case`Home`:t=[-1,`start`]}t?(v(!0),e.preventDefault(),E.move(t[0],t[1])):e.key===`Enter`&&E.activeItem&&(e.preventDefault(),k(E.activeItem))},M=(0,F.useMemo)(()=>{if(!i)return[{label:``,items:T}];let e=new Map;for(let t of T){let n=i(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e].map(([e,t])=>({label:e,items:t}))},[T,i]);return{keyboardNavigation:_,onPointerMove:()=>{v(!1)},activeKey:E.activeKey,activeItem:E.activeItem,groups:M,inputValue:h,listboxId:m,onInputChange:A,onInputKeyDown:j,optionId:O,open:w,commit:k,selectedKeys:C,setOpen:D}}function DIe(e){let{"aria-describedby":t,"aria-invalid":n,"aria-label":r,"aria-labelledby":i,"aria-required":a,activeTone:o=`neutral`,container:s,contentClassName:c,defaultOpen:l=!1,defaultValue:u=null,emptyMessage:d=`No matches`,getKey:f,getLabel:p,getSearchText:m=p,groupBy:h,id:g,inputProps:_,inputRef:v,isDisabled:y=()=>!1,items:b,onOpenChange:x,onValueChange:S,multiple:C,open:w,placeholder:T=`Search…`,renderItem:E,rootRef:D,trigger:O,triggerRef:k,value:A,...j}=e,M=e=>{let t=f(e);if(C){let e=A.includes(t)?A.filter(e=>e!==t):[...A,t];S?.(e,b.filter(t=>e.includes(f(t))))}else S?.(t,e)},ee;C?ee=A:A!==void 0&&(ee=A===null?[]:[A]);let N=(0,F.useId)(),te=O?.props??_,ne=g??te?.id??N,re={id:ne,"aria-describedby":[t,te?.[`aria-describedby`]].filter(Boolean).join(` `)||void 0,"aria-invalid":n??te?.[`aria-invalid`],"aria-label":te?.[`aria-label`]??r,"aria-labelledby":te?.[`aria-labelledby`]??i,"aria-required":a??te?.[`aria-required`]},{keyboardNavigation:P,onPointerMove:ie,activeItem:ae,activeKey:oe,commit:se,groups:ce,inputValue:le,listboxId:ue,onInputChange:de,onInputKeyDown:fe,open:pe,optionId:me,selectedKeys:he,setOpen:ge}=EIe({defaultOpen:l,defaultValue:u,getKey:f,getSearchText:m,groupBy:h,id:ne,isDisabled:y,items:b,onOpenChange:x,onCommit:M,multiple:C??!1,controlledOpen:w,controlledKeys:ee,trigger:O});CIe(()=>{O&&ge(!1)});let _e=SIe(`popover`),ve=s===void 0?_e:s,ye=vIe(`.caps-combobox-option[data-active="true"]:not(:disabled), [data-navigation="pointer"] .caps-combobox-option:hover:not(:disabled)`),be=(0,R.jsx)(h9,{..._,...O?{}:re,"aria-activedescendant":ae?me(f(ae)):void 0,"aria-autocomplete":`list`,"aria-controls":ue,"aria-expanded":!0,className:cC(`input-sm`,_?.className),id:O?_?.id??`${ne}-input`:ne,onChange:e=>{_?.onChange?.(e),de(e)},onKeyDown:e=>{_?.onKeyDown?.(e),e.defaultPrevented||fe(e)},placeholder:_?.placeholder??T,ref:v,role:`combobox`,value:le}),xe=(0,R.jsx)(`div`,{id:ue,ref:ye,className:`caps-combobox-list`,"data-navigation":P?`keyboard`:`pointer`,onPointerMove:ie,role:`listbox`,"aria-multiselectable":C??void 0,children:ce.every(e=>e.items.length===0)?(0,R.jsx)(`div`,{className:`px-md py-md text-sm text-base-content`,children:d}):ce.map(e=>(0,R.jsxs)(`div`,{"aria-label":e.label||void 0,role:e.label?`group`:void 0,children:[e.label?(0,R.jsx)(`div`,{className:`px-md pb-xs pt-sm text-xs text-base-content uppercase tracking-wider`,children:e.label}):null,e.items.map(e=>{let t=f(e),n=y(e),r=oe===t,i={active:r,disabled:n,selected:he.includes(t)};return(0,R.jsxs)(`button`,{"aria-disabled":n||void 0,"aria-selected":i.selected,className:`caps-combobox-option`,"data-active":r&&P,disabled:n,id:me(t),onClick:()=>{se(e)},onMouseDown:e=>{e.preventDefault()},role:`option`,tabIndex:-1,type:`button`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`caps-combobox-check`,children:i.selected?(0,R.jsx)(XAe,{}):null}),E?.(e,r,i)??p(e)]},t)})]},e.label))});return O?(0,R.jsx)(`div`,{...j,className:cC(j.className),ref:D,children:(0,R.jsxs)(CFe,{modal:!0,onOpenChange:ge,open:pe,children:[(0,R.jsx)(FFe,{...re,"aria-haspopup":`dialog`,className:`btn`,ref:k,render:O}),ve===null?null:(0,R.jsx)(LFe,{container:ve,children:(0,R.jsx)(dIe,{align:`start`,side:`bottom`,sideOffset:4,children:(0,R.jsxs)(_Ie,{"data-active-tone":o,className:cC(`min-w-40 rounded-box border border-base-300 bg-base-100 p-xs shadow-lg outline-none caps-combobox-panel caps-combobox-popup`,c),children:[(0,R.jsx)(`div`,{className:`caps-combobox-search`,children:be}),xe]})})})]})}):(0,R.jsx)(`div`,{...j,className:cC(j.className),ref:D,children:(0,R.jsxs)(`div`,{className:cC(`caps-combobox-panel`,c),"data-active-tone":o,children:[(0,R.jsx)(`div`,{className:`caps-combobox-search`,children:be}),xe]})})}var OIe=(0,F.forwardRef)(function({label:e,icon:t,caption:n,appearance:r,className:i,...a},o){return(0,R.jsx)(`label`,{className:`caps-icon-choice`,"data-appearance":r===`compact`?r:void 0,children:(0,R.jsx)(i6,{...a,appearance:r??`default`,"aria-label":e,className:cC(`caps-icon-choice-input`,i),indicator:(0,R.jsx)($T,{icon:t,caption:n}),ref:o})})}),kIe=(0,F.forwardRef)(function({label:e,icon:t,hint:n,className:r,...i},a){let o=(0,F.useId)(),s=[i[`aria-describedby`],n?o:null].filter(Boolean).join(` `)||void 0;return(0,R.jsx)(`label`,{className:`caps-check-key`,children:(0,R.jsx)(i6,{...i,"aria-label":e,"aria-describedby":s,className:cC(`caps-check-key-input`,r),indicator:(0,R.jsxs)(`span`,{className:`caps-check-key-face`,"aria-hidden":`true`,children:[t?(0,R.jsx)(`span`,{className:`caps-check-key-icon`,children:t}):null,(0,R.jsxs)(`span`,{className:`caps-check-key-copy`,children:[(0,R.jsx)(`span`,{className:`caps-check-key-label`,children:e}),n?(0,R.jsx)(`span`,{className:`caps-check-key-hint`,id:o,children:n}):null]}),(0,R.jsx)(`span`,{className:`caps-check-key-lamp`})]}),ref:a})})});function AIe({className:e,...t}){return(0,R.jsx)(`div`,{...t,className:cC(`caps-check-keys`,e)})}function jIe({checked:e}){let t=`caps-radio-${(0,F.useId)().replaceAll(`:`,``)}`,n=(0,F.useRef)(null),r=(0,F.useRef)(e).current,i=(0,F.useRef)(e),a=(0,F.useRef)(null),o=fC(a),{reduced:s}=o;return(0,F.useLayoutEffect)(()=>{if(!n.current)return;let t=s||i.current===e;i.current=e;let r=e?4:0,a=qT(o,{ease:`outCubic`,duration:75}),c=e?KT(o,{bounce:.65,duration:300}):qT(o,{ease:`inCubic`,duration:100}),l=TT(n.current,t?{rx:r,ry:r,cy:6,duration:0}:{rx:[{to:e?3.5:4.15,...a},{to:r,...c}],ry:[{to:e?4.5:3.85,...a},{to:r,...c}],cy:[{to:e?5.85:6.1,...a},{to:6,...c}]});return()=>{l.cancel()}},[e,s,o]),(0,R.jsxs)(`svg`,{ref:a,className:`caps-radio-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,R.jsx)(kT,{id:`${t}-shadow`}),(0,R.jsx)(AT,{id:`${t}-inset`}),(0,R.jsx)(`clipPath`,{id:`${t}-well`,children:(0,R.jsx)(`circle`,{cx:`6`,cy:`6`,r:`5`})})]}),(0,R.jsx)(`circle`,{className:`caps-radio-track`,cx:`6`,cy:`6`,r:`5.5`,filter:`url(#${t}-inset)`}),(0,R.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,R.jsx)(`ellipse`,{ref:n,cx:`6`,cy:`6`,rx:r?4:0,ry:r?4:0,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var g9=(0,F.createContext)(null),MIe=(0,F.forwardRef)(function({children:e,className:t,defaultValue:n,disabled:r=!1,name:i,onValueChange:a,orientation:o=`vertical`,value:s,...c},l){let u=(0,F.useId)(),d=(0,F.useRef)(null);(0,F.useImperativeHandle)(l,()=>{if(!d.current)throw Error(`RadioGroup is not mounted`);return d.current},[]);let f=i??`radio-group-${u}`,[p,m]=(0,F.useState)(n),h=s??p;return(0,F.useEffect)(()=>{let e=d.current?.form;if(!e||s!==void 0)return;let t=e=>{queueMicrotask(()=>{e.defaultPrevented||m(n)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[s,n,c.form]),(0,R.jsx)(g9.Provider,{value:{disabled:r,name:f,onValueChange:e=>{s===void 0&&m(e),a?.(e)},value:h},children:(0,R.jsx)(`fieldset`,{...c,className:cC(`flex gap-md`,o===`horizontal`?`flex-row flex-wrap`:`flex-col`,t),disabled:r,role:c.role??`radiogroup`,ref:d,children:e})})}),_9=(0,F.forwardRef)(function({className:e,indicator:t,onChange:n,onClick:r,value:i,...a},o){let s=(0,F.useContext)(g9);if(!s)throw Error(`RadioGroupItem must be used inside <RadioGroup>`);let c=s.value===i,l=e=>{n?.(e),e.target.checked&&s.onValueChange?.(i)};return(0,R.jsxs)(`span`,{className:`caps-radio`,"data-checked":c,"data-custom-indicator":t!==void 0||void 0,children:[(0,R.jsx)(`input`,{...a,"aria-checked":c,checked:c,className:cC(`caps-radio-input`,e),disabled:s.disabled||a.disabled,name:s.name,onChange:l,onClick:r,ref:o,type:`radio`,value:i}),t===void 0?(0,R.jsx)(jIe,{checked:c}):t]})}),NIe=(0,F.forwardRef)(function({description:e,id:t,meta:n,title:r,...i},a){let o=(0,F.useContext)(g9),s=(0,F.useId)(),c=t??s,l=o?.value===i.value,u=o?.disabled===!0||i.disabled===!0;return(0,R.jsxs)(`label`,{className:`caps-choice-card`,"data-checked":l,"data-disabled":u||void 0,htmlFor:c,children:[(0,R.jsx)(_9,{...i,"aria-describedby":e?`${c}-description`:void 0,"aria-labelledby":`${c}-title`,id:c,ref:a}),(0,R.jsxs)(`span`,{className:`caps-choice-card-copy`,children:[(0,R.jsx)(`span`,{className:`caps-choice-card-title`,id:`${c}-title`,children:r}),e?(0,R.jsx)(`span`,{className:`caps-choice-card-description`,id:`${c}-description`,children:e}):null]}),n?(0,R.jsx)(`span`,{className:`caps-choice-card-meta`,children:n}):null]})}),PIe=(0,F.forwardRef)(function({label:e,icon:t,caption:n,art:r=`dim`,className:i,...a},o){return(0,R.jsx)(`label`,{className:`caps-icon-choice`,"data-art":r===`color`?r:void 0,children:(0,R.jsx)(_9,{...a,"aria-label":e,className:cC(`caps-icon-choice-input`,i),indicator:(0,R.jsx)($T,{icon:t,caption:n}),ref:o})})});(0,F.forwardRef)(function({label:e,color:t,className:n,...r},i){return(0,R.jsx)(`label`,{className:`caps-icon-choice`,"data-art":`color`,"data-swatch":``,title:e,children:(0,R.jsx)(_9,{...r,"aria-label":e,className:cC(`caps-icon-choice-input`,n),indicator:(0,R.jsx)($T,{icon:(0,R.jsx)(`span`,{className:`caps-swatch-dot`,style:{backgroundColor:t}})}),ref:i})})});var FIe=(0,F.forwardRef)(function({className:e,invalid:t,...n},r){return(0,R.jsxs)(`span`,{className:`caps-select-shell`,children:[(0,R.jsx)(`select`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:cC(`select select-bordered caps-select w-full`,t&&`select-error`,e),ref:r}),!n.multiple&&(!n.size||n.size<=1)?(0,R.jsx)(F4,{className:`caps-select-chevron`,"aria-hidden":`true`}):null]})});function IIe({checked:e}){let t=`caps-switch-${(0,F.useId)().replaceAll(`:`,``)}`,n=(0,F.useRef)(null),r=(0,F.useRef)(null),i=(0,F.useRef)(e).current,a=(0,F.useRef)(e),o=_C();return(0,F.useLayoutEffect)(()=>{if(!n.current||!r.current)return;let t=o||a.current===e;a.current=e;let i=e?16:8,s=dC(n.current),c=KT(s,{bounce:.25,duration:440}),l=qT(s,{ease:`inOutSine`,duration:100}),u=TT(n.current,t?{x:2,y:2,width:i,height:8,duration:0}:{x:[{to:e?2.5:1.5,...l},{to:2,...c}],y:[{to:1.5,...l},{to:2,...c}],height:[{to:9,...l},{to:8,...c}],width:[{to:e?7:16.5,...l},{to:i,...c}]}),d=TT(r.current,{gradientTransform:e?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`,...t?{duration:0}:{delay:l.duration,...c}});return()=>{u.cancel(),d.cancel()}},[e,o]),(0,R.jsxs)(`svg`,{className:`caps-switch-visual`,width:`40`,height:`24`,viewBox:`0 0 20 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsx)(OT,{ref:r,id:`${t}-surface`,transform:i?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`}),(0,R.jsx)(kT,{id:`${t}-shadow`}),(0,R.jsx)(AT,{id:`${t}-inset`}),(0,R.jsx)(`clipPath`,{id:`${t}-track`,children:(0,R.jsx)(`rect`,{x:`1`,y:`1`,width:`18`,height:`10`,rx:`5`})})]}),(0,R.jsx)(`rect`,{className:`caps-switch-track`,filter:`url(#${t}-inset)`,x:`0.5`,y:`0.5`,width:`19`,height:`11`,rx:`5.5`}),(0,R.jsx)(`g`,{clipPath:`url(#${t}-track)`,children:(0,R.jsx)(`rect`,{ref:n,x:`2`,y:`2`,width:i?16:8,height:`8`,rx:`4`,fill:`url(#${t}-surface)`,filter:`url(#${t}-shadow)`})})]})}var LIe=(0,F.forwardRef)(function({className:e,checked:t,defaultChecked:n=!1,onChange:r,onCheckedChange:i,...a},o){let s=(0,F.useRef)(null),[c,l]=(0,F.useState)(n),u=t??c;return(0,F.useImperativeHandle)(o,()=>{if(!s.current)throw Error(`Switch input is not mounted`);return s.current},[]),(0,F.useEffect)(()=>{let e=s.current?.form;if(!e||t!==void 0)return;let r=e=>{queueMicrotask(()=>{!e.defaultPrevented&&s.current&&l(n)})};return e.addEventListener(`reset`,r),()=>{e.removeEventListener(`reset`,r)}},[t,n,a.form]),(0,R.jsxs)(`span`,{className:`caps-switch`,"data-checked":u,children:[(0,R.jsx)(`input`,{...a,checked:u,className:cC(`caps-switch-input`,e),onChange:e=>{t===void 0&&l(e.target.checked),r?.(e),i?.(e.target.checked)},ref:s,role:`switch`,type:`checkbox`}),(0,R.jsx)(IIe,{checked:u})]})}),RIe=(0,F.forwardRef)(function({className:e,invalid:t,...n},r){return(0,R.jsx)(`textarea`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:cC(`textarea textarea-bordered w-full`,t&&`textarea-error`,e),ref:r})}),zIe=cg(vg),BIe=cg(bg),VIe=cg(Dg(Ig)),HIe=cg(Cg(vg)),v9=Cg(Mg(File)),UIe=cg(v9),y9=Tg([vg,Ig,bg,gg,_g,Cg(vg),v9]),WIe=cg(y9),b9=e=>zu(zIe(e.state.value),()=>``),x9=e=>zu(BIe(e.state.value),()=>!1),GIe=e=>zu(VIe(e.state.value),()=>null),KIe=e=>zu(HIe(e.state.value),()=>[]),qIe=e=>zu(UIe(e.state.value),()=>[]),JIe=e=>zu(WIe(e.state.value),()=>null);function YIe({field:e,spec:t,locked:n,...r}){let[i,a]=(0,F.useState)(!1);return(0,R.jsxs)(Y3,{children:[(0,R.jsx)(h9,{...r,name:t.name,disabled:n,type:i?`text`:`password`,autoComplete:`off`,spellCheck:!1,className:`caps-field-secret`,placeholder:t.placeholder,readOnly:t.readOnly,value:b9(e),onBlur:e.handleBlur,onChange:t=>{e.handleChange(t.currentTarget.value)}}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,size:`icon`,"aria-label":i?`Hide`:`Show`,"aria-pressed":i,disabled:n,onClick:()=>{a(e=>!e)},children:i?(0,R.jsx)(QAe,{"aria-hidden":`true`}):(0,R.jsx)($Ae,{"aria-hidden":`true`})})]})}var XIe={text:`text`,email:`email`,url:`url`,tel:`tel`};function ZIe({spec:e,field:t,locked:n,...r}){let i=qIe(t),a=n||e.readOnly===!0,o=(0,F.useRef)(null);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[(0,R.jsx)(vC,{asChild:!0,children:(0,R.jsx)(`input`,{...r,ref:o,type:`file`,tabIndex:-1,required:r.required===!0&&i.length===0,name:e.name,accept:e.accept,multiple:e.multiple,disabled:a,onBlur:t.handleBlur,onChange:e=>{t.handleChange(Array.from(e.currentTarget.files??[])),e.currentTarget.value=``}})}),(0,R.jsx)(zT,{type:`button`,variant:`outline`,"aria-label":`Choose files for ${e.label}`,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],disabled:a,onBlur:t.handleBlur,onClick:()=>{o.current?.click()},children:`Choose files`}),(0,R.jsx)(Zje,{items:i.map((e,t)=>({id:String(t),name:e.name,preview:{kind:`file`},progress:0,progressLabel:`${String(e.size)} bytes`,statusLabel:`Selected`,actions:a?{}:{remove:{label:`Remove`,accessibleLabel:`Remove ${e.name}`}}})),onRemove:e=>{t.handleChange(i.filter((t,n)=>String(n)!==e))},onCancel:()=>void 0,onRetry:()=>void 0})]})}function QIe({spec:e,field:t,locked:n,...r}){let i=e=>{t.handleChange(e)},a={...r,name:e.name,disabled:n,onBlur:t.handleBlur};switch(e.kind){case`text`:case`email`:case`url`:case`tel`:return(0,R.jsx)(h9,{...a,type:XIe[e.kind],inputMode:e.kind===`text`?void 0:e.kind,autoComplete:e.autoComplete,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}});case`textarea`:return(0,R.jsx)(RIe,{...a,rows:e.rows??3,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}});case`secret`:return(0,R.jsx)(YIe,{...r,field:t,spec:e,locked:n});case`money`:return(0,R.jsxs)(Y3,{children:[(0,R.jsx)(X3,{className:`caps-field-currency`,children:e.currency??`USD`}),(0,R.jsx)(h9,{...a,inputMode:`decimal`,autoComplete:`off`,className:`caps-field-amount`,placeholder:e.placeholder??`0.00`,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}})]});case`date`:return(0,R.jsx)(h9,{...a,type:`date`,readOnly:e.readOnly,value:b9(t),onChange:e=>{i(e.currentTarget.value)}});case`number`:return(0,R.jsx)(Yje,{...a,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},...e.unit===void 0?{}:{unit:e.unit},...e.wrap===void 0?{}:{wrap:e.wrap},disabled:n||e.readOnly===!0,decrementLabel:`Decrease ${e.label}`,incrementLabel:`Increase ${e.label}`,value:GIe(t),onValueChange:e=>{t.handleChange(e)}});case`select`:return(0,R.jsxs)(FIe,{...a,value:b9(t),onChange:e=>{i(e.currentTarget.value)},children:[e.placeholder===void 0?null:(0,R.jsx)(`option`,{value:``,disabled:!0,children:e.placeholder}),e.options.map(e=>(0,R.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]});case`combobox`:return(0,R.jsx)(DIe,{id:r.id??e.name,"aria-describedby":r[`aria-describedby`],"aria-invalid":r[`aria-invalid`],"aria-required":r[`aria-required`],items:e.options,getKey:e=>e.value,getLabel:e=>e.label,isDisabled:t=>t.disabled||n||e.readOnly===!0,value:b9(t),...e.placeholder===void 0?{}:{placeholder:e.placeholder},trigger:(0,R.jsx)(TIe,{name:e.name,disabled:n||e.readOnly===!0,onBlur:t.handleBlur,children:e.options.find(e=>e.value===b9(t))?.label??e.placeholder??`Choose…`}),inputProps:{"aria-label":`Search ${e.label}`,disabled:n||e.readOnly===!0},onValueChange:e=>{i(e??``),t.handleBlur()}});case`file`:return(0,R.jsx)(ZIe,{...r,spec:e,field:t,locked:n});case`checkbox`:return(0,R.jsx)(i6,{...a,disabled:n||e.readOnly===!0,checked:x9(t),onChange:e=>{t.handleChange(e.currentTarget.checked)}});case`switch`:return(0,R.jsx)(LIe,{...a,disabled:n||e.readOnly===!0,checked:x9(t),onCheckedChange:e=>{t.handleChange(e)}});case`radio`:case`icon-radio`:case`checkboxes`:case`icon-checkboxes`:return null}}var $Ie=new Set([`radio`,`icon-radio`,`checkboxes`,`icon-checkboxes`]);function eLe({spec:e,field:t,locked:n,error:r,layout:i}){let a=n||e.readOnly===!0,o=e.label;if(e.kind===`checkboxes`||e.kind===`icon-checkboxes`){let n=KIe(t),s=(e,r)=>{t.handleChange(r?[...n,e]:n.filter(t=>t!==e))};return(0,R.jsx)(Q3,{legend:o,icon:e.icon,layout:i,...i===`columns`?{legendTitle:o}:{},description:e.help,disabled:a,error:r??null,children:e.kind===`icon-checkboxes`?(0,R.jsx)(`div`,{className:`caps-field-icon-choices`,children:e.options.map(r=>(0,R.jsx)(OIe,{name:e.name,value:r.value,label:r.label,...r.caption===void 0?{}:{caption:r.caption},icon:r.icon,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{s(r.value,e.currentTarget.checked)}},r.value))}):(0,R.jsx)(AIe,{children:e.options.map(r=>(0,R.jsx)(kIe,{name:e.name,value:r.value,label:r.label,icon:r.icon,hint:r.description,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{s(r.value,e.currentTarget.checked)}},r.value))})})}let s=e.options.some(e=>e.description!==void 0||e.meta!==void 0);return(0,R.jsx)(Q3,{legend:o,icon:e.icon,layout:i,...i===`columns`?{legendTitle:o}:{},description:e.help,disabled:a,error:r??null,children:(0,R.jsx)(MIe,{name:e.name,"aria-label":o,value:b9(t),onValueChange:e=>{t.handleChange(e),t.handleBlur()},orientation:e.kind===`icon-radio`||s?`horizontal`:`vertical`,children:e.options.map(t=>e.kind===`icon-radio`?(0,R.jsx)(PIe,{value:t.value,label:t.label,...t.caption===void 0?{}:{caption:t.caption},icon:t.icon,disabled:t.disabled},t.value):s?(0,R.jsx)(NIe,{value:t.value,title:t.label,description:t.description,meta:t.meta,disabled:t.disabled},t.value):(0,R.jsx)($3,{label:t.label,orientation:`inline`,children:(0,R.jsx)(_9,{value:t.value,disabled:t.disabled})},t.value))})})}function tLe({spec:e,field:t,locked:n,error:r,render:i,...a}){return i({name:e.name,label:e.label,help:e.help,value:JIe(t),onChange:e=>{t.handleChange(e)},onBlur:t.handleBlur,error:r,disabled:n,id:a.id??e.name,"aria-describedby":a[`aria-describedby`],"aria-invalid":r!==void 0})}function nLe({form:e,spec:t,locked:n,layout:r}){let i=J3({form:e,name:t.name}),a=K3(e.store,e=>e.submissionAttempts>0),o=i.state.meta.isBlurred||a?Lje(i.state.meta):void 0;if(t.render===void 0&&$Ie.has(t.kind))return(0,R.jsx)(eLe,{spec:t,field:i,locked:n,error:o,layout:r});let s=r===`columns`?t.kind===`switch`||t.kind===`checkbox`?`horizontal`:`vertical`:t.kind===`checkbox`?`inline`:(t.layout??(t.kind===`switch`?`row`:`stacked`))===`row`?`horizontal`:`vertical`;return(0,R.jsx)($3,{label:t.label,...r===`columns`?{labelTitle:t.label}:{},description:t.help,icon:t.icon,orientation:s,error:o,...t.required===void 0?{}:{required:t.required},...t.optional===void 0?{}:{optional:t.optional},children:t.render===void 0?(0,R.jsx)(QIe,{spec:t,field:i,locked:n}):(0,R.jsx)(tLe,{spec:t,field:i,locked:n,error:o,render:t.render})})}var rLe=cg(Sg(vg,y9));function S9({form:e,spec:t,locked:n,layout:r}){let i=t.when;return K3(e.store,e=>i===void 0||i(zu(rLe(e.values),()=>({}))))?(0,R.jsx)(nLe,{form:e,spec:t,locked:n,layout:r}):null}function iLe({form:e,section:t,locked:n,layout:r}){let i=t.fields.map(t=>(0,R.jsx)(S9,{form:e,spec:t,locked:n,layout:r},t.name));return t.title===void 0?i:(0,R.jsx)(Wje,{title:t.title,description:t.description,layout:r,children:i})}function C9({model:e,names:t,disabled:n=!1,layout:r}){let i=e.form;return t===void 0?e.description.sections.map(e=>(0,R.jsx)(iLe,{form:i,section:e,locked:n,layout:r},e.id??``)):t.map(t=>{let a=e.description.fields.find(e=>e.name===t);return a===void 0?null:(0,R.jsx)(S9,{form:i,spec:a,locked:n,layout:r},t)})}var w9=class{annotation;constructor(e){this.annotation=e}},aLe=class{sections;constructor(e){this.sections=e}},T9=`caps/form`,E9=0;function D9(e){E9+=1;let t={[`${T9}:${String(E9)}`]:new w9(e)};return e.label!==void 0&&(t.title=e.label),e.help!==void 0&&(t.description=e.help),t}vg.annotate(D9({kind:`secret`})).pipe(Ag(`Secret`));var O9=e=>{let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)};function oLe(e){return Object.values(e??{}).reduce((e,t)=>t instanceof w9?{...e,...t.annotation}:e,{})}function k9(e){return e.reduce((e,t)=>({...e,...oLe(t)}),{})}function A9(e){let t=e?.[T9];return t instanceof aLe?t.sections:{}}var j9=cg(vg);function M9(e){if(fm(e))return tee(j9(e.literal),{onNone:()=>null,onSome:e=>[e]});if(!gm(e))return null;let t=[];for(let n of e.types){if(um(n))continue;let e=M9(n);if(e===null)return null;t.push(...e)}return t}function N9(e){if(dm(e))return{type:`string`,literals:[]};if(Tne(e))return{type:`number`,nullable:!1};if(Ene(e))return{type:`boolean`};let t=M9(e);if(t!==null)return{type:`string`,literals:t};if(mm(e)){let[t]=e.rest;if(t===void 0)return null;if(dm(t))return{type:`strings`,literals:[]};let n=M9(t);return n===null?null:{type:`strings`,literals:n}}if(gm(e)){let t=e.types.filter(e=>!um(e)&&!lm(e)),n=e.types.some(e=>lm(e)),[r]=t;if(t.length!==1||r===void 0)return null;let i=N9(r);return i?.type===`number`?{type:`number`,nullable:n}:n?null:i}return null}function sLe(e){let t=e.ast;if(!hm(t))throw Error(`A schema form needs a Schema.Struct.`);return{fields:t.propertySignatures.map(e=>{let t=String(e.name),n=jh(e.type),r=k9([e.type.annotations,...(e.type.checks??[]).map(e=>e.annotations)]),i=r.kind===`file`?{type:`files`}:N9(n);if(i===null)throw Error(`Schema field "${t}" has no form control. Annotate it with field({ render }) or a kind.`);return{name:t,valueType:i,optional:e.type.context?.isOptional===!0,annotation:r,title:ire(e.type),description:are(e.type)}}),sections:A9(rre(t))}}function P9(e){let t=e,n=!1,r=!1;for(;;)if(t instanceof Oo)n=!0,t=t.unwrap();else if(t instanceof Mo)r=!0,t=t.unwrap();else if(t instanceof Po)t=t.unwrap();else if(t instanceof Ho)t=t.in;else return{node:t,optional:n,nullable:r}}function F9(e){if(e instanceof fo){let t=e.options.map(e=>F9(e));return t.some(e=>e===null)?null:t.flatMap(e=>e??[])}let t=e instanceof So?e.options:e instanceof wo?[...e.values]:null;if(t===null)return null;let n=t.map(e=>j9(e));return n.every(eee)?n.map(e=>e.value):null}function cLe(e){let{node:t,nullable:n}=P9(e);if(t instanceof Sa)return{type:`string`,literals:[]};if(t instanceof Ka)return{type:`number`,nullable:n};if(t instanceof Xa)return{type:`boolean`};let r=F9(t);if(r!==null)return{type:`string`,literals:r};if(t instanceof oo){let e=P9(t.element).node;if(e instanceof Sa)return{type:`strings`,literals:[]};let n=F9(e);return n===null?null:{type:`strings`,literals:n}}return null}function I9(e){let t=[e];for(;;){let e=t[t.length-1];if(e===void 0)break;let n=e instanceof Oo||e instanceof Mo||e instanceof Po?e.unwrap():e instanceof Ho?e.in:e;if(n===e)break;t.push(n)}return t.reverse().map(e=>ur.get(e))}function L9(e){return I9(e).reduce((e,t)=>({...e,...t}),{})}function lLe(e){return Object.entries(e.shape)}function uLe(e){let t=P9(e).node;if(!(t instanceof co))throw Error(`A schema form needs a z.object.`);return{fields:lLe(t).map(([e,t])=>{let n=k9(I9(t)),r=n.kind===`file`?{type:`files`}:cLe(t);if(r===null)throw Error(`Schema field "${e}" has no form control. Annotate it with field({ render }) or a kind.`);let i=L9(t);return{name:e,valueType:r,optional:P9(t).optional,annotation:n,title:i.title,description:i.description}}),sections:A9(L9(e))}}function dLe(e,t){let n=t.options??{};return(e.length>0?e:Object.keys(n)).map(e=>{let t=n[e],r=t===void 0?{}:t instanceof Object?t:{label:t};return{value:e,label:r.label??O9(e),description:r.description,meta:r.meta,icon:r.icon,caption:r.caption,disabled:r.disabled===!0}})}function fLe(e,t){let n=t.some(e=>e.icon!==void 0);switch(e.type){case`boolean`:return`switch`;case`number`:return`number`;case`strings`:return n?`icon-checkboxes`:`checkboxes`;case`files`:return`file`;case`string`:return t.length===0?`text`:t.length>12?`combobox`:n?`icon-radio`:t.some(e=>e.description!==void 0||e.meta!==void 0)||t.length<=3?`radio`:`select`}}function pLe(e,t){switch(e.type){case`boolean`:return!1;case`number`:return e.nullable?null:0;case`strings`:case`files`:return[];case`string`:return t[0]?.value??``}}function mLe(e){let t=e instanceof ba?uLe(e):sLe(e),n=t.fields.map((e,t)=>{let{kind:n,...r}=e.annotation,i=dLe(e.valueType.type===`string`||e.valueType.type===`strings`?e.valueType.literals:[],e.annotation),a=r.help??e.description;return{...r,name:e.name,label:r.label??e.title??O9(e.name),help:a,kind:n??fLe(e.valueType,i),options:i,optionalInSchema:e.optional,index:t}}),r={};t.fields.forEach((e,t)=>{let i=n[t];i&&(r[e.name]=pLe(e.valueType,i.options))});let i=e=>e.order??e.index,a=e=>e.section!==void 0&&Object.hasOwn(t.sections,e.section)?e.section:null,o=e=>n.filter(t=>a(t)===e).sort((e,t)=>i(e)-i(t)),s=Object.entries(t.sections).map(([e,t])=>({id:e,title:t.title,description:t.description,fields:o(e)}));return{fields:n,sections:[{id:null,title:void 0,description:void 0,fields:o(null)},...s].filter(e=>e.fields.length>0),defaults:r}}function R9(e){let t=e instanceof ba?e:Lre(e);return{"~standard":{...t[`~standard`],validate:e=>{let n=t[`~standard`].validate(e);return n instanceof Promise?n.then(e=>z9(e)):z9(n)}}}}function z9(e){return e.issues===void 0?e:{issues:e.issues.map(e=>e.path===void 0?e:{...e,path:e.path.slice(0,1)})}}var B9=`onServer`;function V9(e){let t=e.querySelector(`[aria-invalid="true"]`),n=t?.matches(`input, select, textarea, button, [tabindex]`)?t:t?.querySelector(`input, select, textarea, button`);return n?.focus(),n!=null}function hLe(e){if(V9(e))return()=>void 0;let t=new MutationObserver(()=>{V9(e)&&t.disconnect()});return t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-invalid`]}),()=>{t.disconnect()}}function gLe(e){return e.state.meta.errorMap.onServer!==void 0}function _Le(e){e.setMeta(e=>({...e,errorMap:{...e.errorMap,[B9]:void 0}}))}function vLe(e,t,n){e.setFieldMeta(t,e=>({...e,isBlurred:!0,errorMap:{...e.errorMap,[B9]:n}}))}function H9(e){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(e.defaultValues),[s,c]=(0,F.useState)(null);h3(a,e.defaultValues)||(o(e.defaultValues),c(null));let{schema:l}=e,u=(0,F.useMemo)(()=>mLe(l),[l]),d=(0,F.useMemo)(()=>R9(l),[l]),f=Pje({defaultValues:s??a,validators:{onChange:d,onSubmit:d},listeners:{onChange:({fieldApi:e})=>{n(null),i(null),gLe(e)&&_Le(e)}},onSubmit:async({value:t,formApi:r})=>{n(null),i(null);let a=await R9(l)[`~standard`].validate(t);if(a.issues){n(a.issues[0]?.message??`Check the form and try again.`);return}let o;try{o=await e.onSubmit(a.value,t)??{kind:`saved`}}catch(t){console.error(`SchemaForm submit failed`,t),n(e.failure??`Couldn't save changes. Try again.`);return}if(o.kind===`refused`){n(o.error??null);let e=r;for(let[t,n]of Object.entries(o.fields??{}))n!==void 0&&n.length>0&&vLe(e,t,n);return}let s=o.values??t;c(s),r.reset(s),i(o.message??`Saved`),e.onSaved?.(s)}});return{description:u,form:f,error:t,saved:r,discard:()=>{n(null),i(null),f.reset()},submit:()=>f.handleSubmit()}}function U9(e){return{dirty:K3(e.form.store,e=>!e.isDefaultValue),submitting:K3(e.form.store,e=>e.isSubmitting),canSubmit:K3(e.form.store,e=>e.canSubmit)}}function W9({model:e,submitLabel:t=`Save changes`,discardLabel:n,onCancel:r,cancelLabel:i,allowClean:a,layout:o,footer:s,children:c,disabled:l=!1,...u}){let{submitting:d}=U9(e),f=(0,F.useRef)(null),p=(0,F.useRef)(()=>void 0);return(0,F.useEffect)(()=>()=>{p.current()},[]),(0,R.jsxs)(Hje,{...u,ref:f,layout:o,busy:d,noValidate:!0,onSubmit:t=>{t.preventDefault(),e.form.state.isSubmitting||e.submit().then(()=>{p.current();let t=f.current;t!==null&&!e.form.state.isValid&&(p.current=hLe(t))})},children:[c??(0,R.jsx)(C9,{model:e,disabled:l,layout:o}),s===void 0?(0,R.jsx)(bLe,{model:e,label:t,discardLabel:r===void 0?n:void 0,onCancel:r,cancelLabel:i,allowClean:a??r!==void 0,divider:r===void 0}):s]})}function yLe({schema:e,defaultValues:t,onSubmit:n,onSaved:r,failure:i,...a}){let o=H9({schema:e,defaultValues:t,onSubmit:n,onSaved:r,failure:i});return(0,R.jsx)(W9,{...a,model:o})}function G9(e){return`model`in e?(0,R.jsx)(W9,{...e}):(0,R.jsx)(yLe,{...e})}function bLe({model:e,label:t,discardLabel:n,onCancel:r,cancelLabel:i=`Cancel`,allowClean:a=!1,dirtyLabel:o=`Unsaved changes`,buttonProps:s,...c}){let{dirty:l,submitting:u}=U9(e),d=u?null:e.saved&&!l?(0,R.jsx)(QT,{tone:`success`,size:`compact`,label:e.saved}):l?(0,R.jsx)(QT,{tone:`neutral`,size:`compact`,label:o}):null;return(0,R.jsxs)(Vje,{...c,error:e.error,status:d,children:[r?(0,R.jsx)(zT,{type:`button`,variant:`ghost`,disabled:u,onClick:r,children:i}):n&&l?(0,R.jsx)(zT,{type:`button`,variant:`ghost`,disabled:u,onClick:e.discard,children:n}):null,(0,R.jsx)(zT,{...s,type:`submit`,loading:u,disabled:u||!l&&!a,title:!l&&!a?`No changes to save`:void 0,children:t})]})}function xLe({duration:e,paused:t=!1,onBurnt:n,className:r}){let i=(0,F.useRef)(null),a=(0,F.useRef)(null),o=(0,F.useRef)(n);return(0,F.useEffect)(()=>{o.current=n},[n]),(0,F.useLayoutEffect)(()=>{let t=i.current;if(!t)return;if(!hC(t)){let t=setTimeout(()=>{o.current()},e);return()=>{clearTimeout(t)}}let n=dC(t),r=Math.max(1,Math.round(e/1e3)),s=t.animate([{transform:`scaleX(1)`},{transform:`scaleX(0)`}],{duration:e,easing:n.reduced?`steps(${String(r)}, end)`:mC(n,`linear`),fill:`forwards`});return s.addEventListener(`finish`,()=>{o.current()}),a.current=s,()=>{s.cancel(),a.current=null}},[e]),(0,F.useEffect)(()=>{let e=a.current;e&&(t?e.pause():e.playState===`paused`&&e.play())},[t]),(0,R.jsx)(`span`,{ref:i,"aria-hidden":`true`,className:cC(`caps-fuse`,r)})}var SLe=(0,F.forwardRef)(function({children:e,onCommit:t,armedAnnouncement:n,undoneAnnouncement:r,undoLabel:i=`Undo`,undoMs:a=5e3,className:o,onKeyDown:s,onPointerEnter:c,onPointerLeave:l,...u},d){let[f,p]=(0,F.useState)(!1),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(``),v=(0,F.useId)(),y=()=>{p(!1),_(r)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(zT,{...u,ref:d,"aria-label":f?void 0:u[`aria-label`],"aria-labelledby":f?void 0:u[`aria-labelledby`],"aria-describedby":f?v:u[`aria-describedby`],className:cC(`caps-undo-action`,o),"data-armed":f?``:void 0,onClick:()=>{if(f){y();return}p(!0),_(n)},onKeyDown:e=>{s?.(e),f&&e.key===`Escape`&&(e.preventDefault(),y())},onPointerEnter:e=>{c?.(e),h(!0)},onPointerLeave:e=>{l?.(e),h(!1)},children:[f?i:e,f?(0,R.jsx)(xLe,{duration:a,paused:m,onBurnt:()=>{p(!1),_(``),t()}}):null]}),(0,R.jsx)(vC,{id:v,children:`Press Escape to undo.`}),(0,R.jsx)(vC,{role:`status`,children:g})]})}),K9=new Set([`Enter`,` `]),CLe=(0,F.forwardRef)(function({children:e,onConfirm:t,holdMs:n=900,holdHint:r=`Press and hold to confirm.`,className:i,disabled:a,loading:o=!1,result:s,resultLabel:c,onBlur:l,onKeyDown:u,onKeyUp:d,onPointerDown:f,onPointerUp:p,onPointerLeave:m,onPointerCancel:h,...g},_){let v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(null),x=(0,F.useRef)(null),S=(0,F.useRef)(t),C=(0,F.useId)();(0,F.useEffect)(()=>{S.current=t},[t]),(0,F.useEffect)(()=>()=>{y.current?.cancel(),b.current!==null&&clearTimeout(b.current)},[]);let w=()=>{y.current=null,b.current=null,x.current=null,S.current();let e=v.current;if(!e||!hC(e))return;let t=dC(e);e.animate([{opacity:1},{opacity:0}],{duration:t.normal,easing:mC(t,t.easeExit)})},T=e=>{let t=v.current;if(a===!0||o||!t||y.current||b.current)return;if(x.current=e,!hC(t)){b.current=setTimeout(w,n);return}let r=dC(t),i=t.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:n,easing:r.reduced?`steps(3, end)`:mC(r,`cubic-bezier(0.3, 0, 0.7, 1)`)});i.addEventListener(`finish`,w),y.current=i},E=e=>{if(e!==void 0&&x.current!==e)return;x.current=null,b.current!==null&&(clearTimeout(b.current),b.current=null);let t=y.current,n=v.current;if(!t||!n)return;y.current=null;let r=getComputedStyle(n).transform;t.cancel();let i=dC(n);n.animate([{transform:r===`none`?`scaleY(0)`:r},{transform:`scaleY(0)`}],{duration:i.fast,easing:mC(i,i.ease)})};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(zT,{...g,ref:_,disabled:a,loading:o,result:s,resultLabel:c??(s===void 0?void 0:e),"aria-describedby":C,className:cC(`caps-hold-button`,i),onBlur:e=>{E(),l?.(e)},onPointerDown:e=>{f?.(e),e.button===0&&T(e.pointerId)},onPointerUp:e=>{p?.(e),E(e.pointerId)},onPointerLeave:e=>{m?.(e),E(e.pointerId)},onPointerCancel:e=>{h?.(e),E(e.pointerId)},onKeyDown:e=>{u?.(e),e.key===`Escape`&&E(),K9.has(e.key)&&(e.preventDefault(),e.repeat||T(`key`))},onKeyUp:e=>{d?.(e),K9.has(e.key)&&(e.preventDefault(),E(`key`))},children:[(0,R.jsx)(`span`,{ref:v,"aria-hidden":`true`,className:`caps-hold-fill`}),e]}),(0,R.jsx)(vC,{id:C,children:r})]})}),q9=(0,F.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(`code`,{...t,className:cC(`caps-inline-code`,e),ref:n})}),J9=`data-reorder-key`;function wLe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{element:t,top:r.top-n.top+e.scrollTop,left:r.left-n.left+e.scrollLeft,width:r.width,height:r.height}}function TLe(e,t,n){e.forEach((e,r)=>{e.animate(t.reduced?[{opacity:0},{opacity:1}]:[{opacity:0,transform:`translateY(${String(t.distance)}px)`},{opacity:1,transform:`none`}],{duration:t.normal,delay:n+r*t.stagger,easing:mC(t,t.ease),fill:`backwards`})})}function ELe(e,t,n){let r=t.element.cloneNode(!0);if(!(r instanceof HTMLElement))return;r.removeAttribute(J9),r.removeAttribute(`id`),r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`inert`,``),Object.assign(r.style,{position:`absolute`,top:`${String(t.top-e.clientTop)}px`,left:`${String(t.left-e.clientLeft)}px`,width:`${String(t.width)}px`,height:`${String(t.height)}px`,margin:`0`,pointerEvents:`none`});let i=getComputedStyle(e).position!==`static`;i||(e.style.position=`relative`),e.append(r);let a=r.animate(n.reduced?[{opacity:1},{opacity:0}]:[{opacity:1,transform:`none`},{opacity:0,transform:`translateY(${String(-n.distance)}px)`}],{duration:n.fast,easing:mC(n,n.easeExit),fill:`forwards`}),o=()=>{r.remove(),!i&&e.querySelector(`:scope > [inert]`)===null&&e.style.removeProperty(`position`)};a.addEventListener(`finish`,o),a.addEventListener(`cancel`,o)}function DLe(e,t,n,r){let i=e.style.overflow;e.style.overflow=`clip`;let a=e.animate([{height:`${String(t)}px`},{height:`${String(n)}px`}],r),o=()=>{e.style.overflow=i};return a.addEventListener(`finish`,o),a.addEventListener(`cancel`,o),a}function OLe(e,t){let n=(0,F.useRef)(null),r=(0,F.useRef)(0),i=(0,F.useRef)(null),a=t.join(`\0`);(0,F.useLayoutEffect)(()=>{let o=e.current;if(o===null){n.current=null;return}let s=n.current,c=s?.order!==a,l=i.current?o.getBoundingClientRect().height:r.current;c&&(i.current?.cancel(),i.current=null);let u=c?o.getBoundingClientRect().height:r.current;r.current=u;let d=new Map;for(let e of o.querySelectorAll(`:scope [${J9}]`)){let t=e.getAttribute(J9);if(t===null)continue;let n=s?.rows.get(t);d.set(t,!c&&n?.element===e?n:wLe(o,e))}let f=new Set(t);if(n.current={order:a,keys:f,rows:d},s===null||!c||!hC(o))return;let p=dC(o),m=[...s.rows].filter(([e,t])=>!f.has(e)&&!t.element.isConnected),h={duration:p.slow,delay:m.length>0?p.fast:0,easing:mC(p,p.ease),fill:`backwards`},g=[],_=[];for(let[e,t]of d){let n=s.rows.get(e);if(n===void 0){s.keys.has(e)||g.push(t.element);continue}let r=n.left-t.left,i=n.top-t.top;(r!==0||i!==0)&&(_.push(t.element),!(p.reduced||p.slow<=0)&&t.element.animate([{transform:`translate(${String(r)}px, ${String(i)}px)`},{transform:`none`}],h))}if(p.reduced)for(let e of _)e.animate([{opacity:.3},{opacity:1}],{duration:p.fast,easing:p.ease});else for(let[,e]of m)ELe(o,e,p);if(TLe(g,p,_.length>0&&!p.reduced?p.fast:0),!p.reduced&&Math.abs(l-u)>.5){let e=DLe(o,l,u,h);i.current=e,e.addEventListener(`finish`,()=>{i.current===e&&(i.current=null)})}})}var kLe=L({port:yS.fields.port.annotate(D9({label:`Port`,min:1,max:65535}))}),ALe=L({command:Xg.pipe(kg(Jg(16384))).annotate(D9({label:`Command`,required:!0})),port:Dg(yS.fields.port).annotate(D9({label:`Port (optional)`,min:1,max:65535,render:e=>(0,R.jsx)(h9,{name:e.name,id:e.id,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:e.value??``,disabled:e.disabled,"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],onBlur:()=>{e.onBlur()},onChange:t=>{let n=t.currentTarget;e.onChange(n.value===``?null:n.valueAsNumber)}})}))}),Y9=[{command:`npm run dev`,port:3e3},{command:`python3 -m http.server 8000`,port:8e3}];function jLe({openPreview:e,openId:t,onOpenChange:n,processNavigation:r=null,leading:i,trailing:a,placement:o=`housing`,extraItems:s=[],hostInset:c}){let{ports:{items:l,status:u,actions:d,refresh:f,expose:p,unexpose:m},processes:{items:h,loading:g,error:_,fix:v,actions:y,refresh:b,stop:x,start:S}}=_D(),C=(0,F.useRef)(null),w=(0,F.useRef)(0),[T,E]=(0,F.useState)(null),D=e=>{Date.now()-w.current<900&&E(e)},O=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(t!==`processes`||!r||O.current===r.requestId||!C.current)return;let e=[...C.current.querySelectorAll(`[${J9}]`)].find(e=>e.getAttribute(J9)===r.processId);e&&(e.focus(),O.current=r.requestId)},[t,r,h]);let k=H9({schema:kLe,defaultValues:{port:5173},onSubmit:async({port:e})=>await p?.(e)?{kind:`saved`}:{kind:`refused`,fields:{port:`Couldn't expose port ${String(e)}. Try again.`}}}),A=H9({schema:ALe,defaultValues:{command:``,port:null},onSubmit:async({command:e,port:t})=>await S?.(t===null?{command:e}:{command:e,port:t})?{kind:`saved`}:{kind:`refused`,fields:{command:`Couldn’t confirm the process start. Try again.`}}}),j=()=>{k.form.setFieldMeta(`port`,e=>({...e,errorMap:{...e.errorMap,onServer:void 0}}))},M=async e=>{await p?.(e)&&k.form.state.values.port===e&&j()},ee=l?.length??0,N=new Map;for(let e of l??[])N.set(e.port,e);for(let[e,t]of d??[])t.expose&&!N.has(e)&&N.set(e,null);let te=h!==null||g||_!==null,ne=u===`not-configured`?(0,R.jsx)(B4,{title:`Preview service isn't configured`,children:`You can still work in the terminal.`}):l===null&&u===`unavailable`?(0,R.jsx)(B4,{title:`Port listing isn't available`,children:`You can still work in the terminal.`}):l===null&&u===`loading`?(0,R.jsx)(B4,{title:`Loading exposed ports`,children:`Checking which ports this Computer has exposed.`}):l===null&&u===`error`?(0,R.jsx)(B4,{title:`Couldn't load exposed ports`,children:`Check the Computer connection, then refresh to try again.`}):(0,R.jsxs)(R.Fragment,{children:[N.size>0?(0,R.jsx)(Z9,{label:`Exposed ports`,order:Array.from(N.keys(),String),children:Array.from(N,([t,n])=>{let r=d?.get(t),i=r?.status===`pending`,a=r?.status===`failed`?r.expose?`Couldn't expose port ${String(t)}. Try again.`:`Couldn't remove exposure. Try again.`:null;return(0,R.jsx)(z4,{[J9]:String(t),role:`listitem`,"data-shed-port":t,icon:(0,R.jsx)(ZAe,{size:16,"aria-hidden":`true`}),primary:a?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`block`,children:[`Port `,t]}),(0,R.jsx)(`span`,{role:`status`,className:`block whitespace-normal text-xs font-normal text-error`,children:a})]}):`Port ${String(t)}`,actions:n?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(zT,{size:`xs`,variant:`ghost`,disabled:i,onClick:()=>{e(n)},"aria-label":`Open preview of port ${String(t)}`,children:[(0,R.jsx)(P4,{size:14,"aria-hidden":`true`}),`Open preview`]}),(0,R.jsx)(SLe,{"aria-label":`Stop exposing port ${String(t)}`,armedAnnouncement:`Port ${String(t)} closes in 5 seconds.`,undoneAnnouncement:`Port ${String(t)} stays open.`,size:`xs`,variant:`ghost`,className:`hover:text-error`,disabled:!m||i,onCommit:()=>{m?.(t)},children:i?r.expose?`Exposing…`:`Removing…`:`Remove exposure`})]}):(0,R.jsx)(zT,{size:`xs`,variant:`ghost`,disabled:!p||i,"aria-label":`Expose port ${String(t)}`,onClick:()=>{M(t)},children:i?`Exposing…`:`Try again`})},t)})}):(0,R.jsx)(B4,{title:u===`error`?`Couldn't load exposed ports`:`No exposed ports`,children:u===`error`?`Check the Computer connection, then refresh to try again.`:`Expose a port from this Computer to see it here.`}),(0,R.jsx)(k.form.Subscribe,{selector:e=>({submitting:e.isSubmitting,port:e.values.port}),children:({submitting:e,port:t})=>{let n=e||d?.get(t)?.status===`pending`,r=p===void 0||n;return(0,R.jsx)(G9,{model:k,className:`mt-3 px-2`,"aria-label":`Expose a port`,disabled:r,footer:null,children:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(C9,{model:k,disabled:r})}),(0,R.jsx)(zT,{className:`self-end`,type:`submit`,size:`sm`,disabled:r,loading:n,onClick:j,children:`Expose`})]})})}}),u===`loading`&&l!==null?(0,R.jsx)(`p`,{className:`mt-2 text-xs text-base-content/60`,role:`status`,children:`Refreshing exposed ports…`}):null,u===`error`&&l!==null?(0,R.jsx)(`p`,{className:`mt-2 text-xs text-error`,role:`status`,children:`Couldn't refresh exposed ports. The list may be out of date.`}):null]}),re=te?g&&h===null?(0,R.jsx)(B4,{title:`Loading processes`,children:`Checking this Computer's process inventory.`}):_!==null&&h===null?(0,R.jsx)(`div`,{className:`px-2 pb-3`,children:(0,R.jsx)(vD,{tone:_.reason===`failed`?`error`:`warning`,role:`status`,title:`Can't run commands`,description:_.message,action:v===void 0?void 0:(0,R.jsx)(zT,{size:`xs`,variant:`outline`,onClick:()=>void v(),children:_.action===`grant`?`Allow access`:`Try again`})})}):h===null||h.length===0?(0,R.jsx)(`div`,{className:`px-2 pb-3`,children:(0,R.jsx)(vE,{variant:`quiet`,headingLevel:3,title:`Nothing running`,description:(0,R.jsxs)(R.Fragment,{children:[`Start a dev server, for example`,` `,(0,R.jsx)(q9,{children:`npm run dev`}),`.`]}),actions:(0,R.jsx)(`ul`,{"aria-label":`Try one of these`,className:`m-0 flex list-none flex-wrap gap-2 p-0`,children:Y9.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(zT,{size:`sm`,variant:`outline`,onClick:()=>{A.form.setFieldValue(`command`,e.command),A.form.setFieldValue(`port`,e.port),document.querySelector(`[aria-label="Start a process"] button[type="submit"]`)?.focus()},children:(0,R.jsx)(q9,{children:e.command})})},e.command))})})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`px-1`,children:(0,R.jsx)(Z9,{label:`Computer process inventory`,order:h.map(({id:e})=>e),listRoot:C,children:h.map(t=>{let n=y?.get(t.id),r=t.state===`running`?l?.find(e=>e.port===t.port):void 0,i=t.state===`exited`&&t.exitCode!==null&&t.exitCode!==0,a=`neutral`,o=`Finished`;t.state===`exited`&&t.exitCode===null?(a=`warning`,o=`Ended · exit not recorded`):t.state===`running`?(a=`success`,o=`Running`):t.state===`uncertain`?(a=`warning`,o=`Status unknown`):i&&(a=`error`,o=`Failed · exit ${String(t.exitCode)}`);let s=t.state===`exited`&&t.sync===`pending`;return(0,R.jsx)(z4,{[J9]:t.id,role:`listitem`,"data-process-state":t.state,"data-process-sync":t.sync,className:`py-2`,tabIndex:-1,primary:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(q9,{className:`block truncate`,"data-process-command":!0,children:t.command}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-normal`,children:[(0,R.jsx)(QT,{size:`compact`,tone:a,label:n===`stopping`?`Stopping`:o}),t.port===null?null:(0,R.jsxs)(`span`,{"data-process-port":!0,children:[`Port `,t.port]})]}),n===`failed`?(0,R.jsxs)(`span`,{role:`status`,className:`block whitespace-normal text-xs font-normal text-error`,children:[`Couldn't stop `,t.command,`. Try again.`]}):(0,R.jsxs)(R.Fragment,{children:[T===t.id?(0,R.jsx)(`span`,{role:`status`,className:`block text-xs font-normal text-(--stipe-fg-muted)`,children:`Hold to stop`}):null,s?(0,R.jsx)(`span`,{className:`block truncate text-xs font-normal text-(--stipe-fg-muted)`,children:`Changes still copying to your files`}):null,t.cwd===null?null:(0,R.jsx)(`span`,{className:`block truncate text-xs font-normal text-(--stipe-fg-muted)`,children:t.cwd})]})]}),actions:(0,R.jsxs)(R.Fragment,{children:[r?(0,R.jsxs)(zT,{size:`xs`,variant:`ghost`,"aria-label":`Open preview of port ${String(r.port)}`,onClick:()=>{e(r)},children:[(0,R.jsx)(P4,{size:14,"aria-hidden":`true`}),` Open`]}):null,t.state===`running`&&x?(0,R.jsx)(CLe,{holdHint:`A stopped process cannot be resumed. Press and hold to stop it.`,size:`xs`,variant:`ghost`,className:`hover:text-error`,disabled:n===`stopping`,"aria-label":`Stop process ${t.command}`,onPointerDown:()=>{w.current=Date.now(),E(null)},onPointerUp:()=>{D(t.id)},onConfirm:()=>{E(null),x(t.id)},children:n===`stopping`?`Stopping…`:`Stop`}):null]})},t.id)})})}),g?(0,R.jsx)(`p`,{className:`mt-2 text-xs text-base-content/60`,role:`status`,children:`Refreshing processes…`}):null,_===null?null:(0,R.jsx)(`p`,{className:`mt-2 text-xs text-error`,role:`status`,children:`Couldn't refresh processes. The list may be out of date.`})]}):(0,R.jsx)(B4,{title:`Processes can't be listed yet`,children:`You can still run things in the terminal.`}),P=[{id:`ports`,label:`Ports`,count:ee,title:`Exposed ports`,actions:(0,R.jsx)(R4,{"aria-label":`Refresh exposed ports`,title:`Refresh exposed ports`,icon:(0,R.jsx)(I4,{}),size:`xs`,iconSize:`xs`,disabled:!f||u===`loading`,onClick:()=>{f?.()}}),content:ne},{id:`processes`,label:`Processes`,count:h?.filter(e=>e.state===`running`).length,title:`Processes`,disabled:!te,accessibleLabel:te?void 0:`Processes can't be listed yet`,actions:(0,R.jsx)(R4,{"aria-label":`Refresh processes`,title:`Refresh processes`,icon:(0,R.jsx)(I4,{}),size:`xs`,iconSize:`xs`,disabled:!b||g,onClick:()=>{b?.()}}),content:(0,R.jsxs)(R.Fragment,{children:[re,S&&(_===null||_.reason===`failed`)?(0,R.jsx)(A.form.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,R.jsx)(G9,{model:A,"aria-label":`Start a process`,className:`mt-3 px-2`,disabled:e,footer:(0,R.jsx)(`div`,{className:`flex justify-end`,children:(0,R.jsx)(zT,{type:`submit`,variant:`primary`,size:`sm`,loading:e,disabled:e,onClick:()=>{A.form.setFieldMeta(`command`,e=>({...e,errorMap:{...e.errorMap,onServer:void 0}}))},children:`Start`})}),children:(0,R.jsx)(C9,{model:A,disabled:e})})}):null]})},...s];return(0,R.jsx)(sje,{items:P,openId:t,onOpenChange:n,leading:i,trailing:a,placement:o,...c===void 0?{}:{hostInset:c},align:o===`host`?`start`:`end`})}function X9({port:e,onClose:t,onPopOut:n}){let[r,i]=(0,F.useState)(0);return(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden rounded-field bg-base-100`,"aria-label":`Preview port ${String(e.port)}`,children:[(0,R.jsxs)(`div`,{className:`shed-browser-controls flex h-8 shrink-0 items-center gap-1 border-b border-base-300 px-1`,children:[(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 truncate px-2 font-mono text-xs`,children:[`:`,e.port]}),(0,R.jsx)(R4,{"aria-label":`Open preview in new window`,title:`Open preview in new window`,icon:(0,R.jsx)(P4,{}),size:`xs`,iconSize:`xs`,onClick:n}),(0,R.jsx)(R4,{"aria-label":`Reload preview`,title:`Reload preview`,icon:(0,R.jsx)(I4,{}),size:`xs`,iconSize:`xs`,onClick:()=>{i(e=>e+1)}}),(0,R.jsx)(R4,{"aria-label":`Close preview`,title:`Close preview`,icon:(0,R.jsx)(L4,{"aria-hidden":`true`}),size:`xs`,iconSize:`xs`,onClick:t})]}),(0,R.jsx)(`iframe`,{className:`shed-preview-frame block min-h-0 w-full flex-1 border-0 bg-base-100`,sandbox:`allow-scripts allow-same-origin allow-popups`,src:e.previewUrl,title:`Preview · port ${String(e.port)}`},`${String(e.port)}:${String(r)}`)]})}function Z9({label:e,order:t,children:n,listRoot:r}){let i=(0,F.useRef)(null),a=r??i;return OLe(a,t),(0,R.jsx)(`div`,{ref:a,children:(0,R.jsx)(cje,{role:`list`,"aria-label":e,children:n})})}var MLe=cg(xS.fields.id);function NLe({app:e}){let t=Ux(e?.context)??null;return(0,R.jsx)(PLe,{app:e,appContext:t},JSON.stringify([e?.identity.surfaceId,t?.computerId]))}function PLe({app:e,appContext:t}){let n=t?.computerId??null,{query:r,ports:i,status:a,actions:o,enabled:s,change:c}=Ape(e,t?.visibility===`visible`),l=(0,F.useCallback)(async()=>{await r.refetch()},[r.refetch]),{query:u,stop:d,startCommand:f,actions:p,enabled:m}=Ope(e,t?.visibility===`visible`),h=(0,F.useCallback)(async()=>{await u.refetch()},[u.refetch]),g=(0,F.useRef)({refreshPorts:l,refreshProcesses:h});if(g.current={refreshPorts:l,refreshProcesses:h},(0,F.useEffect)(()=>{if(e)return js(e.commands,ILe(()=>g.current.refreshPorts(),()=>g.current.refreshProcesses()))},[e]),t?.teamHasComputers===!1)return(0,R.jsx)(FLe,{onAllowAccess:e&&!t.computerAccessGranted?()=>void e.ui.requestAppPermissions({computers:[`computer.execute`]}).catch(e=>{console.error(`Shed Computer operation failed`,e)}):void 0});let _=m&&u.isError?bue(u.error):null,v=_?.action===`retry`?h:_?.action===`grant`&&e?()=>void e.ui.requestAppPermissions({computers:[`computer.execute`]}).catch(e=>{console.error(`Shed Computer operation failed`,e)}):void 0;return(0,R.jsx)(gD.Provider,{value:{ports:{items:i,status:a,actions:o,refresh:s?l:void 0,expose:s?e=>c(e,!0):void 0,unexpose:s?e=>{c(e,!1)}:void 0},processes:{items:m?u.data?.processes??null:null,loading:m&&u.isFetching,error:_,fix:v,actions:p,refresh:m?h:void 0,start:m?f:void 0,stop:m?e=>{d.mutate(e)}:void 0}},children:(0,R.jsx)(LLe,{app:e,computerId:n,computerAccessGranted:t?.computerAccessGranted===!0},n)})}function FLe({onAllowAccess:e}){return(0,R.jsx)(`main`,{className:`grid h-full min-h-0 grid-cols-1 place-items-center bg-base-200 p-6 text-base-content`,children:(0,R.jsx)(vE,{className:`w-full max-w-[460px]`,"data-absence":`team-computers-empty`,variant:`panel`,visual:(0,R.jsx)(`span`,{className:`inline-grid size-16 place-items-center rounded-full bg-base-200 text-primary`,children:(0,R.jsx)(gE,{name:`computer`,size:48})}),title:`No Computer yet.`,description:e?`No Computer is attached to this window. Allow Computer access to use one here.`:`No Computer is attached to this window.`,actions:e?(0,R.jsx)(zT,{size:`sm`,onClick:e,children:`Allow Computer access`}):null})})}function ILe(e,t){return[{id:`refresh-processes`,title:`Refresh processes`,category:`Computer`,description:`Refresh the running processes on this Computer.`,projections:{palette:{}},handler:t},{id:`refresh-ports`,title:`Refresh forwarded ports`,category:`Computer`,description:`Refresh the forwarded ports on this Computer.`,projections:{palette:{}},handler:e}]}function LLe({app:e,computerId:t,computerAccessGranted:n=!1}){let r=(0,F.useRef)(null),[i,a]=(0,F.useState)({width:0,height:0});(0,F.useEffect)(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(([e])=>{a({width:e.contentRect.width,height:e.contentRect.height})});return t.observe(e),()=>{t.disconnect()}},[]);let o=t!==null&&e?.capabilities.has(wS)===!0,{ports:{items:s,status:c},processes:{items:l,loading:u,error:d}}=_D(),[f,p]=(0,F.useState)(null),m=Ux(e?.context)?.openRequest??null,h=(0,F.useRef)(null),[g,_]=(0,F.useState)(null);(0,F.useEffect)(()=>{if(t===null||m?.kind!==`navigate`||h.current===m.requestId)return;let e=m.params.filter(({key:e})=>e===`process`);if(e.length!==1)return;let n=Bu(MLe(e[0]?.value));n!==null&&(h.current=m.requestId,_({requestId:m.requestId,processId:n}),p(`processes`))},[t,m]);let[v,y]=(0,F.useState)(void 0),[b,x]=(0,F.useState)(null),[S,C]=(0,F.useState)(!1),[w,T]=(0,F.useState)(null),E=(0,F.useCallback)(e=>{t!==null&&T({...e,computerId:t})},[t]),D=o&&w?.computerId===t?w:null,O=i.width<540,k=s?.find(e=>e.port===b)??null,A=e=>{if(e.openMode===`external-only`){window.open(e.previewUrl,`_blank`,`noopener,noreferrer`);return}x(e.port),C(!0),p(null)},j=l!==null||u||d!==null,M=xpe({app:e,terminal:D,processes:d===null?l===null?u?{kind:`loading`}:{kind:`unavailable`}:{kind:`loaded`,count:l.length}:{kind:`error`},ports:c===`error`?{kind:`error`}:c===`loaded`&&s!==null?{kind:`loaded`,count:s.length}:c===`loading`?{kind:`loading`}:{kind:`unavailable`}});return Nle(e,t===null?[]:[...D?[{kind:`text`,id:`terminal`,text:`Terminal ${D.state}`,tone:zLe(D.state)}]:o?[]:[{kind:`text`,id:`terminal`,text:`Terminal unavailable`,tone:`warning`}],...c===`not-configured`?[]:[{kind:`button`,id:`ports`,text:`Ports`,icon:`ports`,count:s?.length??0,opens:`dialog`,expanded:f===`ports`}],{kind:`button`,id:`processes`,text:`Processes`,icon:`processes`,opens:`dialog`,expanded:f===`processes`,count:l?.filter(e=>e.state===`running`).length??0,disabled:!j,title:j?`Processes on this Computer`:`Processes can't be listed yet`},...O&&k?[{kind:`toggle`,id:`screen`,text:`:${String(k.port)}`,pressed:S}]:[],{kind:`button`,id:`access`,text:`Access`,icon:`access`,opens:`dialog`,expanded:f===`access`,title:o?`Shed can run commands on this Computer`:`Shed can't run commands on this Computer`}],e=>e.itemId===`screen`?(C(e=>!e),!0):[`ports`,`processes`,`access`].includes(e.itemId)?(y(e.anchor?.start),p(t=>t===e.itemId?null:e.itemId),!0):!1),(0,R.jsxs)(`main`,{className:`shed-workspace flex h-full min-h-0 w-full flex-col overflow-hidden bg-base-200 font-sans text-base-content`,"aria-label":`Shed Computers workspace`,children:[(0,R.jsx)(`div`,{ref:r,className:`relative min-h-0 flex-1`,children:(0,R.jsx)(dD,{bounds:i,tiling:{layout:`main-top`,mainSize:i.width>=540?i.height*.5:i.height,gap:8},children:(0,R.jsx)(RLe,{app:e,computerId:t,computerAccessGranted:n,terminalAvailable:o,bounds:i,narrow:O,preview:k,previewVisible:S,onClosePreview:()=>{C(!1),x(null)},onTerminalStatus:E})})}),t===null?null:(0,R.jsx)(jLe,{placement:`host`,openPreview:A,openId:f,onOpenChange:p,processNavigation:g,extraItems:[M],...v===void 0?{}:{hostInset:v}})]})}function RLe({app:e,computerId:t,computerAccessGranted:n,terminalAvailable:r,bounds:i,narrow:a,preview:o,previewVisible:s,onClosePreview:c,onTerminalStatus:l}){let u=pD(),d=o!==null&&s&&!a,f=(0,F.useRef)(!1);(0,F.useEffect)(()=>{if(!d){f.current=!1;return}f.current||(f.current=!0,requestAnimationFrame(()=>{u.swap(`terminal`,`preview`)}))},[u,d]);let p=()=>{c(),u.zoomedId===`preview`&&u.zoom(null)},m=()=>{o&&window.open(o.previewUrl,`_blank`,`noopener,noreferrer`)};return(0,R.jsxs)(R.Fragment,{children:[d?(0,R.jsx)(Q9,{id:`preview`,children:(0,R.jsx)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col`,children:(0,R.jsx)(X9,{port:o,onClose:p,onPopOut:m})})}):null,(0,R.jsx)(Q9,{id:`terminal`,children:(0,R.jsx)(`section`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,"aria-label":`Terminal`,children:t!==null&&e&&r?(0,R.jsx)(KAe,{app:e,computerId:t,onStatusChange:l,openRuntimeSetup:()=>e.ui.openSetup(`computer`),screen:a&&o&&s?(0,R.jsx)(X9,{port:o,onClose:p,onPopOut:m}):void 0},t):(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(vE,{className:`grid min-h-0 flex-1 content-center justify-items-center p-4 text-center`,"data-absence":t?`terminal-permission`:`computer-context`,role:`status`,variant:`hint`,title:t?`Terminal unavailable`:`No Computer selected`,description:t?`Shed can’t run commands on this Computer yet. Allow Computer access in the window controls.`:n?`No Computer is attached to this window.`:`No Computer is attached to this window. Allow Computer access to use one here.`,actions:e&&t===null&&!n?(0,R.jsx)(zT,{size:`sm`,onClick:()=>void e.ui.requestAppPermissions({computers:[`computer.execute`]}).catch(e=>{console.error(`Shed Computer operation failed`,e)}),children:`Allow Computer access`}):null})})})}),d?(0,R.jsx)(`div`,{className:`absolute inset-x-0 z-20 -translate-y-1/2`,style:{top:(u.divider?.position??i.height/2)+8},children:u.divider?(0,R.jsx)(Tpe,{className:`absolute left-1/2 -translate-x-1/2`,"aria-label":`Preview and terminal size`,orientation:`horizontal`,variant:`notch`,value:u.divider.position,min:u.divider.min,max:u.divider.max,onValueChange:u.resizeMain,onDoubleClick:()=>{u.resizeMain(i.height/2)},...u.divider.props}):null}):null]})}function Q9({id:e,children:t}){let n=mD({id:e,frame:{x:0,y:0,width:560,height:180},minima:{width:240,height:e===`preview`?140:120}});return(0,R.jsx)(`div`,{className:`shed-pane absolute flex min-h-0 min-w-0 p-1`,"data-shed-pane":e,hidden:!n.visible,style:{left:n.frame.x,top:n.frame.y,width:n.frame.width,height:n.frame.height},children:t})}function zLe(e){return e===`open`?`success`:e===`failed`?`error`:e===`starting`?`warning`:`neutral`}var $9=document.getElementById(`shed-root`);if(!$9)throw Error(`Shed root is missing`);mS().catch(e=>{console.error(`Shed terminal operation failed`,e)}),jle($9,{name:`Shed`,queryClient:Vle()},({app:e})=>(0,F.createElement)(NLe,{app:e}));