@fungi.computer/prints 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P={current:null},F={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function L(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.act=L,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=L,e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=l(d(),1),p=class extends Error{code;details;constructor(e,t,n){super(t),this.code=e,this.details=n,this.name=`WhistleActionError`}},m=class extends Error{constructor(){super(`Whistle runtime is closed`),this.name=`WhistleClosedError`}};function h(){let e=!1,t=ie,n=[],r=[],i=!1,a=[],o=new Set,s=()=>{for(let e of o)e()};return Object.freeze({close:()=>{e||(e=!0,n=[],a=[],r=[],t=ie,s(),o.clear())},contribute:t=>{if(C(t),e)throw new m;w(t,n),T(t,n);let r=Symbol(`whistle-contribution`);S(t)||(n=[...n,{contribution:E(t),generation:r}],i=!0,s());let a=!0;return V(o=>{if(!a||e)return;let c={...t,commands:o};C(c);let l=n.findIndex(e=>e.generation===r),u=n.filter(e=>e.generation!==r);w(c,u),T(c,u);let d=E(c);if(S(c)){if(l<0)return;n=u}else n=l<0?[...n,{contribution:d,generation:r}]:n.map(e=>e.generation===r?{contribution:d,generation:r}:e);i=!0,s()},()=>{a&&(a=!1,n.find(e=>e.generation===r)!==void 0&&(n=n.filter(e=>e.generation!==r),i=!0,s()))})},execute:async function t(r,i){if(r.trim().length===0)return{status:`invalid`};if(e)return{status:`closed`};let o=x(r,n);if(o===void 0)return{status:`missing`};let s;try{let e=oe(o);if(e.status===`unavailable`)return e;let n=a.at(-1)?.presenter;i.interaction===void 0&&n!==void 0&&g.has(i.origin)&&(s=n({commandId:r,title:o.title,retry:()=>{t(r,i)}}));let c={...i,signal:i.signal??new AbortController().signal};s!==void 0&&(c.interaction=s.interaction,c.signal=AbortSignal.any([c.signal,s.interaction.signal]));let l=await o.handler(c);return s?.settle({status:`handled`}),l===void 0?{status:`handled`}:{status:`handled`,result:l}}catch(e){let t=ce(e instanceof Error?e:Error(`Command handler threw a non-Error value`));return s?.settle(s.interaction.signal.aborted?{status:`cancelled`}:{status:`failed`,message:t.message}),{status:`failed`,error:t}}},present:t=>{let n={presenter:t};return e||(a=[...a,n]),()=>{a=a.filter(e=>e!==n)}},snapshot:()=>{if(e)return ie;let a=n.flatMap(e=>e.contribution.commands.map(oe));return(i||a.some((e,t)=>!se(e,r[t])))&&(t=le(n,a),r=a,i=!1),t},subscribe:t=>e?()=>void 0:(o.add(t),()=>{o.delete(t)})})}var g=new Set([`browser`,`keyboard`,`menu`,`palette`,`slash`,`terminal`]),_=16,v=32,y=64,b=256;function x(e,t){for(let n of t)for(let t of n.contribution.commands)if(`${n.contribution.namespace}:${t.id}`===e)return t}function S(e){return e.commands.length===0}function C(e){B(e.sourceId,`source ID`),B(e.namespace,`namespace`,!0),e.scope!==void 0&&B(e.scope,`scope`);for(let t of e.commands)R(t)}function w(e,t){t.find(t=>t.contribution.namespace===e.namespace&&t.contribution.sourceId!==e.sourceId)!==void 0&&H(`Namespace is already owned by another source`);let n=new Set,r=new Set;for(let i of t){let t=i.contribution.scope===e.scope;for(let e of i.contribution.commands)if(n.add(`${i.contribution.namespace}:${e.id}`),t)for(let t of e.projections?.slash?.aliases??[])r.add(t)}for(let t of e.commands){let i=`${e.namespace}:${t.id}`;n.has(i)&&H(`Canonical command ID is already registered`),n.add(i);for(let e of t.projections?.slash?.aliases??[])r.has(e)&&H(`Slash alias is already registered`),r.add(e)}}function T(e,t){t.length>=y&&H(`Live contribution capacity exceeded`),t.reduce((e,t)=>e+t.contribution.commands.length,0)+e.commands.length>b&&H(`Live command capacity exceeded`)}function E(e){let t={sourceId:e.sourceId,namespace:e.namespace,commands:e.commands.map(D)};return e.scope===void 0?t:{...t,scope:e.scope}}function D(e){let t={id:e.id,title:e.title,category:e.category,handler:e.handler};return e.description!==void 0&&(t.description=e.description),e.action!==void 0&&(t.action=O(e.action)),e.availability!==void 0&&(t.availability=e.availability),e.projections!==void 0&&(t.projections=M(e.projections)),t}function O(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=k(e.inputSchema)),e.outputSchema!==void 0&&(t.outputSchema=k(e.outputSchema)),e.presentation!==void 0&&(t.presentation=j(e.presentation)),Object.freeze(t)}function k(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,A(t)])))}function A(e){return Array.isArray(e)?Object.freeze(e.map(A)):e!==null&&e instanceof Object?Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,A(t)]))):e}function j(e){switch(e.type){case`action`:return Object.freeze({type:`action`});case`custom`:return Object.freeze({type:`custom`,data:k(e.data)});case`choice`:return Object.freeze({type:`choice`,options:Object.freeze(e.options.map(e=>Object.freeze({...e,value:A(e.value)})))});case`form`:return Object.freeze({...e});case`confirmation`:return Object.freeze({...e})}}function M(e){let t={};return e.bindings!==void 0&&(t.bindings=N(e.bindings)),e.agent!==void 0&&(t.agent=P(e.agent)),e.help!==void 0&&(t.help=F(e.help.order)),e.menu!==void 0&&(t.menu=F(e.menu.order)),e.palette!==void 0&&(t.palette=F(e.palette.order)),e.slash!==void 0&&(t.slash=I(e.slash)),t}function N(e){let t={values:[...e.values]};return e.order!==void 0&&(t.order=e.order),t}function P(e){let t={};return e.keybind!==void 0&&(t.keybind=e.keybind),e.order!==void 0&&(t.order=e.order),t}function F(e){let t={};return e!==void 0&&(t.order=e),t}function I(e){let t={aliases:[...e.aliases]};return e.order!==void 0&&(t.order=e.order),e.consumesDraft!==void 0&&(t.consumesDraft=e.consumesDraft),e.arguments!==void 0&&(t.arguments=L(e.arguments)),t}function L(e){let t={hint:e.hint};return e.words!==void 0&&(t.words=Object.freeze(e.words.map(e=>Object.freeze({...e,arguments:k(e.arguments)})))),e.text!==void 0&&(t.text=Object.freeze({...e.text,arguments:k(e.text.arguments)})),Object.freeze(t)}function R(e){B(e.id,`command ID`,!0),B(e.title,`title`),B(e.category,`category`),z(e.action),ee(e.projections)}function z(e){if(e?.presentation!==void 0)switch(e.presentation.type){case`action`:case`custom`:return;case`choice`:for(let t of e.presentation.options)B(t.label,`choice label`),t.description!==void 0&&B(t.description,`choice description`);return;case`form`:e.presentation.submitLabel!==void 0&&B(e.presentation.submitLabel,`submit label`);return;case`confirmation`:B(e.presentation.message,`confirmation message`),e.presentation.confirmLabel!==void 0&&B(e.presentation.confirmLabel,`confirmation label`),e.presentation.cancelLabel!==void 0&&B(e.presentation.cancelLabel,`cancellation label`)}}function ee(e){if(e!==void 0){for(let t of[e.bindings,e.palette,e.slash,e.help,e.menu,e.agent])t!==void 0&&re(t.order);if(e.bindings!==void 0&&ne(e.bindings.values,`binding`),e.slash!==void 0){ne(e.slash.aliases,`slash alias`);for(let t of e.slash.aliases)/\s/u.test(t)&&H(`slash alias must not contain whitespace`);te(e.slash.arguments)}e.agent?.keybind!==void 0&&B(e.agent.keybind,`agent keybind`)}}function te(e){if(e===void 0)return;B(e.hint,`argument hint`),e.words===void 0&&e.text===void 0&&H(`slash arguments need words or text`);let t=new Set;for(let n of e.words??[])B(n.word,`argument word`),/\s/u.test(n.word)&&H(`argument word must not contain whitespace`),t.has(n.word)&&H(`argument word is repeated`),t.add(n.word),n.description!==void 0&&B(n.description,`argument word description`);t.size>v&&H(`argument word count exceeds 32`),e.text!==void 0&&(B(e.text.field,`argument text field`),e.text.requestIdField!==void 0&&B(e.text.requestIdField,`request id field`))}function ne(e,t){e.length>_&&H(`${t} count exceeds 16`);for(let n of e)B(n,t)}function B(e,t,n=!1){e.trim().length===0&&H(`${t} must not be blank`),n&&e.includes(`:`)&&H(`${t} must not contain a colon`)}function re(e){e!==void 0&&!Number.isSafeInteger(e)&&H(`order must be a safe integer`)}function V(e=()=>void 0,t=()=>void 0){return Object.freeze({update:e,dispose:t})}function H(e){throw Error(e)}var ie=Object.freeze({bindings:Object.freeze([]),palette:Object.freeze([]),slash:Object.freeze([]),help:Object.freeze([]),menu:Object.freeze([]),agent:Object.freeze([])}),ae=Object.freeze({status:`available`});function oe(e){let t=e.availability?.()??ae;return t.status===`available`?ae:Object.freeze({status:`unavailable`,reason:t.reason})}function se(e,t){return e.status===`available`?t?.status===`available`:t?.status===`unavailable`&&e.reason===t.reason}function ce(e){if(e instanceof p){let t={code:e.code,message:e.message};return Object.freeze(e.details===void 0?t:{...t,details:A(e.details)})}return Object.freeze({code:`command_failed`,message:e.message})}function le(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=0;for(let l of e){let e=l.contribution;for(let l of e.commands){let u=l.projections,d=t[c++]??ae;if(u?.bindings!==void 0)for(let t of u.bindings.values)n.push({...he(e,l,u.bindings.order,d),binding:t});if(u?.palette!==void 0&&r.push({...he(e,l,u.palette.order,d)}),u?.slash!==void 0)for(let t of u.slash.aliases){let n={...he(e,l,u.slash.order,d),alias:t};u.slash.consumesDraft!==void 0&&(n={...n,consumesDraft:u.slash.consumesDraft}),u.slash.arguments!==void 0&&(n={...n,arguments:u.slash.arguments}),i.push(n)}u?.help!==void 0&&a.push({...he(e,l,u.help.order,d)}),u?.menu!==void 0&&o.push({...he(e,l,u.menu.order,d)}),u?.agent!==void 0&&s.push(_e(e,l,u.agent,d))}}return fe(n),pe(i),de(r),de(a),de(o),de(s),Object.freeze({bindings:me(n),palette:me(r),slash:me(i),help:me(a),menu:me(o),agent:me(s)})}var U=new TextEncoder;function ue(e,t){let n=U.encode(e),r=U.encode(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e+=1){let t=n[e]??0,i=r[e]??0;if(t!==i)return t<i?-1:1}return n.length<r.length?-1:+(n.length>r.length)}function de(e){e.sort((e,t)=>e.order-t.order||ue(e.commandId,t.commandId))}function fe(e){e.sort((e,t)=>e.order-t.order||ue(e.commandId,t.commandId)||ue(e.binding,t.binding))}function pe(e){e.sort((e,t)=>e.order-t.order||ue(e.commandId,t.commandId)||ue(e.alias,t.alias))}function me(e){return Object.freeze(e.map(e=>Object.freeze(e)))}function he(e,t,n,r){let i=ge(e,t,n,r);return e.scope===void 0?i:{...i,scope:e.scope}}function ge(e,t,n,r){let i={commandId:`${e.namespace}:${t.id}`,sourceId:e.sourceId,title:t.title,category:t.category,order:n??0,availability:r},a=t.description===void 0?i:{...i,description:t.description};return t.action===void 0?a:{...a,action:t.action}}function _e(e,t,n,r){let i=he(e,t,n.order,r),a=i.action===void 0?i:{...i,action:ve(i.action)};return n.keybind===void 0?a:{...a,keybind:n.keybind}}function ve(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=e.inputSchema),e.outputSchema!==void 0&&(t.outputSchema=e.outputSchema),Object.freeze(t)}var ye;function W(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var be=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},xe=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ye=globalThis).__zod_globalConfig??(ye.__zod_globalConfig={});var Se=globalThis.__zod_globalConfig;function Ce(e){return e&&Object.assign(Se,e),Se}function we(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Te(e,t){return typeof t==`bigint`?t.toString():t}function Ee(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function De(e){return e==null}function Oe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ke(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Ae=Symbol(`evaluating`);function je(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ae)return r===void 0&&(r=Ae,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ne(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Pe(e){return JSON.stringify(e)}function Fe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ie=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Le(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Re=Ee(()=>{if(Se.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ze(e){if(Le(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Le(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Be(e){return ze(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Ve=new Set([`string`,`number`,`symbol`]);function He(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ue(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function We(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Ge={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ke(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ue(e,Ne(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Me(this,`shape`,e),e},checks:[]}))}function qe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ue(e,Ne(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Me(this,`shape`,r),r},checks:[]}))}function Je(e,t){if(!ze(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Me(this,`shape`,n),n}}))}function Ye(e,t){if(!ze(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Me(this,`shape`,n),n}}))}function Xe(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Ue(e,Ne(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Me(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ze(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ue(t,Ne(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Me(this,`shape`,i),i},checks:[]}))}function Qe(e,t,n){return Ue(t,Ne(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Me(this,`shape`,i),i}}))}function $e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function et(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function tt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function nt(e){return typeof e==`string`?e:e?.message}function rt(e,t,n){let r=e.message?e.message:nt(e.inst?._zod.def?.error?.(e))??nt(t?.error?.(e))??nt(n.customError?.(e))??nt(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function it(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function at(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var ot=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Te,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},st=W(`$ZodError`,ot),ct=W(`$ZodError`,ot,{Parent:Error});function lt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ut(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var dt=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new be;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>rt(e,a,Ce())));throw Ie(t,i?.callee),t}return o.value},ft=dt(ct),pt=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>rt(e,a,Ce())));throw Ie(t,i?.callee),t}return o.value},mt=pt(ct),ht=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new be;return a.issues.length?{success:!1,error:new(e??st)(a.issues.map(e=>rt(e,i,Ce())))}:{success:!0,data:a.value}},gt=ht(ct),_t=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>rt(e,i,Ce())))}:{success:!0,data:a.value}},vt=_t(ct),yt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>(t,n,r)=>dt(e)(t,n,r),xt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return pt(e)(t,n,i)},St=e=>async(t,n,r)=>pt(e)(t,n,r),Ct=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ht(e)(t,n,i)},wt=e=>(t,n,r)=>ht(e)(t,n,r),Tt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _t(e)(t,n,i)},Et=e=>async(t,n,r)=>_t(e)(t,n,r),Dt=/^[cC][0-9a-z]{6,}$/,Ot=/^[0-9a-z]+$/,kt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,At=/^[0-9a-vA-V]{20}$/,jt=/^[A-Za-z0-9]{27}$/,Mt=/^[a-zA-Z0-9_-]{21}$/,Nt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Pt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ft=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,It=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Rt(){return new RegExp(Lt,`u`)}var zt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Vt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ht=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ut=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wt=/^[A-Za-z0-9_-]*$/,Gt=/^https?$/,Kt=/^\+[1-9]\d{6,14}$/,qt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Jt=RegExp(`^${qt}$`);function Yt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Xt(e){return RegExp(`^${Yt(e)}$`)}function Zt(e){let t=Yt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${qt}T(?:${r})$`)}var Qt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},$t=/^-?\d+$/,en=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,nn=/^null$/i,rn=/^[^A-Z]*$/,an=/^[^a-z]*$/,on=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sn={number:`number`,bigint:`bigint`,object:`date`},cn=W(`$ZodCheckLessThan`,(e,t)=>{on.init(e,t);let n=sn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ln=W(`$ZodCheckGreaterThan`,(e,t)=>{on.init(e,t);let n=sn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),un=W(`$ZodCheckMultipleOf`,(e,t)=>{on.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ke(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dn=W(`$ZodCheckNumberFormat`,(e,t)=>{on.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ge[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=$t)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),fn=W(`$ZodCheckMaxLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!De(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=it(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pn=W(`$ZodCheckMinLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!De(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=it(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mn=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!De(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=it(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),hn=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;on.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gn=W(`$ZodCheckRegex`,(e,t)=>{hn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_n=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=rn,hn.init(e,t)}),vn=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=an,hn.init(e,t)}),yn=W(`$ZodCheckIncludes`,(e,t)=>{on.init(e,t);let n=He(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),bn=W(`$ZodCheckStartsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`^${He(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),xn=W(`$ZodCheckEndsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`.*${He(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Sn=W(`$ZodCheckOverwrite`,(e,t)=>{on.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Cn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
-
`))}},wn={major:4,minor:4,patch:3},Tn=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=$e(e),i;for(let a of t){if(a._zod.def.when){if(et(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new be;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=$e(e,t))});else{if(e.issues.length===t)continue;r||=$e(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if($e(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new be;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new be;return o.then(e=>t(e,r,a))}return t(o,r,a)}}je(e,`~standard`,()=>({validate:t=>{try{let n=gt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return vt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),En=W(`$ZodString`,(e,t)=>{Tn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Dn=W(`$ZodStringFormat`,(e,t)=>{hn.init(e,t),En.init(e,t)}),On=W(`$ZodGUID`,(e,t)=>{t.pattern??=Pt,Dn.init(e,t)}),kn=W(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ft(e)}else t.pattern??=Ft();Dn.init(e,t)}),An=W(`$ZodEmail`,(e,t)=>{t.pattern??=It,Dn.init(e,t)}),jn=W(`$ZodURL`,(e,t)=>{Dn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Gt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Mn=W(`$ZodEmoji`,(e,t)=>{t.pattern??=Rt(),Dn.init(e,t)}),Nn=W(`$ZodNanoID`,(e,t)=>{t.pattern??=Mt,Dn.init(e,t)}),Pn=W(`$ZodCUID`,(e,t)=>{t.pattern??=Dt,Dn.init(e,t)}),Fn=W(`$ZodCUID2`,(e,t)=>{t.pattern??=Ot,Dn.init(e,t)}),In=W(`$ZodULID`,(e,t)=>{t.pattern??=kt,Dn.init(e,t)}),Ln=W(`$ZodXID`,(e,t)=>{t.pattern??=At,Dn.init(e,t)}),Rn=W(`$ZodKSUID`,(e,t)=>{t.pattern??=jt,Dn.init(e,t)}),zn=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=Zt(t),Dn.init(e,t)}),Bn=W(`$ZodISODate`,(e,t)=>{t.pattern??=Jt,Dn.init(e,t)}),Vn=W(`$ZodISOTime`,(e,t)=>{t.pattern??=Xt(t),Dn.init(e,t)}),Hn=W(`$ZodISODuration`,(e,t)=>{t.pattern??=Nt,Dn.init(e,t)}),Un=W(`$ZodIPv4`,(e,t)=>{t.pattern??=zt,Dn.init(e,t),e._zod.bag.format=`ipv4`}),Wn=W(`$ZodIPv6`,(e,t)=>{t.pattern??=Bt,Dn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Gn=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Vt,Dn.init(e,t)}),Kn=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ht,Dn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function qn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Jn=W(`$ZodBase64`,(e,t)=>{t.pattern??=Ut,Dn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{qn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Yn(e){if(!Wt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return qn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Xn=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=Wt,Dn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Yn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Zn=W(`$ZodE164`,(e,t)=>{t.pattern??=Kt,Dn.init(e,t)});function Qn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var $n=W(`$ZodJWT`,(e,t)=>{Dn.init(e,t),e._zod.check=n=>{Qn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),er=W(`$ZodNumber`,(e,t)=>{Tn.init(e,t),e._zod.pattern=e._zod.bag.pattern??en,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),tr=W(`$ZodNumberFormat`,(e,t)=>{dn.init(e,t),er.init(e,t)}),nr=W(`$ZodBoolean`,(e,t)=>{Tn.init(e,t),e._zod.pattern=tn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),rr=W(`$ZodNull`,(e,t)=>{Tn.init(e,t),e._zod.pattern=nn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),ir=W(`$ZodUnknown`,(e,t)=>{Tn.init(e,t),e._zod.parse=e=>e}),ar=W(`$ZodNever`,(e,t)=>{Tn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),or=W(`$ZodVoid`,(e,t)=>{Tn.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}});function sr(e,t,n){e.issues.length&&t.issues.push(...tt(n,e.issues)),t.value[n]=e.value}var cr=W(`$ZodArray`,(e,t)=>{Tn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>sr(t,n,e))):sr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function lr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...tt(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function ur(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=We(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function dr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>lr(e,n,i,t,u,d))):lr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var fr=W(`$ZodObject`,(e,t)=>{if(Tn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Ee(()=>ur(t));je(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Le,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>lr(n,t,e,s,r,i))):lr(a,t,e,s,r,i)}return i?dr(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),pr=W(`$ZodObjectJIT`,(e,t)=>{fr.init(e,t);let n=e._zod.parse,r=Ee(()=>ur(t)),i=e=>{let t=new Cn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Pe(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Pe(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
-
if (${n}.issues.length) {
|
|
5
|
-
if (${o} in input) {
|
|
6
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
-
...iss,
|
|
8
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
-
})));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (${n}.value === undefined) {
|
|
14
|
-
if (${o} in input) {
|
|
15
|
-
newResult[${o}] = undefined;
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
newResult[${o}] = ${n}.value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
`):c?t.write(`
|
|
22
|
-
if (${n}.issues.length) {
|
|
23
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
-
...iss,
|
|
25
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
-
})));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (${n}.value === undefined) {
|
|
30
|
-
if (${o} in input) {
|
|
31
|
-
newResult[${o}] = undefined;
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
newResult[${o}] = ${n}.value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
`):t.write(`
|
|
38
|
-
const ${n}_present = ${o} in input;
|
|
39
|
-
if (${n}.issues.length) {
|
|
40
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
-
...iss,
|
|
42
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
-
})));
|
|
44
|
-
}
|
|
45
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
-
payload.issues.push({
|
|
47
|
-
code: "invalid_type",
|
|
48
|
-
expected: "nonoptional",
|
|
49
|
-
input: undefined,
|
|
50
|
-
path: [${o}]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (${n}_present) {
|
|
55
|
-
if (${n}.value === undefined) {
|
|
56
|
-
newResult[${o}] = undefined;
|
|
57
|
-
} else {
|
|
58
|
-
newResult[${o}] = ${n}.value;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Le,s=!Se.jitless,c=s&&Re.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?dr([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function mr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!$e(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>rt(e,r,Ce())))}),t)}var hr=W(`$ZodUnion`,(e,t)=>{Tn.init(e,t),je(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),je(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),je(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),je(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Oe(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>mr(t,r,e,i)):mr(o,r,e,i)}}),gr=W(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,hr.init(e,t);let n=e._zod.parse;je(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Ee(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Le(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),_r=W(`$ZodIntersection`,(e,t)=>{Tn.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>yr(e,t,n)):yr(e,i,a)}});function vr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ze(e)&&ze(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=vr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=vr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yr(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),$e(e))return e;let o=vr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var br=W(`$ZodTuple`,(e,t)=>{Tn.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=xr(n,`optin`),c=xr(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Sr(t,r,e))):Sr(a,r,e)}}return o.length?Promise.all(o).then(()=>Cr(l,r,n,a,c)):Cr(l,r,n,a,c)}});function xr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Sr(e,t,n){e.issues.length&&t.issues.push(...tt(n,e.issues)),t.value[n]=e.value}function Cr(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...tt(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var wr=W(`$ZodRecord`,(e,t)=>{Tn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ze(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>rt(e,r,Ce())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...tt(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...tt(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&en.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>rt(e,r,Ce())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...tt(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...tt(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Tr=W(`$ZodEnum`,(e,t)=>{Tn.init(e,t);let n=we(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ve.has(typeof e)).map(e=>typeof e==`string`?He(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Er=W(`$ZodLiteral`,(e,t)=>{if(Tn.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?He(e):e?He(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Dr=W(`$ZodTransform`,(e,t)=>{Tn.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new xe(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new be;return n.value=i,n.fallback=!0,n}});function Or(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var kr=W(`$ZodOptional`,(e,t)=>{Tn.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,je(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),je(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Oe(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Or(e,r)):Or(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ar=W(`$ZodExactOptional`,(e,t)=>{kr.init(e,t),je(e._zod,`values`,()=>t.innerType._zod.values),je(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),jr=W(`$ZodNullable`,(e,t)=>{Tn.init(e,t),je(e._zod,`optin`,()=>t.innerType._zod.optin),je(e._zod,`optout`,()=>t.innerType._zod.optout),je(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Oe(e.source)}|null)$`):void 0}),je(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Mr=W(`$ZodDefault`,(e,t)=>{Tn.init(e,t),e._zod.optin=`optional`,je(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Nr(e,t)):Nr(r,t)}});function Nr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Pr=W(`$ZodPrefault`,(e,t)=>{Tn.init(e,t),e._zod.optin=`optional`,je(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Fr=W(`$ZodNonOptional`,(e,t)=>{Tn.init(e,t),je(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ir(t,e)):Ir(i,e)}});function Ir(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Lr=W(`$ZodCatch`,(e,t)=>{Tn.init(e,t),e._zod.optin=`optional`,je(e._zod,`optout`,()=>t.innerType._zod.optout),je(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>rt(e,n,Ce()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>rt(e,n,Ce()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Rr=W(`$ZodPipe`,(e,t)=>{Tn.init(e,t),je(e._zod,`values`,()=>t.in._zod.values),je(e._zod,`optin`,()=>t.in._zod.optin),je(e._zod,`optout`,()=>t.out._zod.optout),je(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>zr(e,t.in,n)):zr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>zr(e,t.out,n)):zr(r,t.out,n)}});function zr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Br=W(`$ZodReadonly`,(e,t)=>{Tn.init(e,t),je(e._zod,`propValues`,()=>t.innerType._zod.propValues),je(e._zod,`values`,()=>t.innerType._zod.values),je(e._zod,`optin`,()=>t.innerType?._zod?.optin),je(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Vr):Vr(r)}});function Vr(e){return e.value=Object.freeze(e.value),e}var Hr=W(`$ZodFunction`,(e,t)=>(Tn.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?ft(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?ft(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await mt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await mt(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new br({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Ur=W(`$ZodPromise`,(e,t)=>{Tn.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Wr=W(`$ZodLazy`,(e,t)=>{Tn.init(e,t),je(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),je(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),je(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),je(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),je(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Gr=W(`$ZodCustom`,(e,t)=>{on.init(e,t),Tn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Kr(t,n,r,e));Kr(i,n,r,e)}});function Kr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(at(e))}}var qr,Jr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Yr(){return new Jr}(qr=globalThis).__zod_globalRegistry??(qr.__zod_globalRegistry=Yr());var Xr=globalThis.__zod_globalRegistry;function Zr(e,t){return new e({type:`string`,...G(t)})}function Qr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...G(t)})}function $r(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...G(t)})}function ei(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...G(t)})}function ti(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...G(t)})}function ni(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...G(t)})}function ri(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...G(t)})}function ii(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...G(t)})}function ai(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...G(t)})}function oi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...G(t)})}function si(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...G(t)})}function ci(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...G(t)})}function li(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...G(t)})}function ui(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...G(t)})}function di(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...G(t)})}function fi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...G(t)})}function pi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...G(t)})}function mi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...G(t)})}function hi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...G(t)})}function gi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...G(t)})}function _i(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...G(t)})}function vi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...G(t)})}function yi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...G(t)})}function bi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...G(t)})}function xi(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...G(t)})}function Si(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...G(t)})}function Ci(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...G(t)})}function wi(e,t){return new e({type:`number`,checks:[],...G(t)})}function Ti(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...G(t)})}function Ei(e,t){return new e({type:`boolean`,...G(t)})}function Di(e,t){return new e({type:`null`,...G(t)})}function Oi(e){return new e({type:`unknown`})}function ki(e,t){return new e({type:`never`,...G(t)})}function Ai(e,t){return new e({type:`void`,...G(t)})}function ji(e,t){return new cn({check:`less_than`,...G(t),value:e,inclusive:!1})}function Mi(e,t){return new cn({check:`less_than`,...G(t),value:e,inclusive:!0})}function Ni(e,t){return new ln({check:`greater_than`,...G(t),value:e,inclusive:!1})}function Pi(e,t){return new ln({check:`greater_than`,...G(t),value:e,inclusive:!0})}function Fi(e,t){return new un({check:`multiple_of`,...G(t),value:e})}function Ii(e,t){return new fn({check:`max_length`,...G(t),maximum:e})}function Li(e,t){return new pn({check:`min_length`,...G(t),minimum:e})}function Ri(e,t){return new mn({check:`length_equals`,...G(t),length:e})}function zi(e,t){return new gn({check:`string_format`,format:`regex`,...G(t),pattern:e})}function Bi(e){return new _n({check:`string_format`,format:`lowercase`,...G(e)})}function Vi(e){return new vn({check:`string_format`,format:`uppercase`,...G(e)})}function Hi(e,t){return new yn({check:`string_format`,format:`includes`,...G(t),includes:e})}function Ui(e,t){return new bn({check:`string_format`,format:`starts_with`,...G(t),prefix:e})}function Wi(e,t){return new xn({check:`string_format`,format:`ends_with`,...G(t),suffix:e})}function Gi(e){return new Sn({check:`overwrite`,tx:e})}function Ki(e){return Gi(t=>t.normalize(e))}function qi(){return Gi(e=>e.trim())}function Ji(){return Gi(e=>e.toLowerCase())}function Yi(){return Gi(e=>e.toUpperCase())}function Xi(){return Gi(e=>Fe(e))}function Zi(e,t,n){return new e({type:`array`,element:t,...G(n)})}function Qi(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...G(n)})}function $i(e,t){let n=ea(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(at(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(at(r))}},e(t.value,t)),t);return n}function ea(e,t){let n=new on({check:`custom`,...G(t)});return n._zod.check=e,n}function ta(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Xr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function na(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,na(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&aa(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ra(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
-
|
|
64
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ia(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:sa(t,`input`,e.processors),output:sa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function aa(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return aa(r.element,n);if(r.type===`set`)return aa(r.valueType,n);if(r.type===`lazy`)return aa(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return aa(r.innerType,n);if(r.type===`intersection`)return aa(r.left,n)||aa(r.right,n);if(r.type===`record`||r.type===`map`)return aa(r.keyType,n)||aa(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:aa(r.in,n)||aa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(aa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(aa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(aa(e,n))return!0;return!!(r.rest&&aa(r.rest,n))}return!1}var oa=(e,t={})=>n=>{let r=ta({...n,processors:t});return na(e,r),ra(r,e),ia(r,e)},sa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ta({...i??{},target:a,io:t,processors:n});return na(e,o),ra(o,e),ia(o,e)},ca={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},la=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ca[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ua=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},da=(e,t,n,r)=>{n.type=`boolean`},fa=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},pa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ma=(e,t,n,r)=>{n.not={}},ha=(e,t,n,r)=>{let i=e._zod.def,a=we(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ga=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},_a=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},va=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},ya=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ba=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=na(a.element,t,{...r,path:[...r.path,`items`]})},xa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=na(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=na(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Sa=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>na(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ca=(e,t,n,r)=>{let i=e._zod.def,a=na(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=na(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},wa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>na(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?na(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Ta=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=na(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=na(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=na(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ea=(e,t,n,r)=>{let i=e._zod.def,a=na(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Da=(e,t,n,r)=>{let i=e._zod.def;na(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Oa=(e,t,n,r)=>{let i=e._zod.def;na(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ka=(e,t,n,r)=>{let i=e._zod.def;na(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Aa=(e,t,n,r)=>{let i=e._zod.def;na(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ja=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;na(o,t,r);let s=t.seen.get(e);s.ref=o},Ma=(e,t,n,r)=>{let i=e._zod.def;na(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Na=(e,t,n,r)=>{let i=e._zod.def;na(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Pa=(e,t,n,r)=>{let i=e._zod.def;na(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Fa=(e,t,n,r)=>{let i=e._zod.innerType;na(i,t,r);let a=t.seen.get(e);a.ref=i},Ia=W(`ZodISODateTime`,(e,t)=>{zn.init(e,t),lo.init(e,t)});function La(e){return bi(Ia,e)}var Ra=W(`ZodISODate`,(e,t)=>{Bn.init(e,t),lo.init(e,t)});function za(e){return xi(Ra,e)}var Ba=W(`ZodISOTime`,(e,t)=>{Vn.init(e,t),lo.init(e,t)});function Va(e){return Si(Ba,e)}var Ha=W(`ZodISODuration`,(e,t)=>{Hn.init(e,t),lo.init(e,t)});function Ua(e){return Ci(Ha,e)}var Wa=W(`ZodError`,(e,t)=>{st.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ut(e,t)},flatten:{value:t=>lt(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Te,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Te,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ga=dt(Wa),Ka=pt(Wa),qa=ht(Wa),Ja=_t(Wa),Ya=yt(Wa),Xa=bt(Wa),Za=xt(Wa),Qa=St(Wa),$a=Ct(Wa),eo=wt(Wa),to=Tt(Wa),no=Et(Wa),ro=new WeakMap;function io(e,t,n){let r=Object.getPrototypeOf(e),i=ro.get(r);if(i||(i=new Set,ro.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var ao=W(`ZodType`,(e,t)=>(Tn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:sa(e,`input`),output:sa(e,`output`)}}),e.toJSONSchema=oa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Ga(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qa(e,t,n),e.parseAsync=async(t,n)=>Ka(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ja(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ya(e,t,n),e.decode=(t,n)=>Xa(e,t,n),e.encodeAsync=async(t,n)=>Za(e,t,n),e.decodeAsync=async(t,n)=>Qa(e,t,n),e.safeEncode=(t,n)=>$a(e,t,n),e.safeDecode=(t,n)=>eo(e,t,n),e.safeEncodeAsync=async(t,n)=>to(e,t,n),e.safeDecodeAsync=async(t,n)=>no(e,t,n),io(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ne(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ue(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ls(e,t))},superRefine(e,t){return this.check(Rs(e,t))},overwrite(e){return this.check(Gi(e))},optional(){return ps(this)},exactOptional(){return hs(this)},nullable(){return _s(this)},nullish(){return ps(_s(this))},nonoptional(e){return Cs(this,e)},array(){return Ko(this)},or(e){return Zo([this,e])},and(e){return ts(this,e)},transform(e){return Ds(this,ds(e))},default(e){return ys(this,e)},prefault(e){return xs(this,e)},catch(e){return Ts(this,e)},pipe(e){return Ds(this,e)},readonly(){return ks(this)},describe(e){let t=this.clone();return Xr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xr.get(this);let t=this.clone();return Xr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Xr.get(e)?.description},configurable:!0}),e)),oo=W(`_ZodString`,(e,t)=>{En.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>la(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,io(e,`_ZodString`,{regex(...e){return this.check(zi(...e))},includes(...e){return this.check(Hi(...e))},startsWith(...e){return this.check(Ui(...e))},endsWith(...e){return this.check(Wi(...e))},min(...e){return this.check(Li(...e))},max(...e){return this.check(Ii(...e))},length(...e){return this.check(Ri(...e))},nonempty(...e){return this.check(Li(1,...e))},lowercase(e){return this.check(Bi(e))},uppercase(e){return this.check(Vi(e))},trim(){return this.check(qi())},normalize(...e){return this.check(Ki(...e))},toLowerCase(){return this.check(Ji())},toUpperCase(){return this.check(Yi())},slugify(){return this.check(Xi())}})}),so=W(`ZodString`,(e,t)=>{En.init(e,t),oo.init(e,t),e.email=t=>e.check(Qr(uo,t)),e.url=t=>e.check(ii(mo,t)),e.jwt=t=>e.check(yi(Ao,t)),e.emoji=t=>e.check(ai(go,t)),e.guid=t=>e.check($r(fo,t)),e.uuid=t=>e.check(ei(po,t)),e.uuidv4=t=>e.check(ti(po,t)),e.uuidv6=t=>e.check(ni(po,t)),e.uuidv7=t=>e.check(ri(po,t)),e.nanoid=t=>e.check(oi(_o,t)),e.guid=t=>e.check($r(fo,t)),e.cuid=t=>e.check(si(vo,t)),e.cuid2=t=>e.check(ci(yo,t)),e.ulid=t=>e.check(li(bo,t)),e.base64=t=>e.check(gi(Do,t)),e.base64url=t=>e.check(_i(Oo,t)),e.xid=t=>e.check(ui(xo,t)),e.ksuid=t=>e.check(di(So,t)),e.ipv4=t=>e.check(fi(Co,t)),e.ipv6=t=>e.check(pi(wo,t)),e.cidrv4=t=>e.check(mi(To,t)),e.cidrv6=t=>e.check(hi(Eo,t)),e.e164=t=>e.check(vi(ko,t)),e.datetime=t=>e.check(La(t)),e.date=t=>e.check(za(t)),e.time=t=>e.check(Va(t)),e.duration=t=>e.check(Ua(t))});function co(e){return Zr(so,e)}var lo=W(`ZodStringFormat`,(e,t)=>{Dn.init(e,t),oo.init(e,t)}),uo=W(`ZodEmail`,(e,t)=>{An.init(e,t),lo.init(e,t)}),fo=W(`ZodGUID`,(e,t)=>{On.init(e,t),lo.init(e,t)}),po=W(`ZodUUID`,(e,t)=>{kn.init(e,t),lo.init(e,t)}),mo=W(`ZodURL`,(e,t)=>{jn.init(e,t),lo.init(e,t)});function ho(e){return ii(mo,e)}var go=W(`ZodEmoji`,(e,t)=>{Mn.init(e,t),lo.init(e,t)}),_o=W(`ZodNanoID`,(e,t)=>{Nn.init(e,t),lo.init(e,t)}),vo=W(`ZodCUID`,(e,t)=>{Pn.init(e,t),lo.init(e,t)}),yo=W(`ZodCUID2`,(e,t)=>{Fn.init(e,t),lo.init(e,t)}),bo=W(`ZodULID`,(e,t)=>{In.init(e,t),lo.init(e,t)}),xo=W(`ZodXID`,(e,t)=>{Ln.init(e,t),lo.init(e,t)}),So=W(`ZodKSUID`,(e,t)=>{Rn.init(e,t),lo.init(e,t)}),Co=W(`ZodIPv4`,(e,t)=>{Un.init(e,t),lo.init(e,t)}),wo=W(`ZodIPv6`,(e,t)=>{Wn.init(e,t),lo.init(e,t)}),To=W(`ZodCIDRv4`,(e,t)=>{Gn.init(e,t),lo.init(e,t)}),Eo=W(`ZodCIDRv6`,(e,t)=>{Kn.init(e,t),lo.init(e,t)}),Do=W(`ZodBase64`,(e,t)=>{Jn.init(e,t),lo.init(e,t)}),Oo=W(`ZodBase64URL`,(e,t)=>{Xn.init(e,t),lo.init(e,t)}),ko=W(`ZodE164`,(e,t)=>{Zn.init(e,t),lo.init(e,t)}),Ao=W(`ZodJWT`,(e,t)=>{$n.init(e,t),lo.init(e,t)}),jo=W(`ZodNumber`,(e,t)=>{er.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ua(e,t,n,r),io(e,`ZodNumber`,{gt(e,t){return this.check(Ni(e,t))},gte(e,t){return this.check(Pi(e,t))},min(e,t){return this.check(Pi(e,t))},lt(e,t){return this.check(ji(e,t))},lte(e,t){return this.check(Mi(e,t))},max(e,t){return this.check(Mi(e,t))},int(e){return this.check(Po(e))},safe(e){return this.check(Po(e))},positive(e){return this.check(Ni(0,e))},nonnegative(e){return this.check(Pi(0,e))},negative(e){return this.check(ji(0,e))},nonpositive(e){return this.check(Mi(0,e))},multipleOf(e,t){return this.check(Fi(e,t))},step(e,t){return this.check(Fi(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Mo(e){return wi(jo,e)}var No=W(`ZodNumberFormat`,(e,t)=>{tr.init(e,t),jo.init(e,t)});function Po(e){return Ti(No,e)}var Fo=W(`ZodBoolean`,(e,t)=>{nr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>da(e,t,n,r)});function Io(e){return Ei(Fo,e)}var Lo=W(`ZodNull`,(e,t)=>{rr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fa(e,t,n,r)});function Ro(e){return Di(Lo,e)}var zo=W(`ZodUnknown`,(e,t)=>{ir.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Bo(){return Oi(zo)}var Vo=W(`ZodNever`,(e,t)=>{ar.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ma(e,t,n,r)});function Ho(e){return ki(Vo,e)}var Uo=W(`ZodVoid`,(e,t)=>{or.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pa(e,t,n,r)});function Wo(e){return Ai(Uo,e)}var Go=W(`ZodArray`,(e,t)=>{cr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(e,t,n,r),e.element=t.element,io(e,`ZodArray`,{min(e,t){return this.check(Li(e,t))},nonempty(e){return this.check(Li(1,e))},max(e,t){return this.check(Ii(e,t))},length(e,t){return this.check(Ri(e,t))},unwrap(){return this.element}})});function Ko(e,t){return Zi(Go,e,t)}var qo=W(`ZodObject`,(e,t)=>{pr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r),je(e,`shape`,()=>t.shape),io(e,`ZodObject`,{keyof(){return ss(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Bo()})},loose(){return this.clone({...this._zod.def,catchall:Bo()})},strict(){return this.clone({...this._zod.def,catchall:Ho()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Je(this,e)},safeExtend(e){return Ye(this,e)},merge(e){return Xe(this,e)},pick(e){return Ke(this,e)},omit(e){return qe(this,e)},partial(...e){return Ze(fs,this,e[0])},required(...e){return Qe(Ss,this,e[0])}})});function Jo(e,t){return new qo({type:`object`,shape:e??{},...G(t)})}function Yo(e,t){return new qo({type:`object`,shape:e,catchall:Ho(),...G(t)})}var Xo=W(`ZodUnion`,(e,t)=>{hr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),e.options=t.options});function Zo(e,t){return new Xo({type:`union`,options:e,...G(t)})}var Qo=W(`ZodDiscriminatedUnion`,(e,t)=>{Xo.init(e,t),gr.init(e,t)});function $o(e,t,n){return new Qo({type:`union`,options:t,discriminator:e,...G(n)})}var es=W(`ZodIntersection`,(e,t)=>{_r.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ca(e,t,n,r)});function ts(e,t){return new es({type:`intersection`,left:e,right:t})}var ns=W(`ZodTuple`,(e,t)=>{br.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wa(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function rs(e,t,n){let r=t instanceof Tn;return new ns({type:`tuple`,items:e,rest:r?t:null,...G(r?n:t)})}var is=W(`ZodRecord`,(e,t)=>{wr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ta(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function as(e,t,n){return!t||!t._zod?new is({type:`record`,keyType:co(),valueType:e,...G(t)}):new is({type:`record`,keyType:e,valueType:t,...G(n)})}var os=W(`ZodEnum`,(e,t)=>{Tr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new os({...t,checks:[],...G(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new os({...t,checks:[],...G(r),entries:i})}});function ss(e,t){return new os({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...G(t)})}var cs=W(`ZodLiteral`,(e,t)=>{Er.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ls(e,t){return new cs({type:`literal`,values:Array.isArray(e)?e:[e],...G(t)})}var us=W(`ZodTransform`,(e,t)=>{Dr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new xe(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(at(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(at(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function ds(e){return new us({type:`transform`,transform:e})}var fs=W(`ZodOptional`,(e,t)=>{kr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ps(e){return new fs({type:`optional`,innerType:e})}var ms=W(`ZodExactOptional`,(e,t)=>{Ar.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hs(e){return new ms({type:`optional`,innerType:e})}var gs=W(`ZodNullable`,(e,t)=>{jr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _s(e){return new gs({type:`nullable`,innerType:e})}var vs=W(`ZodDefault`,(e,t)=>{Mr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ys(e,t){return new vs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Be(t)}})}var bs=W(`ZodPrefault`,(e,t)=>{Pr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ka(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xs(e,t){return new bs({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Be(t)}})}var Ss=W(`ZodNonOptional`,(e,t)=>{Fr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e,t){return new Ss({type:`nonoptional`,innerType:e,...G(t)})}var ws=W(`ZodCatch`,(e,t)=>{Lr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ts(e,t){return new ws({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Es=W(`ZodPipe`,(e,t)=>{Rr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ja(e,t,n,r),e.in=t.in,e.out=t.out});function Ds(e,t){return new Es({type:`pipe`,in:e,out:t})}var Os=W(`ZodReadonly`,(e,t)=>{Br.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new Os({type:`readonly`,innerType:e})}var As=W(`ZodLazy`,(e,t)=>{Wr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fa(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function js(e){return new As({type:`lazy`,getter:e})}var Ms=W(`ZodPromise`,(e,t)=>{Ur.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Na(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e){return new Ms({type:`promise`,innerType:e})}var Ps=W(`ZodFunction`,(e,t)=>{Hr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r)});function Fs(e){return new Ps({type:`function`,input:Array.isArray(e?.input)?rs(e?.input):e?.input??Ko(Bo()),output:e?.output??Bo()})}var Is=W(`ZodCustom`,(e,t)=>{Gr.init(e,t),ao.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r)});function Ls(e,t={}){return Qi(Is,e,t)}function Rs(e,t){return $i(e,t)}function zs(e,t={}){let n=new Is({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...G(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Bs(e){let t=js(()=>Zo([co(e),Mo(),Io(),Ro(),Ko(t),as(co(),t)]));return t}var Vs=Bs(),Hs=js(()=>$o(`status`,[Jo({status:ls(`available`)}).strict(),Jo({status:ls(`unavailable`),reason:co()}).strict()])),Us=Vs,Ws=js(()=>as(co(),Us)),Gs=e=>Us.parse(e),Ks=js(()=>Jo({code:co().min(1).max(160),message:co().min(1).max(512),details:Us.optional()}).strict()),qs=e=>Ks.parse(e),Js=Ws,Ys=js(()=>co().refine(e=>e.trim().length>0)),Xs=Hs,Zs=js(()=>Zo([Jo({type:ls(`action`)}).strict(),Jo({type:ls(`custom`),data:Ws}).strict(),Jo({type:ls(`choice`),options:Ko(Jo({value:Us,label:Ys,description:Ys.optional()}))}).strict(),Jo({type:ls(`form`),submitLabel:Ys.optional()}).strict(),Jo({type:ls(`confirmation`),message:Ys,confirmLabel:Ys.optional(),cancelLabel:Ys.optional()}).strict()])),Qs=js(()=>Jo({inputSchema:Js.optional(),outputSchema:Js.optional(),presentation:Zs.optional()}).strict()),$s=js(()=>Mo().int().refine(e=>Number.isSafeInteger(e))),ec=js(()=>Jo({hint:Ys.pipe(co().max(120)),words:Ko(Jo({word:co().regex(/^\S{1,64}$/u),description:Ys.pipe(co().max(512)).optional(),arguments:Ws}).strict()).max(32).optional(),text:Jo({field:Ys.pipe(co().max(120)),arguments:Ws,requestIdField:Ys.pipe(co().max(120)).optional()}).strict().optional()}).strict().refine(e=>e.words!==void 0||e.text!==void 0,`slash arguments need words or text`)),tc=js(()=>Jo({order:$s.optional()}).strict()),nc=js(()=>Jo({bindings:Jo({order:$s.optional(),values:Ko(Ys).max(16)}).strict().optional(),agent:Jo({keybind:Ys.optional(),order:$s.optional()}).strict().optional(),help:tc.optional(),menu:tc.optional(),palette:tc.optional(),slash:Jo({aliases:Ko(Ys).max(16),consumesDraft:Io().optional(),order:$s.optional(),arguments:ec.optional()}).strict().optional()}).strict()),rc=js(()=>Jo({id:Ys.refine(e=>!e.includes(`:`)),title:Ys,category:Ys,description:Ys.optional(),projections:nc.optional(),action:Qs.optional(),availability:Xs.optional()}).strict()),ic=e=>rc.parse(e),ac=js(()=>Jo({inputSchema:Js.optional(),outputSchema:Js.optional()}).strict());js(()=>Jo({commandId:co(),sourceId:co(),scope:co().optional(),title:co(),category:co(),description:co().optional(),order:Mo(),availability:Hs,action:ac.optional(),keybind:co().optional()}).strict());var oc=Ys.pipe(co().max(8192)),sc=ho({protocol:/^https?$/u});$o(`type`,[Jo({type:ls(`choice`),message:oc,collapsedGroup:oc.optional(),options:Ko(Jo({value:oc,label:oc,description:oc.optional(),group:oc.optional()}).strict()).min(1).max(256)}).strict(),Jo({type:ls(`text`),message:oc,placeholder:oc.optional(),secret:Io().optional()}).strict(),Jo({type:ls(`confirmation`),message:oc,confirmLabel:oc.optional(),cancelLabel:oc.optional()}).strict()]),js(()=>$o(`type`,[Jo({type:ls(`info`),message:oc,links:Ko(Jo({url:sc,label:oc.optional()}).strict()).max(16).optional()}).strict(),Jo({type:ls(`progress`),message:oc}).strict(),Jo({type:ls(`handoff`),url:sc,code:oc.optional(),message:oc.optional()}).strict(),Jo({type:ls(`success`),message:oc}).strict()]));function cc(e,t){let n=!1,r=[];for(let i of t){let{availability:t,handler:a,...o}=i,s=a,c=t===void 0?o:{...o,availability:t()};e.register(c,async({arguments:e,origin:t,signal:n})=>{let r=await s(e===void 0?{origin:t,signal:n}:{arguments:e,origin:t,signal:n});return r===void 0?void 0:Gs(r)}).then(e=>{n?e():r.push(e)},e=>{console.warn(`App command ${i.id} was not registered`,e)})}return()=>{if(!n){n=!0;for(let e of r.splice(0))e()}}}var K=class extends Error{code;retryable;constructor(e,t){super(e,{cause:t.cause}),this.name=`AppError`,this.code=t.code,this.retryable=t.retryable}},lc={CANCELLED:{title:`Request cancelled`,message:`This request was cancelled.`},CAPABILITY_DENIED:{title:`Access needed`,message:`This App needs permission to do that.`,action:`grant`},CAPABILITY_REVOKED:{title:`Access changed`,message:`This App no longer has permission to do that.`,action:`grant`},COMMAND_NOT_DECLARED:{title:`Action unavailable`,message:`This action isn't available in this App.`},CONFLICT:{title:`File changed`,message:`This file changed elsewhere. Review it before saving again.`},DISCONNECTED:{title:`Connection lost`,message:`Reopen the App to connect again.`,action:`reconnect`},HOST_FAILURE:{title:`Couldn't complete the request`,message:`The service couldn't complete this request.`},FILE_TOO_LARGE:{title:`File too large`,message:`Choose a file within the supported size limit.`},IDENTITY:{title:`Couldn't connect`,message:`Reopen the App to connect again.`,action:`reconnect`},INSUFFICIENT_CREDIT:{title:`Something went wrong`,message:`The App couldn't complete this request.`,action:`billing`},INVALID_ARGUMENT:{title:`Request not accepted`,message:`The App couldn't use the details in this request.`},PROTOCOL:{title:`Couldn't read the response`,message:`The App received a response it couldn't use.`},SAFETY_FILTER_REFUSED:{title:`Safety filter refused this prompt`,message:`The model's safety filter refused this prompt — try rewording.`},SELECTION_CHANGED:{title:`Selection changed`,message:`The selection changed during this request. Reopen the App to continue.`,action:`reconnect`},TIMEOUT:{title:`Still waiting`,message:`The request didn't respond in time. Its outcome isn't known yet.`},UNKNOWN:{title:`Something went wrong`,message:`The App couldn't complete this request.`}};function uc(e,t){if(!(e instanceof K))return{...lc.UNKNOWN,retryable:!1};let n=lc[e.code],r=t?.[e.code]??n,i=n.action??(e.retryable?`retry`:void 0),a={title:r.title,message:r.message,retryable:e.retryable};return i?{...a,action:i}:a}ss(`light.dark.latte.mocha.readout.readout-night.field-guide.field-guide-night.embed.embed-dark.phosphor.codec.paper.ember.tide.tape.sunrise.pirate-radio.pirate-radio-night.consulting.consulting-ink.consulting-night.consulting-night-ink.consulting-riso-latte.consulting-riso-latte-ink.consulting-riso-glomzy.consulting-riso-glomzy-ink.vishnu.coin.coin-night.chamfer`.split(`.`));var dc=`data-theme`;function fc(e){return e||(globalThis.document?.documentElement??null)}function pc(e){let t=e.trim();if(t.length===0)throw TypeError(`Theme must be a non-empty string`);return t}function mc(e,t){let n=pc(e),r=fc(t);r&&r.setAttribute(dc,n)}function hc(e){return fc(e)?.getAttribute(dc)??null}var q=o((e=>{var t=d(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),J=o(((e,t)=>{t.exports=q()}))(),gc=f.createContext(void 0),_c=e=>{let t=f.useContext(gc);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},vc=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(gc.Provider,{value:e,children:t})),yc={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},bc=new class{#e=yc;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function xc(e){setTimeout(e,0)}var Sc=typeof window>`u`||`Deno`in globalThis;function Cc(){}function wc(e,t){return typeof e==`function`?e(t):e}function Tc(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ec(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dc(e,t){return typeof e==`function`?e(t):e}function Oc(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ac(o,t.options))return!1}else if(!Mc(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function kc(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(jc(t.options.mutationKey)!==jc(a))return!1}else if(!Mc(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ac(e,t){return(t?.queryKeyHashFn||jc)(e)}function jc(e){return JSON.stringify(e,(e,t)=>Lc(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Mc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Mc(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Mc(e[r],t[r]))return!1;return!0}return!1}var Nc=Object.prototype.hasOwnProperty;function Pc(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ic(e)&&Ic(t);if(!r&&!(Lc(e)&&Lc(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Nc.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Pc(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Fc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Ic(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lc(e){if(!Rc(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Rc(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Rc(e){return Object.prototype.toString.call(e)===`[object Object]`}function zc(e){return new Promise(t=>{bc.setTimeout(t,e)})}function Bc(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Pc(e,t)}function Vc(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Hc(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uc=Symbol();function Wc(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Uc?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gc(e,t){return typeof e==`function`?e(...t):!!e}function Kc(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var qc=()=>Sc,Jc=()=>qc(),Yc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Xc=new class extends Yc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Zc=xc;function Qc(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Zc,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var $c=Qc(),el=new class extends Yc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function tl(e){return Math.min(1e3*2**e,3e4)}function nl(e){return(e??`online`)!==`online`||el.isOnline()}var rl=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function il(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Cc);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new rl(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Xc.isFocused()&&(e.networkMode===`always`||el.isOnline())&&e.canRun(),p=()=>nl(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Jc()?0:3),a=e.retryDelay??tl,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),zc(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var al=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tc(this.gcTime)&&(this.#e=bc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jc()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(bc.clearTimeout(this.#e),this.#e=void 0)}};function ol(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Kc(e,()=>t.signal,()=>n=!0)},u=Wc(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Hc:Vc;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?cl:sl,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:sl(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function sl(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function cl(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ll(e,t){return t?sl(e,t)!=null:!1}function ul(e,t){return!t||!e.getPreviousPageParam?!1:cl(e,t)!=null}var dl=class extends al{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ml(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ml(this.options);e.data!==void 0&&(this.setState(pl(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Bc(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Cc).catch(Cc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Dc(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Dc(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ec(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Wc(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ol(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=il({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof rl&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof rl){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...fl(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...pl(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),$c.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function fl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nl(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function pl(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ml(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var hl=class extends Yc{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),_l(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vl(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vl(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Dc(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Fc(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&yl(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Dc(this.options.enabled,this.#t)!==Dc(t.enabled,this.#t)||Dc(this.options.staleTime,this.#t)!==Dc(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Dc(this.options.enabled,this.#t)!==Dc(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Fc(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Cc)),t}#h(e){return!Jc()&&Dc(this.options.enabled,this.#t)!==!1&&Tc(e)}#g(){this.#b();let e=Dc(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Ec(this.#r.dataUpdatedAt,e)+1;this.#u=bc.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=bc.setInterval(()=>{(this.options.refetchIntervalInBackground||Xc.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(bc.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(bc.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&_l(e,t),o=i&&yl(e,n,t,r);(a||o)&&(l={...l,...fl(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Bc(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Bc(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:bl(e,t),refetch:this.refetch,isEnabled:Dc(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Fc(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();$c.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function gl(e,t){return Dc(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Dc(t.retryOnMount,e)!==!1)}function _l(e,t){return gl(e,t)||e.state.data!==void 0&&vl(e,t,t.refetchOnMount)}function vl(e,t,n){if(Dc(t.enabled,e)!==!1&&Dc(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&bl(e,t)}return!1}function yl(e,t,n,r){return(e!==t||Dc(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&bl(e,n)}function bl(e,t){return Dc(t.enabled,e)!==!1&&e.isStaleByTime(Dc(t.staleTime,e))}var xl=class extends hl{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ll(t,n.data),hasPreviousPage:ul(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Sl=class extends al{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Cl(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=il({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),$c.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Cl(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var wl=class extends Yc{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Sl({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Tl(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Tl(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Tl(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Tl(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){$c.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kc(t,e))}findAll(e={}){return this.getAll().filter(t=>kc(e,t))}notify(e){$c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return $c.batch(()=>Promise.all(e.map(e=>e.continue().catch(Cc))))}};function Tl(e){return e.options.scope?.id}var El=class extends Yc{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Fc(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&jc(t.mutationKey)!==jc(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Cl();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){$c.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Dl(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Ol=class extends Yc{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,$c.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Fc(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Dl(e,n).forEach(e=>{e.destroy()}),Dl(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Pc(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new hl(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&$c.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},kl=class extends Yc{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Ac(r,t),a=this.get(i);return a||(a=new dl({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){$c.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Oc(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Oc(e,t)):t}notify(e){$c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){$c.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$c.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Al=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new kl,this.#t=e.mutationCache||new wl,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Xc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=el.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dc(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=wc(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return $c.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;$c.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return $c.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=$c.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Cc).catch(Cc)}invalidateQueries(e,t={}){return $c.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=$c.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Cc)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Cc)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Dc(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Dc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cc).catch(Cc)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cc).catch(Cc)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return el.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(jc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Mc(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(jc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Mc(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ac(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Uc&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},jl=f.createContext(!1),Ml=()=>f.useContext(jl);jl.Provider;function Nl(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Pl=f.createContext(Nl()),Fl=()=>f.useContext(Pl),Il=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Gc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ll=e=>{f.useEffect(()=>{e.clearReset()},[e])},Rl=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Gc(n,[e.error,r])),zl=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Bl=(e,t)=>e?.suspense&&t.isPending,Vl=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Hl({queries:e,...t},n){let r=_c(n),i=Ml(),a=Fl(),o=t.subscribed!==!1,s=f.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{zl(e);let t=r.getQueryCache().get(e.queryHash);Il(e,a,t)}),Ll(a);let[c]=f.useState(()=>new Ol(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),p=!i&&o;f.useSyncExternalStore(f.useCallback(e=>p?c.subscribe($c.batchCalls(e)):Cc,[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),f.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let m=l.some((e,t)=>Bl(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Bl(n,e)?Vl(n,new hl(r,n),a):[]}):[];if(m.length>0)throw Promise.all(m);let h=l.find((e,t)=>{let n=s[t];return n&&Rl({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(h)throw h.error;return u(d())}function Ul(e,t,n){let r=Ml(),i=Fl(),a=_c(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,zl(o),Il(o,i,s),Ll(i);let[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(f.useSyncExternalStore(f.useCallback(e=>{let t=d?l.subscribe($c.batchCalls(e)):Cc;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),Bl(o,u))throw Vl(o,l,i);if(Rl({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Wl(e,t){return Ul(e,hl,t)}function Gl(e){return e}function Kl(e){return e}function ql(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function Jl(e={},t){let n=_c(t).getMutationCache(),r=f.useRef(e),i=f.useRef(null);return i.current===null&&(i.current=ql(n,e)),f.useEffect(()=>{r.current=e}),f.useSyncExternalStore(f.useCallback(e=>n.subscribe(()=>{let t=Pc(i.current,ql(n,r.current));i.current!==t&&(i.current=t,$c.schedule(e))}),[n]),()=>i.current,()=>i.current)}function Yl(e,t){let n=_c(t),[r]=f.useState(()=>new El(n,e));f.useEffect(()=>{r.setOptions(e)},[r,e]);let i=f.useSyncExternalStore(f.useCallback(e=>r.subscribe($c.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=f.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Cc)},[r]);if(i.error&&Gc(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Xl(e){return e}function Zl(e,t){return Ul(e,xl,t)}var Ql=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),$l=o(((e,t)=>{t.exports=Ql()})),eu=o((e=>{var t=d(),n=$l();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function m(e){return l.call(p,e)?!0:l.call(f,e)?!1:u.test(e)?p[e]=!0:(f[e]=!0,!1)}function h(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function g(e,t,n,r){if(t==null||h(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var v={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){v[e]=new _(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];v[t]=new _(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){v[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){v[e]=new _(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){v[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){v[e]=new _(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){v[e]=new _(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){v[e]=new _(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){v[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new _(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function x(e,t,n,r){var i=v.hasOwnProperty(t)?v[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(g(t,n,i,r)&&(n=null),r||i===null?m(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var S=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,C=Symbol.for(`react.element`),w=Symbol.for(`react.portal`),T=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),D=Symbol.for(`react.profiler`),O=Symbol.for(`react.provider`),k=Symbol.for(`react.context`),A=Symbol.for(`react.forward_ref`),j=Symbol.for(`react.suspense`),M=Symbol.for(`react.suspense_list`),N=Symbol.for(`react.memo`),P=Symbol.for(`react.lazy`),F=Symbol.for(`react.offscreen`),I=Symbol.iterator;function L(e){return typeof e!=`object`||!e?null:(e=I&&e[I]||e[`@@iterator`],typeof e==`function`?e:null)}var R=Object.assign,z;function ee(e){if(z===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||``}return`
|
|
65
|
-
`+z+e}var te=!1;function ne(e,t){if(!e||te)return``;te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
66
|
-
`),a=r.stack.split(`
|
|
67
|
-
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
68
|
-
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{te=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ee(e):``}function B(e){switch(e.tag){case 5:return ee(e.type);case 16:return ee(`Lazy`);case 13:return ee(`Suspense`);case 19:return ee(`SuspenseList`);case 0:case 2:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return``}}function re(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case T:return`Fragment`;case w:return`Portal`;case D:return`Profiler`;case E:return`StrictMode`;case j:return`Suspense`;case M:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case k:return(e.displayName||`Context`)+`.Consumer`;case O:return(e._context.displayName||`Context`)+`.Provider`;case A:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case N:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case P:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}function V(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return re(t);case 8:return t===E?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function H(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ie(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ae(e){var t=ie(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oe(e){e._valueTracker||=ae(e)}function se(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ie(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function ce(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function le(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function U(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=H(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ue(e,t){t=t.checked,t!=null&&x(e,`checked`,t,!1)}function de(e,t){ue(e,t);var n=H(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?pe(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&pe(e,t.type,H(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fe(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function pe(e,t,n){(t!==`number`||ce(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var me=Array.isArray;function he(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+H(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ge(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return R({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function _e(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(me(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:H(n)}}function ve(e,t){var n=H(t.value),r=H(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function ye(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function W(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function be(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?W(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var xe,Se=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(xe||=document.createElement(`div`),xe.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=xe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ce(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var we={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Te=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(we).forEach(function(e){Te.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),we[t]=we[e]})});function Ee(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||we.hasOwnProperty(e)&&we[e]?(``+t).trim():t+`px`}function De(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ee(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Oe=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ke(e,t){if(t){if(Oe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Ae(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var je=null;function Me(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ne=null,Pe=null,Fe=null;function Ie(e){if(e=Ii(e)){if(typeof Ne!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ri(t),Ne(e.stateNode,e.type,t))}}function Le(e){Pe?Fe?Fe.push(e):Fe=[e]:Pe=e}function Re(){if(Pe){var e=Pe,t=Fe;if(Fe=Pe=null,Ie(e),t)for(e=0;e<t.length;e++)Ie(t[e])}}function ze(e,t){return e(t)}function Be(){}var Ve=!1;function He(e,t,n){if(Ve)return e(t,n);Ve=!0;try{return ze(e,t,n)}finally{Ve=!1,(Pe!==null||Fe!==null)&&(Be(),Re())}}function Ue(e,t){var n=e.stateNode;if(n===null)return null;var i=Ri(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var G=!1;if(c)try{var We={};Object.defineProperty(We,"passive",{get:function(){G=!0}}),window.addEventListener(`test`,We,We),window.removeEventListener(`test`,We,We)}catch{G=!1}function Ge(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Ke=!1,qe=null,Je=!1,Ye=null,Xe={onError:function(e){Ke=!0,qe=e}};function Ze(e,t,n,r,i,a,o,s,c){Ke=!1,qe=null,Ge.apply(Xe,arguments)}function Qe(e,t,n,i,a,o,s,c,l){if(Ze.apply(this,arguments),Ke){if(Ke){var u=qe;Ke=!1,qe=null}else throw Error(r(198));Je||(Je=!0,Ye=u)}}function $e(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function et(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function tt(e){if($e(e)!==e)throw Error(r(188))}function nt(e){var t=e.alternate;if(!t){if(t=$e(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return tt(a),e;if(o===i)return tt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function rt(e){return e=nt(e),e===null?null:it(e)}function it(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=it(e);if(t!==null)return t;e=e.sibling}return null}var at=n.unstable_scheduleCallback,ot=n.unstable_cancelCallback,st=n.unstable_shouldYield,ct=n.unstable_requestPaint,lt=n.unstable_now,ut=n.unstable_getCurrentPriorityLevel,dt=n.unstable_ImmediatePriority,ft=n.unstable_UserBlockingPriority,pt=n.unstable_NormalPriority,mt=n.unstable_LowPriority,ht=n.unstable_IdlePriority,gt=null,_t=null;function vt(e){if(_t&&typeof _t.onCommitFiberRoot==`function`)try{_t.onCommitFiberRoot(gt,e,void 0,(e.current.flags&128)==128)}catch{}}var yt=Math.clz32?Math.clz32:St,bt=Math.log,xt=Math.LN2;function St(e){return e>>>=0,e===0?32:31-(bt(e)/xt|0)|0}var Ct=64,wt=4194304;function Tt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Et(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Tt(a))):r=Tt(s)}else o=n&~i,o===0?a!==0&&(r=Tt(a)):r=Tt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-yt(t),i=1<<n,r|=e[n],t&=~i;return r}function Dt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ot(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-yt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function kt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function At(){var e=Ct;return Ct<<=1,!(Ct&4194240)&&(Ct=64),e}function jt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Mt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=n}function Nt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-yt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-yt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ft=0;function It(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Lt,Rt,zt,Bt,Vt,Ht=!1,Ut=[],Wt=null,Gt=null,Kt=null,qt=new Map,Jt=new Map,Yt=[],Xt=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function Zt(e,t){switch(e){case`focusin`:case`focusout`:Wt=null;break;case`dragenter`:case`dragleave`:Gt=null;break;case`mouseover`:case`mouseout`:Kt=null;break;case`pointerover`:case`pointerout`:qt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Jt.delete(t.pointerId)}}function Qt(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ii(t),t!==null&&Rt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function $t(e,t,n,r,i){switch(t){case`focusin`:return Wt=Qt(Wt,e,t,n,r,i),!0;case`dragenter`:return Gt=Qt(Gt,e,t,n,r,i),!0;case`mouseover`:return Kt=Qt(Kt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return qt.set(a,Qt(qt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Jt.set(a,Qt(Jt.get(a)||null,e,t,n,r,i)),!0}return!1}function en(e){var t=Fi(e.target);if(t!==null){var n=$e(t);if(n!==null){if(t=n.tag,t===13){if(t=et(n),t!==null){e.blockedOn=t,Vt(e.priority,function(){zt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);je=r,n.target.dispatchEvent(r),je=null}else return t=Ii(n),t!==null&&Rt(t),e.blockedOn=n,!1;t.shift()}return!0}function nn(e,t,n){tn(e)&&n.delete(t)}function rn(){Ht=!1,Wt!==null&&tn(Wt)&&(Wt=null),Gt!==null&&tn(Gt)&&(Gt=null),Kt!==null&&tn(Kt)&&(Kt=null),qt.forEach(nn),Jt.forEach(nn)}function an(e,t){e.blockedOn===t&&(e.blockedOn=null,Ht||(Ht=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,rn)))}function on(e){function t(t){return an(t,e)}if(0<Ut.length){an(Ut[0],e);for(var n=1;n<Ut.length;n++){var r=Ut[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Wt!==null&&an(Wt,e),Gt!==null&&an(Gt,e),Kt!==null&&an(Kt,e),qt.forEach(t),Jt.forEach(t),n=0;n<Yt.length;n++)r=Yt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Yt.length&&(n=Yt[0],n.blockedOn===null);)en(n),n.blockedOn===null&&Yt.shift()}var sn=S.ReactCurrentBatchConfig,cn=!0;function ln(e,t,n,r){var i=Ft,a=sn.transition;sn.transition=null;try{Ft=1,dn(e,t,n,r)}finally{Ft=i,sn.transition=a}}function un(e,t,n,r){var i=Ft,a=sn.transition;sn.transition=null;try{Ft=4,dn(e,t,n,r)}finally{Ft=i,sn.transition=a}}function dn(e,t,n,r){if(cn){var i=pn(e,t,n,r);if(i===null)si(e,t,r,fn,n),Zt(e,r);else if($t(i,e,t,n,r))r.stopPropagation();else if(Zt(e,r),t&4&&-1<Xt.indexOf(e)){for(;i!==null;){var a=Ii(i);if(a!==null&&Lt(a),a=pn(e,t,n,r),a===null&&si(e,t,r,fn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else si(e,t,r,null,n)}}var fn=null;function pn(e,t,n,r){if(fn=null,e=Me(r),e=Fi(e),e!==null){if(t=$e(e),t===null)e=null;else if(n=t.tag,n===13){if(e=et(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}return fn=e,null}function mn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(ut()){case dt:return 1;case ft:return 4;case pt:case mt:return 16;case ht:return 536870912;default:return 16}default:return 16}}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return _n=i.slice(e,1<r?1-r:void 0)}function yn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bn(){return!0}function xn(){return!1}function Sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?bn:xn,this.isPropagationStopped=xn,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=R({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=R({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Sn(An),Mn=Sn(R({},An,{dataTransfer:0})),Nn=Sn(R({},Tn,{relatedTarget:0})),Pn=Sn(R({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Sn(R({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Sn(R({},Cn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Sn(R({},Tn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Sn(R({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Sn(R({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Sn(R({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Sn(R({},An,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),qn=[9,13,27,32],Jn=c&&`CompositionEvent`in window,Yn=null;c&&`documentMode`in document&&(Yn=document.documentMode);var Xn=c&&`TextEvent`in window&&!Yn,Zn=c&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=vn(),_n=gn=hn=null,nr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){Le(r),t=li(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){ti(e,0)}function dr(e){if(se(Li(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(c){var mr;if(c){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,Me(e)),He(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(){for(var e=window,t=ce();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ce(e.document)}return t}function Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function jr(e){var t=kr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Or(n.ownerDocument.documentElement,n)){if(r!==null&&Ar(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Dr(n,a);var o=Dr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Mr=c&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==ce(r)||(r=Nr,`selectionStart`in r&&Ar(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Tr(Fr,r)||(Fr=r,r=li(Pr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};c&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionend`),qr=new Map,Jr=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function Yr(e,t){qr.set(e,t),o(t,[e])}for(var Xr=0;Xr<Jr.length;Xr++){var Zr=Jr[Xr];Yr(Zr.toLowerCase(),`on`+(Zr[0].toUpperCase()+Zr.slice(1)))}Yr(Ur,`onAnimationEnd`),Yr(Wr,`onAnimationIteration`),Yr(Gr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Kr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Qr=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),$r=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(Qr));function ei(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,Qe(r,t,void 0,e),e.currentTarget=null}function ti(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ei(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ei(i,s,l),a=c}}}if(Je)throw e=Ye,Je=!1,Ye=null,e}function ni(e,t){var n=t[Mi];n===void 0&&(n=t[Mi]=new Set);var r=e+`__bubble`;n.has(r)||(oi(t,e,2,!1),n.add(r))}function ri(e,t,n){var r=0;t&&(r|=4),oi(n,e,r,t)}var ii=`_reactListening`+Math.random().toString(36).slice(2);function ai(e){if(!e[ii]){e[ii]=!0,i.forEach(function(t){t!==`selectionchange`&&($r.has(t)||ri(t,!1,e),ri(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ii]||(t[ii]=!0,ri(`selectionchange`,!1,t))}}function oi(e,t,n,r){switch(mn(t)){case 1:var i=ln;break;case 4:i=un;break;default:i=dn}n=i.bind(null,t,n,e),i=void 0,!G||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function si(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Fi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}He(function(){var r=a,i=Me(n),o=[];a:{var s=qr.get(e);if(s!==void 0){var c=wn,l=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:c=Hn;break;case`focusin`:l=`focus`,c=Nn;break;case`focusout`:l=`blur`,c=Nn;break;case`beforeblur`:case`afterblur`:c=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Wn;break;case Ur:case Wr:case Gr:c=Pn;break;case Kr:c=Gn;break;case`scroll`:c=En;break;case`wheel`:c=Kn;break;case`copy`:case`cut`:case`paste`:c=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Un}var u=!!(t&4),d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Ue(p,f),h!=null&&u.push(ci(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==je&&(l=n.relatedTarget||n.fromElement)&&(Fi(l)||l[ji]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Fi(l):null,l!==null&&(d=$e(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=jn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Un,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Li(c),m=l==null?s:Li(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Fi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=ui(m))p++;for(m=0,h=f;h;h=ui(h))m++;for(;0<p-m;)u=ui(u),p--;for(;0<m-p;)f=ui(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=ui(u),f=ui(f)}u=null}else u=null;c!==null&&di(o,s,c,u,!1),l!==null&&d!==null&&di(o,d,l,u,!0)}}a:{if(s=r?Li(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=fr;else if(or(s)){if(pr)g=Sr;else{g=br;var _=yr}}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=xr);if(g&&=g(e,r)){sr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&pe(s,`number`,s.value)}switch(_=r?Li(r):window,e){case`focusin`:(or(_)||_.contentEditable===`true`)&&(Nr=_,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(o,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(o,n,i)}var v;if(Jn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else nr?er(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(Zn&&n.locale!==`ko`&&(nr||y!==`onCompositionStart`?y===`onCompositionEnd`&&nr&&(v=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,nr=!0)),_=li(r,y),0<_.length&&(y=new In(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=tr(n),v!==null&&(y.data=v)))),(v=Xn?rr(e,n):ir(e,n))&&(r=li(r,`onBeforeInput`),0<r.length&&(i=new In(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ti(o,t)})}function ci(e,t,n){return{instance:e,listener:t,currentTarget:n}}function li(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ue(e,n),a!=null&&r.unshift(ci(e,a,i)),a=Ue(e,t),a!=null&&r.push(ci(e,a,i))),e=e.return}return r}function ui(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function di(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Ue(n,a),c!=null&&o.unshift(ci(n,c,s))):i||(c=Ue(n,a),c!=null&&o.push(ci(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var fi=/\r\n?/g,pi=/\u0000|\uFFFD/g;function mi(e){return(typeof e==`string`?e:``+e).replace(fi,`
|
|
69
|
-
`).replace(pi,``)}function hi(e,t,n){if(t=mi(t),mi(e)!==t&&n)throw Error(r(425))}function gi(){}var _i=null,vi=null;function yi(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bi=typeof setTimeout==`function`?setTimeout:void 0,xi=typeof clearTimeout==`function`?clearTimeout:void 0,Si=typeof Promise==`function`?Promise:void 0,Ci=typeof queueMicrotask==`function`?queueMicrotask:Si===void 0?bi:function(e){return Si.resolve(null).then(e).catch(wi)};function wi(e){setTimeout(function(){throw e})}function Ti(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),on(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);on(t)}function Ei(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Di(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Oi=Math.random().toString(36).slice(2),ki=`__reactFiber$`+Oi,Ai=`__reactProps$`+Oi,ji=`__reactContainer$`+Oi,Mi=`__reactEvents$`+Oi,Ni=`__reactListeners$`+Oi,Pi=`__reactHandles$`+Oi;function Fi(e){var t=e[ki];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ji]||n[ki]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Di(e);e!==null;){if(n=e[ki])return n;e=Di(e)}return t}e=n,n=e.parentNode}return null}function Ii(e){return e=e[ki]||e[ji],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Li(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ri(e){return e[Ai]||null}var zi=[],Bi=-1;function Vi(e){return{current:e}}function Hi(e){0>Bi||(e.current=zi[Bi],zi[Bi]=null,Bi--)}function Ui(e,t){Bi++,zi[Bi]=e.current,e.current=t}var Wi={},Gi=Vi(Wi),Ki=Vi(!1),qi=Wi;function Ji(e,t){var n=e.type.contextTypes;if(!n)return Wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yi(e){return e=e.childContextTypes,e!=null}function Xi(){Hi(Ki),Hi(Gi)}function Zi(e,t,n){if(Gi.current!==Wi)throw Error(r(168));Ui(Gi,t),Ui(Ki,n)}function Qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,V(e)||`Unknown`,a));return R({},n,i)}function $i(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,qi=Gi.current,Ui(Gi,e),Ui(Ki,Ki.current),!0}function ea(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Qi(e,t,qi),i.__reactInternalMemoizedMergedChildContext=e,Hi(Ki),Hi(Gi),Ui(Gi,e)):Hi(Ki),Ui(Ki,n)}var ta=null,na=!1,ra=!1;function ia(e){ta===null?ta=[e]:ta.push(e)}function aa(e){na=!0,ia(e)}function oa(){if(!ra&&ta!==null){ra=!0;var e=0,t=Ft;try{var n=ta;for(Ft=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ta=null,na=!1}catch(t){throw ta!==null&&(ta=ta.slice(e+1)),at(dt,oa),t}finally{Ft=t,ra=!1}}return null}var sa=[],ca=0,la=null,ua=0,da=[],fa=0,pa=null,ma=1,ha=``;function ga(e,t){sa[ca++]=ua,sa[ca++]=la,la=e,ua=t}function _a(e,t,n){da[fa++]=ma,da[fa++]=ha,da[fa++]=pa,pa=e;var r=ma;e=ha;var i=32-yt(r)-1;r&=~(1<<i),n+=1;var a=32-yt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ma=1<<32-yt(t)+i|n<<i|r,ha=a+e}else ma=1<<a|n<<i|r,ha=e}function va(e){e.return!==null&&(ga(e,1),_a(e,1,0))}function ya(e){for(;e===la;)la=sa[--ca],sa[ca]=null,ua=sa[--ca],sa[ca]=null;for(;e===pa;)pa=da[--fa],da[fa]=null,ha=da[--fa],da[fa]=null,ma=da[--fa],da[fa]=null}var ba=null,xa=null,Sa=!1,Ca=null;function wa(e,t){var n=Xl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ta(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,ba=e,xa=Ei(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,ba=e,xa=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=pa===null?null:{id:ma,overflow:ha},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ba=e,xa=null,!0);default:return!1}}function Ea(e){return!!(e.mode&1)&&!(e.flags&128)}function Da(e){if(Sa){var t=xa;if(t){var n=t;if(!Ta(e,t)){if(Ea(e))throw Error(r(418));t=Ei(n.nextSibling);var i=ba;t&&Ta(e,t)?wa(i,n):(e.flags=e.flags&-4097|2,Sa=!1,ba=e)}}else{if(Ea(e))throw Error(r(418));e.flags=e.flags&-4097|2,Sa=!1,ba=e}}}function Oa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ba=e}function ka(e){if(e!==ba)return!1;if(!Sa)return Oa(e),Sa=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!yi(e.type,e.memoizedProps)),t&&=xa){if(Ea(e))throw Aa(),Error(r(418));for(;t;)wa(e,t),t=Ei(t.nextSibling)}if(Oa(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){xa=Ei(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}xa=null}}else xa=ba?Ei(e.stateNode.nextSibling):null;return!0}function Aa(){for(var e=xa;e;)e=Ei(e.nextSibling)}function ja(){xa=ba=null,Sa=!1}function Ma(e){Ca===null?Ca=[e]:Ca.push(e)}var Na=S.ReactCurrentBatchConfig;function Pa(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Fa(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ia(e){var t=e._init;return t(e._payload)}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=eu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=iu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===T?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===P&&Ia(i)===t.type)?(r=a(t,n.props),r.ref=Pa(e,t,n),r.return=e,r):(r=tu(n.type,n.key,n.props,null,e.mode,r),r.ref=Pa(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=au(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=nu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=iu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case C:return n=tu(t.type,t.key,t.props,null,e.mode,n),n.ref=Pa(e,null,t),n.return=e,n;case w:return t=au(t,e.mode,n),t.return=e,t;case P:var r=t._init;return f(e,r(t._payload),n)}if(me(t)||L(t))return t=nu(t,e.mode,n,null),t.return=e,t;Fa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case C:return n.key===i?l(e,t,n,r):null;case w:return n.key===i?u(e,t,n,r):null;case P:return i=n._init,p(e,t,i(n._payload),r)}if(me(n)||L(n))return i===null?d(e,t,n,r,null):null;Fa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case C:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case w:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case P:var a=r._init;return m(e,t,n,a(r._payload),i)}if(me(r)||L(r))return e=e.get(n)||null,d(t,e,r,i,null);Fa(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Sa&&ga(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Sa&&ga(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Sa&&ga(r,h),l}function g(a,s,c,l){var u=L(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Sa&&ga(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Sa&&ga(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Sa&&ga(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===T&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case C:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===T){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===P&&Ia(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Pa(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===T?(r=nu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=tu(i.type,i.key,i.props,null,e.mode,o),o.ref=Pa(e,r,i),o.return=e,e=o)}return s(e);case w:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=au(i,e.mode,o),r.return=e,e=r}return s(e);case P:return l=i._init,_(e,r,l(i._payload),o)}if(me(i))return h(e,r,i,o);if(L(i))return g(e,r,i,o);Fa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=iu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ra=La(!0),za=La(!1),Ba=Vi(null),Va=null,Ha=null,Ua=null;function Wa(){Ua=Ha=Va=null}function Ga(e){var t=Ba.current;Hi(Ba),e._currentValue=t}function Ka(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qa(e,t){Va=e,Ua=Ha=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ls=!0),e.firstContext=null)}function Ja(e){var t=e._currentValue;if(Ua!==e){if(e={context:e,memoizedValue:t,next:null},Ha===null){if(Va===null)throw Error(r(308));Ha=e,Va.dependencies={lanes:0,firstContext:e}}else Ha=Ha.next=e}return t}var Ya=null;function Xa(e){Ya===null?Ya=[e]:Ya.push(e)}function Za(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Xa(t)):(n.next=i.next,i.next=n),t.interleaved=n,Qa(e,r)}function Qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var $a=!1;function eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function to(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function no(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ro(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Xa(r)):(t.next=i.next,i.next=t),r.interleaved=t,Qa(e,n)}function io(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pt(e,n)}}function ao(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function oo(e,t,n,r){var i=e.updateQueue;$a=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:$a=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Qc|=o,e.lanes=o,e.memoizedState=d}}function so(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var co={},lo=Vi(co),uo=Vi(co),fo=Vi(co);function po(e){if(e===co)throw Error(r(174));return e}function mo(e,t){switch(Ui(fo,t),Ui(uo,e),Ui(lo,co),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:be(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=be(t,e)}Hi(lo),Ui(lo,t)}function ho(){Hi(lo),Hi(uo),Hi(fo)}function go(e){po(fo.current);var t=po(lo.current),n=be(t,e.type);t!==n&&(Ui(uo,e),Ui(lo,n))}function _o(e){uo.current===e&&(Hi(lo),Hi(uo))}var vo=Vi(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bo=[];function xo(){for(var e=0;e<bo.length;e++)bo[e]._workInProgressVersionPrimary=null;bo.length=0}var So=S.ReactCurrentDispatcher,Co=S.ReactCurrentBatchConfig,wo=0,To=null,Eo=null,Do=null,Oo=!1,ko=!1,Ao=0,jo=0;function Mo(){throw Error(r(321))}function No(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function Po(e,t,n,i,a,o){if(wo=o,To=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,So.current=e===null||e.memoizedState===null?_s:vs,e=n(i,a),ko){o=0;do{if(ko=!1,Ao=0,25<=o)throw Error(r(301));o+=1,Do=Eo=null,t.updateQueue=null,So.current=ys,e=n(i,a)}while(ko)}if(So.current=gs,t=Eo!==null&&Eo.next!==null,wo=0,Do=Eo=To=null,Oo=!1,t)throw Error(r(300));return e}function Fo(){var e=Ao!==0;return Ao=0,e}function Io(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Do===null?To.memoizedState=Do=e:Do=Do.next=e,Do}function Lo(){if(Eo===null){var e=To.alternate;e=e===null?null:e.memoizedState}else e=Eo.next;var t=Do===null?To.memoizedState:Do.next;if(t!==null)Do=t,Eo=e;else{if(e===null)throw Error(r(310));Eo=e,e={memoizedState:Eo.memoizedState,baseState:Eo.baseState,baseQueue:Eo.baseQueue,queue:Eo.queue,next:null},Do===null?To.memoizedState=Do=e:Do=Do.next=e}return Do}function Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){var t=Lo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Eo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((wo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,To.lanes|=d,Qc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,wr(i,t.memoizedState)||(Ls=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,To.lanes|=o,Qc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Bo(e){var t=Lo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);wr(o,t.memoizedState)||(Ls=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Vo(){}function Ho(e,t){var n=To,i=Lo(),a=t(),o=!wr(i.memoizedState,a);if(o&&(i.memoizedState=a,Ls=!0),i=i.queue,es(Go.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Do!==null&&Do.memoizedState.tag&1){if(n.flags|=2048,Yo(9,Wo.bind(null,n,i,a,t),void 0,null),Gc===null)throw Error(r(349));wo&30||Uo(n,t,a)}return a}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=To.updateQueue,t===null?(t={lastEffect:null,stores:null},To.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function qo(e){var t=Qa(e,1);t!==null&&vl(t,e,1,-1)}function Jo(e){var t=Io();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t.queue=e,e=e.dispatch=fs.bind(null,To,e),[t.memoizedState,e]}function Yo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=To.updateQueue,t===null?(t={lastEffect:null,stores:null},To.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Xo(){return Lo().memoizedState}function Zo(e,t,n,r){var i=Io();To.flags|=e,i.memoizedState=Yo(1|t,n,void 0,r===void 0?null:r)}function Qo(e,t,n,r){var i=Lo();r=r===void 0?null:r;var a=void 0;if(Eo!==null){var o=Eo.memoizedState;if(a=o.destroy,r!==null&&No(r,o.deps)){i.memoizedState=Yo(t,n,a,r);return}}To.flags|=e,i.memoizedState=Yo(1|t,n,a,r)}function $o(e,t){return Zo(8390656,8,e,t)}function es(e,t){return Qo(2048,8,e,t)}function ts(e,t){return Qo(4,2,e,t)}function ns(e,t){return Qo(4,4,e,t)}function rs(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function is(e,t,n){return n=n==null?null:n.concat([e]),Qo(4,4,rs.bind(null,t,e),n)}function as(){}function os(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&No(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ss(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&No(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function cs(e,t,n){return wo&21?(wr(n,t)||(n=At(),To.lanes|=n,Qc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ls=!0),e.memoizedState=n)}function ls(e,t){var n=Ft;Ft=n!==0&&4>n?n:4,e(!0);var r=Co.transition;Co.transition={};try{e(!1),t()}finally{Ft=n,Co.transition=r}}function us(){return Lo().memoizedState}function ds(e,t,n){var r=_l(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ps(e))ms(t,n);else if(n=Za(e,t,n,r),n!==null){var i=gl();vl(n,e,r,i),hs(n,t,r)}}function fs(e,t,n){var r=_l(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ps(e))ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o)){var c=t.interleaved;c===null?(i.next=i,Xa(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Za(e,t,i,r),n!==null&&(i=gl(),vl(n,e,r,i),hs(n,t,r))}}function ps(e){var t=e.alternate;return e===To||t!==null&&t===To}function ms(e,t){ko=Oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pt(e,n)}}var gs={readContext:Ja,useCallback:Mo,useContext:Mo,useEffect:Mo,useImperativeHandle:Mo,useInsertionEffect:Mo,useLayoutEffect:Mo,useMemo:Mo,useReducer:Mo,useRef:Mo,useState:Mo,useDebugValue:Mo,useDeferredValue:Mo,useTransition:Mo,useMutableSource:Mo,useSyncExternalStore:Mo,useId:Mo,unstable_isNewReconciler:!1},_s={readContext:Ja,useCallback:function(e,t){return Io().memoizedState=[e,t===void 0?null:t],e},useContext:Ja,useEffect:$o,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Zo(4194308,4,rs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zo(4,2,e,t)},useMemo:function(e,t){var n=Io();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Io();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ds.bind(null,To,e),[r.memoizedState,e]},useRef:function(e){var t=Io();return e={current:e},t.memoizedState=e},useState:Jo,useDebugValue:as,useDeferredValue:function(e){return Io().memoizedState=e},useTransition:function(){var e=Jo(!1),t=e[0];return e=ls.bind(null,e[1]),Io().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=To,a=Io();if(Sa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Gc===null)throw Error(r(349));wo&30||Uo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,$o(Go.bind(null,i,o,e),[e]),i.flags|=2048,Yo(9,Wo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Io(),t=Gc.identifierPrefix;if(Sa){var n=ha,r=ma;n=(r&~(1<<32-yt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Ao++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=jo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},vs={readContext:Ja,useCallback:os,useContext:Ja,useEffect:es,useImperativeHandle:is,useInsertionEffect:ts,useLayoutEffect:ns,useMemo:ss,useReducer:zo,useRef:Xo,useState:function(){return zo(Ro)},useDebugValue:as,useDeferredValue:function(e){return cs(Lo(),Eo.memoizedState,e)},useTransition:function(){return[zo(Ro)[0],Lo().memoizedState]},useMutableSource:Vo,useSyncExternalStore:Ho,useId:us,unstable_isNewReconciler:!1},ys={readContext:Ja,useCallback:os,useContext:Ja,useEffect:es,useImperativeHandle:is,useInsertionEffect:ts,useLayoutEffect:ns,useMemo:ss,useReducer:Bo,useRef:Xo,useState:function(){return Bo(Ro)},useDebugValue:as,useDeferredValue:function(e){var t=Lo();return Eo===null?t.memoizedState=e:cs(t,Eo.memoizedState,e)},useTransition:function(){return[Bo(Ro)[0],Lo().memoizedState]},useMutableSource:Vo,useSyncExternalStore:Ho,useId:us,unstable_isNewReconciler:!1};function bs(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function xs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:R({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ss={isMounted:function(e){return(e=e._reactInternals)?$e(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gl(),i=_l(e),a=no(r,i);a.payload=t,n!=null&&(a.callback=n),t=ro(e,a,i),t!==null&&(vl(t,e,i,r),io(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gl(),i=_l(e),a=no(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ro(e,a,i),t!==null&&(vl(t,e,i,r),io(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gl(),r=_l(e),i=no(n,r);i.tag=2,t!=null&&(i.callback=t),t=ro(e,i,r),t!==null&&(vl(t,e,r,n),io(t,e,r))}};function Cs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Tr(n,r)||!Tr(i,a):!0}function ws(e,t,n){var r=!1,i=Wi,a=t.contextType;return typeof a==`object`&&a?a=Ja(a):(i=Yi(t)?qi:Gi.current,r=t.contextTypes,a=(r=r!=null)?Ji(e,i):Wi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ss,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ts(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ss.enqueueReplaceState(t,t.state,null)}function Es(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},eo(e);var a=t.contextType;typeof a==`object`&&a?i.context=Ja(a):(a=Yi(t)?qi:Gi.current,i.context=Ji(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(xs(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Ss.enqueueReplaceState(i,i.state,null),oo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ds(e,t){try{var n=``,r=t;do n+=B(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
70
|
-
Error generating stack: `+e.message+`
|
|
71
|
-
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Os(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ks(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var As=typeof WeakMap==`function`?WeakMap:Map;function js(e,t,n){n=no(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ol||(ol=!0,sl=r),ks(e,t)},n}function Ms(e,t,n){n=no(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ks(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){ks(e,t),typeof r!=`function`&&(cl===null?cl=new Set([this]):cl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ns(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new As;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ul.bind(null,e,t,n),t.then(e,e))}function Ps(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Fs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=no(-1,1),t.tag=2,ro(n,t,1))),n.lanes|=1),e)}var Is=S.ReactCurrentOwner,Ls=!1;function Rs(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function zs(e,t,n,r,i){n=n.render;var a=t.ref;return qa(t,i),r=Po(e,t,n,r,a,i),n=Fo(),e!==null&&!Ls?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ac(e,t,i)):(Sa&&n&&va(t),t.flags|=1,Rs(e,t,r,i),t.child)}function Bs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Zl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Vs(e,t,a,r,i)):(e=tu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return ac(e,t,i)}return t.flags|=1,e=eu(a,r),e.ref=t.ref,e.return=t,t.child=e}function Vs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref){if(Ls=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ls=!0);else return t.lanes=e.lanes,ac(e,t,i)}}return Ws(e,t,n,r,i)}function Hs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ui(Yc,Jc),Jc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ui(Yc,Jc),Jc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ui(Yc,Jc),Jc|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ui(Yc,Jc),Jc|=r;return Rs(e,t,i,n),t.child}function Us(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ws(e,t,n,r,i){var a=Yi(n)?qi:Gi.current;return a=Ji(t,a),qa(t,i),n=Po(e,t,n,r,a,i),r=Fo(),e!==null&&!Ls?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ac(e,t,i)):(Sa&&r&&va(t),t.flags|=1,Rs(e,t,n,i),t.child)}function Gs(e,t,n,r,i){if(Yi(n)){var a=!0;$i(t)}else a=!1;if(qa(t,i),t.stateNode===null)ic(e,t),ws(t,n,r),Es(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ja(l):(l=Yi(n)?qi:Gi.current,l=Ji(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Ts(t,o,r,l),$a=!1;var f=t.memoizedState;o.state=f,oo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Ki.current||$a?(typeof u==`function`&&(xs(t,n,u,r),c=t.memoizedState),(s=$a||Cs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,to(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:bs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ja(c):(c=Yi(n)?qi:Gi.current,c=Ji(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Ts(t,o,r,c),$a=!1,f=t.memoizedState,o.state=f,oo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Ki.current||$a?(typeof p==`function`&&(xs(t,n,p,r),m=t.memoizedState),(l=$a||Cs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ks(e,t,n,r,a,i)}function Ks(e,t,n,r,i,a){Us(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&ea(t,n,!1),ac(e,t,a);r=t.stateNode,Is.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ra(t,e.child,null,a),t.child=Ra(t,null,s,a)):Rs(e,t,s,a),t.memoizedState=r.state,i&&ea(t,n,!0),t.child}function qs(e){var t=e.stateNode;t.pendingContext?Zi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zi(e,t.context,!1),mo(e,t.containerInfo)}function Js(e,t,n,r,i){return ja(),Ma(i),t.flags|=256,Rs(e,t,n,r),t.child}var Ys={dehydrated:null,treeContext:null,retryLane:0};function Xs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Zs(e,t,n){var r=t.pendingProps,i=vo.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ui(vo,i&1),e===null)return Da(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ru(o,r,0,null),e=nu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Xs(n),t.memoizedState=Ys,e):Qs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return ec(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=eu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=nu(a,o,n,null),a.flags|=2):a=eu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Xs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Ys,r}return a=e.child,e=a.sibling,r=eu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Qs(e,t){return t=ru({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function $s(e,t,n,r){return r!==null&&Ma(r),Ra(t,e.child,null,n),e=Qs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ec(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Os(Error(r(422))),$s(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=ru({mode:`visible`,children:i.children},a,0,null),o=nu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ra(t,e.child,null,s),t.child.memoizedState=Xs(s),t.memoizedState=Ys,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return $s(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Os(o,i,void 0),$s(e,t,s,i)}if(c=(s&e.childLanes)!==0,Ls||c){if(i=Gc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,Qa(e,a),vl(i,e,a,-1))}return Ml(),i=Os(Error(r(421))),$s(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Gl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,xa=Ei(a.nextSibling),ba=t,Sa=!0,Ca=null,e!==null&&(da[fa++]=ma,da[fa++]=ha,da[fa++]=pa,ma=e.id,ha=e.overflow,pa=t),t=Qs(t,i.children),t.flags|=4096,t)}function tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ka(e.return,t,n)}function nc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function rc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Rs(e,t,r.children,n),r=vo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tc(e,n,t);else if(e.tag===19)tc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ui(vo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&yo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nc(t,!0,n,null,a);break;case`together`:nc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ic(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=eu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=eu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function oc(e,t,n){switch(t.tag){case 3:qs(t),ja();break;case 5:go(t);break;case 1:Yi(t.type)&&$i(t);break;case 4:mo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ui(Ba,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ui(vo,vo.current&1),e=ac(e,t,n),e===null?null:e.sibling):Zs(e,t,n):(Ui(vo,vo.current&1),t.flags|=128,null);Ui(vo,vo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return rc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ui(vo,vo.current),r)break;return null;case 22:case 23:return t.lanes=0,Hs(e,t,n)}return ac(e,t,n)}var sc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},cc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,po(lo.current);var o=null;switch(n){case`input`:i=le(e,i),r=le(e,r),o=[];break;case`select`:i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),o=[];break;case`textarea`:i=ge(e,i),r=ge(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=gi)}ke(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null){if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null))}for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null)){if(u===`style`){if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l}else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ni(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},K=function(e,t,n,r){n!==r&&(t.flags|=4)};function lc(e,t){if(!Sa)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function uc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function dc(e,t,n){var i=t.pendingProps;switch(ya(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return uc(t),null;case 1:return Yi(t.type)&&Xi(),uc(t),null;case 3:return i=t.stateNode,ho(),Hi(Ki),Hi(Gi),xo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ka(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ca!==null&&(Sl(Ca),Ca=null))),uc(t),null;case 5:_o(t);var o=po(fo.current);if(n=t.type,e!==null&&t.stateNode!=null)cc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return uc(t),null}if(e=po(lo.current),ka(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[ki]=t,i[Ai]=s,e=!!(t.mode&1),n){case`dialog`:ni(`cancel`,i),ni(`close`,i);break;case`iframe`:case`object`:case`embed`:ni(`load`,i);break;case`video`:case`audio`:for(o=0;o<Qr.length;o++)ni(Qr[o],i);break;case`source`:ni(`error`,i);break;case`img`:case`image`:case`link`:ni(`error`,i),ni(`load`,i);break;case`details`:ni(`toggle`,i);break;case`input`:U(i,s),ni(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ni(`invalid`,i);break;case`textarea`:_e(i,s),ni(`invalid`,i)}for(var c in ke(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ni(`scroll`,i)}switch(n){case`input`:oe(i),fe(i,s,!0);break;case`textarea`:oe(i),ye(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=gi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=W(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[ki]=t,e[Ai]=i,sc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ae(n,i),n){case`dialog`:ni(`cancel`,e),ni(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ni(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<Qr.length;o++)ni(Qr[o],e);o=i;break;case`source`:ni(`error`,e),o=i;break;case`img`:case`image`:case`link`:ni(`error`,e),ni(`load`,e),o=i;break;case`details`:ni(`toggle`,e),o=i;break;case`input`:U(e,i),o=le(e,i),ni(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=R({},i,{value:void 0}),ni(`invalid`,e);break;case`textarea`:_e(e,i),o=ge(e,i),ni(`invalid`,e);break;default:o=i}for(s in ke(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?De(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Se(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Ce(e,u):typeof u==`number`&&Ce(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ni(`scroll`,e):u!=null&&x(e,s,u,c))}switch(n){case`input`:oe(e),fe(e,i,!1);break;case`textarea`:oe(e),ye(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+H(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&he(e,!!i.multiple,i.defaultValue,!0):he(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=gi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return uc(t),null;case 6:if(e&&t.stateNode!=null)K(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=po(fo.current),po(lo.current),ka(t)){if(i=t.stateNode,n=t.memoizedProps,i[ki]=t,(s=i.nodeValue!==n)&&(e=ba,e!==null))switch(e.tag){case 3:hi(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&hi(i.nodeValue,n,!!(e.mode&1))}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[ki]=t,t.stateNode=i}return uc(t),null;case 13:if(Hi(vo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Sa&&xa!==null&&t.mode&1&&!(t.flags&128))Aa(),ja(),t.flags|=98560,s=!1;else if(s=ka(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[ki]=t}else ja(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;uc(t),s=!1}else Ca!==null&&(Sl(Ca),Ca=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||vo.current&1?Xc===0&&(Xc=3):Ml())),t.updateQueue!==null&&(t.flags|=4),uc(t),null);case 4:return ho(),e===null&&ai(t.stateNode.containerInfo),uc(t),null;case 10:return Ga(t.type._context),uc(t),null;case 17:return Yi(t.type)&&Xi(),uc(t),null;case 19:if(Hi(vo),s=t.memoizedState,s===null)return uc(t),null;if(i=!!(t.flags&128),c=s.rendering,c===null){if(i)lc(s,!1);else{if(Xc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=yo(e),c!==null){for(t.flags|=128,lc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ui(vo,vo.current&1|2),t.child}e=e.sibling}s.tail!==null&<()>il&&(t.flags|=128,i=!0,lc(s,!1),t.lanes=4194304)}}else{if(!i){if(e=yo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Sa)return uc(t),null}else 2*lt()-s.renderingStartTime>il&&n!==1073741824&&(t.flags|=128,i=!0,lc(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(uc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=lt(),t.sibling=null,n=vo.current,Ui(vo,i?n&1|2:n&1),t);case 22:case 23:return Ol(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Jc&1073741824&&(uc(t),t.subtreeFlags&6&&(t.flags|=8192)):uc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function fc(e,t){switch(ya(t),t.tag){case 1:return Yi(t.type)&&Xi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ho(),Hi(Ki),Hi(Gi),xo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _o(t),null;case 13:if(Hi(vo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Hi(vo),null;case 4:return ho(),null;case 10:return Ga(t.type._context),null;case 22:case 23:return Ol(),null;case 24:return null;default:return null}}var pc=!1,mc=!1,hc=typeof WeakSet==`function`?WeakSet:Set,q=null;function J(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){Hl(e,t,n)}else n.current=null}}function gc(e,t,n){try{n()}catch(n){Hl(e,t,n)}}var _c=!1;function vc(e,t){if(_i=cn,e=kr(),Ar(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(vi={focusedElem:e,selectionRange:n},cn=!1,q=t;q!==null;)if(t=q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:bs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Hl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return h=_c,_c=!1,h}function yc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&gc(t,n,a)}i=i.next}while(i!==r)}}function bc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Sc(e){var t=e.alternate;t!==null&&(e.alternate=null,Sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ki],delete t[Ai],delete t[Mi],delete t[Ni],delete t[Pi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cc(e){return e.tag===5||e.tag===3||e.tag===4}function wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Cc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gi));else if(r!==4&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}var Dc=null,Oc=!1;function kc(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(_t&&typeof _t.onCommitFiberUnmount==`function`)try{_t.onCommitFiberUnmount(gt,n)}catch{}switch(n.tag){case 5:mc||J(n,t);case 6:var r=Dc,i=Oc;Dc=null,kc(e,t,n),Dc=r,Oc=i,Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dc.removeChild(n.stateNode));break;case 18:Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?Ti(e.parentNode,n):e.nodeType===1&&Ti(e,n),on(e)):Ti(Dc,n.stateNode));break;case 4:r=Dc,i=Oc,Dc=n.stateNode.containerInfo,Oc=!0,kc(e,t,n),Dc=r,Oc=i;break;case 0:case 11:case 14:case 15:if(!mc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&gc(n,t,o),i=i.next}while(i!==r)}kc(e,t,n);break;case 1:if(!mc&&(J(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Hl(n,t,e)}kc(e,t,n);break;case 21:kc(e,t,n);break;case 22:n.mode&1?(mc=(r=mc)||n.memoizedState!==null,kc(e,t,n),mc=r):kc(e,t,n);break;default:kc(e,t,n)}}function jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hc),t.forEach(function(t){var r=Kl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Mc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Dc=c.stateNode,Oc=!1;break a;case 3:Dc=c.stateNode.containerInfo,Oc=!0;break a;case 4:Dc=c.stateNode.containerInfo,Oc=!0;break a}c=c.return}if(Dc===null)throw Error(r(160));Ac(o,s,a),Dc=null,Oc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Hl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Nc(t,e),t=t.sibling}function Nc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mc(t,e),Pc(e),i&4){try{yc(3,e,e.return),bc(3,e)}catch(t){Hl(e,e.return,t)}try{yc(5,e,e.return)}catch(t){Hl(e,e.return,t)}}break;case 1:Mc(t,e),Pc(e),i&512&&n!==null&&J(n,n.return);break;case 5:if(Mc(t,e),Pc(e),i&512&&n!==null&&J(n,n.return),e.flags&32){var a=e.stateNode;try{Ce(a,``)}catch(t){Hl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&ue(a,o),Ae(c,s);var u=Ae(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?De(a,f):d===`dangerouslySetInnerHTML`?Se(a,f):d===`children`?Ce(a,f):x(a,d,f,u)}switch(c){case`input`:de(a,o);break;case`textarea`:ve(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?he(a,!!o.multiple,o.multiple?[]:``,!1):he(a,!!o.multiple,o.defaultValue,!0)):he(a,!!o.multiple,m,!1)}a[Ai]=o}catch(t){Hl(e,e.return,t)}}break;case 6:if(Mc(t,e),Pc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Hl(e,e.return,t)}}break;case 3:if(Mc(t,e),Pc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{on(t.containerInfo)}catch(t){Hl(e,e.return,t)}break;case 4:Mc(t,e),Pc(e);break;case 13:Mc(t,e),Pc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(rl=lt())),i&4&&jc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(mc=(u=mc)||d,Mc(t,e),mc=u):Mc(t,e),Pc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(q=e,d=e.child;d!==null;){for(f=q=d;q!==null;){switch(p=q,m=p.child,p.tag){case 0:case 11:case 14:case 15:yc(4,p,p.return);break;case 1:J(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Hl(i,n,e)}}break;case 5:J(p,p.return);break;case 22:if(p.memoizedState!==null){Rc(f);continue}}m===null?Rc(f):(m.return=p,q=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Ee(`display`,s))}catch(t){Hl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Hl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Mc(t,e),Pc(e),i&4&&jc(e);break;case 21:break;default:Mc(t,e),Pc(e)}}function Pc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Cc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Ce(a,``),i.flags&=-33),Ec(e,wc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Tc(e,wc(e),o);break;default:throw Error(r(161))}}catch(t){Hl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fc(e,t,n){q=e,Ic(e,t,n)}function Ic(e,t,n){for(var r=!!(e.mode&1);q!==null;){var i=q,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||pc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||mc;s=pc;var l=mc;if(pc=o,(mc=c)&&!l)for(q=i;q!==null;)o=q,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?zc(i):(c.return=o,q=c);for(;a!==null;)q=a,Ic(a,t,n),a=a.sibling;q=i,pc=s,mc=l}Lc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,q=a):Lc(e,t,n)}}function Lc(e){for(;q!==null;){var t=q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mc||bc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!mc){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:bs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&so(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}so(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&on(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}mc||t.flags&512&&xc(t)}catch(e){Hl(t,t.return,e)}}if(t===e){q=null;break}if(n=t.sibling,n!==null){n.return=t.return,q=n;break}q=t.return}}function Rc(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,q=n;break}q=t.return}}function zc(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bc(4,t)}catch(e){Hl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Hl(t,i,e)}}var a=t.return;try{xc(t)}catch(e){Hl(t,a,e)}break;case 5:var o=t.return;try{xc(t)}catch(e){Hl(t,o,e)}}}catch(e){Hl(t,t.return,e)}if(t===e){q=null;break}var s=t.sibling;if(s!==null){s.return=t.return,q=s;break}q=t.return}}var Bc=Math.ceil,Vc=S.ReactCurrentDispatcher,Hc=S.ReactCurrentOwner,Uc=S.ReactCurrentBatchConfig,Wc=0,Gc=null,Kc=null,qc=0,Jc=0,Yc=Vi(0),Xc=0,Zc=null,Qc=0,$c=0,el=0,tl=null,nl=null,rl=0,il=1/0,al=null,ol=!1,sl=null,cl=null,ll=!1,ul=null,dl=0,fl=0,pl=null,ml=-1,hl=0;function gl(){return Wc&6?lt():ml===-1?ml=lt():ml}function _l(e){return e.mode&1?Wc&2&&qc!==0?qc&-qc:Na.transition===null?(e=Ft,e===0?(e=window.event,e=e===void 0?16:mn(e.type),e):e):(hl===0&&(hl=At()),hl):1}function vl(e,t,n,i){if(50<fl)throw fl=0,pl=null,Error(r(185));Mt(e,n,i),(!(Wc&2)||e!==Gc)&&(e===Gc&&(!(Wc&2)&&($c|=n),Xc===4&&wl(e,qc)),yl(e,i),n===1&&Wc===0&&!(t.mode&1)&&(il=lt()+500,na&&oa()))}function yl(e,t){var n=e.callbackNode;Ot(e,t);var r=Et(e,e===Gc?qc:0);if(r===0)n!==null&&ot(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ot(n),t===1)e.tag===0?aa(Tl.bind(null,e)):ia(Tl.bind(null,e)),Ci(function(){!(Wc&6)&&oa()}),n=null;else{switch(It(r)){case 1:n=dt;break;case 4:n=ft;break;case 16:n=pt;break;case 536870912:n=ht;break;default:n=pt}n=Jl(n,bl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function bl(e,t){if(ml=-1,hl=0,Wc&6)throw Error(r(327));var n=e.callbackNode;if(Bl()&&e.callbackNode!==n)return null;var i=Et(e,e===Gc?qc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Nl(e,i);else{t=i;var a=Wc;Wc|=2;var o=jl();(Gc!==e||qc!==t)&&(al=null,il=lt()+500,kl(e,t));do try{Fl();break}catch(t){Al(e,t)}while(1);Wa(),Vc.current=o,Wc=a,Kc===null?(Gc=null,qc=0,t=Xc):t=0}if(t!==0){if(t===2&&(a=kt(e),a!==0&&(i=a,t=xl(e,a))),t===1)throw n=Zc,kl(e,0),wl(e,i),yl(e,lt()),n;if(t===6)wl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Cl(a)&&(t=Nl(e,i),t===2&&(o=kt(e),o!==0&&(i=o,t=xl(e,o))),t===1))throw n=Zc,kl(e,0),wl(e,i),yl(e,lt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Rl(e,nl,al);break;case 3:if(wl(e,i),(i&130023424)===i&&(t=rl+500-lt(),10<t)){if(Et(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){gl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=bi(Rl.bind(null,e,nl,al),t);break}Rl(e,nl,al);break;case 4:if(wl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-yt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=lt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Bc(i/1960))-i,10<i){e.timeoutHandle=bi(Rl.bind(null,e,nl,al),i);break}Rl(e,nl,al);break;case 5:Rl(e,nl,al);break;default:throw Error(r(329))}}}return yl(e,lt()),e.callbackNode===n?bl.bind(null,e):null}function xl(e,t){var n=tl;return e.current.memoizedState.isDehydrated&&(kl(e,t).flags|=256),e=Nl(e,t),e!==2&&(t=nl,nl=n,t!==null&&Sl(t)),e}function Sl(e){nl===null?nl=e:nl.push.apply(nl,e)}function Cl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!wr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wl(e,t){for(t&=~el,t&=~$c,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-yt(t),r=1<<n;e[n]=-1,t&=~r}}function Tl(e){if(Wc&6)throw Error(r(327));Bl();var t=Et(e,0);if(!(t&1))return yl(e,lt()),null;var n=Nl(e,t);if(e.tag!==0&&n===2){var i=kt(e);i!==0&&(t=i,n=xl(e,i))}if(n===1)throw n=Zc,kl(e,0),wl(e,t),yl(e,lt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rl(e,nl,al),yl(e,lt()),null}function El(e,t){var n=Wc;Wc|=1;try{return e(t)}finally{Wc=n,Wc===0&&(il=lt()+500,na&&oa())}}function Dl(e){ul!==null&&ul.tag===0&&!(Wc&6)&&Bl();var t=Wc;Wc|=1;var n=Uc.transition,r=Ft;try{if(Uc.transition=null,Ft=1,e)return e()}finally{Ft=r,Uc.transition=n,Wc=t,!(Wc&6)&&oa()}}function Ol(){Jc=Yc.current,Hi(Yc)}function kl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,xi(n)),Kc!==null)for(n=Kc.return;n!==null;){var r=n;switch(ya(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Xi();break;case 3:ho(),Hi(Ki),Hi(Gi),xo();break;case 5:_o(r);break;case 4:ho();break;case 13:Hi(vo);break;case 19:Hi(vo);break;case 10:Ga(r.type._context);break;case 22:case 23:Ol()}n=n.return}if(Gc=e,Kc=e=eu(e.current,null),qc=Jc=t,Xc=0,Zc=null,el=$c=Qc=0,nl=tl=null,Ya!==null){for(t=0;t<Ya.length;t++)if(n=Ya[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Ya=null}return e}function Al(e,t){do{var n=Kc;try{if(Wa(),So.current=gs,Oo){for(var i=To.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Oo=!1}if(wo=0,Do=Eo=To=null,ko=!1,Ao=0,Hc.current=null,n===null||n.return===null){Xc=1,Zc=t,Kc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=qc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ps(s);if(m!==null){m.flags&=-257,Fs(m,s,c,o,t),m.mode&1&&Ns(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Ns(o,u,t),Ml();break a}l=Error(r(426))}else if(Sa&&c.mode&1){var _=Ps(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Fs(_,s,c,o,t),Ma(Ds(l,c));break a}}o=l=Ds(l,c),Xc!==4&&(Xc=2),tl===null?tl=[o]:tl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=js(o,l,t);ao(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(cl===null||!cl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Ms(o,c,t);ao(o,x);break a}}o=o.return}while(o!==null)}Ll(n)}catch(e){t=e,Kc===n&&n!==null&&(Kc=n=n.return);continue}break}while(1)}function jl(){var e=Vc.current;return Vc.current=gs,e===null?gs:e}function Ml(){(Xc===0||Xc===3||Xc===2)&&(Xc=4),Gc===null||!(Qc&268435455)&&!($c&268435455)||wl(Gc,qc)}function Nl(e,t){var n=Wc;Wc|=2;var i=jl();(Gc!==e||qc!==t)&&(al=null,kl(e,t));do try{Pl();break}catch(t){Al(e,t)}while(1);if(Wa(),Wc=n,Vc.current=i,Kc!==null)throw Error(r(261));return Gc=null,qc=0,Xc}function Pl(){for(;Kc!==null;)Il(Kc)}function Fl(){for(;Kc!==null&&!st();)Il(Kc)}function Il(e){var t=ql(e.alternate,e,Jc);e.memoizedProps=e.pendingProps,t===null?Ll(e):Kc=t,Hc.current=null}function Ll(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=fc(n,t),n!==null){n.flags&=32767,Kc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xc=6,Kc=null;return}}else if(n=dc(n,t,Jc),n!==null){Kc=n;return}if(t=t.sibling,t!==null){Kc=t;return}Kc=t=e}while(t!==null);Xc===0&&(Xc=5)}function Rl(e,t,n){var r=Ft,i=Uc.transition;try{Uc.transition=null,Ft=1,zl(e,t,n,r)}finally{Uc.transition=i,Ft=r}return null}function zl(e,t,n,i){do Bl();while(ul!==null);if(Wc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Nt(e,o),e===Gc&&(Kc=Gc=null,qc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ll||(ll=!0,Jl(pt,function(){return Bl(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=Uc.transition,Uc.transition=null;var s=Ft;Ft=1;var c=Wc;Wc|=4,Hc.current=null,vc(e,n),Nc(n,e),jr(vi),cn=!!_i,vi=_i=null,e.current=n,Fc(n,e,a),ct(),Wc=c,Ft=s,Uc.transition=o}else e.current=n;if(ll&&(ll=!1,ul=e,dl=a),o=e.pendingLanes,o===0&&(cl=null),vt(n.stateNode,i),yl(e,lt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(ol)throw ol=!1,e=sl,sl=null,e;return dl&1&&e.tag!==0&&Bl(),o=e.pendingLanes,o&1?e===pl?fl++:(fl=0,pl=e):fl=0,oa(),null}function Bl(){if(ul!==null){var e=It(dl),t=Uc.transition,n=Ft;try{if(Uc.transition=null,Ft=16>e?16:e,ul===null)var i=!1;else{if(e=ul,ul=null,dl=0,Wc&6)throw Error(r(331));var a=Wc;for(Wc|=4,q=e.current;q!==null;){var o=q,s=o.child;if(q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(q=u;q!==null;){var d=q;switch(d.tag){case 0:case 11:case 15:yc(8,d,o)}var f=d.child;if(f!==null)f.return=d,q=f;else for(;q!==null;){d=q;var p=d.sibling,m=d.return;if(Sc(d),d===u){q=null;break}if(p!==null){p.return=m,q=p;break}q=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}q=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,q=s;else b:for(;q!==null;){if(o=q,o.flags&2048)switch(o.tag){case 0:case 11:case 15:yc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,q=v;break b}q=o.return}}var y=e.current;for(q=y;q!==null;){s=q;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,q=b;else b:for(s=y;q!==null;){if(c=q,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:bc(9,c)}}catch(e){Hl(c,c.return,e)}if(c===s){q=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,q=x;break b}q=c.return}}if(Wc=a,oa(),_t&&typeof _t.onPostCommitFiberRoot==`function`)try{_t.onPostCommitFiberRoot(gt,e)}catch{}i=!0}return i}finally{Ft=n,Uc.transition=t}}return!1}function Vl(e,t,n){t=Ds(n,t),t=js(e,t,1),e=ro(e,t,1),t=gl(),e!==null&&(Mt(e,1,t),yl(e,t))}function Hl(e,t,n){if(e.tag===3)Vl(e,e,n);else for(;t!==null;){if(t.tag===3){Vl(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cl===null||!cl.has(r))){e=Ds(n,e),e=Ms(t,e,1),t=ro(t,e,1),e=gl(),t!==null&&(Mt(t,1,e),yl(t,e));break}}t=t.return}}function Ul(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=gl(),e.pingedLanes|=e.suspendedLanes&n,Gc===e&&(qc&n)===n&&(Xc===4||Xc===3&&(qc&130023424)===qc&&500>lt()-rl?kl(e,0):el|=n),yl(e,t)}function Wl(e,t){t===0&&(e.mode&1?(t=wt,wt<<=1,!(wt&130023424)&&(wt=4194304)):t=1);var n=gl();e=Qa(e,t),e!==null&&(Mt(e,t,n),yl(e,n))}function Gl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wl(e,n)}function Kl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Wl(e,n)}var ql=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Ki.current)Ls=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ls=!1,oc(e,t,n);Ls=!!(e.flags&131072)}}else Ls=!1,Sa&&t.flags&1048576&&_a(t,ua,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ic(e,t),e=t.pendingProps;var a=Ji(t,Gi.current);qa(t,n),a=Po(null,t,i,e,a,n);var o=Fo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yi(i)?(o=!0,$i(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,eo(t),a.updater=Ss,t.stateNode=a,a._reactInternals=t,Es(t,i,e,n),t=Ks(null,t,i,!0,o,n)):(t.tag=0,Sa&&o&&va(t),Rs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(ic(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Ql(i),e=bs(i,e),a){case 0:t=Ws(null,t,i,e,n);break a;case 1:t=Gs(null,t,i,e,n);break a;case 11:t=zs(null,t,i,e,n);break a;case 14:t=Bs(null,t,i,bs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bs(i,a),Ws(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bs(i,a),Gs(e,t,i,a,n);case 3:a:{if(qs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,to(e,t),oo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ds(Error(r(423)),t),t=Js(e,t,i,n,a);break a}if(i!==a){a=Ds(Error(r(424)),t),t=Js(e,t,i,n,a);break a}for(xa=Ei(t.stateNode.containerInfo.firstChild),ba=t,Sa=!0,Ca=null,n=za(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ja(),i===a){t=ac(e,t,n);break a}Rs(e,t,i,n)}t=t.child}return t;case 5:return go(t),e===null&&Da(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,yi(i,a)?s=null:o!==null&&yi(i,o)&&(t.flags|=32),Us(e,t),Rs(e,t,s,n),t.child;case 6:return e===null&&Da(t),null;case 13:return Zs(e,t,n);case 4:return mo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ra(t,null,i,n):Rs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bs(i,a),zs(e,t,i,a,n);case 7:return Rs(e,t,t.pendingProps,n),t.child;case 8:return Rs(e,t,t.pendingProps.children,n),t.child;case 12:return Rs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ui(Ba,i._currentValue),i._currentValue=s,o!==null){if(wr(o.value,s)){if(o.children===a.children&&!Ki.current){t=ac(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=no(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ka(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ka(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Rs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,qa(t,n),a=Ja(a),i=i(a),t.flags|=1,Rs(e,t,i,n),t.child;case 14:return i=t.type,a=bs(i,t.pendingProps),a=bs(i.type,a),Bs(e,t,i,a,n);case 15:return Vs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:bs(i,a),ic(e,t),t.tag=1,Yi(i)?(e=!0,$i(t)):e=!1,qa(t,n),ws(t,i,a),Es(t,i,a,n),Ks(null,t,i,!0,e,n);case 19:return rc(e,t,n);case 22:return Hs(e,t,n)}throw Error(r(156,t.tag))};function Jl(e,t){return at(e,t)}function Yl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xl(e,t,n,r){return new Yl(e,t,n,r)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ql(e){if(typeof e==`function`)return+!!Zl(e);if(e!=null){if(e=e.$$typeof,e===A)return 11;if(e===N)return 14}return 2}function eu(e,t){var n=e.alternate;return n===null?(n=Xl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function tu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)Zl(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case T:return nu(n.children,a,o,t);case E:s=8,a|=8;break;case D:return e=Xl(12,n,t,a|2),e.elementType=D,e.lanes=o,e;case j:return e=Xl(13,n,t,a),e.elementType=j,e.lanes=o,e;case M:return e=Xl(19,n,t,a),e.elementType=M,e.lanes=o,e;case F:return ru(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case O:s=10;break a;case k:s=9;break a;case A:s=11;break a;case N:s=14;break a;case P:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Xl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function nu(e,t,n,r){return e=Xl(7,e,r,t),e.lanes=n,e}function ru(e,t,n,r){return e=Xl(22,e,r,t),e.elementType=F,e.lanes=n,e.stateNode={isHidden:!1},e}function iu(e,t,n){return e=Xl(6,e,null,t),e.lanes=n,e}function au(e,t,n){return t=Xl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ou(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jt(0),this.expirationTimes=jt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function su(e,t,n,r,i,a,o,s,c){return e=new ou(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Xl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},eo(a),e}function cu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:w,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function lu(e){if(!e)return Wi;e=e._reactInternals;a:{if($e(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Yi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Yi(n))return Qi(e,n,t)}return t}function uu(e,t,n,r,i,a,o,s,c){return e=su(n,r,!0,e,i,a,o,s,c),e.context=lu(null),n=e.current,r=gl(),i=_l(n),a=no(r,i),a.callback=t??null,ro(n,a,i),e.current.lanes=i,Mt(e,i,r),yl(e,r),e}function du(e,t,n,r){var i=t.current,a=gl(),o=_l(i);return n=lu(n),t.context===null?t.context=n:t.pendingContext=n,t=no(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ro(i,t,o),e!==null&&(vl(e,i,o,a),io(e,i,o)),o}function fu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function pu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mu(e,t){pu(e,t),(e=e.alternate)&&pu(e,t)}function hu(){return null}var gu=typeof reportError==`function`?reportError:function(e){console.error(e)};function _u(e){this._internalRoot=e}vu.prototype.render=_u.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));du(e,t,null,null)},vu.prototype.unmount=_u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dl(function(){du(null,e,null,null)}),t[ji]=null}};function vu(e){this._internalRoot=e}vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yt.length&&t!==0&&t<Yt[n].priority;n++);Yt.splice(n,0,e),n===0&&en(e)}};function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function xu(){}function Su(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=fu(o);a.call(e)}}var o=uu(t,r,e,0,null,!1,!1,``,xu);return e._reactRootContainer=o,e[ji]=o.current,ai(e.nodeType===8?e.parentNode:e),Dl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=fu(c);s.call(e)}}var c=su(e,0,!1,null,null,!1,!1,``,xu);return e._reactRootContainer=c,e[ji]=c.current,ai(e.nodeType===8?e.parentNode:e),Dl(function(){du(t,c,n,r)}),c}function Cu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=fu(o);s.call(e)}}du(t,o,e,i)}else o=Su(n,t,e,i,r);return fu(o)}Lt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Tt(t.pendingLanes);n!==0&&(Pt(t,n|1),yl(t,lt()),!(Wc&6)&&(il=lt()+500,oa()))}break;case 13:Dl(function(){var t=Qa(e,1);t!==null&&vl(t,e,1,gl())}),mu(e,1)}},Rt=function(e){if(e.tag===13){var t=Qa(e,134217728);t!==null&&vl(t,e,134217728,gl()),mu(e,134217728)}},zt=function(e){if(e.tag===13){var t=_l(e),n=Qa(e,t);n!==null&&vl(n,e,t,gl()),mu(e,t)}},Bt=function(){return Ft},Vt=function(e,t){var n=Ft;try{return Ft=e,t()}finally{Ft=n}},Ne=function(e,t,n){switch(t){case`input`:if(de(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ri(i);if(!a)throw Error(r(90));se(i),de(i,a)}}}break;case`textarea`:ve(e,n);break;case`select`:t=n.value,t!=null&&he(e,!!n.multiple,t,!1)}},ze=El,Be=Dl;var wu={usingClientEntryPoint:!1,Events:[Ii,Li,Ri,Le,Re,El]},Tu={findFiberByHostInstance:Fi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Eu={bundleType:Tu.bundleType,version:Tu.version,rendererPackageName:Tu.rendererPackageName,rendererConfig:Tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=rt(e),e===null?null:e.stateNode},findFiberByHostInstance:Tu.findFiberByHostInstance||hu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Du.isDisabled&&Du.supportsFiber)try{gt=Du.inject(Eu),_t=Du}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yu(t))throw Error(r(200));return cu(e,t,null,n)},e.createRoot=function(e,t){if(!yu(e))throw Error(r(299));var n=!1,i=``,a=gu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=su(e,1,!1,null,null,n,!1,i,a),e[ji]=t.current,ai(e.nodeType===8?e.parentNode:e),new _u(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=rt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Dl(e)},e.hydrate=function(e,t,n){if(!bu(t))throw Error(r(200));return Cu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!yu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=gu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=uu(t,null,e,1,n??null,a,!1,o,s),e[ji]=t.current,ai(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new vu(t)},e.render=function(e,t,n){if(!bu(t))throw Error(r(200));return Cu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!bu(e))throw Error(r(40));return e._reactRootContainer?(Dl(function(){Cu(null,null,e,!1,function(){e._reactRootContainer=null,e[ji]=null})}),!0):!1},e.unstable_batchedUpdates=El,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!bu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Cu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),tu=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=eu()})),nu=o((e=>{var t=tu();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),ru=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},iu={pipe(){return ru(this,arguments)}},au=function(){function e(){}return e.prototype=iu,e}(),ou=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},su=e=>e,cu=e=>()=>e,lu=cu(!0),uu=cu(null),du=cu(void 0),fu=du;function pu(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function mu(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function hu(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var gu=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},_u=new WeakSet,vu=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),yu=0,bu=()=>{yu++};function xu(e){return typeof e==`string`}function Su(e){return typeof e==`number`}function Cu(e){return typeof e==`boolean`}function wu(e){return typeof e==`symbol`}function Tu(e){return xu(e)||Su(e)||wu(e)}function Eu(e){return typeof e==`function`}function Du(e){return e===void 0}function Ou(e){return e!=null}function ku(e){return!0}function Au(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ju(e){return typeof e==`object`&&!!e||Eu(e)}var Mu=ou(2,(e,t)=>ju(e)&&t in e),Nu=`~effect/Hash`,Pu=e=>{switch(typeof e){case`number`:return Bu(e);case`bigint`:return Vu(e.toString(10));case`string`:return Vu(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?Vu(`Invalid Date`):Vu(e.toISOString());if(e instanceof RegExp)return Vu(e.toString());{if(_u.has(e))return Fu(e);let t=Xu.get(e);if(t!==void 0)return t;if(Zu.has(e))return bu(),Vu(`[Circular]`);Zu.add(e);let n=yu,r;try{r=`~effect/Hash`in e?e[Nu]():typeof e==`function`?Fu(e):e instanceof DataView?Gu(vu(e)):Array.isArray(e)||ArrayBuffer.isView(e)?Gu(e):e instanceof Map?Ku(e):e instanceof Set?Ju(e):Uu(e)}finally{Zu.delete(e)}return n===yu&&Xu.set(e,r),r}}return Ru(Iu(Vu(String(e))))},Fu=e=>(Yu.has(e)||Yu.set(e,Ru(Math.random()*4294967296|0)),Yu.get(e)),Iu=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),Lu=ou(2,(e,t)=>Iu(Math.imul(e,2654435761)+Math.imul(t,2246822507))),Ru=e=>e&3221225471|e>>>1&1073741824,zu=new DataView(new ArrayBuffer(8)),Bu=e=>{let t=e|0;return t===e?Ru(t):(zu.setFloat64(0,e===e?e:NaN),Ru(Lu(zu.getInt32(0),zu.getInt32(4))))},Vu=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Ru(t)},Hu=(e,t)=>{let n=12289;for(let r of t)n^=Lu(Pu(r),Pu(e[r]));return Ru(n)},Uu=e=>Hu(e,gu(e)),Wu=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Ru(r)},Gu=e=>{let t=6151;for(let n of e)t=Lu(t,Pu(n));return Ru(t)},Ku=Wu(Vu(`Map`),([e,t])=>Lu(Pu(e),Pu(t))),qu=Vu(`Set`),Ju=Wu(qu,e=>Lu(qu,Pu(e))),Yu=new WeakMap,Xu=new WeakMap,Zu=new WeakSet,Qu=`~effect/Equal`;function $u(){return arguments.length===1?e=>ed(e,arguments[0]):ed(arguments[0],arguments[1])}function ed(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||_u.has(e)||_u.has(t)?!1:td(e,t):!1}function td(e,t){let n=rd.length;for(let r=n;r-->0;)if(rd[r]===e&&id[r]===t)return!0;if(n)return nd(e,t);let r=ad.get(e);r||ad.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=nd(e,t)),i}function nd(e,t){rd.push(e),id.push(t);try{return od(e,t)}finally{rd.pop(),id.pop()}}var rd=[],id=[],ad=new WeakMap;function od(e,t){if(Pu(e)!==Pu(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=pd(e);if(n!==pd(t)||typeof e==`function`&&!n)return!1;if(n)return e[Qu](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:sd(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?cd(vu(e),vu(t)):cd(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:ud(e,t,dd,fd):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:ud(e,t,Pu,ed):ld(e,t)}function sd(e,t){for(let n=0;n<e.length;n++)if(!ed(e[n],t[n]))return!1;return!0}function cd(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ld(e,t){let n=gu(e),r=gu(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!ed(e[i],t[i]))return!1;return!0}function ud(e,t,n,r){let i=new Map,a=0;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e]),a++}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop(),a--;continue outer}}return!1}return a===0}var dd=e=>Pu(e[0]),fd=(e,t)=>ed(e[0],t[0])&&ed(e[1],t[1]),pd=e=>Mu(e,Qu),md=Symbol.for(`~effect/Redactable`),hd=e=>Mu(e,md);function gd(e){return hd(e)?_d(e):e}function _d(e){return e[md](globalThis[`~effect/Fiber/currentFiber`]?.context??bd)}var vd=`~effect/Fiber/currentFiber`,yd=new Map,bd={"~effect/Context":{},base:yd,depth:0,mapUnsafe:yd,pipe(){return ru(this,arguments)}};function xd(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Sd;r.add(e);let l;if(md in e)l=c(_d(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
72
|
-
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Td(e);else if(!t?.ignoreToString&&Mu(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Ed(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${Cd(t)}:${c(Dd(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Cd(t)}: ${c(Dd(e,t),n+1)}`).join(`,
|
|
73
|
-
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Sd=`[Circular]`;function Cd(e){return typeof e==`string`?JSON.stringify(e):String(e)}function wd(e){return e.map(e=>`[${Cd(e)}]`).join(``)}function Td(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Ed(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Dd(e,t){try{return e[t]}catch{return`[property access threw]`}}function Od(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=Mu(r,md)?gd(r):gd(t);if(typeof i==`bigint`)return xd(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!Mu(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return;if(n.push(i),a!==i&&n.push(a),!kd(a)||Ad(a))return a;let o=new Proxy(a,{get(e,t){let n=Reflect.get(e,t,e);return Object.getOwnPropertyDescriptor(e,t)?.get===void 0?n:gd(n)}});return n.push(o),o},t?.space)??`null`}function kd(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function Ad(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}var jd=Symbol.for(`nodejs.util.inspect.custom`),Md=e=>{try{return e=gd(e),Mu(e,`toJSON`)&&Eu(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(Md):e}catch{return`[toJSON threw]`}},Nd={toJSON(){return Md(this)},[jd](){return this.toJSON()},toString(){return xd(this.toJSON())}},Pd=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),Fd=()=>Error.stackTraceLimit,Id=e=>{Pd&&(Error.stackTraceLimit=e)},Ld=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},Rd=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return Fd()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})();function zd(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Bd(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&zd(e,n,t[n])}var Vd=`~effect/Effect`,Hd=`~effect/Exit`,Ud={_A:su,_E:su,_R:su},Wd=`${Vd}/identifier`,Gd=`${Vd}/args`,Kd=`${Vd}/evaluate`,qd=`${Vd}/successCont`,Jd=`${Vd}/failureCont`,Yd=`${Vd}/ensureCont`,Xd=Symbol.for(`effect/Effect/Yield`),Zd={pipe(){return ru(this,arguments)},toJSON(){return{...this}},toString(){return xd(this.toJSON(),{ignoreToString:!0,space:2})},[jd](){return this.toJSON()}},eee={[Vd]:Ud,...Zd,[Symbol.iterator](){return new Ld(this)},toJSON(){return{_id:`Effect`,op:this[Wd],...Gd in this?{args:this[Gd]}:void 0}}},tee=e=>Mu(e,Hd),Qd=`~effect/Cause`,$d=`~effect/Cause/Reason`,ef=e=>Mu(e,Qd),tf=class{constructor(e){this[Qd]=Qd,this.reasons=e}pipe(){return ru(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${xd(this.reasons)})`}[jd](){return this.toJSON()}[Qu](e){return ef(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>$u(t,e.reasons[n]))}[Nu](){return Gu(this.reasons)}},nf=new WeakMap,rf=class{[$d];annotations;_tag;constructor(e,t,n){if(this[$d]=$d,this._tag=e,t!==af&&typeof n==`object`&&n&&t.size>0){let e=nf.get(n);e&&(t=new Map([...e,...t])),nf.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return ru(this,arguments)}toString(){return xd(this)}[jd](){return this.toString()}},af=new Map,of=class extends rf{constructor(e,t=af){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${xd(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[Qu](e){return mf(e)&&$u(this.error,e.error)&&$u(this.annotations,e.annotations)}[Nu](){return Lu(Vu(this._tag))(Lu(Pu(this.error))(Pu(this.annotations)))}},sf=e=>new tf(e),cf=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=Pu(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>$u(e,i)))continue;else t.push(i);r.push(i)}return r},lf=ou(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new tf(cf(e.reasons,t.reasons));return $u(e,n)?e:n}),uf=e=>new tf([new of(e)]),df=class extends rf{constructor(e,t=af){super(`Die`,t,e),this.defect=e}toString(){return`Die(${xd(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[Qu](e){return hf(e)&&$u(this.defect,e.defect)&&$u(this.annotations,e.annotations)}[Nu](){return Lu(Vu(this._tag))(Lu(Pu(this.defect))(Pu(this.annotations)))}},ff=e=>new tf([new df(e)]),pf=ou(e=>ef(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new tf(e.reasons.map(e=>e.annotate(t,n)))),mf=e=>e._tag===`Fail`,hf=e=>e._tag===`Die`,gf=e=>e._tag===`Interrupt`;function _f(e){return Ef(`Effect.evaluate: Not implemented`)}var vf=e=>({...eee,[Wd]:e.op,[Kd]:e[Kd]??_f,[qd]:e[qd],[Jd]:e[Jd],[Yd]:e[Yd]}),yf=e=>{let t=vf(e),n=function(e){this[Gd]=e};return n.prototype=t,function(e){return new n(e)}},bf=e=>{let t={[Hd]:Hd,_tag:e.op,get[e.prop](){return this[Gd]},...vf(e),toString(){return`${e.op}(${xd(this[Gd])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[Gd]}},[Qu](e){return tee(e)&&e._tag===this._tag&&$u(this[Gd],e[Gd])},[Nu](){return Lu(Vu(e.op),Pu(this[Gd]))}},n=function(e){this[Gd]=e};return n.prototype=t,function(e){return new n(e)}},xf=bf({op:`Success`,prop:`value`,[Kd](e){let t=e.getCont(qd);return t?t[qd](this[Gd],e,this):e.yieldWith(this)}}),Sf={key:`effect/Cause/StackTrace`},Cf={key:`effect/Cause/InterruptorStackTrace`},wf=bf({op:`Failure`,prop:`cause`,[Kd](e){let t=this[Gd],n=!1;e.cache.stackFrame&&(t=pf(t,{mapUnsafe:new Map([[Sf.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(Jd),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=Wd in r,r=e.getCont(Jd);a&&(t=sf(t.reasons.filter(e=>e._tag!==`Fail`))),t=lf(t,i),n=!0}return r?r[Jd](t,e,n?void 0:this):e.yieldWith(n?wf(t):this)}}),Tf=e=>wf(uf(e)),Ef=e=>wf(ff(e)),Df=yf({op:`WithFiber`,[Kd](e){return this[Gd](e)}}),nee=function(){class e extends globalThis.Error{}let t=vf({op:`YieldableError`,[Kd](){return Tf(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),ree=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends nee{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Bd(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Of=e=>{class t extends ree{_tag=e}return t.prototype.name=e,t};Of(`NoSuchElementError`);var kf=new WeakMap,Af=`~effect/Redacted`,jf=e=>Mu(e,Af),Mf=(e,t)=>{let n=Object.create(Nf);return t?.label&&(n.label=t.label),kf.set(n,e),n},Nf={[Af]:{_A:e=>e},label:void 0,...Zd,toJSON(){return this.toString()},toString(){return`<redacted${xu(this.label)?`:`+this.label:``}>`},[Nu](){return Pu(kf.get(this))},[Qu](e){return jf(e)&&$u(kf.get(this),kf.get(e))}};function Pf(e,t){console.error(JSON.stringify({source:`agar`,operation:e,failureKind:t instanceof Error?`Error`:`NonErrorThrown`}),Mf(t))}var Ff=e=>e.length>0,If=`~effect/Option`,Lf={[If]:{_A:e=>e},...Zd,[Symbol.iterator](){return new Ld(this)}},Rf=Object.defineProperty(Object.assign(Object.create(Lf),{_tag:`Some`,_op:`Some`,[Qu](e){return Vf(e)&&Uf(e)&&$u(this.value,e.value)},[Nu](){return Lu(Pu(this._tag))(Pu(this.value))},toString(){return`some(${xd(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:Md(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),zf=Pu(`None`),Bf=Object.assign(Object.create(Lf),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[Qu](e){return Vf(e)&&Hf(e)},[Nu](){return zf},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),Vf=e=>Mu(e,If),Hf=e=>e._tag===`None`,Uf=e=>e._tag===`Some`,Wf=Object.create(Bf),Gf=function(e){this.value=e};Gf.prototype=Rf;var Kf=e=>new Gf(e),qf=`~effect/Result`,Jf={[qf]:{_A:e=>e,_E:e=>e},...Zd,[Symbol.iterator](){return new Ld(this)}},Yf=Object.assign(Object.create(Jf),{_tag:`Success`,_op:`Success`,[Qu](e){return Zf(e)&&$f(e)&&$u(this.success,e.success)},[Nu](){return Lu(Pu(this._tag))(Pu(this.success))},toString(){return`success(${xd(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:Md(this.success)}}}),Xf=Object.assign(Object.create(Jf),{_tag:`Failure`,_op:`Failure`,[Qu](e){return Zf(e)&&Qf(e)&&$u(this.failure,e.failure)},[Nu](){return Lu(Pu(this._tag))(Pu(this.failure))},toString(){return`failure(${xd(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:Md(this.failure)}}}),Zf=e=>Mu(e,qf),Qf=e=>e._tag===`Failure`,$f=e=>e._tag===`Success`,ep=function(e){this.failure=e};ep.prototype=Xf;var tp=e=>new ep(e),np=function(e){this.success=e};np.prototype=Yf;var rp=e=>new np(e);function ip(e){return(t,n)=>t===n?0:e(t,n)}var ap=ip((e,t)=>e<t?-1:1),op=ip((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),sp=e=>ou(2,(t,n)=>e(t,n)===-1),cp=e=>ou(2,(t,n)=>e(t,n)===1),lp=e=>ou(2,(t,n)=>e(t,n)!==1),up=e=>ou(2,(t,n)=>e(t,n)!==-1),dp=()=>Wf,fp=Kf,pp=Hf,mp=Uf,hp=ou(2,(e,{onNone:t,onSome:n})=>pp(e)?t():n(e.value)),gp=ou(2,(e,t)=>pp(e)?t():e.value),iee=ou(2,(e,t)=>pp(e)?t():e),aee=gp(uu),oee=gp(du),see=ou(2,(e,t)=>pp(e)?dp():fp(t(e.value))),_p=rp,vp=tp,yp=Qf,cee=$f,bp=ou(2,(e,t)=>yp(e)?vp(t(e.failure)):e),xp=ou(2,(e,{onFailure:t,onSuccess:n})=>yp(e)?t(e.failure):n(e.success)),Sp=globalThis.Array,Cp=ou(2,(e,t)=>[...e,t]);Sp.isArray;var wp=Ff,Tp=Ff,Ep=()=>[],Dp=ou(2,(e,t)=>e.map(t)),Op=`~effect/BigDecimal`,kp={[Op]:Op,[Nu](){let e=Lp(this);return Lu(Vu(String(e.value)),Bu(e.scale))},[Qu](e){return Ap(e)&&Hp(this,e)===0},toString(){return`BigDecimal(${Wp(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[jd](){return this.toJSON()},pipe(){return ru(this,arguments)}},Ap=e=>Mu(e,Op),jp=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(kp);return n.value=e,n.scale=t,n},Mp=(e,t)=>{let n=jp(e,t);return n.normalized=n,n},Np=BigInt(0),Pp=BigInt(1),Fp=BigInt(10),Ip=Mp(Np,0),Lp=e=>{if(e.normalized===void 0){if(e.value===Np)e.normalized=Ip;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=Mp(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},Rp=100,zp=[Pp],Bp=(e,t)=>e===t?0:e<t?-1:1,Vp=(e,t)=>{let n=`${e.value<Np?-e.value:e.value}`,r=`${t.value<Np?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==Np)return i<Np?-1:1;let a=Math.max(n.length,r.length);return ap(n.padEnd(a,`0`),r.padEnd(a,`0`))},Hp=(e,t)=>{if(e.scale===t.scale)return Bp(e.value,t.value);let n=Up(e),r=Up(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>Rp)return n===-1?Vp(t,e):Vp(e,t);let o=zp[a]??=Fp**BigInt(a);return i>0?Bp(e.value,t.value*o):Bp(e.value*o,t.value)},Up=e=>e.value===Np?0:e.value<Np?-1:1,Wp=e=>{let t=Lp(e);if(Math.abs(t.scale)>=16)return Gp(t);let n=t.value<Np,r=`${n?-t.value:t.value}`,i=t.scale>0?r.padStart(t.scale+1,`0`):r.padEnd(r.length-t.scale,`0`),a=i.length-t.scale,o=t.scale>0?`${i.slice(0,a)}.${i.slice(a)}`:i;return n?`-${o}`:o},Gp=e=>{if(Kp(e))return`0e+0`;let t=Lp(e),n=`${t.value}`,r=t.value<Np?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},Kp=e=>e.value===Np,qp=e=>vf({op:e.label,[Kd]:e.evaluate}),Jp=`~effect/Context/Service`,Yp=function(){function e(){}let t=e;Object.setPrototypeOf(t,Xp);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Qp]=Qp,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Zp.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},Xp={[Jp]:Jp,...qp({label:`Service`,evaluate(e){return xf(vm(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return mm(this,e)},use(e){return Df(t=>e(vm(t.context,this)))},useSync(e){return Df(t=>xf(e(vm(t.context,this))))}},Zp=new Set,Qp=`~effect/Context/Reference`,$p=`~effect/Context`,em=8,tm=8,nm=(e,t,n,r)=>{let i=Object.create(cm);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},rm=(e,t)=>{t&&(rm(e,t.parent),e.set(t.key,t.value))},im=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return rm(t,e.overlay),e._flat=t},am=Symbol(),om=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?am:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=tm&&(n.base=im(n),n.overlay=void 0,n.depth=0),r)},sm=e=>nm(void 0,e,void 0,0),cm={get mapUnsafe(){return im(this)},...Zd,[$p]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Qu](e){if(!um(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!$u(r,n.get(e)))return!1;return!0},[Nu](){return Bu(this.mapUnsafe.size)}},lm=(e,t)=>e.cacheRoot===t.cacheRoot,um=e=>Mu(e,$p),dm=e=>!!e[Qp],fm=()=>pm,pm=sm(new Map),mm=(e,t)=>sm(new Map([[e.key,t]])),hm=ou(3,(e,t,n)=>gm(e,t.key,n)),gm=(e,t,n)=>{let r=e,i=Zp.has(t)?void 0:r.cacheRoot;if(r.depth>=em){let e=new Map(r.mapUnsafe);return e.set(t,n),nm(i,e,void 0,0)}return nm(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},_m=(e,t)=>{let n=om(e,t);return n===am?void 0:n},vm=ou(2,(e,t)=>{let n=om(e,t.key);if(n===am){if(dm(t))return bm(t);throw xm(t)}return n}),ym=`~effect/Context/defaultValue`,bm=e=>ym in e?e[ym]:e[ym]=e.defaultValue(),xm=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
74
|
-
`);e.splice(1,3),t.stack=e.join(`
|
|
75
|
-
`)}return t},Sm=Yp,Cm=`~effect/Duration`,wm=BigInt(0),Tm=BigInt(1),Em=BigInt(2),Dm=BigInt(10),Om=BigInt(1e3),km=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),Am=e=>km(e*1e6),jm=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=Dm**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*Em>=a?Tm:wm);return r?-s:s},Mm=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Nm=e=>{switch(typeof e){case`number`:return Gm(e);case`bigint`:return Wm(e);case`string`:{if(e===`Infinity`)return Hm;if(e===`-Infinity`)return Um;let t=Mm.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return Wm(jm(r,Tm));if(i===`micro`||i===`micros`)return Wm(jm(r,Om));let a=Number(r);switch(i){case`milli`:case`millis`:return Gm(a);case`second`:case`seconds`:return Km(a);case`minute`:case`minutes`:return qm(a);case`hour`:case`hours`:return Jm(a);case`day`:case`days`:return Ym(a);case`week`:case`weeks`:return Xm(a)}break}case`object`:{if(e===null)break;if(Cm in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Su)?Pm(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Vm:e[0]===-1/0||e[1]===-1/0?Um:e[0]===1/0||e[1]===1/0?Hm:zm(km(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?zm(n):zm(km(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return Pm(e)},Pm=e=>{throw Error(`Invalid Input: ${e}`)},Fm={_tag:`Millis`,millis:0},Im={_tag:`Infinity`},Lm={_tag:`NegativeInfinity`},Rm={[Cm]:Cm,[Nu](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?Pu(km(e)):Bu(this.value.millis)}case`Nanos`:return Pu(this.value.nanos);default:return Uu(this.value)}},[Qu](e){return Bm(e)&&lee(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[jd](){return this.toJSON()},pipe(){return ru(this,arguments)}},zm=e=>{let t=Object.create(Rm);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?Fm:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:Am(e)}:e>0?Im:Lm:e===wm?Fm:{_tag:`Nanos`,nanos:e},t},Bm=e=>Mu(e,Cm),Vm=zm(0),Hm=zm(1/0),Um=zm(-1/0),Wm=e=>zm(e),Gm=e=>zm(e),Km=e=>zm(e*1e3),qm=e=>zm(e*6e4),Jm=e=>zm(e*36e5),Ym=e=>zm(e*864e5),Xm=e=>zm(e*6048e5),Zm=e=>{let t=Nm(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return Am(t.value.millis)}},Qm=ou(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(Zm(e),t.value.nanos):n.onNanos(e.value.nanos,Zm(t))),$m=(e,t)=>Qm(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),lee=ou(2,(e,t)=>$m(e,t)),eh=Sm(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new rh}),th=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},uee=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},nh=e=>{try{return uee(e)}catch{return th(e)}},dee=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},rh=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?th:nh)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new fee(this.setImmediate)}},fee=class{tasks=new dee;running=void 0;setImmediate;constructor(e=nh){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},pee=Sm(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),mee=Sm(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),ih=Of,ah=`~effect/encoding/EncodingError`,oh=class extends ih(`EncodingError`){[ah]=ah},sh=`effect/Tracer/ParentSpan`;Yp()(sh,{fiberCached:!0});var hee=`effect/Tracer`,gee=`effect/Metric/FiberRuntimeMetrics`,_ee=Sm(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:du}),vee=Sm(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:lu}),yee=Sm(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),bee=Sm(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),xee=class extends rf{constructor(e,t=af){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[Qu](e){return gf(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Nu](){return Lu(Vu(`${this._tag}:${this.fiberId}`))(Fu(this.annotations))}},See=e=>new tf([new xee(e)]),ch=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return _p(n.error)}return vp(e)},Cee=e=>e.reasons.some(gf),wee=ou(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>mf(e)?(n=!0,new of(t(e.error),e.annotations)):e);return n?sf(r):e}),lh=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=Fd();i!==0&&Id(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(uh(i._tag===`Die`?i.defect:i.error,i.annotations,t))}if(n.length===0){let e=Error(`The fiber was interrupted by:`);e.name=`InterruptCause`,e.stack=hh(e,r);let i=new globalThis.Error(`All fibers interrupted without error`,{cause:e});i.name=`InterruptError`,i.stack=`${i.name}: ${i.message}`,n.push(uh(i,r[0].annotations,t))}}finally{i!==0&&Id(i)}return n},uh=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(dh(e),{cause:e.cause?uh(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=ph(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?mh(e,t):e}n?.includeCauseInStack&&(i.stack=vh(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else{i=new globalThis.Error(e?r===`string`?e:Od(e):`Unknown error: ${e}`);let n=`${i.name}: ${i.message}`;i.stack=t?mh(n,t):n}return i},dh=e=>{if(typeof e.message==`string`)return e.message;if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Od(e)},fh=/\((.*)\)/g,ph=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
|
|
76
|
-
`),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?mh(a.join(`
|
|
77
|
-
`),n):a.join(`
|
|
78
|
-
`)},mh=(e,t)=>{let n=t?.get(Sf.key);return n&&(e=`${e}\n${gh(n)}`),e},hh=(e,t)=>{let n=[`${e.name}: ${e.message}`];for(let e of t){let t=e.fiberId===void 0?`unknown`:`#${e.fiberId}`,r=e.annotations.get(Cf.key);n.push(` at fiber (${t})`),r&&n.push(gh(r))}return n.join(`
|
|
79
|
-
`)},gh=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(fh),i=!1;for(let[,e]of r)i=!0,t.push(` at ${n.name} (${e})`);i||t.push(` at ${n.name} (${e.replace(/^at /,``)})`)}else t.push(` at ${n.name}`);n=n.parent,r++}return t.join(`
|
|
80
|
-
`)},_h=e=>lh(e).map(vh).join(`
|
|
81
|
-
`),vh=e=>e.cause?`${e.stack} {\n${yh(e.cause,` `)}\n}`:e.stack,yh=(e,t)=>{let n=e.stack.split(`
|
|
82
|
-
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${yh(e.cause,`${t} `)}\n${t}}`),r},bh=`~effect/Fiber`,xh={_A:su,_E:su},Sh={id:0},Ch=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),wh=()=>Ch===void 0?void 0:new Ch(`effect/Fiber`),Th=()=>globalThis[vd],Eh=class{constructor(e,t=!0){this.setContext(e),this.id=++Sh.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[bh](){return xh}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return vm(this.context,e)}addObserver(e){return this._exit?(e(this._exit),fu):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=See(e);this.cache.stackFrame&&(n=pf(n,mm(Sf,this.cache.stackFrame))),t&&(n=pf(n,t)),this._interruptedCause=this._interruptedCause?lf(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Fh(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;return this._asyncContext=void 0,t.runInAsyncScope(this.evaluate,this,e)}if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===Xd){this._asyncContext=wh();return}let n=Ah.interruptChildren&&Ah.interruptChildren(this);if(n!==void 0)return this.evaluate(sg(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=fm()}runLoop(e){let t=globalThis[vd];globalThis[vd]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=Fh(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=sg(Bh,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[Kd](this),i===Xd){let e=this._yielded;if(Hd in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return Xd}}catch(e){if(!Mu(i,Kd))return Ef(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=Ef(e)}}finally{this._running=n,globalThis[vd]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Oh;for(;;){let t=this._stack.pop();if(!t)return;let n=t[Yd];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&kh-1))return xf(e);let t=this.getCont(qd);return t?t[qd](e,this):this.yieldWith(xf(e))}yieldWith(e){return this._yielded=e,Xd}children(){return this._children??=new Set}pipe(){return ru(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&lm(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=Dh(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},Dh=e=>{let t=_m(e,hee);return{scheduler:vm(e,eh),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:vm(e,vee),span:_m(e,sh),logLevel:vm(e,yee),minimumLogLevel:vm(e,bee),stackFrame:vm(e,_ee),runtimeMetrics:_m(e,gee),maxOpsBeforeYield:vm(e,pee),preventYield:vm(e,mee)}},Oh={[qd](e,t){return Fh(t._interruptedCause)},[Jd](e,t){return Fh(t._interruptedCause)}},kh=32,Ah={interruptChildren:void 0},jh=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Cf.key,e.cache.stackFrame),sm(t)},Mh=e=>Jh(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(Ph(r))}return a(),Lh(()=>i?.())}),Nh=e=>Df(t=>{let n=jh(t),r=Ep();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return og(Mh(r))}),Ph=xf,Fh=wf,Ih=Tf,Lh=yf({op:`Sync`,[Kd](e){let t=this[Gd](),n=e.getCont(qd);return n?n[qd](t,e):e.yieldWith(xf(t))}}),Rh=yf({op:`Suspend`,[Kd](e){return this[Gd]()}}),zh=xp({onFailure:Ih,onSuccess:Ph}),Bh=yf({op:`Yield`,[Kd](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(mg)},this[Gd]??0),e.yieldWith(()=>{t=!0})}})(0),Vh=e=>Rh(()=>Fh(e())),Hh=e=>Ef(e),Uh=e=>Rh(()=>Ih(e())),Wh=Ph(void 0),Gh=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Hg(e,`An error occurred in Effect.try`):e.catch;return Rh(()=>{try{return Ph(t())}catch(e){return Ih(n(e))}})},Kh=function(){let e=vf({op:`Async`,[Kd](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(qh(()=>(t=!0,r?.abort(),i??mg))),Xd):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),qh=yf({op:`AsyncFinalizer`,[Yd](e){e.interruptible&&(e.interruptible=!1,e._stack.push(Ag))},[Jd](e,t){return Cee(e)?sg(Og(wf(e),this[Gd]()),()=>Fh(e)):Fh(e)}}),Jh=e=>Kh(e,e.length>=2),Yh=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Xh=(e,...t)=>Yh(e.length,t.length===0?function(){return Zh(()=>e.apply(this,arguments))}:function(){let n=Zh(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),Zh=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return Ph(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Rh(()=>n?(n=!1,sg(r.value,e=>Qh(t,e))):Rh(()=>Qh(e())))}}}catch(e){return Hh(e)}},Qh=function(){let e=vf({op:`Iterator`,[qd](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return Ph(r.value);if(!cg(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[Kd](e){return this[qd](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),$h=function(e){return e._stack.push(this),this[Gd]},eg=vf({op:`OnSuccess`,[Kd]:$h}),tg=function(e,t,n){this[Gd]=e,this[qd]=t,this.payload=n};tg.prototype=eg;var ng=function(){return this.payload},rg=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),ig=function(e,t){let n=this.payload;return t.succeedWith(rg?n(e):Rd(()=>n(e)))},ag=function(e){let t=this.payload;return t(e)},og=e=>new tg(e,ng,mg),sg=ou(2,(e,t)=>new tg(e,ag,t)),cg=e=>e[Hd]!==void 0,lg=ou(2,(e,t)=>cg(e)?e._tag===`Success`?t(e.value):e:sg(e,t)),ug=ou(2,(e,t)=>new tg(e,ig,t)),dg=ou(2,(e,t)=>cg(e)?hg(e,t):ug(e,t)),fg=ou(2,(e,t)=>cg(e)?gg(e,t):Sg(e,t)),pg=e=>e._tag===`Success`,mg=xf(void 0),hg=ou(2,(e,t)=>e._tag===`Success`?xf(t(e.value)):e),gg=ou(2,(e,t)=>{if(e._tag===`Success`)return e;let n=ch(e.cause);return yp(n)?e:Tf(t(n.success))}),_g=ou(2,(e,t)=>new yg(e,t.length===1?t:e=>t(e))),vg=vf({op:`OnFailure`,[Kd]:$h}),yg=function(e,t){this[Gd]=e,this[Jd]=t};yg.prototype=vg;var bg=ou(3,(e,t,n)=>_g(e,e=>{let r=t(e);return yp(r)?Fh(r.failure):n(r.success,e)})),xg=ou(2,(e,t)=>bg(e,ch,e=>t(e))),Sg=ou(2,(e,t)=>xg(e,e=>Uh(()=>t(e)))),Cg=function(e,t){let n=this.payload;return t.succeedWith(rg?n.onSuccess(e):Rd(()=>n.onSuccess(e)))},wg=((e,t)=>{let n=vf({op:e,[Kd]:$h,[qd]:Cg,[Jd]:t}),r=function(e,t){this[Gd]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(mf);if(n===void 0)return Fh(e);let r=this.payload;return t.succeedWith(rg?r.onFailure(n.error):Rd(()=>r.onFailure(n.error)))}),Tg=ou(2,(e,t)=>new wg(e,t)),Eg=e=>cg(e)?xf(e):Dg(e),Dg=yf({op:`Exit`,[Kd](e){return e._stack.push(this),this[Gd]},[qd](e,t,n){return t.succeedWith(n??xf(e))},[Jd](e,t,n){return t.succeedWith(n??wf(e))}}),Og=(e,t)=>pg(e)?t:_g(t,t=>Fh(lf(e.cause,t))),kg=e=>Df(t=>t.interruptible?(t.interruptible=!1,t._stack.push(Ag),e):e),Ag=yf({op:`SetInterruptible`,[Yd](e){if(e.interruptible=this[Gd],e._interruptedCause&&e.interruptible)return()=>Fh(e._interruptedCause)}})(!0),jg=e=>e===`unbounded`?1/0:Math.max(1,e??1),Mg=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>sg(Eg(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??Wh),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!cg(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},Ng=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f,p,m=e=>{let t=Ef(e);return f=t,c=!0,u&&u.size>0?sg(kg(Nh(Array.from(u))),()=>f??t):t},h=()=>{let i=!1;for(;!f&&a<o;a++){let o=r[a],g=p??t(e,o,a);if(cg(g)){if(f=n(e,o,g,a),f)break}else if(l){p=void 0;let t=Fg(l,g,!0,!0,`inherit`);if(t._exit){if(f=n(e,o,t._exit,a),f)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(f){if(a._tag===`Failure`){let e=a.cause.reasons.filter(e=>e._tag!==`Interrupt`);if(e.length>0){let t=sf(e);f=wf(f._tag===`Failure`?lf(f.cause,t):t)}}}else{let t=n(e,o,a,r);t&&(f=t,h())}if(i){let e=h();e&&d(e)}else c&&u.size===0&&d(f??Wh)}catch(e){d(m(e))}}),u.size<s)continue;i=!0,a++;return}else return Jh(e=>{l=Th(),u=new Set,p=g,d=e;let t;try{t=h()}catch(t){return e(m(t))}return t?e(t):Rh(()=>(f??=mg,sg(u?Nh(u):Wh,()=>f?._tag===`Failure`?f:Wh)))})}if(c=!0,f){if(u&&u.size>0){let e=jh(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||f._tag===`Failure`)return f}else if(d){if(u)u.size===0&&d(Wh);else return mg}};return h()}},Pg=()=>e=>Ng(e),Fg=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Eh(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=wh(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},Ig=e=>(t,n)=>{let r=new Eh(n?.scheduler?hm(e,eh,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},Lg=Ig(fm()),Rg=(e=>{let t=Ig(e);return e=>{if(cg(e))return e;let n=new rh(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Ef(new Bg(r))}})(fm());Of(`TimeoutError`),Of(`IllegalArgumentError`),Of(`ExceededCapacityError`);var zg=`~effect/Cause/AsyncFiberError`,Bg=class extends Of(`AsyncFiberError`){[zg]=zg;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Vg=`~effect/Cause/UnknownError`,Hg=class extends Of(`UnknownError`){[Vg]=Vg;constructor(e,t){super({message:t,cause:e})}},Ug={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Ug.gray,Ug.blue,Ug.green,Ug.yellow,Ug.red,Ug.bgBrightRed,Ug.black;var Wg=mf,Gg=ff,Kg=wee,qg=_h;Yp()(`effect/Cause/StackTrace`),Yp()(`effect/Cause/InterruptorStackTrace`);var Jg=xf,Yg=wf,Xg=Tf,Zg=mg,Qg=pg,$g=`~effect/DateTime`,e_=`~effect/DateTime/TimeZone`,t_={[$g]:$g,pipe(){return ru(this,arguments)},[jd](){return this.toString()},toJSON(){return r_(this).toJSON()}};({...t_}),{...t_};var n_={[e_]:e_,[jd](){return this.toString()}};({...n_}),{...n_};var r_=e=>new Date(e.epochMilliseconds);globalThis.String;var i_=e=>e.trim(),a_=Ph,o_=Rh,s_=Ih,c_=Vh,l_=Hh,u_=Gh,d_=zh,f_=sg,p_=Eg,m_=_g,h_=Tg,g_=Lg,__=Rg;Yp()(`effect/Effect/Transaction`);var v_=dg,y_=fg,b_=lg,x_=Xh;Yp()(`effect/DateTime/CurrentTimeZone`);var S_=e=>w_(typeof e==`string`?T_.encode(e):e),C_=e=>{let t=E_(e),n=t.length;if(n%4!=0)return vp(new oh({kind:`Decode`,module:`Base64`,input:t,message:`Length must be a multiple of 4, but is ${n}`}));let r=t.indexOf(`=`);if(r!==-1&&(r<n-2||r===n-2&&t[n-1]!==`=`))return vp(new oh({kind:`Decode`,module:`Base64`,input:t,message:`Found a '=' character, but it is not at the end`}));try{let e=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=new Uint8Array(n/4*3-e);for(let e=0,i=0;e<n;e+=4,i+=3){let n=k_(t.charCodeAt(e))<<18|k_(t.charCodeAt(e+1))<<12|k_(t.charCodeAt(e+2))<<6|k_(t.charCodeAt(e+3));r[i]=n>>16,r[i+1]=n>>8&255,r[i+2]=n&255}return _p(r)}catch(e){return vp(new oh({kind:`Decode`,module:`Base64`,input:t,message:e instanceof Error?e.message:`Invalid input`}))}},w_=e=>{let t=e.length,n=``,r;for(r=2;r<t;r+=3)n+=D_[e[r-2]>>2],n+=D_[(e[r-2]&3)<<4|e[r-1]>>4],n+=D_[(e[r-1]&15)<<2|e[r]>>6],n+=D_[e[r]&63];return r===t+1&&(n+=D_[e[r-2]>>2],n+=D_[(e[r-2]&3)<<4],n+=`==`),r===t&&(n+=D_[e[r-2]>>2],n+=D_[(e[r-2]&3)<<4|e[r-1]>>4],n+=D_[(e[r-1]&15)<<2],n+=`=`),n},T_=new TextEncoder,E_=e=>e.replace(/[\n\r]/g,``),D_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,O_=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)O_[D_.charCodeAt(e)]=e;O_[61]=0;var k_=e=>{if(e>=O_.length||O_[e]===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return O_[e]};ih(`CookiesError`),{...Nd},{...Nd},{...Zd};function A_(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function j_(e){return t=>A_(t)?.[e]}var M_=`~structural`,N_=`~identifier`,P_=`~sentinels`,F_=`~constructor`,I_=[`title`,`description`,`default`,`examples`,`readOnly`,`writeOnly`,`format`,`contentEncoding`,`contentMediaType`,`contentSchema`],L_=j_(`identifier`),R_=j_(N_),z_=j_(`title`),B_=j_(`description`),V_=mu(e=>{let t=A_(e)?.identifier;return typeof t==`string`?t:e.getExpected(V_)}),H_=new Set([P_,M_,`representation`,`arbitraryConstraint`,`toJsonSchema`,`toCode`,`toEquivalence`,`toFormatter`,`toCodec`,`toCodecJson`,`toCodecStringTree`,`toCodecIso`,`toCodecArbitrary`]),U_=Symbol(),W_=Jg,G_=W_(U_),K_=W_(U_),q_=e=>e===U_?dp():fp(e),J_=e=>e._tag===`None`?G_:W_(e.value),Y_=`~effect/SchemaIssue/Issue`;function X_(e){return Mu(e,Y_)&&e[Y_]===Y_}function Z_(e){return Object.hasOwn(e,`input`)}var Q_=class{[Y_]=Y_;constructor(e,t){t?.reportInput===!0&&e!==U_&&(this.input=e)}},$_=class extends Q_{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},ev=class extends Q_{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},tv=class extends Q_{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},nv=class extends Q_{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},rv=class extends Q_{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},iv=class extends Q_{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},av=class extends Q_{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},ov=class extends Q_{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},sv=class extends Q_{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},cv=class extends Q_{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function lv(e,t,n){if(X_(e))return e;if(typeof e==`string`)return new ov({message:e},t,n);let r=typeof e.issue==`string`?new ov({message:e.issue},t,n):e.issue;return new tv(e.path,r)}function uv(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new ov(void 0,t,n):lv(e,t,n)}function dv(e,t,n,r){return Array.isArray(t)?Tp(t)?t.length===1?lv(t[0],n,r):new iv(e,Dp(t,e=>lv(e,n,r)),n,r):void 0:uv(t,n,r)}var fv=e=>{let t=xv(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return _v(V_(e.ast),e);case`InvalidValue`:{let t=gv(e);if(t!==void 0)return _v(t,e);let n=hv(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=hv(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=hv(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},pv=e=>xv(e.issue)??xv(e);function mv(e){return t=>({issues:vv(t,[],e?.leafHook??fv,e?.checkHook??pv)})}function hv(e){return Z_(e)?xd(e.input):void 0}function gv(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function _v(e,t){let n=hv(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function vv(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return vv(e.issue,t,n,r);let a=gv(e.issue);return[{path:t,message:a===void 0?_v(yv(e.filter),e):_v(a,e.issue)}]}case`Encoding`:return vv(e.issue,t,n,r);case`Pointer`:return vv(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>vv(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:xv(e)??_v(V_(e.ast),e)}]:e.issues.flatMap(e=>vv(e,t,n,r));default:return[{path:t,message:n(e)}]}}function yv(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>yv(e)).join(` & `)}}function Tee(){return e=>bv(e,``)}var Eee=Tee();function bv(e,t){let n;switch(e._tag){case`Filter`:{let r=pv(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return bv(e.issue,t);let r=gv(e.issue);n=r===void 0?_v(yv(e.filter),e):_v(r,e.issue)}break}case`Encoding`:return bv(e.issue,t);case`Pointer`:return bv(e.issue,t+wd(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>bv(e,t)).join(`
|
|
83
|
-
`);n=xv(e)??_v(V_(e.ast),e);break;default:n=fv(e)}return t?`${n}\n at ${t}`:n}function xv(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return xv(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function Sv(e){let t;for(let n of e.reasons){if(!Wg(n)||!X_(n.error))return;t??=n.error}return t}function Cv(e,t){let n=Sv(e);if(n===void 0)throw Error(t,{cause:e});return n}var wv=e=>Object.assign(Object.create(iu),e),Dee=wv({_tag:`Passthrough`});function Tv(){return Dee}function Ev(e){return wv({_tag:`Transform`,transform:e})}function Dv(e){return wv({_tag:`TransformEffect`,transform:e})}function Oee(){return Ev(globalThis.String)}function Ov(){return Ev(globalThis.Number)}function kee(){return Ev(i_)}function Aee(e){return Dv((t,n)=>u_({try:()=>JSON.parse(t,e?.reviver),catch:()=>new ov({expected:`a valid JSON string`},t,n)}))}function jee(e){return Dv((t,n)=>u_({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw TypeError(`Value cannot be represented as JSON`);return n},catch:()=>new ov({expected:`a JSON-serializable value`},t,n)}))}function Mee(){return Ev(S_)}function Nee(){return Dv((e,t)=>y_(d_(C_(e)),()=>new ov({expected:`a valid Base64 string`},e,t)))}var Pee=class extends au{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Pee(this.encode,this.decode)}},kv=`~effect/SchemaTransformation/Transformation`,Av=class extends au{[kv]=kv;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Av(this.encode,this.decode)}};function Fee(e){return Mu(e,kv)&&e[kv]===kv}var jv=e=>Fee(e)?e:new Av(e.decode,e.encode);function Iee(){return new Av(kee(),Tv())}var Lee=new Av(Tv(),Tv());function Mv(){return Lee}var Nv=new Av(Ov(),Oee()),Ree=new Av(Nee(),Mee());function zee(e){return new Av(Aee(e??{}),jee(e))}function Pv(e){return t=>t._tag===e}var Fv=Pv(`Declaration`),Iv=Pv(`Null`),Lv=Pv(`Undefined`),Rv=Pv(`Never`),zv=Pv(`String`),Bv=Pv(`Number`),Vv=Pv(`Boolean`),Hv=Pv(`Literal`),Uv=Pv(`UniqueSymbol`),Wv=Pv(`Arrays`),Gv=Pv(`Objects`),Kv=Pv(`Union`),qv=Pv(`Suspend`),Jv=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Yv={},Xv=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},Zv=`~effect/Schema`,Qv=class{[Zv]=Zv;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},$v=class extends Qv{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===U_?G_:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=yb(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new $v(a,r,this.annotations,t,void 0,this.context,n,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},ey=new class extends Qv{_tag=`Null`;getParser(){return Lb(this,null)}getExpected(){return`null`}},ty=class extends Qv{_tag=`Undefined`;getParser(){return Lb(this,void 0)}toCodecJson(){return sb(this,[ny])}getExpected(){return`undefined`}},ny=new Jv(ey,new Av(Ev(()=>void 0),Ev(()=>null))),ry=new ty,iy=new class extends Qv{_tag=`Unknown`;getParser(){return Rb(this,ku)}getExpected(){return`unknown`}},ay=class extends Qv{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${xd(e)}`);this.literal=e}getParser(){return Lb(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?oy(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:oy(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function oy(e){let t=globalThis.String(e.literal);return sb(e,[new Jv(new ay(t),new Av(Ev(()=>e.literal),Ev(()=>t)))])}var sy=new class extends Qv{_tag=`String`;getParser(){return Rb(this,xu)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Jb(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},cy=class extends Qv{_tag=`Number`;getParser(){return Rb(this,Su)}matchKey(e,t){return this._match(Ub,e,t)}matchPart(e,t){return this._match(Hb,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Jb(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(ly(this.checks,`effect/schema/isFinite`)||ly(this.checks,`effect/schema/isInt`))?this:sb(this,[nb])}toCodecStringTree(){return this.toCodecJson()===this?sb(this,[Kb]):sb(this,[qb])}getExpected(){return`number`}};function ly(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&ly(e.checks,t))}var uy=new cy,dy=new class extends Qv{_tag=`Boolean`;getParser(){return Rb(this,Cu)}getExpected(){return`boolean`}},fy=class extends Qv{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Db(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Db(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}let c=e=>{let{input:t,len:r,options:i}=e;if(n.rest.length===0&&r>a)for(let o=a;o<r;o++){let r=new rv(n,t[o],i),a=new tv([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return s_(new iv(n,[a],t,i))}return e.issues?s_(new iv(n,e.issues,t,i)):W_(e.output)},l=(e,t)=>{let r=e.length,i={ast:n,getParser:s,input:e,len:r,tailThreshold:Math.max(a,r-o),output:new globalThis.Array(r),issues:void 0,options:t},u=n.rest.length===0?a:Math.max(r,a+o),d=t.concurrency===void 0?1:jg(t.concurrency),f=d===1?hy(i,e,0,u):gy(i,e,{concurrency:d,end:u});if(!f)return c(i);if(cg(f))return b_(f,()=>c(i));let p=!0;return o_(()=>p?(p=!1,f_(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===U_)return G_;try{return Array.isArray(e)?(r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)}))),l(e,a)):s_(new av(n,e,a))}catch(e){return l_(e)}}}_rebuild(e,t,n){let r=yb(this.elements,e),i=yb(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new fy(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function py(e,t,n,r){if(n._tag===`Failure`)return _y(e,e.ast,r,n);let i=n===K_?t:n[Gd];if(i!==U_)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Db(t.ast))return;let n=new tv([r],new nv(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Xg(new iv(e.ast,[n],e.input,e.options))}}var my={onItem(e,t,n){let r=n<e.len?t:U_;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:py},hy=Mg()(my),gy=Pg()(my),_y=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=Sv(r.cause);if(i===void 0)return Yg(Kg(r.cause,r=>new iv(t,[new tv([n],r)],e.input,e.options)));let a=new tv([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Xg(new iv(t,[a],e.input,e.options))},vy=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function yy(e,t,n=Yv){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(r=>Object.prototype.propertyIsEnumerable.call(e,r)&&t.matchKey(r,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(zb(Nb(t)))}var by=class{name;type;constructor(e,t){this.name=e,this.type=t}};function xy(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(xy);default:return!1}}function Sy(e){let t=lb(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(Sy);default:return!1}}function Cy(e){return xy(e)&&Sy(e)}var wy=class{parameter;type;constructor(e,t){if(!Cy(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Db(t)&&!Ib(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Ty=class extends Qv{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o}getParser(e,t=e){let n=this,r=n.propertySignatures.length,i=n.indexSignatures.length;if(!r&&!i)return Rb(n,Ou);let a,o,s=()=>(a||(a=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),o=i?n.indexSignatures.map(n=>({is:n,parserKey:e(zb(n.parameter)),parserValue:t(n.type)})):void 0),a),c=()=>{let e=new Set(n.propertySignatures.map(e=>typeof e.name==`number`?globalThis.String(e.name):e.name)),t=(t,i,a,o,s)=>{if(s._tag===`Failure`)return _y(t,n,i,s)??Zg;let c=s===K_?o:s[Gd];if(a!==U_&&c!==U_){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return Zg;zd(t.out,a,c)}return Zg},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!cg(t))return f_(p_(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return _y(e,n,r,a)??Zg;let o=a===K_?r:a[Gd],s=e.input[r],l=i.parserValue(s,e.options);return cg(l)?t(e,r,o,s,l):f_(p_(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return cg(a)?t(e,n,n,i,a):f_(p_(a),r=>t(e,n,n,i,r))},u=i?Pg()({onItem:(e,[t,n])=>n.is.parameter===sy?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return x_(function*(t,d){if(t===U_)return U_;if(!(typeof t==`object`&&t&&!Array.isArray(t)))return yield*s_(new av(n,t,d));s();let f=t,p={},m={ast:n,input:f,out:p,issues:void 0,options:d},h=d.errors===`all`,g=d.onExcessProperty===`error`,_=d.concurrency===void 0?1:jg(d.concurrency),v=i&&g?n.indexSignatures.map(e=>yy(f,e.parameter,d)):void 0;if(g){let r=v?new Set(e):e;if(v)for(let e of v)for(let t of e)r.add(t);let i=Reflect.ownKeys(f);for(let e=0;e<i.length;e++){let a=i[e];if(!r.has(a)&&Object.prototype.propertyIsEnumerable.call(f,a)){let e=new rv(n,f[a],d),r=new tv([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*s_(new iv(n,[r],t,d))}}}if(r){let e=_===1?Oy(m,a):ky(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===sy?l:c,r=v?.[e]??(t.is.parameter===sy?Object.keys(f):yy(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!cg(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=Ep();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===sy?Object.keys(f):yy(f,n.is.parameter,d));for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=u(m,e,{concurrency:_});t&&(yield*t)}return m.issues?yield*s_(new iv(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return f_(p_(n),n=>{let i=Ey(e,r,n);if(i)return i;let o=()=>W_(e.out),s=Oy(e,a.slice(t+1));return s?b_(s,o):o()})};return(e,t)=>{if(e===U_)return G_;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&jg(t.concurrency)!==1)return(l??=c())(e,t);if(!(typeof e==`object`&&e&&!Array.isArray(e)))return s_(new av(n,e,t));let r=s(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=By(i,s),l=c?i[s]:U_,d=n.parser(l,t);if(!cg(d))return u(o,e,d);if(d===K_){c&&zd(a,s,l);continue}let f=Ey(o,n,d);if(f)return f}}catch(e){return l_(e)}return W_(a)}}_rebuild(e,t,n,r){let i=yb(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new by(t.name,n)}),a=yb(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new wy(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new Ty(i,a,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function Ey(e,t,n){if(n._tag===`Failure`)return _y(e,e.ast,t.name,n);if(n===K_)return;let r=n[Gd];if(r!==U_){zd(e.out,t.name,r);return}if(delete e.out[t.name],!Db(t.type)){let n=new tv([t.name],new nv(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return Xg(new iv(e.ast,[n],e.input,e.options))}}var Dy={onItem(e,t){if(!By(e.input,t.name))return t.parser(U_,e.options);let n=e.input[t.name];return zd(e.out,t.name,n),t.parser(n,e.options)},step:Ey},Oy=Mg()(Dy),ky=Pg()(Dy);function Ay(e,t){return e?t?[...e,...t]:e:t}function jy(e,t,n){return new Ty(Reflect.ownKeys(e).map(t=>new by(t,e[t].ast)),[],n,t)}function My(e){return e.ast}function Ny(e,t,n){return new Hy(e.map(My),t,void 0,n)}var Py=hu(e=>{for(;;){if(qv(e))return iy;let t=e.encoding;if(!t)return e.recur?.(Py,su)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==su))return iy;e=t[t.length-1].to}});function Fy(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Fy)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Iy(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[P_];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Db(t)){if(Hv(t))return[{key:e.name,literal:t.literal}];if(Uv(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Db(e)){if(Hv(e))return[{key:t,literal:e.literal}];if(Uv(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Iy(Py(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Iy(e.thunk())}}var Ly=new WeakMap,Ry=Object.freeze([]),zy=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,By=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function Vy(e){let t=Ly.get(e);if(t)return t;let n,r=0,i,a,o=!0,s=[];for(let t=0;t<e.length;t++){let c=e[t],l=Py(c);if(Rv(l))continue;if(Hv(l)||Uv(l)){a??=new Map;let e=Hv(l)?l.literal:l.symbol;s[t]=e;let n=a.get(e);n||a.set(e,n=[]),n.push(t)}else o=!1;let u=Iy(l);if(u.length){n??=new Map,r++;for(let{key:e,literal:r}of u){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Fy(l);for(let n of e)(i[n]??=[]).push(t)}}let c={},l=e=>c[e]??=Object.freeze(i?.[e]??Ry);if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Ry;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=new Map;for(let[e,t]of i)a.set(e,Object.freeze(Array.from(t)));let o=Object.freeze(e.map((e,t)=>t));t=(e,t)=>{if(ju(e)){let n=By(e,r)?e[r]:void 0;if(n!==void 0)return a.get(n)??Ry;if(t)return o}return Ry}}else if(n){let e;for(let t of n)(!e||t[1][0].size>e[1][0].size)&&t[1][1].size===r&&(e=t);t=(t,r)=>{let a=zy(t);if(!ju(t))return l(a);let o=new Set(i?.[a]),s;if(e){let[n,[i]]=e,c=By(t,n),u=c?t[n]:void 0;if(c&&(!r||u!==void 0)){let e=i.get(u);if(!e)return l(a);for(let t of e)o.add(t);s=n}}if(s===void 0)for(let[e,[i,a]]of n){let n=By(t,e),s=n?t[e]:void 0;if(n&&(!r||s!==void 0)){let e=i.get(s);if(e)for(let t of e)o.add(t)}else if(r)for(let e of a)o.add(e)}for(let[e,[i,a]]of n){if(e===s)continue;let n=By(t,e),c=n?t[e]:void 0;if(n&&(!r||c!==void 0)){let e=i.get(c);for(let t of o)a.has(t)&&!e?.has(t)&&o.delete(t)}}return Array.from(o).sort((e,t)=>e-t)}}else t=e=>{let t=l(zy(e));return a?t.filter(t=>s[t]===void 0||s[t]===e):t};return Ly.set(e,t),t}var Hy=class extends Qv{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this,r=t!==void 0,i=[],a=t=>i[t]??=e(n.types[t]),o;return(e,t)=>{if(e===U_)return G_;let i=(o??=Vy(n.types))(e,r);if(i.length===0)return s_(new sv(n,[],e,t));if(i.length===1){let r=a(i[0])(e,t);return r._tag===`Success`?r:cg(r)?Uy(n,r.cause,e,t):Wy(n,r,e,t)}return Gy(n,a,i,e,t)}}_rebuild(e,t,n){let r=yb(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new Hy(r,this.options,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=Nb(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(Hv);if(t.length>0)return`${Yy(n.isMutable)}[ ${t.map(t=>e(t)+Xy(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>Hv(e.type));if(t.length>0)return`{ ${t.map(t=>`${Yy(t.type.context?.isMutable)}${Cd(t.name)}${Xy(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function Uy(e,t,n,r){let i=Sv(t);return i?Xg(new sv(e,[i],n,r)):Yg(t)}function Wy(e,t,n,r){return m_(t,t=>Uy(e,t,n,r))}function Gy(e,t,n,r,i){let a={ast:e,parser:t,input:r,out:void 0,successes:e.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:i},o=qy(a,n);if(!o)return a.out?a.out:s_(new sv(e,a.issues??[],r,i));if(cg(o))return Ky(o,a);let s=!0;return o_(()=>s?(s=!1,Ky(o,a)):Gy(e,t,n,r,i))}function Ky(e,t){return b_(e,e=>t.out===K_?a_(t.input):t.out?t.out:s_(new sv(t.ast,t.issues??[],t.input,t.options)))}var qy=Mg()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=Sv(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),Xg(new cv(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return Zg}}}),Jy=new Hy([new ay(`Infinity`),new ay(`-Infinity`),new ay(`NaN`)]);function Yy(e){return e?``:`readonly `}function Xy(e){return e?`?`:``}var Zy=class extends au{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new Zy(this.run,{...this.annotations,...e},this.aborted)}abort(){return new Zy(this.run,this.annotations,!0)}and(e,t){return new Qy([this,e],t)}},Qy=class extends au{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new Qy(this.checks,{...this.annotations,...e})}and(e,t){return new Qy([this,e],t)}};function $y(e,t,n=!1){return new Zy((t,n,r)=>dv(n,e(t,n,r),t,r),t,n)}function eb(e){return $y(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitraryConstraint:{number:`finite`},...e})}var tb=fb(uy,[eb()]),nb=new Jv(new Hy([tb,Jy]),new Av(Ov(),Ev(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function rb(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return $y(e=>(n.lastIndex=0,n.test(e)),{expected:`a string matching the RegExp ${r.source}`,representation:{id:`effect/schema/isPattern`,payload:r},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[r]},...t})}var ib=new WeakMap;function ab(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>e===`context`||e===`encoding`)&&ib.set(n,ob(e)),n}function ob(e){let t=ib.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return ib.set(e,n),n}function sb(e,t){return e.encoding===t?e:ab(e,{encoding:t})}function cb(e,t){if(e.context===t)return e;let n=ob(e);return n.context===t&&n.encoding===e.encoding?n:ab(e,{context:t})}function lb(e){return e.encoding?lb(e.encoding[e.encoding.length-1].to):e}function ub(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return db(e,Cp(e.checks.slice(0,-1),n.annotate(t)))}return ab(e,{annotations:{...e.annotations,...t}})}function db(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:ab(e,{checks:t})}function fb(e,t){return db(e,Ay(e.checks,t))}function pb(e,t){let n=t(e.to);return n===e.to?e:new Jv(n,e.transformation)}function mb(e,t){let n=e,r=n[n.length-1],i=pb(r,t);return i===r?e:Cp(e.slice(0,e.length-1),i)}function hb(e){return t=>t.encoding?sb(t,mb(t.encoding,e)):t}function gb(e,t){return hb(e=>cb(e,t))(e)}function _b(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:sb(r,mb(r.encoding,n))}return e(r)}return hu(n)}function vb(e,t,n){let r=new Jv(e,t);return sb(n,n.encoding?[...n.encoding,r]:[r])}function yb(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r],a=t(i);if(n)n[r]=a;else if(a!==i){n=Array(e.length);for(let t=0;t<r;t++)n[t]=e[t];n[r]=a}}return n??e}function bb(e,t){return cb(e,e.context?new Xv(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Xv(!1,!1,void 0,t))}var xb=hu(e=>Sb(cb(e,e.context?e.context.isOptional===!1?new Xv(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Xv(!0,!1)))),Sb=hb(xb),Cb=mu(e=>xb(new Hy([e,ry])));function wb(e,t,n){return vb(e,n,t)}function Tb(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Tu(e.literal)&&!t.includes(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.includes(e.symbol)||t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Eb(e,t){let{literals:n,parameters:r}=Tb(e);return new Ty(n.map(e=>new by(e,t)),r.map(e=>new wy(e,t)))}function Db(e){return e.context?.isOptional??!1}function Ob(e){return e.context?.isMutable??!1}function kb(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(kb)}function Ab(e){function t(e){return kb(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return wp(n)?n:void 0}function jb(e){let t=!0;function n(e){return t=t&&!e.encoding&&!qv(e),t&&`recur`in e&&e.recur(n),e}return`recur`in e&&e.recur(n),t}var Mb=hu(e=>{let t=ob(e);if(t!==e){let n=Mb(t);return n===t&&e.encoding===void 0?e:cb(n,e.context)}let n=`recur`in e?e.recur(Mb):e;if(`encodingChecks`in n&&n.encodingChecks){let t=jb(e)?n.encodingChecks:Wv(n)||Gv(n)||Fv(n)&&n.typeParameters.length>0?Ab(n.encodingChecks):void 0;return ab(n,{encodingChecks:void 0,checks:Ay(n.checks,t)})}return n}),Nb=hu(e=>Mb(Fb(e)));function Pb(e,t){let n=t,r=n.length,i=n[r-1],a=[new Jv(Fb(sb(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Jv(Fb(n[e-1].to),n[e].transformation.flip()));let o=Fb(i.to);return o.encoding?sb(o,[...o.encoding,...a]):sb(o,a)}var Fb=mu(e=>{if(e.encoding)return Pb(e,e.encoding);let t=ob(e);if(t!==e){let n=Fb(t);return n===t?e:cb(n,e.context)}return`flip`in e?e.flip(Fb):`recur`in e?e.recur(Fb):e});function Ib(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Ib);default:return!1}}function Lb(e,t){let n=t===0?K_:W_(t);return(r,i)=>r===U_?G_:r===t?n:s_(new av(e,r,i))}function Rb(e,t){return(n,r)=>n===U_?G_:t(n)?K_:s_(new av(e,n,r))}var zb=_b(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(zb)}}),Bb=_b(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Bb)}}),Vb=`[\\s\\S]*?`,Hb=new globalThis.RegExp(`^${vy}$`),Ub=new globalThis.RegExp(`^(?:${vy}|Infinity|-Infinity|NaN)$`);function Wb(e){return rb(Hb,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Hb.source}),...e})}var Gb=fb(sy,[Wb()]),Kb=new Jv(Gb,Nv),qb=new Jv(new Hy([Gb,Jy]),Nv);function Jb(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Jb(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new $_(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Yb(e){if(!Fv(e))return;let t=e.annotations?.[F_];return Eu(t)?t(e.typeParameters):void 0}var Xb=A_,Zb=z_,Qb=B_;function $b(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function ex(e){return e===void 0||typeof e==`string`}function tx(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function nx(e){return tx(e,$b)}var rx=new $v([],()=>(e,t,n)=>nx(e)?K_:s_(new av(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>sx}),ix=new Jv(rx,Mv()),ax=new Jv(new Hy([new fy(!1,[],[rx]),new Ty([],[new wy(sy,rx)])]),Mv());function ox(e){return tx(e,ex)}var sx=new Jv(new $v([],()=>(e,t,n)=>ox(e)?K_:s_(new av(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),Mv()),cx=(e,t,n)=>e===K_?n(t):b_(e,n);function lx(e){if(e._tag===`Middleware`)return(t,n,r)=>ux(t===K_?e.decode(W_(q_(n)),r):e.decode(v_(t,q_),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===K_?W_(t):e;case`Transform`:{let e=e=>e===U_?G_:W_(t.transform(e));return(t,n)=>cx(t,n,e)}case`TransformOptional`:{let e=e=>J_(t.transform(q_(e)));return(t,n)=>cx(t,n,e)}case`TransformEffect`:return(e,n,r)=>cx(e,n,e=>e===U_?G_:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>cx(e,n,e=>ux(t.transform(q_(e),r)))}}var ux=e=>b_(e,J_),dx=(e,t,n,r)=>m_(r,r=>c_(()=>Kg(r,r=>new ev(e,r,t,n))));function fx(e,t){let n=lx(e.link.transformation),r;return(i,a)=>{if(i===U_)return G_;if(e.isConstructed(i))return K_;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function px(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==U_&&r!==void 0)return t(r,i);let a=n;if(cg(a)&&a._tag===`Success`){let e=t(a[Gd],i);return e===K_?a:e}return b_(dx(e,r,i,a),e=>{let n=t(e,i);return n===K_?W_(e):n})}}function mx(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:px(e,n)}function hx(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Yb(e):void 0,o=a?fx(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>lx(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(cg(r)){if(r._tag===`Success`){let i=r===K_?t:r[Gd];if(t!==U_&&i!==U_){let i=Jb(u,t,void 0,e,n);i&&(r=s_(new iv(e,i,t,n)))}}}else r=f_(r,r=>{if(t!==U_&&r!==U_){let r=Jb(u,t,void 0,e,n);if(r)return s_(new iv(e,r,t,n))}return a_(r)})}if(s&&!n.disableChecks){if(cg(r)){if(r._tag===`Success`){let i=r===K_?t:r[Gd];if(i===U_)return r;let a=Jb(s,i,void 0,e,n);a&&(r=s_(new iv(e,a,i,n)))}}else r=f_(r,t=>{if(t!==U_){let r=Jb(s,t,void 0,e,n);if(r)return s_(new iv(e,r,t,n))}return a_(t)})}return r},p=i===void 0?f:i(f);return c?(n,r)=>{let i=d??=c.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=c.length-1;e>=0;e--)if(o=l[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[Gd],o=t(a,r)):o=b_(o,e=>{let n=t(e,r);return n===K_?W_(e):n})}if(o._tag===`Success`){let e=o[Gd],t=p(e,r);return t===K_?o:t}return o=dx(e,n,r,o),b_(o,e=>{let t=p(e,r);return t===K_?W_(e):t})}:p}var gx=Symbol(),_x=new WeakMap,vx=e=>Sx(e).parser,yx=e=>Sx(e).makeEffect,bx=e=>mx(e,yx),xx=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=hx(this.ast,vx)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=hx(this.ast,yx,bx)}};function Sx(e){let t=_x.get(e);if(t!==void 0)return t;let n=new xx(e);return _x.set(e,n),n}function Cx(e){let t=e.ast,n;return(e,r)=>(n??=Ix(Ux,Mb(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function wx(e){let t=Cx(e);return(e,n)=>{let r=__(t(e,n));return Qg(r)?fp(r.value):(Cv(r.cause,`Option adapter can only return none for schema issues`),dp())}}function Tx(e){return Vx(Mb(e.ast))}function Ex(e){return Ox(e.ast)}function Dx(e){{let t=Lx(Px(e));return e=>{let n=t(e,Yv);return Qg(n)?!0:(Cv(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}}function Ox(e){let t=Mb(e),n=e=>(n=Dx(t),n(e));return e=>n(e)}function kx(e,t){let n=Px(e.ast);return t===void 0?n:(e,r)=>n(e,Mx(t,r))}function Ax(e,t){return Rx(kx(e,t))}function jx(e,t){return zx(kx(e,t))}var Mx=(e,t)=>t?{...e,...t}:e,Nx=e=>e===U_?s_(new ov):a_(e);function Px(e){return Ix(Hx,e)}function Fx(e,t){return e===K_?a_(t):cg(e)?e[Gd]===U_?Nx(U_):e:b_(e,Nx)}function Ix(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Yv);return a===K_?a_(r):cg(a)?a[Gd]===U_?Nx(U_):a:b_(a,Nx)}}function Lx(e){return(t,n)=>__(e(t,n))}function Rx(e){let t=Lx(e);return(e,n)=>{let r=t(e,n);return Qg(r)?fp(r.value):(Cv(r.cause,`Option adapter can only return none for schema issues`),dp())}}function zx(e){let t=Lx(e);return(e,n)=>{let r=t(e,n);return Qg(r)?_p(r.value):vp(Cv(r.cause,`Result adapter can only return schema issues`))}}function Bx(e,t){let n=__(e);if(Qg(n))return n.value;let r=Cv(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function Vx(e){let t,n;return(r,i)=>{t??=Sx(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??Yv,o=t.make;if(o!==void 0&&r!==U_){let e;try{e=o(r,a)}catch(e){throw Cv(Gg(e),`Constructor adapter can only throw schema issues`),e}if(e!==gx&&e!==U_)return e}return Bx(Fx((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var Hx=e=>Sx(e).parser,Ux=e=>Sx(e).makeEffect,Wx=`~effect/Schema/Schema`,Gx=Symbol(),Kx={[Wx]:Wx,get make(){let e=Tx(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=Cx(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=wx(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return ru(this,arguments)},annotate(e){return this.rebuild(ub(this.ast,e))},annotateKey(e){return this.rebuild(bb(this.ast,e))},check(...e){return this.rebuild(fb(this.ast,e))},rebuild(e){return qx(e,this[Gx])}};function qx(e,t){function n(){}let r=Object.setPrototypeOf(n,Kx);return t&&(Object.hasOwn(t,`name`)||Object.hasOwn(t,`length`)||Object.hasOwn(t,`__proto__`))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[Gx]=t,r.ast=e,r}function Jx(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Yx(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Xx(e){return encodeURI(Jx(e)).replace(/#/g,`%23`)}function Zx(e){if(e.length===0||e===`#`)return``;if(!e.startsWith(`#`))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,`%`).replace(/#/g,`%23`)!==t)return;let e=decodeURIComponent(t);return e.startsWith(`/`)&&!/~(?:[^01]|$)/.test(e)?e:void 0}catch{return}}function Qx(e,t){return n(e,!1,!0);function n(e,r,i=!1){if(!Au(e))return e;let a=r||!i&&nS(e.$id),o={};for(let t of Object.keys(e)){let r=e[t],i=r;switch(t){case`$defs`:case`properties`:case`patternProperties`:case`dependentSchemas`:i=tS(r,e=>n(e,a))??r;break;case`allOf`:case`anyOf`:case`oneOf`:case`prefixItems`:i=Array.isArray(r)?r.map(e=>n(e,a)):r;break;case`not`:case`additionalProperties`:case`propertyNames`:case`unevaluatedProperties`:case`items`:case`contains`:case`unevaluatedItems`:case`if`:case`then`:case`else`:case`contentSchema`:i=n(r,a)}zd(o,t,i)}return t(o,a),o}}function $x(e,t){return Qx(e,e=>{eS(e,t)})}function eS(e,t){typeof e.$ref==`string`&&zd(e,`$ref`,t(e.$ref,`$ref`)),typeof e.$dynamicRef==`string`&&zd(e,`$dynamicRef`,t(e.$dynamicRef,`$dynamicRef`))}function tS(e,t){if(!Au(e))return;let n={};for(let r of Object.keys(e))zd(n,r,t(e[r],r));return n}function nS(e){return typeof e==`string`&&e.length>0&&e[0]!==`#`}var rS=[`$anchor`,`$defs`,`$dynamicAnchor`,`$dynamicRef`,`$vocabulary`,`contentSchema`,`dependentRequired`,`dependentSchemas`,`maxContains`,`minContains`,`prefixItems`,`unevaluatedItems`,`unevaluatedProperties`];[...rS],[...rS];var iS=_b(e=>{let t=lS(e,iS),n=e.context;return t===e||n===void 0?t:gb(t,aS(n))});function aS(e){return e.constructorDefault===void 0?e:new Xv(e.isOptional,e.isMutable,void 0,e.annotations)}function oS(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function sS(e){return t=>{let n=[...t].sort((t,n)=>e(Nb(t))-e(Nb(n)));return n.some((e,n)=>e!==t[n])?n:t}}var cS=sS(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function lS(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Eu(n))return sb(e,[ix]);let r=n(e.typeParameters.map(e=>qx(Nb(e))));return r===void 0?e:sb(e,[pb(r,t)])}case`Unknown`:return sb(e,[ix]);case`ObjectKeyword`:return sb(e,[ax]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return oS(e),e.recur(t,Bb);case`Union`:{let n=cS(e.types);return n===e.types?e.recur(t):new Hy(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}globalThis.RegExp;var uS=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`);function dS(e,t){return t.length>0&&(e+=`\n at ${wd(t)}`),Error(e)}function fS(e){return`#/$defs/${Xx(e)}`}var pS=new Set([...H_,N_,...I_]);function mS(e,t){if(e===void 0)return;let n={},r=e.title;typeof r==`string`&&(n.title=r);let i=e.description,a=e.expected;typeof i==`string`?n.description=i:t?.generateDescriptions===!0&&typeof a==`string`&&(n.description=a);let o=e.default;nx(o)&&(n.default=o);let s=e.examples;Array.isArray(s)&&nx(s)&&(n.examples=s);let c=e.readOnly;typeof c==`boolean`&&(n.readOnly=c);let l=e.writeOnly;typeof l==`boolean`&&(n.writeOnly=l);let u=e.format;typeof u==`string`&&(n.format=u);let d=e.contentEncoding;typeof d==`string`&&(n.contentEncoding=d);let f=e.contentMediaType;typeof f==`string`&&(n.contentMediaType=f);let p=e.contentSchema;if(nx(p)&&(n.contentSchema=p),t?.includeAnnotationKey!==void 0)for(let[r,i]of Object.entries(e))pS.has(r)||!t.includeAnnotationKey(r)||nx(i)&&zd(n,r,i);return Object.keys(n).length===0?void 0:n}function hS(e){let t=e.type===`number`||e.type===`integer`?e.type:void 0,n=e;if(t!==void 0&&(n={...e},delete n.type),Array.isArray(n.allOf)){let e=[],r=!1;for(let i of n.allOf){let n=hS(i);n.type!==void 0&&(r=!0,(t===void 0||n.type===`integer`)&&(t=n.type)),Object.keys(n.schema).length>0&&e.push(n.schema)}if(r){let{allOf:t,...r}=n;n=e.length===0?r:{...r,allOf:e}}}return{type:t,schema:n}}function gS(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==`number`)return!1;let t=e.anyOf[1];return t?.type===`string`&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(`NaN`)&&t.enum.includes(`Infinity`)&&t.enum.includes(`-Infinity`)}var _S=`|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|`;function vS(e,t){return Object.keys(e).every(e=>t.includes(`|${e}|`))}function yS(e,t){return typeof e.$ref!=`string`&&t.every(t=>!Object.hasOwn(e,t))}var bS=`|title|description|default|examples|readOnly|writeOnly|`,xS=_S+bS;function SS(e,t,n){if(Object.keys(e).length===0)return t;let r=Object.keys(t);if(r.length===0)return e;let i=e.type===`number`||e.type===`integer`?e.type:void 0,a=gS(e);if(i!==void 0||a){let r=hS(t);if(r.type!==void 0){let t=i===`integer`||r.type===`integer`?`integer`:`number`,o={...e,type:t};a&&delete o.anyOf;let s=Object.keys(r.schema);return s.length===0?o:vS(r.schema,bS)&&yS(o,s)?{...o,...r.schema}:SS(o,r.schema,n)}}if(n&&yS(e,r))return{...e,...t};let o=Array.isArray(t.allOf)&&r.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...o]}:typeof e.$ref==`string`?{allOf:[e,...o]}:{...e,allOf:o}}function CS(e,t=new Set){return typeof e==`boolean`?e:t.has(e)?!0:(t.add(e),e.every(e=>CS(e,t)))}function wS(e){return Array.isArray(e)}function TS(e,t,n,r){let i=new Map,a=new Map,o=new WeakMap,s=new Map,c=new Map,l=Object.keys(n);for(let e of l)m(e,[`references`,e]);let u=Dp(e,(e,n)=>v(e,t[n],[]));for(let[e,t]of s.values())if(!CS(e))for(let e of t)Array.isArray(e.oneOf)&&(e.anyOf=e.oneOf,delete e.oneOf);for(let e of l){let t=n[e],r=g(t);if(r===void 0)continue;let o=i.get(e)[0],s=c.get(r),l=s?.find(e=>$u(i.get(e)[0],o));l===void 0?s===void 0?c.set(r,[e]):s.push(e):a.set(e,l)}let d=Dp(u,h),f={};for(let e of l)a.has(e)||zd(f,e,h(i.get(e)[0]));return{dialect:`draft-2020-12`,schemas:d,definitions:f};function p(e){return Array.isArray(e.oneOf)&&s.get(e.oneOf)?.[1].push(e),e}function m(e,t){if(!Object.hasOwn(n,e))throw dS(`Invalid reference ${e}`,[...t,`$ref`]);let r=i.get(e);if(r!==void 0)return r;let a=[{},[]];return i.set(e,a),a[0]=v(n[e],[`references`,e],a[1]),a}function h(e){return $x(e,e=>{let t=Zx(e);if(t===void 0){if(/^#(?:\/|%2f)/i.test(e))throw Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(e)}`);return e}if(!t.startsWith(`/$defs/`))return e;let n=t.indexOf(`/`,7),r=a.get(Yx(t.slice(7,n<0?void 0:n)));return r===void 0?e:e.replace(/^#(?:\/|%2f).*?(?:\/|%2f).*?(?=\/|%2f|$)/i,fS(r))})}function g(e){if(e._tag===`Reference`)return;let t=e.checks.length===0?e.annotations:e.checks[e.checks.length-1].annotations;return typeof t?.identifier!=`string`&&typeof t?.[`~identifier`]==`string`?t[N_]:void 0}function _(e,t,n,i){let a=e.annotations,o=a?.toJsonSchema;if(o!==void 0){let s=o({type:t,schemas:e.representation?.schemas?.map((e,t)=>v(e,[...n,`representation`,`schemas`,t],i))??[]}),c=wS(s);c&&i.push(!1);let l=c?s[0]:s,u=mS(a,r),d=u===void 0?l:{...l,...u},f=u===void 0?_S:xS;return[d,e._tag===`Filter`&&vS(d,f)&&(u===void 0||vS(u,bS))?!0:void 0]}if(e._tag===`Filter`){i.push(!1);return}let s=e.checks.flatMap((e,r)=>{let a=_(e,t,[...n,`checks`,r],i);return a===void 0?[]:[a[0]]});if(s.length===0)return;let c=mS(a,r),l={allOf:s};return[c===void 0?l:{...l,...c}]}function v(e,t,n){if(e._tag===`Reference`)return n.push(m(e.$ref,t)[1]),{$ref:fS(e.$ref)};let i=o.get(e);if(i!==void 0)return n.push(i[1]),i[0];let a=[];n.push(a);let s=y(e,t,a),c=mS(e.annotations,r);c!==void 0&&(s={...s,...c});for(let n=0;n<e.checks.length;n++){let r=typeof s.type==`string`&&ES(s.type)?s.type:void 0,i=_(e.checks[n],r,[...t,`checks`,n],a);i!==void 0&&(s=SS(s,...i))}return o.set(e,[s,a]),p(s)}function y(e,t,n){switch(e._tag){case`Any`:case`Unknown`:return{};case`ObjectKeyword`:return{anyOf:[{type:`object`},{type:`array`}]};case`Void`:case`Undefined`:case`Null`:return{type:`null`};case`BigInt`:return{type:`string`,allOf:[{pattern:`^-?\\d+$`}]};case`Symbol`:return{type:`string`,allOf:[{pattern:`^Symbol\\(([\\s\\S]*)\\)$`}]};case`UniqueSymbol`:return globalThis.Symbol.keyFor(e.symbol)===void 0?{not:{}}:{type:`string`,enum:[globalThis.String(e.symbol)]};case`Declaration`:return n.push(!1),{};case`Suspend`:return v(e.thunk,[...t,`thunk`],n);case`Never`:return{not:{}};case`String`:return{type:`string`};case`Number`:return{anyOf:[{type:`number`},{type:`string`,enum:[`NaN`,`Infinity`,`-Infinity`]}]};case`Boolean`:return{type:`boolean`};case`Literal`:{let t=e.literal;return typeof t==`bigint`?{type:`string`,enum:[globalThis.String(t)]}:{type:typeof t,enum:[t]}}case`Enum`:{let n=e.enums.map(([e,n],r)=>{if(typeof n==`number`&&!globalThis.Number.isFinite(n))throw dS(`Invalid numeric enum value ${globalThis.String(n)}`,[...t,`enums`,r,1]);return{type:typeof n,enum:[n],title:e}});return n.length===0?{not:{}}:{anyOf:n}}case`TemplateLiteral`:return{type:`string`,pattern:`^${e.parts.map(OS).join(``)}$`};case`Arrays`:{if(e.rest.length>1)throw dS(`Invalid schema representation document`,[...t,`rest`]);let i={type:`array`},a=e.elements.length,o=e.elements.map((e,i)=>{e.isOptional&&a--;let o=v(e.type,[...t,`elements`,i,`type`],n),s=mS(e.annotations,r);return s===void 0?o:p(SS(o,s))});if(o.length>0?(i.prefixItems=o,i.maxItems=e.elements.length,a>0&&(i.minItems=a)):i.items=!1,e.rest.length===1){delete i.maxItems;let r=v(e.rest[0],[...t,`rest`,0],n);Object.keys(r).length>0?i.items=r:delete i.items}return i}case`Objects`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return{not:{type:`null`}};let i={type:`object`},a={},o=[];for(let i=0;i<e.propertySignatures.length;i++){let s=e.propertySignatures[i];if(typeof s.name!=`string`)throw dS(`Invalid schema representation document`,[...t,`propertySignatures`,i,`name`]);let c=s.name,l=v(s.type,[...t,`propertySignatures`,i,`type`],n),u=mS(s.annotations,r);zd(a,c,u===void 0?l:p(SS(l,u))),s.isOptional||o.push(c)}e.propertySignatures.length>0&&(i.properties=a),o.length>0&&(i.required=o);let s={},c=[],l=[],u=!1;for(let r=0;r<e.indexSignatures.length;r++){let i=e.indexSignatures[r],a=v(i.type,[...t,`indexSignatures`,r,`type`],n);$u(a,{not:{}})&&(a=!1),l.push(a);let o=b(i.parameter,[...t,`indexSignatures`,r,`parameter`],new Set);if(o===void 0){u=!0,n.push(!1);continue}if(o.length===0)c.push(a);else for(let e of o){let t=s[e];zd(s,e,t===void 0?a:t===!1||a===!1?!1:p(SS(t,a)))}}let d=Object.keys(s).length>0;if(d&&(i.patternProperties=s),u&&r?.onExcessProperty===`error`){let r=[];e.propertySignatures.length>0&&r.push({enum:Object.keys(a)});for(let i=0;i<e.indexSignatures.length;i++)r.push(v(e.indexSignatures[i].parameter,[...t,`indexSignatures`,i,`parameter`],n));i.propertyNames=r.length===1?r[0]:{anyOf:r},i.additionalProperties=l.length===1?l[0]:{anyOf:l},c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})))}else c.length===0?i.additionalProperties=u||r?.onExcessProperty!==`error`:c.length===1&&e.propertySignatures.length===0&&!d?i.additionalProperties=c[0]:c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})));return typeof i.additionalProperties==`object`&&i.additionalProperties!==null&&Object.keys(i.additionalProperties).length===0&&delete i.additionalProperties,i}case`Union`:{let r=[],i=e.types.map((e,n)=>v(e,[...t,`types`,n],r));if(n.push(r),i.length===0)return{not:{}};let a=e.options?.mode??`anyOf`;if(a===`anyOf`&&i.length>1){let e=DS(i);if(e!==void 0)return e}return a===`oneOf`&&s.set(i,[r,[]]),{[a]:i}}}}function b(e,t,r){switch(e._tag){case`Reference`:{if(!Object.hasOwn(n,e.$ref))throw dS(`Invalid reference ${e.$ref}`,[...t,`$ref`]);if(m(e.$ref,t),r.has(e.$ref))return;let i=new Set(r).add(e.$ref);return b(n[e.$ref],[`references`,e.$ref],i)}case`String`:{if(e.checks.length===0)return[];if(e.checks.length!==1||e.checks[0]._tag!==`Filter`||e.checks[0].annotations?.toJsonSchema===void 0)return;let n=[],r=v(e,t,n);return CS(n)&&r.type===`string`&&typeof r.pattern==`string`&&vS(r,`|type|pattern|title|description|default|examples|readOnly|writeOnly|`)?[r.pattern]:void 0}case`TemplateLiteral`:return e.checks.length===0?[`^${e.parts.map(OS).join(``)}$`]:void 0;case`Union`:{if(e.types.length===0||e.checks.length>0||e.options?.mode===`oneOf`)return;let n=[];for(let i=0;i<e.types.length;i++){let a=b(e.types[i],[...t,`types`,i],r);if(a===void 0)return;if(a.length===0)return[];n.push(...a)}return n}default:throw dS(`Invalid schema representation document`,t)}}}function ES(e){return e===`string`||e===`number`||e===`boolean`||e===`array`||e===`object`||e===`null`||e===`integer`}function DS(e){let t,n=[];for(let r of e){if(Object.keys(r).length!==2||r.type===void 0||!Array.isArray(r.enum)||r.enum.length===0)return;if(t===void 0)t=r.type;else if(r.type!==t)return;for(let e of r.enum){if(n.includes(e))return;n.push(e)}}return{type:t,enum:n}}function OS(e){switch(e._tag){case`Literal`:return uS(globalThis.String(e.literal));case`String`:return Vb;case`Number`:return vy;case`TemplateLiteral`:return e.parts.map(OS).join(``);case`Union`:return`(?:${e.types.map(OS).join(`|`)})`;default:throw dS(`Invalid schema representation document`,[])}}function kS(e,t){let n=TS([e.representation],[[`representation`]],e.references,t);return{dialect:n.dialect,schema:n.schemas[0],definitions:n.definitions}}var AS=({identifier:e})=>e;function jS(e){return e===void 0?void 0:{annotations:e}}function MS(e,t){let{references:n,representations:r}=NS([e],t);return{representation:r[0],references:n}}function NS(e,t){let n={},r=new Map,i=new Set,a=new Map,o=new Set;for(let t of e)f(t);let s=t?.referencePolicy??AS;for(let e of a.values())for(let t of e.values()){let e=s({ast:t.ast,occurrences:t.occurrences,identifier:t.identifier});e===void 0?t.isRecursive&&(t.reference=c(`${t.ast._tag}_`,t,``)):t.reference=c(e,t,e===t.identifier||!e.endsWith(`_`)?`_`:``)}return{representations:Dp(e,e=>m(e)),references:n};function c(e,t,n=`_`){let i=e,a=0;for(;r.has(i);){if(r.get(i)===t)return i;i=`${e}${n}${++a}`}return r.set(i,t),i}function l(e,t,n){let r=t.fallback;return r===void 0?n===t.identifier?e:ub(e,{identifier:n}):R_(e)===r?e:ub(e,{[N_]:r})}function u(e,t){if(!Object.hasOwn(n,e)&&!i.has(e)){i.add(e);let r=h(t);i.delete(e),zd(n,e,r)}return{_tag:`Reference`,$ref:e}}function d(e){let t=lb(e),n=ob(t),r=L_(t),i=r===void 0?(t===e?void 0:L_(e))??R_(t):void 0;i!==void 0&&(r=`${i}Encoded`);let o=a.get(n);o===void 0&&(o=new Map,a.set(n,o));let s=o.get(r);return s===void 0&&(s={ast:n,identifier:r,fallback:i,occurrences:0,isRecursive:!1,reference:void 0},o.set(r,s)),s}function f(e){let t=d(e),n=t.ast;if(t.occurrences++,o.has(t)){t.isRecursive=!0;return}if(!(t.occurrences>1)){switch(o.add(t),p(n.checks),n._tag){case`Declaration`:case`Arrays`:case`Objects`:case`Union`:n.recur(e=>(f(e),e));break;case`TemplateLiteral`:n.parts.forEach(f);break;case`Suspend`:f(n.thunk())}o.delete(t)}}function p(e){e?.forEach(e=>{e.annotations?.representation?.schemas?.forEach(e=>f(Mb(e))),e._tag===`FilterGroup`&&p(e.checks)})}function m(e){let t=d(e),n=t.ast,r=t.reference;return r===void 0?h(n):u(r,t.identifier===void 0?n:l(n,t,r))}function h(e){let t=g(e.checks);switch(e._tag){case`Declaration`:return{_tag:`Declaration`,typeParameters:e.typeParameters.map(e=>m(e)),checks:t,...v(e.annotations)};case`Null`:case`Undefined`:case`Void`:case`Never`:case`Unknown`:case`Any`:case`String`:case`Boolean`:case`Number`:case`BigInt`:case`Symbol`:case`ObjectKeyword`:return{_tag:e._tag,checks:t,...jS(e.annotations)};case`Literal`:return{_tag:`Literal`,literal:e.literal,checks:t,...jS(e.annotations)};case`UniqueSymbol`:return{_tag:`UniqueSymbol`,symbol:e.symbol,checks:t,...jS(e.annotations)};case`Enum`:return{_tag:`Enum`,enums:e.enums,checks:t,...jS(e.annotations)};case`TemplateLiteral`:return{_tag:`TemplateLiteral`,parts:e.parts.map(e=>m(e)),checks:t,...jS(e.annotations)};case`Arrays`:return{_tag:`Arrays`,elements:e.elements.map(e=>{let t=lb(e),n=t.context?.annotations;return{isOptional:Db(t),type:m(e),...jS(n)}}),rest:e.rest.map(e=>m(e)),checks:t,...jS(e.annotations)};case`Objects`:return{_tag:`Objects`,propertySignatures:e.propertySignatures.map(e=>{let t=lb(e.type),n=t.context?.annotations;return{name:e.name,type:m(e.type),isOptional:Db(t),isMutable:Ob(t),...jS(n)}}),indexSignatures:e.indexSignatures.map(e=>({parameter:m(e.parameter),type:m(e.type)})),checks:t,...jS(e.annotations)};case`Union`:return{_tag:`Union`,types:e.types.map(e=>m(e)),...e.options===void 0?{}:{options:e.options},checks:t,...jS(e.annotations)};case`Suspend`:return{_tag:`Suspend`,checks:[],thunk:m(e.thunk()),...jS(e.annotations)}}}function g(e){return e?.map(_)??[]}function _(e){switch(e._tag){case`Filter`:return{_tag:`Filter`,aborted:e.aborted,...y(e.annotations)};case`FilterGroup`:return{_tag:`FilterGroup`,checks:Dp(e.checks,_),...y(e.annotations)}}}function v(e){if(e===void 0)return;let{representation:t,...n}=e;return{...t===void 0?void 0:{representation:t},...Object.keys(n).length===0?void 0:{annotations:n}}}function y(e){if(e===void 0)return;let{representation:t,...n}=e,r=t===void 0?void 0:t.schemas===void 0?t:{...t,schemas:t.schemas.map(e=>m(Mb(e)))};return{...r===void 0?void 0:{representation:r},...Object.keys(n).length===0?void 0:{annotations:n}}}}function PS(e){return Qg(e)?e.value:{issues:[{message:qg(e.cause)}]}}function FS(e,t){let n=kx(e),r={errors:`all`,...t?.parseOptions},i=mv(t),a=e=>{let t=new rh(`sync`),a=g_(h_(n(e,r),{onFailure:i,onSuccess:e=>({value:e})}),{scheduler:t});a.currentDispatcher?.flush();let o=a.pollUnsafe();return o?PS(o):new Promise(e=>{a.addObserver(t=>{e(PS(t))})})};if(Object.hasOwn(e,`~standard`)){let t=e;return`validate`in t[`~standard`]||Object.assign(t[`~standard`],{validate:a}),t}return Object.assign(e,{"~standard":{version:1,vendor:`effect`,validate:a}})}var IS=e=>e,LS=`~effect/Schema/SchemaError`;function RS(e){return Mu(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}function zS(){return(e,t,n)=>$S(new $v(e.map(My),e=>t(e.map(e=>$S(e))),n))}function BS(e,t){return zS()([],()=>(t,n,r)=>e(t)?a_(t):s_(new av(n,t,r)),t)}var VS=class extends ih(`SchemaError`){[LS]=LS;constructor(e){let t=Fd();Id(0);try{super({issue:e})}finally{Id(t)}}get message(){return Eee(this.issue)}toString(){return`SchemaError(${this.message})`}};function HS(e){return RS(e)}function US(e){return cg(e)?WS(e):m_(e,e=>c_(()=>Kg(e,e=>new VS(e))))}function WS(e){return Qg(e)?e:Yg(Kg(e.cause,e=>new VS(e)))}function GS(e,t){let n;for(let r of e.reasons){if(!Wg(r)||!HS(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function KS(e){let t=__(e);if(Qg(t))return t.value;throw GS(t.cause,`Sync adapter can only throw schema errors`)}function qS(e,t){return FS(e,t)}var JS=Ex;function YS(e,t){let n=kx(e,t);return(e,t)=>US(n(e,t))}var XS=Ax;function ZS(e,t){let n=jx(e,t);return(e,t)=>bp(n(e,t),e=>new VS(e))}function QS(e,t){let n=YS(e,t);return(e,t)=>KS(n(e,t))}var $S=qx,eC=IS(e=>$S(xb(e.ast),{schema:e})),tC=IS(e=>{let t=gC(e);return $S(Cb(e.ast),{schema:t})});function nC(e){let t=$S(new ay(e),{literal:e,transform(n){return t.pipe(vC(nC(n),{decode:Ev(()=>n),encode:Ev(()=>e)}))}});return t}var rC=$S(iy),iC=$S(ey),aC=$S(ry),oC=$S(sy),sC=$S(uy),cC=$S(dy);function lC(e,t){return $S(e,{fields:t,mapFields(e,t){let n=e(this.fields);return lC(jy(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Y(e){return lC(jy(e,void 0),e)}function uC(e,t){return $S(Eb(e.ast,t.ast),{key:e,value:t})}var dC=IS(e=>$S(new fy(!1,[],[e.ast]),{value:e}));function fC(e,t){return $S(e,{members:t,mapMembers(e,t){let n=e(this.members);return fC(Ny(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function pC(e,t){return fC(Ny(e,t,void 0),e)}function mC(e){let t=e.map(nC);return $S(Ny(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return pC(e(this.members))},pick(e){return mC(e)},transform(e){return pC(t.map((t,n)=>t.transform(e[n])))}})}var hC=IS(e=>pC([e,iC])),gC=IS(e=>pC([e,aC]));function X(...e){return t=>t.check(...e)}function _C(e){return t=>$S(t.ast,{schema:t,identifier:e})}function vC(e,t){return n=>$S(wb(n.ast,e.ast,t?jv(t):Mv()),{from:n,to:e})}function yC(e,t){return BS(t=>t instanceof e,t)}function bC(){return(e,t)=>new Jv(e.ast,jv(t))}var xC=$y,SC=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function CC(e){let t=new globalThis.RegExp(SC);return xC(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitraryConstraint:{patterns:[{source:SC,flags:``}]},...e})}function wC(e,t){let n=e.source,r=e.flags,i=/^[dg]*uy?$/.test(r),a=r===``?`new RegExp(${xd(n)})`:`new RegExp(${xd(n)}, ${xd(r)})`;return rb(e,{toJsonSchema:()=>i?{pattern:r.endsWith(`y`)?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${a})`}),...t})}var TC=$S(tb);function EC(e){let t=cp(e.order),n=e.formatter??xd;return(r,i)=>xC(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r,exclusiveMinimum:!0},...e.annotate?.(r),...i})}function DC(e){let t=up(e.order),n=e.formatter??xd;return(r,i)=>xC(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r},...e.annotate?.(r),...i})}function OC(e){let t=lp(e.order),n=e.formatter??xd;return(r,i)=>xC(e=>t(e,r),{expected:`a value less than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,maximum:r},...e.annotate?.(r),...i})}function kC(e){let t=up(e.order),n=cp(e.order),r=lp(e.order),i=sp(e.order),a=e.formatter??xd;return(o,s)=>{let c=o.exclusiveMinimum?n:t,l=o.exclusiveMaximum?i:r;return xC(e=>c(e,o.minimum)&&l(e,o.maximum),{expected:`a value between ${a(o.minimum)}${o.exclusiveMinimum?` (excluded)`:``} and ${a(o.maximum)}${o.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:o.minimum,maximum:o.maximum,...o.exclusiveMinimum&&{exclusiveMinimum:!0},...o.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(o),...s})}}function AC(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${xd(e)}`);return e}var jC=EC({order:op,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:AC(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${xd(e)})`})})}),MC=DC({order:op,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:AC(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${xd(e)})`})})}),NC=OC({order:op,annotate:e=>({representation:{id:`effect/schema/isLessThanOrEqualTo`,payload:{maximum:AC(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${xd(e)})`})})}),PC=kC({order:op,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:AC(e.minimum),maximum:AC(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${xd(e.minimum)}, maximum: ${xd(e.maximum)}, exclusiveMinimum: ${xd(t)}, exclusiveMaximum: ${xd(n)} })`})}}});function FC(e){return xC(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>[{type:`integer`},!0],toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var IC=sC.check(FC());function LC(e,t){return e=VC(e),RC(e,Math.ceil(e/2),t)}function RC(e,t,n){return xC(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:n})=>n===`string`?e<=1?{minLength:t}:[{minLength:t},!0]:n===`array`?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[M_]:!0,arbitraryConstraint:{minLength:e},...n})}function zC(e){return RC(1,1,e)}function BC(e,t){return e=VC(e),xC(t=>t.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:`effect/schema/isMaxLength`,payload:{maxLength:e}},toJsonSchema:({type:t})=>t===`string`?e===0?{maxLength:e}:[{maxLength:e},!0]:t===`array`?{maxItems:e}:t===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[M_]:!0,arbitraryConstraint:{maxLength:e},...t})}function VC(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}var HC=oC.check(zC());globalThis.RegExp,globalThis.URL;var UC=oC.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function WC(e,t){return UC.pipe(vC(e,zee(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams;var GC=oC.check(CC()),KC=oC.annotate({expected:`a string that will be decoded as a trimmed string`}).pipe(vC(GC,Iee())),qC=oC.annotate({expected:`a base64 encoded string that will be decoded as Uint8Array`,format:`byte`,contentEncoding:`base64`}),Bee=yC(globalThis.Uint8Array,{representation:{id:`effect/schema/Uint8Array`,payload:null},toCode:()=>({runtime:`Schema.Uint8Array`,Type:`globalThis.Uint8Array`}),expected:`Uint8Array`,toCodecJson:()=>bC()(qC,Ree)});function Vee(e,t){return kS(MS(iS(e.ast),t),t)}var Hee=Symbol(`workers-module`);Symbol.dispose||(Symbol.dispose=Symbol.for(`dispose`)),Symbol.asyncDispose||(Symbol.asyncDispose=Symbol.for(`asyncDispose`)),Promise.withResolvers||(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}});var JC=globalThis[Hee],YC=JC?JC.RpcTarget:class{},Uee=async function(){}.constructor,Wee=typeof Buffer<`u`?Buffer.prototype:void 0;function XC(e){switch(typeof e){case`boolean`:case`number`:case`string`:return`primitive`;case`undefined`:return`undefined`;case`object`:case`function`:break;case`bigint`:return`bigint`;default:return`unsupported`}if(e===null)return`primitive`;let t=Object.getPrototypeOf(e);switch(t){case Object.prototype:return`object`;case Function.prototype:case Uee.prototype:return`function`;case Array.prototype:return`array`;case Date.prototype:return`date`;case Uint8Array.prototype:case Wee:case ArrayBuffer.prototype:case DataView.prototype:case Int8Array.prototype:case Uint8ClampedArray.prototype:case Int16Array.prototype:case Uint16Array.prototype:case Int32Array.prototype:case Uint32Array.prototype:case BigInt64Array.prototype:case BigUint64Array.prototype:case Float32Array.prototype:case Float64Array.prototype:return`bytes`;case WritableStream.prototype:return`writable`;case ReadableStream.prototype:return`readable`;case URL.prototype:return`url`;case Headers.prototype:return`headers`;case Request.prototype:return`request`;case Response.prototype:return`response`;case Blob.prototype:return`blob`;case ow.prototype:return`stub`;case sw.prototype:return`rpc-promise`;default:if(JC){if(t==JC.RpcStub.prototype||e instanceof JC.ServiceStub)return`rpc-target`;if(t==JC.RpcPromise.prototype||t==JC.RpcProperty.prototype)return`rpc-thenable`}return e instanceof YC?`rpc-target`:e instanceof Error?`error`:`unsupported`}}function ZC(){throw Error(`RPC map() implementation was not loaded.`)}var QC={applyMap:ZC,sendMap:ZC};function $C(){throw Error(`Stream implementation was not loaded.`)}var ew={createWritableStreamHook:$C,createWritableStreamFromHook:$C,createReadableStreamHook:$C},tw=class{stream(e,t){let n=this.call(e,t),r;try{r=n.pull()}catch(e){throw n.dispose(),e}let i;return r instanceof Promise?i=r.then(e=>{e.dispose()}):(r.dispose(),i=Promise.resolve()),{promise:i}}},nw=class extends tw{error;constructor(e){super(),this.error=e}call(e,t){return t.dispose(),this}map(e,t,n){for(let e of t)e.dispose();return this}get(e){return this}dup(){return this}pull(){return Promise.reject(this.error)}ignoreUnhandledRejections(){}dispose(){}onBroken(e){try{e(this.error)}catch(e){Promise.resolve(e)}}},rw=new nw(Error(`Attempted to use RPC stub after it has been disposed.`)),iw=(e,t,n)=>e.call(t,n);function Gee(e,t){let n=iw;iw=e;try{return t()}finally{iw=n}}var aw=Symbol(`realStub`),Kee={apply(e,t,n){let r=e.raw;return new sw(iw(r.hook,r.pathIfPromise||[],fw.fromAppParams(n)),[])},get(e,t,n){let r=e.raw;if(t===aw)return r;if(t in sw.prototype)return r[t];if(typeof t==`string`)return new sw(r.hook,r.pathIfPromise?[...r.pathIfPromise,t]:[t]);if(t===Symbol.dispose&&(!r.pathIfPromise||r.pathIfPromise.length==0))return()=>{r.hook.dispose(),r.hook=rw}},has(e,t){let n=e.raw;return t===aw?!0:t in sw.prototype?t in n:typeof t==`string`||t===Symbol.dispose&&(!n.pathIfPromise||n.pathIfPromise.length==0)},construct(e,t){throw Error(`An RPC stub cannot be used as a constructor.`)},defineProperty(e,t,n){throw Error(`Can't define properties on RPC stubs.`)},deleteProperty(e,t){throw Error(`Can't delete properties on RPC stubs.`)},getOwnPropertyDescriptor(e,t){},getPrototypeOf(e){return Object.getPrototypeOf(e.raw)},isExtensible(e){return!1},ownKeys(e){return[]},preventExtensions(e){return!0},set(e,t,n,r){throw Error(`Can't assign properties on RPC stubs.`)},setPrototypeOf(e,t){throw Error(`Can't override prototype of RPC stubs.`)}},ow=class e extends YC{constructor(e,t){if(super(),!(e instanceof tw)){let n=e;if(e=n instanceof YC||n instanceof Function?_w.create(n,void 0):new hw(fw.fromAppReturn(n)),t)throw TypeError(`RpcStub constructor expected one argument, received two.`)}this.hook=e,this.pathIfPromise=t;let n=()=>{};return n.raw=this,new Proxy(n,Kee)}hook;pathIfPromise;dup(){let t=this[aw];return t.pathIfPromise?new e(t.hook.get(t.pathIfPromise)):new e(t.hook.dup())}onRpcBroken(e){this[aw].hook.onBroken(e)}map(e){let{hook:t,pathIfPromise:n}=this[aw];return QC.sendMap(t,n||[],e)}toString(){return`[object RpcStub]`}},sw=class extends ow{constructor(e,t){if(e instanceof tw)super(e,t??[]);else{if(t!==void 0)throw TypeError(`RpcPromise constructor expected one argument, received two.`);let n=XC(e);if(n===`rpc-promise`){let t=uw(e);if(t.pathIfPromise.length>0)super(t.hook,t.pathIfPromise);else{let e=t.hook;t.hook=rw,super(e,[])}}else if(n===`rpc-thenable`)super(_w.create(e,void 0),[]);else{let t=new vw(Promise.resolve(e).then(e=>new hw(fw.fromAppReturn(e))));t.ignoreUnhandledRejections(),super(t,[])}}}then(e,t){return dw(this).then(...arguments)}catch(e){return dw(this).catch(...arguments)}finally(e){return dw(this).finally(...arguments)}toString(){return`[object RpcPromise]`}};function qee(e){let{hook:t,pathIfPromise:n}=e[aw];return n&&n.length>0?t.get(n):t}function Jee(e){let{hook:t,pathIfPromise:n}=e[aw];return n?t.get(n):t.dup()}function cw(e){let{hook:t,pathIfPromise:n}=e[aw];if(!(n&&n.length>0))return t}function lw(e){return e[aw].hook}function uw(e){return e[aw]}async function dw(e){let{hook:t,pathIfPromise:n}=e[aw];return n.length>0&&(t=t.get(n)),(await t.pull()).deliverResolve()}var fw=class e{value;source;hooks;promises;static fromAppParams(t){return new e(t,`params`)}static fromAppReturn(t){return new e(t,`return`)}static fromArray(t){let n=[],r=[],i=[];for(let e of t){e.ensureDeepCopied();for(let t of e.hooks)n.push(t);for(let t of e.promises)t.parent===e&&(t={parent:i,property:i.length,promise:t.promise}),r.push(t);i.push(e.value)}return new e(i,`owned`,n,r)}static forEvaluate(t,n){return new e(null,`owned`,t,n)}static deepCopyFrom(t,n,r){let i=new e(null,`owned`,[],[]);return i.value=i.deepCopy(t,n,`value`,i,!0,r),i}constructor(e,t,n,r){this.value=e,this.source=t,this.hooks=n,this.promises=r}rpcTargets;getHookForRpcTarget(e,t,n=!0){if(this.source===`params`){if(n){let t=e;typeof t.dup==`function`&&(e=t.dup())}return _w.create(e,t)}if(this.source===`return`){let r=this.rpcTargets?.get(e);return r?n?r.dup():(this.rpcTargets?.delete(e),r):(r=_w.create(e,t),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,r),r.dup()):r)}throw Error(`owned payload shouldn't contain raw RpcTargets`)}getHookForWritableStream(e,t,n=!0){if(this.source===`params`)return ew.createWritableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=ew.createWritableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw WritableStreams`)}getHookForReadableStream(e,t,n=!0){if(this.source===`params`)return ew.createReadableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=ew.createReadableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw ReadableStreams`)}deepCopy(e,t,n,r,i,a){switch(XC(e)){case`unsupported`:return e;case`primitive`:case`bigint`:case`date`:case`bytes`:case`blob`:case`url`:case`error`:case`undefined`:return e;case`array`:{let t=e,n=t.length,r=Array(n);for(let e=0;e<n;e++)r[e]=this.deepCopy(t[e],t,e,r,i,a);return r}case`object`:{let t={},n=e;for(let e in n)t[e]=this.deepCopy(n[e],n,e,t,i,a);return t}case`stub`:case`rpc-promise`:{let t=e,a;if(a=i?Jee(t):qee(t),t instanceof sw){let e=new sw(a,[]);return this.promises.push({parent:r,property:n,promise:e}),e}return this.hooks.push(a),new ow(a)}case`function`:case`rpc-target`:{let n=e,r;return r=a?a.getHookForRpcTarget(n,t,i):_w.create(n,t),this.hooks.push(r),new ow(r)}case`rpc-thenable`:{let o=e,s;return s=a?new sw(a.getHookForRpcTarget(o,t,i),[]):new sw(_w.create(o,t),[]),this.promises.push({parent:r,property:n,promise:s}),s}case`writable`:{let n=e,r;return r=a?a.getHookForWritableStream(n,t,i):ew.createWritableStreamHook(n),this.hooks.push(r),n}case`readable`:{let n=e,r;return r=a?a.getHookForReadableStream(n,t,i):ew.createReadableStreamHook(n),this.hooks.push(r),n}case`headers`:return new Headers(e);case`request`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Request(t)}case`response`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Response(t.body,t)}default:throw Error(`unreachable`)}}ensureDeepCopied(){if(this.source!==`owned`){let e=this.source===`params`;this.hooks=[],this.promises=[];try{this.value=this.deepCopy(this.value,void 0,`value`,this,e,this)}catch(e){throw this.hooks=void 0,this.promises=void 0,e}if(this.source=`owned`,this.rpcTargets&&this.rpcTargets.size>0)throw Error(`Not all rpcTargets were accounted for in deep-copy?`);this.rpcTargets=void 0}}deliverTo(t,n,r){if(this.ensureDeepCopied(),this.value instanceof sw)e.deliverRpcPromiseTo(this.value,t,n,r);else{t[n]=this.value;for(let t of this.promises)e.deliverRpcPromiseTo(t.promise,t.parent,t.property,r)}}static deliverRpcPromiseTo(t,n,r,i){let a=cw(t);if(!a)throw Error(`property promises should have been resolved earlier`);let o=a.pull();o instanceof e?o.deliverTo(n,r,i):i.push(o.then(e=>{let t=[];if(e.deliverTo(n,r,t),t.length>0)return Promise.all(t)}))}async deliverCall(t,n){try{let r=[];this.deliverTo(this,`value`,r),r.length>0&&await Promise.all(r);let i=Function.prototype.apply.call(t,n,this.value);return i instanceof sw?e.fromAppReturn(i):e.fromAppReturn(await i)}finally{this.dispose()}}async deliverStreamWrite(t){try{let n=[];this.deliverTo(this,`value`,n),n.length>0&&await Promise.all(n);let r=this.value[0];return(this.hooks.length>0||this.promises.length>0)&&r instanceof Object?(Symbol.dispose in r||Object.defineProperty(r,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0}),await t.write(r),e.fromAppReturn(void 0)):(await t.write(r),this.dispose(),e.fromAppReturn(void 0))}catch(e){throw this.dispose(),e}}async deliverResolve(){try{let e=[];this.deliverTo(this,`value`,e),e.length>0&&await Promise.all(e);let t=this.value;return t instanceof Object&&(Symbol.dispose in t||Object.defineProperty(t,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0})),t}catch(e){throw this.dispose(),e}}dispose(){if(this.source===`owned`)this.hooks.forEach(e=>e.dispose()),this.promises.forEach(e=>e.promise[Symbol.dispose]());else if(this.source===`return`&&(this.disposeImpl(this.value,void 0),this.rpcTargets&&this.rpcTargets.size>0))throw Error(`Not all rpcTargets were accounted for in disposeImpl()?`);this.source=`owned`,this.hooks=[],this.promises=[]}disposeImpl(e,t){switch(XC(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`url`:case`error`:case`undefined`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.disposeImpl(t[e],t);return}case`object`:{let t=e;for(let e in t)this.disposeImpl(t[e],t);return}case`stub`:case`rpc-promise`:{let t=cw(e);t&&t.dispose();return}case`function`:case`rpc-target`:{let t=e,n=this.rpcTargets?.get(t);n?(n.dispose(),this.rpcTargets.delete(t)):gw(t);return}case`rpc-thenable`:return;case`headers`:return;case`request`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`response`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`writable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=ew.createWritableStreamHook(t),n.dispose();return}case`readable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=ew.createReadableStreamHook(t),n.dispose();return}default:return}}ignoreUnhandledRejections(){this.hooks?(this.hooks.forEach(e=>{e.ignoreUnhandledRejections()}),this.promises.forEach(e=>lw(e.promise).ignoreUnhandledRejections())):this.ignoreUnhandledRejectionsImpl(this.value)}ignoreUnhandledRejectionsImpl(e){switch(XC(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`undefined`:case`function`:case`rpc-target`:case`writable`:case`readable`:case`url`:case`headers`:case`request`:case`response`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`object`:{let t=e;for(let e in t)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`stub`:case`rpc-promise`:lw(e).ignoreUnhandledRejections();return;case`rpc-thenable`:e.then(e=>{},e=>{});return;default:return}}};function pw(e,t,n,r){for(let i=0;i<n.length;i++){t=e;let a=n[i];if(a in Object.prototype){e=void 0;continue}switch(XC(e)){case`object`:case`function`:e=Object.hasOwn(e,a)?e[a]:void 0;break;case`array`:e=Number.isInteger(a)&&a>=0?e[a]:void 0;break;case`rpc-target`:case`rpc-thenable`:if(Object.hasOwn(e,a))throw TypeError(`Attempted to access property '${a}', which is an instance property of the RpcTarget. To avoid leaking private internals, instance properties cannot be accessed over RPC. If you want to make this property available over RPC, define it as a method or getter on the class, instead of an instance property.`);e=e[a],r=null;break;case`stub`:case`rpc-promise`:{let{hook:t,pathIfPromise:r}=uw(e);return{hook:t,remainingPath:r?r.concat(n.slice(i)):n.slice(i)}}case`writable`:e=void 0;break;case`readable`:e=void 0;break;case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`url`:case`headers`:case`request`:case`response`:e=void 0;break;case`undefined`:e=e[a];break;case`unsupported`:if(i===0)throw TypeError(`RPC stub points at a non-serializable type.`);{let e=n.slice(0,i).join(`.`),t=n.slice(0,i).join(`.`);throw TypeError(`'${e}' is not a serializable type, so property ${t} cannot be accessed.`)}default:throw TypeError(`unreachable`)}}if(e instanceof sw){let{hook:t,pathIfPromise:n}=uw(e);return{hook:t,remainingPath:n||[]}}return{value:e,parent:t,owner:r}}var mw=class extends tw{call(e,t){let n;try{let{value:t,owner:r}=this.getValue();n=pw(t,void 0,e,r)}catch(e){return t.dispose(),new nw(e)}return n.hook?n.hook.call(n.remainingPath,t):typeof n.value==`function`?new vw(t.deliverCall(n.value,n.parent).then(e=>new hw(e))):(t.dispose(),new nw(TypeError(`'${e.join(`.`)}' is not a function.`)))}map(e,t,n){try{let r;try{let{value:t,owner:n}=this.getValue();r=pw(t,void 0,e,n)}catch(e){for(let e of t)e.dispose();throw e}return r.hook?r.hook.map(r.remainingPath,t,n):QC.applyMap(r.value,r.parent,r.owner,t,n)}catch(e){return new nw(e)}}get(e){try{let{value:t,owner:n}=this.getValue();if(e.length===0&&n===null){if(t instanceof Object&&`then`in t)return this.dup();throw Error(`Can't dup an RpcTarget stub as a promise.`)}let r=pw(t,void 0,e,n);return r.hook?r.hook.get(r.remainingPath):new hw(fw.deepCopyFrom(r.value,r.parent,r.owner))}catch(e){return new nw(e)}}},hw=class e extends mw{constructor(e){super(),this.payload=e}payload;getPayload(){if(this.payload)return this.payload;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){let e=this.getPayload();return{value:e.value,owner:e}}dup(){let t=this.getPayload();return new e(fw.deepCopyFrom(t.value,void 0,t))}pull(){return this.getPayload()}ignoreUnhandledRejections(){this.payload&&this.payload.ignoreUnhandledRejections()}dispose(){this.payload&&=(this.payload.dispose(),void 0)}onBroken(e){this.payload&&this.payload.value instanceof ow&&this.payload.value.onRpcBroken(e)}};function gw(e){if(Symbol.dispose in e)try{e[Symbol.dispose]()}catch(e){Promise.reject(e)}}var _w=class e extends mw{static create(t,n){return typeof t!=`function`&&(n=void 0),new e(t,n)}constructor(e,t,n){super(),this.target=e,this.parent=t,n?n.refcount&&(this.refcount=n.refcount,++this.refcount.count):Symbol.dispose in e&&(this.refcount={count:1})}target;parent;refcount;getTarget(){if(this.target)return this.target;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){return{value:this.getTarget(),owner:null}}dup(){return new e(this.getTarget(),this.parent,this)}pull(){let e=this.getTarget();return`then`in e?Promise.resolve(e).then(e=>fw.fromAppReturn(e)):Promise.reject(Error(`Tried to resolve a non-promise stub.`))}ignoreUnhandledRejections(){}dispose(){this.target&&=(this.refcount&&--this.refcount.count==0&&gw(this.target),void 0)}onBroken(e){let t=this.target;t&&`then`in t&&Promise.resolve(t).then(()=>{},e)}},vw=class e extends tw{promise;resolution;constructor(e){super(),this.promise=e.then(e=>(this.resolution=e,e))}call(t,n){return n.ensureDeepCopied(),new e(this.promise.then(e=>e.call(t,n),e=>{throw n.dispose(),e}))}stream(e,t){return t.ensureDeepCopied(),{promise:this.promise.then(n=>n.stream(e,t).promise,e=>{throw t.dispose(),e})}}map(t,n,r){return new e(this.promise.then(e=>e.map(t,n,r),e=>{for(let e of n)e.dispose();throw e}))}get(t){return new e(this.promise.then(e=>e.get(t)))}dup(){return this.resolution?this.resolution.dup():new e(this.promise.then(e=>e.dup()))}pull(){return this.resolution?this.resolution.pull():this.promise.then(e=>e.pull())}ignoreUnhandledRejections(){this.resolution?this.resolution.ignoreUnhandledRejections():this.promise.then(e=>{e.ignoreUnhandledRejections()},e=>{})}dispose(){this.promise.then(e=>e.dispose(),()=>{})}onBroken(e){this.resolution?this.resolution.onBroken(e):this.promise.then(t=>{t.onBroken(e)},e)}},yw={maxBigIntDigits:16384,maxDepth:256,maxMessageSize:33554432},bw=new Uint8Array(new Uint16Array([1]).buffer)[0]===1,Yee=[`ArrayBuffer`,`DataView`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`,`Float32Array`,`Float64Array`];function Xee(e){return Yee.includes(e)}var xw={ArrayBuffer:void 0,DataView:void 0,Int8Array:void 0,Uint8Array:void 0,Uint8ClampedArray:void 0,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,BigInt64Array:8,BigUint64Array:8,Float32Array:4,Float64Array:8},Sw={ArrayBuffer:ArrayBuffer.prototype,DataView:DataView.prototype,Int8Array:Int8Array.prototype,Uint8ClampedArray:Uint8ClampedArray.prototype,Int16Array:Int16Array.prototype,Uint16Array:Uint16Array.prototype,Int32Array:Int32Array.prototype,Uint32Array:Uint32Array.prototype,BigInt64Array:BigInt64Array.prototype,BigUint64Array:BigUint64Array.prototype,Float32Array:Float32Array.prototype,Float64Array:Float64Array.prototype},Cw=new Map;for(let e of Object.keys(Sw))Cw.set(Sw[e],e);function ww(e,t){if(t!==2&&t!==4&&t!==8)throw RangeError(`Unsupported element size: ${t}`);let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let r=0;r<e.byteLength;r+=t)switch(t){case 2:n.setUint16(r,n.getUint16(r,!1),!0);break;case 4:n.setUint32(r,n.getUint32(r,!1),!0);break;case 8:n.setBigUint64(r,n.getBigUint64(r,!1),!0)}}var Zee=new class{exportStub(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}exportPromise(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}getImport(e){}unexport(e){}createPipe(e){throw Error(`Cannot create pipes without an RPC session.`)}onSendError(e){}};async function Qee(e,t){let n=await new Response(e).blob();return n.type===t?n:n.slice(0,n.size,t)}var $ee={__proto__:null,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError},Tw=class e{exporter;source;encodingLevel;constructor(e,t,n){this.exporter=e,this.source=t,this.encodingLevel=n}static devaluate(t,n,r=Zee,i,a=`string`){let o=new e(r,i,a);try{return o.devaluateImpl(t,n,0)}catch(e){if(o.exports)try{r.unexport(o.exports)}catch{}throw e}}exports;devaluateImpl(e,t,n){if(n>=256)throw Error(`Serialization exceeded maximum allowed depth. (Does the message contain cycles?)`);switch(XC(e)){case`unsupported`:{let t;try{t=`Cannot serialize value: ${e}`}catch{t=`Cannot serialize value: (couldn't stringify value)`}throw TypeError(t)}case`primitive`:return typeof e==`number`&&!isFinite(e)?this.encodingLevel===`structuredClonable`?e:e===1/0?[`inf`]:e===-1/0?[`-inf`]:[`nan`]:e;case`object`:{let t=e,r={};for(let e in t)r[e]=this.devaluateImpl(t[e],t,n+1);return r}case`array`:{let t=e,r=t.length,i=Array(r);for(let e=0;e<r;e++)i[e]=this.devaluateImpl(t[e],t,n+1);return[i]}case`bigint`:return this.encodingLevel===`structuredClonable`?e:[`bigint`,e.toString()];case`date`:{if(this.encodingLevel===`structuredClonable`)return e;let t=e.getTime();return[`date`,Number.isNaN(t)?null:t]}case`bytes`:{let t=Cw.get(Object.getPrototypeOf(e)),n;if(t===`ArrayBuffer`)n=new Uint8Array(e);else if(t===void 0)n=e;else{let r=e;n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);let i=xw[t];!bw&&i&&(n=n.slice(),ww(n,i))}if(this.encodingLevel===`structuredClonable`||this.encodingLevel===`jsonCompatibleWithBytes`)return t===void 0?[`bytes`,n]:[`bytes`,n,t];let r;if(n.toBase64)r=n.toBase64({omitPadding:!0});else if(typeof Buffer<`u`)r=(n instanceof Buffer?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength)).toString(`base64`);else{let e=``;for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);r=btoa(e)}return r=r.replace(/=+$/,``),t===void 0?[`bytes`,r]:[`bytes`,r,t]}case`url`:return[`url`,e.href];case`headers`:return[`headers`,[...e]];case`request`:{let t=e,r={};t.method!==`GET`&&(r.method=t.method);let i=[...t.headers];if(i.length>0&&(r.headers=i),t.body)r.body=this.devaluateImpl(t.body,t,n+1),r.duplex=t.duplex||`half`;else if(t.body===void 0&&![`GET`,`HEAD`,`OPTIONS`,`TRACE`,`DELETE`].includes(t.method)){let e=t.arrayBuffer(),n=new ReadableStream({async start(t){try{t.enqueue(new Uint8Array(await e)),t.close()}catch(e){t.error(e)}}}),i=ew.createReadableStreamHook(n);r.body=[`readable`,this.exporter.createPipe(n,i)],r.duplex=t.duplex||`half`}t.cache&&t.cache!=="default"&&(r.cache=t.cache),t.redirect!==`follow`&&(r.redirect=t.redirect),t.integrity&&(r.integrity=t.integrity),t.mode&&t.mode!==`cors`&&(r.mode=t.mode),t.credentials&&t.credentials!==`same-origin`&&(r.credentials=t.credentials),t.referrer&&t.referrer!==`about:client`&&(r.referrer=t.referrer),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.keepalive&&(r.keepalive=t.keepalive);let a=t;return a.cf&&(r.cf=a.cf),a.encodeResponseBody&&a.encodeResponseBody!==`automatic`&&(r.encodeResponseBody=a.encodeResponseBody),[`request`,t.url,r]}case`response`:{let t=e,r=this.devaluateImpl(t.body,t,n+1),i={};t.status!==200&&(i.status=t.status),t.statusText&&(i.statusText=t.statusText);let a=[...t.headers];a.length>0&&(i.headers=a);let o=t;if(o.cf&&(i.cf=o.cf),o.encodeBody&&o.encodeBody!==`automatic`&&(i.encodeBody=o.encodeBody),o.webSocket)throw TypeError(`Can't serialize a Response containing a webSocket.`);return[`response`,r,i]}case`blob`:{let t=e,n=t.stream(),r=ew.createReadableStreamHook(n),i=this.exporter.createPipe(n,r);return[`blob`,t.type,[`readable`,i]]}case`error`:{let t=e,r=this.exporter.onSendError(t);r&&(t=r);let i=t,a,o=(e,r)=>{let i=this.exports?.length??0;try{let i=this.devaluateImpl(r,t,n+1);a||={},a[e]=i}catch{if(this.exports&&this.exports.length>i){let e=this.exports.splice(i);try{this.exporter.unexport(e)}catch{}}}};for(let e of Object.keys(t))e!==`name`&&e!==`message`&&e!==`stack`&&o(e,i[e]);`cause`in t&&o(`cause`,i.cause),t instanceof AggregateError&&o(`errors`,t.errors);let s=[`error`,t.name,t.message];return a?(s.push(r&&r.stack?r.stack:null),s.push(a)):r&&r.stack&&s.push(r.stack),s}case`undefined`:return this.encodingLevel===`structuredClonable`?void 0:[`undefined`];case`stub`:case`rpc-promise`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let{hook:t,pathIfPromise:n}=uw(e),r=this.exporter.getImport(t);return r===void 0?(t=n?t.get(n):t.dup(),this.devaluateHook(n?`promise`:`export`,t)):n?n.length>0?[`pipeline`,r,n]:[`pipeline`,r]:[`import`,r]}case`function`:case`rpc-target`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`export`,n)}case`rpc-thenable`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`promise`,n)}case`writable`:{if(!this.source)throw Error(`Can't serialize WritableStream in this context.`);let n=this.source.getHookForWritableStream(e,t);return this.devaluateHook(`writable`,n)}case`readable`:{if(!this.source)throw Error(`Can't serialize ReadableStream in this context.`);let n=e,r=this.source.getHookForReadableStream(n,t);return[`readable`,this.exporter.createPipe(n,r)]}default:throw Error(`unreachable`)}}devaluateHook(e,t){this.exports||=[];let n=e===`promise`?this.exporter.exportPromise(t):this.exporter.exportStub(t);return this.exports.push(n),[e,n]}};new class{importStub(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}importPromise(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}getExport(e){}getPipeReadable(e){throw Error(`Cannot retrieve pipe readable without an RPC session.`)}getLimits(){return yw}};function ete(e,t){return new sw(new vw(new Response(t).arrayBuffer().then(t=>{let n=new Uint8Array(t),r=new Request(e,{body:n});return new hw(fw.fromAppReturn(r))})),[])}function tte(e,t){return new sw(new vw(Qee(e,t).then(e=>new hw(fw.fromAppReturn(e)))),[])}var Ew=class e{importer;encodingLevel;limits;constructor(e,t=`string`){this.importer=e,this.encodingLevel=t,this.limits=e.getLimits()}hooks=[];promises=[];evaluate(e){return this.evaluateWithDepth(e,0)}evaluateWithDepth(e,t){let n=fw.forEvaluate(this.hooks,this.promises);try{return n.value=this.evaluateImpl(e,n,`value`,t),n}catch(e){throw n.dispose(),e}}evaluateCopy(e){return this.evaluate(structuredClone(e))}evaluateImpl(t,n,r,i){let a=this.limits.maxDepth;if(i>=a)throw TypeError(`Deserialization exceeded maximum allowed message depth of ${a}.`);if(this.encodingLevel===`structuredClonable`&&(t instanceof Date||typeof t==`bigint`))return t;if(t instanceof Array){if(t.length==1&&t[0]instanceof Array){let e=t[0];for(let t=0;t<e.length;t++)e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}switch(t[0]){case`bigint`:if(typeof t[1]==`string`){let e=t[1],n=this.limits.maxBigIntDigits;if(e.length>n)throw TypeError(`Deserialized bigint exceeds maximum length of ${n} digits.`);return BigInt(e)}break;case`date`:if(t[1]===null)return new Date(NaN);if(typeof t[1]==`number`)return new Date(t[1]);break;case`bytes`:{let e;if(t[1]instanceof Uint8Array)e=t[1];else if(typeof t[1]==`string`){if(typeof Buffer<`u`)e=Buffer.from(t[1],`base64`);else if(Uint8Array.fromBase64)e=Uint8Array.fromBase64(t[1]);else{let n=atob(t[1]),r=n.length;e=new Uint8Array(r);for(let t=0;t<r;t++)e[t]=n.charCodeAt(t)}}else break;if(t.length===2)return e;if(typeof t[2]!=`string`)throw TypeError(`Unknown bytes type marker type: ${typeof t[2]}`);if(!Xee(t[2])){let e=t[2].slice(0,64);throw TypeError(`Unknown bytes type marker: ${e}`)}let n=t[2],r=xw[n];if(r!==void 0&&e.byteLength%r!==0)throw TypeError(`Invalid byte length ${e.byteLength} for ${n}; expected a multiple of ${r}`);let i=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);switch(!bw&&r!==void 0&&ww(new Uint8Array(i),r),n){case`ArrayBuffer`:return i;case`DataView`:return new DataView(i);case`Int8Array`:return new Int8Array(i);case`Uint8Array`:return new Uint8Array(i);case`Uint8ClampedArray`:return new Uint8ClampedArray(i);case`Int16Array`:return new Int16Array(i);case`Uint16Array`:return new Uint16Array(i);case`Int32Array`:return new Int32Array(i);case`Uint32Array`:return new Uint32Array(i);case`BigInt64Array`:return new BigInt64Array(i);case`BigUint64Array`:return new BigUint64Array(i);case`Float32Array`:return new Float32Array(i);case`Float64Array`:return new Float64Array(i)}}case`error`:if(t.length>=3&&typeof t[1]==`string`&&typeof t[2]==`string`){let e=$ee[t[1]]||Error,n=e===AggregateError?new e([],t[2]):new e(t[2]);if(typeof t[3]==`string`&&(n.stack=t[3]),t.length>=5){let e=t[4];if(!e||typeof e!=`object`||Array.isArray(e))break;let r=n,a=e;for(let e of Object.keys(a))if(e!==`name`&&e!==`message`&&e!==`stack`){if(e in Object.prototype||e===`toJSON`){this.evaluateImpl(a[e],n,e,i+1);continue}r[e]=this.evaluateImpl(a[e],n,e,i+1)}}return n}break;case`undefined`:if(t.length===1)return;break;case`inf`:return 1/0;case`-inf`:return-1/0;case`nan`:return NaN;case`url`:if(t.length===2&&typeof t[1]==`string`)return new URL(t[1]);break;case`headers`:if(t.length===2&&t[1]instanceof Array)return new Headers(t[1]);break;case`request`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=t[2];if(typeof a!=`object`||!a)break;if(a.body&&(a.body=this.evaluateImpl(a.body,a,`body`,i+1),!(a.body===null||typeof a.body==`string`||a.body instanceof Uint8Array||a.body instanceof ReadableStream)))throw TypeError(`Request body must be of type ReadableStream.`);if(a.signal&&(a.signal=this.evaluateImpl(a.signal,a,`signal`,i+1),!(a.signal instanceof AbortSignal)))throw TypeError(`Request siganl must be of type AbortSignal.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);let o=new Request(e,a);if(a.body instanceof ReadableStream&&o.body===void 0){let e=ete(o,a.body);return this.promises.push({promise:e,parent:n,property:r}),e}return o}case`response`:{if(t.length!==3)break;let e=this.evaluateImpl(t[1],n,r,i+1);if(!(e===null||typeof e==`string`||e instanceof Uint8Array||e instanceof ReadableStream))throw TypeError(`Response body must be of type ReadableStream.`);let a=t[2];if(typeof a!=`object`||!a)break;if(a.webSocket)throw TypeError(`Can't deserialize a Response containing a webSocket.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);return new Response(e,a)}case`blob`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=this.evaluateImpl(t[2],n,r,i+1);if(!(a instanceof ReadableStream))throw TypeError(`Blob content must be serialized as a ReadableStream.`);let o=tte(a,e);return this.promises.push({promise:o,parent:n,property:r}),o}case`import`:case`pipeline`:{if(t.length<2||t.length>4||typeof t[1]!=`number`)break;let a=this.importer.getExport(t[1]);if(!a)throw Error(`no such entry on exports table: ${t[1]}`);let o=t[0]==`pipeline`,s=e=>{if(o){let t=new sw(e,[]);return this.promises.push({promise:t,parent:n,property:r}),t}return this.hooks.push(e),new sw(e,[])};if(t.length==2)return s(o?a.get([]):a.dup());let c=t[2];if(!(c instanceof Array)||!c.every(e=>typeof e==`string`||typeof e==`number`))break;if(t.length==3)return s(a.get(c));let l=t[3];if(!(l instanceof Array))break;return l=new e(this.importer).evaluateWithDepth([l],i),s(a.call(c,l))}case`remap`:{if(t.length!==5||typeof t[1]!=`number`||!(t[2]instanceof Array)||!(t[3]instanceof Array)||!(t[4]instanceof Array))break;let e=this.importer.getExport(t[1]);if(!e)throw Error(`no such entry on exports table: ${t[1]}`);let i=t[2];if(!i.every(e=>typeof e==`string`||typeof e==`number`))break;let a=t[3].map(e=>{if(!(e instanceof Array)||e.length!==2||e[0]!==`import`&&e[0]!==`export`||typeof e[1]!=`number`)throw TypeError(`unknown map capture: ${JSON.stringify(e)}`);if(e[0]===`export`)return this.importer.importStub(e[1]);{let t=this.importer.getExport(e[1]);if(!t)throw Error(`no such entry on exports table: ${e[1]}`);return t.dup()}}),o=t[4],s=new sw(e.map(i,a,o),[]);return this.promises.push({promise:s,parent:n,property:r}),s}case`export`:case`promise`:if(typeof t[1]==`number`){if(t[0]==`promise`){let e=new sw(this.importer.importPromise(t[1]),[]);return this.promises.push({parent:n,property:r,promise:e}),e}{let e=this.importer.importStub(t[1]);return this.hooks.push(e),new ow(e)}}break;case`writable`:if(typeof t[1]==`number`){let e=this.importer.importStub(t[1]),n=ew.createWritableStreamFromHook(e);return this.hooks.push(e),n}break;case`readable`:if(typeof t[1]==`number`){let e=this.importer.getPipeReadable(t[1]),n=ew.createReadableStreamHook(e);return this.hooks.push(n),e}}throw TypeError(`unknown special value: ${JSON.stringify(t)}`)}if(t instanceof Object){let e=t;for(let t in e)t in Object.prototype||t===`toJSON`?(this.evaluateImpl(e[t],e,t,i+1),delete e[t]):e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}return t}},Dw=16,Ow=8,kw=16,nte=64;function Aw(e){return 2+e.length*3}function jw(e,t,n=0){if(n>=nte)return Ow;switch(typeof e){case`string`:return Aw(e);case`number`:return 16;case`bigint`:return 16;case`boolean`:return 8;case`undefined`:return 16;case`object`:{if(e===null)return 8;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return kw+e.byteLength;if(typeof Blob<`u`&&e instanceof Blob)return kw+e.size;if(e instanceof Date)return 16;if(t??=new WeakSet,t.has(e))return Ow;if(t.add(e),e instanceof Array){let r=Dw;for(let i of e)r+=Ow+jw(i,t,n+1);return r}if(e instanceof Error){let r=Dw+Aw(e.name)+Aw(e.message)+Aw(e.stack??``);for(let i of Object.keys(e))r+=Ow+Aw(i)+jw(e[i],t,n+1);return r}let r=Dw;for(let i of Object.keys(e))r+=Ow+Aw(i)+jw(e[i],t,n+1);return r}default:return 16}}var Mw=class{session;importId;constructor(e,t,n){this.session=e,this.importId=t,n&&(this.activePull=Promise.withResolvers())}localRefcount=0;remoteRefcount=1;activePull;resolution;onBrokenRegistrations;resolve(e){if(this.localRefcount==0){e.dispose();return}if(this.resolution=e,this.sendRelease(),this.onBrokenRegistrations){for(let t of this.onBrokenRegistrations){let n=this.session.onBrokenCallbacks[t],r=this.session.onBrokenCallbacks.length;e.onBroken(n),this.session.onBrokenCallbacks[r]===n?delete this.session.onBrokenCallbacks[r]:delete this.session.onBrokenCallbacks[t]}this.onBrokenRegistrations=void 0}this.activePull&&=(this.activePull.resolve(),void 0)}async awaitResolution(){return this.activePull||=(this.session.sendPull(this.importId),Promise.withResolvers()),await this.activePull.promise,this.resolution.pull()}dispose(){this.resolution?this.resolution.dispose():(this.abort(Error(`RPC was canceled because the RpcPromise was disposed.`)),this.sendRelease())}abort(e){this.resolution||(this.resolution=new nw(e),this.activePull&&=(this.activePull.reject(e),void 0),this.onBrokenRegistrations=void 0)}onBroken(e){if(this.resolution)this.resolution.onBroken(e);else{let t=this.session.onBrokenCallbacks.length;this.session.onBrokenCallbacks.push(e),this.onBrokenRegistrations||=[],this.onBrokenRegistrations.push(t)}}sendRelease(){this.remoteRefcount>0&&(this.session.sendRelease(this.importId,this.remoteRefcount),this.remoteRefcount=0)}},Nw=class e extends tw{isPromise;entry;constructor(e,t){super(),this.isPromise=e,++t.localRefcount,this.entry=t}collectPath(e){return this}getEntry(){if(this.entry)return this.entry;throw Error(`This RpcImportHook was already disposed.`)}getEntryTakingOwnership(e){try{return this.getEntry()}catch(t){throw e(),t}}call(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.call(e,t):n.session.sendCall(n.importId,e,t)}stream(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.stream(e,t):n.session.sendStream(n.importId,e,t)}map(e,t,n){let r=this.getEntryTakingOwnership(()=>{for(let e of t)e.dispose()});return r.resolution?r.resolution.map(e,t,n):r.session.sendMap(r.importId,e,t,n)}get(e){let t=this.getEntry();return t.resolution?t.resolution.get(e):t.session.sendCall(t.importId,e)}dup(){return new e(!1,this.getEntry())}pull(){let e=this.getEntry();if(!this.isPromise)throw Error(`Can't pull this hook because it's not a promise hook.`);return e.resolution?e.resolution.pull():e.awaitResolution()}ignoreUnhandledRejections(){}dispose(){let e=this.entry;this.entry=void 0,e&&--e.localRefcount===0&&e.dispose()}onBroken(e){this.entry&&this.entry.onBroken(e)}},rte=class extends Nw{session;constructor(e){super(!1,e),this.session=e.session}dispose(){if(this.session){let e=this.session;this.session=void 0,e.shutdown()}}},ite=class{transport;options;exports=[];reverseExports=new Map;imports=[];abortReason;cancelReadLoop;nextExportId=-1;onBatchDone;pullCount=0;onBrokenCallbacks=[];encodingLevel;limits;constructor(e,t,n){this.transport=e,this.options=n;let r=`string`;if(`encodingLevel`in e){let t=e.encodingLevel;if(t!==void 0){if(t!==`string`&&t!==`jsonCompatible`&&t!==`jsonCompatibleWithBytes`&&t!==`structuredClonable`)throw TypeError(`Unknown transport encodingLevel: ${String(t)}`);r=t}}this.encodingLevel=r,this.limits={...yw,...n.limits},this.exports.push({hook:t,refcount:1}),this.imports.push(new Mw(this,0,!1)),this.readLoop().catch(e=>this.abort(e))}getMainImport(){return new rte(this.imports[0])}shutdown(){this.abort(Error(`RPC session was shut down by disposing the main stub`),!1)}exportStub(e){if(this.abortReason)throw this.abortReason;let t=this.reverseExports.get(e);if(t!==void 0)return++this.exports[t].refcount,t;{let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),t}}exportPromise(e){if(this.abortReason)throw this.abortReason;let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.ensureResolvingExport(t),t}unexport(e){for(let t of e)this.releaseExport(t,1)}releaseExport(e,t){let n=this.exports[e];if(!n)throw Error(`no such export ID: ${e}`);if(n.refcount<t)throw Error(`refcount would go negative: ${n.refcount} < ${t}`);n.refcount-=t,n.refcount===0&&(delete this.exports[e],this.reverseExports.delete(n.hook),n.hook.dispose())}onSendError(e){if(this.options.onSendError)return this.options.onSendError(e)}ensureResolvingExport(e){let t=this.exports[e];if(!t)throw Error(`no such export ID: ${e}`);if(!t.pull){let n=async()=>{let e=t.hook;for(;;){let t=await e.pull();if(t.value instanceof ow){let{hook:n,pathIfPromise:r}=uw(t.value);if(r&&r.length==0&&this.getImport(e)===void 0){e=n;continue}}return t}},r=t.autoRelease;++this.pullCount,t.pull=n().then(t=>{let n=Tw.devaluate(t.value,void 0,this,t,this.encodingLevel);this.send([`resolve`,e,n]),r&&this.releaseExport(e,1)},t=>{this.send([`reject`,e,Tw.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}).catch(t=>{try{this.send([`reject`,e,Tw.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}catch(e){this.abort(e)}}).finally(()=>{--this.pullCount===0&&this.onBatchDone&&this.onBatchDone.resolve()})}}getImport(e){if(e instanceof Nw&&e.entry&&e.entry.session===this)return e.entry.importId}importStub(e){if(this.abortReason)throw this.abortReason;let t=this.imports[e];return t||(t=new Mw(this,e,!1),this.imports[e]=t),new Nw(!1,t)}importPromise(e){if(this.abortReason)throw this.abortReason;if(this.imports[e])return new nw(Error(`Bug in RPC system: The peer sent a promise reusing an existing export ID.`));let t=new Mw(this,e,!0);return this.imports[e]=t,new Nw(!0,t)}getExport(e){return this.exports[e]?.hook}getPipeReadable(e){let t=this.exports[e];if(!t||!t.pipeReadable)throw Error(`Export ${e} is not a pipe or its readable end was already consumed.`);let n=t.pipeReadable;return t.pipeReadable=void 0,n}getLimits(){return this.limits}createPipe(e,t){if(this.abortReason)throw this.abortReason;this.send([`pipe`]);let n=this.imports.length,r=new Mw(this,n,!1);this.imports.push(r);let i=new Nw(!1,r),a=ew.createWritableStreamFromHook(i);return e.pipeTo(a).catch(()=>{}).finally(()=>t.dispose()),n}send(e){if(this.abortReason!==void 0)return 0;if(this.encodingLevel===`string`){let t;try{t=JSON.stringify(e)}catch(e){try{this.abort(e)}catch{}throw e}try{let e=this.transport.send(t);e!==void 0&&typeof e.catch==`function`&&e.catch(e=>this.abort(e,!1))}catch(e){queueMicrotask(()=>this.abort(e,!1))}return t.length}try{let t=this.transport.send(e);if(typeof t==`number`)return t;let n=t;n&&typeof n.then==`function`&&Promise.resolve(n).catch(e=>this.abort(e,!1));return}catch(e){queueMicrotask(()=>this.abort(e,!1));return}}sendCall(e,t,n){if(this.abortReason)throw n?.dispose(),this.abortReason;let r=[`pipeline`,e,t];if(n){let e;try{e=Tw.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(e[0])}this.send([`push`,r]);let i=new Mw(this,this.imports.length,!1);return this.imports.push(i),new Nw(!0,i)}sendStream(e,t,n){if(this.abortReason)throw n.dispose(),this.abortReason;let r=[`pipeline`,e,t],i;try{i=Tw.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(i[0]);let a=[`stream`,r],o=this.send(a);o===void 0&&(o=jw(a));let s=this.imports.length,c=new Mw(this,s,!0);return c.remoteRefcount=0,c.localRefcount=1,this.imports.push(c),{promise:c.awaitResolution().then(e=>{e.dispose(),delete this.imports[s]},e=>{throw delete this.imports[s],e}),size:o}}sendMap(e,t,n,r){if(this.abortReason){for(let e of n)e.dispose();throw this.abortReason}let i=[`remap`,e,t,n.map(e=>{let t=this.getImport(e);return t===void 0?[`export`,this.exportStub(e)]:[`import`,t]}),r];this.send([`push`,i]);let a=new Mw(this,this.imports.length,!1);return this.imports.push(a),new Nw(!0,a)}sendPull(e){if(this.abortReason)throw this.abortReason;this.send([`pull`,e])}sendRelease(e,t){this.abortReason||(this.send([`release`,e,t]),delete this.imports[e])}abort(e,t=!0){if(this.abortReason===void 0){if(this.cancelReadLoop?.(e),this.cancelReadLoop=void 0,t)try{let t=[`abort`,Tw.devaluate(e,void 0,this,void 0,this.encodingLevel)];if(this.encodingLevel===`string`){let e=this.transport.send(JSON.stringify(t));e!==void 0&&typeof e.catch==`function`&&e.catch(e=>{})}else{let e=this.transport.send(t);e&&typeof e.then==`function`&&Promise.resolve(e).catch(e=>{})}}catch{}if(e===void 0&&(e=`undefined`),this.abortReason=e,this.onBatchDone&&this.onBatchDone.reject(e),this.transport.abort)try{this.transport.abort(e)}catch(e){Promise.resolve(e)}for(let t in this.onBrokenCallbacks)try{this.onBrokenCallbacks[t](e)}catch(e){Promise.resolve(e)}for(let t in this.imports)this.imports[t].abort(e);for(let e in this.exports)this.exports[e].hook.dispose()}}async readLoop(){for(;!this.abortReason;){let e=Promise.withResolvers();this.cancelReadLoop=e.reject;let t;try{t=await Promise.race([this.transport.receive(),e.promise])}finally{this.cancelReadLoop===e.reject&&(this.cancelReadLoop=void 0)}if(this.encodingLevel===`string`&&t.length>this.limits.maxMessageSize)throw TypeError(`Incoming message exceeds maximum size of ${this.limits.maxMessageSize} UTF-16 code units.`);if(this.abortReason)break;let n=this.encodingLevel===`string`?JSON.parse(t):t;if(n instanceof Array)switch(n[0]){case`push`:if(n.length>1){let e=new hw(new Ew(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections(),this.exports.push({hook:e,refcount:1});continue}break;case`stream`:if(n.length>1){let e=new hw(new Ew(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections();let t=this.exports.length;this.exports.push({hook:e,refcount:1,autoRelease:!0}),this.ensureResolvingExport(t);continue}break;case`pipe`:{let{readable:e,writable:t}=new TransformStream,n=ew.createWritableStreamHook(t);this.exports.push({hook:n,refcount:1,pipeReadable:e});continue}case`pull`:{let e=n[1];if(typeof e==`number`){this.ensureResolvingExport(e);continue}break}case`resolve`:case`reject`:{let e=n[1];if(typeof e==`number`&&n.length>2){let t=this.imports[e];if(t){if(n[0]==`resolve`)t.resolve(new hw(new Ew(this,this.encodingLevel).evaluate(n[2])));else{let e=new Ew(this,this.encodingLevel).evaluate(n[2]);e.dispose(),t.resolve(new nw(e.value))}}else n[0]==`resolve`&&new Ew(this,this.encodingLevel).evaluate(n[2]).dispose();continue}break}case`release`:{let e=n[1],t=n[2];if(typeof e==`number`&&typeof t==`number`){this.releaseExport(e,t);continue}break}case`abort`:{let e=new Ew(this,this.encodingLevel).evaluate(n[1]);e.dispose(),this.abort(e.value,!1);break}}throw Error(`bad RPC message: ${JSON.stringify(n)}`)}}async drain(){if(this.abortReason)throw this.abortReason;if(this.pullCount>0){let{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.onBatchDone={resolve:t,reject:n},await e}}getStats(){let e={imports:0,exports:0};for(let t in this.imports)++e.imports;for(let t in this.exports)++e.exports;return e}},ate=class{#e;#t;constructor(e,t,n={}){let r;r=t?new hw(fw.fromAppReturn(t)):new nw(Error(`This connection has no main object.`)),this.#e=new ite(e,r,n),this.#t=new ow(this.#e.getMainImport())}getRemoteMain(){return this.#t}getStats(){return this.#e.getStats()}drain(){return this.#e.drain()}};function ote(e,t,n){return new ate(new ste(e),t,n).getRemoteMain()}var ste=class{encodingLevel=`structuredClonable`;constructor(e){this.#e=e,e.start(),e.addEventListener(`message`,e=>{this.#i||(e.data===null?this.#a(Error(`Peer closed MessagePort connection.`)):this.#t?(this.#t(e.data),this.#t=void 0,this.#n=void 0):this.#r.push(e.data))}),e.addEventListener(`messageerror`,e=>{this.#a(Error(`MessagePort message error.`))})}#e;#t;#n;#r=[];#i;send(e){if(this.#i)throw this.#i;this.#e.postMessage(e)}async receive(){if(this.#r.length>0)return this.#r.shift();if(this.#i)throw this.#i;return new Promise((e,t)=>{this.#t=e,this.#n=t})}abort(e){try{this.#e.postMessage(null)}catch{}this.#e.close(),this.#i||=e}#a(e){this.#i||(this.#i=e,this.#n&&=(this.#n(e),this.#t=void 0,void 0))}},Pw,Fw=class{context;captureMap=new Map;instructions=[];constructor(e,t){this.context=Pw?{parent:Pw,captures:[],subject:Pw.capture(e),path:t}:{parent:void 0,captures:[],subject:e,path:t},Pw=this}unregister(){Pw=this.context.parent}makeInput(){return new Lw(this,0)}makeOutput(e){let t;try{t=Tw.devaluate(e.value,void 0,this,e)}finally{e.dispose()}return this.instructions.push(t),this.context.parent?(this.context.parent.instructions.push([`remap`,this.context.subject,this.context.path,this.context.captures.map(e=>[`import`,e]),this.instructions]),new Lw(this.context.parent,this.context.parent.instructions.length)):this.context.subject.map(this.context.path,this.context.captures,this.instructions)}pushCall(e,t,n){let r=Tw.devaluate(n.value,void 0,this,n);r=r[0];let i=this.capture(e.dup());return this.instructions.push([`pipeline`,i,t,r]),new Lw(this,this.instructions.length)}pushGet(e,t){let n=this.capture(e.dup());return this.instructions.push([`pipeline`,n,t]),new Lw(this,this.instructions.length)}capture(e){if(e instanceof Lw&&e.mapper===this)return e.idx;let t=this.captureMap.get(e);if(t===void 0){if(this.context.parent){let t=this.context.parent.capture(e);this.context.captures.push(t)}else this.context.captures.push(e);t=-this.context.captures.length,this.captureMap.set(e,t)}return t}exportStub(e){throw Error(`Can't construct an RpcTarget or RPC callback inside a mapper function. Try creating a new RpcStub outside the callback first, then using it inside the callback.`)}exportPromise(e){return this.exportStub(e)}getImport(e){return this.capture(e)}unexport(e){}createPipe(e){throw Error(`Cannot send ReadableStream inside a mapper function.`)}onSendError(e){}};QC.sendMap=(e,t,n)=>{let r=new Fw(e,t),i;try{i=fw.fromAppReturn(Gee(r.pushCall.bind(r),()=>n(new sw(r.makeInput(),[]))))}finally{r.unregister()}if(i instanceof Promise)throw i.catch(e=>{}),Error(`RPC map() callbacks cannot be async.`);return new sw(r.makeOutput(i),[])};function Iw(){throw Error(`Attempted to use an abstract placeholder from a mapper function. Please make sure your map function has no side effects.`)}var Lw=class extends tw{mapper;idx;constructor(e,t){super(),this.mapper=e,this.idx=t}dup(){return this}dispose(){}get(e){if(e.length==0)return this;if(Pw)return Pw.pushGet(this,e);Iw()}call(e,t){t.dispose(),Iw()}map(e,t,n){for(let e of t)e.dispose();Iw()}pull(){Iw()}ignoreUnhandledRejections(){}onBroken(e){Iw()}},Rw=class{captures;variables;constructor(e,t){this.captures=e,this.variables=[t]}dispose(){for(let e of this.variables)e.dispose()}apply(e){try{if(e.length<1)throw Error(`Invalid empty mapper function.`);for(let t of e.slice(0,-1)){let e=new Ew(this).evaluateCopy(t);if(e.value instanceof ow){let t=cw(e.value);if(t){this.variables.push(t);continue}}this.variables.push(new hw(e))}return new Ew(this).evaluateCopy(e[e.length-1])}finally{for(let e of this.variables)e.dispose()}}importStub(e){throw Error(`A mapper function cannot refer to exports.`)}importPromise(e){return this.importStub(e)}getExport(e){return e<0?this.captures[-e-1]:this.variables[e]}getPipeReadable(e){throw Error(`A mapper function cannot use pipe readables.`)}getLimits(){return yw}};function zw(e,t,n,r,i){let a=new Rw(r,new hw(fw.deepCopyFrom(e,t,n)));try{return a.apply(i)}finally{a.dispose()}}QC.applyMap=(e,t,n,r,i)=>{try{let a;if(e instanceof sw)throw Error(`applyMap() can't be called on RpcPromise`);if(e instanceof Array){let t=[];try{for(let a of e)t.push(zw(a,e,n,r,i))}catch(e){for(let e of t)e.dispose();throw e}a=fw.fromArray(t)}else a=e==null?fw.fromAppReturn(e):zw(e,t,n,r,i);return new hw(a)}finally{for(let e of r)e.dispose()}};var Bw=class e extends tw{state;static create(t){let n=t.getWriter();return new e({refcount:1,writer:n,closed:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}getState(){if(this.state)return this.state;throw Error(`Attempted to use a WritableStreamStubHook after it was disposed.`)}call(e,t){try{let n=this.getState();if(e.length!==1||typeof e[0]!=`string`)throw Error(`WritableStream stub only supports direct method calls`);let r=e[0];if(r!==`write`&&r!==`close`&&r!==`abort`)throw Error(`Unknown WritableStream method: ${r}`);return(r===`close`||r===`abort`)&&(n.closed=!0),new vw((r===`write`?t.deliverStreamWrite(n.writer):t.deliverCall(n.writer[r],n.writer)).then(e=>new hw(e)))}catch(e){return t.dispose(),new nw(e)}}map(e,t,n){for(let e of t)e.dispose();return new nw(Error(`Cannot use map() on a WritableStream`))}get(e){return new nw(Error(`Cannot access properties on a WritableStream stub`))}dup(){let t=this.getState();return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a WritableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.closed||e.writer.abort(Error(`WritableStream RPC stub was disposed without calling close()`)).catch(()=>{}),e.writer.releaseLock())}onBroken(e){}},Vw=262144,Hw=1073741824,Uw=65536,Ww=2,Gw=1.25,Kw=.9,qw=3,Jw=class{now;window=Vw;bytesInFlight=0;inStartupPhase=!0;delivered=0;deliveredTime=0;firstAckTime=0;firstAckDelivered=0;minRtt=1/0;roundsWithoutIncrease=0;lastRoundWindow=0;roundStartTime=0;constructor(e){this.now=e}onSend(e){this.bytesInFlight+=e;let t={sentTime:this.now(),size:e,deliveredAtSend:this.delivered,deliveredTimeAtSend:this.deliveredTime,windowAtSend:this.window,windowFullAtSend:this.bytesInFlight>=this.window};return{token:t,shouldBlock:t.windowFullAtSend}}onError(e){this.bytesInFlight-=e.size}onAck(e){let t=this.now();this.delivered+=e.size,this.deliveredTime=t,this.bytesInFlight-=e.size;let n=t-e.sentTime;if(this.minRtt=Math.min(this.minRtt,n),this.firstAckTime===0)this.firstAckTime=t,this.firstAckDelivered=this.delivered;else{let n,r;e.deliveredTimeAtSend===0?(n=this.firstAckTime,r=this.firstAckDelivered):(n=e.deliveredTimeAtSend,r=e.deliveredAtSend);let i=t-n,a=(this.delivered-r)/i,o=this.inStartupPhase?Ww:Gw,s=a*this.minRtt*o;s=Math.min(s,e.windowAtSend*o),s=e.windowFullAtSend?Math.max(s,e.windowAtSend*Kw):Math.max(s,this.window),this.window=Math.max(Math.min(s,Hw),Uw),this.inStartupPhase&&e.sentTime>=this.roundStartTime&&(this.window>this.lastRoundWindow*Gw?this.roundsWithoutIncrease=0:++this.roundsWithoutIncrease>=qw&&(this.inStartupPhase=!1),this.roundStartTime=t,this.lastRoundWindow=this.window)}return this.bytesInFlight<this.window}};function Yw(e){let t,n=!1,r=new Jw(()=>performance.now()),i,a,o=()=>{n||(n=!0,e.dispose())};return new WritableStream({write(n,s){if(t!==void 0)throw t;let c=fw.fromAppParams([n]),{promise:l,size:u}=e.stream([`write`],c);if(u===void 0)return l.catch(e=>{throw t===void 0&&(t=e),e});{let{token:e,shouldBlock:n}=r.onSend(u);if(l.then(()=>{r.onAck(e)&&i&&(i(),i=void 0,a=void 0)},n=>{r.onError(e),t===void 0&&(t=n,s.error(n),o()),a&&=(a(n),i=void 0,void 0)}),n)return new Promise((e,t)=>{i=e,a=t})}},async close(){if(t!==void 0)throw o(),t;let{promise:n}=e.stream([`close`],fw.fromAppParams([]));try{await n}catch(e){throw t??e}finally{o()}},abort(n){if(t!==void 0)return;t=n??Error(`WritableStream was aborted`),a&&=(a(t),i=void 0,void 0);let{promise:r}=e.stream([`abort`],fw.fromAppParams([n]));r.then(()=>o(),()=>o())}})}var Xw=class e extends tw{state;static create(t){return new e({refcount:1,stream:t,canceled:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}call(e,t){return t.dispose(),new nw(Error(`Cannot call methods on a ReadableStream stub`))}map(e,t,n){for(let e of t)e.dispose();return new nw(Error(`Cannot use map() on a ReadableStream`))}get(e){return new nw(Error(`Cannot access properties on a ReadableStream stub`))}dup(){let t=this.state;if(!t)throw Error(`Attempted to dup a ReadableStreamStubHook after it was disposed.`);return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a ReadableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.canceled||(e.canceled=!0,e.stream.locked||e.stream.cancel(Error(`ReadableStream RPC stub was disposed without being consumed`)).catch(()=>{})))}onBroken(e){}};ew.createWritableStreamHook=Bw.create,ew.createWritableStreamFromHook=Yw,ew.createReadableStreamHook=Xw.create;var Zw=ow,Qw=YC,$w=ote;function eT(e){return e<32||e>=127&&e<=159||e===1564||e>=8203&&e<=8207||e===8232||e===8233||e>=8234&&e<=8238||e>=8294&&e<=8297||e===65279}function tT(e,t=80){let n=``;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);n+=eT(r)?` `:e.charAt(t)}return n=n.replace(/\s+/gu,` `).trim(),n.length<=t?n:`${n.slice(0,Math.max(0,t-1)).trimEnd()}…`}function nT(e,t){let n=e.find(e=>e.id===t.itemId);if(n===void 0||n.kind===`text`)return!1;if(n.kind===`menu`){let e=n.options.find(e=>e.id===t.optionId);return e!==void 0&&e.disabled!==!0}return t.optionId===void 0?n.kind!==`button`||n.disabled!==!0:!1}Object.freeze({publish:()=>Promise.resolve(),onBack:()=>()=>void 0,onActivate:()=>()=>void 0});function rT(e,t){if(t.kind===`action`){let n=[...e.primary??[],...e.menu??[]].find(e=>e.id===t.actionId);return n!==void 0&&n.disabled!==!0}let n=e.crumbs?.find(e=>e.id===t.crumbId);return n===void 0?!1:t.siblingId===void 0||n.siblings?.some(e=>e.id===t.siblingId)===!0}function iT(e){let t=e.trim().toLowerCase();if(!t)throw Error(`Invalid keymap token: token cannot be empty`);return t}function aT(e){let t=e.trim().toLowerCase();if(!t)throw Error(`Invalid key name: key name cannot be empty`);return t}function oT(e){return{name:aT(e.name),ctrl:e.ctrl??!1,shift:e.shift??!1,meta:e.meta??!1,super:e.super??!1,hyper:e.hyper||void 0}}function sT(e){return{name:e.name,ctrl:e.ctrl,shift:e.shift,meta:e.meta,super:e.super,hyper:e.hyper||void 0}}function cT(e,t){let n=sT(oT(e));return{stroke:n,display:t?.display??gT(n),match:t?.match??fT(n),tokenName:t?.tokenName?iT(t.tokenName):void 0}}function lT(e){return{stroke:sT(e.stroke),display:e.display,match:e.match,tokenName:e.tokenName,patternName:e.patternName,payloadKey:e.payloadKey}}function uT(e){return e.map(e=>lT(e))}function dT(e){return`match`in e?e.match:`stroke`in e?fT(e.stroke):fT(e)}function fT(e){return`key:${_T(oT(e))}`}function pT(e){let t=e.trim();if(!t)throw Error(`Invalid keymap match id: id cannot be empty`);return`text:${t}`}function mT(e,t){return`stroke`in e?t?.preferDisplay&&e.display?e.display:gT(e.stroke):gT(oT(e))}function hT(e,t){return e.map(e=>mT(e,t)).join(t?.separator??``)}function gT(e){let t=[];return e.ctrl&&t.push(`ctrl`),e.shift&&t.push(`shift`),e.meta&&t.push(`meta`),e.super&&t.push(`super`),e.hyper&&t.push(`hyper`),t.push(e.name===`return`?`enter`:e.name),t.join(`+`)}function _T(e){return`${e.name}:${+!!e.ctrl}:${+!!e.shift}:${+!!e.meta}:${+!!e.super}:${+!!e.hyper}`}var vT=Symbol(`keymap-extension-context`);function yT(e){return e.isDestroyed?null:e.getFocusedTarget()}function bT(e,t,n){let r=t??e.rootTarget,i=t!==null;for(;r;){if(n(r,i)===!1)return;r=e.getParentTarget(r),i=!1}}function xT(e,t){let n=new Set;return bT(e,t,e=>{n.add(e)}),n}function ST(e,t,n){let r=[],i=xT(t,n),a=Array.isArray(e)?e:CT(e);for(let e of a)wT(t,e,n,i)&&r.push(e);return r}function CT(e){return[...e].sort((e,t)=>t.priority-e.priority||t.order-e.order)}function wT(e,t,n,r=xT(e,n)){let i=t.target;return i?e.isTargetDestroyed(i)?!1:t.targetMode===`focus`?i===n:r.has(i):!0}function TT(e){let t=e.binding.sequence[e.index];if(!t?.patternName)return 0;let n=e.patterns?.at(-1);return n?.name===t.patternName?n.values.length:0}function ET(e,t,n=!0){let r=e.binding.sequence[e.index];if(!r?.patternName)return!0;let i=t.get(r.patternName);return i?TT(e)>=i.min:n}function DT(e,t,n=!0){let r=e.binding.sequence[e.index];if(r?.patternName){let n=t.get(r.patternName);if(n&&TT(e)<n.max)return!0}return ET(e,t,n)&&e.index+1<e.binding.sequence.length}function OT(e,t){return e.index===e.binding.sequence.length-1&&ET(e,t,!1)}function kT(e,t,n,r){return{parent:e,depth:e?e.depth+1:0,stroke:t,match:n,pattern:r,children:new Map,patternChildren:[],bindings:[],reachableBindings:[]}}function AT(e,t){let n=kT(null,null,null);for(let r of e){if(r.event!==`press`)continue;let e=n;for(let n of r.sequence){let i;if(n.patternName){let r=t.get(n.patternName);i=e.patternChildren.find(e=>e.pattern?.name===n.patternName),i||(i=kT(e,n.stroke,n.match,r),e.patternChildren.push(i))}else i=e.children.get(n.match),i||(i=kT(e,n.stroke,n.match),e.children.set(n.match,i));i.reachableBindings.push(r),e=i}e.bindings.push(r)}return n}function jT(e,t){let n=[];for(let r of e){if(!ET(r,t))continue;let e=r.index+1,i=r.binding.sequence[e];i&&n.push({part:i,binding:r.binding,index:e,exact:e===r.binding.sequence.length-1,continues:e<r.binding.sequence.length-1})}return n}function MT(e,t,n,r){let i=n.patternName;if(!i)return{...e,index:t};let a=[...e.patterns??[]],o=a.at(-1);return o?.name===i?a[a.length-1]={...o,values:[...o.values,r],parts:[...o.parts,n]}:a.push({name:i,payloadKey:n.payloadKey??i,values:[r],parts:[n]}),{layer:e.layer,binding:e.binding,index:t,parts:[...e.parts,n],patterns:a}}function NT(e,t){let n=e.parts.at(-1);if(!n||n.patternName)return t.length;let r=t.indexOf(n.match);return r===-1?t.length:r}function PT(e,t,n,r,i,a,o,s,c){let l=t.sequence[n];if(l){if(l.patternName){let a=s(l.patternName,o);if(!a)return;let u=c(o,l.patternName,a);return MT({layer:e,binding:t,index:n,parts:r,patterns:i},n,u,a.value??o.name)}if(a.includes(l.match))return{layer:e,binding:t,index:n,parts:[...r,l],patterns:i}}}function FT(e,t,n,r,i,a){let o=e.binding.sequence[e.index];if(o?.patternName){let s=r.get(o.patternName);if(s&&TT(e)<s.max){let t=i(s.name,n);if(t){let r=a(n,s.name,t);return MT(e,e.index,r,t.value??n.name)}}return ET(e,r,!1)?PT(e.layer,e.binding,e.index+1,e.parts,e.patterns,t,n,i,a):void 0}return PT(e.layer,e.binding,e.index+1,e.parts,e.patterns,t,n,i,a)}function IT(e,t,n,r,i){let a=[],o=1/0;for(let s of e.bindings){if(s.event!==`press`)continue;let c=PT(e,s,0,[],void 0,t,n,r,i);if(!c)continue;let l=NT(c,t);l<o&&(o=l,a.length=0),l===o&&a.push(c)}return a}import.meta.require;function LT(e){let t=Object.create(null),n=(e,n)=>{let r=t[e];if(!r)return;let i=r.filter(e=>e!==n);i.length===0?delete t[e]:i.length!==r.length&&(t[e]=i)};return{hook(e,r){return t[e]=[...t[e]??[],r],()=>n(e,r)},has(e){return(t[e]?.length??0)>0},emit(n,...r){let i=t[n];if(i)for(let t of i)try{r.length===0?t():t(r[0])}catch(t){e(n,t)}}}}function RT(){let e=[];return{get:()=>e,set:t=>{e=t},remove(t){e=e.filter(e=>e!==t)},has:()=>e.length>0,clear:()=>{e=[]}}}function zT(){let e=RT();return{append(t){return e.set([...e.get(),t]),()=>e.remove(t)},prepend(t){return e.set([t,...e.get()]),()=>e.remove(t)},values:e.get,has:e.has,clear:e.clear}}function BT(){let e=RT(),t=0;return{register(n,r){let i={...r,listener:n,order:t++};return e.set([...e.get(),i].sort((e,t)=>t.priority-e.priority||e.order-t.order)),()=>e.remove(i)},entries:e.get,has:e.has,clear:e.clear}}function VT(e){return typeof e==`string`||!!e&&typeof e==`object`&&!Array.isArray(e)}function HT(e){if(!Array.isArray(e))return{ok:!1,reason:`Invalid keymap bindings: expected an array of binding objects`};for(let[t,n]of e.entries()){if(!n||typeof n!=`object`||Array.isArray(n))return{ok:!1,reason:`Invalid keymap binding at index ${t}: expected a binding object`};if(!VT(n.key))return{ok:!1,reason:`Invalid keymap binding at index ${t}: expected "key" to be a string or keystroke object`}}return{ok:!0}}function UT(e){let t=HT(e);if(!t.ok)throw Error(t.reason);return e.map(e=>({...e,key:typeof e.key==`string`?e.key:{...e.key}}))}function WT(e){return{...e,sequence:uT(e.sequence)}}function GT(e,t){let n=zT();return{prependLayerAnalyzer(e){return n.prepend(e)},appendLayerAnalyzer(e){return n.append(e)},clearLayerAnalyzers(){n.clear()},analyzeLayer(r){let i=n.values();if(i.length===0)return;let a=KT(r.bindings),o={target:r.target,order:r.order,sourceBindings:r.sourceBindings,bindings:a,hasTokenBindings:r.hasTokenBindings,checkCommandResolution(e){return t.getCommandResolutionStatus(e,r.commands)},warn(t,n,r){e.emitWarning(t,n,r)},warnOnce(t,n,r,i){e.warnOnce(t,n,r,i)},error(t,n,r){e.emitError(t,n,r)}};for(let t of i)try{t(o)}catch(t){e.emitError(`layer-analyzer-error`,t,`[Keymap] Error in layer analyzer:`)}}}}function KT(e){return e.map(t=>({sequence:uT(t.sequence),command:t.command,attrs:t.attrs,event:t.event,preventDefault:t.preventDefault,fallthrough:t.fallthrough,parsedBinding:WT(t.parsedBinding),sourceTarget:t.sourceTarget,sourceLayerOrder:t.sourceLayerOrder,bindingIndex:t.bindingIndex,hasCommandAtSequence:e.some(e=>e.event===`press`&&e.command!==void 0&&qT(e,t)),hasContinuations:e.some(e=>e.event===`press`&&JT(t,e))}))}function qT(e,t){return e.sequence.length===t.sequence.length&&e.sequence.every((e,n)=>e.match===t.sequence[n]?.match)}function JT(e,t){return e.sequence.length<t.sequence.length&&e.sequence.every((e,n)=>e.match===t.sequence[n]?.match)}function YT(){return{version:-1,notifyVersion:-1,focused:void 0,value:[],targets:new WeakMap}}function XT(){return{plain:YT(),bindings:YT(),metadata:YT(),bindingsAndMetadata:YT()}}function ZT(e,t){if(t===void 0)return e.plain;let n=t.includeBindings===!0,r=t.includeMetadata===!0;return n?r?e.bindingsAndMetadata:e.bindings:r?e.metadata:e.plain}function QT(e,t,n){let r=n?e.targets.get(n):e.nullTarget;return r?.version===t?r:void 0}function $T(e,t,n,r){let i={version:t,value:r};n?e.targets.set(n,i):e.nullTarget=i}function eE(e,t){if(e===t)return!0;if(!e||!t||e.captures.length!==t.captures.length)return!1;for(let n=0;n<e.captures.length;n+=1){let r=e.captures[n],i=t.captures[n];if(!r||!i||r.layer!==i.layer||r.binding!==i.binding||r.index!==i.index||r.parts.length!==i.parts.length)return!1;for(let e=0;e<r.parts.length;e+=1)if(r.parts[e]?.match!==i.parts[e]?.match)return!1;let a=r.patterns??[],o=i.patterns??[];if(a.length!==o.length)return!1;for(let e=0;e<a.length;e+=1){let t=a[e],n=o[e];if(!t||!n||t.name!==n.name||t.values.length!==n.values.length)return!1;for(let e=0;e<t.values.length;e+=1)if(!Object.is(t.values[e],n.values[e]))return!1}}return!0}function tE(e){let t=e.parts.at(-1);if(!t||e.parts.length<=1)return;let n=e.index-1,r=e.patterns;if(t.patternName){let i=r?.at(-1);i?.name===t.patternName&&(i.values.length>1?(n=e.index,r=[...(r??[]).slice(0,-1),{...i,values:i.values.slice(0,-1),parts:i.parts.slice(0,-1)}]):r=(r??[]).slice(0,-1))}return{layer:e.layer,binding:e.binding,index:n,parts:e.parts.slice(0,-1),patterns:r}}function nE(e){let t=e.captures[0];if(!t||t.parts.length===0)return[];let n=[];for(let r=0;r<t.parts.length;r+=1){let i=t.parts[r];if(!i)continue;let a,o,s=!1,c=!1;for(let t of e.captures){let e=t.parts[r];if(e){if(a===void 0){a=e.display,o=e.tokenName;continue}!s&&a!==e.display&&(s=!0),!c&&o!==e.tokenName&&(c=!0)}}(a===void 0||s)&&(a=mT(i.stroke)),c&&(o=void 0),n.push(cT(i.stroke,{display:a,match:i.match,tokenName:o}))}return n}function rE(e){if(e.isDestroyed)throw Error(`Cannot use a keymap after its host was destroyed`);return e}function iE(e,t,n,r,i,a,o={}){let s=XT(),c=-1,l=[],u=()=>rE(t).getFocusedTarget(),d=()=>yT(t),f=t=>{let n=e.pending;eE(n,t)||(e.pending=t,o.onPendingSequenceChanged?.(n,t),V(),r.queueStateChange())},p=()=>{let t=e.pending;if(!t)return;let n=u(),r=a.getActiveCommandView(n),o=t.captures.filter(t=>e.layers.has(t.layer)&&C(t.layer,n)&&i.matchesConditions(t.layer)&&D(t.binding,n,r)&&DT(t,e.patterns));if(o.length===0){f(null);return}return o.length!==t.captures.length&&f({captures:o}),e.pending??void 0},m=()=>{t.isDestroyed||!e.pending||p()},h=()=>!t.isDestroyed&&e.pending!==null,g=()=>{if(c===e.cacheVersion)return l;let t=p(),n=t?nE(t):[];return(!t||T())&&(c=e.cacheVersion,l=n),n},_=()=>{let e=p();if(!e)return!1;let t=e.captures[0];if(!t||t.parts.length<=1)return f(null),!0;let n=[];for(let t of e.captures){let e=tE(t);e&&n.push(e)}return n.length===0?(f(null),!0):(f({captures:n}),!0)},v=t=>{let n=t?.includeBindings===!0,r=t?.includeMetadata===!0,i=ZT(s,t);return i.notifyVersion===e.derivedVersion?i.value:y(i,n,r)},y=(n,r,i)=>{t.isDestroyed&&rE(t);let o=u(),s=QT(n,e.cacheVersion,o);if(s)return n.notifyVersion=e.derivedVersion,n.version=e.cacheVersion,n.focused=o,n.value=s.value,s.value;let c=a.getActiveCommandView(o),l=p(),d=l?[]:S(o),f=l?F(l.captures,r,i,o,c):j(d,r,i,o,c);return(l?T():w(d))&&(n.version=e.cacheVersion,n.notifyVersion=e.derivedVersion,n.focused=o,n.value=f,$T(n,e.cacheVersion,o,f)),f},b=(e,t)=>{let n=t?.includeBindings===!0,r=t?.includeMetadata===!0,i=u(),o=a.getActiveCommandView(i);return F(e,n,r,i,o)},x=(e,t)=>{let n=t?.includeBindings===!0,r=t?.includeMetadata===!0,i=e===d()?p():void 0,o=a.getActiveCommandView(e);return i?F(i.captures,n,r,e,o):j(S(e),n,r,e,o)},S=n=>e.activeLayersCacheVersion===e.cacheVersion&&e.activeLayersCacheFocused===n?e.activeLayersCache:(e.activeLayersCacheVersion=e.cacheVersion,e.activeLayersCacheFocused=n,e.activeLayersCache=ST(e.sortedLayers,t,n),e.activeLayersCache),C=(e,n)=>wT(t,e,n),w=t=>!e.commandResolvers.has()&&e.activeKeyCacheBlockers===0,T=()=>!e.commandResolvers.has()&&e.activeKeyCacheBlockers===0,E=(e,t,n)=>{let r=[];for(let o of e)i.matchesConditions(o)&&a.isBindingVisible(o,t,n)&&r.push(o);return r},D=(e,t,n)=>i.matchesConditions(e)&&a.isBindingVisible(e,t,n),O=(e,t)=>{let n,r,i=!1,a=!1;for(let o of e){let e=o.sequence[t];if(e){if(n===void 0){n=e.display,r=e.tokenName;continue}!i&&n!==e.display&&(i=!0),!a&&r!==e.tokenName&&(a=!0)}}if(n===void 0||i){let r=e[0]?.sequence[t]?.stroke;n=r?mT(r):``}return a&&(r=void 0),{display:n,tokenName:r}},k=(e,t,n)=>({sequence:e.sequence,command:e.command,commandAttrs:a.getBindingCommandAttrs(e,t,n),attrs:e.attrs,event:e.event,preventDefault:e.preventDefault,fallthrough:e.fallthrough}),A=(e,t,n)=>e.map(e=>k(e,t,n)),j=(e,t,n,r,a)=>{let o=new Map,s=new Set;for(let n of e)n.root.children.size===0&&n.root.patternChildren.length===0||!i.matchesConditions(n)||(M(n.root.children.values(),o,s,t,r,a),M(n.root.patternChildren,o,s,t,r,a));return R(o,t,n,r,a)},M=(e,t,n,r,i,a)=>{for(let o of e){let e=o.match;if(!e||n.has(e)||!o.stroke)continue;let s=N(o,r,i,a);if(!s)continue;let c=t.get(e);c?B(c,s,r):t.set(e,ne(o.stroke,s,r)),s.stop&&n.add(e)}},N=(e,t,n,r)=>{if(!(e.children.size>0||e.patternChildren.length>0)){let i=te(P(e)?E(e.bindings,n,r):e.bindings,n,r);if(!i)return;let a=O(i.bindings,e.depth-1);return{display:a.display,tokenName:a.tokenName,continues:!1,firstBinding:i.bindings[0],commandBinding:i.commandBinding,bindings:t?[...i.bindings]:void 0,stop:i.stop}}let i=E(e.reachableBindings,n,r);if(i.length===0)return;let a=te(e.bindings,n,r),o=O(i,e.depth-1);return{display:o.display,tokenName:o.tokenName,continues:!0,firstBinding:a?.bindings[0],commandBinding:a?.commandBinding,bindings:t&&a?[...a.bindings]:void 0,stop:!0}},P=t=>{if(e.commandResolvers.has())return!0;for(let e of t.bindings)if(e.matchers.length>0)return!0;return!1},F=(t,n,r,i,a)=>{let o=new Map,s=new Set;return I(jT(t,e.patterns),o,s,n,i,a),R(o,n,r,i,a)},I=(e,t,n,r,i,a)=>{let o=new Set;for(let s of e)o.has(s.part.match)||(o.add(s.part.match),L(s,e,t,n,r,i,a))},L=(e,t,n,r,i,a,o)=>{let s=e.part.match;if(r.has(s))return;let c=z(e,t,i,a,o);if(!c)return;let l=n.get(s);l?B(l,c,i):n.set(s,ne(e.part.stroke,c,i)),c.stop&&r.add(s)},R=(e,t,n,r,i)=>{let a=[];for(let o of e.values()){let e=re(o,t,n,r,i);e&&a.push(e)}return a},z=(e,t,n,r,i)=>{let a=t.filter(t=>t.part.match===e.part.match),o=a.filter(e=>e.exact).map(e=>e.binding),s=te(o,r,i),c=a.some(e=>e.continues);if(!c&&!s)return;let l=ee(a);return{display:l.display,tokenName:l.tokenName,continues:c,firstBinding:s?.bindings[0],commandBinding:s?.commandBinding,bindings:n&&s?[...s.bindings]:void 0,stop:c||s?.stop===!0}},ee=e=>{let t,n,r=!1,i=!1;for(let a of e){let e=a.part;if(t===void 0){t=e.display,n=e.tokenName;continue}!r&&t!==e.display&&(r=!0),!i&&n!==e.tokenName&&(i=!0)}let a=e[0]?.part;return(t===void 0||r)&&(t=a?mT(a.stroke):``),i&&(n=void 0),{display:t,tokenName:n}},te=(e,t,n)=>{let r=[],o;for(let s of e)if(!(!i.matchesConditions(s)||!a.isBindingVisible(s,t,n))&&(r.push(s),s.command!==void 0&&(o??=s,!s.fallthrough)))return{bindings:r,commandBinding:o,stop:!0};if(r.length!==0)return{bindings:r,commandBinding:o,stop:!1}},ne=(e,t,n)=>({stroke:e,display:t.display,tokenName:t.tokenName,continues:t.continues,firstBinding:t.firstBinding,commandBinding:t.commandBinding,bindings:n&&t.bindings?[...t.bindings]:void 0}),B=(e,t,n)=>{if(!e.firstBinding&&t.firstBinding&&(e.firstBinding=t.firstBinding),!e.commandBinding&&t.commandBinding&&(e.commandBinding=t.commandBinding),t.continues&&(e.continues=!0),!(!n||!t.bindings||t.bindings.length===0)){if(!e.bindings){e.bindings=[...t.bindings];return}e.bindings.push(...t.bindings)}},re=(e,t,n,r,i)=>{if(!e.commandBinding&&!e.continues)return;let o={stroke:sT(e.stroke),display:e.display,continues:e.continues};if(e.tokenName&&(o.tokenName=e.tokenName),e.commandBinding&&(o.command=e.commandBinding.command),t&&e.bindings&&e.bindings.length>0&&(o.bindings=e.bindings.length===1?[k(e.bindings[0],r,i)]:A(e.bindings,r,i)),n){e.firstBinding?.attrs&&(o.bindingAttrs=e.firstBinding.attrs);let t=e.commandBinding?a.getBindingCommandAttrs(e.commandBinding,r,i):void 0;t&&(o.commandAttrs=t)}return o},V=()=>{n.has(`pendingSequence`)&&n.emit(`pendingSequence`,e.pending?nE(e.pending):[])};return{getFocusedTarget:u,getFocusedTargetIfAvailable:d,setPendingSequence:f,ensureValidPendingSequence:p,revalidatePendingSequenceIfNeeded:m,hasPendingSequenceState:h,getPendingSequence:g,popPendingSequence:_,getActiveKeys:v,getActiveKeysForCaptures:b,getActiveKeysForFocused:x,getActiveLayers:S,isLayerActiveForFocused:C,collectSequencePartsFromPending:nE,collectMatchingBindings:E,collectActiveBindings:A}}var aE=new Set([`name`,`run`,`fields`,`attrs`,`rejectedResult`]),oE=new Set([`key`,`cmd`,`event`,`preventDefault`,`fallthrough`]),sE=new Set([`target`,`targetMode`,`priority`,`bindings`,`commands`]);function cE(e){if(e===void 0||typeof e==`function`)return e;let t=e.trim();if(!t)throw Error(`Invalid keymap command: command cannot be empty`);return t}function lE(e){let t=e.trim();if(!t)throw Error(`Invalid keymap command name: name cannot be empty`);if(/\s/.test(t))throw Error(`Invalid keymap command name "${e}": command names cannot contain whitespace`);return t}function uE(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function dE(e){let t=[],n=new Map;for(let r of e.layers)for(let e of r.commands){let i={layer:r,commandState:e};t.push(i),uE(n,e.command.name,i)}return{entries:t,chainsByName:n}}function fE(e,t,n){let r=[],i=[],a=new Map,o=new Map;for(let s of e)if(s.commands.length!==0&&!(n&&!t.matchesConditions(s)))for(let e of s.commands){if(!t.matchesConditions(e))continue;let n={layer:s,commandState:e};r.push(n),uE(o,e.command.name,n),a.has(e.command.name)||(a.set(e.command.name,n),i.push(n))}return{layers:e,entries:r,reachable:i,reachableByName:a,chainsByName:o}}function pE(e,t,n,r){return(e.activeLayersCacheVersion!==e.cacheVersion||e.activeLayersCacheFocused!==r)&&(e.activeLayersCacheVersion=e.cacheVersion,e.activeLayersCacheFocused=r,e.activeLayersCache=ST(e.sortedLayers,t,r)),fE(e.activeLayersCache,n,!0)}function mE(e,t,n,r){if(Object.prototype.hasOwnProperty.call(e,t)&&!Object.is(e[t],n))throw Error(`Conflicting keymap requirement for "${t}" from ${r}`);e[t]=n}function hE(e,t,n,r){if(Object.prototype.hasOwnProperty.call(e,t)&&!Object.is(e[t],n))throw Error(`Conflicting keymap attribute for "${t}" from ${r}`);e[t]=n}function gE(e){let t=`field ${e.fieldName}`;return{require(n,r){mE(e.requirements,n,r,t)},attr(n,r){if(!e.attrs)throw Error(`Keymap ${t} cannot publish attrs`);hE(e.attrs,n,r,t)},activeWhen(n){e.matchers.push(e.conditions.buildRuntimeMatcher(n,t))}}}function _E(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function vE(e,t){return e instanceof Error&&e.message?e.message:t}function yE(e){return!e||typeof e!=`object`&&typeof e!=`function`?!1:typeof e.then==`function`}function bE(e,t){let n=t?.deep===!0,r=t?.freeze===!0,i=t?.preserveNonPlainObjects===!0;if(Array.isArray(e)){let i=n?e.map(e=>bE(e,t)):[...e];return r?Object.freeze(i):i}if(e&&typeof e==`object`){if(i&&!_E(e))return e;let a={};for(let[r,i]of Object.entries(e))a[r]=n?bE(i,t):i;return r?Object.freeze(a):a}return e}var xE=[`name`],SE=Object.freeze({}),CE=new WeakMap;function wE(e,t,n,r,i){let a=-1,o,s=-1,c,l,u=-1,d,f,p=-1,m,h=-1,g=new Map,_=t=>EE({commands:t,commandFields:e.commandFields,conditions:r,onError:(e,t,r)=>{n.emitError(e,t,r)}}),v=t=>R(()=>e.commandResolvers.prepend(t),t),y=t=>R(()=>e.commandResolvers.append(t),t),b=()=>{e.commandResolvers.has()&&n.runWithStateChangeBatch(()=>{e.commandResolvers.clear(),i.onCommandResolversChanged(),n.queueStateChange()})},x=e=>ie(e).map(e=>TE(e.commandState)),S=e=>{let t=H(e),n=ie(e,t);if(n.length===0)return[];let r=n.map(e=>({entry:e,command:TE(e.commandState),commandAttrs:e.commandState.attrs,bindings:[]})),i=new Map;for(let[e,t]of r.entries()){let n=i.get(t.command.name);n?n.push(e):i.set(t.command.name,[e])}return i.size>0&&ae(r,i,t),r.map(e=>({command:e.command,bindings:e.bindings}))},C=t=>{if(t.visibility===`registered`&&u===e.derivedVersion&&d===t.commands&&f)return f;let n=new Map;for(let e of t.commands)n.has(e)||n.set(e,[]);return n.size===0?n:(oe(n,H(t)),t.visibility===`registered`&&(u=e.derivedVersion,d=t.commands,f=n),n)},w=(e,t,n)=>{let r=M(t);if(n){let i=[],a=r.chainsByName.get(e);if(a)for(let e of a)i.push({target:e.layer.target,command:e.commandState.command,attrs:e.commandState.attrs,payload:n.payload});let o=de(e,t,{mode:`active`,execution:n});return o.resolved&&i.push(o.resolved),{entries:i.length>0?i:void 0,hadError:o.hadError}}let i=[];for(let t of r.chainsByName.get(e)??[])i.push({target:t.layer.target,command:t.commandState.command,attrs:t.commandState.attrs});let a=de(e,t,{mode:`active`});return a.resolved&&i.push(a.resolved),{entries:i.length>0?i:void 0,hadError:a.hadError}},T=t=>{if(h!==e.derivedVersion&&(h=e.derivedVersion,g=new Map),g.has(t))return g.get(t)??void 0;let n=ne(te(t));return g.set(t,n??null),n},E=(e,t)=>ne(M(t).chainsByName.get(e)),D=(e,t)=>de(e,null,{mode:`registered`,execution:t}),O=(e,t,n)=>de(e,t,{mode:`active`,execution:n}),k=(e,t)=>z(e,t)?.command,A=e=>ee(e)?.commandState.command,j=(e,n,i)=>{let a=N().chainsByName.get(e);if(!a||a.length===0)return;let o,s;for(let e of a){if(!wT(t,e.layer,n)){o??=e;continue}(!r.matchesConditions(e.layer)||!r.matchesConditions(e.commandState))&&(s??=e)}let c=s??o;if(c)return{reason:s?`disabled`:`inactive`,command:i?c.commandState.command:void 0}},M=n=>{if(s===e.derivedVersion&&c===n&&l)return l;let i=pE(e,t,r,n);return P()&&(s=e.derivedVersion,c=n,l=i),i},N=()=>a===e.derivedVersion&&o?o:(a=e.derivedVersion,o=dE(e),o),P=()=>e.activeCommandViewCacheBlockers===0,F=(e,t,n)=>e.command===void 0||e.run?!0:typeof e.command==`string`?n.reachableByName.has(e.command)?!0:B(e.command,t,`active`)!==void 0:!1,I=(e,t,n)=>{if(typeof e.command!=`string`)return;let r=n.reachableByName.get(e.command);return r?r.commandState.attrs:B(e.command,t,`active`)?.attrs},L=(e,n)=>{if(n?.some(t=>t.command.name===e)||N().chainsByName.has(e))return`resolved`;let r=de(e,yT(t));return r.resolved||r.hadError?r.resolved?`resolved`:`error`:`unresolved`},R=(t,r)=>n.runWithStateChangeBatch(()=>{let a=t();return i.onCommandResolversChanged(),n.queueStateChange(),()=>{n.runWithStateChangeBatch(()=>{a(),!e.commandResolvers.values().includes(r)&&(i.onCommandResolversChanged(),n.queueStateChange())})}}),z=(e,t)=>{let n=M(t).reachableByName.get(e);return n?{target:n.layer.target,command:n.commandState.command,attrs:n.commandState.attrs}:B(e,t,`active`)},ee=e=>te(e)?.[0],te=t=>{let n=[];for(let r of e.sortedLayers)for(let e of r.commands)e.command.name===t&&n.push({layer:r,commandState:e});return n.length>0?n:void 0},ne=e=>{if(e?.length)return e.map(e=>({target:e.layer.target,command:e.commandState.command,attrs:e.commandState.attrs}))},B=(e,t,n)=>de(e,t,{mode:n}).resolved,re=()=>N().entries,V=()=>{if(p===e.derivedVersion&&m)return m;let t=new Map;for(let n of e.layers)for(let e of n.bindings){if(typeof e.command!=`string`)continue;let n=t.get(e.command);n?n.push(e):t.set(e.command,[e])}return p=e.derivedVersion,m=t,t},H=e=>{let n=e?.visibility??`reachable`,r=e&&Object.prototype.hasOwnProperty.call(e,`focused`)?e.focused??null:yT(t);return n===`registered`?{visibility:n,focused:r}:{visibility:n,focused:r,activeView:M(r)}},ie=(e,t=H(e))=>{let r;return r=t.visibility===`registered`?re():t.visibility===`active`?t.activeView?.entries??[]:t.activeView?.reachable??[],jE({entries:r,query:e,getCommand:e=>TE(e),onFilterError:e=>{n.emitError(`command-query-filter-error`,e,`[Keymap] Error in command query filter:`)}})},ae=(e,t,n)=>{se(n,n=>{ce(e,t,n)})},oe=(e,t)=>{if(t.visibility===`registered`){let t=V();for(let[n,r]of e){let e=N().chainsByName.get(n)?.[0]?.commandState.attrs;for(let i of t.get(n)??[])r.push(U(i,e))}return}se(t,n=>{le(e,n,t)})},se=(t,n)=>{if(t.visibility===`registered`){for(let t of e.layers)for(let e of t.bindings)n(e);return}let i=t.activeView;if(i){for(let e of i.layers)if(!(e.bindings.length===0||!r.matchesConditions(e)))for(let a of e.bindings)r.matchesConditions(a)&&F(a,t.focused,i)&&n(a)}},ce=(e,t,n)=>{if(typeof n.command!=`string`)return;let r=t.get(n.command);if(!(!r||r.length===0))for(let t of r){let r=e[t];r&&r.bindings.push(U(n,r.commandAttrs))}},le=(e,t,n)=>{if(typeof t.command!=`string`)return;let r=e.get(t.command);r&&r.push(U(t,ue(t,n)))},U=(e,t)=>({sequence:e.sequence,command:e.command,commandAttrs:t,attrs:e.attrs,event:e.event,preventDefault:e.preventDefault,fallthrough:e.fallthrough}),ue=(e,t)=>{if(typeof e.command!=`string`)return;if(t.visibility===`registered`)return N().chainsByName.get(e.command)?.[0]?.commandState.attrs;let n=t.activeView;if(n)return I(e,t.focused,n)},de=(t,r,i)=>{let a=i?.mode??`active`,o=i?.execution??{input:t},s=DE(t,e.commandResolvers.values(),()=>me(r,a,o),e=>{n.emitError(`command-resolver-error`,e,`[Keymap] Error in command resolver for "${t}":`)}),c=s.resolved;if(c){let e=pe(c.command.name,r,a);e?.commandState.command===c.command&&c.target===void 0&&(c={...c,target:e.layer.target},s.resolved=c)}if(c&&!c.attrs){let e=fe(c.command.name,r,a)??AE(c.command);e&&(s.resolved={...c,attrs:e})}return s},fe=(e,t,n)=>n===`registered`?ee(e)?.commandState.attrs:M(t).reachableByName.get(e)?.commandState.attrs,pe=(e,t,n)=>n===`registered`?ee(e):M(t).reachableByName.get(e),me=(e,t,n)=>{let r=n.input,i=n.payload;return{context:{get input(){return r},get payload(){return i},setInput(e){r=e},setPayload(e){i=e},getCommand:n=>t===`registered`?A(n):k(n,e)},getExecutionFields(){return{input:r,payload:i}}}};return{normalizeCommands:_,prependCommandResolver:v,appendCommandResolver:y,clearCommandResolvers:b,getCommands:x,getCommandEntries:S,getCommandBindings:C,getResolvedCommandChain:w,getRegisteredResolvedEntries:T,getActiveRegisteredResolvedEntries:E,resolveRegisteredResolverFallback:D,resolveActiveResolverFallback:O,getTopCommand:k,getDispatchUnavailableCommandState:j,getActiveCommandView:M,isBindingVisible:F,getBindingCommandAttrs:I,getCommandResolutionStatus:L}}function TE(e){return e.command}function EE(e){let t=[],n=new Set;for(let r of e.commands)try{let i={},a=[],o=lE(r.name),s=OE(r),c={};if(n.has(o)){e.onError(`duplicate-command`,{command:o},`Duplicate keymap command "${o}" in the same layer`);continue}r.name=o;for(let[t,n]of Object.entries(s)){if(n===void 0)continue;let r=e.commandFields.get(t);r&&r(n,gE({fieldName:t,conditions:e.conditions,requirements:i,matchers:a,attrs:c}))}let l={command:r,fields:s,attrs:Object.keys(c).length===0?void 0:c,requires:Object.entries(i),matchers:a};n.add(l.command.name),t.push(l)}catch(t){e.onError(`register-command-failed`,t,vE(t,`Failed to register keymap command "${String(r.name)}"`));continue}return t}function DE(e,t,n,r){if(t.length===0)return{hadError:!1};let i=!1;for(let a of t){let t,o=n();try{t=a(e,o.context)}catch(e){i=!0,r(e);continue}if(t)return{hadError:i,resolved:kE(t,o.getExecutionFields())}}return{hadError:i}}function OE(e){let t={};for(let[n,r]of Object.entries(e))!aE.has(n)&&r!==void 0&&(t[n]=r);return Object.keys(t).length===0?SE:t}function kE(e,t){return{command:e,input:t.input,payload:t.payload}}function AE(e){let t=OE(e);return t===SE?void 0:t}function jE(e){let t=e.query?.namespace,n=ME(e.query?.limit);if(n===0)return[];let r=e.query?.search?.trim().toLowerCase()??``,i=xE;e.query?.searchIn&&e.query.searchIn.length>0&&(i=e.query.searchIn);let a=e.query?.filter,o,s,c;if(typeof a==`function`)s=a;else if(a){let e=Object.entries(a),t=[];for(let[n,r]of e){if(n===`name`){if(typeof r==`string`){c=new Set([r]);continue}if(Array.isArray(r)){let e=new Set;for(let t of r)typeof t==`string`&&e.add(t);c=e;continue}}t.push([n,r])}o=t.length>0?t:void 0}let l=[];for(let a of e.entries){let u=a.commandState;if(PE(u,t)&&NE(u,r,i)&&!(c&&!c.has(u.command.name))&&FE(u,o,e)){if(s){let t=!1;try{t=s(e.getCommand(u))}catch(t){e.onFilterError(t);continue}if(!t)continue}if(l.push(a),n!==void 0&&l.length>=n)break}}return l}function ME(e){if(e===void 0)return;let t=Math.floor(Number(e));return!Number.isFinite(t)||t<=0?0:t}function NE(e,t,n){if(!t)return!0;for(let r of n)if(IE(e,r,t))return!0;return!1}function PE(e,t){if(t===void 0)return!0;let n=e.fields;return Object.prototype.hasOwnProperty.call(n,`namespace`)?UE(n.namespace,t):!1}function FE(e,t,n){if(!t)return!0;for(let[r,i]of t)if(!BE(e,r,i,n))return!1;return!0}function IE(e,t,n){return LE(e,t)?.includes(n)===!0}function LE(e,t){let n=CE.get(e);if(n||(n=new Map,CE.set(e,n)),n.has(t))return n.get(t);let r=e.fields,i=e.attrs,a;t===`name`?a=e.command.name:Object.prototype.hasOwnProperty.call(r,t)?a=r[t]:i&&Object.prototype.hasOwnProperty.call(i,t)&&(a=i[t]);let o=RE(a);return n.set(t,o),o}function RE(e){if(Array.isArray(e)){let t=[];for(let n of e){let e=RE(n);e!==void 0&&t.push(e)}return t.length>0?t.join(`\0`):void 0}if(typeof e==`string`)return e.toLowerCase();if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e).toLowerCase()}function zE(e,t,n,r){try{return e(t,n)}catch(e){return r(e),!1}}function BE(e,t,n,r){return typeof n==`function`?VE(e,t,n,r):HE(e,t,n)}function VE(e,t,n,r){let i=e.command,a=e.fields,o=e.attrs,s,c=!1,l=()=>s??=r.getCommand(e);return t===`name`&&(c=!0,zE(n,i.name,l(),r.onFilterError))||Object.prototype.hasOwnProperty.call(a,t)&&(c=!0,zE(n,a[t],l(),r.onFilterError))||o&&Object.prototype.hasOwnProperty.call(o,t)&&(c=!0,zE(n,o[t],l(),r.onFilterError))?!0:!c&&zE(n,void 0,l(),r.onFilterError)}function HE(e,t,n){let r=e.command,i=e.fields,a=e.attrs;return t===`name`&&UE(r.name,n)||Object.prototype.hasOwnProperty.call(i,t)&&UE(i[t],n)?!0:!!a&&Object.prototype.hasOwnProperty.call(a,t)&&UE(a[t],n)}function UE(e,t){return Array.isArray(t)?t.some(t=>WE(e,t)):WE(e,t)}function WE(e,t){return Array.isArray(e)?e.some(e=>WE(e,t)):Object.is(e,t)}function GE(e,t,n,r,i){let a=(e,t,n,r,a,o)=>({keymap:i.keymap,event:e,focused:t,target:n,data:r,input:a,payload:o}),o=(t,n,r,i)=>{let a=typeof n==`function`?void 0:n,o=typeof n==`function`?n:n.run,s=i?a:void 0,c;try{c=o(a?{...r,command:a}:r)}catch(n){return e.emitError(`command-execution-error`,n,`[Keymap] Error running command "${t}":`),{status:`error`,result:s?{ok:!1,reason:`error`,command:s}:{ok:!1,reason:`error`}}}if(yE(c))return c.catch(n=>{e.emitError(`async-command-error`,n,`[Keymap] Async error in command "${t}":`)}),{status:`handled`,result:s?{ok:!0,command:s}:{ok:!0}};if(KE(c)){let e=c;return(!c.ok&&c.reason!==`not-found`&&i&&a&&!c.command||c.ok&&i&&a&&!c.command)&&(e={...c,command:a}),{status:c.ok?`handled`:`rejected`,result:e}}return c===!1?{status:`rejected`,result:s?{ok:!1,reason:`rejected`,command:s}:{ok:!1,reason:`rejected`}}:{status:`handled`,result:s?{ok:!0,command:s}:{ok:!0}}},s=(e,t,n,r,i,s,c,l)=>{let u;for(let d of t??[]){let t=o(e,d.command,a(n,r,i??d.target??null,s,e,c),l);if(t.status===`handled`||t.status===`error`)return[t.result,u];u=t.result}return[void 0,u]},c=(e,c,l)=>{let u;try{u=cE(e)}catch{return{ok:!1,reason:`invalid-args`}}if(typeof u!=`string`)return{ok:!1,reason:`not-found`};let d=c?.includeCommand===!0,f=c?.focused??n.getFocusedTargetIfAvailable(),p=c?.event??i.createCommandEvent(),m=t.getReadonlyData(),h=c?.payload,g=l===`registered`?r.getRegisteredResolvedEntries(u):r.getActiveRegisteredResolvedEntries(u,f),[_,v]=s(u,g,p,f,c?.target,m,h,d);if(_)return _;let y=v,b=l===`registered`?r.resolveRegisteredResolverFallback(u,{input:u,payload:h}):r.resolveActiveResolverFallback(u,f,{input:u,payload:h});if(b.resolved){let e=o(u,b.resolved.command,a(p,f,c?.target??b.resolved.target??null,m,b.resolved.input??u,b.resolved.payload),d);if(e.status===`handled`||e.status===`error`)return e.result;y=e.result}if(b.hadError)return{ok:!1,reason:`error`};if(l===`active`){let e=r.getDispatchUnavailableCommandState(u,f,d);if(e)return e.command?{ok:!1,reason:e.reason,command:e.command}:{ok:!1,reason:e.reason}}return y??{ok:!1,reason:`not-found`}};return{runCommand(e,t){return c(e,t,`registered`)},dispatchCommand(e,t){return c(e,t,`active`)},runBinding(e,n,i,s,c){let l=t.getReadonlyData();if(n.run)return o(typeof n.command==`string`?n.command:`<function>`,n.run,a(i,s,e.target??null,l,typeof n.command==`string`?n.command:`<function>`,c),!1).status!==`rejected`&&(qE(n,i),!0);if(typeof n.command!=`string`)return!1;let u=r.getResolvedCommandChain(n.command,s,c===void 0?void 0:{input:n.command,payload:c}).entries;for(let t of u??[])if(o(n.command,t.command,a(i,s,t.target??e.target??null,l,t.input??n.command,t.payload),!1).status!==`rejected`)return qE(n,i),!0;return!1}}}function KE(e){return typeof e==`object`&&!!e&&`ok`in e}function qE(e,t){e.preventDefault&&(t.preventDefault(),t.stopPropagation())}var JE=Object.freeze({}),YE=[],XE=[];function ZE(e){if(Object.keys(e).length!==0)return bE(e,{freeze:!0})}function QE(e,t,n,r){let i=t=>iD(t,e.bindingParsers.values(),{tokens:e.tokens,patterns:e.patterns,layer:JE,parseObjectKey:(e,t)=>c(e,t)}),a=t=>{if(typeof t!=`string`)return[c(t)];let n=rD(t,e.bindingParsers.values(),{tokens:e.tokens,patterns:e.patterns,layer:JE,parseObjectKey:(e,t)=>c(e,t)});for(let e of n.unknownTokens)r.warnUnknownToken(e,t);return n.unknownTokens.length>0?[]:n.parts},o=(e,t)=>hT(a(e),t),s=(i,a,o,s,d)=>{let f=[],p=!1,m=e.bindingExpanders.values(),h=e.bindingParsers.values(),g=e.bindingFields,_=e.disambiguationResolvers.has(),v=r.warnUnknownField,y=r.warnUnknownToken;for(let[r,b]of i.entries()){let i;try{i=tD(b.key,m,{layer:d})}catch(e){t.emitError(`binding-expand-error`,e,vE(e,`Failed to expand keymap binding`));continue}for(let m of i){let i=m.key,x;try{x=typeof i==`string`?rD(i,h,{tokens:a,patterns:e.patterns,layer:d,parseObjectKey:(e,t)=>c(e,t)}):{parts:[c(i)],usedTokens:[],unknownTokens:[],hasTokenBindings:!1},x=nD(x,m)}catch(e){t.emitError(`binding-parse-error`,e,vE(e,`Failed to parse keymap binding`));continue}let S=x.parts;p||=x.hasTokenBindings;for(let e of x.unknownTokens)y(e,typeof i==`string`?i:String(i.name));if(!(x.unknownTokens.length>0))for(let i of u(b,S,a,h,d))try{let t=l(i.event),a=i.sequence,c={},u={},d=[];for(let e in i){if(e===`sequence`||oE.has(e))continue;let t=i[e];if(t===void 0)continue;let r=g.get(e);if(!r){v(`binding`,e);continue}r(t,gE({fieldName:e,conditions:n,requirements:c,matchers:d,attrs:u}))}let p=Object.keys(u).length>0?ZE(u):void 0,m=cE(i.cmd),h={binding:b,sequence:a,command:m,event:t,parsedBinding:WT(i),sourceTarget:o,sourceLayerOrder:s,bindingIndex:r,requires:Object.keys(c).length>0?Object.entries(c):YE,matchers:d.length>0?d:XE,preventDefault:i.preventDefault!==!1,fallthrough:i.fallthrough??!1};if(p&&(h.attrs=p),typeof m==`function`&&(h.run=m),a.length===0)continue;if(t===`release`&&a.length>1)throw Error(`Keymap release bindings only support a single key stroke`);let y=a.at(-1);if(y?.patternName){let t=e.patterns.get(y.patternName);if(t&&t.max!==t.min)throw Error(`Keymap unbounded sequence patterns must be followed by a concrete continuation`)}t===`press`&&!_&&eD(f,h),f.push(h)}catch(e){t.emitError(`binding-compile-error`,e,vE(e,`Failed to compile keymap binding`))}}}return{bindings:f,hasTokenBindings:p}},c=(e,t)=>cT(e,t),l=e=>{if(e===void 0||e===`press`)return`press`;if(e===`release`)return`release`;throw Error(`Invalid keymap binding event "${String(e)}": expected "press" or "release"`)},u=(n,r,i,a,o)=>{let s=e.bindingTransformers.values();if(s.length===0)return[{...n,sequence:uT(r)}];let l={...n,sequence:uT(r)},u=[],d=!0,f=o??JE;for(let n of s)try{n(l,{layer:f,parseKey:t=>iD(t,a,{tokens:i,patterns:e.patterns,layer:f,parseObjectKey:(e,t)=>c(e,t)}),add:e=>{u.push(WT(e))},skipOriginal:()=>{d=!1}})}catch(e){t.emitError(`binding-transformer-error`,e,`[Keymap] Error in binding transformer:`)}return d?u.length===0?[l]:[l,...u]:u};return{parseTokenKey:i,parseKeySequence:a,formatKey:o,compileBindings:s}}function $E(e,t){if(e.length>=t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.match!==t[n]?.match)return!1;return!0}function eD(e,t){for(let n of e)if(n.event===`press`&&(n.command!==void 0&&$E(n.sequence,t.sequence)||t.command!==void 0&&$E(t.sequence,n.sequence)))throw Error(`Keymap bindings cannot use the same sequence as both an exact match and a prefix in the same layer`)}function tD(e,t,n){if(typeof e!=`string`||t.length===0)return[{key:e}];let r=n?.layer??JE,i=[{key:e}];for(let e of t){let t=[];for(let n of i){let i=e({input:n.key,displays:n.displays,layer:r});if(!i){t.push(n);continue}if(i.length===0)throw Error(`Keymap binding expander must return at least one key sequence for "${n.key}"`);for(let e of i){if(!e||typeof e!=`object`||Array.isArray(e)||typeof e.key!=`string`)throw Error(`Keymap binding expander must return expansion objects with string keys for "${n.key}"`);if(e.displays!==void 0){if(!Array.isArray(e.displays))throw Error(`Keymap binding expander displays must be an array of strings for "${n.key}"`);for(let t of e.displays)if(typeof t!=`string`)throw Error(`Keymap binding expander displays must be an array of strings for "${n.key}"`)}t.push(e)}}i=t}return i}function nD(e,t){if(!t.displays)return e;if(t.displays.length!==e.parts.length)throw Error(`Keymap binding expansion displays length must match parsed sequence length for "${String(t.key)}"`);return{...e,parts:e.parts.map((e,n)=>({...e,display:t.displays[n]}))}}function rD(e,t,n){if(e.length===0)throw Error(`Invalid key sequence: sequence cannot be empty`);if(t.length===0)throw Error(`No keymap binding parsers are registered`);let r=n.tokens??new Map,i=n.patterns??new Map,a=n.layer??JE,o=n.parseObjectKey,s=[],c=new Set,l=new Set,u=0;for(;u<e.length;){let n=!1;for(let d of t){let t=d({input:e,index:u,layer:a,tokens:r,patterns:i,normalizeTokenName:iT,createMatch:pT,parseObjectKey:o});if(t){if(t.nextIndex<=u||t.nextIndex>e.length)throw Error(`Keymap binding parser must advance the input for "${e}" at index ${u}`);s.push(...t.parts);for(let e of t.usedTokens??[])c.add(e);for(let e of t.unknownTokens??[])l.add(e);u=t.nextIndex,n=!0;break}}if(!n)throw Error(`No keymap binding parser handled input at index ${u} in "${e}"`)}return{parts:s,usedTokens:[...c],unknownTokens:[...l],hasTokenBindings:c.size>0||l.size>0}}function iD(e,t,n){if(typeof e!=`string`)return n.parseObjectKey(e);let{parts:r}=rD(e,t,n),[i]=r;if(!i||r.length!==1)throw Error(`Invalid key "${String(e)}": expected a single key stroke`);return i}function aD(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.get==`function`&&typeof t.subscribe==`function`}function oD(e,t){let n=e=>e.requires.length===0&&e.matchers.length===0,r=e=>{try{return e.match()}catch(n){return t.emitError(`runtime-matcher-error`,n,`[Keymap] Error evaluating runtime matcher from ${e.source}:`),!1}},i=e=>{if(e.matchers.length===0)return!0;if(e.matchers.length===1){let[t]=e.matchers;return!t||r(t)}for(let t of e.matchers)if(!r(t))return!1;return!0},a=t=>{if(t.length===0)return!0;for(let[n,r]of t)if(!Object.is(e.data[n],r))return!1;return!0};return{buildRuntimeMatcher(e,t){if(typeof e==`function`)return{source:t,match:e};if(aD(e))return{source:t,match:()=>e.get(),subscribe:t=>e.subscribe(t)};throw Error(`Keymap ${t} expected a function or a reactive matcher`)},matchesConditions:e=>n(e)||a(e.requires)&&i(e)}}var sD=Symbol(`keymap-disambiguation-decision`),cD=Symbol(`keymap-deferred-disambiguation-decision`);function lD(e,t){return{[sD]:!0,action:e,handler:t}}function uD(e){return{[cD]:!0,action:e}}function dD(e){return!!e&&typeof e==`object`&&e[sD]===!0}function fD(e){return!!e&&typeof e==`object`&&e[cD]===!0}function pD(e,t){return t.aborted?Promise.resolve(!1):new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n(!0)},Math.max(0,e)),i=()=>{clearTimeout(r),t.removeEventListener(`abort`,i),n(!1)};t.addEventListener(`abort`,i,{once:!0})})}function mD(e,t,n,r){let i=e.get(n);if(i)try{return i.matcher(r)}catch(e){t.emitError(`sequence-pattern-match-error`,e,`[Keymap] Error matching sequence pattern "${i.name}":`);return}}function hD(e,t,n,r){let i=e.get(n)?.payloadKey??n;return{...cT({name:t.name,ctrl:t.ctrl,shift:t.shift,meta:t.meta,super:t.super??!1,hyper:t.hyper||void 0},{display:r.display??String(r.value??t.name)}),patternName:n,payloadKey:i}}function gD(e,t,n){if(!n?.patterns||n.patterns.length===0)return;let r={},i=!1;for(let a of n.patterns){let n=e.get(a.name),o;try{o=n?.finalize?n.finalize(a.values):a.values.length===1?a.values[0]:[...a.values]}catch(e){t.emitError(`sequence-pattern-finalize-error`,e,`[Keymap] Error finalizing sequence pattern "${a.name}":`);continue}let s=r[a.payloadKey];s===void 0?(r[a.payloadKey]=o,i=!0):Array.isArray(s)?s.push(o):r[a.payloadKey]=[s,o]}return i?r:void 0}function _D(e,t,n,r,i,a,o,s,c,l){let u={resolveKey:e=>o.parseTokenKey(e).match},d=null,f=0;function p(t,n,r){if(t===`key`){let t=r;return e.keyHooks.register(n,{priority:t?.priority??0,release:t?.release??!1})}if(t===`key:after`){let t=r;return e.keyAfterHooks.register(n,{priority:t?.priority??0,release:t?.release??!1})}let i=r;return e.rawHooks.register(n,{priority:i?.priority??0})}function m(t){return e.eventMatchResolvers.prepend(t)}function h(t){return e.eventMatchResolvers.append(t)}function g(){e.eventMatchResolvers.clear()}function _(t){return L(()=>e.disambiguationResolvers.prepend(t),t)}function v(t){return L(()=>e.disambiguationResolvers.append(t),t)}function y(){e.disambiguationResolvers.has()&&t.runWithStateChangeBatch(()=>{e.disambiguationResolvers.clear(),c.recompileBindings()})}function b(e,t){d&&U()}function x(n){let r=e.rawHooks.entries();if(r.length===0)return!1;let i=!1,a={sequence:n,stop(){i=!0}};for(let e of r){try{e.listener(a)}catch(e){t.emitError(`raw-intercept-error`,e,`[Keymap] Error in raw intercept listener:`)}if(i)return!0}return!1}function S(e,t){return{sequence:uT(e.sequence),command:e.command,commandAttrs:s.getBindingCommandAttrs(e,t,s.getActiveCommandView(t)),attrs:e.attrs,event:e.event,preventDefault:e.preventDefault,fallthrough:e.fallthrough,sourceLayerOrder:e.sourceLayerOrder,bindingIndex:e.bindingIndex}}function C(e){l.has(`dispatch`)&&l.emit(`dispatch`,e)}function w(e,t,n,r){l.has(`dispatch`)&&C({phase:e,event:n.event,focused:r,layer:{order:t.order,priority:t.priority,target:t.target,targetMode:t.targetMode},binding:S(n,r),sequence:uT(n.sequence),command:n.command})}function T(e,t,n){if(!l.has(`dispatch`))return;let i=t[0],a=t.length>0?r.collectSequencePartsFromPending({captures:t}):[];C({phase:e,event:`press`,focused:n,layer:i?{order:i.layer.order,priority:i.layer.priority,target:i.layer.target,targetMode:i.layer.targetMode}:void 0,sequence:a})}function E(t){let n=e.keyAfterHooks.entries();for(let e of n)if(e.release===t)return n}function D(e){return e.sequence?uT(e.sequence):e.captures?r.collectSequencePartsFromPending({captures:e.captures}):[]}function O(e,t){return{handled:e!==`sequence-miss`,reason:e,captures:t}}function k(e,t){return{handled:t,reason:t?`binding-handled`:`binding-rejected`,sequence:e.sequence}}function A(e,t){return t.handled||e.reason===`no-match`?t:e}function j(e,i,a,o,s){let c={event:i,eventType:a?`release`:`press`,focused:o,handled:s.handled,reason:s.reason,sequence:D(s),pendingSequence:r.getPendingSequence(),setData:(e,t)=>{n.setData(e,t)},getData:e=>n.getData(e),consume:e=>{let t=e?.preventDefault??!0,n=e?.stopPropagation??!0;t&&i.preventDefault(),n&&i.stopPropagation()}};for(let n of e)if(n.release===a)try{n.listener(c)}catch(e){t.emitError(`key-after-intercept-error`,e,`[Keymap] Error in key:after intercept listener:`)}}function M(){return{handled:!1,reason:`no-match`}}function N(e){e.preventDefault(),e.stopPropagation()}function P(e,t,n,i){r.setPendingSequence({captures:t});let a=O(`sequence-pending`,t);return T(e,t,n),N(i),a}function F(e,t,n,i){let a=O(e,t);return T(`sequence-clear`,t,n),r.setPendingSequence(null),N(i),a}function I(i,a){a||U();let o=E(a),s=o?r.getFocusedTarget():null,c=e.keyHooks.entries(),l={event:i,setData:(e,t)=>{n.setData(e,t)},getData:e=>n.getData(e),consume:e=>{let t=e?.preventDefault??!0,n=e?.stopPropagation??!0;t&&i.preventDefault(),n&&i.stopPropagation()}};for(let e of c)if(e.release===a){try{e.listener(l)}catch(e){t.emitError(`key-intercept-error`,e,`[Keymap] Error in key intercept listener:`)}if(i.propagationStopped){o&&j(o,i,a,s,{handled:!0,reason:`intercept-consumed`,sequence:[]});return}}if(a){let e=R(i);o&&j(o,i,a,s,e);return}let u=z(i);o&&j(o,i,a,s,u)}function L(n,r){return t.runWithStateChangeBatch(()=>{let i=e.disambiguationResolvers.has(),a=n();return!i&&e.disambiguationResolvers.has()&&c.recompileBindings(),()=>{t.runWithStateChangeBatch(()=>{let t=e.disambiguationResolvers.has();a(),!e.disambiguationResolvers.values().includes(r)&&t&&!e.disambiguationResolvers.has()&&c.recompileBindings()})}})}function R(e){let t=r.getFocusedTarget(),n=r.getActiveLayers(t),a=he(e),o=M();for(let r of a)layerLoop:for(let a of n){if(a.bindings.length===0||!i.matchesConditions(a))continue;let n=ge(a,r,e,t);if(o=A(o,n.outcome),n.handled){if(n.stop)return o;continue layerLoop}}return o}function z(e){let t=r.getFocusedTarget(),n=r.ensureValidPendingSequence(),i=he(e);if(n)return ee(n,i,e,t);let a=r.getActiveLayers(t),o=M();for(let n of i){let r=ne(a,[n],e,t);if(o=A(o,r),r.handled)return o}return o}function ee(t,n,i,a){let o=s.getActiveCommandView(a),c=[];for(let r of t.captures){let t=FT(r,n,i,e.patterns,_e,ve);t&&c.push(t)}let l=c.reduce((e,t)=>Math.min(e,NT(t,n)),1/0),u=c.filter(e=>NT(e,n)===l);if(u.length===0||!u.some(e=>xe(e,a,o))){let e=O(`sequence-miss`,t.captures);return T(`sequence-clear`,t.captures,a),r.setPendingSequence(null),e}return te(u,0,!1,i,a)}function te(t,n,i,a,o){let s=i,c=M(),l=new Set;for(let i=n;i<t.length;i+=1){let n=t[i];if(!n||l.has(n))continue;let u=pe(t,i,n);if(u.length>0){if(s)continue;let e=me(t,n);return V(t,i,u,e,a,o,s)||P(`sequence-advance`,u,o,a)}if(!OT(n,e.patterns))continue;let d=me(t,n);for(let e of d)l.add(e);let f=Se(n.layer,d,a,o);if(c=A(c,f.outcome),f.handled&&(s=!0,f.stop))return T(`sequence-clear`,t,o),r.setPendingSequence(null),c}return T(`sequence-clear`,t,o),r.setPendingSequence(null),c}function ne(e,t,n,r){return B(e,0,t,n,r)}function B(t,n,r,a,o){let c=s.getActiveCommandView(o),l=M();for(let s=n;s<t.length;s+=1){let n=t[s];if(!n||!i.matchesConditions(n))continue;let u=ye(n,r,a,o,c);if(u.length===0)continue;if(u.filter(t=>DT(t,e.patterns,!1)).length>0){let n=u.filter(t=>OT(t,e.patterns)),i=fe(t,s,r,a,o);return re(t,s,r,i,n,a,o)||P(`sequence-start`,i,o,a)}let d=Se(n,u.filter(t=>OT(t,e.patterns)),a,o);if(l=A(l,d.outcome),d.handled&&d.stop)return l}return l}function re(e,t,n,i,a,o,s){return H({event:o,focused:s,continuationCaptures:i,exactBindingsSource:a.map(e=>e.binding),sequencePhase:`sequence-start`,runExact:()=>{r.setPendingSequence(null);let i=a[0]?.layer;if(!i)return M();let c=Se(i,a,o,s);return c.stop?c.outcome:A(c.outcome,B(e,t+1,n,o,s))}})}function V(e,t,n,i,a,o,s){return H({event:a,focused:o,continuationCaptures:n,exactBindingsSource:i.map(e=>e.binding),sequencePhase:`sequence-advance`,runExact:()=>{r.setPendingSequence(null);let n=i[0]?.layer;if(!n)return M();let c=Se(n,i,a,o);return c.stop?c.outcome:A(c.outcome,te(e,t+1,s||c.handled,a,o))}})}function H(t){let{event:n,focused:i,continuationCaptures:a,exactBindingsSource:o,sequencePhase:c,runExact:l}=t;if(!e.disambiguationResolvers.has()||a.length===0)return;let u=s.getActiveCommandView(i),d=r.collectMatchingBindings(o,i,u);if(!d.some(e=>e.command!==void 0))return;let f=()=>P(c,a,i,n),p=()=>F(`sequence-cleared`,a,i,n),m,h=()=>(m??=r.collectSequencePartsFromPending({captures:a}),m),g=ae({event:n,focused:i,getSequence:h,exactBindings:d,continuationCaptures:a,activeView:u});return g?ie(g,a,l,f,p,i,h):(de(h()),f())}function ie(e,t,n,r,i,a,o){if(e.action===`run-exact`)return n();if(e.action===`continue-sequence`)return r();if(e.action===`clear`)return i();let s=r();return oe(t,e.handler,a,o(),e=>{if(e){if(e.action===`run-exact`){n();return}if(e.action===`continue-sequence`){r();return}i()}}),s}function ae(i){let a,o,s,c,l={event:i.event,focused:i.focused,get sequence(){return a??=uT(i.getSequence()),a},get stroke(){let e=i.getSequence().at(-1);if(!e)throw Error(`Disambiguation context expected a non-empty sequence`);return c??={...e,stroke:sT(e.stroke)},c},get exact(){return o??=r.collectActiveBindings(i.exactBindings,i.focused,i.activeView).map(e=>({...e,sequence:uT(e.sequence)})),o},get continuations(){return s??=r.getActiveKeysForCaptures(i.continuationCaptures,{includeBindings:!0,includeMetadata:!0}),s},getData:e=>n.getData(e),setData:(e,t)=>{n.setData(e,t)},runExact:()=>lD(`run-exact`),continueSequence:()=>lD(`continue-sequence`),clear:()=>lD(`clear`),defer:e=>lD(`defer`,e)};for(let n of e.disambiguationResolvers.values()){let e;try{e=n(l)}catch(e){t.emitError(`disambiguation-resolver-error`,e,`[Keymap] Error in disambiguation resolver:`);continue}if(e!==void 0){if(yE(e)){t.emitError(`invalid-disambiguation-resolver-return`,e,`[Keymap] Disambiguation resolvers must return synchronously; use ctx.defer(...) for async handling`);continue}if(!dD(e)){t.emitError(`invalid-disambiguation-decision`,e,`[Keymap] Invalid disambiguation decision returned by resolver:`);continue}return e}}}function oe(e,t,n,r,i){U();let a=new AbortController,o={id:f++,controller:a,captures:e,apply:i};d=o,queueMicrotask(()=>{se(o,t,n,r)})}function se(e,n,r,i){if(!ue(e))return;let a={signal:e.controller.signal,sequence:uT(i),focused:r,sleep:t=>pD(t,e.controller.signal),runExact:()=>uD(`run-exact`),continueSequence:()=>uD(`continue-sequence`),clear:()=>uD(`clear`)},o;try{o=n(a)}catch(n){ue(e)&&(t.emitError(`deferred-disambiguation-error`,n,`[Keymap] Error in deferred disambiguation handler:`),le(e));return}if(yE(o)){o.then(t=>{ce(e,t)}).catch(n=>{ue(e)&&(t.emitError(`deferred-disambiguation-error`,n,`[Keymap] Error in deferred disambiguation handler:`),le(e))});return}ce(e,o)}function ce(e,n){if(ue(e)){if(n!==void 0&&!fD(n)){t.emitError(`invalid-deferred-disambiguation-decision`,n,`[Keymap] Invalid deferred disambiguation decision returned by handler:`),le(e);return}le(e),e.apply(n)}}function le(e){ue(e)&&(d=null)}function U(){let e=d;e&&(d=null,e.controller.abort())}function ue(e){return d===e}function de(e){let n=hT(e,{preferDisplay:!0});t.warnOnce(`unresolved-disambiguation:${n}`,`unresolved-disambiguation`,{sequence:n},`[Keymap] Ambiguous exact/prefix sequence "${n}" fell back to prefix handling because no disambiguation resolver resolved it`)}function fe(t,n,r,a,o){let c=[],l=s.getActiveCommandView(o);for(let s=n;s<t.length;s+=1){let n=t[s];if(n&&i.matchesConditions(n))for(let t of ye(n,r,a,o,l))DT(t,e.patterns,!1)&&c.push(t)}return c}function pe(t,n,r){return t.filter((t,i)=>i>=n&&DT(t,e.patterns,!1)&&yD(t.parts,r.parts))}function me(t,n){return t.filter(t=>t.layer===n.layer&&OT(t,e.patterns)&&yD(t.parts,n.parts))}function he(n){let r=e.eventMatchResolvers.values();if(r.length===0)return[];if(r.length===1)return vD(r[0],n,u,t);let i=[],a=new Set;for(let e of r){let r;try{r=e(n,u)}catch(e){t.emitError(`event-match-resolver-error`,e,`[Keymap] Error in event match resolver:`);continue}if(!(!r||r.length===0))for(let e of r){if(typeof e!=`string`){t.emitError(`invalid-event-match-resolver-candidate`,e,`[Keymap] Invalid event match resolver candidate:`);continue}a.has(e)||(a.add(e),i.push(e))}}return i}function ge(e,t,n,r){let o=!1,s=M();for(let c of e.bindings){if(c.event!==`release`)continue;let l=c.sequence[0];if(!l||l.match!==t||!i.matchesConditions(c))continue;let u=a.runBinding(e,c,n,r);if(s=A(s,k(c,u)),!u){w(`binding-reject`,e,c,r);continue}if(w(`binding-execute`,e,c,r),o=!0,!c.fallthrough)return{handled:!0,stop:!0,outcome:s}}return{handled:o,stop:!1,outcome:s}}function _e(n,r){return mD(e.patterns,t,n,r)}function ve(t,n,r){return hD(e.patterns,t,n,r)}function ye(e,t,n,r,i){let a=IT(e,t,n,_e,ve);return a.some(e=>xe(e,r,i))?a:[]}function W(n){return gD(e.patterns,t,n)}function be(e,t,n){return i.matchesConditions(e)&&s.isBindingVisible(e,t,n)}function xe(e,t,n){return be(e.binding,t,n)}function Se(e,t,n,r){let o=!1,s=M();for(let c of t){let t=c.binding;if(!i.matchesConditions(t))continue;let l=a.runBinding(e,t,n,r,W(c));if(s=A(s,k(t,l)),!l){w(`binding-reject`,e,t,r);continue}if(w(`binding-execute`,e,t,r),o=!0,!t.fallthrough)return{handled:!0,stop:!0,outcome:s}}return{handled:o,stop:!1,outcome:s}}return{intercept:p,prependEventMatchResolver:m,appendEventMatchResolver:h,clearEventMatchResolvers:g,prependDisambiguationResolver:_,appendDisambiguationResolver:v,clearDisambiguationResolvers:y,handlePendingSequenceChange:b,handleRawSequence:x,handleKeyEvent:I}}function vD(e,t,n,r){let i;try{i=e(t,n)}catch(e){return r.emitError(`event-match-resolver-error`,e,`[Keymap] Error in event match resolver:`),[]}if(!i||i.length===0)return[];if(i.length===1){let[e]=i;return typeof e==`string`?[e]:(r.emitError(`invalid-event-match-resolver-candidate`,e,`[Keymap] Invalid event match resolver candidate:`),[])}let a=[],o=new Set;for(let e of i){if(typeof e!=`string`){r.emitError(`invalid-event-match-resolver-candidate`,e,`[Keymap] Invalid event match resolver candidate:`);continue}o.has(e)||(o.add(e),a.push(e))}return a}function yD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.match!==t[n]?.match)return!1;return!0}var bD=()=>{};function xD(e,t,n,r){if(n===void 0)return r;if(typeof n!=`number`||!Number.isInteger(n)||n<0)throw Error(`Keymap sequence pattern "${e}" ${t} must be a non-negative integer`);return n}function SD(e,t){let{kind:n,reservedFields:r,registeredFields:i,emitError:a}=t,o=Object.entries(e),s=[];for(let[e,t]of o){if(r.has(e)){a(`reserved-${n}-field`,{field:e,kind:n},`Keymap ${n} field "${e}" is reserved`);continue}if(i.has(e)){a(`duplicate-${n}-field`,{field:e,kind:n},`Keymap ${n} field "${e}" is already registered`);continue}i.set(e,t),s.push([e,t])}return()=>{for(let[e,t]of s)i.get(e)===t&&i.delete(e)}}function CD(e,t,n,r,i){let a;try{a=iT(i.name)}catch(e){return t.emitError(`token-name-normalize-error`,e,vE(e,`Failed to register keymap token`)),bD}if(e.tokens.has(a)||e.patterns.has(a))return t.emitError(`duplicate-token`,{token:a},`Keymap token "${a}" is already registered`),bD;let o;try{if(o=n.parseTokenKey(i.key),o.patternName)throw Error(`Invalid key "${String(i.key)}": expected a concrete key stroke`)}catch(e){return t.emitError(`token-parse-error`,e,vE(e,`Failed to register keymap token "${a}"`)),bD}let s={stroke:o.stroke,match:o.match},c=new Map(e.tokens);c.set(a,s);try{r.applyTokenState(c)}catch(e){return t.emitError(`token-register-error`,e,vE(e,`Failed to register keymap token "${a}"`)),bD}return()=>{if(e.tokens.get(a)!==s)return;let n=new Map(e.tokens);n.delete(a);try{r.applyTokenState(n)}catch(e){t.emitError(`token-unregister-error`,e,vE(e,`Failed to unregister keymap token "${a}"`))}}}function wD(e,t,n,r){let i,a;try{i=iT(r.name);let e=xD(i,`min`,r.min,1),t=xD(i,`max`,r.max,2**53-1);if(t<e)throw Error(`Keymap sequence pattern "${i}" max must be greater than or equal to min`);a={name:i,display:r.display,payloadKey:r.payloadKey??i,match:pT(`pattern:${i}`),min:e,max:t,matcher:e=>r.match(e),finalize:r.finalize}}catch(e){return t.emitError(`sequence-pattern-register-error`,e,vE(e,`Failed to register keymap sequence pattern`)),bD}return e.tokens.has(i)||e.patterns.has(i)?(t.emitError(`duplicate-sequence-pattern`,{pattern:i},`Keymap sequence pattern "${i}" is already registered`),bD):(e.patterns.set(i,a),n.recompileBindings(),()=>{e.patterns.get(i)===a&&(e.patterns.delete(i),n.recompileBindings())})}function TD(e,t,n,r){return SD(r,{kind:n,reservedFields:n===`layer`?sE:n===`binding`?oE:aE,registeredFields:n===`layer`?e.layerFields:n===`binding`?e.bindingFields:e.commandFields,emitError:(e,n,r)=>t.emitError(e,n,r)})}var ED=()=>{};function DD(e,t){return t.priority-e.priority||t.order-e.order}function OD(e){if(e.matchers.length>0)return!0;for(let t of e.commands)if(t.matchers.length>0)return!0;for(let t of e.bindings)if(t.matchers.length>0)return!0;return!1}function kD(e){if(e.commands.length===0)return!1;if(e.matchers.length>0)return!0;for(let t of e.commands)if(t.matchers.length>0)return!0;return!1}function AD(e,t,n,r,i){let a=n=>t.runWithStateChangeBatch(()=>{let a=n.target;if(a&&i.host.isTargetDestroyed(a))return t.emitError(`destroyed-layer-target`,{target:a},`Cannot register a keymap layer for a destroyed keymap target`),ED;let o,s,c,p,m,v,y;try{y=l(n),o=u(UT(n.bindings??[]),n);let e=d(n.commands??[],n);v=e.length===0?[]:i.commands.normalizeCommands(e),{requires:s,matchers:c,fields:p,attrs:m}=f(n)}catch(e){return t.emitError(`register-layer-failed`,e,vE(e,`Failed to register keymap layer`)),ED}let b=e.order++,x=i.compiler.compileBindings(o,e.tokens,a,b,p);if(x.bindings.length===0&&!x.hasTokenBindings&&v.length===0)return ED;i.diagnostics?.analyzeLayer({target:a,order:b,commands:v,sourceBindings:o,bindings:x.bindings,hasTokenBindings:x.hasTokenBindings});let S={order:b,target:a,targetMode:y,priority:n.priority??0,requires:s,matchers:c,fields:p,attrs:m,commands:v,sourceBindings:o,bindings:x.bindings,root:AT(x.bindings,e.patterns),hasTokenBindings:x.hasTokenBindings,activeKeyCacheBlocked:!1,activeCommandViewCacheBlocked:!1};_(S),e.layers.add(S),e.sortedLayers=[...e.sortedLayers,S].sort(DD),g(S);for(let e of S.commands)g(e);for(let e of S.bindings)g(e);return a&&(S.offTargetDestroy=i.host.onTargetDestroy(a,()=>{h(S)})),S.commands.length>0&&r.ensureValidPendingSequence(),t.queueStateChange(),()=>{h(S)}}),o=n=>{t.runWithStateChangeBatch(()=>{let i=new Map;for(let t of e.layers)t.hasTokenBindings&&i.set(t,p(t,n));e.tokens=n;let a=!1;for(let[e,t]of i)m(e,t)&&(a=!0);a&&r.setPendingSequence(null),i.size>0&&t.queueStateChange()})},s=()=>{t.runWithStateChangeBatch(()=>{let n=0,i=!1;for(let t of e.layers){if(t.sourceBindings.length===0)continue;let r=p(t,e.tokens);m(t,r)&&(i=!0),n+=1}i&&r.setPendingSequence(null),n>0&&t.queueStateChange()})},c=()=>{for(let t of e.layers){y(t);for(let e of t.commands)y(e);for(let e of t.bindings)y(e);t.offTargetDestroy?.(),t.offTargetDestroy=void 0}},l=e=>{if(e.targetMode){if(!e.target)throw Error(`Keymap targetMode "${e.targetMode}" requires a target`);return e.targetMode}return e.target?`focus-within`:void 0},u=(t,n)=>{let r=e.layerBindingsTransformers.values();if(r.length===0)return t;let i=t;for(let e of r){let t=e(i,{layer:n,validateBindings:e=>HT(e)});t&&(i=UT(t))}return i},d=(n,r)=>{let i=e.commandTransformers.values();if(n.length===0||i.length===0)return n;let a=[];for(let e of n){let n={...e},o=[],s=!0;for(let e of i)try{e(n,{layer:r,add(e){o.push({...e})},skipOriginal(){s=!1}})}catch(e){t.emitError(`command-transformer-error`,e,`[Keymap] Error in command transformer:`)}s&&a.push(n),a.push(...o)}return a},f=t=>{let r={},a=[],o=Object.create(null),s={};for(let[c,l]of Object.entries(t)){if(sE.has(c)||l===void 0)continue;o[c]=bE(l);let t=e.layerFields.get(c);if(!t){i.warnUnknownField(`layer`,c);continue}t(l,gE({fieldName:c,conditions:n,requirements:r,matchers:a,attrs:s}))}return{requires:Object.entries(r),matchers:a,fields:Object.keys(o).length>0?Object.freeze(o):void 0,attrs:Object.keys(s).length>0?bE(s,{freeze:!0}):void 0}},p=(e,t)=>i.compiler.compileBindings(e.sourceBindings,t,e.target,e.order,e.fields),m=(t,n)=>{i.diagnostics?.analyzeLayer({target:t.target,order:t.order,commands:t.commands,sourceBindings:t.sourceBindings,bindings:n.bindings,hasTokenBindings:n.hasTokenBindings}),v(t);for(let e of t.bindings)y(e);t.bindings=n.bindings,t.root=AT(n.bindings,e.patterns),t.hasTokenBindings=n.hasTokenBindings,_(t);for(let e of t.bindings)g(e);return e.pending?.captures.some(e=>e.layer===t)??!1},h=n=>{t.runWithStateChangeBatch(()=>{if(e.layers.delete(n)){e.sortedLayers=e.sortedLayers.filter(e=>e!==n),v(n),y(n);for(let e of n.commands)y(e);for(let e of n.bindings)y(e);n.offTargetDestroy?.(),n.offTargetDestroy=void 0,e.pending?.captures.some(e=>e.layer===n)?r.setPendingSequence(null):n.commands.length>0&&!i.host.isDestroyed&&r.ensureValidPendingSequence(),t.queueStateChange()}})},g=e=>{for(let n of e.matchers)if(n.subscribe)try{n.dispose=n.subscribe(()=>{if(!r.hasPendingSequenceState()){t.queueStateChange();return}t.runWithStateChangeBatch(()=>{r.revalidatePendingSequenceIfNeeded(),t.queueStateChange()})})}catch(e){t.emitError(`reactive-matcher-subscribe-error`,e,vE(e,`Failed to subscribe to reactive matcher from ${n.source}`))}},_=t=>{let n=OD(t),r=kD(t);t.activeKeyCacheBlocked=n,t.activeCommandViewCacheBlocked=r,n&&(e.activeKeyCacheBlockers+=1),r&&(e.activeCommandViewCacheBlockers+=1)},v=t=>{t.activeKeyCacheBlocked&&=(--e.activeKeyCacheBlockers,!1),t.activeCommandViewCacheBlocked&&=(--e.activeCommandViewCacheBlockers,!1)},y=e=>{for(let n of e.matchers)if(n.dispose){try{n.dispose()}catch(e){t.emitError(`reactive-matcher-dispose-error`,e,vE(e,`Failed to dispose reactive matcher from ${n.source}`))}n.dispose=void 0}};return{registerLayer:a,applyTokenState:o,recompileBindings:s,cleanup:c}}var jD=1e3;function MD(e,t,n){let r=(e,n,r)=>{if(!t.has(`warning`)){let t=`[${e}] ${r}`;n instanceof Error?console.warn(t,n):console.warn(t);return}t.emit(`warning`,{code:e,message:r,warning:n})},i=(e,n,r)=>{if(!t.has(`error`)){let t=`[${e}] ${r}`;n instanceof Error?console.error(t,n):console.error(t);return}t.emit(`error`,{code:e,message:r,error:n})},a=()=>{if(!(!e.stateChangePending||e.stateChangeDepth>0||e.flushingStateChange)){e.flushingStateChange=!0;try{let t=0;for(;e.stateChangePending&&e.stateChangeDepth===0;){if(t>=jD){e.stateChangePending=!1,i(`state-change-feedback-loop`,{iterations:jD},`[Keymap] Possible infinite state listener feedback loop detected after ${jD} iterations; pending state notifications were dropped`);break}t+=1,e.stateChangePending=!1,n.emit(`state`)}}finally{e.flushingStateChange=!1}}};return{runWithStateChangeBatch(t){e.stateChangeDepth+=1;try{return t()}finally{--e.stateChangeDepth,e.stateChangeDepth===0&&a()}},queueStateChange(t){e.derivedVersion+=1,t?.invalidateCaches!==!1&&(e.cacheVersion+=1),n.has(`state`)&&(e.stateChangePending=!0,e.stateChangeDepth===0&&!e.flushingStateChange&&a())},emitWarning:r,emitError:i,reportListenerError(e,t){if(e===`state`){i(`state-listener-error`,t,`[Keymap] Error in state listener:`);return}if(e===`pendingSequence`){i(`pending-sequence-listener-error`,t,`[Keymap] Error in pending sequence listener:`);return}e===`dispatch`&&i(`dispatch-listener-error`,t,`[Keymap] Error in dispatch listener:`)},warnOnce(t,n,i,a){e.usedWarningKeys.has(t)||(e.usedWarningKeys.add(t),r(n,i,a))}}}function ND(e,t,n){return{getData(t){return e.data[t]},setData(r,i){t.runWithStateChangeBatch(()=>{if(i===void 0){if(!(r in e.data))return;delete e.data[r],e.dataVersion+=1,n.ensureValidPendingSequence(),t.queueStateChange();return}Object.is(e.data[r],i)||(e.data[r]=i,e.dataVersion+=1,n.ensureValidPendingSequence(),t.queueStateChange())})},getReadonlyData(){return e.readonlyDataVersion===e.dataVersion?e.readonlyData:(e.readonlyData=Object.freeze({...e.data}),e.readonlyDataVersion=e.dataVersion,e.readonlyData)}}}var PD=Object.freeze({});function FD(){return{order:0,tokens:new Map,patterns:new Map,layerFields:new Map,layerBindingsTransformers:zT(),bindingExpanders:zT(),bindingParsers:zT(),bindingTransformers:zT(),bindingFields:new Map,commandTransformers:zT(),commandFields:new Map,eventMatchResolvers:zT(),disambiguationResolvers:zT(),keyHooks:BT(),keyAfterHooks:BT(),rawHooks:BT(),layers:new Set,sortedLayers:[],activeLayersCacheVersion:-1,activeLayersCacheFocused:void 0,activeLayersCache:[],activeKeyCacheBlockers:0,activeCommandViewCacheBlockers:0,commandResolvers:zT(),pending:null,data:{},dataVersion:0,readonlyDataVersion:-1,readonlyData:PD,cacheVersion:0,derivedVersion:0,stateChangeDepth:0,stateChangePending:!1,flushingStateChange:!1,usedWarningKeys:new Set}}function ID(e){return dT(e)}var LD=class{#e=FD();#t=!1;#n=new Map;#r=[];#i=LT(()=>{});#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;getPendingSequence;getActiveKeys;constructor(e){if(this.#b=e,e.isDestroyed)throw Error(`Cannot create a keymap for a destroyed host`);this.#a=LT((e,t)=>{this.#o.reportListenerError(e,t)}),this.#o=MD(this.#e,this.#i,this.#a),this.#l=oD(this.#e,this.#o),this.#u=wE(this.#e,this.#b,this.#o,this.#l,{onCommandResolversChanged:()=>{this.#s.ensureValidPendingSequence()}}),this.#s=iE(this.#e,this.#b,this.#a,this.#o,this.#l,this.#u,{onPendingSequenceChanged:(e,t)=>{this.#p?.handlePendingSequenceChange(e,t)}}),this.#c=ND(this.#e,this.#o,this.#s),this.#d=GE(this.#o,this.#c,this.#s,this.#u,{keymap:this,createCommandEvent:()=>this.#b.createCommandEvent()}),this.#f=QE(this.#e,this.#o,this.#l,{warnUnknownField:(e,t)=>{this.#C(e,t)},warnUnknownToken:(e,t)=>{this.#w(e,t)}}),this.#h=GT(this.#o,this.#u),this.#m=AD(this.#e,this.#o,this.#l,this.#s,{compiler:this.#f,commands:this.#u,host:this.#b,diagnostics:this.#h,warnUnknownField:(e,t)=>{this.#C(e,t)}}),this.#p=_D(this.#e,this.#o,this.#c,this.#s,this.#l,this.#d,this.#f,this.#u,this.#m,this.#a),this.getPendingSequence=this.#s.getPendingSequence,this.getActiveKeys=this.#s.getActiveKeys,this.#g=e=>{this.#p.handleKeyEvent(e,!1)},this.#_=e=>{this.#p.handleKeyEvent(e,!0)},this.#v=e=>this.#p.handleRawSequence(e),this.#y=e=>{this.#S(e)},this.#r.push(this.#b.onKeyPress(this.#g)),this.#r.push(this.#b.onKeyRelease(this.#_)),this.#b.onRawInput&&this.#r.push(this.#b.onRawInput(this.#v)),this.#r.push(this.#b.onFocusChange(this.#y)),this.#b.onDestroy&&this.#r.push(this.#b.onDestroy(()=>{this.#x()}))}[vT](){return{state:this.#e,host:this.#b,conditions:this.#l,catalog:this.#u,activation:this.#s}}#x(){if(!this.#t){this.#t=!0,this.#s.setPendingSequence(null);for(let e of this.#n.values())e.dispose();this.#n.clear(),this.#m.cleanup();for(let e of this.#r.splice(0))e()}}setData(e,t){this.#c.setData(e,t)}getData(e){return this.#c.getData(e)}getHostMetadata(){return this.#b.metadata}hasPendingSequence(){return this.#s.ensureValidPendingSequence()!==void 0}createKeyMatcher(e){let t=this.#f.parseTokenKey(e).match;return e=>e?ID(e)===t:!1}parseKeySequence(e){return this.#f.parseKeySequence(e)}formatKey(e,t){return this.#f.formatKey(e,t)}clearPendingSequence(){this.#s.setPendingSequence(null)}popPendingSequence(){return this.#s.popPendingSequence()}getCommands(e){return this.#u.getCommands(e)}getCommandEntries(e){return this.#u.getCommandEntries(e)}getCommandBindings(e){return this.#u.getCommandBindings(e)}acquireResource(e,t){if(this.#t||this.#b.isDestroyed)throw Error(`Cannot use a keymap after its host was destroyed`);let n=this.#n.get(e);if(n)return n.count+=1,()=>{this.#T(e,n)};let r={count:1,dispose:t()};return this.#n.set(e,r),()=>{this.#T(e,r)}}runCommand(e,t){return this.#d.runCommand(e,t)}dispatchCommand(e,t){return this.#d.dispatchCommand(e,t)}on(e,t){return e===`warning`||e===`error`?this.#i.hook(e,t):this.#a.hook(e,t)}intercept(e,t,n){return this.#p.intercept(e,t,n)}registerLayer(e){return this.#m.registerLayer(e)}registerLayerFields(e){return TD(this.#e,this.#o,`layer`,e)}prependLayerBindingsTransformer(e){return this.#e.layerBindingsTransformers.prepend(e)}appendLayerBindingsTransformer(e){return this.#e.layerBindingsTransformers.append(e)}clearLayerBindingsTransformers(){this.#e.layerBindingsTransformers.clear()}prependBindingTransformer(e){return this.#e.bindingTransformers.prepend(e)}appendBindingTransformer(e){return this.#e.bindingTransformers.append(e)}clearBindingTransformers(){this.#e.bindingTransformers.clear()}prependCommandTransformer(e){return this.#e.commandTransformers.prepend(e)}appendCommandTransformer(e){return this.#e.commandTransformers.append(e)}clearCommandTransformers(){this.#e.commandTransformers.clear()}prependBindingParser(e){return this.#e.bindingParsers.prepend(e)}appendBindingParser(e){return this.#e.bindingParsers.append(e)}clearBindingParsers(){this.#e.bindingParsers.clear()}registerToken(e){return CD(this.#e,this.#o,this.#f,this.#m,e)}registerSequencePattern(e){return wD(this.#e,this.#o,this.#m,e)}prependBindingExpander(e){return this.#e.bindingExpanders.prepend(e)}appendBindingExpander(e){return this.#e.bindingExpanders.append(e)}clearBindingExpanders(){this.#e.bindingExpanders.clear()}registerBindingFields(e){return TD(this.#e,this.#o,`binding`,e)}registerCommandFields(e){return TD(this.#e,this.#o,`command`,e)}prependCommandResolver(e){return this.#u.prependCommandResolver(e)}appendCommandResolver(e){return this.#u.appendCommandResolver(e)}clearCommandResolvers(){this.#u.clearCommandResolvers()}prependLayerAnalyzer(e){return this.#h.prependLayerAnalyzer(e)}appendLayerAnalyzer(e){return this.#h.appendLayerAnalyzer(e)}clearLayerAnalyzers(){this.#h.clearLayerAnalyzers()}prependEventMatchResolver(e){return this.#p.prependEventMatchResolver(e)}appendEventMatchResolver(e){return this.#p.appendEventMatchResolver(e)}clearEventMatchResolvers(){this.#p.clearEventMatchResolvers()}prependDisambiguationResolver(e){return this.#p.prependDisambiguationResolver(e)}appendDisambiguationResolver(e){return this.#p.appendDisambiguationResolver(e)}clearDisambiguationResolvers(){this.#p.clearDisambiguationResolvers()}#S(e){this.#o.runWithStateChangeBatch(()=>{this.#s.setPendingSequence(null),this.#o.queueStateChange({invalidateCaches:!1})})}#C(e,t){this.#o.warnOnce(`${e}:${t}`,`unknown-${e}-field`,{field:t,kind:e},`[Keymap] Unknown ${e} field "${t}" was ignored`)}#w(e,t){this.#o.warnOnce(`token:${e}`,`unknown-token`,{token:e,sequence:t},`[Keymap] Unknown token "${e}" in key sequence "${t}"; binding was skipped until the token is registered`)}#T(e,t){this.#n.get(e)===t&&(--t.count,!(t.count>0)&&(t.dispose(),this.#n.delete(e)))}},RD=new Set(`up.down.left.right.clear.escape.return.linefeed.enter.tab.backspace.delete.insert.home.end.pageup.pagedown.space.lt.gt.plus.minus.equal.comma.period.slash.backslash.semicolon.quote.backquote.leftbracket.rightbracket.capslock.numlock.scrolllock.printscreen.pause.menu.apps.kp0.kp1.kp2.kp3.kp4.kp5.kp6.kp7.kp8.kp9.kpdecimal.kpdivide.kpmultiply.kpminus.kpplus.kpenter.kpequal.kpseparator.kpleft.kpright.kpup.kpdown.kppageup.kppagedown.kphome.kpend.kpinsert.kpdelete.mediaplay.mediapause.mediaplaypause.mediareverse.mediastop.mediafastforward.mediarewind.medianext.mediaprev.mediarecord.volumedown.volumeup.mute.leftshift.leftctrl.leftalt.leftsuper.lefthyper.leftmeta.rightshift.rightctrl.rightalt.rightsuper.righthyper.rightmeta.iso_level3_shift.iso_level5_shift.option.alt.meta.super.hyper.control.ctrl.shift`.split(`.`)),zD=new Set([`ctrl`,`control`,`shift`,`meta`,`alt`,`option`,`super`,`hyper`]),BD=HD(RD),VD=HD(zD);function HD(e){let t=new Map;for(let n of e){let e=n.charCodeAt(0);if(Number.isNaN(e))continue;let r=t.get(e);r||(r=[],t.set(e,r)),r.push(n)}for(let e of t.values())e.sort((e,t)=>t.length-e.length);return t}function UD(e){return e>=65&&e<=90?e+32:e}function WD(e){return e>=48&&e<=57}function GD(e,t,n){if(e.startsWith(t,n))return!0;if(n+t.length>e.length)return!1;for(let r=0;r<t.length;r+=1)if(UD(e.charCodeAt(n+r))!==t.charCodeAt(r))return!1;return!0}function KD(e,t,n){let r=t.charCodeAt(n);if(Number.isNaN(r))return;let i=e.get(UD(r));if(i){for(let e of i)if(GD(t,e,n))return e}}function qD(e,t,n,r,i){return e.parseObjectKey(t,{display:n,match:r,tokenName:i})}function JD(e,t){if(e===` `)return t.parseObjectKey({name:`space`},{display:`space`});if(e===`+`)return t.parseObjectKey({name:`+`},{display:`+`});let n=e.split(`+`),r=``,i=``,a=!1,o=!1,s=!1,c=!1,l=!1;for(let t of n){let n=t.trim();if(!n)continue;let u=n.toLowerCase();if(u===`ctrl`||u===`control`){a=!0;continue}if(u===`shift`){o=!0;continue}if(u===`meta`||u===`alt`||u===`option`){s=!0;continue}if(u===`super`){c=!0;continue}if(u===`hyper`){l=!0;continue}if(r)throw Error(`Invalid key "${e}": multiple key names are not supported`);r=n,i=u}if(!r)throw Error(`Invalid key "${e}": missing key name`);let u=[];return a&&u.push(`ctrl`),o&&u.push(`shift`),s&&u.push(`meta`),c&&u.push(`super`),l&&u.push(`hyper`),u.push(i),t.parseObjectKey({name:r,ctrl:a,shift:o,meta:s,super:c,hyper:l||void 0},{display:u.join(`+`)})}function YD(e,t){let n=e.trim().toLowerCase();return t.parseObjectKey({name:n},{display:n})}function XD(e,t){let n=KD(BD,e,t);if(n)return n;if(UD(e.charCodeAt(t))!==102||!WD(e.charCodeAt(t+1)))return;let r=WD(e.charCodeAt(t+2))?t+3:t+2;return e.slice(t,r).toLowerCase()}function ZD(e,t){return KD(VD,e,t)}function QD(e,t,n){let r=t,i=!1,a=!1,o=!1,s=!1,c=!1;for(;r<e.length;){let t=ZD(e,r);if(!t)break;let n=r+t.length;if(e[n]!==`+`)break;t===`ctrl`||t===`control`?i=!0:t===`shift`?a=!0:t===`meta`||t===`alt`||t===`option`?o=!0:t===`super`?s=!0:t===`hyper`&&(c=!0),r=n+1}if(r===t)return;let l=e[r];if(l===void 0)throw Error(`Invalid key "${e.slice(t)}": missing key name`);let u=XD(e,r)??l,d=u===` `?`space`:u===`+`?`+`:u.toLowerCase(),f=[];return i&&f.push(`ctrl`),a&&f.push(`shift`),o&&f.push(`meta`),s&&f.push(`super`),c&&f.push(`hyper`),f.push(d),{part:n.parseObjectKey({name:u===` `?`space`:u,ctrl:i,shift:a,meta:o,super:s,hyper:c||void 0},{display:f.join(`+`)}),nextIndex:r+u.length}}var $D=e=>{let{input:t,index:n,tokens:r,normalizeTokenName:i}=e;if(n===0&&t.includes(`+`)&&/\s/.test(t))return{parts:[JD(t,e)],nextIndex:t.length};let a=t[n];if(a===void 0)return;if(a===`<`){let o=t.indexOf(`>`,n);if(o===-1)return{parts:[JD(a,e)],nextIndex:n+1};let s=i(t.slice(n+1,o)),c=r.get(s);return c?{parts:[qD(e,c.stroke,`<${s}>`,c.match,s)],nextIndex:o+1,usedTokens:[s]}:{parts:[],nextIndex:o+1,unknownTokens:[s]}}if(a===`{`){let r=t.indexOf(`}`,n);if(r===-1)return{parts:[JD(a,e)],nextIndex:n+1};let o=i(t.slice(n+1,r)),s=e.patterns.get(o);return s?{parts:[{...e.parseObjectKey({name:o,ctrl:!1,shift:!1,meta:!1,super:!1},{display:s.display??`{${o}}`,match:s.match}),patternName:s.name,payloadKey:s.payloadKey}],nextIndex:r+1,usedTokens:[o]}:{parts:[],nextIndex:r+1,unknownTokens:[o]}}let o=QD(t,n,e);if(o)return{parts:[o.part],nextIndex:o.nextIndex};let s=XD(t,n);return s?{parts:[YD(s,e)],nextIndex:n+s.length}:{parts:[JD(a,e)],nextIndex:n+1}},eO=(e,t)=>[t.resolveKey({name:e.name,ctrl:e.ctrl,shift:e.shift,meta:e.meta,super:e.super??!1,hyper:e.hyper||void 0})];function tO(e){return e.appendBindingParser(e=>$D(e))}function nO(e){return e.appendEventMatchResolver((e,t)=>eO(e,t))}function rO(e){let t=tO(e),n=nO(e);return()=>{n(),t()}}var iO=Symbol(`keymap:mod-bindings`),aO=/(^|[+,\s])mod(?=\s*\+)/i,oO=/(^|[+,\s])mod(?=\s*\+)/gi;function sO(e){let t=e.primaryModifier;return(t===`ctrl`||t===`super`)&&e.modifiers[t]!==`unsupported`?t:e.modifiers.ctrl===`unsupported`?`super`:`ctrl`}function cO(e){if(e.includes(`,`))return[e];let t=e.trim();return t.includes(` `)?t.split(/\s+/):[e]}function lO(e){return e.acquireResource(iO,()=>e.appendBindingExpander(({input:t,displays:n})=>{if(!aO.test(t))return;let r=sO(e.getHostMetadata());return[{key:t.replace(oO,(e,t)=>`${t}${r}`),displays:n??cO(t)}]}))}var uO=new Map([[` `,`space`],[`Spacebar`,`space`],[`ArrowUp`,`up`],[`ArrowDown`,`down`],[`ArrowLeft`,`left`],[`ArrowRight`,`right`],[`Escape`,`escape`],[`Esc`,`escape`],[`Enter`,`return`],[`Backspace`,`backspace`],[`Delete`,`delete`],[`Tab`,`tab`],[`Home`,`home`],[`End`,`end`],[`PageUp`,`pageup`],[`PageDown`,`pagedown`],[`Insert`,`insert`],[`CapsLock`,`capslock`],[`NumLock`,`numlock`],[`ScrollLock`,`scrolllock`],[`ContextMenu`,`menu`],[`Meta`,`super`],[`OS`,`super`],[`Alt`,`alt`],[`Control`,`control`],[`Shift`,`shift`]]);function dO(e){let t=e?.trim().toLowerCase();return t?t.includes(`mac`)||t.includes(`darwin`)?`macos`:t.includes(`win`)?`windows`:t.includes(`linux`)||t.includes(`x11`)?`linux`:`unknown`:`unknown`}function fO(){let e=globalThis.navigator,t=e?.userAgentData?.platform,n=dO(t);return n===`unknown`?dO(e?.platform??e?.userAgent):n}function pO(){let e=fO();return{platform:e,primaryModifier:e===`macos`?`super`:e===`unknown`?`unknown`:`ctrl`,modifiers:{ctrl:`supported`,shift:`supported`,meta:`supported`,super:`supported`,hyper:`unsupported`}}}function mO(e){return e.length===1&&!/^[a-z0-9]$/i.test(e)}function hO(e){let t={name:e.name,ctrl:e.ctrl,shift:e.shift,meta:e.meta,super:e.super??!1,hyper:e.hyper||void 0};return!t.shift||!mO(t.name)?[t]:[t,{...t,shift:!1}]}var gO=class{name;ctrl;shift;meta;superKey;originalEvent;propagationStopped=!1;constructor(e,t,n,r,i,a){this.name=e,this.ctrl=t,this.shift=n,this.meta=r,this.superKey=i,this.originalEvent=a}get super(){return this.superKey}preventDefault(){this.originalEvent?.preventDefault()}stopPropagation(){this.propagationStopped=!0,this.originalEvent?.stopPropagation()}};function _O(){return globalThis.MutationObserver}function vO(e){return uO.get(e)||(/^F\d{1,2}$/i.test(e)||e.length===1?e.toLowerCase():e.trim().toLowerCase().replace(/\s+/g,``))}function yO(e){if(!e)return new gO(`command`,!1,!1,!1,!1);let t=globalThis.KeyboardEvent;return new gO(vO(e.key),e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t&&e instanceof t?e:void 0)}var bO=class{metadata=pO();rootTarget;isDestroyed=!1;observer;targetDestroyListeners=new Map;constructor(e){this.rootTarget=e}getFocusedTarget(){let e=this.rootTarget.ownerDocument.activeElement;return!e||typeof e!=`object`?null:e===this.rootTarget||this.rootTarget.contains(e)?e:null}getParentTarget(e){return e.parentElement}isTargetDestroyed(e){return e===this.rootTarget?!1:!e.isConnected||!this.rootTarget.contains(e)}onKeyPress(e){let t=t=>{e(yO(t))};return this.rootTarget.addEventListener(`keydown`,t,{capture:!0}),()=>{this.rootTarget.removeEventListener(`keydown`,t,{capture:!0})}}onKeyRelease(e){let t=t=>{e(yO(t))};return this.rootTarget.addEventListener(`keyup`,t,{capture:!0}),()=>{this.rootTarget.removeEventListener(`keyup`,t,{capture:!0})}}onFocusChange(e){let t=()=>{queueMicrotask(()=>{e(this.getFocusedTarget())})};return this.rootTarget.addEventListener(`focusin`,t,{capture:!0}),this.rootTarget.addEventListener(`focusout`,t,{capture:!0}),()=>{this.rootTarget.removeEventListener(`focusin`,t,{capture:!0}),this.rootTarget.removeEventListener(`focusout`,t,{capture:!0})}}onTargetDestroy(e,t){let n=this.targetDestroyListeners.get(e);return n||(n=new Set,this.targetDestroyListeners.set(e,n)),n.add(t),this.ensureObserver(),this.flushDisconnectedTargets(),()=>{let n=this.targetDestroyListeners.get(e);n&&(n.delete(t),n.size===0&&this.targetDestroyListeners.delete(e),this.targetDestroyListeners.size===0&&this.disconnectObserver())}}createCommandEvent(){return yO()}ensureObserver(){if(this.observer||this.targetDestroyListeners.size===0)return;let e=_O();e&&(this.observer=new e(()=>{this.flushDisconnectedTargets()}),this.observer.observe(this.rootTarget,{childList:!0,subtree:!0}))}disconnectObserver(){this.observer&&=(this.observer.disconnect(),void 0)}flushDisconnectedTargets(){for(let[e,t]of this.targetDestroyListeners)if(this.isTargetDestroyed(e)){this.targetDestroyListeners.delete(e);for(let e of[...t])e()}this.targetDestroyListeners.size===0&&this.disconnectObserver()}};function xO(e){return new bO(e)}var SO=(e,t)=>hO(e).map(e=>t.resolveKey(e)),CO=`fungi.app.ready`,wO=`fungi.app.connect`,TO=[`PROTOCOL`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`FILE_TOO_LARGE`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`COMMAND_NOT_DECLARED`,`CONFLICT`,`INVALID_ARGUMENT`,`TIMEOUT`,`CANCELLED`,`DISCONNECTED`,`HOST_FAILURE`,`SELECTION_CHANGED`,`SAFETY_FILTER_REFUSED`],EO=e=>oC.pipe(X(LC(1)),X(BC(e))),DO=e=>tC(EO(e)),OO=sC.pipe(X(FC()),X(xC(Number.isSafeInteger,{message:`Expected a safe integer`}))),kO=OO.pipe(X(MC(0))),AO=OO.pipe(X(jC(0))),jO=Y({appId:EO(160),releaseId:EO(160),surfaceId:EO(160)}),MO=Y({editing:cC,surface:pC([EO(160),iC])}),NO=pC([Y({kind:nC(`compose`),requestId:EO(160),text:EO(2e3)}),Y({kind:nC(`navigate`),requestId:EO(160),params:dC(Y({key:EO(64),value:EO(4096)})).pipe(X(BC(16)))})]),PO=Y({computerId:pC([EO(256),iC]),teamHasComputers:tC(hC(cC)),computerAccessGranted:tC(cC),focus:MO,openRequest:pC([iC,NO]),visibility:mC([`visible`,`hidden`])}),FO=mC([`connecting`,`connected`,`suspended`,`disconnected`,`disposing`,`disposed`]),IO=Y({altKey:cC,ctrlKey:cC,id:EO(160),key:EO(64),metaKey:cC,shiftKey:cC}),LO=Y({action:tC(rC),availability:tC(rC),category:EO(160),description:DO(512),id:EO(160),projections:tC(rC),title:EO(160)}),RO=Y({arguments:tC(rC),commandId:EO(321),origin:mC([`agent`,`browser`,`keyboard`,`menu`,`palette`,`programmatic`,`slash`,`terminal`]),requestId:EO(160)}),zO=pC([Y({result:tC(rC),status:nC(`handled`)}),Y({error:rC,status:nC(`failed`)})]),BO=e=>EO(e).pipe(X(xC(e=>{for(let t=0;t<e.length;t+=1)if(eT(e.charCodeAt(t)))return!1;return!0},{message:`Expected one line of plain text`}))),VO={id:EO(64),text:BO(80),end:eC(cC)},HO=eC(sC.pipe(X(FC()),X(PC({minimum:0,maximum:9999})))),UO=dC(pC([Y({...VO,kind:nC(`text`),tone:eC(mC([`neutral`,`success`,`warning`,`error`]))}),Y({...VO,kind:nC(`button`),icon:eC(mC([`folder`,`ports`,`processes`,`access`])),count:HO,title:eC(BO(1024)),disabled:eC(cC),opens:eC(nC(`dialog`)),expanded:eC(cC)}),Y({...VO,kind:nC(`toggle`),pressed:cC}),Y({...VO,kind:nC(`menu`),count:HO,title:eC(BO(1024)),options:dC(Y({id:EO(64),text:BO(80),checked:eC(cC),disabled:eC(cC)})).pipe(X(BC(16)),X(xC(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status option ids`})))})])).pipe(X(BC(6)),X(xC(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status item ids`}))),WO=Y({computerId:EO(256),path:EO(1024)}),GO=EO(80).pipe(X(xC(e=>e.trim()===e,{message:`Expected a trimmed title`}))),KO=EO(64),qO=EO(80),JO=e=>new Set(e.map(e=>e.id)).size===e.length,YO=Y({id:KO,label:qO,siblings:tC(dC(Y({id:KO,label:qO})).pipe(X(BC(16)),X(xC(JO,{message:`Expected unique crumb sibling ids`}))))}),XO=Y({id:KO,label:qO,variant:tC(mC([`primary`,`outline`,`ghost`])),tone:tC(nC(`destructive`)),disabled:tC(cC)}),ZO=e=>dC(XO).pipe(X(BC(e)),X(xC(JO,{message:`Expected unique header command ids`}))),QO={status:tC(dC(Y({id:KO,label:qO,tone:tC(mC([`neutral`,`info`,`warning`,`success`,`error`]))})).pipe(X(BC(4)),X(xC(JO,{message:`Expected unique header status ids`})))),crumbs:tC(dC(YO).pipe(X(BC(8)),X(xC(JO,{message:`Expected unique crumb ids`})))),primary:tC(ZO(3)),menu:tC(ZO(12))},$O=Y({contractVersion:nC(1),canGoBack:cC,title:tC(GO),...QO}),ek=Y({canGoBack:cC,title:tC(oC),...QO}),tk=pC([Y({kind:nC(`crumb`),crumbId:KO,siblingId:tC(KO)}),Y({kind:nC(`action`),actionId:KO})]),nk=hC(Y({agentId:EO(256),sessionId:EO(256)})),rk=Y({agents:tC(dC(mC([`agent.list`,`agent.manage`,`agent.read`,`agent.send`])).pipe(X(BC(4)))),computers:tC(dC(mC([`computer.list`,`computer.readFile`,`computer.writeFile`,`computer.execute`])).pipe(X(BC(4))))}),ik=mC([`granted`,`declined`,`customize`]),ak=Y({message:EO(512),tone:tC(mC([`info`,`success`,`warning`,`error`]))}),ok=Y({code:mC(TO),message:EO(512),retryable:cC}),sk=Y({protocolVersion:nC(2),type:nC(CO)}),ck=Y({epoch:EO(160),protocolVersion:nC(2),type:nC(wO)}),lk=Y({epoch:EO(160),protocolVersion:nC(2)}),uk={[Symbol.dispose]:tC(rC)},dk=pC([Y({...uk,ok:nC(!0),value:rC}),Y({...uk,error:ok,ok:nC(!1)})]);function fk(e,t,n=`PROTOCOL`){return pu(ZS(e,{onExcessProperty:`error`}),xp({onFailure:e=>{throw new K(`The peer sent malformed protocol data`,{cause:e,code:n,retryable:!1})},onSuccess:t}))}function pk(e){return Object.freeze(e)}function mk(e,t){let n=e.arguments===void 0?void 0:Gs(e.arguments),r={origin:e.origin,signal:t};return n!==void 0&&Object.assign(r,{arguments:n}),pk(r)}var hk=fk(LO,e=>{let t={category:e.category,id:e.id,title:e.title};return e.action!==void 0&&Object.assign(t,{action:e.action}),e.availability!==void 0&&Object.assign(t,{availability:e.availability}),e.description!==void 0&&Object.assign(t,{description:e.description}),e.projections!==void 0&&Object.assign(t,{projections:e.projections}),pk(iA(()=>ic(t)))},`INVALID_ARGUMENT`),gk=fk(EO(321),e=>e),_k=fk(RO,e=>{let t=e.arguments===void 0?void 0:Gs(e.arguments),n={commandId:e.commandId,origin:e.origin,requestId:e.requestId};return t!==void 0&&Object.assign(n,{arguments:t}),pk(n)}),vk=fk(pC([aC,rC]),e=>e===void 0?void 0:Gs(e)),yk=fk(ck,e=>pk(e));fk(lk,e=>pk(e));var bk=fk(PO,e=>{let t={computerId:e.computerId,focus:pk({...e.focus}),openRequest:e.openRequest===null?null:pk({...e.openRequest}),visibility:e.visibility};return e.teamHasComputers!==void 0&&(t.teamHasComputers=e.teamHasComputers),e.computerAccessGranted!==void 0&&(t.computerAccessGranted=e.computerAccessGranted),pk(t)}),xk=fk(ok,e=>pk({...e})),Sk=fk(MO,e=>pk({...e}),`INVALID_ARGUMENT`),Ck=fk(jO,e=>pk({...e})),wk=fk(FO,e=>e),Tk=fk(UO,e=>pk(e.map(e=>e.kind===`menu`?pk({...e,options:pk(e.options.map(e=>pk(e)))}):pk(e))),`INVALID_ARGUMENT`),Ek=fk(Y({itemId:EO(64),optionId:eC(EO(64)),anchor:eC(Y({start:sC.pipe(X(PC({minimum:0,maximum:1e5}))),width:sC.pipe(X(PC({minimum:0,maximum:1e5})))}))}),e=>pk(e.anchor===void 0?{...e}:{...e,anchor:pk({...e.anchor})}),`INVALID_ARGUMENT`),Dk=fk(WO,e=>pk({...e}),`INVALID_ARGUMENT`);function Ok(e){let t={id:e.id,label:e.label};return pk(e.tone===void 0?t:{...t,tone:e.tone})}function kk(e){let t={id:e.id,label:e.label};return e.siblings===void 0?pk(t):pk({...t,siblings:pk(e.siblings.map(e=>pk({...e})))})}function Ak(e){let t={id:e.id,label:e.label};return e.variant!==void 0&&(t={...t,variant:e.variant}),e.tone!==void 0&&(t={...t,tone:e.tone}),e.disabled!==void 0&&(t={...t,disabled:e.disabled}),pk(t)}function jk(e){let t={canGoBack:e.canGoBack};return e.title!==void 0&&(t={...t,title:e.title}),e.crumbs!==void 0&&(t={...t,crumbs:pk(e.crumbs.map(kk))}),e.primary!==void 0&&(t={...t,primary:pk(e.primary.map(Ak))}),e.menu!==void 0&&(t={...t,menu:pk(e.menu.map(Ak))}),e.status!==void 0&&(t={...t,status:pk(e.status.map(Ok))}),pk(t)}var Mk=fk($O,jk,`INVALID_ARGUMENT`),Nk=fk(ek,e=>{let t=e.title?.trim();return Pk({...jk({...e,title:t===void 0||t.length===0?void 0:t}),contractVersion:1})},`INVALID_ARGUMENT`),Pk=fk($O,e=>pk({...jk(e),contractVersion:1}),`INVALID_ARGUMENT`),Fk=fk(tk,e=>e.kind===`action`?pk({...e}):pk(e.siblingId===void 0?{kind:e.kind,crumbId:e.crumbId}:e),`INVALID_ARGUMENT`),Ik=fk(nk,e=>e===null?null:pk({...e}),`INVALID_ARGUMENT`),Lk=fk(rk,e=>pk({agents:pk([...new Set(e.agents??[])]),computers:pk([...new Set(e.computers??[])])}),`INVALID_ARGUMENT`);fk(sk,e=>pk(e));var Rk=fk(EO(512),e=>e),zk=fk(ak,e=>pk({...e}),`INVALID_ARGUMENT`);fk(Y({id:EO(160),repeat:cC}),e=>pk(e));var Bk=fk(dC(IO).pipe(X(BC(64))),e=>{if(new Set(e.map(e=>e.id)).size!==e.length)throw new K(`Reserved chords are invalid`,{code:`PROTOCOL`,retryable:!1});return pk(e.map(e=>pk({...e})))});function Vk(e){return fk(Y({value:rC,version:kO}),t=>pk({value:e(t.value),version:t.version}))}var Hk=Vk(bk),Uk=fk(Y({capabilities:dC(rC).pipe(X(BC(128))),context:rC}),e=>pk({capabilities:pk(e.capabilities.map(e=>Yk(e))),context:Hk(e.context)})),Wk=Vk(wk),Gk=Vk(Bk),Kk=Vk(Rk),qk=pu(Wk,e=>{if(e.value!==`connected`&&e.value!==`suspended`)throw new K(`The host lifecycle is invalid`,{code:`PROTOCOL`,retryable:!1});return pk({value:e.value,version:e.version})});function Jk(e){return fk(Y({handle:rC,id:EO(160),version:AO}),t=>{if(!(t.handle instanceof Zw)&&!(e&&t.handle instanceof Qw))throw new K(`A capability handle is invalid`,{code:`PROTOCOL`,retryable:!1});return pk({handle:t.handle,id:t.id,version:t.version})})}var Yk=Jk(!1),Xk=Jk(!0);function Zk(e){let t=e?Xk:Yk;return fk(Y({capabilities:dC(rC).pipe(X(BC(128))),context:rC,identity:rC,lifecycle:rC,reservedChords:rC,theme:rC}),e=>pk({capabilities:pk(e.capabilities.map(e=>t(e))),context:Hk(e.context),identity:Ck(e.identity),lifecycle:qk(e.lifecycle),reservedChords:Gk(e.reservedChords),theme:Kk(e.theme)}))}var Qk=Zk(!1);Zk(!0);function $k(e){return fk(dk,t=>t.ok?pk({ok:!0,value:e(t.value)}):pk({ok:!1,error:xk(t.error)}))}var eA=$k(Qk),tA=$k(fk(Y({commandId:EO(321)}),e=>pk(e)));$k(fk(zO,e=>{if(e.status===`failed`)return pk({status:`failed`,error:iA(()=>qs(e.error))});let t=e.result===void 0?void 0:Gs(e.result);return pk(t===void 0?{status:`handled`}:{status:`handled`,result:t})}));var nA=$k(fk(aC,()=>void 0)),rA=$k(fk(ik,e=>e));$k(fk(cC,e=>e)),$k(fk(cC,e=>e));function iA(e){try{return e()}catch(e){throw new K(`The command metadata is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}}var aA=pC([Y({kind:nC(`saveFile`),name:EO(255).pipe(X(wC(/^[^\p{Cc}/\\]+$/u))),mime:EO(255),bytes:Bee}),Y({kind:nC(`copyText`),text:oC})]);function oA(e){let t=ZS(aA,{onExcessProperty:`error`})(e);if(yp(t))return{kind:`refused`,reason:`invalid-request`};let n=t.success;return n.kind===`saveFile`?n.name===`.`||n.name===`..`?{kind:`refused`,reason:`invalid-request`}:n.bytes.byteLength>33554432?{kind:`refused`,reason:`too-large`}:{...n,bytes:new Uint8Array(n.bytes)}:n.text.length>1048576||new TextEncoder().encode(n.text).byteLength>1048576?{kind:`refused`,reason:`too-large`}:n}var sA=$k(fk(pC([Y({kind:nC(`saved`)}),Y({kind:nC(`copied`)}),Y({kind:nC(`refused`),reason:mC([`no-user-gesture`,`too-large`,`invalid-request`,`unavailable`,`denied`,`busy`])})]),e=>pk(e)));function cA(e){return e instanceof K?{code:e.code,message:uA(e.message),retryable:e.retryable}:{code:`HOST_FAILURE`,message:`Host operation failed`,retryable:!1}}function lA(e){try{let t=xk(e);return new K(t.message,{code:t.code,retryable:t.retryable})}catch(e){return new K(`The host returned a malformed error`,{cause:e,code:`PROTOCOL`,retryable:!1})}}function uA(e){return e.trim().slice(0,512)||`Host operation failed`}var dA=e=>({ok:!0,value:e}),fA=e=>({error:cA(e),ok:!1});async function pA(e,t){let n,r=new Set;try{return n=await e,mA(t(n))}catch(e){throw hA(e)&&gA(e,r),e instanceof K?e:new K(`The remote operation failed`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}finally{n!==e&&hA(n)&&gA(n,r)}}function mA(e){if(e.ok)return e.value;throw lA(e.error)}function hA(e){return Au(e)&&Symbol.dispose in e&&Eu(e[Symbol.dispose])}function gA(e,t){if(!t.has(e)){t.add(e);try{e[Symbol.dispose]()}catch(e){console.warn(`RPC result disposal failed`,e)}}}function _A(){let e=[],t=new Set;return{get:()=>e,subscribe:e=>(t.add(e),()=>t.delete(e)),update:n=>{e=n;for(let e of Array.from(t))try{e()}catch(e){console.warn(`App binding subscriber failed`,e)}}}}function vA(e){let t=Bk(e),n=new Set;return{get:()=>t,subscribe:e=>(n.add(e),()=>n.delete(e)),update:e=>{t=Bk(e);for(let e of Array.from(n))try{e()}catch(e){console.warn(`Reserved chord subscriber failed`,e)}}}}function yA(e){let t=!0,n,r=e.window.document.querySelector(`html`);if(!r)return()=>{t=!1};let i=xO(r),a=new LD(i);rO(a),lO(a),a.prependEventMatchResolver(SO);let o=xA(e.onBroken),s=TA(a,e.chords,e.remote,o),c=bA(e,o,()=>t,e=>{n=e},()=>n),l=i.onFocusChange(()=>{queueMicrotask(c)}),u=()=>{queueMicrotask(c)};e.window.addEventListener(`focus`,u),e.window.addEventListener(`blur`,u);let d=e.bindings,f=()=>SA(e.window.document,e.identity.surfaceId).editing,p=d===void 0?()=>void 0:CA(a,d,f),m=d===void 0?()=>void 0:d.subscribe(()=>{p(),p=CA(a,d,f)}),h=e.chords.subscribe(()=>{s(),s=TA(a,e.chords,e.remote,o)});return queueMicrotask(c),()=>{t&&(t=!1,l(),e.window.removeEventListener(`focus`,u),e.window.removeEventListener(`blur`,u),h(),s(),m(),p())}}function bA(e,t,n,r,i){return()=>{if(!n())return;let a=SA(e.window.document,e.identity.surfaceId),o=i();(a.editing!==o?.editing||a.surface!==o.surface)&&(r(a),t(()=>e.remote.reportFocus(a)))}}function xA(e){return t=>{try{pA(t(),nA).catch(t=>{Pf(`browser-bridge.host-call`,t),e(t)})}catch(t){Pf(`browser-bridge.host-call`,t),e(t)}}}function SA(e,t){let n=e.activeElement;return Sk({editing:!!(n?.matches(`input, textarea, select, [contenteditable='true']`)===!0||n?.closest(`[contenteditable='true']`)),surface:e.hasFocus()?t:null})}function CA(e,t,n){let r=t.get();return e.registerLayer({bindings:r.map((e,t)=>({cmd:`app/${String(t)}`,key:e.key})),commands:r.map((e,t)=>({name:`app/${String(t)}`,run:t=>{let r=t.event.originalEvent;if(r?.defaultPrevented||r?.isComposing||wA(e.key)&&n())return!1;e.run()}})),priority:500})}function wA(e){return!/(?:^|\+)(?:ctrl|control|super|meta|cmd|alt|option|mod)\+/iu.test(e)}function TA(e,t,n,r){let i=t.get();return e.registerLayer({bindings:i.map(e=>({cmd:`reserved/${e.id}`,key:{ctrl:e.ctrlKey,meta:e.altKey,name:vO(e.key),shift:e.shiftKey,super:e.metaKey}})),commands:i.map(e=>({name:`reserved/${e.id}`,run:t=>{let i=t.event.originalEvent;if(i?.defaultPrevented||i?.isComposing)return!1;r(()=>n.invokeReservedChord(e.id,i?.repeat??!1))}})),priority:1e3})}function EA(e){let t=t=>{if(t.defaultPrevented||t.isComposing)return;let n=kA(t,e.mac);n!==null&&(t.preventDefault(),n===`back`&&!t.repeat&&e.canGoBack()&&e.back())},n=t=>{let n=OA(t.button);if(n===null)return;let r=t.defaultPrevented;t.preventDefault(),t.type===`mouseup`&&n===`back`&&!r&&e.canGoBack()&&e.back()};e.window.addEventListener(`keydown`,t);for(let t of DA)e.window.addEventListener(t,n);return()=>{e.window.removeEventListener(`keydown`,t);for(let t of DA)e.window.removeEventListener(t,n)}}var DA=[`mousedown`,`mouseup`,`auxclick`];function OA(e){return e===3?`back`:e===4?`forward`:null}function kA(e,t){return e.shiftKey||e.ctrlKey?null:t?!e.metaKey||e.altKey?null:e.key===`[`?`back`:e.key===`]`?`forward`:AA(e.target)?null:e.key===`ArrowLeft`?`back`:e.key===`ArrowRight`?`forward`:null:!e.altKey||e.metaKey?null:e.key===`ArrowLeft`?`back`:e.key===`ArrowRight`?`forward`:null}function AA(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement:!1}function jA(){return!Du(globalThis.navigator)&&/Mac|iPhone|iPad/u.test(globalThis.navigator.userAgent)}function MA(e){let t=e,n=new Set;return{get:()=>t,subscribe(e){n.add(e);let t=!0;return()=>{t&&(t=!1,n.delete(e))}},update(e){if(!Object.is(t,e)){t=e;for(let e of Array.from(n))try{e(t)}catch(e){console.warn(`App store subscriber failed`,e)}}}}}function NA(e){let t=new Map,n=MA(0),r=!1,i=e=>{let t=new Map;try{for(let n of e){let e=Yk(n),r=RA(e.id,e.version);if(t.has(r))throw FA(e.handle),new K(`Duplicate capability grant`,{code:`PROTOCOL`,retryable:!1});t.set(r,e.handle)}}catch(e){for(let e of t.values())FA(e);throw e}return t};for(let[n,r]of i(e))t.set(n,r);let a=e=>{for(let t of e)FA(t)},o=e=>{if(r)throw new K(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let n=RA(e.id,e.version);return t.get(n)};return{directory:Object.freeze({get version(){return n.get()},subscribe:e=>n.subscribe(e),has(e){return!!o(e)},require(e){let t=o(e);if(!t)throw new K(`The capability is not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});try{return e.schema.parse(t)}catch(e){throw new K(`The capability interface is malformed`,{cause:e,code:`PROTOCOL`,retryable:!1})}}}),replace(e){if(r)throw new K(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let o=i(e),s=[...t.values()];t.clear();for(let[e,n]of o)t.set(e,n);a(s.filter(e=>![...o.values()].includes(e))),n.update(n.get()+1)},disconnect(){r||(r=!0,a(t.values()),t.clear(),n.update(n.get()+1))}}}var PA=Bo().transform(e=>{let t=zs(Object).safeParse(e);if(!t.success)return;let n=Object.create(t.data),r=QS(Y({[Symbol.dispose]:tC(yC(Function))}))(n);return{owner:t.data,dispose:r[Symbol.dispose]}});function FA(e){try{let t=PA.parse(e);if(t===void 0||LA.has(t.owner))return;LA.add(t.owner),t.dispose?.call(t.owner)}catch(e){console.warn(`RPC value disposal failed`,e)}}function IA(e){return{value:e,[Symbol.dispose](){FA(e)}}}var LA=new WeakSet;function RA(e,t){return`${e}@${String(t)}`}var zA=class extends Qw{#e=!0;#t;#n=new Map;constructor(e){super(),this.#t=e}cancel(e){try{return this.#n.get(gk(e))?.abort(),Promise.resolve(dA(void 0))}catch(e){return Promise.resolve(fA(e))}}dispose(){if(this.#e){this.#e=!1;for(let e of this.#n.values())e.abort();this.#n.clear()}}async invoke(e){try{if(!this.#e)throw new K(`The command is disposed`,{code:`DISCONNECTED`,retryable:!0});let t=_k(e);if(this.#n.has(t.requestId))throw new K(`Duplicate command request`,{code:`PROTOCOL`,retryable:!1});if(this.#n.size>=64)throw new K(`Too many command requests`,{code:`HOST_FAILURE`,retryable:!0});let n=new AbortController;this.#n.set(t.requestId,n);try{let e=vk(await this.#t(mk(t,n.signal)));return dA(e===void 0?{status:`handled`}:{status:`handled`,result:e})}finally{this.#n.delete(t.requestId)}}catch(e){if(e instanceof p)try{return dA({status:`failed`,error:qs({code:e.code,message:e.message,details:e.details})})}catch(e){return fA(e)}return fA(e)}}[Symbol.dispose](){this.dispose()}};function BA(e){let t=[];for(let n of e.values()){let{definition:e,handler:r}=n;if(n.commandId===void 0)continue;let i=e.availability?.status!==`unavailable`;for(let n of e.projections?.bindings?.values??[])n.trim().includes(` `)||n.startsWith(`<`)||t.push({key:n,run:()=>{i&&Promise.resolve().then(()=>r({origin:`keyboard`,signal:new AbortController().signal})).catch(e=>{console.warn(`App key command failed`,e)})}})}return t}function VA(e,t,n,r){let i=new Map,a=!1,o=()=>{r?.update(a?[]:BA(i))},s=e=>{try{n()}catch(t){console.warn(`App command failure callback failed`,t,e)}},c=e=>{try{pA(e(),nA).catch(e=>{s(e)})}catch(e){console.warn(`App command RPC supervision failed`,e),s(e)}};return{commands:UA(e,t,i,()=>a,t=>{let n=i.get(t);if(!n)return;i.delete(t),n.target.dispose(),o();let r=n.commandId;!a&&r!==void 0&&c(()=>e.unregisterCommand(r))},o),dispose(){if(!a){a=!0;for(let e of i.values())e.target[Symbol.dispose]();i.clear(),o()}}}}function HA(e,t,n,r){let i=t.id;if(e.size>=128||e.has(i))throw r.dispose(),new K(`Command registration is unavailable`,{code:`INVALID_ARGUMENT`,retryable:!1});let a={commandId:void 0,definition:t,handler:n,target:r};e.set(i,a);let o=!1;return{commit(e){o||(a.commandId=e)},release(){o||(o=!0,e.get(i)===a&&e.delete(i),r.dispose())},target:r}}function UA(e,t,n,r,i,a){return Object.freeze({async register(o,s){if(t(),!Eu(s))throw new K(`Command handler must be a function`,{code:`INVALID_ARGUMENT`,retryable:!1});let c=hk(o),l=new zA(s),u=HA(n,c,s,l);try{let t=await WA(e,c,u.target);r()&&await GA(e,t.commandId,l),u.commit(t.commandId),a()}catch(e){throw u.release(),e}let d=!0;return()=>{d&&(d=!1,i(c.id))}}})}async function WA(e,t,n){return pA(e.registerCommand(t,n),tA)}async function GA(e,t,n){throw n.dispose(),await pA(e.unregisterCommand(t),nA),new K(`The command controller is disposed`,{code:`DISCONNECTED`,retryable:!0})}var KA=BS(e=>e instanceof Zw),qA=class extends Qw{#e=!1;#t;constructor(e){super(),this.#t=e}disconnect(e){try{if(this.#e)throw ij();let t=e===void 0?void 0:xk(e);return setTimeout(()=>this.#t.disconnect?.(t??cj()),0),Promise.resolve(dA(void 0))}catch(e){return Promise.resolve(fA(e))}}async requestClose(){try{if(this.#e)throw ij();return dA(await(this.#t.beforeClose?.()??!0))}catch(e){return fA(e)}}async requestBack(){try{if(this.#e)throw ij();return dA(await(this.#t.back?.()??!1))}catch(e){return fA(e)}}async activateNavigation(e){try{if(this.#e)throw ij();let t=Fk(e);return rT(this.#t.navigation,t)?dA(await(this.#t.activate?.(t)??!1)):dA(!1)}catch(e){return fA(e)}}async activateStatus(e){try{if(this.#e)throw ij();let t=Ek(e);return nT(this.#t.statusItems,t)?dA(await(this.#t.statusAction?.(t)??!1)):dA(!1)}catch(e){return fA(e)}}[Symbol.dispose](){this.#e=!0}async updateContext(e){return this.#e?fA(ij()):this.#n(e,`context`,bk,e=>{this.#t.context.update(e)})}reconfigure(e){let t=[];try{if(this.#e)throw ij();let n=Uk(e);if(n.context.version<=this.#t.versions.context)return Promise.resolve(dA(void 0));for(let e of n.capabilities)t.push({...e,handle:QS(KA)(e.handle).dup()});if(!this.#t.capabilities)throw ij();return this.#t.capabilities.replace(t),t=[],this.#t.versions.context=n.context.version,this.#t.context.update(n.context.value),Promise.resolve(dA(void 0))}catch(e){for(let e of t)FA(e.handle);return Promise.resolve(fA(e))}}updateLifecycle(e){try{if(this.#e)throw ij();let t=Vk(wk)(e);if(t.version<=this.#t.versions.lifecycle)return Promise.resolve(dA(void 0));if(!lj(this.#t.lifecycle.get(),t.value))throw new K(`The host sent an invalid lifecycle transition`,{code:`PROTOCOL`,retryable:!1});return this.#t.versions.lifecycle=t.version,this.#t.lifecycle.update(t.value),Promise.resolve(dA(void 0))}catch(e){return Promise.resolve(fA(e))}}async updateReservedChords(e){return this.#e?fA(ij()):this.#n(e,`chords`,Bk,e=>{this.#t.chords.update(e)})}async updateTheme(e){return this.#e?fA(ij()):this.#n(e,`theme`,Rk,e=>{this.#t.theme.update(e)})}#n(e,t,n,r){try{let i=Vk(n)(e);return i.version>this.#t.versions[t]&&(this.#t.versions[t]=i.version,r(i.value)),Promise.resolve(dA(void 0))}catch(e){return Promise.resolve(fA(e))}}};async function JA(e){let t=QA(),n=new qA(t),r=$w(e.port,n),i,a=ZA(r);try{performance.mark(`fungi.app-open.agar-rpc-connect-start`);let o=await Promise.race([r.connect({epoch:e.epoch,protocolVersion:2}),a]);performance.mark(`fungi.app-open.agar-rpc-connect-ready`),i=o;let s=mA(eA(o));if(!e.isActive())throw XA();let c=$A({bootstrap:s,bootstrapOwner:i,options:e,remote:r,state:t,target:n});return performance.mark(`fungi.app-open.agar-root-created`),i=void 0,c}catch(t){return dj(t,e,n,r,i)}}function YA(e,t){e.context.update(t.context.value),e.theme.update(t.theme.value),e.lifecycle.update(t.lifecycle.value),e.chords.update(t.chords.value),e.versions.context=t.context.version,e.versions.theme=t.theme.version,e.versions.lifecycle=t.lifecycle.version,e.versions.chords=t.chords.version}function XA(){return new K(`App connection was cancelled`,{code:`CANCELLED`,retryable:!1})}function ZA(e){let t,n=new Promise((e,n)=>{t=n});return n.catch(e=>{Pf(`app-session.rpc-disconnect`,e)}),e.onRpcBroken(()=>t?.(new K(`The app host disconnected`,{code:`DISCONNECTED`,retryable:!0}))),n}function QA(){return{statusItems:[],navigation:{canGoBack:!1},bindings:_A(),chords:vA([]),context:MA({computerId:null,focus:{editing:!1,surface:null},openRequest:null,visibility:`hidden`}),lifecycle:MA(`connecting`),theme:MA(`default`),canGoBack:!1,versions:{chords:-1,context:-1,lifecycle:-1,theme:-1}}}function $A(e){let t=Ck(e.bootstrap.identity),n=uj(e.bootstrap);YA(e.state,n);let r=NA(e.bootstrap.capabilities);return e.state.capabilities=r,tj(e,t,r)}function ej(e,t,n){return yA({bindings:e.state.bindings,chords:e.state.chords,identity:t,onBroken:e=>{n({code:`DISCONNECTED`,message:e instanceof K?e.message:`The app host rejected a browser bridge operation`,retryable:!0})},remote:e.remote,window:e.options.window})}function tj(e,t,n){let r=!1,i=t=>{r||(r=!0,oj([()=>{t&&e.state.lifecycle.update(`disconnected`)},()=>{e.state.lifecycle.update(`disposing`)},l,u,()=>{o.dispose()},()=>{e.state.beforeClose=void 0,e.state.back=void 0,e.state.activate=void 0,e.state.statusAction=void 0},()=>{n.disconnect()},()=>{e.target[Symbol.dispose]()},()=>{FA(e.bootstrapOwner)},()=>{FA(e.remote)},()=>{e.options.port.close()},()=>{e.state.lifecycle.update(`disposed`)},e.options.onDisposed],`app connection disposal`))},a=()=>{if(r)throw new K(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0})},o=VA(e.remote,a,()=>{i({code:`DISCONNECTED`,message:`The app host rejected a terminal command operation`,retryable:!0})},e.state.bindings),s=rj(e.remote,a,e.state),c=nj(e.state,e.remote,a),l=ej(e,t,i),u=EA({window:e.options.window,mac:jA(),canGoBack:()=>e.state.canGoBack&&e.state.back!==void 0,back:()=>{let t=e.state.back;t&&Promise.resolve().then(t).catch(e=>{Pf(`app-window.back-input`,e)})}});return e.state.disconnect=i,e.remote.onRpcBroken(()=>{aj(i)}),sj({capabilities:n.directory,commands:o.commands,context:e.state.context,dispose:i,identity:t,lifecycle:e.state.lifecycle,theme:e.state.theme,ui:s,window:c})}function nj(e,t,n){let r=Object.freeze({async publish(r){n();let i=Nk(r);e.canGoBack=i.canGoBack,e.navigation=Mk(i),await pA(t.reportNavigation(i),nA)},onActivate(t){if(n(),e.activate!==void 0)throw new K(`The App already owns navigation activations`,{code:`INVALID_ARGUMENT`,retryable:!1});e.activate=t;let r=!1;return()=>{r||(r=!0,e.activate===t&&(e.activate=void 0))}},onBack(t){if(n(),e.back!==void 0)throw new K(`The App already owns Back requests`,{code:`INVALID_ARGUMENT`,retryable:!1});e.back=t;let r=!1;return()=>{r||(r=!0,e.back===t&&(e.back=void 0))}}});return Object.freeze({navigation:r,onBeforeClose(t){if(n(),e.beforeClose!==void 0)throw new K(`The App already owns a close consultation`,{code:`INVALID_ARGUMENT`,retryable:!1});e.beforeClose=t;let r=!1;return()=>{r||(r=!0,e.beforeClose===t&&(e.beforeClose=void 0))}}})}function rj(e,t,n){return Object.freeze({async requestComputerChoice(){t(),await pA(e.requestComputerChoice(),nA)},async requestBrowserAction(n){t();let r=oA(n);return r.kind===`refused`?r:await pA(e.requestBrowserAction(r),sA)},onStatusAction(e){if(t(),n.statusAction!==void 0)throw new K(`The App already owns its status actions`,{code:`INVALID_ARGUMENT`,retryable:!1});n.statusAction=e;let r=!1;return()=>{r||(r=!0,n.statusAction===e&&(n.statusAction=void 0))}},async requestAppPermissions(n){return t(),await pA(e.requestAppPermissions(Lk(n)),rA)},async openDesktopSettings(){t(),await pA(e.openDesktopSettings(),nA)},async openTeamBilling(){t(),await pA(e.openTeamBilling(),nA)},async openNavigation(n){t(),await pA(e.openNavigation(Dk(n)),nA)},async reportStatus(r){t();let i=Tk(r);n.statusItems=i,await pA(e.reportStatus(i),nA)},async reportAgentSessionSelection(n){t(),await pA(e.reportAgentSessionSelection(Ik(n)),nA)},async showToast(n){t(),await pA(e.showToast(zk(n)),nA)}})}function ij(){return new K(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0})}function aj(e){e({code:`DISCONNECTED`,message:`The app host disconnected`,retryable:!0})}function oj(e,t){for(let n of e)try{n()}catch(e){console.warn(`${t} cleanup failed`,e)}}function sj(e){return Object.freeze(e)}function cj(){return{code:`DISCONNECTED`,message:`The app host disconnected`,retryable:!1}}function lj(e,t){return e===t||e===`connected`&&t===`suspended`||e===`suspended`&&t===`connected`}function uj(e){let t=Vk(bk)(e.context),n=Vk(Rk)(e.theme),r=Vk(wk)(e.lifecycle),i=Vk(Bk)(e.reservedChords);if(r.value!==`connected`&&r.value!==`suspended`)throw new K(`The bootstrap lifecycle is invalid`,{code:`PROTOCOL`,retryable:!1});return{chords:i,context:t,lifecycle:r,theme:n}}function dj(e,t,n,r,i){throw oj([()=>{n[Symbol.dispose]()},()=>{i&&FA(i)},()=>{FA(r)},()=>{t.port.close()},t.onDisposed],`app connection rejection`),e instanceof K?e:new K(`Unable to establish the app RPC session`,{cause:e,code:`PROTOCOL`,retryable:!1})}var fj=!1,pj=class{options;#e;#t;#n;#r=!1;#i;#a;constructor(e){this.options=e,this.#t=vj(e.expectedHostOrigin),this.#e=globalThis.window}start(){performance.mark(`fungi.app-open.agar-connect-start`);let e=this.#t;if(!e)return Promise.reject(bj());let t=this.#u();return t?Promise.reject(t):(fj=!0,this.#o(e))}#o(e){return new Promise((t,n)=>{let r=(e,r)=>{this.#s(e,r,a,i,t,n)},i=()=>{r(hj())},a=t=>{this.#c(t,e,r,a)};this.#e.addEventListener(`message`,a),this.options.signal?.addEventListener(`abort`,i,{once:!0});let o=()=>{try{performance.mark(`fungi.app-open.agar-ready-sent`),this.#e.parent.postMessage({protocolVersion:2,type:CO},e)}catch(e){Pf(`connect.notify-host`,e),r(Sj(e))}};this.#i=setInterval(o,200),this.#a=setTimeout(()=>{r(_j())},1e4),o()})}#s(e,t,n,r,i,a){if(!this.#r){if(this.#r=!0,this.#l(),this.#e.removeEventListener(`message`,n),this.options.signal?.removeEventListener(`abort`,r),e||!t){this.#n?.close(),fj=!1,a(e??_j());return}i(t)}}#c(e,t,n,r){if(!xj(e.data))return;if(performance.mark(`fungi.app-open.agar-connect-received`),e.source!==this.#e.parent||e.origin!==t){n(yj());return}let i=Cj(e,n);if(!i)return;let a=e.ports.length===1?e.ports[0]:void 0;if(!a){n(wj(`The app host did not transfer exactly one port`));return}this.#n=a,this.#l(),this.#e.removeEventListener(`message`,r),JA({epoch:i.epoch,isActive:()=>!this.#r,onDisposed:()=>{fj=!1},port:a,window:this.#e}).then(e=>{performance.mark(`fungi.app-open.agar-root-ready`),n(void 0,e)},e=>{n(gj(e))})}#l(){clearInterval(this.#i),clearTimeout(this.#a),this.#i=void 0,this.#a=void 0}#u(){if(this.options.signal?.aborted)return hj();if(fj)return new K(`An app connection is already live`,{code:`IDENTITY`,retryable:!1});if(Du(globalThis.window)||this.#e.parent===this.#e)return new K(`The app host is unavailable`,{code:`DISCONNECTED`,retryable:!0})}};function mj(e){return new pj(e).start()}function hj(){return new K(`App connection was cancelled`,{code:`CANCELLED`,retryable:!1})}function gj(e){return e instanceof K?e:new K(`Unable to connect to the app host`,{cause:e,code:`PROTOCOL`,retryable:!1})}function _j(){return new K(`The app host disconnected`,{code:`DISCONNECTED`,retryable:!0})}function vj(e){if(!URL.canParse(e))return;let t=new URL(e).origin;return t===e?t:void 0}function yj(){return new K(`The app connection identity is invalid`,{code:`IDENTITY`,retryable:!1})}function bj(){return new K(`expectedHostOrigin must be an origin`,{code:`INVALID_ARGUMENT`,retryable:!1})}var xj=JS(Y({type:nC(wO)}));function Sj(e){return new K(`Unable to notify the app host`,{cause:e,code:`DISCONNECTED`,retryable:!0})}function Cj(e,t){try{return yk(e.data)}catch(e){Pf(`connect.decode-message`,e),t(e instanceof K?e:new K(`Malformed app connection`,{cause:e,code:`PROTOCOL`,retryable:!1}));return}}function wj(e){return new K(e,{code:`PROTOCOL`,retryable:!1})}function Tj(e,t,n){e.style.isolation=`isolate`;let r=(0,nu.createRoot)(e),i=new AbortController,a=e.ownerDocument.documentElement,o=hc(a),s,c,l,u=!1,d=e=>{let i=(0,f.createElement)(Ej,{state:e,render:n});r.render(t.queryClient?(0,f.createElement)(vc,{client:t.queryClient},i):i)},p=()=>{l?.(),l=void 0,c?.(),c=void 0;let e=s;s=void 0,e?.dispose(),u&&=(o===null?a.removeAttribute(`data-theme`):mc(o,a),!1)},{referrer:m,defaultView:h}=e.ownerDocument;return performance.mark(`fungi.app-open.react-root-render-start`),!h||h.parent===h||!URL.canParse(m)?d({app:null,status:`standalone`}):(d({app:null,status:`connecting`}),mj({expectedHostOrigin:new URL(m).origin,signal:i.signal}).then(e=>{if(i.signal.aborted){e.dispose();return}s=e;let t=()=>{let t=e.lifecycle.get();return t===`disposing`||t===`disconnected`||t===`disposed`?(p(),d({app:null,status:`ended`}),!0):!1};l=e.lifecycle.subscribe(t),!t()&&(u=!0,mc(e.theme.get(),a),c=e.theme.subscribe(e=>{mc(e,a)}),d({app:e,status:`live`}))}).catch(e=>{i.signal.aborted&&e instanceof K&&e.code===`CANCELLED`||(console.error(`${t.name} host connection failed`,e),p(),i.signal.aborted||d({app:null,status:`ended`}))})),()=>{i.signal.aborted||(i.abort(),r.unmount(),p())}}function Ej({state:e,render:t}){return(0,f.useLayoutEffect)(()=>{performance.mark(`fungi.app-open.react-initial-commit`)},[]),(0,f.useLayoutEffect)(()=>{e.app&&performance.mark(`fungi.app-open.react-connected-commit`)},[e.app]),t(e)}function Dj(e){let t=(0,f.useCallback)(t=>e?.subscribe(t)??(()=>void 0),[e]),n=(0,f.useCallback)(()=>e?.get(),[e]);return(0,f.useSyncExternalStore)(t,n,n)}function Oj(e){return Dj(e?.context)??null}function kj(e){return Oj(e)?.computerId??null}function Aj(e,t,n,r){let i=(0,f.useRef)(t);i.current=t;let a=(0,f.useRef)(n);a.current=n;let o=(0,f.useRef)(r);o.current=r;let s=JSON.stringify(t),c=n!==void 0;(0,f.useEffect)(()=>{e&&e.ui.reportStatus(i.current).catch(e=>{o.current?o.current(e):console.error(`Window status report failed`,e)})},[e,s]),(0,f.useEffect)(()=>{if(!(!e||!c))return e.ui.onStatusAction(e=>a.current?.(e)??!1)},[e,c]),(0,f.useEffect)(()=>()=>{e?.ui.reportStatus([]).catch(e=>{console.error(`Window status report failed`,e)})},[e])}function jj(e,{sourceId:t,namespace:n},r){let i=(0,f.useMemo)(()=>h(),[]),a=(0,f.useMemo)(r,[r]);return(0,f.useEffect)(()=>{let e=i.contribute({sourceId:t,namespace:n,commands:a});return()=>{e.dispose()}},[i,t,n,a]),(0,f.useEffect)(()=>e?cc(e.commands,a):void 0,[e,a]),i}var Mj=class{id;version;#e;constructor(e,t,n){this.id=e,this.version=t,this.#e=n,Object.freeze(this)}get schema(){return this.#e}};function Nj(e,t,n){return new Mj(e,t,n)}function Pj(e){let t=Jo(e),n=zs(Object),r=Jo(Object.fromEntries(Object.keys(e).map(e=>[e,Bo().optional()])));return Bo().transform(e=>{let i=n.parse(e),a=Object.create(i),o=r.parse(a),s=Object.fromEntries(Object.entries(o).map(([e,t])=>[e,Fs().parse(t).bind(i)]));return{...t.parse(s),[Symbol.dispose](){FA(e)}}})}function Fj(e){return Bo().transform(t=>{try{return e.parse(t)}catch(e){throw e instanceof K?e:new K(`The capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}finally{FA(t)}})}function Ij(e){return Fs({output:Ns(Bo().transform(t=>{try{return e.parse(t)}catch(e){throw FA(t),e instanceof K?e:new K(`The capability returned a malformed result`,{cause:e,code:`PROTOCOL`,retryable:!1})}}))})}var Lj=Ij(Fj(Wo()));Pj({fetch:Ij(zs(Response)),close:Lj});var Rj=e=>crypto.getRandomValues(new Uint8Array(e)),zj=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(409.6*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},Bj=(e,t=21)=>zj(e,t|0,Rj),Vj=`abcdefghijklmnopqrstuvwxyz0123456789`;function Hj(e=21){if(e===1/0||e===-1/0)throw RangeError(`nanoid length must be finite`);return Bj(Vj,e)()}var Uj=`gilled.velvety.spored.saprotrophic.mycorrhizal.luminescent.honeycomb.truffley.wispy.earthy.mossy.woody.waxy.gelatinous.coral.inkcapped.feathery.stiped.ringed.annulate.scaly.shaggy.fuzzy.spiky.conical.umbral.parasol.leathery.damp.dewy.bristly.powdery.yeasty.musty.ancient.patient.steady.faithful.hardy.rootbound.forested.shaded.sunlit.sporeladen.golden.honeyed.amber.ivory.crimson.violet.indigo.silver.mossgreen.midnight.creamy.buttery.porcelain.glossy.matte.ribbed.fluted.wavy.lobed.branched.curled.folded.hooded.crowned.blushing.weeping.laughing.dancing.singing.whistling.glowing.ghostly.fairy.elfin.rustic.homey.barnraised.pasture.orchard.mill.woven.gardened.herded.trailed.ridged.meadow.fielded.vined.rooted.tendered.seasoned.ripe.wild.tame.broody.stubborn.gentle.drowsy.watchful.wandering.migratory.burrowed.nested.perched.loamy.mulched.composted.fermented.brewed.cured.smoked.pickled.preserved.aged.vintage.heirloom.grandmothers.forgotten.remembered.beloved.cherished.worn.weathered.windblown.rainsoaked.frosted.snowed.bloomed.flowered.seeded.sprouted.grafted.pruned.harvested.threshed.milled.baked.proofed.risen.folded.twisted.braided.stitched.patched.mended.polished.burnished.glazed.gilded.verdigris.patinaed.microdosed.tripping.wavy.prismatic.shimmering.rippling.echoing.oracular.mystic.kaleidoscopic.auroral.nebular.azure.psychedelic.transcendent.visionary.wandering.dreaming.phantom.spectral.iridescent.liminal.tidal.celestial.cosmic.astral.ethereal.incandescent`.split(`.`),Wj=`shiitake.morel.chanterelle.bolete.puffball.oyster.enoki.maitake.lionsmane.truffle.porcini.agaric.amanita.bracket.conk.stipe.cap.gill.spore.hypha.mycelium.sporocarp.earthstar.stinkhorn.jelly.milkcap.blewit.cep.hedgehog.woodear.waxcap.inkcap.birdnest.cup.saddle.fieldcap.rust.smut.ergot.lichen.yeast.mold.toadstool.fruitingbody.basidiocarp.ascocarp.perithecium.apothecium.cystidium.basidium.clamp.septa.rhizomorph.sclerotium.gemma.annulus.volva.pileus.lamella.trama.gleba.peridium.sporangium.zygospora.conidia.teleomorph.anamorph.saprobe.endophyte.epiphyte.decomposer.recycler.alchemist.mycorrhiza.hyphae.web.net.lattice.thread.strand.root.tendril.runner.vine.ivy.moss.fern.liverwort.mule.cairn.almanac.parrot.birddog.watchdog.pigeon.ranch.barn.coop.pasture.meadow.field.orchard.gate.fence.silo.well.windmill.homestead.trail.ridge.creek.hill.grove.vineyard.apiary.garden.plot.furrow.shed.stable.trough.hayloft.rootcellar.smokehouse.springhouse.millstone.weathervane.lantern.tinderbox.candlemold.honeycomb.beeswax.propolis.nectar.pollen.comb.burrow.den.nest.perch.warren.colony.swarm.flock.herd.pod.grist.flour.starter.mother.scoby.kombucha.miso.tempeh.cheese.rennet.whey.curd.cream.butter.braid.loaf.crust.crumb.fiddlehead.sorrel.ramp.morelberry.huckleberry.thimbleberry.salmonberry.serviceberry.chokecherry.microdose.trip.shroom.liberty.teacher.treasure.wanderer.seeker.dreamer.shaman.visionary.tripper.oracle.seer.augur.prism.fractal.kaleidoscope.spectrum.nebula.aurora.comet.meteor.eclipse.zenith.horizon.mirage.echo.ripple.shimmer.glimmer.phantom.twilight.starlight.moonbeam`.split(`.`);function Gj(e){let t=Math.floor(4294967296/e.length)*e.length,n;do{let e=crypto.getRandomValues(new Uint32Array(1))[0];if(e===void 0)throw Error(`CSPRNG returned no candidate value`);n=e}while(n>=t);let r=e[n%e.length];if(r===void 0)throw Error(`Candidate vocabulary is empty`);return r}function Kj(e){if(e?.count===1/0)throw RangeError(`words count must be finite`);let t=Math.max(1,Math.floor(e?.count??2)),n=e?.separator??`-`,r=[Gj(Uj)];for(let e=1;e<t;e++)r.push(Gj(Wj));return r.join(n)}var qj=W(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);Tn.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>ft(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>gt(e,t,n),e.parseAsync=async(t,n)=>mt(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>vt(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>Ue(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),Jj=W(`ZodMiniObject`,(e,t)=>{fr.init(e,t),qj.init(e,t),je(e,`shape`,()=>t.shape)});function Yj(e,t){return new Jj({type:`object`,shape:e??{},...G(t)})}var Xj=W(`ZodMiniLiteral`,(e,t)=>{Er.init(e,t),qj.init(e,t)});function Zj(e,t){return new Xj({type:`literal`,values:Array.isArray(e)?e:[e],...G(t)})}function Qj(e){return e instanceof K?e:new K(`App operation failed`,{cause:e,code:`HOST_FAILURE`,retryable:!1})}var $j=new WeakMap,eM={of(e,...t){return[e?.identity.surfaceId??null,e?.context.get().computerId??null,...t]}};function tM(e){let t={};return e&&$j.set(t,e),t}function nM(){let e=new Al({defaultOptions:{queries:{retry:!1,staleTime:3e4,refetchOnWindowFocus:!1},mutations:{retry:!1}}}),t=new Map;return e.getQueryCache().subscribe(n=>{let r=n.query;if(n.type===`removed`){t.get(r.queryHash)?.release(),t.delete(r.queryHash);return}let i=r.meta&&$j.get(r.meta),a=t.get(r.queryHash);if(a?.app===i||(a?.release(),t.delete(r.queryHash),!i))return;let o=()=>{queueMicrotask(()=>{e.getQueryCache().get(r.queryHash)===r&&t.get(r.queryHash)?.app===i&&e.resetQueries({predicate:e=>e===r})})},s=i.capabilities.subscribe(o);t.set(r.queryHash,{app:i,release:s}),a&&o()}),e}function rM(e,t,n,r){let i=e?.context.get().computerId;return Gl({queryKey:n,meta:tM(e),enabled:e!==null,retry:!1,queryFn:async({signal:n})=>{try{if(!e)throw new K(`No App connection`,{code:`DISCONNECTED`,retryable:!0});if(e.context.get().computerId!==i)throw new K(`The selected Computer changed`,{code:`SELECTION_CHANGED`,retryable:!1});return await r(e.capabilities.require(t),n)}catch(e){throw Qj(e)}}})}function iM(e){return Xl({mutationKey:e.queryKey,scope:{id:jc(e.queryKey)},mutationFn:async(t,n)=>{try{return await e.mutationFn(t,n)}catch(e){throw Qj(e)}},onMutate:async(t,{client:n})=>{if(n.isMutating({mutationKey:e.queryKey,exact:!0})>1)return;await n.cancelQueries({queryKey:e.queryKey,exact:!0});let r=n.getQueryData(e.queryKey);if(r!==void 0)return n.setQueryData(e.queryKey,e.apply(r,t)),{previous:r,optimistic:n.getQueryData(e.queryKey)}},onError:(t,n,r,{client:i})=>{r&&i.getQueryData(e.queryKey)===r.optimistic&&i.setQueryData(e.queryKey,r.previous)},onSettled:(t,n,r,i,{client:a})=>a.invalidateQueries({queryKey:e.queryKey,exact:!0})})}var aM=Nj(`app.backend`,1,js(()=>Pj({request:Ij(Fj(Bo().transform(e=>Gs(e))))}))),oM=Nj(`app.methods`,1,js(()=>Pj({call:Ij(Fj(Bo().transform(e=>Gs(e))))}))),sM=e=>co().min(1).max(e),cM=Mo().int().min(-(2**53-1)).max(2**53-1),lM=cM.positive(),uM=cM.nonnegative(),dM=Yo({printId:sM(256),computerId:sM(256),kind:ss([`image`,`video`]),prompt:sM(2048),model:sM(256),width:lM.nullable(),height:lM.nullable(),steps:uM.nullable(),durationSeconds:uM.nullable(),format:sM(32),bytes:lM,costMilliunits:uM,actorKind:ss([`member`,`agent`]),actorId:sM(256),derivedFrom:sM(256).nullable(),createdAt:uM,source:ss([`recorded`,`file`]),schemaVersion:lM}),fM=Jo({printId:dM.shape.printId,path:co().startsWith(`/`).min(2).max(4096)});function pM(e,t){let n=e?.app??null,r=Oj(n),i=r?.openRequest,a=r?.computerId,o=i?.kind===`navigate`?i.params.find(e=>e.key===`print`):void 0,s=dM.shape.printId.safeParse(o?.value),c=s.success?s.data:null,l=i?.kind===`navigate`?i.requestId:null,u=(0,f.useRef)({app:n,requestId:l,computerId:a});(u.current.app!==n||u.current.requestId!==l)&&(u.current={app:n,requestId:l,computerId:a});let d=u.current.computerId===a,p=Wl({...rM(n,oM,eM.of(n,`prints`,`navigate`,a,l,c),async(e,t)=>{if(!n||!a||!c||!l)throw Error(`No print selected`);let r=await e.call(`openOutput`,JSON.stringify({printId:c,byteLength:1}));if(t.throwIfAborted(),n.context.get().computerId!==a)throw Error(`Computer selection changed`);let i=fM.parse(r);if(i.printId!==c)throw Error(`Print selection changed`);return{path:i.path,requestId:l,computerId:a}}),enabled:!!(n&&d&&a&&l&&c&&n.capabilities.has(oM)),retry:!1,staleTime:1/0}),m=(0,f.useRef)(t);m.current=t;let h=(0,f.useRef)(void 0);return(0,f.useEffect)(()=>{let t=p.data;!e||!t||h.current===t||e.app.context.get().computerId!==t.computerId||(h.current=t,m.current(t.path,`add`,e,t.computerId))},[e,p.data]),{target:p.data??null,error:p.error}}function mM(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function hM(...e){return t=>{let n=!1,r=e.map(e=>{let r=mM(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():mM(e[t],null)}}}}function gM(...e){return f.useCallback(hM(...e),e)}function _M(e){let t=f.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];TM(r)&&typeof kM==`function`&&(r=kM(r._payload)),f.Children.forEach(r,e=>{if(CM(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;TM(n)&&typeof kM==`function`&&(n=kM(n._payload)),a=bM(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?SM(a):void 0,l=gM(n,c);if(!a){if(r||r===0)throw Error(o?OM(e):DM(e));return r}let u=xM(i,a.props??{});return a.type!==f.Fragment&&(u.ref=n?l:c),f.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var vM=_M(`Slot`),yM=Symbol.for(`radix.slottable`),bM=(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 xM(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 SM(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 CM(e){return f.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===yM}var wM=Symbol.for(`react.lazy`);function TM(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===wM&&`_payload`in e&&EM(e._payload)}function EM(e){return typeof e==`object`&&!!e&&`then`in e}var DM=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,OM=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,kM=f.use,AM=Object.freeze({alphaIntercept:-9,alphaSlope:19,blurStdDeviation:1.5}),jM=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-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 MM(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=MM(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function NM(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=MM(e))&&(r&&(r+=` `),r+=t);return r}var PM=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,FM=NM,IM=(e,t)=>n=>{if(t?.variants==null)return FM(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=PM(t)||PM(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 FM(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)},LM=Object.defineProperty,RM=((e,t)=>{let n={};for(var r in e)LM(n,r,{get:e[r],enumerable:!0});return t||LM(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>QM,isAnyNonArbitrary:()=>rN,isArbitraryFamilyName:()=>bN,isArbitraryImage:()=>SN,isArbitraryLength:()=>_N,isArbitraryNumber:()=>vN,isArbitraryPosition:()=>xN,isArbitraryShadow:()=>CN,isArbitrarySize:()=>hN,isArbitraryValue:()=>gN,isArbitraryVariable:()=>wN,isArbitraryVariableFamilyName:()=>EN,isArbitraryVariableImage:()=>kN,isArbitraryVariableLength:()=>TN,isArbitraryVariablePosition:()=>DN,isArbitraryVariableShadow:()=>AN,isArbitraryVariableSize:()=>ON,isArbitraryVariableWeight:()=>jN,isArbitraryWeight:()=>yN,isFraction:()=>qM,isInteger:()=>YM,isNamedContainerQuery:()=>iN,isNumber:()=>JM,isPercent:()=>XM,isTshirtSize:()=>ZM}),zM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,BM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,VM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,HM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,UM=/\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$/,WM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qM=e=>VM.test(e),JM=e=>!!e&&!Number.isNaN(Number(e)),YM=e=>!!e&&Number.isInteger(Number(e)),XM=e=>e.endsWith(`%`)&&JM(e.slice(0,-1)),ZM=e=>HM.test(e),QM=()=>!0,$M=e=>UM.test(e)&&!WM.test(e),eN=()=>!1,tN=e=>GM.test(e),nN=e=>KM.test(e),rN=e=>!gN(e)&&!wN(e),iN=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)),aN=(e,t,n)=>{let r=zM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},oN=(e,t,n=!1)=>{let r=BM.exec(e);return r?r[1]?t(r[1]):n:!1},sN=e=>e===`position`||e===`percentage`,cN=e=>e===`image`||e===`url`,lN=e=>e===`length`||e===`size`||e===`bg-size`,uN=e=>e===`length`,dN=e=>e===`number`,fN=e=>e===`family-name`,pN=e=>e===`number`||e===`weight`,mN=e=>e===`shadow`,hN=e=>aN(e,lN,eN),gN=e=>zM.test(e),_N=e=>aN(e,uN,$M),vN=e=>aN(e,dN,JM),yN=e=>aN(e,pN,QM),bN=e=>aN(e,fN,eN),xN=e=>aN(e,sN,eN),SN=e=>aN(e,cN,nN),CN=e=>aN(e,mN,tN),wN=e=>BM.test(e),TN=e=>oN(e,uN),EN=e=>oN(e,fN),DN=e=>oN(e,sN),ON=e=>oN(e,lN),kN=e=>oN(e,cN),AN=e=>oN(e,mN,!0),jN=e=>oN(e,pN,!0),MN=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},NN=e=>typeof e==`function`&&e.isThemeGetter===!0,PN=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),FN=(e,t)=>{let n=PN(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},IN={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},LN=25,RN=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),zN=(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},BN=(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),zN(e,n,t)}let n=t.$v,r=RM[n];if(IN[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return zN(e,n,r)},VN=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),HN=(e,t)=>e.theme[t]??[],UN=(e,t,n)=>{let r=VN(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=VN(),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(NN(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:BN(t,n),groupId:o});return}if(MN(n,`$t`)){for(let t of HN(e,n.$t))a(t,r,o);return}if(MN(n,`$v`)){(r.validators??=[]).push({validatorId:BN(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},WN=e=>{let t=RN(),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=UN(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 N=[];for(let e of h){let t=N[N.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):N.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let P=new Map,F=[];for(let e of N){let t=e.tails.join(` `),n=P.get(t);n===void 0&&(n=F.length,P.set(t,n),F.push(e.tails)),e.set=n}for(let e of F.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let I=new Set(F.flat()).size;N.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 L=n.length,R=new Int32Array(L).fill(-1),z=0,ee=e=>(R[e]===-1&&(R[e]=z++),R[e]);for(let e=0;e<M.length;e++)M[e]=ee(M[e]);for(let e of N)e.gid=ee(e.gid);for(let e=0;e<D.length;e++)D[e]>=0&&(D[e]=ee(D[e]));for(let e=0;e<L;e++)R[e]===-1&&(R[e]=z++);let te=Array(L);for(let e=0;e<L;e++)te[R[e]]=n[e];let ne=[],B=[],re=[],V=[],H=[];for(let t=0;t<L;t++){let n=te[t],i=(e.conflictingClassGroups[n]??[]).map(e=>R[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>R[r.get(e)]);i.length&&(ne.push(t),B.push(i.length),re.push(...i));for(let e of a)V.push(t),H.push(e)}let ie=(e.postfixLookupClassGroups??[]).map(e=>R[r.get(e)]),ae=[],oe=new Int32Array(j.length);for(let e=0;e<j.length;e++){let n=t.names[j[e]],r=IN[n];if(r!==void 0)oe[e]=r;else{let t=ae.indexOf(n);t===-1&&(t=ae.length,ae.push(n)),oe[e]=LN+t}}let se=new Map,ce=[],le=[],U=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(oe[e++]);let r=n.join(`,`),i=se.get(r);i===void 0&&(i=ce.length,se.set(r,i),ce.push(n.length),le.push(...n)),U.push(i)}}let ue={};for(let e of ae)ue[e]=t.classifierFns.get(e);return{G:L,customNames:ae,impls:ue,edgeCounts:w,edgeLabelLen:T,labelText:E,edgeTargetActual:k,nodeGroup:D,nodeVlist:O,nodeCount:S,totalEdges:C,patCounts:ce,patOps:le,listPat:U,vlistGroup:M,litEntries:h,sets:F,attachments:N,uniqueTailCount:I,adjGid:ne,adjCnt:B,adjTgt:re,patGid:V,patTgt:H,postfixLookup:ie,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},GN=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},KN=e=>{let t=WN(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:GN(t.edgeCounts),labelStart:GN(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:GN(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:GN(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}},qN=`line`in Error(),JN=-1,YN=-1,XN=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},ZN=(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},QN=(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,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(XN(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(XN(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[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&I-1}},z=n.cacheSize??8192,ee=n.prefix??e.prefix??``,te=ee===``?``:ee+`:`,ne=te.length,B=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),re=/\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$/,V=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,H=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ae=0,oe=-1,se=-1,ce=-1,le=-1,U=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(ae=0,oe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ae=1;else if(r===40&&i===41)ae=2;else return;ce=t+1,le=n-1;let a=t+1;if(U(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!U(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,se=a,ce=a+1)}},fe=(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},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(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&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`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(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],W=(e,t,n,r)=>{if(e>=10){if(e>=25)return B[e-25](t.slice(n,r));let i=e-10;if(ae!==_e[i])return!1;if(oe>=0){for(let e of ve[i])if(fe(t,oe,se,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ce,le);return re.test(e)&&!V.test(e)}case 3:return he(t.slice(ce,le));case 4:return ie.test(t.slice(ce,le));default:return H.test(t.slice(ce,le))}}switch(e){case 0:return!0;case 1:return ae===0;case 2:return ae===1;case 3:return ae===2;case 4:return pe.test(t.slice(n,r));case 5:return he(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&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},be=new Set(typeof E==`string`?E.split(` `):E),xe=(e,t,n,r,i,a)=>{let o=XN(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},Se=new Map,Ce=new Map,we=2,Te=4096,Ee=(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||be.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=Ce.get(s);return c===void 0&&Ce.set(s,c=we++),c},De=new Map,Oe=r,ke=r+4096,Ae=()=>Oe++,je=2097152,Me=8192,Ne=new Int32Array(Me),Pe=Array(Me).fill(null),Fe=new Int32Array(Me),Ie=new Int32Array(Me),Le=new Uint8Array(Me),Re=0,ze=(e,t,n,r,i,a,o,s)=>{let c=e;if(Pe[e]!==null){if(Pe[e|1]===null)c=e|1;else if(!(Re++&3))c=e|Re>>2&1;else return}Pe[c]=t.slice(n,r),Ne[c]=i,Fe[c]=a,Ie[c]=o,Le[c]=s},Be=()=>Pe.fill(null),Ve=256,He=[new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve),new Int32Array(Ve)],[Ue,G,We,Ge]=He,Ke=new Uint8Array(Ve),qe=new Uint8Array(Ve),Je=()=>{Ve*=2,He=He.map(e=>{let t=new Int32Array(Ve);return t.set(e),t}),[Ue,G,We,Ge]=He;let e=new Uint8Array(Ve);e.set(Ke),Ke=e,qe=new Uint8Array(Ve)},Ye=64,Xe=new Int32Array(Ye),Ze=new Int32Array(Ye),Qe=new Int32Array(r),$e=2048,et=21,tt=new Float64Array($e),nt=new Int32Array($e),rt=0,it=(e,t)=>{if(e===0&&t<r)return Qe[t]===rt?1:(Qe[t]=rt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>et;for(;nt[i]===rt;){if(tt[i]===n)return 1;i=i+1&$e-1}return tt[i]=n,nt[i]=rt,0},at=(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?JN:xe(De,e,t+1,r,0,Ae)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ze[t];if(r>n)continue;let i=Xe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(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;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(W(d[t],e,r,n))return p[h+t]}return JN},ot=e=>{let t=e.length,n=0,c=0,u=!1;(we>Te||Se.size>Te)&&(Se=new Map,Ce=new Map,we=2,Be()),Oe>ke&&(De=new Map,Oe=r,Be());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(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&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ve&&Je();let _=n++;Ue[_]=p,G[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Ne[y]===v&&Pe[y]!==null&&Pe[y].length===g?t=y:Ne[y|1]===v&&Pe[y|1]!==null&&Pe[y|1].length===g&&(t=y|1),t>=0){let n=Pe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){We[_]=Fe[t],Ge[_]=Ie[t],Ke[_]=Le[t];continue}}}let b=p;if(ne!==0){if(h-p<=ne||!e.startsWith(te,p)){We[_]=JN,ze(y,e,p,h,v,JN,0,0);continue}b=p+ne}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 P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Xe[0]=0,Ze[0]=M,R=1);let z=YN,ee=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?YN:P,ee=R),P!==YN){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=YN;else{let e=i[P],t=i[P+1],c=YN;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]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ye){Ye*=2;let e=new Int32Array(Ye);e.set(Xe),Xe=e;let t=new Int32Array(Ye);t.set(Ze),Ze=t}Xe[R]=r,Ze[R]=t+2,R++}}A===D&&(z=F<I?YN:P,ee=R);let B=F<I?YN:P,re,V=!1;if(A>=0){if(V=!0,re=at(e,E,A,z,ee),re!==JN&&re<r&&j[re]){let t=at(e,E,D,B,R);t!==JN&&t!==re&&(re=t,V=!1)}else re===JN&&(re=at(e,E,D,B,R),V=!1)}else re=at(e,E,D,B,R);let H=0,ie=0;re===JN?We[_]=JN:(ie=+!!V,H=b>=C?+!!O:xe(Se,e,b,C,+!!O,e=>Ee(e,O)),We[_]=re,Ke[_]=ie,Ge[_]=H),ze(y,e,p,h,v,re,H,ie)}if(n===0)return``;if(n===1)return Ue[0]===0&&G[0]===t?e:e.slice(Ue[0],G[0]);if(n*k>$e){for(;n*k>$e;)$e<<=1,et--;tt=new Float64Array($e),nt=new Int32Array($e)}if(we>=je||Oe>=je)throw Error(`cn: too many distinct classes in one merge`);rt=rt+1|0,rt===0&&(Qe.fill(0),nt.fill(0),rt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=We[e];if(t===JN){qe[e]=1;continue}let n=Ge[e];if(it(n,t)===1){qe[e]=0,f=!0;continue}if(qe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)it(n,x[e]);if(Ke[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&it(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!qe[m]){m++;continue}let t=Ue[m],r=G[m],i=m+1;for(;i<n&&qe[i]&&Ue[i]===r+1&&e.charCodeAt(r)===32;)r=G[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},st=16384,ct=new Int32Array(st*2),lt=0,ut=1,dt=Object.create(null),ft=Object.create(null),pt=new Map,mt=new Map,ht=0,gt=0,_t=()=>{lt^=st,ut=ut+1|0,gt=0},vt=e=>{let t=dt[e];if(t!==void 0)return t;let n=ZN(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=ft[e],t!==void 0)?(dt[e]=t,t):(t=ot(e),i?(dt[e]=t,++ht>z&&(ht=0,ft=dt,dt=Object.create(null),_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},yt=e=>{let t=pt.get(e);if(t!==void 0)return t;let n=ZN(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=mt.get(e),t!==void 0)?(pt.set(e,t),t):(t=ot(e),i?(pt.set(e,t),++ht>z&&(ht=0,mt=pt,pt=new Map,_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},bt=e=>{let t=ZN(e,0,e.length),n=(t&16383)+lt;return ct[n]===(t^ut)||ct[n^st]===(t^ut-1)||(ct[n]=t^ut,++gt>st&&_t(),!1)},xt=z===0?ot:qN?e=>{let t=pt.get(e);return t===void 0?yt(e):t}:vt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?xt(arguments[0]):xt(tP.apply(null,arguments))},mergeString:xt,seenBefore:z===0?()=>!1:bt,mergeUncached:ot}},$N=(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:$N(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},eP=(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:$N(i,t);a&&(n&&(n+=` `),n+=a)}return n},tP=function(){return eP(arguments,!1)},nP=(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]=$N(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($N(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)}},rP=`{"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"]}`,iP=()=>JSON.parse(rP),aP=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,oP=e=>e===void 0?{config:iP()}:typeof e==`function`?{config:e(iP())}:aP(e)?{config:e}:{config:FN(iP(),e),cacheSize:e.cacheSize},sP=e=>{let{config:t,cacheSize:n}=oP(e),{tables:r,validatorImpls:i,prefix:a}=KN(t);return QN(r,i,{cacheSize:n,prefix:a})},Z=(e=>{let t=null,n=()=>t??=sP(e);return nP(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{theme:{spacing:[...jM]}}});function cP(e,t){return typeof e==`function`?e(t):e}var lP=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)`}),uP=`(prefers-reduced-motion: reduce)`;function dP(e){let t=e.ownerDocument.defaultView;if(!t)return lP;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?.(uP).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`,lP.squish),fast:o(`fast`,lP.fast),normal:o(`normal`,lP.normal),slow:o(`slow`,lP.slow),springDuration:o(`spring-duration`,lP.springDuration),bounce:Math.min(1,s(`bounce`,lP.bounce)),stretch:s(`stretch`,lP.stretch),distance:s(`distance`,lP.distance),stagger:a?0:i(`--stipe-motion-stagger`,lP.stagger),blur:s(`blur`,lP.blur),shake:s(`shake`,lP.shake),steps:Math.floor(s(`steps`,lP.steps)),fuse:r(`--stipe-motion-fuse`,lP.fuse),pressDepth:a?0:r(`--stipe-press-depth`,lP.pressDepth),pressScale:a?1:r(`--stipe-press-scale`,lP.pressScale),ease:n.getPropertyValue(`--stipe-motion-ease`).trim()||lP.ease,easeExit:n.getPropertyValue(`--stipe-motion-ease-exit`).trim()||lP.easeExit}}function fP(e){let[t,n]=(0,f.useState)(()=>({...lP,reduced:!0}));return(0,f.useLayoutEffect)(()=>{let t=e.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let i=()=>{let e=dP(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?.(uP);return o?.addEventListener(`change`,i),()=>{a.disconnect(),o?.removeEventListener(`change`,i)}},[e]),t}function pP(e,t){return e.reduced?0:Math.round(t*e.normal/lP.normal)}function mP(e,t){if(e.reduced)return 0;let n=t*e.bounce/lP.bounce;return Math.min(.9,Math.max(0,n))}function hP(e,t){return e.reduced?0:Math.round(t*e.springDuration/lP.springDuration)}function gP(e,t){return e.steps>0?`steps(${String(e.steps)}, end)`:t}function _P(e){return`animate`in e}var vP=globalThis;function yP(){return vP.matchMedia?.(uP).matches??!1}function bP(e){let t=vP.matchMedia?.(uP);return t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}}function xP(){return!0}function SP(){return(0,f.useSyncExternalStore)(bP,yP,xP)}var CP=(0,f.forwardRef)(function({asChild:e=!1,className:t,...n},r){let i=Z(`absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]`,t);return e?(0,J.jsx)(vM,{...n,className:i,ref:r}):(0,J.jsx)(`span`,{...n,className:i,ref:r})}),wP=typeof window<`u`,TP=wP?window:null,EP=wP?document:null,DP={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},OP={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},kP={NONE:0,AUTO:1,FORCE:2},AP={replace:0,none:1,blend:2},jP=Symbol(),MP=Symbol(),NP=Symbol(),PP=Symbol(),FP=Symbol(),IP=1e-11,LP=0xe8d4a51000,RP=1e3,zP=[],BP=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),VP=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],HP=VP.reduce((e,t)=>({...e,[t]:t+`(`}),{}),UP=()=>{},WP=e=>e,GP=/\)\s*[-.\d]/,KP=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,qP=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,JP=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,YP=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,XP=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,ZP=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,QP=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,$P=/([a-z])([A-Z])/g,eF=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,tF={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:RP,delay:0,loopDelay:0,ease:`out(2)`,composition:AP.replace,modifier:WP,onBegin:UP,onBeforeUpdate:UP,onUpdate:UP,onLoop:UP,onPause:UP,onComplete:UP,onRender:UP},nF={current:null,root:EP},rF={defaults:tF,precision:4,timeScale:1,tickThreshold:200,editor:null},iF={version:`4.5.0`,engine:null};wP&&(TP.AnimeJS||=[],TP.AnimeJS.push(iF));var aF=e=>e.replace($P,`$1-$2`).toLowerCase(),oF=(e,t)=>e.indexOf(t)===0,sF=Date.now,cF=Array.isArray,lF=e=>e&&e.constructor===Object,uF=e=>typeof e==`number`&&!isNaN(e),dF=e=>typeof e==`string`,fF=e=>typeof e==`function`,pF=e=>e===void 0,mF=e=>pF(e)||e===null,hF=e=>wP&&e instanceof SVGElement,gF=e=>KP.test(e),_F=e=>oF(e,`rgb`),vF=e=>oF(e,`hsl`),yF=e=>gF(e)||(_F(e)||vF(e))&&(e[e.length-1]===`)`||!GP.test(e)),bF=e=>!rF.defaults.hasOwnProperty(e),xF=[`opacity`,`rotate`,`overflow`,`color`],SF=(e,t)=>{if(xF.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}},CF=Math.pow,wF=Math.sqrt,TF=Math.sin,EF=Math.cos,DF=Math.abs,OF=Math.exp,kF=Math.ceil,AF=Math.floor,jF=Math.asin,MF=Math.PI,NF=Math.round,PF=(e,t,n)=>e<t?t:e>n?n:e,FF=(e,t)=>{if(t<0)return e;if(!t)return NF(e);let n=10**t;return NF(e*n)/n},IF=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,LF=e=>e===1/0?LP:e===-1/0?-LP:e,RF=e=>e<=1e-11?IP:LF(FF(e,11)),zF=e=>cF(e)?[...e]:e,BF=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=pF(i)?t[r]:i}return n},VF=(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}},HF=(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},UF=(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},WF=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[PP],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(!pF(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:oF(t,`scale`)?`1`:oF(t,`rotate`)||oF(t,`skew`)?`0deg`:`0px`},GF=e=>{let t=``;for(let n=0,r=VP.length;n<r;n++){let r=VP[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+=`${HP[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},KF=[];function qF(e,t){if(!e)return null;let n=KF.length;outer:for(let r=0;r<n;r++){let n=KF[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=KF[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 JF=e=>{let t=qP.exec(e)||JP.exec(e),n=pF(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},YF=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]},XF=(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),ZF=e=>{let t=YP.exec(e)||XP.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=pF(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=FF(XF(t,e,n+1/3)*255,0),s=FF(XF(t,e,n)*255,0),c=FF(XF(t,e,n-1/3)*255,0)}return[o,s,c,a]},QF=e=>_F(e)?JF(e):gF(e)?YF(e):vF(e)?ZF(e):[0,0,0,1],$F=(e,t)=>pF(e)?t:e,eI=(e,t)=>{let n=e.match(eF),r=t[MP]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},tI=(e,t,n,r,i,a)=>{if(fF(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(dF(e)&&oF(e,`var(`)){if(!i)return eI(e,t);let n=()=>eI(e,t);return i.func=n,n()}return e},nI=(e,t)=>e[MP]?e[NP]&&SF(e,t)?DP.ATTRIBUTE:VP.includes(t)||BP.get(t)?DP.TRANSFORM:oF(t,`--`)?DP.CSS_VAR:t in e.style?DP.CSS:t in e?DP.OBJECT:DP.ATTRIBUTE:DP.OBJECT,rI=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[FP]||e).getPropertyValue(t);return i===`auto`?`0`:i},iI=(e,t,n,r)=>{let i=pF(n)?nI(e,t):n,a=qF(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===DP.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===DP.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===DP.TRANSFORM?WF(e,t,r):i===DP.CSS_VAR?rI(e,t,r).trimStart():rI(e,t,r)},aI=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,oI=()=>({t:OP.NUMBER,n:0,u:null,o:null,d:null,s:null}),sI=(e,t)=>{if(t.t=OP.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(` `)&&QP.exec(r);if(i)return t.t=OP.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(yF(r))return t.t=OP.COLOR,t.d=QF(r),t;{let e=r.match(ZP);return t.t=OP.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(ZP)||[],t}},cI=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=zF(e._toNumbers),t.s=zF(e._strings),t),lI=oI(),uI=(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(FF(IF(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},dI=(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=PF(g,-h,o),b=PF(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=IP,T=i===kP.FORCE,E=0,D=v,O=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=PF(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===kP.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)>=rF.tickThreshold,i=FF(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!==AP.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=PF(j-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===DP.OBJECT,g=f===OP.NUMBER,_=g&&m||n===0||n===1?-1:rF.precision,v,y;if(g)v=y=i(FF(IF(o._fromNumber,o._toNumber,n),_));else if(f===OP.UNIT)y=i(FF(IF(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===OP.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(IF(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${FF(e[0],0)},${FF(e[1],0)},${FF(e[2],0)},${e[3]})`)}else f===OP.COMPLEX&&(v=uI(o,n,_));if(h&&(o._number=y),!r&&e!==AP.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===DP.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===DP.TRANSFORM?(s!==l&&(l=s,u=s[PP]),u[e]=v,d=1):p===DP.CSS?c[e]=v:p===DP.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=GF(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},fI=(e,t,n,r,i)=>{let a=e._currentIteration;if(dI(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=sF(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;VF(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&dI(t,e,n,1,kP.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)}VF(o,e=>{let t=FF((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+=dI(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))))}},pI={},mI=(e,t,n)=>{if(n===DP.TRANSFORM)return BP.get(e)||e;if(n===DP.CSS||n===DP.ATTRIBUTE&&hF(t)&&e in t.style){let t=pI[e];if(t)return t;{let t=e&&aF(e);return pI[e]=t,t}}return e},hI=(e,t=!1)=>{if(e._hasChildren)VF(e,e=>hI(e,t),!0);else{let n=e;n.pause(),VF(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=mF(o)||o===``;if(e._setter){if(!t&&!s){if(sI(o,lI),lI.d){let t=lI.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=lI.n;e._setter(e.target,e._number,e)}}else if(a===DP.OBJECT)!t&&!s&&(i[r]=o);else if(i[MP]){if(a===DP.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===DP.TRANSFORM){let n=i[PP];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=GF(n):t.removeProperty(`transform`))}else s?t.removeProperty(aF(r)):t[r]=o}}i[MP]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},gI=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=RP/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?IP:t,r=RP/n;n>tF.frameRate&&(tF.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?IP:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?kP.NONE:(this._lastTickTime=n>=t?e-n%t:e,kP.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},_I={animation:null,update:UP},vI=e=>{let t=_I.animation;return t||(t={duration:IP,computeDeltaTime:UP,_offset:0,_delay:0,_head:null,_tail:null},_I.animation=t,_I.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===OP.COMPLEX||e===OP.COLOR?zF(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}}}),dI(t,1,1,0,kP.FORCE)}),t},yI=wP?requestAnimationFrame:setImmediate,cte=wP?cancelAnimationFrame:clearImmediate,lte=class extends gI{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=tF,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=sF();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?(HF(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):fI(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):kP.AUTO),r=i}_I.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(sF()),this.reqId=yI(xI)),this}pause(){if(this.reqId)return this.paused=!0,ute()}resume(){if(this.paused)return this.paused=!1,VF(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(rF.timeScale===1?1:RP)}set speed(e){let t=e*rF.timeScale;this._speed!==t&&(this._speed=t,VF(this,e=>e.speed=e._speed))}get timeUnit(){return rF.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(rF.timeScale!==r){rF.timeScale=r,rF.tickThreshold=200*r;let e=n?t:RP;this.defaults.duration*=e,this._speed*=e}}get precision(){return rF.precision}set precision(e){rF.precision=e}},bI=(()=>{let e=new lte(sF());return wP&&(iF.engine=e,EP.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(EP.hidden?e.pause():e.resume())})),e})(),xI=()=>{bI._head?(bI.reqId=yI(xI),bI.update()):bI.reqId=0},ute=()=>(cte(bI.reqId),bI.reqId=0,bI),SI={_rep:new WeakMap,_add:new Map},CI=(e,t,n=`_rep`)=>{let r=SI[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},dte=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,wI=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=IP,e._currentTime=IP},TI=(e,t)=>{let n=e._composition;if(n===AP.replace){let n=e._absoluteStartTime;UF(t,e,dte,`_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){wI(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)wI(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=FF(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&wI(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(VF(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;VF(e,e=>{e!==t&&VF(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===AP.blend){let t=CI(e.target,e.property,`_add`),n=vI(SI._add),r=t._head;r||(r={...e},r._composition=AP.replace,r._updateDuration=IP,r._startTime=0,r._numbers=zF(e._fromNumbers),r._number=0,r._next=null,r._prev=null,UF(t,r),UF(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=zF(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=zF(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}UF(t,e,null,`_prevAdd`,`_nextAdd`)}return e},fte=e=>{let t=e._composition;if(t!==AP.none){let n=e.target,r=e.property,i=SI._rep.get(n)[r];if(HF(i,e,`_prevRep`,`_nextRep`),t===AP.blend){let t=SI._add,i=t.get(n);if(!i)return;let a=i[r],o=_I.animation;HF(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){HF(a,s,`_prevAdd`,`_nextAdd`),HF(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},EI=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),DI=e=>e._cancelled?(e._hasChildren?VF(e,DI):VF(e,e=>{e._composition!==AP.none&&TI(e,CI(e.target,e.property))}),e._cancelled=0,e):e,OI=0,pte=(e,t)=>e._priority>t._priority,mte=class extends gI{constructor(e={},t=null,n=0){super(0),++OI;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;nF.current&&nF.current.register(this);let b=t?0:bI._lastTickTime,x=t?t.defaults:rF.defaults,S=fF(i)||pF(i)?x.delay:+i,C=fF(a)||pF(a)?1/0:+a,w=$F(c,x.loop),T=$F(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(bI.reqId||bI.requestTick(sF()),D=(bI._lastTickTime-bI._startTime)*rF.timeScale),this.id=pF(r)?OI:r,this.parent=t,this.duration=LF((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&&$F(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=UP,this._running=!1,this._reversed=+$F(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=$F(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=$F(d,x.frameRate),this._speed=$F(f,x.playbackRate),this._priority=+$F(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return PF(FF(this._currentTime,rF.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return PF(FF(this._iterationTime,rF.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return PF(FF(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return PF(FF(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*PF(+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 DI(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,fI(this,0,1,~~e,kP.FORCE),EI(this),this._hasChildren&&VF(this,EI),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&fI(this,this.duration,1,~~e,kP.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!pF(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*bI._speed);return this._startTime=sF()-(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?fI(this,IP,0,0,kP.FORCE):(this._running||=(UF(bI,this,pte),bI._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,bI.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){DI(this),this.completed=!1;let r=this.paused;return this.paused=!0,fI(this,e+this._delay,~~t,~~n,kP.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?AF(LP/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?VF(this,e=>e.cancel(),!0):VF(this,fte),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=RF(e);if(t===n)return this;let r=e/t,i=e<=IP;return this.duration=i?IP:n,this.iterationDuration=i?IP:RF(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){fI(this,0,1,0,kP.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=UP){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=UP};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function kI(e){let t=dF(e)?nF.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function hte(e){if(mF(e))return[];if(!wP)return cF(e)&&e.flat(1/0)||[e];if(cF(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!mF(r)){let e=kI(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!mF(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=kI(e);return t?Array.from(t):[e]}function gte(e){let t=hte(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[jP]){n[jP]=!0;let e=hF(n);(n.nodeType||e)&&(n[MP]=!0,n[NP]=e,n[PP]={})}}return t}var AI={deg:1,rad:180/MF,turn:360},jI={},MI=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===OP.UNIT&&i===n)return t;let o=a+i+n,s=jI[o];if(!pF(s)&&!r)t.n=s;else{let r;if(i in AI)r=a*AI[i]/AI[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==EP?o:EP.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,jI[o]=r}return t.t,OP.UNIT,t.u=n,t},NI=e=>e,PI=(e=1.68)=>t=>CF(t,+e),FI={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},_te=MF/2,II=MF*2,LI={"":PI,Quad:PI(2),Cubic:PI(3),Quart:PI(4),Quint:PI(5),Sine:e=>1-EF(e*_te),Circ:e=>1-wF(1-e*e),Expo:e=>e?CF(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=CF(2,--n))-1)/11;);return 1/CF(4,3-n)-7.5625*CF((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=PF(+e,1,10),r=PF(+t,IP,2),i=r/II*jF(1/n),a=II/r;return e=>e===0||e===1?e:-n*CF(2,-10*(1-e))*TF((1-e-i)*a)}},RI=(()=>{let e={linear:NI,none:NI};for(let t in FI)for(let n in LI){let r=LI[n],i=FI[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),zI={linear:NI,none:NI},vte=e=>{if(zI[e])return zI[e];if(e.indexOf(`(`)<=-1){let t=FI[e]||e.includes(`Back`)||e.includes(`Elastic`)?RI[e]():RI[e];return t?zI[e]=t:NI}{let t=e.slice(0,-1).split(`(`),n=RI[t[0]];return n?zI[e]=n(...t[1].split(`,`)):NI}},BI=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],VI=e=>{if(dF(e)){for(let t=0,n=BI.length;t<n;t++)if(oF(e,BI[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}\``),NI}return fF(e)?e:dF(e)?vte(e):NI},HI=oI(),UI=oI(),WI={},GI={func:null},KI={func:null},qI=[null],JI=[null,null],YI={to:null},yte=0,XI=0,ZI,QI,bte=(e,t)=>{let n={};if(cF(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(bF);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];bF(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=$F(t.duration,rF.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(bF(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},xte=class extends mte{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++XI;let s=gte(e),c=s.length,l=t.keyframes,u=l?BF(bte(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:rF.defaults,b=$F(m,y.ease),x=$F(h,y.playbackEase),S=x?VI(x):null,C=!pF(b.ease),w=C?b.ease:$F(m,S?`linear`:y.ease),T=C?b.settlingDuration:$F(p,y.duration),E=$F(f,y.delay),D=g||y.modifier,O=pF(_)&&c>=1e3?AP.none:pF(_)?y.composition:_,k=this._offset+(n?n._offset:0);C&&(b.parent=this);let A=NaN,j=NaN,M=0,N=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(bF(e)){let a=nI(t,e),o=qF(t,e),s=mI(e,t,a),f=u[e],p=cF(f);if(i&&!p&&(JI[0]=f,JI[1]=f,f=JI),p){let e=f.length,t=!lF(f[0]);e===2&&t?(YI.to=f,qI[0]=YI,ZI=qI):e>2&&t?(ZI=[],f.forEach((e,t)=>{t?t===1?(JI[1]=e,ZI.push(JI)):ZI.push(e):JI[0]=e})):ZI=f}else qI[0]=f,ZI=qI;let m=null,h=null,g=NaN,_=0,v=0;for(let e=ZI.length;v<e;v++){let i=ZI[v];lF(i)?QI=i:(YI.to=i,QI=YI),GI.func=null,KI.func=null;let l=tI($F(QI.composition,O),t,r,c,null,null),u=uF(l)?l:AP[l];!m&&u!==AP.none&&(m=CI(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=tI(QI.to,t,r,c,GI,f),y;lF(p)&&!pF(p.to)?(QI=p,y=p.to):y=p;let b=tI(QI.from,t,r,c,KI,f),x=QI.ease||w,S=tI(x,t,r,c,null,f),C=fF(S)||dF(S)?S:x,A=!pF(C)&&!pF(C.ease),j=A?C.ease:C,P=A?C.settlingDuration:tI($F(QI.duration,e>1?tI(T,t,r,c,null,f)/e:T),t,r,c,null,f),F=tI($F(QI.delay,v?0:E),t,r,c,null,f),I=QI.modifier||D,L=!pF(b),R=!pF(y),z=cF(y),ee=z||L&&R,te=h?_:0,ne=h?_+F:F,B=FF(k+ne,12),re=FF(k+te,12);!N&&(L||z)&&(N=1);let V=h;if(u!==AP.none){let e=m._head;for(;e&&e._absoluteStartTime<=B;)if(e._isOverridden||(V=e),e=e._nextRep,e&&e._absoluteStartTime>=B)for(;e;)wI(e),e=e._nextRep}if(ee){sI(z?tI(y[0],t,r,c,KI,f):b,HI),sI(z?tI(y[1],t,r,c,GI,f):y,UI);let e=iI(t,s,a,WI);HI.t===OP.NUMBER&&(V?V._valueType===OP.UNIT&&(HI.t=OP.UNIT,HI.u=V._unit):(sI(e,lI),lI.t===OP.UNIT&&(HI.t=OP.UNIT,HI.u=lI.u)))}else R?sI(y,UI):h?cI(h,UI):sI(n&&V&&V.parent.parent===n?V._value:iI(t,s,a,WI),UI),L?sI(b,HI):h?cI(h,HI):sI(n&&V&&V.parent.parent===n?V._value:iI(t,s,a,WI),HI);if(HI.o&&(HI.n=aI(V?V._toNumber:sI(iI(t,s,a,WI),lI).n,HI.n,HI.o)),UI.o&&(UI.n=aI(HI.n,UI.n,UI.o)),HI.t!==UI.t){if(HI.t===OP.COMPLEX||UI.t===OP.COMPLEX){let e=HI.t===OP.COMPLEX?HI:UI,t=HI.t===OP.COMPLEX?UI:HI;t.t=OP.COMPLEX,t.s=zF(e.s),t.d=e.d.map(()=>t.n)}else if(HI.t===OP.UNIT||UI.t===OP.UNIT){let e=HI.t===OP.UNIT?HI:UI,t=HI.t===OP.UNIT?UI:HI;t.t=OP.UNIT,t.u=e.u}else if(HI.t===OP.COLOR||UI.t===OP.COLOR){let e=HI.t===OP.COLOR?HI:UI,t=HI.t===OP.COLOR?UI:HI;t.t=OP.COLOR,t.d=e.d.map(()=>0)}}if(HI.u!==UI.u){let e=UI.u?HI:UI;e=MI(t,e,UI.u?UI.u:HI.u,!1)}if(UI.d&&HI.d&&UI.d.length!==HI.d.length){let e=HI.d.length>UI.d.length?HI:UI,t=e===HI?UI:HI;t.d=e.d.map((e,n)=>pF(t.d[n])?0:t.d[n]),t.s=zF(e.s)}let H=FF(+P||1e-11,12),ie=WI[s];mF(ie)||(WI[s]=null);let ae=o?o.set:null;_=FF(ne+H,12);let oe=HI.d,se=UI.d,ce=UI.s,le={parent:this,id:yte++,property:s,target:t,_value:null,_toFunc:GI.func,_fromFunc:KI.func,_ease:VI(j),_fromNumbers:oe?zF(oe):zP,_toNumbers:se?zF(se):zP,_strings:ce?zF(ce):zP,_fromNumber:HI.n,_toNumber:UI.n,_numbers:oe?zF(oe):zP,_number:HI.n,_unit:UI.u,_modifier:I,_currentTime:0,_startTime:ne,_delay:+F,_updateDuration:H,_changeDuration:H,_absoluteStartTime:B,_absoluteUpdateStartTime:re,_absoluteEndTime:FF(k+_,12),_hasFromValue:L||z?1:0,_tweenType:a,_setter:ae,_valueType:UI.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:ie,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==AP.none&&TI(le,m);let U=le._valueType;if(U===OP.COMPLEX)le._value=uI(le,1,-1);else if(U===OP.UNIT)le._value=`${I(le._toNumber)}${le._unit}`;else if(U===OP.COLOR){let e=UI.d;le._value=`rgba(${FF(e[0],0)},${FF(e[1],0)},${FF(e[2],0)},${e[3]})`}else le._value=I(le._toNumber);isNaN(g)&&(g=le._startTime),h=le,M++,UF(this,le)}(isNaN(j)||g<j)&&(j=g),(isNaN(A)||_>A)&&(A=_),a===DP.TRANSFORM&&(l=M-v,d=M)}if(!isNaN(l)){let e=0;VF(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===AP.blend&&VF(_I.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?(VF(this,e=>{e._startTime-e._delay||(e._delay-=j),e._startTime-=j}),A-=j):j=0,A||(A=IP,this.iterationCount=0),this.targets=s,this.id=pF(d)?XI:d,this.duration=A===1e-11?IP:LF((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&&N&&this.onRender(this)}stretch(e){let t=this.duration;if(t===RF(e))return this;let n=e/t;return VF(this,e=>{e._updateDuration=RF(e._updateDuration*n),e._changeDuration=RF(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 VF(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(sI(n(),HI),HI.u!==e._unit&&e.target[MP]&&MI(e.target,HI,e._unit,!0),e._fromNumbers=zF(HI.d),e._fromNumber=HI.n):t&&(sI(iI(e.target,e.property,e._tweenType),lI),e._fromNumbers=zF(lI.d),e._fromNumber=lI.n),t&&(sI(t(),UI),e._toNumbers=zF(UI.d),e._strings=zF(UI.s),e._toNumber=UI.o?aI(e._fromNumber,UI.n,UI.o):UI.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),hI(this)}then(e){return super.then(e)}},$I=(e,t)=>rF.editor?rF.editor.addAnimation(e,t):new xte(e,t,null,0,!1).init(),eL=RP*10,Ste=class{constructor(e={}){let t=!pF(e.bounce)||!pF(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/RP,this.maxIterations=this.maxDuration/this.timeStep/RP,this.bn=PF($F(e.bounce,.5),-1,1),this.pd=PF($F(e.duration,628),10*rF.timeScale,eL*rF.timeScale),this.m=PF($F(e.mass,1),1,eL),this.s=PF($F(e.stiffness,100),IP,eL),this.d=PF($F(e.damping,10),IP,eL),this.v=PF($F(e.velocity,0),-eL,eL),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||UP,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?OF(-a*t*n)*(1*EF(r*a)+i*TF(r*a)):t===1?(1+i*a)*OF(-a*n):((1+i)*OF((-t*n+r)*a)+(1-i)*OF((-t*n-r)*a))/2,1-a}calculateSDFromBD(){let e=rF.timeScale===1?this.pd/RP:this.pd;this.m=1,this.v=0,this.s=CF(2*MF/e,2),this.d=this.bn>=0?(1-this.bn)*4*MF/e:4*MF/(e*(1+this.bn)),this.s=FF(PF(this.s,IP,eL),3),this.d=FF(PF(this.d,IP,300),3)}calculateBDFromSD(){let e=2*MF/wF(this.s);this.pd=e*(rF.timeScale===1?RP:1),this.bn=this.d/(2*wF(this.s))<=1?1-this.d*e/(4*MF):4*MF/(this.d*e)-1,this.bn=FF(PF(this.bn,-1,1),3),this.pd=FF(PF(this.pd,10*rF.timeScale,eL*rF.timeScale),3)}compute(){let{maxRestSteps:e,maxIterations:t,restThreshold:n,timeStep:r,m:i,d:a,s:o,v:s}=this,c=this.w0=PF(wF(o/i),IP,RP),l=this.zeta=a/(2*wF(o*i));l<1?(this.wd=c*wF(1-l*l),this.b=(l*c+-s)/this.wd):l===1?(this.wd=0,this.b=-s+c):(this.wd=c*wF(l*l-1),this.b=(l*c+-s)/this.wd);let u=0,d=0,f=0;for(;d<=e&&f<=t;)DF(1-this.solve(u))<n?d++:d=0,this.solverDuration=u,u+=r,f++;this.settlingDuration=FF(this.solverDuration*RP,0)*rF.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=PF($F(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=PF($F(e,1),10*rF.timeScale,eL*rF.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=PF($F(e,100),IP,eL),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=PF($F(e,10),IP,eL),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=PF($F(e,1),1,eL),this.compute()}get velocity(){return this.v}set velocity(e){this.v=PF($F(e,0),-eL,eL),this.compute()}},tL=e=>new Ste(e),nL=(e=10,t)=>{let n=t?kF:AF;return t=>n(PF(t,0,1)*e)*(1/e)},Cte=s({animate:()=>$I,spring:()=>tL}),rL=(0,f.forwardRef)(function({id:e,transform:t},n){return(0,J.jsxs)(`radialGradient`,{ref:n,id:e,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`-1.6`,r:`5.6`,gradientTransform:t,children:[(0,J.jsx)(`stop`,{offset:`0`,stopColor:`color-mix(in oklab, var(--color-white) calc(var(--depth) * 50%), currentColor)`}),(0,J.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`})]})});function iL({id:e}){return(0,J.jsx)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,J.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1`,floodColor:`currentColor`,style:{floodOpacity:`calc(var(--depth) * 0.6)`}})})}function aL({id:e}){return(0,J.jsxs)(`filter`,{id:e,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,J.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.3`,result:`soft-edge`}),(0,J.jsx)(`feOffset`,{in:`soft-edge`,dx:`0.25`,dy:`0.45`,result:`lower-edge`}),(0,J.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`lower-edge`,operator:`out`,result:`inner-shadow`}),(0,J.jsx)(`feFlood`,{floodColor:`var(--color-black)`,floodOpacity:`calc(var(--depth) * 0.28)`}),(0,J.jsx)(`feComposite`,{in2:`inner-shadow`,operator:`in`,result:`shade`}),(0,J.jsx)(`feOffset`,{in:`soft-edge`,dx:`-0.2`,dy:`-0.35`,result:`upper-edge`}),(0,J.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`upper-edge`,operator:`out`,result:`inner-highlight`}),(0,J.jsx)(`feFlood`,{floodColor:`var(--color-white)`,floodOpacity:`calc(var(--depth) * 0.7)`}),(0,J.jsx)(`feComposite`,{in2:`inner-highlight`,operator:`in`,result:`highlight`}),(0,J.jsxs)(`feMerge`,{children:[(0,J.jsx)(`feMergeNode`,{in:`SourceGraphic`}),(0,J.jsx)(`feMergeNode`,{in:`shade`}),(0,J.jsx)(`feMergeNode`,{in:`highlight`})]})]})}var oL=Object.freeze({alphaIntercept:-8,alphaSlope:18,blurStdDeviation:2});function sL({id:e,values:t=AM}){return(0,J.jsxs)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,J.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t.blurStdDeviation,result:`blur`}),(0,J.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,J.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`gooey`,operator:`atop`})]})}function cL(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 lL(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function uL(e,t){let n=Math.max(0,Math.min(1,(t-(e-1)*.085)/.68));return Math.sin(n*Math.PI)**2}function dL(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=lL(n/.66)*Math.PI*2,o=Math.min(e,t*Math.PI/8)-Math.PI/2,s=lL((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+uL(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=uL(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 wte={line:1700,square:1900,donut:3e3,wander:4600,bloom:2800};function Tte({variant:e}){let t=`caps-loader-${(0,f.useId)().replaceAll(`:`,``)}`,n=(0,f.useRef)(null),r=(0,f.useRef)(null),i=fP(r),{reduced:a}=i,o=e===`donut`?16:e===`bloom`?5:e===`square`?4:3;return(0,f.useLayoutEffect)(()=>{if(a||!n.current||!r.current)return;let t=[...n.current.querySelectorAll(`ellipse`)].map((t,n)=>$I(t,{keyframes:Array.from({length:48},(t,r)=>({...dL(e,n,(r+1)/48),duration:pP(i,wte[e])/48})),ease:`linear`,loop:!0})),o=cL(r.current,e=>{for(let n of t)e?n.resume():n.pause()});return()=>{o();for(let e of t)e.revert()}},[e,a,i]),(0,J.jsxs)(`svg`,{ref:r,"aria-hidden":`true`,focusable:`false`,viewBox:e===`line`?`-20 -10 40 20`:`-20 -20 40 40`,children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsx)(sL,{id:t,values:oL}),(0,J.jsx)(rL,{id:`${t}-surface`,transform:e===`line`?`matrix(3.4 0 0 1.4 0 0)`:`matrix(3 0 0 3 0 0)`}),(0,J.jsx)(iL,{id:`${t}-shadow`}),(0,J.jsx)(`mask`,{id:`${t}-mask`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`40`,height:`40`,style:{maskType:`alpha`},children:(0,J.jsx)(`g`,{ref:n,fill:`currentColor`,filter:`url(#${t})`,children:Array.from({length:o},(t,n)=>(0,J.jsx)(`ellipse`,{...dL(e,n,0)},n))})})]}),(0,J.jsx)(`g`,{filter:`url(#${t}-shadow)`,children:(0,J.jsx)(`rect`,{x:`-20`,y:`-20`,width:`40`,height:`40`,fill:`url(#${t}-surface)`,mask:`url(#${t}-mask)`})})]})}var Ete={sm:`caps-loader-sm`,md:`caps-loader-md`,lg:`caps-loader-lg`,fill:`caps-loader-fill`},Dte={neutral:`text-base-content`,accent:`text-accent`,primary:`text-primary`,success:`text-success`},fL=(0,f.forwardRef)(function({"aria-label":e,"aria-labelledby":t,className:n,decorative:r=!1,label:i=`Loading`,size:a=`md`,variant:o=`line`,tone:s=`neutral`,...c},l){let u=`${(0,f.useId)()}-label`,d=!r&&e===void 0&&t===void 0;return(0,J.jsxs)(`span`,{...c,"aria-label":r?void 0:e,"aria-hidden":r||void 0,"aria-labelledby":r?void 0:t??(e===void 0?u:void 0),className:Z(`caps-loader`,Ete[a],Dte[s],n),"data-variant":o,role:r?void 0:`status`,ref:l,children:[(0,J.jsx)(Tte,{variant:o}),d?(0,J.jsx)(CP,{id:u,children:i}):null]})}),pL=`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`,Ote=IM(`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 ${pL}`,ghost:`btn-ghost`,"ghost-destructive":`btn-ghost caps-button-ghost-destructive`,link:`btn-link ${pL}`},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`}}),mL=(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 p=Z(Ote({size:c,variant:l}),n),m=(0,f.useRef)(a).current,h=(0,f.useRef)(null);return(0,f.useImperativeHandle)(d,()=>h.current),kte(h,[i,a,t]),e?(0,J.jsx)(vM,{...u,"aria-busy":i?!0:u[`aria-busy`],"aria-disabled":r===!0||i?!0:void 0,className:p,ref:h,children:t}):(0,J.jsx)(`button`,{...u,"aria-busy":i?!0:u[`aria-busy`],className:p,disabled:r===!0||i,ref:h,type:u.type??`button`,children:a===void 0&&o===void 0?(0,J.jsxs)(J.Fragment,{children:[i?(0,J.jsx)(fL,{className:`size-3`,decorative:!0,size:`sm`}):null,t]}):(0,J.jsx)(Nte,{label:o,loading:i,onResultEnd:s,result:a,settled:m,children:t})})});function kte(e,t){let n=(0,f.useRef)(null),r=(0,f.useRef)(null);(0,f.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let i=r.current,a=i?t.getBoundingClientRect().width:n.current;i?.cancel(),r.current=null;let o=t.getBoundingClientRect().width;if(n.current=o,a===null||Math.abs(a-o)<1||!_P(t))return;let s=dP(t);if(s.reduced)return;let c=t.animate([{width:`${String(a)}px`},{width:`${String(o)}px`}],{duration:s.normal,easing:gP(s,s.ease)});r.current=c,t.style.overflow=`clip`,t.style.whiteSpace=`nowrap`;let l=()=>{r.current===c&&(r.current=null,t.style.removeProperty(`overflow`),t.style.removeProperty(`white-space`))};c.onfinish=l,c.oncancel=l},[e,...t])}var Ate=1100;function jte(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:gP(t,`ease-out`)})}function Mte(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:gP(t,`linear`)})}function hL(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:gP(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:gP(n,n.ease),fill:`backwards`})]}function Nte({children:e,label:t,loading:n,onResultEnd:r,result:i,settled:a}){let o=(0,f.useRef)(null),s=SP(),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(!1);c&&!u&&d(!0);let p=(0,f.useRef)(a),m=(0,f.useRef)(r);(0,f.useEffect)(()=>{m.current=r},[r]),(0,f.useLayoutEffect)(()=>{let e=p.current;if(p.current=i,i===e)return;if(i===`done`){l(!0);let e=setTimeout(()=>{m.current?m.current():l(!1)},Ate);return()=>{clearTimeout(e)}}l(!1);let t=o.current;if(i!==`failed`||!t||!_P(t))return;let n=dP(t);if(n.shake<=0)return;let r=Mte(t,n);return()=>{r.cancel()}},[i,s]);let h=(0,f.useRef)(c);return(0,f.useLayoutEffect)(()=>{let e=o.current;if(!e||h.current===c)return;h.current=c;let t=e.querySelector(`[data-face="label"]`),n=e.querySelector(`[data-face="result"]`);if(!t||!n||!_P(e)){c||d(!1);return}let r=dP(e),i=c?hL(t,n,r):hL(n,t,r);if(c||i[0]?.addEventListener(`finish`,()=>{d(!1)}),c&&!r.reduced){i.push(jte(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:gP(r,r.ease),fill:`backwards`}))}return()=>{for(let e of i)e.cancel()}},[c,s]),(0,J.jsxs)(`span`,{ref:o,className:`caps-button-faces`,"data-showing":c?`result`:`label`,children:[(0,J.jsxs)(`span`,{className:`caps-button-face`,"data-face":`label`,"aria-hidden":c?!0:void 0,children:[n||c?(0,J.jsx)(fL,{className:`size-3`,decorative:!0,size:`sm`}):null,e]}),u?(0,J.jsxs)(`span`,{className:`caps-button-face`,"data-face":`result`,"aria-hidden":!c||void 0,children:[(0,J.jsx)(`svg`,{className:`caps-button-check`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,J.jsx)(`path`,{d:`M4.5 12.5 9.5 17.5 19.5 6.5`,pathLength:1})}),t===void 0?e:t]}):null]})}var Pte={xs:`size-3`,sm:`size-[var(--stipe-icon-size-sm)]`,md:`size-[var(--stipe-icon-size-md)]`,lg:`size-[var(--stipe-icon-size-lg)]`},gL=(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,J.jsx)(mL,{...c,resultLabel:c.result===void 0?void 0:null,ref:l,size:u?`sm`:a,variant:s,className:Z(`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,J.jsx)(`span`,{"aria-hidden":`true`,className:Z(`inline-flex shrink-0 [&>svg]:size-full [&>svg]:[stroke-width:var(--stipe-icon-stroke)]`,Pte[n]),children:t})})}),_L=(0,f.forwardRef)(function({className:e,size:t=`md`,depth:n=`shallow`,placement:r=`standalone`,...i},a){return(0,J.jsx)(`div`,{...i,ref:a,"data-surface-size":t,"data-surface-depth":n,"data-surface-placement":r,className:Z(`caps-surface`,e)})}),vL=(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(`div`,{...t,ref:n,className:Z(`caps-screen`,e)})});(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,J.jsx)(_L,{...a,className:Z(t,s&&`flex min-h-0 flex-1`),depth:n,ref:o,children:(0,J.jsx)(`div`,{className:Z(`caps-display-gasket`,s&&`flex min-h-0 min-w-0 flex-1`),"data-display-density":i,children:(0,J.jsx)(vL,{className:Z(s&&`flex min-h-0 min-w-0 flex-1 overflow-hidden`),children:e})})})}),(0,f.forwardRef)(function({className:e,icon:t,status:n,title:r,...i},a){return(0,J.jsxs)(`header`,{...i,className:Z(`caps-screen-header`,e),ref:a,children:[t?(0,J.jsx)(`span`,{className:`caps-screen-header-icon`,"aria-hidden":`true`,children:t}):null,(0,J.jsx)(`span`,{className:`caps-screen-header-title`,children:r}),n?(0,J.jsx)(`span`,{className:`caps-screen-header-status`,children:n}):null]})}),(0,f.forwardRef)(function({appearance:e,className:t,...n},r){return(0,J.jsx)(`div`,{...n,className:Z(`caps-screen-cells`,t),"data-appearance":e===`compact`?e:void 0,ref:r})}),(0,f.forwardRef)(function({children:e,className:t,legend:n,readout:r,icon:i,appearance:a,wide:o=!1,...s},c){return(0,J.jsxs)(`div`,{...s,className:Z(`caps-screen-cell`,t),"data-wide":o||void 0,"data-appearance":a===`compact`?a:void 0,ref:c,children:[i?(0,J.jsx)(`span`,{className:`caps-screen-cell-icon`,children:i}):null,n?(0,J.jsx)(`span`,{className:`caps-screen-cell-legend`,children:n}):null,r?(0,J.jsx)(`span`,{className:`caps-screen-cell-readout`,children:r}):null,a===`compact`?(0,J.jsx)(`div`,{className:`caps-screen-cell-controls`,children:e}):e]})});var Fte=(0,f.forwardRef)(function({className:e,density:t=`regular`,...n},r){return(0,J.jsx)(`ul`,{...n,className:Z(`list`,t===`compact`&&`list-sm`,e),ref:r})}),yL=(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(`li`,{...t,className:Z(`list-row`,e),ref:n})}),bL=(0,f.forwardRef)(function({aside:e,children:t,className:n,level:r=2,...i},a){return(0,J.jsxs)(r===3?`h3`:`h2`,{...i,className:Z(`caps-data-list-heading`,n),ref:a,children:[(0,J.jsx)(`span`,{children:t}),e===void 0?null:(0,J.jsx)(`span`,{className:`caps-data-list-heading-aside`,children:e})]})}),Ite=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),xL=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Lte={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`},Rte=(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,...Lte,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xL(`lucide`,i),...s},[...o.map(([e,t])=>(0,f.createElement)(e,t)),...Array.isArray(a)?a:[a]])),SL=(e,t)=>{let n=(0,f.forwardRef)(({className:n,...r},i)=>(0,f.createElement)(Rte,{ref:i,iconNode:t,className:xL(`lucide-${Ite(e)}`,n),...r}));return n.displayName=`${e}`,n},zte=SL(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),CL=SL(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),wL=SL(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Bte=SL(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Vte=SL(`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`}]]),Hte=SL(`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`}]]),Ute=SL(`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`}]]),Wte=SL(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),TL=SL(`ImagePlus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Gte=SL(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Kte=SL(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),qte=SL(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),EL=SL(`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`}]]),DL=SL(`SlidersHorizontal`,[[`line`,{x1:`21`,x2:`14`,y1:`4`,y2:`4`,key:`obuewd`}],[`line`,{x1:`10`,x2:`3`,y1:`4`,y2:`4`,key:`1q6298`}],[`line`,{x1:`21`,x2:`12`,y1:`12`,y2:`12`,key:`1iu8h1`}],[`line`,{x1:`8`,x2:`3`,y1:`12`,y2:`12`,key:`ntss68`}],[`line`,{x1:`21`,x2:`16`,y1:`20`,y2:`20`,key:`14d8ph`}],[`line`,{x1:`12`,x2:`3`,y1:`20`,y2:`20`,key:`m0wm8r`}],[`line`,{x1:`14`,x2:`14`,y1:`2`,y2:`6`,key:`14e1ph`}],[`line`,{x1:`8`,x2:`8`,y1:`10`,y2:`14`,key:`1i6ji0`}],[`line`,{x1:`16`,x2:`16`,y1:`18`,y2:`22`,key:`1lctlv`}]]),OL=SL(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),kL=SL(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),AL=XS(WC(Y({error:nC(`too_large`)})));async function jL(e,t){let n,r=()=>n??=e.close(),i=()=>{r().catch(e=>{Pf(`files.read.abort-close`,e)})};t.signal?.addEventListener(`abort`,i,{once:!0});try{t.signal?.throwIfAborted();let n=await e.response();try{let e=QS(yC(Response))(n);if(e.status===413)throw new K(`App file exceeds the read bound`,{code:AL(await e.text())._tag===`Some`?`FILE_TOO_LARGE`:`PROTOCOL`,retryable:!1});if(!e.ok)throw Error(`App file unavailable (${String(e.status)})`);let r=await e.blob();return t.signal?.throwIfAborted(),new File([r],t.name,{type:r.type,lastModified:0})}finally{FA(n)}}finally{t.signal?.removeEventListener(`abort`,i);try{await r()}finally{e[Symbol.dispose]()}}}async function ML(e,t,n){let r,i=()=>r??=e.close(),a=()=>{i().catch(e=>{Pf(`files.write.abort-close`,e)})};n.signal?.addEventListener(`abort`,a,{once:!0});try{n.signal?.throwIfAborted(),await e.write(t.stream())}finally{n.signal?.removeEventListener(`abort`,a);try{await i()}catch(e){Pf(`files.write.remote-close`,e)}try{e[Symbol.dispose]()}catch(e){Pf(`files.write.local-dispose`,e)}}}var NL=Y({path:oC,entries:dC(Y({name:oC,type:mC([`file`,`directory`,`symlink`]),size:sC,modifiedAt:sC})),nextOffset:hC(sC)}),PL=Nj(`computer.list`,1,js(()=>Pj({list:Ij(Fj(Bo().transform(e=>QS(NL)(e))))}))),FL=pC([Y({state:mC([`running`,`sleeping`,`starting`])}),Y({state:nC(`queued`),position:sC.pipe(X(FC()),X(jC(0)))})]),IL=Y({enabled:cC,effective:cC,blockedBy:hC(mC([`team`,`global`]))}),LL=Y({computerId:HC,name:HC,runtime:FL,backends:dC(Y({id:HC,kind:mC([`platform-container`,`on-box-vm`,`local`]),status:mC([`ready`,`queued`,`online`,`offline`]),queuePosition:hC(sC.pipe(X(FC()),X(jC(0)))),hostId:hC(oC),hostLabel:hC(oC),folderLabel:hC(oC),detachable:cC})),internet:IL});Nj(`computer.instrument.read`,1,js(()=>Pj({read:Ij(Fj(Bo().transform(e=>QS(LL)(e))))}))),Nj(`computer.instrument.control`,1,js(()=>Pj({start:Ij(Fj(Bo().transform(e=>QS(FL)(e)))),setInternetAccess:Ij(Fj(Bo().transform(e=>QS(IL)(e)))),detachLocal:Ij(Fj(Bo().transform(e=>QS(Y({detached:cC}))(e))))})));var RL=pC([Y({ports:dC(Y({port:sC.pipe(X(FC()),X(PC({minimum:1,maximum:65535}))),previewUrl:HC,openMode:mC([`inline`,`external-only`]),expiresAt:sC.pipe(X(FC()),X(jC(0)))})).pipe(X(BC(64)))}),Y({error:nC(`port_previews_not_configured`)})]),zL=Y({port:sC.annotate({message:`Use a port from 1 to 65535.`}).check(FC({message:`Use a port from 1 to 65535.`}),PC({minimum:1,maximum:65535},{message:`Use a port from 1 to 65535.`})),exposed:cC}),BL=Y({port:sC.pipe(X(FC()),X(PC({minimum:1,maximum:65535}))),removed:cC});Nj(`computer.ports`,2,js(()=>Pj({list:Ij(Fj(Bo().transform(e=>QS(RL)(e)))),expose:Ij(Fj(Bo().transform(e=>QS(zL)(e)))),unexpose:Ij(Fj(Bo().transform(e=>QS(BL)(e))))})));var VL=mC([`synced`,`pending`,`unknown`]),HL=Y({port:hC(zL.fields.port),id:HC,command:HC,cwd:hC(oC),startedAt:sC.pipe(X(FC()),X(MC(0))),state:mC([`running`,`exited`,`uncertain`]),exitCode:hC(sC.pipe(X(FC()))),sync:VL,endedAt:hC(sC.pipe(X(FC()),X(MC(0))))}),UL=Y({processes:dC(HL)}),WL=Y({process:HL,signalled:cC});Y({requestId:HC.pipe(X(BC(256))),command:HC.pipe(X(BC(16384))),cwd:eC(oC),port:eC(zL.fields.port)}),Nj(`computer.processes`,1,js(()=>Pj({start:Ij(Fj(Bo().transform(e=>QS(HL)(e)))),list:Ij(Fj(Bo().transform(e=>QS(UL)(e)))),kill:Ij(Fj(Bo().transform(e=>QS(WL)(e))))})));var GL=Nj(`computer.readFile`,1,js(()=>Pj({open:Ij(Pj({response:Ij(zs(Response)),close:Lj}))})));async function KL(e,t,n){return await jL(await e.require(GL).open(t),{...n,name:t.path.split(`/`).at(-1)??`file`})}async function qL(e,t){return QS(NL)(await e.require(PL).list(t))}var JL=Nj(`computer.writeFile`,3,js(()=>Pj({open:Ij(Pj({write:Lj,close:Lj})),mkdir:Lj,replace:Ij(Fj(Bo().transform(e=>QS(YL)(e))))}))),YL=pC([Y({kind:nC(`replaced`),path:HC,bytes:sC.pipe(X(FC()),X(MC(0)))}),Y({kind:nC(`conflict`)})]),XL=Y({computerName:HC.pipe(X(BC(256))),teamName:HC.pipe(X(BC(256))),modelDoor:HC.pipe(X(BC(256))),uptimeSeconds:sC.pipe(X(FC()),X(MC(0))),version:HC.pipe(X(BC(64)))});Nj(`computer.terminal`,2,js(()=>Pj({open:Ij(Pj({information:Ij(Fj(Bo().transform(e=>QS(XL)(e)))),output:Ij(zs(ReadableStream).transform(e=>e.pipeThrough(new TransformStream({transform(e,t){t.enqueue(zs(Uint8Array).parse(e))}})))),input:Ij(zs(WritableStream)),resize:Lj,close:Lj}))})));async function ZL(e,t,n){await ML(await e.require(JL).open({path:t.path}),t.content,n)}var QL=o((e=>{function t(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find==`function`)return n.find.call(e,t);for(var i=0;i<e.length;i++)if(r(e,i)){var a=e[i];if(t.call(void 0,a,i,e))return a}}function n(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors==`function`&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze==`function`?t.freeze(e):e}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function i(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var n in t)r(t,n)&&(e[n]=t[n]);return e}var a=n({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function o(e){return r(a,e.toLowerCase())}var s=n({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function c(e){return r(s,e.toLowerCase())}var l=n({script:!1,style:!1,textarea:!0,title:!0});function u(e){var t=e.toLowerCase();return r(l,t)&&!l[t]}function d(e){var t=e.toLowerCase();return r(l,t)&&l[t]}function f(e){return e===m.HTML}function p(e){return f(e)||e===m.XML_XHTML_APPLICATION}var m=n({HTML:`text/html`,XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),h=Object.keys(m).map(function(e){return m[e]});function g(e){return h.indexOf(e)>-1}var _=n({HTML:`http://www.w3.org/1999/xhtml`,SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.assign=i,e.find=t,e.freeze=n,e.HTML_BOOLEAN_ATTRIBUTES=a,e.HTML_RAW_TEXT_ELEMENTS=l,e.HTML_VOID_ELEMENTS=s,e.hasDefaultHTMLNamespace=p,e.hasOwn=r,e.isHTMLBooleanAttribute=o,e.isHTMLRawTextElement=u,e.isHTMLEscapableRawTextElement=d,e.isHTMLMimeType=f,e.isHTMLVoidElement=c,e.isValidMimeType=g,e.MIME_TYPE=m,e.NAMESPACE=_})),$L=o((e=>{var t=QL();function n(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var r=t.freeze({Error:`Error`,IndexSizeError:`IndexSizeError`,DomstringSizeError:`DomstringSizeError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NoDataAllowedError:`NoDataAllowedError`,NoModificationAllowedError:`NoModificationAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InUseAttributeError:`InUseAttributeError`,InvalidStateError:`InvalidStateError`,SyntaxError:`SyntaxError`,InvalidModificationError:`InvalidModificationError`,NamespaceError:`NamespaceError`,InvalidAccessError:`InvalidAccessError`,ValidationError:`ValidationError`,TypeMismatchError:`TypeMismatchError`,SecurityError:`SecurityError`,NetworkError:`NetworkError`,AbortError:`AbortError`,URLMismatchError:`URLMismatchError`,QuotaExceededError:`QuotaExceededError`,TimeoutError:`TimeoutError`,InvalidNodeTypeError:`InvalidNodeTypeError`,DataCloneError:`DataCloneError`,EncodingError:`EncodingError`,NotReadableError:`NotReadableError`,UnknownError:`UnknownError`,ConstraintError:`ConstraintError`,DataError:`DataError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,OperationError:`OperationError`,NotAllowedError:`NotAllowedError`,OptOutError:`OptOutError`}),i=Object.keys(r);function a(e){return typeof e==`number`&&e>=1&&e<=25}function o(e){return typeof e==`string`&&e.substring(e.length-r.Error.length)===r.Error}function s(e,t){a(e)?(this.name=i[e],this.message=t||``):(this.message=e,this.name=o(t)?t:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,s)}n(s,!0),Object.defineProperties(s.prototype,{code:{enumerable:!0,get:function(){var e=i.indexOf(this.name);return a(e)?e:0}}});for(var c={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},l=Object.entries(c),u=0;u<l.length;u++){var d=l[u][0];s[d]=l[u][1]}function f(e,t,n){this.message=e,this.locator=t,this.cause=n,Error.captureStackTrace&&Error.captureStackTrace(this,f)}n(f),e.DOMException=s,e.DOMExceptionName=r,e.ExceptionCode=c,e.ParseError=f})),eR=o((e=>{function t(e){try{typeof e!=`function`&&(e=RegExp);var t=new e(`𝌆`,`u`).exec(`𝌆`);return!!t&&t[0].length===2}catch{}return!1}var n=t();function r(e){if(e.source[0]!==`[`)throw Error(e+` can not be used with chars`);return e.source.slice(1,e.source.lastIndexOf(`]`))}function i(e,t){if(e.source[0]!==`[`)throw Error(`/`+e.source+`/ can not be used with chars_without`);if(!t||typeof t!=`string`)throw Error(JSON.stringify(t)+` is not a valid search`);if(e.source.indexOf(t)===-1)throw Error(`"`+t+`" is not is /`+e.source+`/`);if(t===`-`&&e.source.indexOf(t)!==1)throw Error(`"`+t+`" is not at the first postion of /`+e.source+`/`);return new RegExp(e.source.replace(t,``),n?`u`:``)}function a(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(e){var n=typeof e==`string`;if(n&&t===void 0&&e===`|`)throw Error("use regg instead of reg to wrap expressions with `|`!");return n?e:e.source}).join(``),n?`u`:``)}function o(e){if(arguments.length===0)throw Error(`no parameters provided`);return a.apply(o,[`(?:`].concat(Array.prototype.slice.call(arguments),[`)`]))}var s=`�`,c=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;n&&(c=a(`[`,r(c),`\\u{10000}-\\u{10FFFF}`,`]`));var l=RegExp(`[^`+r(c)+`]`,n?`u`:``),u=/[\x20\x09\x0D\x0A]/,d=r(u),f=a(u,`+`),p=a(u,`*`),m=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;n&&(m=a(`[`,r(m),`\\u{10000}-\\u{10FFFF}`,`]`));var h=a(`[`,r(m),r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),`]`),g=a(m,h,`*`),_=a(`^`,g,`$`),v=a(h,`+`),y=o(a(`&`,g,`;`),`|`,o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/)),b=a(`%`,g,`;`),x=o(a(`"`,o(/[^%&"]/,`|`,b,`|`,y),`*`,`"`),`|`,a(`'`,o(/[^%&']/,`|`,b,`|`,y),`*`,`'`)),S=o(`"`,o(/[^<&"]/,`|`,y),`*`,`"`,`|`,`'`,o(/[^<&']/,`|`,y),`*`,`'`),C=a(i(m,`:`),i(h,`:`),`*`),w=a(`^`,C,`$`),T=a(C,o(`:`,C),`?`),E=a(`^`,T,`$`),D=a(`(`,T,`)`),O=o(/"[^"]*"|'[^']*'/),k=a(/^<\?/,`(`,g,`)`,o(f,`(?!`,u,`)(`,c,`*?)`),`?`,/\?>/),A=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,j=o(`"`,A,`*"`,`|`,`'`,i(A,`'`),`*'`),M=`<!--`,N=`-->`,P=a(M,o(i(c,`-`),`|`,a(`-`,i(c,`-`))),`*`,N),F=`#PCDATA`,I=o(`EMPTY`,`|`,`ANY`,`|`,o(a(/\(/,p,F,o(p,/\|/,p,T),`*`,p,/\)\*/),`|`,a(/\(/,p,F,p,/\)/)),`|`,a(/\([^>]+\)/,/[?*+]?/)),L=a(`<!ELEMENT`,f,o(T,`|`,b),f,o(I,`|`,b),p,`>`),R=a(`<!ATTLIST`,f,g,o(f,g,f,o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,`|`,o(a(`NOTATION`,f,/\(/,p,g,o(p,/\|/,p,g),`*`,p,/\)/),`|`,a(/\(/,p,v,o(p,/\|/,p,v),`*`,p,/\)/))),f,o(/#REQUIRED|#IMPLIED/,`|`,o(o(`#FIXED`,f),`?`,S))),`*`,p,`>`),z=`about:legacy-compat`,ee=o(`"`+z+`"`,`|`,`'`+z+`'`),te=`SYSTEM`,ne=`PUBLIC`,B=o(o(te,f,O),`|`,o(ne,f,j,f,O)),re=a(`^`,o(o(te,f,`(?<SystemLiteralOnly>`,O,`)`),`|`,o(ne,f,`(?<PubidLiteral>`,j,`)`,f,`(?<SystemLiteral>`,O,`)`))),V=a(`^`,j,`$`),H=a(`^`,O,`$`),ie=o(x,`|`,o(B,o(f,`NDATA`,f,g),`?`)),ae=`<!ENTITY`,oe=o(a(ae,f,g,f,ie,p,`>`),`|`,a(ae,f,`%`,f,g,f,o(x,`|`,B),p,`>`)),se=a(`<!NOTATION`,f,g,f,o(B,`|`,a(ne,f,j)),p,`>`),ce=a(p,`=`,p),le=/1[.]\d+/,U=a(f,`version`,ce,o(`'`,le,`'`,`|`,`"`,le,`"`)),ue=/[A-Za-z][-A-Za-z0-9._]*/,de=a(/^<\?xml/,U,o(f,`encoding`,ce,o(`"`,ue,`"`,`|`,`'`,ue,`'`)),`?`,o(f,`standalone`,ce,o(`'`,o(`yes`,`|`,`no`),`'`,`|`,`"`,o(`yes`,`|`,`no`),`"`)),`?`,p,/\?>/),fe=`<!DOCTYPE`,pe=`<![CDATA[`,me=`]]>`,he=a(/<!\[CDATA\[/,a(c,`*?`,/\]\]>/));e.chars=r,e.chars_without=i,e.detectUnicodeSupport=t,e.reg=a,e.regg=o,e.ABOUT_LEGACY_COMPAT=z,e.ABOUT_LEGACY_COMPAT_SystemLiteral=ee,e.AttlistDecl=R,e.CDATA_START=pe,e.CDATA_END=me,e.CDSect=he,e.Char=c,e.Comment=P,e.COMMENT_START=M,e.COMMENT_END=N,e.DOCTYPE_DECL_START=fe,e.elementdecl=L,e.EntityDecl=oe,e.EntityValue=x,e.ExternalID=B,e.ExternalID_match=re,e.Name=g,e.Name_exact=_,e.NCName_exact=w,e.NotationDecl=se,e.Reference=y,e.PEReference=b,e.PI=k,e.PUBLIC=ne,e.PubidLiteral=j,e.PubidLiteral_match=V,e.QName=T,e.QName_exact=E,e.QName_group=D,e.S=f,e.SChar_s=d,e.S_OPT=p,e.SYSTEM=te,e.SystemLiteral=O,e.SystemLiteral_match=H,e.InvalidChar=l,e.UNICODE_REPLACEMENT_CHARACTER=s,e.UNICODE_SUPPORT=n,e.XMLDecl=de})),tR=o((e=>{var t=QL(),n=t.find,r=t.hasDefaultHTMLNamespace,i=t.hasOwn,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.isHTMLVoidElement,c=t.MIME_TYPE,l=t.NAMESPACE,u=Symbol(),d=$L(),f=d.DOMException,p=d.DOMExceptionName,m=eR();function h(e){if(e!==u)throw TypeError(`Illegal constructor`)}function g(e){return e!==``}function _(e){return e?e.split(/[\t\n\f\r ]+/).filter(g):[]}function v(e,t){return i(e,t)||(e[t]=!0),e}function y(e){if(!e)return[];var t=_(e);return Object.keys(t.reduce(v,{}))}function b(e){return function(t){return e&&e.indexOf(t)!==-1}}function x(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in qualified name "`+e+`"`)}function S(e,n){x(n),e||=null;var r=null,i=n;if(n.indexOf(`:`)>=0){var a=n.split(`:`);r=a[0],i=a[1]}if(r!==null&&e===null)throw new f(f.NAMESPACE_ERR,`prefix is non-null and namespace is null`);if(r===`xml`&&e!==t.NAMESPACE.XML)throw new f(f.NAMESPACE_ERR,`prefix is "xml" and namespace is not the XML namespace`);if((r===`xmlns`||n===`xmlns`)&&e!==t.NAMESPACE.XMLNS)throw new f(f.NAMESPACE_ERR,`either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace`);if(e===t.NAMESPACE.XMLNS&&r!==`xmlns`&&n!==`xmlns`)throw new f(f.NAMESPACE_ERR,`namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"`);return[e,r,i]}function C(e,t){for(var n in e)i(e,n)&&(t[n]=e[n])}function w(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,C(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var T={},E=T.ELEMENT_NODE=1,D=T.ATTRIBUTE_NODE=2,O=T.TEXT_NODE=3,k=T.CDATA_SECTION_NODE=4,A=T.ENTITY_REFERENCE_NODE=5,j=T.ENTITY_NODE=6,M=T.PROCESSING_INSTRUCTION_NODE=7,N=T.COMMENT_NODE=8,P=T.DOCUMENT_NODE=9,F=T.DOCUMENT_TYPE_NODE=10,I=T.DOCUMENT_FRAGMENT_NODE=11,L=T.NOTATION_NODE=12,R=t.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function z(e,t){if(t.length<e.length)return z(t,e);var n=null;for(var r in e){if(e[r]!==t[r])return n;n=e[r]}return n}function ee(e){return e.guid||=Math.random(),e.guid}function te(){}te.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e?{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null}:{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null},n=[],r=0;r<this.length;r++)G(this[r],n,null,t);return n.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},te.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function ne(e,t){this._node=e,this._refresh=t,B(this)}function B(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ke(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)i(e,r)&&delete e[r];C(n,e),e._inc=t}}ne.prototype.item=function(e){return B(this),this[e]||null},w(ne,te);function re(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function V(e,t){for(var n=0;n<e.length;){if(e[n]===t)return n;n++}}function H(e,t,n){if(!t)return e._noNsIndex;var r=e._nsIndex[t];return!r&&n&&(r=e._nsIndex[t]=Object.create(null)),r}function ie(e,t,n){var r=H(e,t,!1);return r&&r[n]||null}function ae(e,t){H(e,t.namespaceURI,!0)[t.localName]=t}function oe(e,t){var n=H(e,t.namespaceURI,!1);n&&delete n[t.localName]}function se(e,t,n,r){if(r?t[V(t,r)]=n:(t[t.length]=n,t.length++),ae(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&he(i,e,r),me(i,e,n))}}function ce(e,t,n){var r=V(t,n);if(r>=0){for(var i=t.length-1;r<=i;)t[r]=t[++r];if(t.length=i,oe(t,n),e){var a=e.ownerDocument;a&&he(a,e,n),n.ownerElement=null}}}re.prototype={length:0,item:te.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var n=this[t];if(n.nodeName===e)return n;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new f(f.INUSE_ATTRIBUTE_ERR);var n=ie(this,e.namespaceURI,e.localName);return n===e?e:(se(this._ownerElement,this,e,n),n)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new f(f.NOT_FOUND_ERR,e);return ce(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);if(!n)throw new f(f.NOT_FOUND_ERR,e?e+` : `+t:t);return ce(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){e||=null;for(var n=0;n<this.length;){var r=this[n];if(r.localName===t&&r.namespaceURI===e)return r;n++}return null}},re.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function le(){}le.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=c.XML_APPLICATION;e===l.HTML?r=c.XML_XHTML_APPLICATION:e===l.SVG&&(r=c.XML_SVG_IMAGE);var i=new pe(u,{contentType:r});if(i.implementation=this,i.childNodes=new te,i.doctype=n||null,n&&i.appendChild(n),t){var a=i.createElementNS(e,t);i.appendChild(a)}return i},createDocumentType:function(e,t,n,r){x(e);var i=new Pe(u);return i.name=e,i.nodeName=e,i.publicId=t||``,i.systemId=n||``,i.internalSubset=r||``,i.childNodes=new te,i},createHTMLDocument:function(e){var t=new pe(u,{contentType:c.HTML});if(t.implementation=this,t.childNodes=new te,e!==!1){t.doctype=this.createDocumentType(`html`),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var n=t.createElement(`html`);t.appendChild(n);var r=t.createElement(`head`);if(n.appendChild(r),typeof e==`string`){var i=t.createElement(`title`);i.appendChild(t.createTextNode(e)),r.appendChild(i)}n.appendChild(t.createElement(`body`))}return t}};function U(e){h(e)}U.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:`about:blank`,get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=t.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;for(var t=[{node:this,other:e}];t.length>0;){var n=t.pop(),r=n.node,i=n.other;if(r.nodeType!==i.nodeType)return!1;switch(r.nodeType){case r.DOCUMENT_TYPE_NODE:if(r.name!==i.name||r.publicId!==i.publicId||r.systemId!==i.systemId)return!1;break;case r.ELEMENT_NODE:if(r.namespaceURI!==i.namespaceURI||r.prefix!==i.prefix||r.localName!==i.localName||r.attributes.length!==i.attributes.length)return!1;for(var a=0;a<r.attributes.length;a++){var o=r.attributes.item(a),s=i.getAttributeNodeNS(o.namespaceURI,o.localName);if(!s)return!1;t.push({node:o,other:s})}break;case r.ATTRIBUTE_NODE:if(r.namespaceURI!==i.namespaceURI||r.localName!==i.localName||r.value!==i.value)return!1;break;case r.PROCESSING_INSTRUCTION_NODE:if(r.target!==i.target||r.data!==i.data)return!1;break;case r.TEXT_NODE:case r.CDATA_SECTION_NODE:case r.COMMENT_NODE:if(r.data!==i.data)return!1}if(r.childNodes.length!==i.childNodes.length)return!1;for(var a=r.childNodes.length-1;a>=0;a--)t.push({node:r.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return De(this,e,t)},replaceChild:function(e,t){De(this,e,t,Ee),t&&this.removeChild(t)},removeChild:function(e){return _e(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Ge(this.ownerDocument||this,this,e)},normalize:function(){fe(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(n!==null&&n.nodeType===O&&t.nodeType===O){for(var r=[],i=n;i!==null&&i.nodeType===O;)r.push(i.data),i=i.nextSibling;for(var a=t.nextSibling;a!==i;){var o=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=o}t.nextSibling=i,i===null?e.lastChild=t:i.previousSibling=t,t.appendData(r.join(``)),ge(e.ownerDocument,e),t=i}else t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(i(n,r)&&n[r]===e)return r}t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&i(n,e))return n[e];t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,n=this,r=null,i=null;if(t instanceof ke&&(r=t,t=r.ownerElement),n instanceof ke&&(i=n,n=i.ownerElement,r&&t&&n===t))for(var a=0,o;o=n.attributes[a];a++){if(o===r)return R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+R.DOCUMENT_POSITION_PRECEDING;if(o===i)return R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+R.DOCUMENT_POSITION_FOLLOWING}if(!t||!n||n.ownerDocument!==t.ownerDocument)return R.DOCUMENT_POSITION_DISCONNECTED+R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(ee(n.ownerDocument)>ee(t.ownerDocument)?R.DOCUMENT_POSITION_FOLLOWING:R.DOCUMENT_POSITION_PRECEDING);if(i&&t===n)return R.DOCUMENT_POSITION_CONTAINS+R.DOCUMENT_POSITION_PRECEDING;if(r&&t===n)return R.DOCUMENT_POSITION_CONTAINED_BY+R.DOCUMENT_POSITION_FOLLOWING;for(var s=[],c=t.parentNode;c;){if(!i&&c===n)return R.DOCUMENT_POSITION_CONTAINED_BY+R.DOCUMENT_POSITION_FOLLOWING;s.push(c),c=c.parentNode}s.reverse();for(var l=[],u=n.parentNode;u;){if(!r&&u===t)return R.DOCUMENT_POSITION_CONTAINS+R.DOCUMENT_POSITION_PRECEDING;l.push(u),u=u.parentNode}l.reverse();var d=z(s,l);for(var f in d.childNodes){var p=d.childNodes[f];if(p===n)return R.DOCUMENT_POSITION_FOLLOWING;if(p===t)return R.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return R.DOCUMENT_POSITION_FOLLOWING;if(s.indexOf(p)>=0)return R.DOCUMENT_POSITION_PRECEDING}return 0}};function ue(e){return e==`<`&&`<`||e==`>`&&`>`||e==`&`&&`&`||e==`"`&&`"`||`&#`+e.charCodeAt()+`;`}C(T,U),C(T,U.prototype),C(R,U),C(R,U.prototype);function de(e,t){fe(e,null,{enter:function(e){return!t(e)||fe.STOP}})}function fe(e,t,n){for(var r=[{node:e,context:t,phase:fe.ENTER}];r.length>0;){var i=r.pop();if(i.phase===fe.ENTER){var a=n.enter(i.node,i.context);if(a===fe.STOP)return fe.STOP;if(r.push({node:i.node,context:a,phase:fe.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:fe.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}fe.STOP=Symbol(`walkDOM.STOP`),fe.ENTER=0,fe.EXIT=1;function pe(e,t){h(e);var n=t||{};this.ownerDocument=this,this.contentType=n.contentType||c.XML_APPLICATION,this.type=a(this.contentType)?`html`:`xml`}function me(e,t,n){e&&e._inc++,n.namespaceURI===l.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function he(e,t,n,r){e&&e._inc++,n.namespaceURI===l.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function ge(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n&&!n.nextSibling)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function _e(e,t){if(e!==t.parentNode)throw new f(f.NOT_FOUND_ERR,`child's parent is not parent`);var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,ge(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function ve(e){return e&&(e.nodeType===U.DOCUMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.ELEMENT_NODE)}function ye(e){return e&&(e.nodeType===U.CDATA_SECTION_NODE||e.nodeType===U.COMMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.DOCUMENT_TYPE_NODE||e.nodeType===U.ELEMENT_NODE||e.nodeType===U.PROCESSING_INSTRUCTION_NODE||e.nodeType===U.TEXT_NODE)}function W(e){return e&&e.nodeType===U.DOCUMENT_TYPE_NODE}function be(e){return e&&e.nodeType===U.ELEMENT_NODE}function xe(e){return e&&e.nodeType===U.TEXT_NODE}function Se(e,t){var r=e.childNodes||[];if(n(r,be)||W(t))return!1;var i=n(r,W);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function Ce(e,t){var r=e.childNodes||[];function i(e){return be(e)&&e!==t}if(n(r,i))return!1;var a=n(r,W);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function we(e,t,n){if(!ve(e))throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new f(f.NOT_FOUND_ERR,`child not in parent`);if(!ye(t)||W(t)&&e.nodeType!==U.DOCUMENT_NODE)throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function Te(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var o=a.filter(be);if(o.length>1||n(a,xe))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!Se(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(be(t)&&!Se(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(W(t)){if(n(i,W))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,be);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`);if(!r&&s)throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can not be appended since element is present`)}}function Ee(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var o=a.filter(be);if(o.length>1||n(a,xe))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!Ce(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(be(t)&&!Ce(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(W(t)){function e(e){return W(e)&&e!==r}if(n(i,e))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,be);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`)}}function De(e,t,n,r){we(e,t,n),e.nodeType===U.DOCUMENT_NODE&&(r||Te)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===I){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do a.parentNode=e;while(a!==o&&(a=a.nextSibling));return ge(e.ownerDocument||e,e,t),t.nodeType==I&&(t.firstChild=t.lastChild=null),t}pe.prototype={implementation:null,nodeName:`#document`,nodeType:P,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===I){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return De(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===E&&(this.documentElement=e),e},removeChild:function(e){var t=_e(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){De(this,e,t,Ee),e.ownerDocument=this,t&&this.removeChild(t),be(e)&&(this.documentElement=e)},importNode:function(e,t){return We(this,e,t)},getElementById:function(e){var t=null;return de(this.documentElement,function(n){if(n.nodeType==E&&n.getAttribute(`id`)==e)return t=n,!0}),t},createElement:function(e){var t=new Oe(u);t.ownerDocument=this,this.type===`html`&&(e=e.toLowerCase()),r(this.contentType)&&(t.namespaceURI=l.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new te;var n=t.attributes=new re;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Re(u);return e.ownerDocument=this,e.childNodes=new te,e},createTextNode:function(e){var t=new je(u);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createComment:function(e){var t=new Me(u);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new f(f.INVALID_CHARACTER_ERR,`data contains "]]>"`);var t=new Ne(u);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ze(u);return n.ownerDocument=this,n.childNodes=new te,n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in name "`+e+`"`);return this.type===`html`&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new ke(u);return t.ownerDocument=this,t.childNodes=new te,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!m.Name_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`not a valid xml name "`+e+`"`);if(this.type===`html`)throw new f(`document is an html document`,p.NotSupportedError);var t=new Le(u);return t.ownerDocument=this,t.childNodes=new te,t.nodeName=e,t},createElementNS:function(e,t){var n=S(e,t),r=new Oe(u),i=r.attributes=new re;return r.childNodes=new te,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],i._ownerElement=r,r},createAttributeNS:function(e,t){var n=S(e,t),r=new ke(u);return r.ownerDocument=this,r.childNodes=new te,r.nodeName=t,r.name=t,r.specified=!0,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],r}},w(pe,U);function Oe(e){h(e),this._nsMap=Object.create(null)}Oe.prototype={nodeType:E,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+`:`+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type===`html`&&this.namespaceURI===l.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var n=this.getAttributeNode(e);n?n.value=n.nodeValue=``+t:(n=this.ownerDocument._createAttribute(e),n.value=n.nodeValue=``+t,this.setAttributeNode(n))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n?n.value:null},setAttributeNS:function(e,t,n){var r=S(e,t)[2],i=this.getAttributeNodeNS(e,r);i?i.value=i.nodeValue=``+n:(i=this.ownerDocument.createAttributeNS(e,t),i.value=i.nodeValue=``+n,this.setAttributeNode(i))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=y(e);return new ne(this,function(n){var r=[];return t.length>0&&de(n,function(i){if(i!==n&&i.nodeType===E){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var s=y(a);o=t.every(b(s))}o&&r.push(i)}}}),r})},getElementsByTagName:function(e){var t=(this.nodeType===P?this:this.ownerDocument).type===`html`,n=e.toLowerCase();return new ne(this,function(r){var i=[];return de(r,function(a){a!==r&&a.nodeType===E&&(e===`*`||a.getQualifiedName()===(t&&a.namespaceURI===l.HTML?n:e))&&i.push(a)}),i})},getElementsByTagNameNS:function(e,t){return new ne(this,function(n){var r=[];return de(n,function(i){i!==n&&i.nodeType===E&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},pe.prototype.getElementsByClassName=Oe.prototype.getElementsByClassName,pe.prototype.getElementsByTagName=Oe.prototype.getElementsByTagName,pe.prototype.getElementsByTagNameNS=Oe.prototype.getElementsByTagNameNS,w(Oe,U);function ke(e){h(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}ke.prototype.nodeType=D,w(ke,U);function Ae(e){h(e)}Ae.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},w(Ae,U);function je(e){h(e)}je.prototype={nodeName:`#text`,nodeType:O,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},w(je,Ae);function Me(e){h(e)}Me.prototype={nodeName:`#comment`,nodeType:N},w(Me,Ae);function Ne(e){h(e)}Ne.prototype={nodeName:`#cdata-section`,nodeType:k},w(Ne,je);function Pe(e){h(e)}Pe.prototype.nodeType=F,w(Pe,U);function Fe(e){h(e)}Fe.prototype.nodeType=L,w(Fe,U);function Ie(e){h(e)}Ie.prototype.nodeType=j,w(Ie,U);function Le(e){h(e)}Le.prototype.nodeType=A,w(Le,U);function Re(e){h(e)}Re.prototype.nodeName=`#document-fragment`,Re.prototype.nodeType=I,w(Re,U);function ze(e){h(e)}ze.prototype.nodeType=M,w(ze,Ae);function Be(){}Be.prototype.serializeToString=function(e,t){return Ve.call(e,t)},U.prototype.toString=Ve;function Ve(e){var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e==null?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null}:{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null},n=[],r=this.nodeType===P&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return G(this,n,o,t),n.join(``)}function He(e,t,n){var r=e.prefix||``,i=e.namespaceURI;if(!i||r===`xml`&&i===l.XML||i===l.XMLNS)return!1;for(var a=n.length;a--;){var o=n[a];if(o.prefix===r)return o.namespace!==i}return!0}function Ue(e,t,n,r){if(r&&!m.QName_exact.test(t))throw new f(`The attribute name "`+t+`" is not a valid XML QName`,p.InvalidStateError);e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,ue),`"`)}function G(e,t,n,r){n||=[];var i=r.nodeFilter,a=r.requireWellFormed,c=r.splitCDATASections,u=(e.nodeType===P?e:e.ownerDocument).type===`html`;fe(e,{ns:n},{enter:function(e,n){var d=n.ns;if(i){if(e=i(e),e){if(typeof e==`string`)return t.push(e),null}else return null}switch(e.nodeType){case E:var h=e.attributes,g=h.length,_=e.tagName,v=_;if(!u&&!e.prefix&&e.namespaceURI){for(var y,b=0;b<h.length;b++)if(h.item(b).name===`xmlns`){y=h.item(b).value;break}if(!y)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.prefix===``&&S.namespace===e.namespaceURI){y=S.namespace;break}}if(y!==e.namespaceURI)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.namespace===e.namespaceURI){S.prefix&&(v=S.prefix+`:`+_);break}}}if(a&&!m.QName_exact.test(v))throw new f(`The element name "`+v+`" is not a valid XML QName`,p.InvalidStateError);t.push(`<`,v);for(var C=d.slice(),w=0;w<g;w++){var T=h.item(w);T.prefix==`xmlns`?C.push({prefix:T.localName,namespace:T.value}):T.nodeName==`xmlns`&&C.push({prefix:``,namespace:T.value})}for(var w=0;w<g;w++){var T=h.item(w);if(He(T,u,C)){var j=T.prefix||``,L=T.namespaceURI;Ue(t,j?`xmlns:`+j:`xmlns`,L,a),C.push({prefix:j,namespace:L})}var R=i?i(T):T;R&&(typeof R==`string`?t.push(R):Ue(t,R.name,R.value,a))}if(_===v&&He(e,u,C)){var z=e.prefix||``,L=e.namespaceURI;Ue(t,z?`xmlns:`+z:`xmlns`,L,a),C.push({prefix:z,namespace:L})}var ee=!e.firstChild;if(ee&&(u||e.namespaceURI===l.HTML)&&(ee=s(_)),ee)return t.push(`/>`),null;if(t.push(`>`),u&&o(_)){for(var te=e.firstChild;te;)te.data?t.push(te.data):G(te,t,C.slice(),r),te=te.nextSibling;return t.push(`</`,v,`>`),null}return{ns:C,tag:v};case P:case I:if(a&&e.nodeType===P&&e.documentElement==null)throw new f(`The Document has no documentElement`,p.InvalidStateError);return{ns:d};case D:return Ue(t,e.name,e.value,a),null;case O:if(a&&m.InvalidChar.test(e.data))throw new f(`The Text node data contains characters outside the XML Char production`,p.InvalidStateError);return t.push(e.data.replace(/[<&>]/g,ue)),null;case k:if(a&&e.data.indexOf(`]]>`)!==-1)throw new f(`The CDATASection data contains "]]>"`,p.InvalidStateError);return c?t.push(m.CDATA_START,e.data.replace(/]]>/g,`]]]]><![CDATA[>`),m.CDATA_END):t.push(m.CDATA_START,e.data,m.CDATA_END),null;case N:if(a){if(m.InvalidChar.test(e.data))throw new f(`The comment node data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`--`)!==-1||e.data[e.data.length-1]===`-`)throw new f(`The comment node data contains "--" or ends with "-"`,p.InvalidStateError)}return t.push(m.COMMENT_START,e.data,m.COMMENT_END),null;case F:var ne=e.publicId,B=e.systemId;if(a){if(!m.Name_exact.test(e.name))throw new f(`The doctype name "`+e.name+`" is not a valid XML Name`,p.InvalidStateError);if(ne&&!m.PubidLiteral_match.test(ne))throw new f(`DocumentType publicId is not a valid PubidLiteral`,p.InvalidStateError);if(B&&B!==`.`&&!m.SystemLiteral_match.test(B))throw new f(`DocumentType systemId is not a valid SystemLiteral`,p.InvalidStateError);if(e.internalSubset&&e.internalSubset.indexOf(`]>`)!==-1)throw new f(`DocumentType internalSubset contains "]>"`,p.InvalidStateError)}return t.push(m.DOCTYPE_DECL_START,` `,e.name),ne?(t.push(` `,m.PUBLIC,` `,ne),B&&B!==`.`&&t.push(` `,B)):B&&B!==`.`&&t.push(` `,m.SYSTEM,` `,B),e.internalSubset&&t.push(` [`,e.internalSubset,`]`),t.push(`>`),null;case M:if(a){if(!m.NCName_exact.test(e.target)||e.target.toLowerCase()===`xml`)throw new f(`The processing instruction target "`+e.target+`" is not a valid XML NCName or is reserved`,p.InvalidStateError);if(m.InvalidChar.test(e.data))throw new f(`The ProcessingInstruction data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`?>`)!==-1)throw new f(`The ProcessingInstruction data contains "?>"`,p.InvalidStateError)}return t.push(`<?`,e.target,` `,e.data,`?>`),null;case A:if(a&&!m.Name_exact.test(e.nodeName))throw new f(`The entity reference name "`+e.nodeName+`" is not a valid XML Name`,p.InvalidStateError);return t.push(`&`,e.nodeName,`;`),null;default:return t.push(`??`,e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push(`</`,n.tag,`>`)}})}function We(e,t,n){var r;return fe(t,null,{enter:function(t,i){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,i===null?r=a:i.appendChild(a),t.nodeType===D||n?a:null}}),r}function Ge(e,t,n){var r;return fe(t,null,{enter:function(t,a){var o=new t.constructor(u);for(var s in t)if(i(t,s)){var c=t[s];typeof c!=`object`&&c!=o[s]&&(o[s]=c)}t.childNodes&&(o.childNodes=new te),o.ownerDocument=e;var l=n;switch(o.nodeType){case E:var d=t.attributes,f=o.attributes=new re,p=d.length;f._ownerElement=o;for(var m=0;m<p;m++)o.setAttributeNode(Ge(e,d.item(m),!0));break;case D:l=!0}return a===null?r=o:a.appendChild(o),l?o:null}}),r}function Ke(e,t,n){e[t]=n}function qe(e){for(var t=[],n=e.firstChild;n;)n.nodeType===E&&t.push(n),n=n.nextSibling;return t}try{Object.defineProperty&&(Object.defineProperty(ne.prototype,"length",{get:function(){return B(this),this.$$length}}),Object.defineProperty(U.prototype,"textContent",{get:function(){if(this.nodeType===E||this.nodeType===I){var e=[];return fe(this,null,{enter:function(t){if(t.nodeType===E||t.nodeType===I)return!0;if(t.nodeType===M||t.nodeType===N)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case E:case I:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Object.defineProperty(Ae.prototype,"data",{get:function(){return this._data==null?``:this._data},set:function(e){this._data=e,this.length=typeof e==`string`?e.length:0}}),Object.defineProperty(Ae.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(Oe.prototype,"children",{get:function(){return new ne(this,qe)}}),Object.defineProperty(pe.prototype,"children",{get:function(){return new ne(this,qe)}}),Object.defineProperty(Re.prototype,"children",{get:function(){return new ne(this,qe)}}),Ke=function(e,t,n){e[`$$`+t]=n})}catch{}e._updateLiveList=B,e.Attr=ke,e.CDATASection=Ne,e.CharacterData=Ae,e.Comment=Me,e.Document=pe,e.DocumentFragment=Re,e.DocumentType=Pe,e.DOMImplementation=le,e.Element=Oe,e.Entity=Ie,e.EntityReference=Le,e.LiveNodeList=ne,e.NamedNodeMap=re,e.Node=U,e.NodeList=te,e.Notation=Fe,e.Text=je,e.ProcessingInstruction=ze,e.walkDOM=fe,e.XMLSerializer=Be})),nR=o((e=>{var t=QL().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:``,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:``,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:``,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:``,InvisibleTimes:``,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:``,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:``,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
84
|
-
`,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:``,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:``,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:``,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:` `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:``,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:``,zwnj:``}),e.entityMap=e.HTML_ENTITIES})),rR=o((e=>{var t=QL(),n=eR(),r=$L(),i=t.isHTMLEscapableRawTextElement,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.hasOwn,c=t.NAMESPACE,l=r.ParseError,u=r.DOMException,d=0,f=1,p=2,m=3,h=4,g=5,_=6,v=7;function y(){}y.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),E(t,t=Object.create(null)),x(e,t,n,r,this.errorHandler),r.endDocument()}};var b=/&#?\w+;?/g;function x(e,r,i,o,c){var d=a(o.mimeType);e.indexOf(n.UNICODE_REPLACEMENT_CHARACTER)>=0&&c.warning(`Unicode replacement character detected, source encoding issues?`);function f(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e[e.length-1]===`;`?e:e+`;`;if(!d&&t!==e)return c.error(`EntityRef: expecting ;`),e;var r=n.Reference.exec(t);if(!r||r[0].length!==t.length)return c.error(`entity not matching Reference production: `+e),e;var a=t.slice(1,-1);return s(i,a)?i[a]:a.charAt(0)===`#`?f(parseInt(a.substring(1).replace(`x`,`0x`))):(c.error(`entity not found:`+e),e)}function m(t){if(t>D){var n=e.substring(D,t).replace(b,p);v&&y(D),o.characters(n,0,t-D),D=t}}var h=0,g=0,_=/\r\n?|\n|$/g,v=o.locator;function y(t,n){for(;t>=g&&(n=_.exec(e));)h=g,g=n.index+n[0].length,v.lineNumber++;v.columnNumber=t-h+1}for(var x=[{currentNSMap:r}],E=[],D=0;;){try{var O=e.indexOf(`<`,D);if(O<0){if(!d&&E.length>0)return c.fatalError(`unclosed xml tag(s): `+E.join(`, `));if(!e.substring(D).match(/^\s*$/)){var M=o.doc,N=M.createTextNode(e.substring(D));if(M.documentElement)return c.error(`Extra content at the end of the document`);M.appendChild(N),o.currentElement=N}return}if(O>D){var P=e.substring(D,O);!d&&E.length===0&&(P=P.replace(new RegExp(n.S_OPT.source,`g`),``),P&&c.error(`Unexpected content outside root element: '`+P+`'`)),m(O)}switch(e.charAt(O+1)){case`/`:var F=e.indexOf(`>`,O+2),I=e.substring(O+2,F>0?F:void 0);if(!I)return c.fatalError(`end tag name missing`);var L=n.reg(`^`,n.QName_group,n.S_OPT,`$`),R=F>0&&L.exec(I);if(!R){var z=F>0&&n.reg(`^`,n.QName_group).exec(I);if(d&&z)c.warning(`end tag name contains invalid trailing characters: "`+I+`"`),R=z;else if(z&&new RegExp(L.source,L.flags+`m`).test(I))c.error(`end tag name is followed by a line break and trailing content: "`+I+`"`),R=z;else return c.fatalError(`end tag name contains invalid characters: "`+I+`"`)}if(!o.currentElement&&!o.doc.documentElement)return;var ee=E[E.length-1]||o.currentElement.tagName||o.doc.documentElement.tagName||``;if(ee!==R[1]){var te=R[1].toLowerCase();if(!d||ee.toLowerCase()!==te)return c.fatalError(`Opening and ending tag mismatch: "`+ee+`" != "`+I+`"`)}var ne=x.pop();E.pop();var B=ne.localNSMap;if(o.endElement(ne.uri,ne.localName,ee),B)for(var re in B)s(B,re)&&o.endPrefixMapping(re);F++;break;case`?`:v&&y(O),F=A(e,O,o,c);break;case`!`:v&&y(O),F=k(e,O,o,c,d);break;default:v&&y(O);var V=new j,H=x[x.length-1].currentNSMap,F=C(e,O,V,H,p,c,d),ie=V.length;if(V.closed||(d&&t.isHTMLVoidElement(V.tagName)?V.closed=!0:E.push(V.tagName)),v&&ie){for(var ae=S(v,{}),oe=0;oe<ie;oe++){var se=V[oe];y(se.offset),se.locator=S(v,{})}o.locator=ae,w(V,o,H)&&x.push(V),o.locator=v}else w(V,o,H)&&x.push(V);d&&!V.closed?F=T(e,F,V.tagName,p,o):F++}}catch(e){if(e instanceof l)throw e;if(e instanceof u)return c.fatalError(`Error constructing the DOM: `+e.name+`: `+e.message,e);c.error(`element parse error: `+e),F=-1}F>D?D=F:m(Math.max(O,D)+1)}}function S(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function C(e,t,n,r,i,a,o){function c(e,t,r){if(s(n.attributeNames,e))return a.fatalError(`Attribute `+e+` redefined`);if(!o&&t.indexOf(`<`)>=0)return a.fatalError(`Unescaped '<' not allowed in attributes values`);n.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(b,i),r)}for(var l,u,y=++t,x=d;;){var S=e.charAt(y);if(x===d&&S===`<`)throw Error(`unexpected < in tag name: `+e.slice(t,y));switch(S){case`=`:if(x===f)l=e.slice(t,y),x=m;else if(x===p)x=m;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(x===m||x===f){if(x===f&&(a.warning(`attribute value must after "="`),l=e.slice(t,y)),t=y+1,y=e.indexOf(S,t),y>0)u=e.slice(t,y),c(l,u,t-1),x=g;else throw Error(`attribute value no end '`+S+`' match`)}else if(x==h)u=e.slice(t,y),c(l,u,t),a.warning(`attribute "`+l+`" missed start quot(`+S+`)!!`),t=y+1,x=g;else throw Error(`attribute value must after "="`);break;case`/`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:x=v,n.closed=!0;case h:case f:break;case p:n.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return a.error(`unexpected end of input`),x==d&&n.setTagName(e.slice(t,y)),y;case`>`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:break;case h:case f:u=e.slice(t,y),u.slice(-1)===`/`&&(n.closed=!0,u=u.slice(0,-1));case p:x===p&&(u=l),x==h?(a.warning(`attribute "`+u+`" missed quot(")!`),c(l,u,t)):(o||a.warning(`attribute "`+u+`" missed value!! "`+u+`" instead!!`),c(u,u,t));break;case m:if(!o)return a.fatalError(`AttValue: ' or " expected`)}return y;case``:S=` `;default:if(S<=` `)switch(x){case d:n.setTagName(e.slice(t,y)),x=_;break;case f:l=e.slice(t,y),x=p;break;case h:var u=e.slice(t,y);a.warning(`attribute "`+u+`" missed quot(")!!`),c(l,u,t);case g:x=_}else switch(x){case p:o||a.warning(`attribute "`+l+`" missed value!! "`+l+`" instead2!!`),c(l,l,t),t=y,x=f;break;case g:a.warning(`attribute space is required"`+l+`"!!`);case _:x=f,t=y;break;case m:x=h,t=y;break;case v:throw Error(`elements closed character '/' and '>' must be connected to`)}}y++}}function w(e,t,n){for(var r=e.tagName,i=null,a=e.length;a--;){var o=e[a],l=o.qName,u=o.value,d=l.indexOf(`:`);if(d>0)var f=o.prefix=l.slice(0,d),p=l.slice(d+1),m=f===`xmlns`&&p;else p=l,f=null,m=l===`xmlns`&&``;o.localName=p,m!==!1&&(i??(i=Object.create(null),n=Object.create(n)),n[m]=i[m]=u,o.uri=c.XMLNS,t.startPrefixMapping(m,u))}for(var a=e.length;a--;)o=e[a],o.prefix&&(o.prefix===`xml`&&(o.uri=c.XML),o.prefix!==`xmlns`&&(o.uri=n[o.prefix]));var d=r.indexOf(`:`);d>0?(f=e.prefix=r.slice(0,d),p=e.localName=r.slice(d+1)):(f=null,p=e.localName=r);var h=e.uri=n[f||``];if(t.startElement(h,p,r,e),e.closed){if(t.endElement(h,p,r),i)for(f in i)s(i,f)&&t.endPrefixMapping(f)}else return e.currentNSMap=n,e.localNSMap=i,!0}function T(e,t,n,r,a){var s=i(n);if(s||o(n)){var c=RegExp(`</`+n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`>`,`ig`);c.lastIndex=t;var l=c.exec(e),u=l?l.index:-1;if(u<0)return t+1;var d=e.substring(t+1,u);return s&&(d=d.replace(b,r)),a.characters(d,0,d.length),u}return t+1}function E(e,t){for(var n in e)s(e,n)&&(t[n]=e[n])}function D(e,t){var r=t;function i(t){return t||=0,e.charAt(r+t)}function a(e){e||=1,r+=e}function o(){for(var t=0;r<e.length;){var n=i();if(n!==` `&&n!==`
|
|
85
|
-
`&&n!==` `&&n!==`\r`)return t;t++,a()}return-1}function s(){return e.substring(r)}function c(t){return e.substring(r,r+t.length)===t}function l(t){return e.substring(r,r+t.length).toUpperCase()===t.toUpperCase()}function u(e){var t=n.reg(`^`,e).exec(s());return t?(a(t[0].length),t[0]):null}return{char:i,getIndex:function(){return r},getMatch:u,getSource:function(){return e},skip:a,skipBlanks:o,substringFromIndex:s,substringStartsWith:c,substringStartsWithCaseInsensitive:l}}function O(e,t){function r(e,t){var r=n.PI.exec(e.substringFromIndex());return r?r[1].toLowerCase()===`xml`?t.fatalError(`xml declaration is only allowed at the start of the document, but found at position `+e.getIndex()):(e.skip(r[0].length),r[0]):t.fatalError(`processing instruction is not well-formed at position `+e.getIndex())}var i=e.getSource();if(e.char()===`[`){e.skip(1);for(var a=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),e.char()===`]`){var o=i.substring(a,e.getIndex());return e.skip(1),o}var s=null;if(e.char()===`<`&&e.char(1)===`!`)switch(e.char(2)){case`E`:e.char(3)===`L`?s=e.getMatch(n.elementdecl):e.char(3)===`N`&&(s=e.getMatch(n.EntityDecl));break;case`A`:s=e.getMatch(n.AttlistDecl);break;case`N`:s=e.getMatch(n.NotationDecl);break;case`-`:s=e.getMatch(n.Comment)}else if(e.char()===`<`&&e.char(1)===`?`)s=r(e,t);else if(e.char()===`%`)s=e.getMatch(n.PEReference);else return t.fatalError(`Error detected in Markup declaration`);if(!s)return t.fatalError(`Error in internal subset at position `+e.getIndex())}return t.fatalError(`doctype internal subset is not well-formed, missing ]`)}}function k(e,t,r,i,a){var o=D(e,t);switch(a?o.char(2).toUpperCase():o.char(2)){case`-`:var s=o.getMatch(n.Comment);return s?(r.comment(s,n.COMMENT_START.length,s.length-n.COMMENT_START.length-n.COMMENT_END.length),o.getIndex()):i.fatalError(`comment is not well-formed at position `+o.getIndex());case`[`:var c=o.getMatch(n.CDSect);return c?!a&&!r.currentElement?i.fatalError(`CDATA outside of element`):(r.startCDATA(),r.characters(c,n.CDATA_START.length,c.length-n.CDATA_START.length-n.CDATA_END.length),r.endCDATA(),o.getIndex()):i.fatalError(`Invalid CDATA starting at position `+t);case`D`:if(r.doc&&r.doc.documentElement)return i.fatalError(`Doctype not allowed inside or after documentElement at position `+o.getIndex());if(a?!o.substringStartsWithCaseInsensitive(n.DOCTYPE_DECL_START):!o.substringStartsWith(n.DOCTYPE_DECL_START))return i.fatalError(`Expected `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());if(o.skip(n.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=o.getMatch(n.Name),!l.name)return i.fatalError(`doctype name missing or contains unexpected characters at position `+o.getIndex());if(a&&l.name.toLowerCase()!==`html`&&i.warning(`Unexpected DOCTYPE in HTML document at position `+o.getIndex()),o.skipBlanks(),o.substringStartsWith(n.PUBLIC)||o.substringStartsWith(n.SYSTEM)){var u=n.ExternalID_match.exec(o.substringFromIndex());if(!u)return i.fatalError(`doctype external id is not well-formed at position `+o.getIndex());u.groups.SystemLiteralOnly===void 0?(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral):l.systemId=u.groups.SystemLiteralOnly,o.skip(u[0].length)}else if(a&&o.substringStartsWithCaseInsensitive(n.SYSTEM)){if(o.skip(n.SYSTEM.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.SYSTEM+` at position `+o.getIndex());if(l.systemId=o.getMatch(n.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return i.fatalError(`Expected `+n.ABOUT_LEGACY_COMPAT+` in single or double quotes after `+n.SYSTEM+` at position `+o.getIndex())}return a&&l.systemId&&!n.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&i.warning(`Unexpected doctype.systemId in HTML document at position `+o.getIndex()),a||(o.skipBlanks(),l.internalSubset=O(o,i)),o.skipBlanks(),o.char()===`>`?(o.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),o.getIndex()):i.fatalError(`doctype not terminated with > at position `+o.getIndex());default:return i.fatalError(`Not well-formed XML starting with "<!" at position `+t)}}function A(e,t,r,i){var a=e.substring(t).match(n.PI);if(!a)return i.fatalError(`Invalid processing instruction starting at position `+t);if(a[1].toLowerCase()===`xml`){if(t>0)return i.fatalError(`processing instruction at position `+t+` is an xml declaration which is only at the start of the document`);if(!n.XMLDecl.test(e.substring(t)))return i.fatalError(`xml declaration is not well-formed`)}return r.processingInstruction(a[1],a[2]),t+a[0].length}function j(){this.attributeNames=Object.create(null)}j.prototype={setTagName:function(e){if(!n.QName_exact.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,r){if(!n.QName_exact.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},e.XMLReader=y,e.parseUtils=D,e.parseDoctypeCommentOrCData=k})),iR=o((e=>{var t=QL(),n=tR(),r=$L(),i=nR(),a=rR(),o=n.DOMImplementation,s=t.hasDefaultHTMLNamespace,c=t.isHTMLMimeType,l=t.isValidMimeType,u=t.MIME_TYPE,d=t.NAMESPACE,f=r.ParseError,p=a.XMLReader;function m(e){return e.replace(/\r[\n\u0085]/g,`
|
|
86
|
-
`).replace(/[\r\u0085\u2028\u2029]/g,`
|
|
87
|
-
`)}function h(e){if(e||={},e.locator===void 0&&(e.locator=!0),this.assign=e.assign||t.assign,this.domHandler=e.domHandler||g,this.onError=e.onError||e.errorHandler,e.errorHandler&&typeof e.errorHandler!=`function`)throw TypeError(`errorHandler object is no longer supported, switch to onError!`);e.errorHandler&&e.errorHandler(`warning`,"The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||m,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}h.prototype.parseFromString=function(e,n){if(!l(n))throw TypeError(`DOMParser.parseFromString: the provided mimeType "`+n+`" is not valid.`);var r=this.assign(Object.create(null),this.xmlns),a=i.XML_ENTITIES,o=r[``]||null;s(n)?(a=i.HTML_ENTITIES,o=d.HTML):n===u.XML_SVG_IMAGE&&(o=d.SVG),r[``]=o,r.xml=r.xml||d.XML;var c=new this.domHandler({mimeType:n,defaultNamespace:o,onError:this.onError}),f=this.locator?{}:void 0;this.locator&&c.setDocumentLocator(f);var m=new p;return m.errorHandler=c,m.domBuilder=c,!t.isHTMLMimeType(n)&&typeof e!=`string`&&m.errorHandler.fatalError(`source is not a string`),m.parse(this.normalizeLineEndings(String(e)),r,a),c.doc.documentElement||m.errorHandler.fatalError(`missing root element`),c.doc};function g(e){var t=e||{};this.mimeType=t.mimeType||u.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function _(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}g.prototype={startDocument:function(){var e=new o;this.doc=c(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,``)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;b(this,a),this.currentElement=a,this.locator&&_(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&_(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&_(this.locator,n),b(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=y.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&_(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,n){e=y.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&_(this.locator,r),b(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n,r){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(e,t,n,r);this.locator&&_(this.locator,a),b(this,a),this.doc.doctype=a}},reportError:function(e,t){if(typeof this.onError==`function`)try{this.onError(e,t,this)}catch(n){throw new f(`Reporting `+e+` "`+t+`" caused `+n,this.locator)}else console.error(`[xmldom `+e+`] `+t,v(this.locator))},warning:function(e){this.reportError(`warning`,e)},error:function(e){this.reportError(`error`,e)},fatalError:function(e,t){throw this.reportError(`fatalError`,e),new f(e,this.locator,t)}};function v(e){if(e)return`
|
|
88
|
-
@#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function y(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){g.prototype[e]=function(){return null}});function b(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}function x(e){if(e===`error`)throw`onErrorStopParsing`}function S(){throw`onWarningStopParsing`}e.__DOMHandler=g,e.DOMParser=h,e.normalizeLineEndings=m,e.onErrorStopParsing=x,e.onWarningStopParsing=S})),aR=o((e=>{var t=QL();e.assign=t.assign,e.hasDefaultHTMLNamespace=t.hasDefaultHTMLNamespace,e.isHTMLMimeType=t.isHTMLMimeType,e.isValidMimeType=t.isValidMimeType,e.MIME_TYPE=t.MIME_TYPE,e.NAMESPACE=t.NAMESPACE;var n=$L();e.DOMException=n.DOMException,e.DOMExceptionName=n.DOMExceptionName,e.ExceptionCode=n.ExceptionCode,e.ParseError=n.ParseError;var r=tR();e.Attr=r.Attr,e.CDATASection=r.CDATASection,e.CharacterData=r.CharacterData,e.Comment=r.Comment,e.Document=r.Document,e.DocumentFragment=r.DocumentFragment,e.DocumentType=r.DocumentType,e.DOMImplementation=r.DOMImplementation,e.Element=r.Element,e.Entity=r.Entity,e.EntityReference=r.EntityReference,e.LiveNodeList=r.LiveNodeList,e.NamedNodeMap=r.NamedNodeMap,e.Node=r.Node,e.NodeList=r.NodeList,e.Notation=r.Notation,e.ProcessingInstruction=r.ProcessingInstruction,e.Text=r.Text,e.XMLSerializer=r.XMLSerializer;var i=iR();e.DOMParser=i.DOMParser,e.normalizeLineEndings=i.normalizeLineEndings,e.onErrorStopParsing=i.onErrorStopParsing,e.onWarningStopParsing=i.onWarningStopParsing}))(),oR=class{constructor(e){if(sR(e))throw Error(`DataView: Passed buffer type is unsupported.`);this.buffer=e,this.byteLength=this.buffer.length}getUint8(e){return this.buffer.readUInt8(e)}getUint16(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}getUint32(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}getInt32(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}};function sR(e){return typeof e!=`object`||e.length===void 0||e.readUInt8===void 0||e.readUInt16LE===void 0||e.readUInt16BE===void 0||e.readUInt32LE===void 0||e.readUInt32BE===void 0||e.readInt32LE===void 0||e.readInt32BE===void 0}function cR(e,t,n){try{return new DataView(e,t,n)}catch{return new oR(e,t,n)}}function lR(e,t,n){let r=[];for(let i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return pR(r)}function uR(e,t){let n=[],r=0;for(;t+r<e.byteLength;){let i=e.getUint8(t+r);if(i===0)break;n.push(i),r++}return pR(n)}function dR(e,t,n){let r=[];for(let i=0;i+2<=n&&t+i+2<=e.byteLength;i+=2)r.push(e.getUint16(t+i));return r[r.length-1]===0&&r.pop(),pR(r)}function fR(e,t){let n=e.getUint8(t);return[n,lR(e,t+1,n)]}function pR(e){return e.map(e=>String.fromCharCode(e)).join(``)}function mR(e){let t=hR(e);return t===void 0?e:t}function hR(e){try{return decodeURIComponent(escape(e))}catch{return}}function gR(e,t,n,r){e&&t&&e.push({type:t,start:n,end:r})}function _R(){if(typeof Promise>`u`)throw Error(`Promise is required when async mode is enabled.`)}function vR(){for(let e=1;e<arguments.length;e++)for(let t in arguments[e])yR(arguments[0],t,arguments[e][t]);return arguments[0]}function yR(e,t,n){if(t===`__proto__`){Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0});return}e[t]=n}function bR(e,t,n){let r=!1;Object.defineProperty(e,t,{get(){return r||(r=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n.apply(e),writable:!0})),e[t]},configurable:!0,enumerable:!0})}function xR(e){if(typeof btoa<`u`)return btoa(typeof e==`string`?e:Array.prototype.reduce.call(new Uint8Array(e),(e,t)=>e+String.fromCharCode(t),``));if(!(typeof Buffer>`u`))return Buffer.from===void 0?new Buffer(e).toString(`base64`):Buffer.from(e).toString(`base64`)}function SR(e){let t=e.substring(e.indexOf(`,`)+1);if(e.indexOf(`;base64`)!==-1)return typeof atob<`u`?Uint8Array.from(atob(t),e=>e.charCodeAt(0)).buffer:typeof Buffer>`u`?void 0:Buffer.from===void 0?new Buffer(t,`base64`):Buffer.from(t,`base64`);let n=decodeURIComponent(t);return typeof Buffer<`u`?Buffer.from===void 0?new Buffer(n):Buffer.from(n):Uint8Array.from(n,e=>e.charCodeAt(0)).buffer}function CR(e,t,n){return TR(n,Math.max(0,t-e.length))+e}function wR(e,t){return parseInt(e.replace(`.`,``),t)/t**+(e.split(`.`)[1]||``).length}function TR(e,t){return Array(t+1).join(e)}var ER=`brotli`,DR=134217728;function OR(e,t,n,r=`string`,i){let a=kR(i);if(i&&t!==void 0){let o=i[t===0?`deflate`:`brotli`];if(typeof o==`function`){let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return Promise.resolve(o(t)).then(e=>NR(e)>a?PR(a):r===`dataview`?e instanceof ArrayBuffer?new DataView(e):e.byteOffset===0&&e.byteLength===e.buffer.byteLength?new DataView(e.buffer):new DataView(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)):new TextDecoder(n).decode(e))}}if(t===0&&typeof DecompressionStream==`function`)return AR(e,`deflate`,a).then(e=>MR(e,r,n));if(t===`brotli`){if(typeof DecompressionStream==`function`)try{return AR(e,`brotli`,a).then(e=>MR(e,r,n))}catch{}return Promise.reject(`Brotli decompression is not supported in this environment. Pass in a brotli decompression function via the decompress option.`)}if(t!==void 0)return Promise.reject(`Unknown compression method ${t}.`);if(r===`string`)try{return new TextDecoder(n).decode(e)}catch{let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return Array.from(t,e=>String.fromCharCode(e)).join(``)}return e}function kR(e){return e&&typeof e.maxDecompressedSize==`number`?e.maxDecompressedSize:DR}function AR(e,t,n){let r=new DecompressionStream(t),i=new Blob([e]).stream().pipeThrough(r).getReader(),a=[],o=0;return s();function s(){return i.read().then(({done:e,value:t})=>e?jR(a,o):(o+=t.byteLength,o>n?i.cancel().then(()=>PR(n)):(a.push(t),s())))}}function jR(e,t){let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].byteLength;return n.buffer}function MR(e,t,n){return t===`dataview`?new DataView(e):new TextDecoder(n).decode(e)}function NR(e){return e&&typeof e.byteLength==`number`?e.byteLength:0}function PR(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`ExifReader: skipped a compressed metadata block that would exceed the maximum decompressed size of ${e} bytes.`),Promise.reject(`Decompressed metadata exceeded the maximum allowed size of ${e} bytes.`)}function FR(e){return typeof e==`string`}function IR(e){return typeof File<`u`&&e instanceof File}function LR(e){return/^data:[^;,]*(;base64)?,/.test(e)}function RR(e,t){return/^\w+:\/\//.test(e)?typeof fetch<`u`?VR(e,BR(t)).then(e=>e.buffer):GR(e,BR(t)).then(e=>e.buffer):LR(e)?Promise.resolve(SR(e)):YR(e,BR(t)).then(e=>e.buffer)}function zR(e,t){return $R(e,BR(t)).then(e=>e.buffer)}function BR(e){return e&&Number.isInteger(e.length)&&e.length>=0?{start:0,end:e.length}:{start:0}}function VR(e,{start:t=0,end:n}={}){let r={method:`GET`};return(t>0||n!==void 0&&n!==1/0)&&(r.headers={range:HR(t,n)}),fetch(e,r).then(e=>{let t=e&&typeof e.status==`number`?e.status:void 0;if(t!==void 0&&!WR(t)){let n=e.statusText||``;return Promise.reject(Error(`Could not fetch file: ${t} ${n}`.trim()))}let n=UR(e);return Promise.resolve(e.arrayBuffer()).then(e=>({buffer:e,totalSize:n,status:t}))})}function HR(e,t){return t===void 0||t===1/0?`bytes=${e}-`:`bytes=${e}-${t-1}`}function UR(e){if(!(!e||!e.headers||typeof e.headers.get!=`function`))return qR(e.headers.get(`Content-Range`),e.headers.get(`Content-Length`))}function WR(e){return e>=200&&e<=299||e===416}function GR(e,{start:t=0,end:n}={}){return new Promise((r,i)=>{let a={};(t>0||n!==void 0&&n!==1/0)&&(a.headers={range:HR(t,n)}),JR(e)(e,a,e=>{if(e.statusCode>=200&&e.statusCode<=299){let t=KR(e),n=[];e.on(`data`,e=>n.push(Buffer.from(e))),e.on(`error`,e=>i(e)),e.on(`end`,()=>r({buffer:Buffer.concat(n),totalSize:t,status:e.statusCode}))}else e.statusCode===416?(e.resume(),r({buffer:Buffer.alloc(0),totalSize:KR(e),status:e.statusCode})):(i(Error(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`)),e.resume())}).on(`error`,e=>i(e))})}function KR(e){if(!(!e||!e.headers))return qR(e.headers[`content-range`],e.headers[`content-length`])}function qR(e,t){if(e){let t=/\/(\d+|\*)$/.exec(e);if(t&&t[1]!==`*`)return parseInt(t[1],10)}if(t){let e=parseInt(t,10);if(Number.isFinite(e))return e}}function JR(e){return/^https:\/\//.test(e)?__non_webpack_require__(`https`).get:__non_webpack_require__(`http`).get}function YR(e,{start:t=0,end:n,totalSize:r}={}){return new Promise((i,a)=>{let o=QR();o.open(e,(s,c)=>{if(s)return a(s);XR(o,e,r,(r,s)=>{if(r)return o.close(c,()=>a(r));let l=n===void 0||n===1/0||n>s?s:n,u=Math.min(Math.max(0,t),l),d=l-u,f=Buffer.alloc(d);if(d===0)return o.close(c,t=>ZR(e,t,f,s,i));o.read(c,{buffer:f,length:d,position:u},t=>{if(t)return o.close(c,()=>a(t));o.close(c,t=>ZR(e,t,f,s,i))})})})})}function XR(e,t,n,r){if(n!==void 0)return r(null,n);e.stat(t,(e,t)=>r(e,e?void 0:t.size))}function ZR(e,t,n,r,i){t&&console.warn(`Could not close file ${e}:`,t),i({buffer:n,totalSize:r})}function QR(){try{return __non_webpack_require__(`fs`)}catch{return}}function $R(e,{start:t=0,end:n}={}){return new Promise((r,i)=>{let a=new FileReader,o=typeof e.size==`number`?e.size:void 0;if(a.onload=e=>r({buffer:e.target.result,totalSize:o}),a.onerror=()=>i(a.error),e&&typeof e.slice==`function`&&(t>0||n!==void 0&&n!==1/0)){let r=n===void 0||n===1/0?o:n;a.readAsArrayBuffer(e.slice(t,r))}else a.readAsArrayBuffer(e)})}function ez(e,t){if(!e)return t;if(!t)return e;if(typeof Buffer<`u`&&Buffer.isBuffer(e)&&Buffer.isBuffer(t))return Buffer.concat([e,t]);let n=tz(e),r=tz(t),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(n,0),i.set(r,n.byteLength),i.buffer}function tz(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof Buffer<`u`&&Buffer.isBuffer(e)||ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var nz=131072,rz=4,iz=`length: "auto" could not locate metadata in this file (no metadata blocks found after reading the file — e.g. plain TIFF, bare JPEG XL codestream, or a file with no recognizable metadata).`,az=`length: "auto" is not supported for this file type (no leading metadata container — e.g. plain TIFF or bare JPEG XL codestream).`;function oz(e){if(e.expanded!==!0||e.includeOffsets!==!0)throw Error(`length: "auto" requires both expanded: true and includeOffsets: true.`)}function sz(e){return function(e,i){_R();let a=vR({},i,{async:!0});return FR(e)?t(e,a):IR(e)?n(e,a):r(e,a)};function t(e,t){return/^\w+:\/\//.test(e)?i(typeof fetch<`u`?{readRange:(t,n)=>VR(e,{start:t,end:n}),options:t}:{readRange:(t,n)=>GR(e,{start:t,end:n}),options:t}):LR(e)?r(SR(e),t):i({readRange:(t,n,r)=>YR(e,{start:t,end:n,totalSize:r?r.totalSize:void 0}),options:t})}function n(e,t){return i({readRange:(t,n)=>$R(e,{start:t,end:n}),options:t})}function r(t,n){return Promise.resolve().then(()=>e(t,n)).then(e=>{if(!e||!e.metadataRange)throw Error(az);let n=e.metadataRange.end;return e.metadataRange.buffer=fz(t,n),e.metadataRange.fetched=pz(e.metadataRange.buffer),e.metadataRange.requests=0,e})}function i({readRange:e,options:t}){return a({readRange:e,options:t,buffer:null,fetched:0,requests:0,totalSize:void 0,need:nz,iter:0})}function a(t){return t.iter>=rz||(t.totalSize!==void 0&&(t.need=Math.min(t.need,t.totalSize)),t.need<=t.fetched)?c(t):t.readRange(t.fetched,t.need,{totalSize:t.totalSize}).then(n=>(t.requests++,n.status===416?s(t):(cz(t,n),Promise.resolve(e(t.buffer,t.options)).then(e=>o(t,e)))))}function o(e,t){let n=t&&t.metadataRange;if(n&&n.complete)return lz(t,e.buffer,e.fetched,e.requests);let r=e.totalSize!==void 0&&e.fetched>=e.totalSize;if(!n&&r)throw Error(iz);let i=uz({range:n,totalSize:e.totalSize,fetched:e.fetched});if(i<=e.fetched){if(n)return lz(t,e.buffer,e.fetched,e.requests);throw Error(iz)}return e.need=i,e.iter++,a(e)}function s(t){return t.readRange(0,1/0,{totalSize:void 0}).then(n=>(t.requests++,t.buffer=n.buffer,t.fetched=pz(t.buffer),n.totalSize!==void 0&&(t.totalSize=n.totalSize),Promise.resolve(e(t.buffer,t.options)))).then(e=>{if(!e||!e.metadataRange)throw Error(iz);return lz(e,t.buffer,t.fetched,t.requests)})}function c(t){console.warn(`ExifReader: length:"auto" did not converge in ${rz} iterations; falling back to full read.`);let n;return n=t.totalSize!==void 0&&t.fetched<t.totalSize?t.readRange(t.fetched,t.totalSize,{totalSize:t.totalSize}).then(e=>{t.requests++,cz(t,e)}):t.totalSize===void 0?t.readRange(t.fetched,1/0,{totalSize:t.totalSize}).then(e=>{t.requests++,cz(t,e)}):Promise.resolve(),n.then(()=>Promise.resolve(e(t.buffer,t.options))).then(e=>{if(!e||!e.metadataRange)throw Error(iz);return lz(e,t.buffer,t.fetched,t.requests)})}}function cz(e,t){if(t.status===200&&e.fetched>0){e.buffer=t.buffer,e.fetched=pz(e.buffer),t.totalSize!==void 0&&(e.totalSize=t.totalSize);return}t.totalSize!==void 0&&e.totalSize===void 0&&(e.totalSize=t.totalSize),e.buffer=ez(e.buffer,t.buffer),e.fetched=pz(e.buffer)}function lz(e,t,n,r){let i=e.metadataRange.end;return e.metadataRange.buffer=dz(t,i),e.metadataRange.fetched=n,e.metadataRange.requests=r,e}function uz({range:e,totalSize:t,fetched:n}){return e?Math.min(Math.max(e.end,n*2),t===void 0?1/0:t):t===void 0?n*2:t}function dz(e,t){return!e||typeof t!=`number`||t<0?e:typeof Buffer<`u`&&Buffer.isBuffer(e)?Buffer.from(e.subarray(0,Math.min(t,e.length))):e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer?e.slice(0,Math.min(t,e.byteLength)):e}function fz(e,t){if(typeof Buffer<`u`&&Buffer.isBuffer(e))return Buffer.from(e.subarray(0,t));if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0,t);if(ArrayBuffer.isView(e)){let n=Math.max(0,Math.min(t,e.byteLength));return e.buffer.slice(e.byteOffset,e.byteOffset+n)}return e}function pz(e){return e?typeof e.byteLength==`number`?e.byteLength:typeof e.length==`number`?e.length:0:0}var Q={USE_FILE:!0,USE_JFIF:!0,USE_PNG_FILE:!0,USE_EXIF:!0,USE_IPTC:!0,USE_XMP:!0,USE_ICC:!0,USE_MPF:!0,USE_PHOTOSHOP:!0,USE_THUMBNAIL:!0,USE_TIFF:!0,USE_JPEG:!0,USE_PNG:!0,USE_HEIC:!0,USE_AVIF:!0,USE_JXL:!0,USE_WEBP:!0,USE_GIF:!0,USE_MAKER_NOTES:!0};function mz(e){if(e.length>=8){let t=pR(e.slice(0,8));if(t===`ASCII\0\0\0`)return pR(e.slice(8));if(t===`JIS\0\0\0\0\0`)return`[JIS encoded text]`;if(t===`UNICODE\0`)return`[Unicode encoded text]`;if(t===`\0\0\0\0\0\0\0\0`){let t=pR(e.slice(8));return/[\x20-\x7e]/.test(t)?t:`[Undefined encoding]`}}return`Undefined`}function hz(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}var gz=18761,_z=19789,vz={BIG_ENDIAN:_z,LITTLE_ENDIAN:gz,getByteOrder:yz};function yz(e,t){if(e.getUint16(t)===gz)return gz;if(e.getUint16(t)===_z)return _z;throw Error(`Illegal byte order value. Faulty image.`)}function bz(e,t){return e.getUint32(t+4)}function xz(e,t,n){return t+n<=e.byteLength}var Sz=1048576;function Cz(e,t,n,r,i,a){let{offsets:o,sizes:s}=wz(n,r+3),c=e.getUint8(o.offsetSize)>>4;s.item.extent.extentOffset=c;let l=e.getUint8(o.lengthSize)&15;s.item.extent.extentLength=l;let u=e.getUint8(o.baseOffsetSize)>>4;s.item.baseOffset=u;let d=Tz(e,o.indexSize,n);s.item.extent.extentIndex=d===void 0?0:d;let f=Ez(e,o.itemCount,n);return{type:`iloc`,items:Dz(e,Math.min(t+i,a),n,o,s,c,l,d,f),length:i}}function wz(e,t){let n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):e===2&&(n.itemCount=4,n.item.itemId=4),e===1||e===2?n.item.constructionMethod=2:n.item.constructionMethod=0;let r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}function Tz(e,t,n){if(n===1||n===2)return e.getUint8(t)&15}function Ez(e,t,n){if(n<2)return e.getUint16(t);if(n===2)return e.getUint32(t)}function Dz(e,t,n,r,i,a,o,s,c){if(c===void 0)return[];let l=[],u=r.items,d=i.item.extent.extentIndex+i.item.extent.extentOffset+i.item.extent.extentLength,f=i.item.itemId+i.item.constructionMethod+i.item.dataReferenceIndex+i.item.baseOffset+i.item.extentCount,p=0;for(let r=0;r<c&&!(u+f>t);r++){let r={extents:[]};r.itemId=kz(e,u,n),u+=i.item.itemId,r.constructionMethod=n===1||n===2?e.getUint16(u)&15:void 0,u+=i.item.constructionMethod,r.dataReferenceIndex=e.getUint16(u),u+=i.item.dataReferenceIndex,r.baseOffset=jz(e,u,i.item.baseOffset),u+=i.item.baseOffset,r.extentCount=e.getUint16(u),u+=i.item.extentCount;let c=Oz(r.extentCount,d,u,t,Sz-p);for(let t=0;t<c;t++){let t={};t.extentIndex=Az(e,n,u,s),u+=i.item.extent.extentIndex,t.extentOffset=jz(e,u,a),u+=i.item.extent.extentOffset,t.extentLength=jz(e,u,o),u+=i.item.extent.extentLength,r.extents.push(t)}if(p+=c,l.push(r),(r.extentCount-c)*d>0)break}return l}function Oz(e,t,n,r,i){if(t===0)return 0;let a=Math.floor((r-n)/t);return Math.max(0,Math.min(e,a,i))}function kz(e,t,n){if(n<2)return e.getUint16(t);if(n===2)return e.getUint32(t)}function Az(e,t,n,r){if((t===1||t===2)&&r>0)return jz(e,n,r)}function jz(e,t,n){return n===4?e.getUint32(t):n===8?(console.warn(`This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed.`),bz(e,t)):0}var Mz=1718909296,Nz=1768977008,Pz=1835365473,Fz=1768714083,Iz=1768186228,Lz=1768517222,Rz=1768842853,zz=1768973167,Bz=1668246642,Vz=1165519206,Hz=1835625829,Uz=1970432288;function Wz(e,t,n=e.byteLength){if(xz(e,t,8))try{let{length:r,contentOffset:i}=Kz(e,t);if(r<8)return;let a=e.getUint32(t+4);if(a===Mz)return uB(e,i,r);if(a===Nz)return dB(e,t,i,r,n);if(a===zz)return fB(e,t,i,r,n);if(a===Bz)return pB(e,i,r);if(a===Iz)return gB(i,r);if(!xz(e,i,1))return;let o=e.getUint8(i);return a===Pz?hB(e,t,i+1,r,n):a===Fz?Cz(e,t,o,i+1,r,n):a===Lz?vB(e,t,o,i+1,r,n):a===Rz?yB(e,t,o,i+1,r):{type:void 0,length:r}}catch{return}}function Gz(e,t){if(!e)return!1;try{let n=Wz(e,0);return n!==void 0&&t.indexOf(n.majorBrand)!==-1}catch{return!1}}function Kz(e,t){let n=e.getUint32(t);if(qz(n))return{length:e.byteLength-t,contentOffset:t+4+4};if(Jz(n)){if(!xz(e,t,16))return{length:0,contentOffset:t+4+4};if(Yz(e,t))return{length:e.getUint32(t+12),contentOffset:t+4+4+8}}return{length:n,contentOffset:t+4+4}}function qz(e){return e===0}function Jz(e){return e===1}function Yz(e,t){return e.getUint32(t+8)===0}function Xz(e,t){if(Q.USE_EXIF||Q.USE_XMP||Q.USE_ICC){let n={},r=Zz(e);if(!r)return{hasAppMarkers:!1};if(Q.USE_EXIF){let i=Qz(e,r,t);i!==void 0&&(n.tiffHeaderOffset=i.tiffHeaderOffset,i.dataView!==void 0&&(n.exifDataView=i.dataView))}if(Q.USE_XMP){let i=sB(e,r,t);i!==void 0&&(n.xmpChunks=i.chunks,i.dataView!==void 0&&(n.xmpDataView=i.dataView))}return Q.USE_ICC&&(n.iccChunks=lB(r,t)),n.hasAppMarkers=n.tiffHeaderOffset!==void 0||n.xmpChunks!==void 0||n.iccChunks!==void 0,n}return{}}function Zz(e){let t=0;for(;t+4+4<=e.byteLength;){let n=Wz(e,t);if(n===void 0)break;if(n.type===`meta`)return n;t+=n.length}}function Qz(e,t,n){try{let r=iB(t).itemId,i=aB(t,r);nB(i);let a=tB(t);if($z(n,i,`exif`,a),i.extents.length>1){let t=rB(e,i,a);return t===void 0?void 0:{tiffHeaderOffset:oB(t,0),dataView:t}}let o=eB(i,i.extents[0],a);return o===void 0?void 0:{tiffHeaderOffset:oB(e,o)}}catch{return}}function $z(e,t,n,r){if(e)for(let i=0;i<t.extents.length;i++){let a=t.extents[i],o=eB(t,a,r);o!==void 0&&gR(e,n,o,o+a.extentLength)}}function eB(e,t,n){let r=e.constructionMethod;if(r===void 0||r===0)return e.baseOffset+t.extentOffset;if(r===1&&n!==void 0)return n+e.baseOffset+t.extentOffset}function tB(e){let t=e.subBoxes.find(e=>e.type===`idat`);return t?t.contentOffset:void 0}function nB(e){e.constructionMethod===2&&console.warn(`This file uses iloc constructionMethod 2 (item_offset) which is currently not supported by ExifReader. Contact the maintainer to get it fixed.`)}function rB(e,t,n){let r=[],i=0;for(let a=0;a<t.extents.length;a++){let o=t.extents[a],s=eB(t,o,n);if(s===void 0||s+o.extentLength>e.byteLength||(r.push({start:s,length:o.extentLength}),i+=o.extentLength,i>e.byteLength))return}let a=new Uint8Array(i),o=0;for(let t=0;t<r.length;t++){let{start:n,length:i}=r[t];for(let t=0;t<i;t++)a[o+t]=e.getUint8(n+t);o+=i}return new DataView(a.buffer)}function iB(e){return e.subBoxes.find(e=>e.type===`iinf`).itemInfos.find(e=>e.itemType===Vz)}function aB(e,t){return e.subBoxes.find(e=>e.type===`iloc`).items.find(e=>e.itemId===t)}function oB(e,t){return t+4+e.getUint32(t)}function sB(e,t,n){try{let r=cB(t).itemId,i=aB(t,r);nB(i);let a=tB(t);if($z(n,i,`xmp`,a),i.extents.length>1){let t=rB(e,i,a);return t===void 0?void 0:{chunks:[{dataOffset:0,length:t.byteLength}],dataView:t}}let o=i.extents[0],s=eB(i,o,a);return s===void 0?void 0:{chunks:[{dataOffset:s,length:o.extentLength}]}}catch{return}}function cB(e){return e.subBoxes.find(e=>e.type===`iinf`).itemInfos.find(e=>e.itemType===1835625829&&e.contentType===`application/rdf+xml`)}function lB(e,t){try{let n=e.subBoxes.find(e=>e.type===`iprp`).subBoxes.find(e=>e.type===`ipco`).properties.find(e=>e.type===`colr`).icc;if(n)return gR(t,`icc`,n.offset,n.offset+n.length),[n]}catch{}}function uB(e,t,n){return{type:`ftyp`,majorBrand:lR(e,t,4),length:n}}function dB(e,t,n,r,i){return{type:`iprp`,subBoxes:_B(e,n,r-(n-t),i),length:r}}function fB(e,t,n,r,i){return{type:`ipco`,properties:_B(e,n,r-(n-t),i),length:r}}function pB(e,t,n){return{type:`colr`,icc:mB(e,t),length:n}}function mB(e,t){let n=lR(e,t,4);if(n===`prof`||n===`rICC`)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function hB(e,t,n,r,i){return{type:`meta`,subBoxes:_B(e,n+3,r-(n+3-t),i),length:r}}function gB(e,t){return{type:`idat`,contentOffset:e,length:t}}function _B(e,t,n,r){let i=[Vz,Hz],a=Math.min(t+n,r),o=[],s=t;for(;s+8<=a;){let t=Wz(e,s,a);if(t===void 0)break;t.type!==void 0&&(t.itemType===void 0||i.indexOf(t.itemType)!==-1)&&o.push(t),s+=t.length}return o}function vB(e,t,n,r,i,a){let o=n===0?2:4,s=r+3+o;return{type:`iinf`,itemInfos:_B(e,s,i-(s-t),a),length:i}}function yB(e,t,n,r,i){r+=3;let a={type:`infe`,length:i};return(n===0||n===1)&&(a.itemId=e.getUint16(r),r+=2,a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemName=uR(e,r),r+=a.itemName.length+1),n>=2&&(n===2?(a.itemId=e.getUint16(r),r+=2):n===3&&(a.itemId=e.getUint32(r),r+=4),a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemType=e.getUint32(r),r+=4,a.itemName=uR(e,r),r+=a.itemName.length+1,a.itemType===1835625829?(a.contentType=uR(e,r),r+=a.contentType.length+1,t+i>r&&(a.contentEncoding=uR(e,r),r+=a.contentEncoding.length+1)):a.itemType===Uz&&(a.itemUri=uR(e,r),r+=a.itemUri.length+1)),a}var bB={isTiffFile:xB,findTiffOffsets:CB};function xB(e){return!!e&&e.byteLength>=4&&SB(e)}function SB(e){let t=e.getUint16(0)===vz.LITTLE_ENDIAN;return e.getUint16(2,t)===42}function CB(){return Q.USE_EXIF?{hasAppMarkers:!0,tiffHeaderOffset:0}:{}}var wB={isJpegFile:sV,findJpegOffsets:cV},TB=2,EB=65496,DB=2,OB=4,kB=2,AB=2,jB=10,MB=18,NB=33,PB=79,FB=18,IB=8,LB=`ICC_PROFILE\0`,RB=16,zB=17,BB=255,VB=`MPF\0`,HB=65472,UB=65474,WB=65476,GB=65499,KB=65501,qB=65498,JB=65504,YB=65505,XB=65506,ZB=65517,QB=65519,$B=65534,eV=65535,tV=`JFIF`,nV=`Exif`,rV=`http://ns.adobe.com/xap/1.0/\0`,iV=`http://ns.adobe.com/xmp/extension/\0`,aV=`Photoshop 3.0`,oV=`8BIM`;function sV(e){return!!e&&e.byteLength>=TB&&e.getUint16(0)===EB}function cV(e,t){let n=DB,r,i,a,o,s,c,l,u,d,f=0,p,m=!1;for(;n+OB+5<=e.byteLength;){let h;if(e.getUint16(n)===qB&&(m=!0),Q.USE_FILE&&lV(e,n))r=e.getUint16(n+kB),i=n+kB,h=`file`;else if(Q.USE_FILE&&uV(e,n))r=e.getUint16(n+kB),a=n+kB,h=`file`;else if(Q.USE_JFIF&&pV(e,n))r=e.getUint16(n+kB),o=n+AB,h=`jfif`;else if(Q.USE_EXIF&&mV(e,n)){r=e.getUint16(n+kB),f++;let t=n+jB;if(f===1)p={appMarkerPosition:n,fieldLength:r,tiffHeaderOffset:t,score:void 0};else{p.score===void 0&&(p.score=wV(e,p.appMarkerPosition,p.fieldLength,p.tiffHeaderOffset));let i=wV(e,n,r,t);i>p.score&&(p={appMarkerPosition:n,fieldLength:r,tiffHeaderOffset:t,score:i})}s=p.tiffHeaderOffset,h=`exif`}else if(Q.USE_XMP&&hV(e,n))l||=[],r=e.getUint16(n+kB),l.push(yV(n,r)),h=`xmp`;else if(Q.USE_XMP&&_V(e,n))l||=[],r=e.getUint16(n+kB),l.push(bV(n,r)),h=`xmp`;else if(Q.USE_IPTC&&xV(e,n))r=e.getUint16(n+kB),c=n+MB,h=`iptc`;else if(Q.USE_ICC&&dV(e,n)){if(r=e.getUint16(n+kB),u||=[],u.length<BB){let t=n+FB,i=r-16,a=e.getUint8(n+RB),o=e.getUint8(n+zB);u.push({offset:t,length:i,chunkNumber:a,chunksTotal:o})}h=`icc`}else if(Q.USE_MPF&&fV(e,n))r=e.getUint16(n+kB),d=n+IB,h=`mpf`;else if(SV(e,n))r=e.getUint16(n+kB);else if(CV(e,n)){n++;continue}else break;gR(t,h,n,n+kB+r),n+=kB+r}return f>1&&EV(f),t&&(!m&&n+kB<=e.byteLength&&e.getUint16(n)===qB&&(m=!0),t.truncated=!m),{hasAppMarkers:n>DB,fileDataOffset:i||a,jfifDataOffset:o,tiffHeaderOffset:s,iptcDataOffset:c,xmpChunks:l,iccChunks:u,mpfDataOffset:d}}function lV(e,t){return e.getUint16(t)===HB}function uV(e,t){return e.getUint16(t)===UB}function dV(e,t){return e.getUint16(t)===XB&&t+zB<e.byteLength&&lR(e,t+OB,12)===LB}function fV(e,t){return e.getUint16(t)===XB&&lR(e,t+OB,4)===VB}function pV(e,t){return e.getUint16(t)===JB&&lR(e,t+OB,4)===tV&&e.getUint8(t+OB+4)===0}function mV(e,t){return e.getUint16(t)===YB&&lR(e,t+OB,4)===nV&&e.getUint8(t+OB+4)===0}function hV(e,t){return e.getUint16(t)===YB&&gV(e,t)}function gV(e,t){return lR(e,t+OB,29)===rV}function _V(e,t){return e.getUint16(t)===YB&&vV(e,t)}function vV(e,t){return lR(e,t+OB,35)===iV}function yV(e,t){return{dataOffset:e+NB,length:t-31}}function bV(e,t){return{dataOffset:e+PB,length:t-77}}function xV(e,t){let n=t+OB+13+1;return n+4<=e.byteLength&&e.getUint16(t)===ZB&&lR(e,t+OB,13)===aV&&e.getUint8(t+OB+13)===0&&lR(e,n,4)===oV}function SV(e,t){let n=e.getUint16(t);return n>=JB&&n<=QB||n===$B||n===HB||n===UB||n===WB||n===GB||n===KB||n===qB}function CV(e,t){return e.getUint16(t)===eV}function wV(e,t,n,r){let i=TV(e,r,t+kB+n);if(!i)return 0;let a=Number.isInteger(i.ifdEntries)?i.ifdEntries:0;return(i.isValid?1e9:0)+a*1e6+n}function TV(e,t,n){try{if(t+8>n)return;let r=e.getUint16(t+0),i=r===vz.LITTLE_ENDIAN;if(!i&&r!==vz.BIG_ENDIAN||e.getUint16(t+2,i)!==42)return;let a=t+e.getUint32(t+4,i);if(a+2>n)return;let o=e.getUint16(a,i);return{ifdEntries:o,isValid:a+(2+o*12+4)<=n&&o>0}}catch{return}}function EV(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`ExifReader: Found ${e} Exif segments (APP1). Will pick the best candidate segment.`)}var DV={isPngFile:FV,findPngOffsets:IV},OV=`PNG\r
|
|
89
|
-
|
|
90
|
-
`,kV=4,AV=`XML:com.adobe.xmp\0`,jV=`pHYs`,MV=`tIME`,NV=`eXIf`,PV=`iCCP`;function FV(e){return!!e&&lR(e,0,8)===OV}function IV(e,t,n){let r={hasAppMarkers:!1},i=8,a=!1;for(;i+kV+4<=e.byteLength;){let o,s=e.getUint32(i+0);if(n&&lR(e,i+4,4)===`IEND`&&(a=!0),Q.USE_PNG_FILE&&LV(e,i))r.hasAppMarkers=!0,r.pngHeaderOffset=i+8,o=`file`;else if(Q.USE_XMP&&RV(e,i)){let t=UV(e,i);t!==void 0&&(r.hasAppMarkers=!0,r.xmpChunks=[{dataOffset:t,length:s-(t-(i+8))}],o=`xmp`)}else if(zV(e,i,t)){r.hasAppMarkers=!0;let t=lR(e,i+4,4);r.pngTextChunks||=[],r.pngTextChunks.push({length:s,type:t,offset:i+8}),o=`png`}else if(BV(e,i))r.hasAppMarkers=!0,r.tiffHeaderOffset=i+8,o=`exif`;else if(Q.USE_ICC&&t&&VV(e,i)){let t=i+8,n=WV(e,t);n!==void 0&&(r.hasAppMarkers=!0,r.iccChunks||=[],r.iccChunks.push({offset:n.compressedProfileOffset,length:s-(n.compressedProfileOffset-t),chunkNumber:1,chunksTotal:1,profileName:n.profileName,compressionMethod:n.compressionMethod}),o=`icc`)}else HV(e,i)&&(r.hasAppMarkers=!0,r.pngChunkOffsets||=[],r.pngChunkOffsets.push(i+0),o=`png`);let c=s+kV+4+4;gR(n,o,i,i+c),i+=c}return n&&(n.truncated=!a),r}function LV(e,t){return lR(e,t+4,4)===`IHDR`}function RV(e,t){return lR(e,t+4,4)===`iTXt`&&lR(e,t+8,18)===AV}function zV(e,t,n){let r=lR(e,t+4,4);return r===`tEXt`||r===`iTXt`||r===`zTXt`&&n}function BV(e,t){return lR(e,t+4,4)===NV}function VV(e,t){return lR(e,t+4,4)===PV}function HV(e,t){let n=[jV,MV],r=lR(e,t+4,4);return n.includes(r)}function UV(e,t){t+=28;let n=0;for(;n<2&&t<e.byteLength;)e.getUint8(t)===0&&n++,t++;if(!(n<2))return t}function WV(e,t){let n=uR(e,t);if(t+=n.length+1,t+1>e.byteLength)return;let r=e.getUint8(t);return t+=1,{profileName:n,compressionMethod:r,compressedProfileOffset:t}}var GV={isHeicFile:qV,findHeicOffsets:JV},KV=[`heic`,`heix`,`hevc`,`hevx`,`heim`,`heis`,`hevm`,`hevs`,`mif1`];function qV(e){return Gz(e,KV)}function JV(e,t){return Xz(e,t)}var YV={isAvifFile:ZV,findAvifOffsets:QV},XV=[`avif`];function ZV(e){return Gz(e,XV)}function QV(e,t){return Xz(e,t)}var $V={isJxlFile:lH,findJxlOffsets:fH},eH=[0,0,0,12,74,88,76,32,13,10,135,10],tH=[255,10],nH=1165519206,rH=2020437024,iH=1651666786,aH=1786276963,oH=1786276976,sH=4,cH=4;function lH(e){try{return uH(e)||dH(e)}catch{return!1}}function uH(e){if(!e||e.byteLength<eH.length)return!1;for(let t=0;t<eH.length;t++)if(e.getUint8(t)!==eH[t])return!1;return!0}function dH(e){return!e||e.byteLength<tH.length?!1:e.getUint8(0)===tH[0]&&e.getUint8(1)===tH[1]}function fH(e,t){let n=0,r,i,a,o,s;if(dH(e))return{hasAppMarkers:!0,tiffHeaderOffset:void 0,xmpChunks:void 0,brobExifChunk:void 0,brobXmpChunk:void 0,jxlCodestreamOffset:0};for(;n+8<=e.byteLength;){let{length:c,contentOffset:l}=Kz(e,n);if(c<8)break;let u=e.getUint32(n+4),d;if(Q.USE_EXIF&&u===nH){try{r=oB(e,l)}catch{}d=`exif`}if(Q.USE_XMP&&u===rH&&(i=[{dataOffset:l,length:c-(l-n)}],d=`xmp`),u===aH&&s===void 0&&(s=l),u===oH&&s===void 0&&l+sH<=e.byteLength&&(e.getUint32(l)&2147483647||(s=l+sH)),u===iH&&l+cH<=e.byteLength){let t=e.getUint32(l),s=l+cH,u=c-(s-n);Q.USE_EXIF&&t===nH&&(d=`exif`,r===void 0&&!a&&(a={dataOffset:s,length:u})),Q.USE_XMP&&t===rH&&(d=`xmp`,!i&&!o&&(o={dataOffset:s,length:u}))}gR(t,d,n,n+c),n+=c}return{hasAppMarkers:r!==void 0||i!==void 0||a!==void 0||o!==void 0||s!==void 0,tiffHeaderOffset:r,xmpChunks:i,brobExifChunk:a,brobXmpChunk:o,jxlCodestreamOffset:s}}var pH={isWebpFile:mH,findOffsets:hH};function mH(e){return!!e&&lR(e,0,4)===`RIFF`&&lR(e,8,4)===`WEBP`}function hH(e,t){let n=12,r=!1,i,a,o,s;for(;n+8<e.byteLength;){let c=lR(e,n,4),l=e.getUint32(n+4,!0),u;Q.USE_EXIF&&c===`EXIF`?(r=!0,i=lR(e,n+8,6)===`Exif\0\0`?n+8+6:n+8,u=`exif`):Q.USE_XMP&&c===`XMP `?(r=!0,a=[{dataOffset:n+8,length:l}],u=`xmp`):Q.USE_ICC&&c===`ICCP`?(r=!0,o=[{offset:n+8,length:l,chunkNumber:1,chunksTotal:1}],u=`icc`):c===`VP8X`&&(r=!0,s=n+8,u=`riff`);let d=8+(l%2==0?l:l+1);gR(t,u,n,n+d),n+=d}return{hasAppMarkers:r,tiffHeaderOffset:i,xmpChunks:a,iccChunks:o,vp8xChunkOffset:s}}var gH={isGifFile:bH,findOffsets:xH},_H=6,vH=[`GIF87a`,`GIF89a`],yH=13;function bH(e){return!!e&&vH.includes(lR(e,0,_H))}function xH(e,t){return gR(t,`gif`,0,yH),{gifHeaderOffset:0}}var SH={isXMLFile:EH,findOffsets:DH},CH=0,wH=`<?xpacket begin`,TH=[`<?xpacket end=`,`</x:xmpmeta>`];function EH(e){return!!e&&lR(e,CH,15)===wH}function DH(e,t){let n=[];return n.push({dataOffset:CH,length:e.byteLength}),gR(t,`xmp`,0,e.byteLength),t&&(t.truncated=!OH(e)),{xmpChunks:n}}function OH(e){let t=lR(e,0,e.byteLength);for(let e=0;e<TH.length;e++)if(t.indexOf(TH[e])!==-1)return!0;return!1}var kH={parseAppMarkers:AH};function AH(e,t,n){let r=n?[]:void 0;if(Q.USE_TIFF&&bB.isTiffFile(e))return jH(bB.findTiffOffsets(),`tiff`,`TIFF`,r);if(Q.USE_JPEG&&wB.isJpegFile(e))return jH(wB.findJpegOffsets(e,r),`jpeg`,`JPEG`,r);if(Q.USE_PNG&&DV.isPngFile(e))return jH(DV.findPngOffsets(e,t,r),`png`,`PNG`,r);if(Q.USE_HEIC&&GV.isHeicFile(e))return jH(GV.findHeicOffsets(e,r),`heic`,`HEIC`,r);if(Q.USE_AVIF&&YV.isAvifFile(e))return jH(YV.findAvifOffsets(e,r),`avif`,`AVIF`,r);if(Q.USE_JXL&&$V.isJxlFile(e))return jH($V.findJxlOffsets(e,r),`jxl`,`JPEG XL`,r);if(Q.USE_WEBP&&pH.isWebpFile(e))return jH(pH.findOffsets(e,r),`webp`,`WebP`,r);if(Q.USE_GIF&&gH.isGifFile(e))return jH(gH.findOffsets(e,r),`gif`,`GIF`,r);if(Q.USE_XMP&&SH.isXMLFile(e))return jH(SH.findOffsets(e,r),`xml`,`XML`,r);throw Error(`Invalid image format`)}function jH(e,t,n,r){let i=vR({},e,{fileType:{value:t,description:n}});return r!==void 0&&(i.metadataBlocks=r,i.metadataTruncated=!!r.truncated),i}var MH={ApertureValue:e=>(Math.sqrt(2)**+(e[0]/e[1])).toFixed(2),ColorSpace(e){return e===1?`sRGB`:e===65535?`Uncalibrated`:`Unknown`},ComponentsConfiguration(e){return e.map(e=>{if(e===49)return`Y`;if(e===50)return`Cb`;if(e===51)return`Cr`;if(e===52)return`R`;if(e===53)return`G`;if(e===54)return`B`}).join(``)},Contrast(e){return e===0?`Normal`:e===1?`Soft`:e===2?`Hard`:`Unknown`},CustomRendered(e){return e===0?`Normal process`:e===1?`Custom process`:`Unknown`},ExposureMode(e){return e===0?`Auto exposure`:e===1?`Manual exposure`:e===2?`Auto bracket`:`Unknown`},ExposureProgram(e){return e===0?`Undefined`:e===1?`Manual`:e===2?`Normal program`:e===3?`Aperture priority`:e===4?`Shutter priority`:e===5?`Creative program`:e===6?`Action program`:e===7?`Portrait mode`:e===8?`Landscape mode`:e===9?`Bulb`:`Unknown`},ExposureTime(e){if(e[0]/e[1]>.25){let t=e[0]/e[1];return Number.isInteger(t)?``+t:t.toFixed(1)}return e[0]===0?`0/${e[1]}`:`1/${Math.round(e[1]/e[0])}`},FNumber:e=>`f/${Number(e[0]/e[1]).toFixed(1)}`,FocalLength:e=>e[0]/e[1]+` mm`,FocalPlaneResolutionUnit(e){return e===2?`inches`:e===3?`centimeters`:e===4?`millimeters`:`Unknown`},LightSource:e=>e===1?`Daylight`:e===2?`Fluorescent`:e===3?`Tungsten (incandescent light)`:e===4?`Flash`:e===9?`Fine weather`:e===10?`Cloudy weather`:e===11?`Shade`:e===12?`Daylight fluorescent (D 5700 – 7100K)`:e===13?`Day white fluorescent (N 4600 – 5400K)`:e===14?`Cool white fluorescent (W 3900 – 4500K)`:e===15?`White fluorescent (WW 3200 – 3700K)`:e===17?`Standard light A`:e===18?`Standard light B`:e===19?`Standard light C`:e===20?`D55`:e===21?`D65`:e===22?`D75`:e===23?`D50`:e===24?`ISO studio tungsten`:e===255?`Other light source`:`Unknown`,MeteringMode(e){return e===1?`Average`:e===2?`CenterWeightedAverage`:e===3?`Spot`:e===4?`MultiSpot`:e===5?`Pattern`:e===6?`Partial`:e===255?`Other`:`Unknown`},ResolutionUnit(e){return e===2?`inches`:e===3?`centimeters`:`Unknown`},Saturation(e){return e===0?`Normal`:e===1?`Low saturation`:e===2?`High saturation`:`Unknown`},FocalLengthIn35mmFilm(e){return e===0?`Unknown`:e+` mm`},SceneCaptureType(e){return e===0?`Standard`:e===1?`Landscape`:e===2?`Portrait`:e===3?`Night scene`:`Unknown`},Sharpness(e){return e===0?`Normal`:e===1?`Soft`:e===2?`Hard`:`Unknown`},ShutterSpeedValue(e){let t=2**(e[0]/e[1]);return t<=1?`${Math.round(1/t)}`:`1/${Math.round(t)}`},WhiteBalance(e){return e===0?`Auto white balance`:e===1?`Manual white balance`:`Unknown`},XResolution:e=>``+Math.round(e[0]/e[1]),YResolution:e=>``+Math.round(e[0]/e[1])},NH={11:`ProcessingSoftware`,254:{name:`SubfileType`,description:e=>({0:`Full-resolution image`,1:`Reduced-resolution image`,2:`Single page of multi-page image`,3:`Single page of multi-page reduced-resolution image`,4:`Transparency mask`,5:`Transparency mask of reduced-resolution image`,6:`Transparency mask of multi-page image`,7:`Transparency mask of reduced-resolution multi-page image`,65537:`Alternate reduced-resolution image`,4294967295:`Invalid`})[e]||`Unknown`},255:{name:`OldSubfileType`,description:e=>({0:`Full-resolution image`,1:`Reduced-resolution image`,2:`Single page of multi-page image`})[e]||`Unknown`},256:`ImageWidth`,257:`ImageLength`,258:`BitsPerSample`,259:`Compression`,262:`PhotometricInterpretation`,263:{name:`Thresholding`,description:e=>({1:`No dithering or halftoning`,2:`Ordered dither or halfton`,3:`Randomized dither`})[e]||`Unknown`},264:`CellWidth`,265:`CellLength`,266:{name:`FillOrder`,description:e=>({1:`Normal`,2:`Reversed`})[e]||`Unknown`},269:`DocumentName`,270:`ImageDescription`,271:`Make`,272:`Model`,273:`StripOffsets`,274:{name:`Orientation`,description:e=>e===1?`top-left`:e===2?`top-right`:e===3?`bottom-right`:e===4?`bottom-left`:e===5?`left-top`:e===6?`right-top`:e===7?`right-bottom`:e===8?`left-bottom`:`Undefined`},277:`SamplesPerPixel`,278:`RowsPerStrip`,279:`StripByteCounts`,280:`MinSampleValue`,281:`MaxSampleValue`,282:{name:`XResolution`,description:MH.XResolution},283:{name:`YResolution`,description:MH.YResolution},284:`PlanarConfiguration`,285:`PageName`,286:{name:`XPosition`,description:e=>``+Math.round(e[0]/e[1])},287:{name:`YPosition`,description:e=>``+Math.round(e[0]/e[1])},290:{name:`GrayResponseUnit`,description:e=>({1:`0.1`,2:`0.001`,3:`0.0001`,4:`1e-05`,5:`1e-06`})[e]||`Unknown`},296:{name:`ResolutionUnit`,description:MH.ResolutionUnit},297:`PageNumber`,301:`TransferFunction`,305:`Software`,306:`DateTime`,315:`Artist`,316:`HostComputer`,317:`Predictor`,318:{name:`WhitePoint`,description:e=>e.map(e=>`${e[0]}/${e[1]}`).join(`, `)},319:{name:`PrimaryChromaticities`,description:e=>e.map(e=>`${e[0]}/${e[1]}`).join(`, `)},321:`HalftoneHints`,322:`TileWidth`,323:`TileLength`,330:`A100DataOffset`,332:{name:`InkSet`,description:e=>({1:`CMYK`,2:`Not CMYK`})[e]||`Unknown`},337:`TargetPrinter`,338:{name:`ExtraSamples`,description:e=>({0:`Unspecified`,1:`Associated Alpha`,2:`Unassociated Alpha`})[e]||`Unknown`},339:{name:`SampleFormat`,description:e=>{let t={1:`Unsigned`,2:`Signed`,3:`Float`,4:`Undefined`,5:`Complex int`,6:`Complex float`};return Array.isArray(e)?e.map(e=>t[e]||`Unknown`).join(`, `):`Unknown`}},513:`JPEGInterchangeFormat`,514:`JPEGInterchangeFormatLength`,529:{name:`YCbCrCoefficients`,description:e=>e.map(e=>``+e[0]/e[1]).join(`/`)},530:`YCbCrSubSampling`,531:{name:`YCbCrPositioning`,description:e=>e===1?`centered`:e===2?`co-sited`:`undefined `+e},532:{name:`ReferenceBlackWhite`,description:e=>e.map(e=>``+e[0]/e[1]).join(`, `)},700:`ApplicationNotes`,18246:`Rating`,18249:`RatingPercent`,33432:{name:`Copyright`,description:e=>e.join(`; `)},33550:`PixelScale`,33723:`IPTC-NAA`,33920:`IntergraphMatrix`,33922:`ModelTiePoint`,34118:`SEMInfo`,34264:`ModelTransform`,34377:`PhotoshopSettings`,34665:`Exif IFD Pointer`,34675:`ICC_Profile`,34735:`GeoTiffDirectory`,34736:`GeoTiffDoubleParams`,34737:`GeoTiffAsciiParams`,34853:`GPS Info IFD Pointer`,40091:{name:`XPTitle`,description:PH},40092:{name:`XPComment`,description:PH},40093:{name:`XPAuthor`,description:PH},40094:{name:`XPKeywords`,description:PH},40095:{name:`XPSubject`,description:PH},42112:`GDALMetadata`,42113:`GDALNoData`,50341:`PrintIM`,50707:`DNGBackwardVersion`,50708:`UniqueCameraModel`,50709:`LocalizedCameraModel`,50721:`ColorMatrix1`,50722:`ColorMatrix2`,50723:`CameraCalibration1`,50724:`CameraCalibration2`,50725:`ReductionMatrix1`,50726:`ReductionMatrix2`,50727:`AnalogBalance`,50728:`AsShotNeutral`,50729:`AsShotWhiteXY`,50730:`BaselineExposure`,50731:`BaselineNoise`,50732:`BaselineSharpness`,50734:`LinearResponseLimit`,50735:`CameraSerialNumber`,50736:`DNGLensInfo`,50739:`ShadowScale`,50741:{name:`MakerNoteSafety`,description:e=>({0:`Unsafe`,1:`Safe`})[e]||`Unknown`},50778:{name:`CalibrationIlluminant1`,description:MH.LightSource},50779:{name:`CalibrationIlluminant2`,description:MH.LightSource},50781:`RawDataUniqueID`,50827:`OriginalRawFileName`,50828:`OriginalRawFileData`,50831:`AsShotICCProfile`,50832:`AsShotPreProfileMatrix`,50833:`CurrentICCProfile`,50834:`CurrentPreProfileMatrix`,50879:`ColorimetricReference`,50885:`SRawType`,50898:`PanasonicTitle`,50899:`PanasonicTitle2`,50931:`CameraCalibrationSig`,50932:`ProfileCalibrationSig`,50933:`ProfileIFD`,50934:`AsShotProfileName`,50936:`ProfileName`,50937:`ProfileHueSatMapDims`,50938:`ProfileHueSatMapData1`,50939:`ProfileHueSatMapData2`,50940:`ProfileToneCurve`,50941:{name:`ProfileEmbedPolicy`,description:e=>({0:`Allow Copying`,1:`Embed if Used`,2:`Never Embed`,3:`No Restrictions`})[e]||`Unknown`},50942:`ProfileCopyright`,50964:`ForwardMatrix1`,50965:`ForwardMatrix2`,50966:`PreviewApplicationName`,50967:`PreviewApplicationVersion`,50968:`PreviewSettingsName`,50969:`PreviewSettingsDigest`,50970:{name:`PreviewColorSpace`,description:e=>({1:`Gray Gamma 2.2`,2:`sRGB`,3:`Adobe RGB`,4:`ProPhoto RGB`})[e]||`Unknown`},50971:`PreviewDateTime`,50972:`RawImageDigest`,50973:`OriginalRawFileDigest`,50981:`ProfileLookTableDims`,50982:`ProfileLookTableData`,51043:`TimeCodes`,51044:`FrameRate`,51058:`TStop`,51081:`ReelName`,51089:`OriginalDefaultFinalSize`,51090:`OriginalBestQualitySize`,51091:`OriginalDefaultCropSize`,51105:`CameraLabel`,51107:{name:`ProfileHueSatMapEncoding`,description:e=>({0:`Linear`,1:`sRGB`})[e]||`Unknown`},51108:{name:`ProfileLookTableEncoding`,description:e=>({0:`Linear`,1:`sRGB`})[e]||`Unknown`},51109:`BaselineExposureOffset`,51110:{name:`DefaultBlackRender`,description:e=>({0:`Auto`,1:`None`})[e]||`Unknown`},51111:`NewRawImageDigest`,51112:`RawToPreviewGain`};function PH(e){return new TextDecoder(`utf-16`).decode(new Uint8Array(e)).replace(/\u0000+$/,``)}var FH={33434:{name:`ExposureTime`,description:MH.ExposureTime},33437:{name:`FNumber`,description:MH.FNumber},34850:{name:`ExposureProgram`,description:MH.ExposureProgram},34852:`SpectralSensitivity`,34855:`ISOSpeedRatings`,34856:{name:`OECF`,description:()=>`[Raw OECF table data]`},34858:`TimeZoneOffset`,34859:`SelfTimerMode`,34864:{name:`SensitivityType`,description:e=>({1:`Standard Output Sensitivity`,2:`Recommended Exposure Index`,3:`ISO Speed`,4:`Standard Output Sensitivity and Recommended Exposure Index`,5:`Standard Output Sensitivity and ISO Speed`,6:`Recommended Exposure Index and ISO Speed`,7:`Standard Output Sensitivity, Recommended Exposure Index and ISO Speed`})[e]||`Unknown`},34865:`StandardOutputSensitivity`,34866:`RecommendedExposureIndex`,34867:`ISOSpeed`,34868:`ISOSpeedLatitudeyyy`,34869:`ISOSpeedLatitudezzz`,36864:{name:`ExifVersion`,description:e=>pR(e)},36867:`DateTimeOriginal`,36868:`DateTimeDigitized`,36873:`GooglePlusUploadCode`,36880:`OffsetTime`,36881:`OffsetTimeOriginal`,36882:`OffsetTimeDigitized`,37121:{name:`ComponentsConfiguration`,description:MH.ComponentsConfiguration},37122:`CompressedBitsPerPixel`,37377:{name:`ShutterSpeedValue`,description:MH.ShutterSpeedValue},37378:{name:`ApertureValue`,description:MH.ApertureValue},37379:`BrightnessValue`,37380:`ExposureBiasValue`,37381:{name:`MaxApertureValue`,description:e=>(Math.sqrt(2)**+(e[0]/e[1])).toFixed(2)},37382:{name:`SubjectDistance`,description:e=>e[0]/e[1]+` m`},37383:{name:`MeteringMode`,description:MH.MeteringMode},37384:{name:`LightSource`,description:MH.LightSource},37385:{name:`Flash`,description:e=>e===0?`Flash did not fire`:e===1?`Flash fired`:e===5?`Strobe return light not detected`:e===7?`Strobe return light detected`:e===9?`Flash fired, compulsory flash mode`:e===13?`Flash fired, compulsory flash mode, return light not detected`:e===15?`Flash fired, compulsory flash mode, return light detected`:e===16?`Flash did not fire, compulsory flash mode`:e===24?`Flash did not fire, auto mode`:e===25?`Flash fired, auto mode`:e===29?`Flash fired, auto mode, return light not detected`:e===31?`Flash fired, auto mode, return light detected`:e===32?`No flash function`:e===65?`Flash fired, red-eye reduction mode`:e===69?`Flash fired, red-eye reduction mode, return light not detected`:e===71?`Flash fired, red-eye reduction mode, return light detected`:e===73?`Flash fired, compulsory flash mode, red-eye reduction mode`:e===77?`Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected`:e===79?`Flash fired, compulsory flash mode, red-eye reduction mode, return light detected`:e===89?`Flash fired, auto mode, red-eye reduction mode`:e===93?`Flash fired, auto mode, return light not detected, red-eye reduction mode`:e===95?`Flash fired, auto mode, return light detected, red-eye reduction mode`:`Unknown`},37386:{name:`FocalLength`,description:MH.FocalLength},37393:`ImageNumber`,37394:{name:`SecurityClassification`,description:e=>({C:`Confidential`,R:`Restricted`,S:`Secret`,T:`Top Secret`,U:`Unclassified`})[e]||`Unknown`},37395:`ImageHistory`,37396:{name:`SubjectArea`,description:e=>e.length===2?`Location; X: ${e[0]}, Y: ${e[1]}`:e.length===3?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:e.length===4?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:`Unknown`},37500:{name:`MakerNote`,description:()=>`[Raw maker note data]`},37510:{name:`UserComment`,description:mz},37520:`SubSecTime`,37521:`SubSecTimeOriginal`,37522:`SubSecTimeDigitized`,37724:`ImageSourceData`,37888:{name:`AmbientTemperature`,description:e=>e[0]/e[1]+` °C`},37889:{name:`Humidity`,description:e=>e[0]/e[1]+` %`},37890:{name:`Pressure`,description:e=>e[0]/e[1]+` hPa`},37891:{name:`WaterDepth`,description:e=>e[0]/e[1]+` m`},37892:{name:`Acceleration`,description:e=>e[0]/e[1]+` mGal`},37893:{name:`CameraElevationAngle`,description:e=>e[0]/e[1]+` °`},40960:{name:`FlashpixVersion`,description:e=>e.map(e=>String.fromCharCode(e)).join(``)},40961:{name:`ColorSpace`,description:MH.ColorSpace},40962:`PixelXDimension`,40963:`PixelYDimension`,40964:`RelatedSoundFile`,40965:`Interoperability IFD Pointer`,41483:`FlashEnergy`,41484:{name:`SpatialFrequencyResponse`,description:()=>`[Raw SFR table data]`},41486:`FocalPlaneXResolution`,41487:`FocalPlaneYResolution`,41488:{name:`FocalPlaneResolutionUnit`,description:MH.FocalPlaneResolutionUnit},41492:{name:`SubjectLocation`,description:([e,t])=>`X: ${e}, Y: ${t}`},41493:`ExposureIndex`,41495:{name:`SensingMethod`,description:e=>e===1?`Undefined`:e===2?`One-chip color area sensor`:e===3?`Two-chip color area sensor`:e===4?`Three-chip color area sensor`:e===5?`Color sequential area sensor`:e===7?`Trilinear sensor`:e===8?`Color sequential linear sensor`:`Unknown`},41728:{name:`FileSource`,description:e=>e===3?`DSC`:`Unknown`},41729:{name:`SceneType`,description:e=>e===1?`A directly photographed image`:`Unknown`},41730:{name:`CFAPattern`,description:()=>`[Raw CFA pattern table data]`},41985:{name:`CustomRendered`,description:MH.CustomRendered},41986:{name:`ExposureMode`,description:MH.ExposureMode},41987:{name:`WhiteBalance`,description:MH.WhiteBalance},41988:{name:`DigitalZoomRatio`,description:e=>e[0]===0?`Digital zoom was not used`:``+e[0]/e[1]},41989:{name:`FocalLengthIn35mmFilm`,description:MH.FocalLengthIn35mmFilm},41990:{name:`SceneCaptureType`,description:MH.SceneCaptureType},41991:{name:`GainControl`,description:e=>e===0?`None`:e===1?`Low gain up`:e===2?`High gain up`:e===3?`Low gain down`:e===4?`High gain down`:`Unknown`},41992:{name:`Contrast`,description:MH.Contrast},41993:{name:`Saturation`,description:MH.Saturation},41994:{name:`Sharpness`,description:MH.Sharpness},41995:{name:`DeviceSettingDescription`,description:()=>`[Raw device settings table data]`},41996:{name:`SubjectDistanceRange`,description:e=>e===1?`Macro`:e===2?`Close view`:e===3?`Distant view`:`Unknown`},42016:`ImageUniqueID`,42032:`CameraOwnerName`,42033:`BodySerialNumber`,42034:{name:`LensSpecification`,description:e=>{let t=`${parseFloat((e[0][0]/e[0][1]).toFixed(5))}-${parseFloat((e[1][0]/e[1][1]).toFixed(5))} mm`;if(e[3][1]===0)return`${t} f/?`;let n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${t} f/${parseFloat(n.toFixed(5))}`}},42035:`LensMake`,42036:`LensModel`,42037:`LensSerialNumber`,42080:{name:`CompositeImage`,description:e=>({1:`Not a Composite Image`,2:`General Composite Image`,3:`Composite Image Captured While Shooting`})[e]||`Unknown`},42081:`SourceImageNumberOfCompositeImage`,42082:`SourceExposureTimesOfCompositeImage`,42240:`Gamma`,59932:`Padding`,59933:`OffsetSchema`,65e3:`OwnerName`,65001:`SerialNumber`,65002:`Lens`,65100:`RawFile`,65101:`Converter`,65102:`WhiteBalance`,65105:`Exposure`,65106:`Shadows`,65107:`Brightness`,65108:`Contrast`,65109:`Saturation`,65110:`Sharpness`,65111:`Smoothness`,65112:`MoireFilter`},IH={0:{name:`GPSVersionID`,description:e=>e[0]===2&&e[1]===2&&e[2]===0&&e[3]===0?`Version 2.2`:`Unknown`},1:{name:`GPSLatitudeRef`,description:e=>{let t=e.join(``);return t===`N`?`North latitude`:t===`S`?`South latitude`:`Unknown`}},2:{name:`GPSLatitude`,description:hz},3:{name:`GPSLongitudeRef`,description:e=>{let t=e.join(``);return t===`E`?`East longitude`:t===`W`?`West longitude`:`Unknown`}},4:{name:`GPSLongitude`,description:hz},5:{name:`GPSAltitudeRef`,description:e=>e===0?`Sea level`:e===1?`Sea level reference (negative value)`:`Unknown`},6:{name:`GPSAltitude`,description:e=>e[0]/e[1]+` m`},7:{name:`GPSTimeStamp`,description:e=>e.map(([e,t])=>{let n=e/t;return/^\d(\.|$)/.test(`${n}`)?`0${n}`:n}).join(`:`)},8:`GPSSatellites`,9:{name:`GPSStatus`,description:e=>{let t=e.join(``);return t===`A`?`Measurement in progress`:t===`V`?`Measurement Interoperability`:`Unknown`}},10:{name:`GPSMeasureMode`,description:e=>{let t=e.join(``);return t===`2`?`2-dimensional measurement`:t===`3`?`3-dimensional measurement`:`Unknown`}},11:`GPSDOP`,12:{name:`GPSSpeedRef`,description:e=>{let t=e.join(``);return t===`K`?`Kilometers per hour`:t===`M`?`Miles per hour`:t===`N`?`Knots`:`Unknown`}},13:`GPSSpeed`,14:{name:`GPSTrackRef`,description:e=>{let t=e.join(``);return t===`T`?`True direction`:t===`M`?`Magnetic direction`:`Unknown`}},15:`GPSTrack`,16:{name:`GPSImgDirectionRef`,description:e=>{let t=e.join(``);return t===`T`?`True direction`:t===`M`?`Magnetic direction`:`Unknown`}},17:`GPSImgDirection`,18:`GPSMapDatum`,19:{name:`GPSDestLatitudeRef`,description:e=>{let t=e.join(``);return t===`N`?`North latitude`:t===`S`?`South latitude`:`Unknown`}},20:{name:`GPSDestLatitude`,description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:`GPSDestLongitudeRef`,description:e=>{let t=e.join(``);return t===`E`?`East longitude`:t===`W`?`West longitude`:`Unknown`}},22:{name:`GPSDestLongitude`,description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:`GPSDestBearingRef`,description:e=>{let t=e.join(``);return t===`T`?`True direction`:t===`M`?`Magnetic direction`:`Unknown`}},24:`GPSDestBearing`,25:{name:`GPSDestDistanceRef`,description:e=>{let t=e.join(``);return t===`K`?`Kilometers`:t===`M`?`Miles`:t===`N`?`Knots`:`Unknown`}},26:`GPSDestDistance`,27:{name:`GPSProcessingMethod`,description:mz},28:{name:`GPSAreaInformation`,description:mz},29:`GPSDateStamp`,30:{name:`GPSDifferential`,description:e=>e===0?`Measurement without differential correction`:e===1?`Differential correction applied`:`Unknown`},31:`GPSHPositioningError`},LH={1:`InteroperabilityIndex`,2:{name:`InteroperabilityVersion`,description:e=>pR(e)},4096:`RelatedImageFileFormat`,4097:`RelatedImageWidth`,4098:`RelatedImageHeight`},RH={45056:{name:`MPFVersion`,description:e=>pR(e)},45057:`NumberOfImages`,45058:`MPEntry`,45059:`ImageUIDList`,45060:`TotalFrames`},zH={1:{name:`CameraSettings`,description:e=>e},4:{name:`ShotInfo`,description:e=>e},149:`LensModel`},BH={0:{name:`PentaxVersion`,description:e=>e.join(`.`)},5:`PentaxModelID`,555:`LevelInfo`},VH=Q.USE_EXIF?vR({},NH,FH):{},HH=`exif`,UH=`interoperability`,WH=`canon`,GH=`pentax`,KH={"0th":VH,"1st":Q.USE_EXIF?NH:{},[HH]:VH,gps:Q.USE_EXIF?IH:{},[UH]:Q.USE_EXIF?LH:{},mpf:Q.USE_MPF?RH:{},[WH]:Q.USE_MAKER_NOTES?zH:{},[GH]:Q.USE_MAKER_NOTES?BH:{}},qH={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},JH={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},$={getAsciiValue:YH,getByteAt:XH,getAsciiAt:ZH,getShortAt:QH,getLongAt:$H,getRationalAt:eU,getUndefinedAt:tU,getSlongAt:nU,getSrationalAt:rU,getIfdPointerAt:iU,typeSizes:qH,tagTypes:JH,getTypeSize:aU};function YH(e){return e.map(e=>String.fromCharCode(e))}function XH(e,t){return e.getUint8(t)}function ZH(e,t){return e.getUint8(t)}function QH(e,t,n){return e.getUint16(t,n===vz.LITTLE_ENDIAN)}function $H(e,t,n){return e.getUint32(t,n===vz.LITTLE_ENDIAN)}function eU(e,t,n){return[$H(e,t,n),$H(e,t+4,n)]}function tU(e,t){return XH(e,t)}function nU(e,t,n){return e.getInt32(t,n===vz.LITTLE_ENDIAN)}function rU(e,t,n){return[nU(e,t,n),nU(e,t+4,n)]}function iU(e,t,n){return $H(e,t,n)}function aU(e){if(JH[e]===void 0)throw Error(`No such type found.`);return qH[JH[e]]}var oU={exif:!0,iptc:!0,photoshop:!0,mpf:!0,makerNotes:!0},sU={exif:!0,iptc:!0,xmp:!0,icc:!0,photoshop:!0,makerNotes:!0,mpf:!0,file:!0,jfif:!0,png:!0,riff:!0,gif:!0,gps:!0,composite:!0,thumbnail:!0},cU={exifIfdPointer:`Exif IFD Pointer`,gpsInfoIfdPointer:`GPS Info IFD Pointer`,interoperabilityIfdPointer:`Interoperability IFD Pointer`},lU={thumbnail:[`JPEGInterchangeFormat`,`JPEGInterchangeFormatLength`],iptc:[`IPTC-NAA`],xmp:[`ApplicationNotes`],icc:[`ICC_Profile`],photoshop:[`ImageSourceData`,`PhotoshopSettings`],makerNotes:[`MakerNote`,`Make`],gps:[`GPSLatitude`,`GPSLatitudeRef`,`GPSLongitude`,`GPSLongitudeRef`,`GPSAltitude`,`GPSAltitudeRef`]},uU={file:[`Image Width`,`Image Height`],exif:[`FocalLength`,`FocalPlaneXResolution`,`FocalPlaneYResolution`,`FocalPlaneResolutionUnit`,`FocalLengthIn35mmFilm`]};function dU(e){let t=Object.create(null);if(!e)return t;Array.isArray(e.exif)&&e.exif.length>0&&(t[cU.exifIfdPointer]=!0,n(t,e.exif));for(let n in lU)if(fU(e[n])){let e=lU[n];for(let n=0;n<e.length;n++)t[e[n]]=!0;t[cU.exifIfdPointer]=!0}return fU(e.gps)&&(t[cU.gpsInfoIfdPointer]=!0,t[cU.exifIfdPointer]=!0),t;function n(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(typeof r!=`string`)continue;let i=r.toLowerCase();i.indexOf(`gps`)===0&&(e[cU.gpsInfoIfdPointer]=!0),(i.indexOf(`interoperability`)===0||i.indexOf(`relatedimage`)===0)&&(e[cU.interoperabilityIfdPointer]=!0)}}}function fU(e){return e===!0||Array.isArray(e)&&e.length>0}function pU({includeTags:e,excludeTags:t}={}){let n=!!e,r=!!t,i=n||r,a=Object.create(null),o=Object.create(null),s=Object.create(null);if(!i)return mU();let c=n&&(yU(e,`iptc`)||yU(e,`xmp`)||yU(e,`icc`)||yU(e,`photoshop`)||yU(e,`makerNotes`)||yU(e,`thumbnail`)||yU(e,`gps`)||yU(e,`composite`)),l=n&&yU(e,`composite`),u=Object.create(null);n&&(u=gU(e));let d=Object.create(null);n&&l&&(d=TU(uU.file));for(let i in sU){let f=n&&Object.prototype.hasOwnProperty.call(e,i),p=r&&Object.prototype.hasOwnProperty.call(t,i),m;p&&!f&&(m=t[i]);let h=xU({groupKey:i,includeValue:f?e[i]:void 0,excludeValue:m,extraIncludeNames:Object.create(null)});a[i]=!n||f,f&&bU(e[i])&&(a[i]=!1),h.excludeAll&&(a[i]=!1),o[i]=h,s[i]=xU({groupKey:i,includeValue:_U({groupKey:i,hasIncludeTags:n,hasIncludeEntry:f,includeTags:e,shouldParseExif:c,shouldParseFile:l}),excludeValue:m,extraIncludeNames:vU({groupKey:i,hasIncludeTags:n,hasIncludeEntry:f,shouldParseExif:c,shouldParseFile:l,exifIncludeDependencies:u,fileIncludeDependencies:d})})}return{isActive:i,shouldReturnGroup:f,shouldParseGroup:p,shouldReturnTag:m,shouldParseTag:h};function f(e){return!sU[e]||!!a[e]}function p(e){return!sU[e]||f(e)?!0:e===`exif`?c:e===`file`&&l}function m(e,t,n){return sU[e]?f(e)?SU(o[e],t,n):!1:!0}function h(e,t,n){return sU[e]?p(e)?SU(s[e],t,n):!1:!0}}function mU(){return{isActive:!1,shouldReturnGroup:e,shouldParseGroup:e,shouldReturnTag:e,shouldParseTag:e};function e(){return!0}}var hU=mU();function gU(e){let t=dU(e);return yU(e,`composite`)&&EU(t,uU.exif),t}function _U({groupKey:e,hasIncludeTags:t,hasIncludeEntry:n,includeTags:r,shouldParseExif:i,shouldParseFile:a}){if(!t)return!0;if(n)return e===`thumbnail`&&Array.isArray(r[e])?!0:r[e];if(e===`exif`&&i||e===`file`&&a)return[]}function vU({groupKey:e,hasIncludeTags:t,hasIncludeEntry:n,shouldParseExif:r,shouldParseFile:i,exifIncludeDependencies:a,fileIncludeDependencies:o}){return t?e===`exif`&&(r||n&&Object.keys(a).length>0)?a:e===`file`&&i?o:Object.create(null):Object.create(null)}function yU(e,t){if(!e||!Object.prototype.hasOwnProperty.call(e,t))return!1;let n=e[t];return n===!0||Array.isArray(n)&&n.length>0}function bU(e){return Array.isArray(e)&&e.length===0}function xU({groupKey:e,includeValue:t,excludeValue:n,extraIncludeNames:r}){let i=!!oU[e],a={includeAll:!1,includeNames:void 0,includeIds:void 0,excludeAll:!1,excludeNames:void 0,excludeIds:void 0};if(t===!0)a.includeAll=!0;else if(Array.isArray(t)){a.includeNames=Object.create(null),i&&(a.includeIds=Object.create(null));for(let e=0;e<t.length;e++)o(a,t[e]);for(let e in r)a.includeNames[e.toLowerCase()]=!0}else if(r&&Object.keys(r).length>0){a.includeNames=Object.create(null);for(let e in r)a.includeNames[e.toLowerCase()]=!0}if(n===!0)return a.excludeAll=!0,a;if(Array.isArray(n)){a.excludeNames=Object.create(null),i&&(a.excludeIds=Object.create(null));for(let e=0;e<n.length;e++)s(a,n[e])}return a;function o(e,t){if(typeof t==`number`&&e.includeIds){e.includeIds[String(t)]=!0;return}typeof t==`string`&&(e.includeNames[t.toLowerCase()]=!0)}function s(e,t){if(typeof t==`number`&&e.excludeIds){e.excludeIds[String(t)]=!0;return}typeof t==`string`&&(e.excludeNames[t.toLowerCase()]=!0)}}function SU(e,t,n){return e.excludeAll?!1:e.includeAll||!e.includeNames&&!e.includeIds||CU(e,t,n)?!wU(e,t,n):!1}function CU(e,t,n){return!!(n!==void 0&&e.includeIds&&e.includeIds[String(n)]||t&&e.includeNames&&e.includeNames[String(t).toLowerCase()])}function wU(e,t,n){return!!(n!==void 0&&e.excludeIds&&e.excludeIds[String(n)]||t&&e.excludeNames&&e.excludeNames[String(t).toLowerCase()])}function TU(e){let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].toLowerCase()]=!0;return t}function EU(e,t){for(let n=0;n<t.length;n++)e[t[n]]=!0}var DU=4,OU={1:$.getByteAt,2:$.getAsciiAt,3:$.getShortAt,4:$.getLongAt,5:$.getRationalAt,7:$.getUndefinedAt,9:$.getSlongAt,10:$.getSrationalAt,13:$.getIfdPointerAt};function kU(e,t,n){let r=t+4;if(!(r+$.getTypeSize(`LONG`)>e.byteLength))return t+$.getLongAt(e,r,n)}function AU(e,t,n,r,i,a,o=!1,s=hU,c=`exif`,l=jU(e)){let u=$.getTypeSize(`SHORT`),d={},f=MU(e,r,i);r+=u;for(let u=0;u<f&&!(r+12>e.byteLength);u++){let u=NU(e,t,n,r,i,a,s,c,l);u!==void 0&&(d[u.name]={id:u.id,value:u.value,description:u.description},o&&(d[u.name].computed=HU(u.tagType,u.value)),(u.name===`MakerNote`||t===`pentax`&&u.name===`LevelInfo`)&&(d[u.name].__offset=u.__offset)),r+=12}if(Q.USE_THUMBNAIL&&r<e.byteLength-$.getTypeSize(`LONG`)){let c=$.getLongAt(e,r,i);c!==0&&t===`0th`&&s.shouldParseGroup(`thumbnail`)&&(d.Thumbnail=AU(e,`1st`,n,n+c,i,a,o,s,`thumbnail`,l))}return d}function jU(e){return{remaining:e.byteLength*DU}}function MU(e,t,n){return t+$.getTypeSize(`SHORT`)<=e.byteLength?$.getShortAt(e,t,n):0}function NU(e,t,n,r,i,a=!1,o=hU,s=`exif`,c){let l=$.getTypeSize(`SHORT`),u=l+$.getTypeSize(`SHORT`),d=u+$.getTypeSize(`LONG`),f=$.getShortAt(e,r,i),p=$.getShortAt(e,r+l,i),m=$.getLongAt(e,r+u,i),h,g;if($.typeSizes[p]===void 0||!a&&KH[t][f]===void 0)return;let _=PU(t,f);if(!o.shouldParseTag(s,_,f))return;if(FU(p,m))g=r+d,h=IU(e,g,p,m,i);else if(g=$.getLongAt(e,r+d,i),LU(e,n,g,p,m)){let t=f===33723,r=RU(c.remaining,p,m);c.remaining-=r*$.typeSizes[p],h=IU(e,n+g,p,r,i,t)}else h=`<faulty value>`;p===$.tagTypes.ASCII&&(h=zU(h),h=BU(h));let v=h;if(KH[t][f]!==void 0){if(KH[t][f].name!==void 0&&KH[t][f].description!==void 0)try{v=KH[t][f].description(h)}catch{v=VU(h)}else v=p===$.tagTypes.RATIONAL||p===$.tagTypes.SRATIONAL?``+h[0]/h[1]:VU(h)}return{id:f,name:_,value:h,description:v,tagType:p,__offset:g}}function PU(e,t){if(KH[e][t]!==void 0){if(typeof KH[e][t]==`string`)return KH[e][t];if(KH[e][t].name)return KH[e][t].name}return`undefined-${t}`}function FU(e,t){return $.typeSizes[e]*t<=$.getTypeSize(`LONG`)}function IU(e,t,n,r,i,a=!1){let o=[];a&&(r*=$.typeSizes[n],n=$.tagTypes.BYTE);for(let a=0;a<r;a++)o.push(OU[n](e,t,i)),t+=$.typeSizes[n];return n===$.tagTypes.ASCII?o=$.getAsciiValue(o):o.length===1&&(o=o[0]),o}function LU(e,t,n,r,i){return t+n+$.typeSizes[r]*i<=e.byteLength}function RU(e,t,n){let r=Math.min(n,Math.floor(e/$.typeSizes[t]));return r===1&&n>1?0:r}function zU(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(e[r]===`\0`){n++;continue}t[n]===void 0&&(t[n]=``),t[n]+=e[r]}return t}function BU(e){return e.map(e=>mR(e))}function VU(e){return e instanceof Array?e.join(`, `):e}function HU(e,t){return e===$.tagTypes.ASCII?Array.isArray(t)&&t.length===1?t[0]:t:e===$.tagTypes.RATIONAL||e===$.tagTypes.SRATIONAL?UU(t)?WU(t):Array.isArray(t)?t.map(e=>WU(e)):t:t}function UU(e){return!Array.isArray(e)||e.length!==2?!1:typeof e[0]==`number`&&typeof e[1]==`number`}function WU(e){if(!Array.isArray(e)||e.length!==2)return e;let t=e[0],n=e[1];return!Number.isFinite(t)||!Number.isFinite(n)?e:n===0?null:t/n}var GU=[{pointerKey:`Exif IFD Pointer`,ifdType:HH},{pointerKey:`GPS Info IFD Pointer`,ifdType:`gps`},{pointerKey:`Interoperability IFD Pointer`,ifdType:UH}],KU={read:qU};function qU(e,t,n,r=!1,i=void 0){let a=vz.getByteOrder(e,t),o=jU(e),s=JU(e,t,a,n,r,i,o);for(let c=0;c<GU.length;c++)s=YU(GU[c],s,e,t,a,n,r,i,o);return{tags:s,byteOrder:a}}function JU(e,t,n,r,i,a,o){let s=kU(e,t,n);return s===void 0?{}:AU(e,`0th`,t,s,n,r,i,a,`exif`,o)}function YU(e,t,n,r,i,a,o,s,c){let l=t[e.pointerKey];return l===void 0?t:vR(t,AU(n,e.ifdType,r,r+l.value,i,a,o,s,`exif`,c))}var XU={read:$U},ZU=16,QU=8;function $U(e,t,n,r=!1,i=void 0){try{let a=vz.getByteOrder(e,t),o=kU(e,t,a);return o===void 0?{}:eW(e,t,AU(e,`mpf`,t,o,a,n,r,i,`mpf`),a)}catch{return{}}}function eW(e,t,n,r){if(!n.MPEntry)return n;let i=e.byteLength,a=e.byteOffset||0,o=i*QU,s=[];for(let c=0;c<Math.ceil(n.MPEntry.value.length/ZU);c++){s[c]={};let l=tW(n.MPEntry.value,c*ZU,$.getTypeSize(`LONG`),r);s[c].ImageFlags=nW(l),s[c].ImageFormat=rW(l),s[c].ImageType=iW(l);let u=tW(n.MPEntry.value,c*ZU+4,$.getTypeSize(`LONG`),r);s[c].ImageSize={value:u,description:``+u};let d=aW(c,n.MPEntry,r,t);s[c].ImageOffset={value:d,description:``+d};let f=tW(n.MPEntry.value,c*ZU+12,$.getTypeSize(`SHORT`),r);s[c].DependentImage1EntryNumber={value:f,description:``+f};let p=tW(n.MPEntry.value,c*ZU+14,$.getTypeSize(`SHORT`),r);s[c].DependentImage2EntryNumber={value:p,description:``+p};let m=Math.min(Math.max(d,0),i),h=Math.min(m+Math.max(u,0),i,m+o);s[c].image=e.buffer.slice(a+m,a+h),o-=h-m,bR(s[c],`base64`,function(){return xR(this.image)})}return n.Images=s,n}function tW(e,t,n,r){if(r===vz.LITTLE_ENDIAN){let r=0;for(let i=0;i<n;i++)r+=e[t+i]<<8*i;return r}let i=0;for(let r=0;r<n;r++)i+=e[t+r]<<8*(n-1-r);return i}function nW(e){let t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push(`Dependent Parent Image`),t[1]&&n.push(`Dependent Child Image`),t[2]&&n.push(`Representative Image`),{value:t,description:n.join(`, `)||`None`}}function rW(e){let t=e>>24&7;return{value:t,description:t===0?`JPEG`:`Unknown`}}function iW(e){let t=e&16777215;return{value:t,description:{196608:`Baseline MP Primary Image`,65537:`Large Thumbnail (VGA equivalent)`,65538:`Large Thumbnail (Full HD equivalent)`,131073:`Multi-Frame Image (Panorama)`,131074:`Multi-Frame Image (Disparity)`,131075:`Multi-Frame Image (Multi-Angle)`,0:`Undefined`}[t]||`Unknown`}}function aW(e,t,n,r){return oW(e)?0:tW(t.value,e*ZU+8,$.getTypeSize(`LONG`),n)+r}function oW(e){return e===0}var sW={read:cW};function cW(e,t){let n=lW(e,t),r=pW(e,t,n);return{"Bits Per Sample":uW(e,t,n),"Image Height":dW(e,t,n),"Image Width":fW(e,t,n),"Color Components":r,Subsampling:r&&mW(e,t,r.value,n)}}function lW(e,t){return Math.min($.getShortAt(e,t),e.byteLength-t)}function uW(e,t,n){if(3>n)return;let r=$.getByteAt(e,t+2);return{value:r,description:``+r}}function dW(e,t,n){if(5>n)return;let r=$.getShortAt(e,t+3);return{value:r,description:`${r}px`}}function fW(e,t,n){if(7>n)return;let r=$.getShortAt(e,t+5);return{value:r,description:`${r}px`}}function pW(e,t,n){if(8>n)return;let r=$.getByteAt(e,t+7);return{value:r,description:``+r}}function mW(e,t,n,r){if(8+3*n>r)return;let i=[];for(let r=0;r<n;r++){let n=t+8+r*3;i.push([$.getByteAt(e,n),$.getByteAt(e,n+1),$.getByteAt(e,n+2)])}return{value:i,description:i.length>1?hW(i)+gW(i):``}}function hW(e){let t={1:`Y`,2:`Cb`,3:`Cr`,4:`I`,5:`Q`};return e.map(e=>t[e[0]]).join(``)}function gW(e){let t={17:`4:4:4 (1 1)`,18:`4:4:0 (1 2)`,20:`4:4:1 (1 4)`,33:`4:2:2 (2 1)`,34:`4:2:0 (2 2)`,36:`4:2:1 (2 4)`,65:`4:1:1 (4 1)`,66:`4:1:0 (4 2)`};return e.length===0||e[0][1]===void 0||t[e[0][1]]===void 0?``:t[e[0][1]]}var _W={read:xW},vW=2,yW=[9,13,18,30],bW=[0,1,12/10,4/3,3/2,16/9,5/4,2];function xW(e,t){let n={};try{let{height:r,width:i}=SW(wW(e,t+vW));n[`Image Height`]={value:r,description:`${r}px`},n[`Image Width`]={value:i,description:`${i}px`}}catch{}return n}function SW(e){let t=e.readBits(1),n,r;if(t){n=(e.readBits(5)+1)*8;let t=e.readBits(3);r=t===0?(e.readBits(5)+1)*8:Math.ceil(n*bW[t])}else{n=CW(e);let t=e.readBits(3);r=t===0?CW(e):Math.ceil(n*bW[t])}return{height:n,width:r}}function CW(e){let t=e.readBits(2);return 1+e.readBits(yW[t])}function wW(e,t){let n=t,r=0;return{readBits(t){let i=0;for(let a=0;a<t;a++){if(n>=e.byteLength)throw Error(`Unexpected end of data`);let t=e.getUint8(n)>>r&1;i|=t<<a,r++,r>=8&&(r=0,n++)}return i}}}var TW={read:EW};function EW(e,t){let n=DW(e,t),r=NW(e,t,n),i=PW(e,t,n),a={"JFIF Version":OW(e,t,n),"Resolution Unit":kW(e,t,n),XResolution:jW(e,t,n),YResolution:MW(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(r!==void 0&&i!==void 0){let o=FW(e,t,3*r.value*i.value,n);o&&(a[`JFIF Thumbnail`]=o)}for(let e in a)a[e]===void 0&&delete a[e];return a}function DW(e,t){return Math.min($.getShortAt(e,t),e.byteLength-t)}function OW(e,t,n){if(9>n)return;let r=$.getByteAt(e,t+7),i=$.getByteAt(e,t+7+1);return{value:r*256+i,description:r+`.`+i}}function kW(e,t,n){if(10>n)return;let r=$.getByteAt(e,t+9);return{value:r,description:AW(r)}}function AW(e){return e===0?`None`:e===1?`inches`:e===2?`cm`:`Unknown`}function jW(e,t,n){if(12>n)return;let r=$.getShortAt(e,t+10);return{value:r,description:``+r}}function MW(e,t,n){if(14>n)return;let r=$.getShortAt(e,t+12);return{value:r,description:``+r}}function NW(e,t,n){if(15>n)return;let r=$.getByteAt(e,t+14);return{value:r,description:`${r}px`}}function PW(e,t,n){if(16>n)return;let r=$.getByteAt(e,t+15);return{value:r,description:`${r}px`}}function FW(e,t,n,r){if(n===0||16+n>r)return;let i=e.byteOffset||0;return{value:e.buffer.slice(i+t+16,i+t+16+n),description:`<24-bit RGB pixel data>`}}var IW={iptc:{256:{name:`Model Version`,description:e=>((e[0]<<8)+e[1]).toString()},261:{name:`Destination`,repeatable:!0},276:{name:`File Format`,description:e=>((e[0]<<8)+e[1]).toString()},278:{name:`File Format Version`,description:e=>((e[0]<<8)+e[1]).toString()},286:`Service Identifier`,296:`Envelope Number`,306:`Product ID`,316:`Envelope Priority`,326:{name:`Date Sent`,description:LW},336:{name:`Time Sent`,description:RW},346:{name:`Coded Character Set`,description:zW,encoding_name:zW},356:`UNO`,376:{name:`ARM Identifier`,description:e=>((e[0]<<8)+e[1]).toString()},378:{name:`ARM Version`,description:e=>((e[0]<<8)+e[1]).toString()},512:{name:`Record Version`,description:e=>((e[0]<<8)+e[1]).toString()},515:`Object Type Reference`,516:`Object Attribute Reference`,517:`Object Name`,519:`Edit Status`,520:{name:`Editorial Update`,description:e=>pR(e)===`01`?`Additional Language`:`Unknown`},522:`Urgency`,524:{name:`Subject Reference`,repeatable:!0,description:e=>{let t=pR(e).split(`:`);return t[2]+(t[3]?`/`+t[3]:``)+(t[4]?`/`+t[4]:``)}},527:`Category`,532:{name:`Supplemental Category`,repeatable:!0},534:`Fixture Identifier`,537:{name:`Keywords`,repeatable:!0},538:{name:`Content Location Code`,repeatable:!0},539:{name:`Content Location Name`,repeatable:!0},542:`Release Date`,547:`Release Time`,549:`Expiration Date`,550:`Expiration Time`,552:`Special Instructions`,554:{name:`Action Advised`,description:e=>{let t=pR(e);return t===`01`?`Object Kill`:t===`02`?`Object Replace`:t===`03`?`Object Append`:t===`04`?`Object Reference`:`Unknown`}},557:{name:`Reference Service`,repeatable:!0},559:{name:`Reference Date`,repeatable:!0},562:{name:`Reference Number`,repeatable:!0},567:{name:`Date Created`,description:LW},572:{name:`Time Created`,description:RW},574:{name:`Digital Creation Date`,description:LW},575:{name:`Digital Creation Time`,description:RW},577:`Originating Program`,582:`Program Version`,587:{name:`Object Cycle`,description:e=>{let t=pR(e);return t===`a`?`morning`:t===`p`?`evening`:t===`b`?`both`:`Unknown`}},592:{name:`By-line`,repeatable:!0},597:{name:`By-line Title`,repeatable:!0},602:`City`,604:`Sub-location`,607:`Province/State`,612:`Country/Primary Location Code`,613:`Country/Primary Location Name`,615:`Original Transmission Reference`,617:`Headline`,622:`Credit`,627:`Source`,628:`Copyright Notice`,630:{name:`Contact`,repeatable:!0},632:`Caption/Abstract`,634:{name:`Writer/Editor`,repeatable:!0},637:{name:`Rasterized Caption`,description:e=>e},642:`Image Type`,643:{name:`Image Orientation`,description:e=>{let t=pR(e);return t===`P`?`Portrait`:t===`L`?`Landscape`:t===`S`?`Square`:`Unknown`}},647:`Language Identifier`,662:{name:`Audio Type`,description:e=>{let t=pR(e),n=t.charAt(0),r=t.charAt(1),i=``;return n===`1`?i+=`Mono`:n===`2`&&(i+=`Stereo`),r===`A`?i+=`, actuality`:r===`C`?i+=`, question and answer session`:r===`M`?i+=`, music, transmitted by itself`:r===`Q`?i+=`, response to a question`:r===`R`?i+=`, raw sound`:r===`S`?i+=`, scener`:r===`V`?i+=`, voicer`:r===`W`&&(i+=`, wrap`),i===``?t:i}},663:{name:`Audio Sampling Rate`,description:e=>parseInt(pR(e),10)+` Hz`},664:{name:`Audio Sampling Resolution`,description:e=>{let t=parseInt(pR(e),10);return t+(t===1?` bit`:` bits`)}},665:{name:`Audio Duration`,description:e=>{let t=pR(e);return t.length>=6?t.substr(0,2)+`:`+t.substr(2,2)+`:`+t.substr(4,2):t}},666:`Audio Outcue`,698:`Short Document ID`,699:`Unique Document ID`,700:`Owner ID`,712:{name:e=>e.length===2?`ObjectData Preview File Format`:`Record 2 destination`,description:e=>{if(e.length===2){let t=(e[0]<<8)+e[1];return t===0?`No ObjectData`:t===1?`IPTC-NAA Digital Newsphoto Parameter Record`:t===2?`IPTC7901 Recommended Message Format`:t===3?`Tagged Image File Format (Adobe/Aldus Image data)`:t===4?`Illustrator (Adobe Graphics data)`:t===5?`AppleSingle (Apple Computer Inc)`:t===6?`NAA 89-3 (ANPA 1312)`:t===7?`MacBinary II`:t===8?`IPTC Unstructured Character Oriented File Format (UCOFF)`:t===9?`United Press International ANPA 1312 variant`:t===10?`United Press International Down-Load Message`:t===11?`JPEG File Interchange (JFIF)`:t===12?`Photo-CD Image-Pac (Eastman Kodak)`:t===13?`Microsoft Bit Mapped Graphics File [*.BMP]`:t===14?`Digital Audio File [*.WAV] (Microsoft & Creative Labs)`:t===15?`Audio plus Moving Video [*.AVI] (Microsoft)`:t===16?`PC DOS/Windows Executable Files [*.COM][*.EXE]`:t===17?`Compressed Binary File [*.ZIP] (PKWare Inc)`:t===18?`Audio Interchange File Format AIFF (Apple Computer Inc)`:t===19?`RIFF Wave (Microsoft Corporation)`:t===20?`Freehand (Macromedia/Aldus)`:t===21?`Hypertext Markup Language "HTML" (The Internet Society)`:t===22?`MPEG 2 Audio Layer 2 (Musicom), ISO/IEC`:t===23?`MPEG 2 Audio Layer 3, ISO/IEC`:t===24?`Portable Document File (*.PDF) Adobe`:t===25?`News Industry Text Format (NITF)`:t===26?`Tape Archive (*.TAR)`:t===27?`Tidningarnas Telegrambyrå NITF version (TTNITF DTD)`:t===28?`Ritzaus Bureau NITF version (RBNITF DTD)`:t===29?`Corel Draw [*.CDR]`:`Unknown format ${t}`}return pR(e)}},713:{name:`ObjectData Preview File Format Version`,description:(e,t)=>{let n={"00":{"00":`1`},"01":{"01":`1`,"02":`2`,"03":`3`,"04":`4`},"02":{"04":`4`},"03":{"01":`5.0`,"02":`6.0`},"04":{"01":`1.40`},"05":{"01":`2`},"06":{"01":`1`},11:{"01":`1.02`},20:{"01":`3.1`,"02":`4.0`,"03":`5.0`,"04":`5.5`},21:{"02":`2.0`}},r=pR(e);if(t[`ObjectData Preview File Format`]){let e=pR(t[`ObjectData Preview File Format`].value);if(n[e]&&n[e][r])return n[e][r]}return r}},714:`ObjectData Preview Data`,1802:{name:`Size Mode`,description:e=>e[0].toString()},1812:{name:`Max Subfile Size`,description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:`ObjectData Size Announced`,description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:`Maximum ObjectData Size`,description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function LW(e){let t=pR(e);return t.length>=8?t.substr(0,4)+`-`+t.substr(4,2)+`-`+t.substr(6,2):t}function RW(e){let t=pR(e),n=t;return t.length>=6&&(n=t.substr(0,2)+`:`+t.substr(2,2)+`:`+t.substr(4,2),t.length===11&&(n+=t.substr(6,1)+t.substr(7,2)+`:`+t.substr(9,2))),n}function zW(e){let t=pR(e);return t===`\x1B%G`?`UTF-8`:t===`\x1B%5`?`Windows-1252`:t===`\x1B%/G`?`UTF-8 Level 1`:t===`\x1B%/H`?`UTF-8 Level 2`:t===`\x1B%/I`?`UTF-8 Level 3`:t===`\x1B/A`?`ISO-8859-1`:t===`\x1B/B`?`ISO-8859-2`:t===`\x1B/C`?`ISO-8859-3`:t===`\x1B/D`?`ISO-8859-4`:t===`\x1B/@`?`ISO-8859-5`:t===`\x1B/G`?`ISO-8859-6`:t===`\x1B/F`?`ISO-8859-7`:t===`\x1B/H`?`ISO-8859-8`:`Unknown`}var BW={get:VW};function VW(){if(typeof TextDecoder<`u`)return TextDecoder}var HW=5,UW={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},WW={decode:GW,TAG_HEADER_SIZE:HW};function GW(e,t){if(typeof t==`string`)return mR(t);let n=BW.get();if(n!==void 0&&e!==void 0)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch{}let r=t.map(e=>String.fromCharCode(e)).join(``);try{return decodeURIComponent(escape(r))}catch{return KW(t)}}function KW(e){let t=e instanceof DataView,n=t?e.byteLength:e.length,r=t?t=>e.getUint8(t):t=>e[t],i=Array(n);for(let e=0;e<n;e++){let t=r(e),n=UW[t];i[e]=n===void 0?t:n}return String.fromCharCode.apply(null,i)}var qW=943868237,JW=4,YW=2,XW=1,ZW=4,QW=12,$W=1028,eG=5,tG={read:nG};function nG(e,t,n,r=hU){try{if(Array.isArray(e))return sG(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n,r);let{naaBlock:i,dataOffset:a}=rG(e,t);return sG(e,i,a,n,r)}catch{return{}}}function rG(e,t){for(;t+QW<=e.byteLength;){let n=iG(e,t);if(aG(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+oG(n)}throw Error(`No IPTC NAA resource block.`)}function iG(e,t){if(e.getUint32(t,!1)!==qW)throw Error(`Not an IPTC resource block.`);let n=e.getUint8(t+JW+YW),r=(n%2==0?n+1:n)+XW;return{headerSize:6+r+ZW,type:e.getUint16(t+JW),size:e.getUint32(t+JW+YW+r)}}function aG(e){return e.type===$W}function oG(e){return e.size%2==0?0:1}function sG(e,t,n,r,i){let a={},o,s=n+t.size;for(;n<s&&n<e.byteLength;){let{tag:t,tagSize:s}=cG(e,n,a,o,r,i);if(t===null)break;t&&(`encoding`in t&&(o=t.encoding),a[t.name]===void 0||t.repeatable===void 0?a[t.name]={id:t.id,value:t.value,description:t.description}:(a[t.name]instanceof Array||(a[t.name]=[{id:a[t.name].id,value:a[t.name].value,description:a[t.name].description}]),a[t.name].push({id:t.id,value:t.value,description:t.description}))),n+=eG+s}return a}function cG(e,t,n={},r=void 0,i=!1,a=hU){if(uG(e,t))return{tag:null,tagSize:0};let o=e.getUint16(t+1),s=e.getUint16(t+3);if(!i&&!IW.iptc[o]||!a.shouldParseTag(`iptc`,lG(o,i),o))return{tag:void 0,tagSize:s};let c=dG(e,t+eG,s),l={id:o,name:fG(IW.iptc[o],o,c),value:c,description:hG(IW.iptc[o],c,n,r)};return vG(o)&&(l.repeatable=!0),yG(o)&&(l.encoding=IW.iptc[o].encoding_name(c)),{tag:l,tagSize:s}}function lG(e,t){let n=IW.iptc[e];if(!n)return t?`undefined-${e}`:void 0;if(typeof n==`string`)return n;if(n&&typeof n.name==`string`)return n.name}function uG(e,t){return e.getUint8(t)!==28}function dG(e,t,n){let r=[];for(let i=0;i<n;i++)r.push(e.getUint8(t+i));return r}function fG(e,t,n){return e?pG(e)?e:mG(e)?e.name(n):e.name:`undefined-${t}`}function pG(e){return typeof e==`string`}function mG(e){return typeof e.name==`function`}function hG(e,t,n,r){if(_G(e))try{return e.description(t,n)}catch{}return gG(e,t)?WW.decode(r,t):t}function gG(e,t){return e&&t instanceof Array}function _G(e){return e&&e.description!==void 0}function vG(e){return IW.iptc[e]&&IW.iptc[e].repeatable}function yG(e){return IW.iptc[e]&&IW.iptc[e].encoding_name!==void 0}var bG={"tiff:Orientation"(e){return e===`1`?`Horizontal (normal)`:e===`2`?`Mirror horizontal`:e===`3`?`Rotate 180`:e===`4`?`Mirror vertical`:e===`5`?`Mirror horizontal and rotate 270 CW`:e===`6`?`Rotate 90 CW`:e===`7`?`Mirror horizontal and rotate 90 CW`:e===`8`?`Rotate 270 CW`:e},"tiff:ResolutionUnit":e=>MH.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>xG(MH.XResolution,e),"tiff:YResolution":e=>xG(MH.YResolution,e),"exif:ApertureValue":e=>xG(MH.ApertureValue,e),"exif:GPSLatitude":wG,"exif:GPSLongitude":wG,"exif:FNumber":e=>xG(MH.FNumber,e),"exif:FocalLength":e=>xG(MH.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>MH.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>MH.ColorSpace(SG(e)),"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){let e=t.split(`, `).map(e=>e.charCodeAt(0));return MH.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>MH.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>MH.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>MH.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>MH.ExposureProgram(parseInt(e,10)),"exif:ExposureTime"(e){return CG(e)?MH.ExposureTime(e.split(`/`).map(e=>parseInt(e,10))):e},"exif:MeteringMode":e=>MH.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>MH.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>MH.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>MH.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>xG(MH.ShutterSpeedValue,e),"exif:WhiteBalance":e=>MH.WhiteBalance(parseInt(e,10))};function xG(e,t){return CG(t)?e(t.split(`/`)):t}function SG(e){return e.substring(0,2)===`0x`?parseInt(e.substring(2),16):parseInt(e,10)}function CG(e){return/^-?\d+\/-?\d+$/.test(e)}function wG(e){let[t,n]=e.split(`,`);if(t!==void 0&&n!==void 0){let e=parseFloat(t),r=parseFloat(n),i=n.charAt(n.length-1);if(!Number.isNaN(e)&&!Number.isNaN(r))return``+(e+r/60)+i}return e}var TG={get:EG};function EG(e){if(e)return e;if(typeof DOMParser<`u`)return new DOMParser;try{let{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__(`@xmldom/xmldom`);return new e({onError:t})}catch{return}}function DG(e){let t=[`prefix is non-null and namespace is null`,`prefix not bound to a namespace`,`prefix inte bundet till en namnrymd`,/Namespace prefix .+ is not defined/];for(let n=0;n<t.length;n++)if(new RegExp(t[n]).test(e.message))return!0;return!1}function OG(e){let t=kG(e);if(t===-1)return e;let{insertionIndex:n,attributeValueSpans:r}=AG(e,t+1);if(n===-1)return e;let i=NG(e,t,n,r),a=FG(e).filter(e=>i[e]===void 0);if(a.length===0)return e;let o=LG(a);return e.slice(0,n)+o+e.slice(n)}function kG(e){let t=0;for(;t<e.length;){if(t=e.indexOf(`<`,t),t===-1)return-1;if(/[A-Za-z_]/.test(e.charAt(t+1)))return t;jG(e,`<!--`,t)?t=MG(e,t+4,`-->`):jG(e,`<![CDATA[`,t)?t=MG(e,t+9,`]]>`):e.charAt(t+1)===`?`?t=MG(e,t+2,`?>`):t++}return-1}function AG(e,t){let n=[],r,i;for(let a=t;a<e.length;a++){let t=e.charAt(a);if(r!==void 0)t===r&&(n.push({start:i,end:a}),r=void 0);else if(t===`"`||t===`'`)r=t,i=a+1;else if(t===`>`)return e.charAt(a-1)===`/`?{insertionIndex:a-1,attributeValueSpans:n}:{insertionIndex:a,attributeValueSpans:n}}return{insertionIndex:-1,attributeValueSpans:n}}function jG(e,t,n){return e.slice(n,n+t.length)===t}function MG(e,t,n){let r=e.indexOf(n,t);return r===-1?e.length:r+n.length}function NG(e,t,n,r){let i=Object.create(null),a=/xmlns:([A-Za-z_][A-Za-z0-9._-]*)\s*=\s*["']([^"']*)["']/g,o,s=0;for(;(o=a.exec(e))!==null;){for(;s<r.length&&r[s].end<=o.index;)s++;if(s<r.length&&r[s].start<=o.index){a.lastIndex=r[s].end;continue}(o[2]!==``||PG(o.index,t,n))&&(i[o[1]]=!0)}return i}function PG(e,t,n){return e>t&&e<n}function FG(e){let t=[],n=Object.create(null),r=/(?:^|[^A-Za-z0-9._-])([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*/g,i;for(;(i=r.exec(e))!==null;){let e=i[1];e!==`xmlns`&&e!==`xml`&&n[e]===void 0&&(n[e]=!0,t.push(e))}return t}var IG={xmp:`http://ns.adobe.com/xap/1.0/`,tiff:`http://ns.adobe.com/tiff/1.0/`,exif:`http://ns.adobe.com/exif/1.0/`,dc:`http://purl.org/dc/elements/1.1/`,xmpMM:`http://ns.adobe.com/xap/1.0/mm/`,stEvt:`http://ns.adobe.com/xap/1.0/sType/ResourceEvent#`,stRef:`http://ns.adobe.com/xap/1.0/sType/ResourceRef#`,photoshop:`http://ns.adobe.com/photoshop/1.0/`};function LG(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t.push(` xmlns:`+r+`="`+RG(r)+`"`)}return t.join(``)}function RG(e){return Object.prototype.hasOwnProperty.call(IG,e)?IG[e]:`http://fallback.namespace/`+e}var zG={read:VG},BG=class extends Error{constructor(e){super(e),this.name=`ParseError`}};function VG(e,t,n){let r={};if(typeof e==`string`)return GG(r,e,n),r;let[i,a]=HG(e,t),o=GG(r,i,n);if(a){let i=GG(r,a,n);!o&&!i&&(delete r._raw,GG(r,UG(e,t),n))}return r}function HG(e,t){if(t.length===0)return[];let n=[UG(e,t.slice(0,1))];return t.length>1&&n.push(UG(e,t.slice(1))),n}function UG(e,t){let n=t.map(t=>WG(e,t)),r=n.reduce((e,t)=>e+t.length,0),i=new Uint8Array(r),a=0;for(let e=0;e<n.length;e++)i.set(n[e],a),a+=n[e].length;return new DataView(i.buffer)}function WG(e,t){let n=e.byteLength,r=e.byteOffset||0,i=Math.min(Math.max(t.dataOffset,0),n),a=Math.min(i+Math.max(t.length,0),n);return new Uint8Array(e.buffer.slice(r+i,r+a))}function GG(e,t,n){try{let{doc:r,raw:i,decodeValue:a}=KG(t,n);return e._raw=(e._raw||``)+i,vR(e,sK($G(QG(r),!0,a))),!0}catch{return!1}}function KG(e,t){let n=TG.get(t);if(!n)throw console.warn(`Warning: DOMParser is not available. It is needed to be able to parse XMP tags.`),Error();let{xmlString:r,decodeValue:i}=qG(e);return{doc:ZG(n,XG(r)),raw:r,decodeValue:i}}function qG(e){if(typeof e==`string`)return JG(e);let t=BW.get();if(t!==void 0)try{return{xmlString:new t(`utf-8`,{fatal:!0}).decode(e),decodeValue:YG}}catch{}return JG(lR(e,0,e.byteLength))}function JG(e){let t=hR(e);return t===void 0?{xmlString:e,decodeValue:mR}:{xmlString:t,decodeValue:YG}}function YG(e){return e}function XG(e){return e.replace(/^.+(<\?xpacket begin)/,`$1`).replace(/(<\?xpacket end=".*"\?>).+$/,`$1`)}function ZG(e,t,n=!1){try{let n=e.parseFromString(t,`application/xml`),r=n.getElementsByTagName(`parsererror`);if(r.length>0)throw new BG(r[0].textContent);return n}catch(r){if(r.name===`ParseError`&&DG(r)&&!n)return ZG(e,OG(t),!0);throw r}}function QG(e){for(let t=0;t<e.childNodes.length;t++){if(e.childNodes[t].tagName===`x:xmpmeta`)return QG(e.childNodes[t]);if(e.childNodes[t].tagName===`rdf:RDF`)return e.childNodes[t]}throw Error()}function $G(e,t,n){let r=eK(e);return tK(r)?t?{}:n(nK(r[0])):rK(r,n)}function eK(e){let t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}function tK(e){return e.length===1&&e[0].nodeName===`#text`}function nK(e){return e.nodeValue}function rK(e,t){let n=Object.create(null);return e.forEach(e=>{if(iK(e)){let r=aK(e,t);n[e.nodeName]===void 0?n[e.nodeName]=r:(Array.isArray(n[e.nodeName])||(n[e.nodeName]=[n[e.nodeName]]),n[e.nodeName].push(r))}}),n}function iK(e){return e.nodeName&&e.nodeName!==`#text`}function aK(e,t){return{attributes:oK(e,t),value:$G(e,!1,t)}}function oK(e,t){let n={};for(let r=0;r<e.attributes.length;r++)yR(n,e.attributes[r].nodeName,t(e.attributes[r].value));return n}function sK(e){let t={};if(typeof e==`string`)return e;for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]),r.forEach(e=>{vR(t,cK(e.attributes)),typeof e.value==`object`&&vR(t,_K(e.value))})}return t}function cK(e){let t={};for(let n in e)try{lK(n)&&yR(t,dK(n),{value:e[n],attributes:{},description:fK(e[n],n)})}catch{}return t}function lK(e){return e!==`rdf:parseType`&&!uK(e)}function uK(e){return e.split(`:`)[0]===`xmlns`}function dK(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?`RatingPercent`:e.split(`:`)[1]}function fK(e,t=void 0){if(Array.isArray(e)){let n=pK(e);if(mK(t))try{let r=bG[t](e,n);if(typeof r==`string`)return r}catch{}return n}if(typeof e==`object`)return hK(e);if(mK(t))try{return bG[t](e)}catch{return e}return e}function pK(e){return e.map(e=>e.value===void 0?fK(e):fK(e.value)).join(`, `)}function mK(e){return Object.prototype.hasOwnProperty.call(bG,e)&&typeof bG[e]==`function`}function hK(e){let t=[];for(let n in e)t.push(`${gK(n)}: ${fK(e[n].value)}`);return t.join(`; `)}function gK(e){return e===`CiAdrCity`?`CreatorCity`:e===`CiAdrCtry`?`CreatorCountry`:e===`CiAdrExtadr`?`CreatorAddress`:e===`CiAdrPcode`?`CreatorPostalCode`:e===`CiAdrRegion`?`CreatorRegion`:e===`CiEmailWork`?`CreatorWorkEmail`:e===`CiTelWork`?`CreatorWorkPhone`:e===`CiUrlWork`?`CreatorWorkUrl`:e}function _K(e,t={}){for(let n in e)try{uK(n)||yR(t,dK(n),vK(e[n],n))}catch{}return t}function vK(e,t){return bK(e)?xK(e,t):yK(e)?{value:``,attributes:{},description:``}:SK(e)?CK(e,t):kK(e)?AK(e,t):jK(e)?MK(e,t):NK(e)?FK(e,t):LK(e,t)}function yK(e){return e.attributes[`rdf:parseType`]===`Resource`&&typeof e.value==`string`&&e.value.trim()===``}function bK(e){return Array.isArray(e)}function xK(e,t){return LK(e[e.length-1],t)}function SK(e){return e.attributes[`rdf:parseType`]===`Resource`&&e.value[`rdf:value`]!==void 0||e.value[`rdf:Description`]!==void 0&&e.value[`rdf:Description`].value[`rdf:value`]!==void 0}function CK(e,t){let n=wK(e);e.value[`rdf:Description`]!==void 0&&(e=e.value[`rdf:Description`]),vR(n,wK(e),TK(e));let r=EK(e);return{value:r,attributes:n,description:fK(r,t)}}function wK(e){let t={};for(let n in e.attributes)n!==`rdf:parseType`&&n!==`rdf:resource`&&!uK(n)&&yR(t,dK(n),e.attributes[n]);return t}function TK(e){let t={};for(let n in e.value)n!==`rdf:value`&&!uK(n)&&yR(t,dK(n),e.value[n].value);return t}function EK(e){let t=DK(e.value[`rdf:value`]);return RK(t)||OK(t)}function DK(e){return bK(e)?e[e.length-1]:e}function OK(e){return NK(e)?FK(e).value:typeof e.value==`object`?_K(e.value,Object.create(null)):e.value}function kK(e){return e.attributes[`rdf:parseType`]===`Resource`||e.value[`rdf:Description`]!==void 0&&e.value[`rdf:Description`].value[`rdf:value`]===void 0}function AK(e,t){let n={value:{},attributes:{}};return e.value[`rdf:Description`]!==void 0&&(vR(n.value,cK(e.value[`rdf:Description`].attributes)),vR(n.attributes,wK(e)),e=e.value[`rdf:Description`]),vR(n.value,_K(e.value)),n.description=fK(n.value,t),n}function jK(e){return Object.keys(e.value).length===0&&e.attributes[`xml:lang`]===void 0&&e.attributes[`rdf:resource`]===void 0}function MK(e,t){let n=cK(e.attributes);return{value:n,attributes:{},description:fK(n,t)}}function NK(e){return PK(e.value)!==void 0}function PK(e){return DK(e[`rdf:Bag`]||e[`rdf:Seq`]||e[`rdf:Alt`])}function FK(e,t){let n=PK(e.value).value[`rdf:li`],r=wK(e),i=[];return n===void 0?n=[]:Array.isArray(n)||(n=[n]),n.forEach(e=>{i.push(IK(e))}),{value:i,attributes:r,description:fK(i,t)}}function IK(e){return SK(e)?CK(e):kK(e)?AK(e).value:jK(e)?MK(e).value:LK(e)}function LK(e,t){let n=RK(e)||sK(e.value);return{value:n,attributes:wK(e),description:fK(n,t)}}function RK(e){return e.attributes&&e.attributes[`rdf:resource`]}var zK={CLOSED_SUBPATH_LENGTH:0,CLOSED_SUBPATH_BEZIER_LINKED:1,CLOSED_SUBPATH_BEZIER_UNLINKED:2,OPEN_SUBPATH_LENGTH:3,OPEN_SUBPATH_BEZIER_LINKED:4,OPEN_SUBPATH_BEZIER_UNLINKED:5,FILL_RULE:6,CLIPBOARD:7,INITIAL_FILL_RULE:8},BK=24,VK={2e3:{name:`PathInformation`,description:HK},2999:{name:`ClippingPathName`,description(e){let[,t]=fR(e,0);return t}}};function HK(e){let t={},n=[];for(let r=0;r<e.byteLength;r+=26){let i=$.getShortAt(e,r);UK[i]&&(t[i]||(t[i]=UK[i].description),n.push({type:i,path:UK[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}var UK={[zK.CLOSED_SUBPATH_LENGTH]:{description:`Closed subpath length`,path:(e,t)=>[$.getShortAt(e,t)]},[zK.CLOSED_SUBPATH_BEZIER_LINKED]:{description:`Closed subpath Bezier knot, linked`,path:WK},[zK.CLOSED_SUBPATH_BEZIER_UNLINKED]:{description:`Closed subpath Bezier knot, unlinked`,path:WK},[zK.OPEN_SUBPATH_LENGTH]:{description:`Open subpath length`,path:(e,t)=>[$.getShortAt(e,t)]},[zK.OPEN_SUBPATH_BEZIER_LINKED]:{description:`Open subpath Bezier knot, linked`,path:WK},[zK.OPEN_SUBPATH_BEZIER_UNLINKED]:{description:`Open subpath Bezier knot, unlinked`,path:WK},[zK.FILL_RULE]:{description:`Path fill rule`,path:()=>[]},[zK.INITIAL_FILL_RULE]:{description:`Initial fill rule`,path:(e,t)=>[$.getShortAt(e,t)]},[zK.CLIPBOARD]:{description:`Clipboard`,path:KK}};function WK(e,t){let n=[];for(let r=0;r<BK;r+=8)n.push(GK(e,t+r));return n}function GK(e,t){let n=qK(e,t,8);return[qK(e,t+4,8),n]}function KK(e,t){return[[qK(e,t,8),qK(e,t+4,8),qK(e,t+8,8),qK(e,t+12,8)],qK(e,t+16,8)]}function qK(e,t,n){let r=$.getLongAt(e,t),i=r>>>31?-1:1,a=(r&2130706432)>>>32-n,o=r&parseInt(TR(`1`,32-n),2);return i*wR(a.toString(2)+`.`+CR(o.toString(2),32-n,`0`),2)}var JK={read:eq},YK=`8BIM`,XK=2,ZK=4,QK=4,$K=12;function eq(e,t,n=hU){if(!Array.isArray(e))return{};let r=cR(new Uint8Array(e).buffer),i={},a=0;for(;a+$K<=r.byteLength;){let e=lR(r,a,QK);a+=QK;let o=$.getShortAt(r,a);a+=XK;let{tagName:s,tagNameSize:c}=nq(r,a);if(a+=c,a+ZK>r.byteLength)break;let l=$.getLongAt(r,a);a+=ZK;let u=Math.min(l,r.byteLength-a);if(e===YK){let e=tq(o,s,t);if(!n.shouldParseTag(`photoshop`,e,o)){a+=u+u%2;continue}let c=cR(r.buffer,a,u),l={id:o,value:lR(c,0,u)};if(VK[o]){try{l.description=VK[o].description(c)}catch{l.description=`<no description formatter>`}i[s||VK[o].name]=l}else t&&(i[`undefined-${o}`]=l)}a+=u+u%2}return i}function tq(e,t,n){if(t)return t;if(VK[e]&&VK[e].name)return VK[e].name;if(n)return`undefined-${e}`}function nq(e,t){let[n,r]=fR(e,t);return{tagName:r,tagNameSize:1+n+ +(n%2==0)}}var rq={desc:{name:`ICC Description`},cprt:{name:`ICC Copyright`},dmdd:{name:`ICC Device Model Description`},vued:{name:`ICC Viewing Conditions Description`},dmnd:{name:`ICC Device Manufacturer for Display`},tech:{name:`Technology`}},iq={4:{name:`Preferred CMM type`,value:(e,t)=>lR(e,t,4),description:e=>e===null?``:cq(e)},8:{name:`Profile Version`,value:(e,t)=>e.getUint8(t).toString(10)+`.`+(e.getUint8(t+1)>>4).toString(10)+`.`+(e.getUint8(t+1)%16).toString(10)},12:{name:`Profile/Device class`,value:(e,t)=>lR(e,t,4),description:e=>{switch(e.toLowerCase()){case`scnr`:return`Input Device profile`;case`mntr`:return`Display Device profile`;case`prtr`:return`Output Device profile`;case`link`:return`DeviceLink profile`;case`abst`:return`Abstract profile`;case`spac`:return`ColorSpace profile`;case`nmcl`:return`NamedColor profile`;case`cenc`:return`ColorEncodingSpace profile`;case`mid `:return`MultiplexIdentification profile`;case`mlnk`:return`MultiplexLink profile`;case`mvis`:return`MultiplexVisualization profile`;default:return e}}},16:{name:`Color Space`,value:(e,t)=>lR(e,t,4)},20:{name:`Connection Space`,value:(e,t)=>lR(e,t,4)},24:{name:`ICC Profile Date`,value:(e,t)=>aq(e,t).toISOString()},36:{name:`ICC Signature`,value:(e,t)=>sq(e.buffer.slice(t,t+4))},40:{name:`Primary Platform`,value:(e,t)=>lR(e,t,4),description:e=>cq(e)},48:{name:`Device Manufacturer`,value:(e,t)=>lR(e,t,4),description:e=>cq(e)},52:{name:`Device Model Number`,value:(e,t)=>lR(e,t,4)},64:{name:`Rendering Intent`,value:(e,t)=>e.getUint32(t),description:e=>{switch(e){case 0:return`Perceptual`;case 1:return`Relative Colorimetric`;case 2:return`Saturation`;case 3:return`Absolute Colorimetric`;default:return e}}},80:{name:`Profile Creator`,value:(e,t)=>lR(e,t,4)}};function aq(e,t){let n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),a=e.getUint16(t+6),o=e.getUint16(t+8),s=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,a,o,s))}var oq=8192;function sq(e){let t=new Uint8Array(e),n=[];for(let e=0;e<t.length;e+=oq)n.push(String.fromCharCode.apply(null,t.subarray(e,e+oq)));return n.join(``)}function cq(e){switch(e.toLowerCase()){case`appl`:return`Apple`;case`adbe`:return`Adobe`;case`msft`:return`Microsoft`;case`sunw`:return`Sun Microsystems`;case`sgi`:return`Silicon Graphics`;case`tgnt`:return`Taligent`;default:return e}}var lq={read:wq},uq=84,dq=128,fq=`acsp`,pq=`desc`,mq=`mluc`,hq=`text`,gq=`sig `,_q=12,vq=12,yq=12,bq=16,xq=1e3,Sq=1e3,Cq=1048576;function wq(e,t,n,r){return n&&t[0].compressionMethod!==void 0?Tq(e,t,r):Dq(e,t)}function Tq(e,t,n){if(!Eq(t[0].compressionMethod))return{};let r=e.byteOffset||0,i=e.buffer.slice(r+t[0].offset,r+t[0].offset+t[0].length);return OR(new DataView(new Uint8Array(i).buffer),t[0].compressionMethod,`utf-8`,`dataview`,n).then(Mq).catch(()=>({}))}function Eq(e){return e===0}function Dq(e,t){try{let n=Oq(e),r=e.byteOffset||0,i=t.reduce((e,t)=>e+t.length,0),a=Math.min(i,n.byteLength),o=new Uint8Array(a),s=0,c=kq(t);for(let e=1;e<=t.length;e++){let t=c[e];if(!t)throw Error(`ICC chunk ${e} not found`);let i=n.slice(r+t.offset,r+t.offset+t.length),a=new Uint8Array(i);o.set(a,s),s+=a.length}return Mq(new DataView(o.buffer))}catch{return{}}}function Oq(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}function kq(e){let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].chunkNumber]===void 0&&(t[e[n].chunkNumber]=e[n]);return t}function Aq(e){return e.byteLength<132}function jq(e,t){return e.byteLength<t+_q}function Mq(e){let t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw Error(`ICC profile length not matching`);if(e.byteLength<uq)throw Error(`ICC profile too short`);let r={},i=Object.keys(iq);for(let t=0;t<i.length;t++){let n=i[t],a=iq[n],o=a.value(e,parseInt(n,10)),s=o;a.description&&(s=a.description(o)),r[a.name]={value:o,description:s}}if(sq(t.slice(36,40))!==fq)throw Error(`ICC profile: missing signature`);if(Aq(e))return r;let a=Math.min(e.getUint32(dq),Sq),o=132,s={remaining:Math.min(e.byteLength,Cq)};for(let n=0;n<a;n++){if(jq(e,o))return r;let n=lR(e,o,4),i=e.getUint32(o+4),a=e.getUint32(o+8);if(i>e.byteLength)return r;let c=lR(e,i,4);if(c===pq){if(i+vq>e.byteLength)return r;let t=e.getUint32(i+8);if(t>a)return r;Pq(r,n,Nq(e,i+12,t-1,s))}else if(c===mq){if(i+bq>e.byteLength)return r;let t=e.getUint32(i+8),o=e.getUint32(i+12);if(o<yq||t>xq)return r;let c=t*o;if(c>e.byteLength-i-bq||c>s.remaining)return r;s.remaining-=c;let l=Math.min(a,e.byteLength-i),u=i+bq,d=[];for(let n=0;n<t;n++){let t=lR(e,u+0,2),n=lR(e,u+2,2),r=e.getUint32(u+4),a=e.getUint32(u+8),c=Math.max(0,l-a),f=Math.min(r,c,s.remaining);s.remaining-=f;let p=dR(e,i+a,f);d.push({languageCode:t,countryCode:n,text:p}),u+=o}if(t===1)Pq(r,n,d[0].text);else{let e={};for(let t=0;t<d.length;t++)e[`${d[t].languageCode}-${d[t].countryCode}`]=d[t].text;Pq(r,n,e)}}else if(c===hq){let t=Nq(e,i+8,a-8,s),o=t.indexOf(`\0`);Pq(r,n,o===-1?t:t.slice(0,o))}else c===gq&&Pq(r,n,sq(t.slice(i+8,i+12)));o+=12}return r}function Nq(e,t,n,r){let i=Math.max(0,Math.min(n,e.byteLength-t,r.remaining));return r.remaining-=i,sq(e.buffer.slice(t,t+i))}function Pq(e,t,n){rq[t]?e[rq[t].name]={value:n,description:n}:e[t]={value:n,description:n}}var Fq=27,Iq=22,Lq={read:Rq,SHOT_INFO_AUTO_ROTATE:Fq,CAMERA_SETTINGS_LENS_TYPE:Iq};function Rq(e,t,n,r,i,a=!1,o=void 0){let s=AU(e,WH,t,t+n,r,i,a,o,`makerNotes`);return s.ShotInfo&&(s=vR({},s,zq(s.ShotInfo.value)),delete s.ShotInfo),s.CameraSettings&&(s=vR({},s,Bq(s.CameraSettings.value)),delete s.CameraSettings),s}function zq(e){let t={};return e[Fq]!==void 0&&(t.AutoRotate={value:e[Fq],description:Vq(e[Fq])}),t}function Bq(e){let t={};if(!Array.isArray(e))return t;let n=e[Iq];return Number.isFinite(n)&&(t.LensType={value:n,description:`${n}`}),t}function Vq(e){return e===0?`None`:e===1?`Rotate 90 CW`:e===2?`Rotate 180`:e===3?`Rotate 270 CW`:`Unknown`}var Hq=8,Uq=10,Wq={K3_III:78420},Gq={CAMERA_ORIENTATION:1,ROLL_ANGLE:3,PITCH_ANGLE:5},Kq={read:qq,PENTAX_IFD_OFFSET:Uq,MODEL_ID:Wq,LIK3III:Gq};function qq(e,t,n,r,i=!1,a=void 0){try{let o=vz.getByteOrder(e,t+n+Hq),s=t+n,c=AU(e,GH,s,s+Uq,o,r,i,a,`makerNotes`);return Jq(c)&&(c=vR({},c,Yq(e,s+c.LevelInfo.__offset,o)),delete c.LevelInfo),c}catch{return{}}}function Jq(e){return e.PentaxModelID&&e.PentaxModelID.value===Wq.K3_III&&e.LevelInfo}function Yq(e,t,n){let r={};if(t+7>e.byteLength)return r;let i=e.getInt8(t+Gq.CAMERA_ORIENTATION);r.CameraOrientation={value:i,description:Xq(i)};let a=e.getInt16(t+Gq.ROLL_ANGLE,n===vz.LITTLE_ENDIAN);r.RollAngle={value:a,description:Zq(a)};let o=e.getInt16(t+Gq.PITCH_ANGLE,n===vz.LITTLE_ENDIAN);return r.PitchAngle={value:o,description:Qq(o)},r}function Xq(e){return e===0?`Horizontal (normal)`:e===1?`Rotate 270 CW`:e===2?`Rotate 180`:e===3?`Rotate 90 CW`:e===4?`Upwards`:e===5?`Downwards`:`Unknown`}function Zq(e){return``+e*-.5}function Qq(e){return``+e*-.5}var $q={read:rJ},eJ={0:`Grayscale`,2:`RGB`,3:`Palette`,4:`Grayscale with Alpha`,6:`RGB with Alpha`},tJ={0:`Noninterlaced`,1:`Adam7 Interlace`},nJ=[{name:`Image Width`,offset:0,size:4,read:$.getLongAt,description:e=>`${e}px`},{name:`Image Height`,offset:4,size:4,read:$.getLongAt,description:e=>`${e}px`},{name:`Bit Depth`,offset:8,size:1,read:$.getByteAt,description:e=>`${e}`},{name:`Color Type`,offset:9,size:1,read:$.getByteAt,description:e=>eJ[e]||`Unknown`},{name:`Compression`,offset:10,size:1,read:$.getByteAt,description:e=>e===0?`Deflate/Inflate`:`Unknown`},{name:`Filter`,offset:11,size:1,read:$.getByteAt,description:e=>e===0?`Adaptive`:`Unknown`},{name:`Interlace`,offset:12,size:1,read:$.getByteAt,description:e=>tJ[e]||`Unknown`}];function rJ(e,t){let n={};for(let r=0;r<nJ.length;r++)n[nJ[r].name]=iJ(e,t,nJ[r]);return n}function iJ(e,t,n){if(t+n.offset+n.size>e.byteLength)return;let r=n.read(e,t+n.offset);return{value:r,description:n.description(r)}}var aJ={read:mJ},oJ=`STATE_KEYWORD`,sJ=`STATE_COMPRESSION`,cJ=`STATE_LANG`,lJ=`STATE_TRANSLATED_KEYWORD`,uJ=`STATE_TEXT`,dJ=1,fJ=1,pJ=6;function mJ(e,t,n,r,i=!1,a=hU,o){let s={},c=[];for(let l=0;l<t.length;l++){let{offset:u,length:d,type:f}=t[l],p=hJ(e,u,d,f,n,o);if(p instanceof Promise)c.push(p.then(({name:e,value:t,description:n})=>{try{if(Q.USE_EXIF&&CJ(e,t))return a.shouldParseGroup(`exif`)?{__exif:KU.read(TJ(t),pJ,r,i,a).tags}:{};if(Q.USE_IPTC&&wJ(e,t))return a.shouldParseGroup(`iptc`)?{__iptc:tG.read(TJ(t),0,r,a)}:{};if(e&&!CJ(e,t)&&!wJ(e,t))return a.shouldParseGroup(`png`)?{[e]:{value:t,description:n}}:{}}catch{}return{}}));else{let{name:e,value:t,description:n}=p;e&&a.shouldParseGroup(`png`)&&(s[e]={value:t,description:n})}}return{readTags:s,readTagsPromise:c.length>0?Promise.all(c):void 0}}function hJ(e,t,n,r,i,a){let o=[],s=[],c=[],l,u=oJ,d,f=e.byteOffset||0;for(let i=0;i<n&&t+i<e.byteLength;i++){if(u===sJ){d=gJ({type:r,dataView:e,offset:t+i}),r===`iTXt`&&(i+=dJ),u=_J(r,u);continue}if(u===uJ){let r=e.buffer.slice(f+t+i,f+t+n);l=new DataView(new Uint8Array(r).buffer);break}let a=e.getUint8(t+i);a===0?u=_J(r,u):u===oJ?o.push(a):u===cJ?s.push(a):u===lJ&&c.push(a)}if(d!==void 0&&!i)return{};let p=OR(l,d,vJ(r),`string`,a);return p instanceof Promise?p.then(e=>yJ(e,r,s,o)).catch(()=>yJ(`<text using unknown compression>`.split(``),r,s,o)):yJ(p,r,s,o)}function gJ({type:e,dataView:t,offset:n}){if(e===`iTXt`){if(n+1<t.byteLength&&t.getUint8(n)===fJ)return t.getUint8(n+1)}else if(e===`zTXt`)return t.getUint8(n)}function _J(e,t){return t===oJ&&[`iTXt`,`zTXt`].includes(e)?sJ:t===sJ?e===`iTXt`?cJ:uJ:t===cJ?lJ:uJ}function vJ(e){return e===`tEXt`||e===`zTXt`?`latin1`:`utf-8`}function yJ(e,t,n,r){let i=xJ(e);return{name:bJ(t,n,r),value:i,description:t===`iTXt`?SJ(e):i}}function bJ(e,t,n){let r=pR(n);return e===`tEXt`||t.length===0?r:`${r} (${pR(t)})`}function xJ(e){return e instanceof DataView?lR(e,0,e.byteLength):e}function SJ(e){return WW.decode(`UTF-8`,e)}function CJ(e,t){return e.toLowerCase()===`raw profile type exif`&&t.substring(1,5)===`exif`}function wJ(e,t){return e.toLowerCase()===`raw profile type iptc`&&t.substring(1,5)===`iptc`}function TJ(e){return EJ(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,``))}function EJ(e){let t=new DataView(new ArrayBuffer(e.length/2));for(let n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}var DJ={read:OJ};function OJ(e,t){let n={};for(let r=0;r<t.length;r++){let i=$.getLongAt(e,t[r]+0),a=lR(e,t[r]+4,4);a===`pHYs`?(n[`Pixels Per Unit X`]=kJ(e,t[r],i),n[`Pixels Per Unit Y`]=AJ(e,t[r],i),n[`Pixel Units`]=jJ(e,t[r],i)):a===`tIME`&&(n[`Modify Date`]=MJ(e,t[r],i))}return n}function kJ(e,t,n){if(!NJ(e,t,n,0,4))return;let r=$.getLongAt(e,t+8+0);return{value:r,description:``+r}}function AJ(e,t,n){if(!NJ(e,t,n,4,4))return;let r=$.getLongAt(e,t+8+4);return{value:r,description:``+r}}function jJ(e,t,n){if(!NJ(e,t,n,8,1))return;let r=$.getByteAt(e,t+8+8);return{value:r,description:r===1?`meters`:`Unknown`}}function MJ(e,t,n){if(!NJ(e,t,n,0,7))return;let r=$.getShortAt(e,t+8),i=$.getByteAt(e,t+8+2),a=$.getByteAt(e,t+8+3),o=$.getByteAt(e,t+8+4),s=$.getByteAt(e,t+8+5),c=$.getByteAt(e,t+8+6);return{value:[r,i,a,o,s,c],description:`${PJ(r,4)}-${PJ(i,2)}-${PJ(a,2)} ${PJ(o,2)}:${PJ(s,2)}:${PJ(c,2)}`}}function NJ(e,t,n,r,i){return r+i<=n&&t+8+r+i<=e.byteLength}function PJ(e,t){return CR(``+e,t,`0`)}var FJ={read:zJ},IJ=4,LJ=7,RJ=10;function zJ(e,t){let n={};if(t+RJ>e.byteLength)return n;let r=$.getByteAt(e,t);return n.Alpha=BJ(r),n.Animation=VJ(r),n.ImageWidth=HJ(e,t+IJ),n.ImageHeight=HJ(e,t+LJ),n}function BJ(e){let t=e&16;return{value:+!!t,description:t?`Yes`:`No`}}function VJ(e){let t=e&2;return{value:+!!t,description:t?`Yes`:`No`}}function HJ(e,t){let n=$.getByteAt(e,t)+256*$.getByteAt(e,t+1)+65536*$.getByteAt(e,t+2)+1;return{value:n,description:n+`px`}}var UJ={read:KJ},WJ=e=>`${e} ${e===1?`bit`:`bits`}`,GJ=[{name:`GIF Version`,offset:3,size:3,getValue:(e,t)=>lR(e,t,3),description:e=>e},{name:`Image Width`,offset:6,size:2,getValue:(e,t)=>e.getUint16(t,!0),description:e=>`${e}px`},{name:`Image Height`,offset:8,size:2,getValue:(e,t)=>e.getUint16(t,!0),description:e=>`${e}px`},{name:`Global Color Map`,offset:10,size:1,getValue:(e,t)=>(e.getUint8(t)&128)>>>7,description:e=>e===1?`Yes`:`No`},{name:`Bits Per Pixel`,offset:10,size:1,getValue:(e,t)=>(e.getUint8(t)&7)+1,description:WJ},{name:`Color Resolution Depth`,offset:10,size:1,getValue:(e,t)=>((e.getUint8(t)&112)>>>4)+1,description:WJ}];function KJ(e){let t={};for(let n=0;n<GJ.length;n++)t[GJ[n].name]=qJ(e,GJ[n]);return t}function qJ(e,t){if(t.offset+t.size>e.byteLength)return;let n=t.getValue(e,t.offset);return{value:n,description:t.description(n)}}var JJ=[6,7,99],YJ={get:XJ};function XJ(e,t,n){if(ZJ(t)){let r=n+t.JPEGInterchangeFormat.value,i=t.JPEGInterchangeFormatLength.value;if(QJ(e,r,i)){t.type=`image/jpeg`;let n=e.byteOffset||0;t.image=e.buffer.slice(n+r,n+r+i),bR(t,`base64`,function(){return xR(this.image)})}}return t}function ZJ(e){return e&&(e.Compression===void 0||JJ.includes(e.Compression.value))&&e.JPEGInterchangeFormat&&e.JPEGInterchangeFormat.value&&e.JPEGInterchangeFormatLength&&e.JPEGInterchangeFormatLength.value}function QJ(e,t,n){return $J(t)&&$J(n)&&t+n<=e.byteLength}function $J(e){return typeof e==`number`&&e>=0&&e%1==0}var eY={INCHES:2,CENTIMETERS:3,MILLIMETERS:4},tY={INCHES_TO_MM:25.4,CM_TO_MM:10,MM_TO_MM:1},nY={get:rY};function rY(e,t){let n={},r=!1,i=iY(e,`exif`,`FocalLength`,t),a=iY(e,`exif`,`FocalPlaneXResolution`,t),o=iY(e,`exif`,`FocalPlaneYResolution`,t),s=iY(e,`exif`,`FocalPlaneResolutionUnit`,t),c=iY(e,`file`,`Image Width`,t),l=iY(e,`file`,`Image Height`,t),u=iY(e,`exif`,`FocalLengthIn35mmFilm`,t)||aY(a,o,s,c,l,i);u&&(n.FocalLength35efl={value:u,description:MH.FocalLengthIn35mmFilm(u)},r=!0);let d=oY(i,u);d&&(n.ScaleFactorTo35mmEquivalent=d,r=!0);let f=sY(u);if(f&&(n.FieldOfView=f,r=!0),r)return n}function iY(e,t,n,r){if(r&&e[t]&&e[t][n])return e[t][n].value;if(!r&&e[n])return e[n].value}function aY(e,t,n,r,i,a){if(e&&t&&n&&r&&i&&a)try{let o;switch(n){case eY.INCHES:o=tY.INCHES_TO_MM;break;case eY.CENTIMETERS:o=tY.CM_TO_MM;break;case eY.MILLIMETERS:o=tY.MM_TO_MM;break;default:return}let s=e[0]/e[1]*o,c=t[0]/t[1]*o,l=r/s,u=i/c,d=Math.sqrt(l**2+u**2);return a[0]/a[1]*(43.27/d)}catch{}}function oY(e,t){if(e&&t)try{let n=t/(e[0]/e[1]);return{value:n,description:n.toFixed(1)}}catch{}}function sY(e){if(e)try{let t=2*Math.atan(36/(2*e))*(180/Math.PI);return{value:t,description:t.toFixed(1)+` deg`}}catch{}}function cY({mergeSteps:e,deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:a,tiffHeaderOffset:o,exifDataView:s,fileType:c,pngTextChunks:l,pngTextIsAsync:u,thumbnailIfdTags:d,deps:f}){let p={};for(let l=0;l<e.length;l++)p=lY({step:e[l],deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:a,tiffHeaderOffset:o,exifDataView:s,fileType:c,thumbnailIfdTags:d,tags:p,deps:f});return Q.USE_PNG&&r&&u&&i.shouldReturnGroup(`png`)&&p.png&&(p.pngText=f.objectAssign({},p.png)),Q.USE_PNG&&r&&i.shouldReturnGroup(`png`)&&f.hasPngTextData(l)&&p.png&&!p.pngText&&(p.pngText=f.objectAssign({},p.png)),p}function lY({step:e,deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:a,tiffHeaderOffset:o,exifDataView:s,fileType:c,thumbnailIfdTags:l,tags:u,deps:d}){if(e.type===`mergeGroupAssign`){let t=d.filterTagsForReturn(e.groupKey,e.parsedTags,i);return uY(u,e.groupKey,t,r,d)}if(e.type===`mergeGroupMerge`){let t=d.filterTagsForReturn(e.groupKey,e.parsedTags,i);return fY(u,e.groupKey,t,r,d)}if(Q.USE_XMP&&e.type===`mergeXmpGroupAssign`){let t=d.filterTagsForReturn(`xmp`,e.parsedTags,i);return dY(u,t,r,d)}if(Q.USE_ICC&&e.type===`mergeIccDeferred`){let a=t[e.deferredKey],o=d.filterTagsForParse(`icc`,a,i);if(n.icc=o,!i.shouldReturnGroup(`icc`))return u;let s=d.filterTagsForReturn(`icc`,o,i);return uY(u,`icc`,s,r,d)}if(Q.USE_JXL&&e.type===`mergeBrobExifDeferred`){let a=t[e.deferredKey];if(!a||Object.keys(a).length===0)return u;let o=d.filterTagsForParse(`exif`,a,i);if(n.exif=n.exif?d.objectAssign({},n.exif,o):o,!i.shouldReturnGroup(`exif`))return u;let s=d.filterTagsForReturn(`exif`,o,i);return uY(u,`exif`,s,r,d)}if(Q.USE_JXL&&e.type===`mergeBrobXmpDeferred`){let a=t[e.deferredKey];if(!a||Object.keys(a).length===0)return u;let o=d.filterTagsForParse(`xmp`,a,i);if(n.xmp=o,!i.shouldReturnGroup(`xmp`))return u;let s=d.filterTagsForReturn(`xmp`,o,i);return dY(u,s,r,d)}if(Q.USE_PNG&&e.type===`mergePngFile`){let t=d.filterTagsForReturn(`png`,e.parsedTags,i);return i.shouldReturnGroup(`png`)?r?(u.png=u.png?d.objectAssign({},u.png,t):t,u.pngFile=t,u):d.objectAssign({},u,t):u}if(Q.USE_PNG&&e.type===`mergePngChunk`){let t=d.filterTagsForReturn(`png`,e.parsedTags,i);return i.shouldReturnGroup(`png`)?r?(u.png=u.png?d.objectAssign({},u.png,t):t,u):d.objectAssign({},u,t):u}if(Q.USE_PNG&&e.type===`processPngTextReadTags`)return pY({readTags:e.readTags,parsedGroups:n,expanded:r,tagFilter:i,tags:u,deps:d});if(Q.USE_PNG&&e.type===`processPngTextReadTagsDeferredList`){let a=t[e.deferredKey]||[];for(let e=0;e<a.length;e++)u=pY({readTags:a[e],parsedGroups:n,expanded:r,tagFilter:i,tags:u,deps:d});return u}if(Q.USE_EXIF&&e.type===`gps`){if(r&&i.shouldReturnGroup(`gps`)&&n.exif){let e=d.getGpsGroupFromExifTags(n.exif);if(e){let t=d.filterTagsForReturn(`gps`,e,i);u.gps=t}}return u}if((Q.USE_EXIF||Q.USE_XMP)&&e.type===`composite`){if(!i.shouldReturnGroup(`composite`))return u;let e=u,t=r;i.isActive&&(e={exif:n.exif,file:n.file},t=!0);let a=d.Composite.get(e,t);if(!a)return u;let o=d.filterTagsForReturn(`composite`,a,i);return uY(u,`composite`,o,r,d)}if(e.type===`thumbnail`){if(!i.shouldReturnGroup(`thumbnail`)||!i.shouldReturnTag(`thumbnail`,`Thumbnail`))return delete u.Thumbnail,u;if(!l)return u;let e=d.filterTagsForParse(`thumbnail`,l,i),t=Q.USE_EXIF&&Q.USE_THUMBNAIL&&d.Thumbnail.get(s||a,e,o);return t?u.Thumbnail=t:delete u.Thumbnail,u}if(e.type===`metadataRange`){if(!r)return u;let t=hY(e.metadataBlocks,e.metadataTruncated,a,n);return t&&(u.metadataRange=t),u}return e.type===`fileType`&&c&&i.shouldReturnGroup(`file`)&&i.shouldReturnTag(`file`,`FileType`)&&(r?(u.file||(u.file={}),u.file.FileType=c):u.FileType=c),u}function uY(e,t,n,r,i){return r?(e[t]=n,e):i.objectAssign({},e,n)}function dY(e,t,n,r){if(n)return e.xmp=t,e;let i=r.objectAssign({},t);return delete i._raw,r.objectAssign({},e,i)}function fY(e,t,n,r,i){return r?(e[t]=e[t]?i.objectAssign({},e[t],n):n,e):i.objectAssign({},e,n)}function pY({readTags:e,parsedGroups:t,expanded:n,tagFilter:r,tags:i,deps:a}){let o=e.__exif,s=e.__iptc;if(delete e.__exif,delete e.__iptc,o){let e=a.filterTagsForParse(`exif`,o,r);if(t.exif=t.exif?a.objectAssign({},t.exif,e):e,r.shouldReturnGroup(`exif`)){let t=a.filterTagsForReturn(`exif`,e,r);if(n)i.exif=i.exif?a.objectAssign({},i.exif,t):t;else{let e=a.objectAssign({},t);delete e.Thumbnail,i=a.objectAssign({},i,e)}}}if(s){let e=a.filterTagsForParse(`iptc`,s,r);if(t.iptc=t.iptc?a.objectAssign({},t.iptc,e):e,r.shouldReturnGroup(`iptc`)){let t=a.filterTagsForReturn(`iptc`,e,r);n?i.iptc=i.iptc?a.objectAssign({},i.iptc,t):t:i=a.objectAssign({},i,t)}}if(r.shouldReturnGroup(`png`)){let o=a.filterTagsForParse(`png`,e,r),s=a.filterTagsForReturn(`png`,o,r);t.pngText=o,n?(i.png=i.png?a.objectAssign({},i.png,s):s,s&&Object.keys(s).length>0&&(i.pngText=i.pngText?a.objectAssign({},i.pngText,s):s)):i=a.objectAssign({},i,s)}return i}function mY(e){return!!e&&typeof e.then==`function`}function hY(e,t,n,r){let i=(e||[]).slice(),a=!!t;if(r&&r.mpf&&Array.isArray(r.mpf.Images))for(let e=0;e<r.mpf.Images.length;e++){let t=r.mpf.Images[e];if(!t||!t.ImageOffset||!t.ImageSize)continue;let n=t.ImageOffset.value,a=t.ImageSize.value;typeof n!=`number`||n<=0||typeof a!=`number`||a<=0||i.push({type:`mpfImage`,start:n,end:n+a})}if(i.length===0)return;i.sort((e,t)=>e.start-t.start);let o=i[0].start,s=i[0].end;for(let e=1;e<i.length;e++)i[e].end>s&&(s=i[e].end);let c=n&&typeof n.byteLength==`number`?n.byteLength:0;return{start:o,end:s,complete:!a&&s<=c,blocks:i}}function gY(e){this.name=`MetadataMissingError`,this.message=e||`No Exif data`,this.stack=Error().stack}gY.prototype=Error();var _Y={MetadataMissingError:gY},vY={load:yY,loadView:SY,errors:_Y};function yY(e,t={}){if(t.length===`auto`)return oz(t),sz(bY)(e,t);if(FR(e)||IR(e)){_R();let n=FR(e)?RR:zR,r=vR({},t,{async:!0});return n(e,r).then(e=>bY(e,r))}return bY(e,t)}function bY(e,t){return xY(e)&&(e=new Uint8Array(e).buffer),SY(cR(e),t)}function xY(e){try{return Buffer.isBuffer(e)}catch{return!1}}function SY(e,{expanded:t=!1,async:n=!1,computed:r=!1,includeUnknown:i=!1,includeOffsets:a=!1,domParser:o=void 0,includeTags:s=void 0,excludeTags:c=void 0,decompress:l=void 0}={}){e=CY(e);let u=pU({includeTags:s,excludeTags:c}),d=Object.create(null),f=[],p=Object.create(null),m=[],h=!1,g,_,{fileType:v,fileDataOffset:y,jfifDataOffset:b,tiffHeaderOffset:x,iptcDataOffset:S,xmpChunks:C,iccChunks:w,mpfDataOffset:T,pngHeaderOffset:E,pngTextChunks:D,pngChunkOffsets:O,vp8xChunkOffset:k,gifHeaderOffset:A,brobExifChunk:j,brobXmpChunk:M,jxlCodestreamOffset:N,metadataBlocks:P,metadataTruncated:F,exifDataView:I,xmpDataView:L}=kH.parseAppMarkers(e,n,t&&a),R=jY({fileType:v,fileDataOffset:y,jfifDataOffset:b,tiffHeaderOffset:x,iptcDataOffset:S,xmpChunks:C,iccChunks:w,mpfDataOffset:T,pngHeaderOffset:E,pngTextChunks:D,pngChunkOffsets:O,vp8xChunkOffset:k,gifHeaderOffset:A,jxlCodestreamOffset:N});if(Q.USE_JPEG&&Q.USE_FILE&&y!==void 0&&u.shouldParseGroup(`file`)&&ee(s)){let t=OY(`file`,sW.read(e,y),u);d.file=t,u.shouldReturnGroup(`file`)&&f.push({type:`mergeGroupAssign`,groupKey:`file`,parsedTags:t})}if(Q.USE_JPEG&&Q.USE_JFIF&&b!==void 0&&u.shouldParseGroup(`jfif`)){let t=OY(`jfif`,TW.read(e,b),u);d.jfif=t,u.shouldReturnGroup(`jfif`)&&f.push({type:`mergeGroupAssign`,groupKey:`jfif`,parsedTags:t})}if(Q.USE_EXIF&&x!==void 0&&u.shouldParseGroup(`exif`)){let{tags:n,byteOrder:a}=DY(I||e,x,i,r,u);n.Thumbnail&&(g=n.Thumbnail,delete n.Thumbnail);let s=OY(`exif`,n,u);if(d.exif=s,Q.USE_IPTC&&s[`IPTC-NAA`]&&S===void 0&&u.shouldParseGroup(`iptc`)){let e=OY(`iptc`,tG.read(s[`IPTC-NAA`].value,0,i,u),u);d.iptc=e,u.shouldReturnGroup(`iptc`)&&f.push({type:`mergeGroupAssign`,groupKey:`iptc`,parsedTags:e})}if(Q.USE_XMP&&s.ApplicationNotes&&Array.isArray(s.ApplicationNotes.value)&&!NY(C)&&u.shouldParseGroup(`xmp`)){let e=OY(`xmp`,zG.read(pR(s.ApplicationNotes.value),void 0,o),u);if(d.xmp=e,u.shouldReturnGroup(`xmp`)){let n={type:`mergeXmpGroupAssign`,parsedTags:e};t?f.push(n):_=n}}if(Q.USE_PHOTOSHOP&&s.ImageSourceData&&s.PhotoshopSettings&&Array.isArray(s.PhotoshopSettings.value)&&u.shouldParseGroup(`photoshop`)){let e=OY(`photoshop`,JK.read(s.PhotoshopSettings.value,i,u),u);d.photoshop=e,u.shouldReturnGroup(`photoshop`)&&f.push({type:`mergeGroupAssign`,groupKey:`photoshop`,parsedTags:e})}if(Q.USE_ICC&&s.ICC_Profile&&!PY(w)&&u.shouldParseGroup(`icc`)){let e=OY(`icc`,lq.read(s.ICC_Profile.value,[{offset:0,length:s.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]),u);d.icc=e,u.shouldReturnGroup(`icc`)&&f.push({type:`mergeGroupAssign`,groupKey:`icc`,parsedTags:e})}if(Q.USE_MAKER_NOTES&&s.MakerNote&&u.shouldParseGroup(`makerNotes`)){if(FY(s)){let t=Lq.read(I||e,x,s.MakerNote.__offset,a,i,r,u);d.makerNotes=t,u.shouldReturnGroup(`makerNotes`)&&f.push({type:`mergeGroupAssign`,groupKey:`makerNotes`,parsedTags:t})}else if(IY(s)){let t=Kq.read(I||e,x,s.MakerNote.__offset,i,r,u);d.makerNotes=t,u.shouldReturnGroup(`makerNotes`)&&f.push({type:`mergeGroupAssign`,groupKey:`makerNotes`,parsedTags:t})}}s.MakerNote&&delete s.MakerNote.__offset,u.shouldReturnGroup(`exif`)&&f.push({type:`mergeGroupAssign`,groupKey:`exif`,parsedTags:s}),!t&&_&&(f.push(_),_=void 0)}if(Q.USE_JPEG&&Q.USE_IPTC&&S!==void 0&&u.shouldParseGroup(`iptc`)){let t=OY(`iptc`,tG.read(e,S,i,u),u);d.iptc=t,u.shouldReturnGroup(`iptc`)&&f.push({type:`mergeGroupAssign`,groupKey:`iptc`,parsedTags:t})}if(Q.USE_XMP&&NY(C)&&u.shouldParseGroup(`xmp`)){let t=OY(`xmp`,zG.read(L||e,C,o),u);d.xmp=t,u.shouldReturnGroup(`xmp`)&&f.push({type:`mergeXmpGroupAssign`,parsedTags:t})}if(Q.USE_JXL&&Q.USE_EXIF&&j&&x===void 0&&u.shouldParseGroup(`exif`)&&n){let t=EY(e,j);m.push(OR(t,ER,void 0,`dataview`,l).then(e=>{let t=oB(e,0),{tags:n}=KU.read(e,t,i,r,u);n.Thumbnail&&delete n.Thumbnail,p.brobExif=n}).catch(()=>{p.brobExif={}})),f.push({type:`mergeBrobExifDeferred`,deferredKey:`brobExif`})}if(Q.USE_JXL&&Q.USE_XMP&&M&&!NY(C)&&u.shouldParseGroup(`xmp`)&&n){let t=EY(e,M);m.push(OR(t,ER,void 0,`dataview`,l).then(e=>{p.brobXmp=zG.read(e,[{dataOffset:0,length:e.byteLength}],o)}).catch(()=>{p.brobXmp={}})),f.push({type:`mergeBrobXmpDeferred`,deferredKey:`brobXmp`})}if(Q.USE_ICC&&PY(w)&&u.shouldParseGroup(`icc`)){let t=lq.read(e,w,n,l);if(mY(t)){if(!n)throw Error(`Promise is required when async mode is enabled.`);m.push(t.then(e=>{p.iccApp=e})),f.push({type:`mergeIccDeferred`,deferredKey:`iccApp`})}else{let e=OY(`icc`,t,u);d.icc=e,u.shouldReturnGroup(`icc`)&&f.push({type:`mergeGroupAssign`,groupKey:`icc`,parsedTags:e})}}if(Q.USE_MPF&&T!==void 0&&u.shouldParseGroup(`mpf`)){let t=OY(`mpf`,XU.read(e,T,i,r,u),u);d.mpf=t,u.shouldReturnGroup(`mpf`)&&f.push({type:`mergeGroupAssign`,groupKey:`mpf`,parsedTags:t})}if(Q.USE_PNG&&Q.USE_PNG_FILE&&E!==void 0&&u.shouldParseGroup(`png`)){let t=OY(`png`,$q.read(e,E),u);d.pngFile=t,u.shouldReturnGroup(`png`)&&f.push({type:`mergePngFile`,parsedTags:t})}if(Q.USE_PNG&&LY(D)&&(u.shouldParseGroup(`png`)||u.shouldParseGroup(`exif`)||u.shouldParseGroup(`iptc`))){let{readTags:t,readTagsPromise:a}=aJ.read(e,D,n,i,r,u,l);h=!!a,f.push({type:`processPngTextReadTags`,readTags:t}),a&&(m.push(a.then(e=>{p.pngTextTagList=e})),f.push({type:`processPngTextReadTagsDeferredList`,deferredKey:`pngTextTagList`}))}if(Q.USE_PNG&&O!==void 0&&u.shouldParseGroup(`png`)){let t=OY(`png`,DJ.read(e,O),u);d.pngChunk=t,u.shouldReturnGroup(`png`)&&f.push({type:`mergePngChunk`,parsedTags:t})}if(Q.USE_WEBP&&k!==void 0&&u.shouldParseGroup(`riff`)){let t=OY(`riff`,FJ.read(e,k),u);d.riff=t,u.shouldReturnGroup(`riff`)&&f.push({type:`mergeGroupMerge`,groupKey:`riff`,parsedTags:t})}if(Q.USE_GIF&&A!==void 0&&u.shouldParseGroup(`gif`)){let t=OY(`gif`,UJ.read(e,A),u);d.gif=t,u.shouldReturnGroup(`gif`)&&f.push({type:`mergeGroupMerge`,groupKey:`gif`,parsedTags:t})}if(Q.USE_JXL&&N!==void 0&&u.shouldParseGroup(`file`)){let t=OY(`file`,_W.read(e,N),u);d.file=t,u.shouldReturnGroup(`file`)&&f.push({type:`mergeGroupAssign`,groupKey:`file`,parsedTags:t})}if(Q.USE_EXIF&&f.push({type:`gps`}),(Q.USE_EXIF||Q.USE_XMP)&&f.push({type:`composite`}),f.push({type:`thumbnail`}),f.push({type:`fileType`}),t&&a&&f.push({type:`metadataRange`,metadataBlocks:P,metadataTruncated:!!F}),!R)throw new _Y.MetadataMissingError;let z={objectAssign:vR,hasPngTextData:LY,filterTagsForParse:OY,filterTagsForReturn:kY,getGpsGroupFromExifTags:Q.USE_EXIF?MY:void 0,Composite:Q.USE_EXIF||Q.USE_XMP?nY:void 0,Thumbnail:YJ};if(n)return _R(),Promise.all(m).then(()=>cY({mergeSteps:f,deferredResults:p,parsedGroups:d,expanded:t,tagFilter:u,dataView:e,tiffHeaderOffset:x,exifDataView:I,fileType:v,pngTextChunks:D,pngTextIsAsync:h,thumbnailIfdTags:g,deps:z}));return cY({mergeSteps:f,deferredResults:p,parsedGroups:d,expanded:t,tagFilter:u,dataView:e,tiffHeaderOffset:x,exifDataView:I,fileType:v,pngTextChunks:D,pngTextIsAsync:h,thumbnailIfdTags:g,deps:z});function ee(e){if(!e)return!0;let{composite:t,file:n}=e;return t===!0||Array.isArray(t)&&t.length>0?!0:!(Array.isArray(n)&&n.length===1&&n[0]===`FileType`)}}function CY(e){return wY(e)?cR(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)):e}function wY(e){return TY(e)&&(e.byteOffset>0||e.byteLength<e.buffer.byteLength)}function TY(e){return!!e&&typeof e.getUint8==`function`&&typeof e.byteOffset==`number`&&typeof e.byteLength==`number`&&!!e.buffer&&typeof e.buffer.slice==`function`}function EY(e,t){let n=Math.max(0,Math.min(t.length,e.byteLength-t.dataOffset));return new DataView(e.buffer,e.byteOffset+t.dataOffset,n)}function DY(e,t,n,r,i){try{return KU.read(e,t,n,r,i)}catch{return{tags:{},byteOrder:vz.BIG_ENDIAN}}}function OY(e,t,n){return n.isActive?AY(e,t,n.shouldParseTag):t}function kY(e,t,n){return n.isActive?AY(e,t,n.shouldReturnTag):t}function AY(e,t,n){if(!t)return t;let r={};for(let a in t){let o=t[a];n(e,a,i(o))&&(r[a]=o)}return r;function i(e){if(e)return Array.isArray(e)?e.length===0?void 0:e[0].id:e.id}}function jY({fileType:e,fileDataOffset:t,jfifDataOffset:n,tiffHeaderOffset:r,iptcDataOffset:i,xmpChunks:a,iccChunks:o,mpfDataOffset:s,pngHeaderOffset:c,pngTextChunks:l,pngChunkOffsets:u,vp8xChunkOffset:d,gifHeaderOffset:f,jxlCodestreamOffset:p}){return!!e||Q.USE_JPEG&&Q.USE_FILE&&t!==void 0||Q.USE_JPEG&&Q.USE_JFIF&&n!==void 0||Q.USE_EXIF&&r!==void 0||Q.USE_JPEG&&Q.USE_IPTC&&i!==void 0||Q.USE_XMP&&NY(a)||Q.USE_ICC&&PY(o)||Q.USE_MPF&&s!==void 0||Q.USE_PNG&&Q.USE_PNG_FILE&&c!==void 0||Q.USE_PNG&&LY(l)||Q.USE_PNG&&u!==void 0||Q.USE_WEBP&&d!==void 0||Q.USE_GIF&&f!==void 0||Q.USE_JXL&&p!==void 0}function MY(e){let t;if(e.GPSLatitude&&e.GPSLatitudeRef){t||={};try{t.Latitude=hz(e.GPSLatitude.value),e.GPSLatitudeRef.value.join(``)===`S`&&(t.Latitude=-t.Latitude)}catch{}}if(e.GPSLongitude&&e.GPSLongitudeRef){t||={};try{t.Longitude=hz(e.GPSLongitude.value),e.GPSLongitudeRef.value.join(``)===`W`&&(t.Longitude=-t.Longitude)}catch{}}if(e.GPSAltitude&&e.GPSAltitudeRef){t||={};try{t.Altitude=e.GPSAltitude.value[0]/e.GPSAltitude.value[1],e.GPSAltitudeRef.value===1&&(t.Altitude=-t.Altitude)}catch{}}if(t)return t}function NY(e){return Array.isArray(e)&&e.length>0}function PY(e){return Array.isArray(e)&&e.length>0}function FY(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&e.Make.value[0]===`Canon`&&e.MakerNote&&e.MakerNote.__offset}function IY(e){return Array.isArray(e.MakerNote.value)&&e.MakerNote.value.length>7&&pR(e.MakerNote.value.slice(0,7))===`PENTAX `&&e.MakerNote.__offset}function LY(e){return Array.isArray(e)&&e.length>0}var RY=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,14,14,15,15,16,16,17,17,18,18]);new Uint32Array([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,32769,49153,65537,98305,131073,196609,262145,393217,524289,786433])[39]+(1<<RY[39])-1;var zY=new Uint8Array([24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112]);(()=>{let e=new Map;for(let t=0;t<120;t++)e.set(zY[t],t+1);return e})(),new Int32Array([17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15]);var BY=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]);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])[23]+(1<<BY[23])-1;function VY(e){if(e.length<12)throw Error(`Invalid RIFF file: shorter than 12-byte container header`);let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e[0]!==82||e[1]!==73||e[2]!==70||e[3]!==70)throw Error(`Invalid RIFF file: missing RIFF signature`);if(e[8]!==87||e[9]!==69||e[10]!==66||e[11]!==80)throw Error(`Invalid WebP file: missing WEBP signature`);let n=[],r=12;for(;r+8<=e.length;){let i=String.fromCharCode(e[r],e[r+1],e[r+2],e[r+3]),a=t.getUint32(r+4,!0),o=r+8,s=Math.min(o+a,e.length);n.push({fourCC:i,size:a,data:e.subarray(o,s),offset:o});let c=a+(a&1),l=r+8+c;if(l<=r)break;r=l}return n}function HY(e){let t=4;for(let n of e){let e=n.data.length+(n.data.length&1);t+=8+e}let n=new Uint8Array(8+t),r=new DataView(n.buffer);n[0]=82,n[1]=73,n[2]=70,n[3]=70,r.setUint32(4,t,!0),n[8]=87,n[9]=69,n[10]=66,n[11]=80;let i=12;for(let t of e){n[i]=t.fourCC.charCodeAt(0),n[i+1]=t.fourCC.charCodeAt(1),n[i+2]=t.fourCC.charCodeAt(2),n[i+3]=t.fourCC.charCodeAt(3),r.setUint32(i+4,t.data.length,!0),n.set(t.data,i+8);let e=t.data.length+(t.data.length&1);i+=8+e}return n}new Uint8Array([0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0]),new Uint8Array([0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15]),new Uint8Array([173,148,140,0]),new Uint8Array([176,155,140,135,0]),new Uint8Array([180,157,141,134,130,0]),new Uint8Array([254,254,243,230,196,177,153,140,133,130,129,0]),(()=>{let e=new Uint8Array(1056),t=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],n=0;for(let r=0;r<4;r++)for(let i=0;i<8;i++)for(let a=0;a<3;a++)for(let o=0;o<11;o++)e[n++]=t[r][i][a][o];return e})(),(()=>{let e=new Uint8Array(1056),t=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],n=0;for(let r=0;r<4;r++)for(let i=0;i<8;i++)for(let a=0;a<3;a++)for(let o=0;o<11;o++)e[n++]=t[r][i][a][o];return e})(),new Uint16Array([4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284]),new Uint16Array([4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157]),new Int8Array([-10,2,4,6,-0,-2,-3,-1]),new Uint8Array([145,156,163,128]),new Int8Array([-0,2,-2,4,-3,-1]),new Uint8Array([142,114,183]),new Int8Array([-0,2,-1,4,-2,6,8,12,-3,10,-4,-5,-6,14,-7,16,-8,-9]),(()=>{let e=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],t=new Uint8Array(900),n=0;for(let r=0;r<10;r++)for(let i=0;i<10;i++)for(let a=0;a<9;a++)t[n++]=e[r][i][a];return t})(),new Uint16Array([0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396]),new Uint8Array([7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0]),new Uint8Array([127,127,191,127,159,191,223,127,143,159,175,191,207,223,239,127,135,143,151,159,167,175,183,191,199,207,215,223,231,239,247,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,127]);var UY;(function(e){e[e.Literal=0]=`Literal`,e[e.Backref=1]=`Backref`,e[e.Cache=2]=`Cache`})(UY||={});var WY=o((e=>{(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`0.3.0`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t(),r=typeof Buffer<`u`;function i(e){if(e.length>32768&&r)return o(new Buffer(e));for(var t=-1,i=e.length-1,a=0;a<i;)t=n[(t^e.charCodeAt(a++))&255]^t>>>8,t=n[(t^e.charCodeAt(a++))&255]^t>>>8;return a===i&&(t=t>>>8^n[(t^e.charCodeAt(a))&255]),t^-1}function a(e){if(e.length>1e4)return o(e);for(var t=-1,r=0,i=e.length-3;r<i;)t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255];for(;r<i+3;)t=t>>>8^n[(t^e[r++])&255];return t^-1}function o(e){for(var t=-1,r=0,i=e.length-7;r<i;)t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255];for(;r<i+7;)t=t>>>8^n[(t^e[r++])&255];return t^-1}function s(e){for(var t=-1,r=0,i=e.length,a,o;r<i;)a=e.charCodeAt(r++),a<128?t=t>>>8^n[(t^a)&255]:a<2048?(t=t>>>8^n[(t^(192|a>>6&31))&255],t=t>>>8^n[(t^(128|a&63))&255]):a>=55296&&a<57344?(a=(a&1023)+64,o=e.charCodeAt(r++)&1023,t=t>>>8^n[(t^(240|a>>8&7))&255],t=t>>>8^n[(t^(128|a>>2&63))&255],t=t>>>8^n[(t^(128|o>>6&15|a&3))&255],t=t>>>8^n[(t^(128|o&63))&255]):(t=t>>>8^n[(t^(224|a>>12&15))&255],t=t>>>8^n[(t^(128|a>>6&63))&255],t=t>>>8^n[(t^(128|a&63))&255]);return t^-1}e.table=n,e.bstr=i,e.buf=a,e.str=s})})),GY=o(((e,t)=>{var n=WY();t.exports=o;var r=new Uint8Array(4),i=new Int32Array(r.buffer),a=new Uint32Array(r.buffer);function o(e){if(e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)throw Error(`Invalid .png file header`);if(e[4]!==13||e[5]!==10)throw Error(`Invalid .png file header: possibly caused by DOS-Unix line ending conversion?`);if(e[6]!==26)throw Error(`Invalid .png file header`);if(e[7]!==10)throw Error(`Invalid .png file header: possibly caused by DOS-Unix line ending conversion?`);for(var t=!1,o=[],s=8;s<e.length;){r[3]=e[s++],r[2]=e[s++],r[1]=e[s++],r[0]=e[s++];var c=a[0]+4,l=new Uint8Array(c);l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++];var u=String.fromCharCode(l[0])+String.fromCharCode(l[1])+String.fromCharCode(l[2])+String.fromCharCode(l[3]);if(!o.length&&u!==`IHDR`)throw Error(`IHDR header missing`);if(u===`IEND`){t=!0,o.push({name:u,data:new Uint8Array});break}for(var d=4;d<c;d++)l[d]=e[s++];r[3]=e[s++],r[2]=e[s++],r[1]=e[s++],r[0]=e[s++];var f=i[0];if(n.buf(l)!==f)throw Error(`CRC values for `+u+` header do not match, PNG file is likely corrupted`);var p=new Uint8Array(l.buffer.slice(4));o.push({name:u,data:p})}if(!t)throw Error(`.png file ended prematurely: no IEND header was found`);return o}})),KY=o(((e,t)=>{t.exports=function(e,t,n){var r=[],i=e.length;if(i===0)return r;var a=t<0?Math.max(0,t+i):t||0;for(n!==void 0&&(i=n<0?n+i:n);i-->a;)r[i-a]=e[i];return r}})),qY=o(((e,t)=>{var n=KY(),r=WY();t.exports=s;var i=new Uint8Array(4),a=new Int32Array(i.buffer),o=new Uint32Array(i.buffer);function s(e){var t=8,s=t,c;for(c=0;c<e.length;c++)t+=e[c].data.length,t+=12;var l=new Uint8Array(t);for(l[0]=137,l[1]=80,l[2]=78,l[3]=71,l[4]=13,l[5]=10,l[6]=26,l[7]=10,c=0;c<e.length;c++){var u=e[c],d=u.name,f=u.data,p=f.length,m=[d.charCodeAt(0),d.charCodeAt(1),d.charCodeAt(2),d.charCodeAt(3)];o[0]=p,l[s++]=i[3],l[s++]=i[2],l[s++]=i[1],l[s++]=i[0],l[s++]=m[0],l[s++]=m[1],l[s++]=m[2],l[s++]=m[3];for(var h=0;h<p;)l[s++]=f[h++];var g=m.concat(n(f));a[0]=r.buf(g),l[s++]=i[3],l[s++]=i[2],l[s++]=i[1],l[s++]=i[0]}return l}})),JY=l(GY(),1),YY=l(qY(),1);function XY(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}function ZY(e,t){let n=new TextEncoder().encode(t);return e.length>=n.length&&n.every((t,n)=>e[n]===t)}function QY(e,t){let n=(0,JY.default)(e),r=`XML:com.adobe.xmp\0`,i=n.filter(e=>!([`iTXt`,`tEXt`,`zTXt`].includes(e.name)&&ZY(e.data,r))),a=i.findIndex(e=>e.name===`IDAT`);if(a<0)throw Error(`PNG has no image data`);return i.splice(a,0,{name:`iTXt`,data:XY([new TextEncoder().encode(r),new Uint8Array(4),new TextEncoder().encode(t)])}),(0,YY.default)(i)}var $Y=`http://ns.adobe.com/xap/1.0/\0`,eX=`http://ns.adobe.com/xmp/extension/\0`;function tX(e,t){let n=e,r=new DataView(e.buffer,e.byteOffset,e.byteLength);if(n.length<4||r.getUint16(0)!==65496||r.getUint16(n.length-2)!==65497)throw Error(`Invalid JPEG envelope`);let i=new TextEncoder().encode(`${$Y}${t}`);if(i.length>65533)throw Error(`XMP exceeds one JPEG APP1 segment`);let a=new Uint8Array(4),o=new DataView(a.buffer);o.setUint16(0,65505),o.setUint16(2,i.length+2);let s=XY([a,i]),c=[n.subarray(0,2)],l=1,u=!0,d=!1,f=2;for(;f+4<=n.length;){let e=f;if(n[f]!==255)throw Error(`Invalid JPEG marker`);for(;n[f]===255;)f++;let t=n[f];if(t===void 0||t===0||t===216||t===217)throw Error(`JPEG ended before its scan`);if(t===1||t>=208&&t<=215){c.push(n.subarray(e,f+1)),f++,u=!1;continue}if(f+3>n.length)throw Error(`Truncated JPEG length`);let i=r.getUint16(f+1),a=f+1+i;if(i<2||a>n.length)throw Error(`Truncated JPEG segment`);if(t>=192&&t<=207&&![196,200,204].includes(t)&&(d=!0),t===218){if(!d)throw Error(`JPEG has no frame`);return c.splice(l,0,s),c.push(n.subarray(e)),XY(c)}let o=n.subarray(f+3,a);t===225&&[$Y,eX].some(e=>ZY(o,e))||(c.push(n.subarray(e,a)),u&&(t===224||t===225&&ZY(o,`Exif\0\0`))?l=c.length:u=!1),f=a}throw Error(`JPEG has no scan`)}var nX=`https://fungi.computer/ns/provenance/1.0/`,rX=`http://iptc.org/std/Iptc4xmpExt/2008-02-29/`,iX=`http://www.w3.org/1999/02/22-rdf-syntax-ns#`;function aX(e){let t=new aR.DOMParser({onError:()=>{throw Error(`Invalid provenance XML`)}}),n=e?t.parseFromString(e,`application/xml`):void 0,r=(e,t)=>{let r=n?.getElementsByTagNameNS(e,t).item(0);if(r?.textContent)return r.textContent;let i=n?.getElementsByTagNameNS(iX,`Description`);if(i)for(let n=0;n<i.length;n++){let r=i.item(n)?.getAttributeNS(e,t);if(r)return r}},i=t.parseFromString(`<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about=""/></rdf:RDF></x:xmpmeta>`,`application/xml`),a=i.getElementsByTagNameNS(iX,`Description`).item(0);if(!a)throw Error(`Missing provenance description`);let o=[{namespace:nX,name:`printId`,qualified:`fungi:printId`},{namespace:rX,name:`DigitalSourceType`,qualified:`Iptc4xmpExt:DigitalSourceType`}];for(let{namespace:e,name:t,qualified:n}of o){let o=r(e,t);if(o===void 0)continue;let s=i.createElementNS(e,n);s.textContent=o,a.appendChild(s)}return new aR.XMLSerializer().serializeToString(i)}var oX=33554432,sX=class extends Error{reason;name=`ProvenanceExportError`;constructor(e,t){super(`Print export refused: ${e}`,t),this.reason=e}};function cX(e,t){let n=VY(e);if(n.some(e=>e.size!==e.data.length)||n.reduce((e,t)=>e+8+t.size+t.size%2,12)!==e.length)throw Error(`Incomplete extended WebP`);if(!n.some(e=>e.fourCC===`XMP `))return e;if(!n.some(e=>e.fourCC===`VP8X`))throw Error(`XMP without extended WebP header`);let r=!1;return HY(n.flatMap(e=>e.fourCC===`XMP `?r?[]:(r=!0,[{fourCC:`XMP `,data:new TextEncoder().encode(t)}]):[{fourCC:e.fourCC,data:e.data}]))}async function lX(e){if(e.length>33554432)throw new sX(`too-large`);let t=new TextDecoder(`latin1`).decode(e);if(t.includes(`c2pa`)||t.includes(`caBX`))throw new sX(`signed-image`);try{let t=await vY.loadView(new DataView(e.buffer,e.byteOffset,e.byteLength),{expanded:!0,async:!0,domParser:new aR.DOMParser,includeTags:{xmp:!0,png:!0,file:!0},decompress:{maxDecompressedSize:oX}}),n=t.file?.FileType?.value;if(n!==`png`&&n!==`jpeg`&&n!==`webp`&&n!==`gif`)throw new sX(`unsupported-format`);let r={type:`image/${n}`,extension:n===`jpeg`?`jpg`:n};if(n===`gif`&&!t.xmp)return{bytes:e,...r};let i=aX(t.xmp?._raw??t.pngText?.[`XML:com.adobe.xmp`]?.value),a=n===`png`?QY(e,i):n===`jpeg`?tX(e,i):n===`webp`?cX(e,i):void 0;if(!a)throw new sX(`unsupported-format`);if(a.length>33554432)throw new sX(`too-large`);return{bytes:a,...r}}catch(e){throw e instanceof sX?e:new sX(`invalid-image`,{cause:e})}}function uX(e){return/\.mp4$/iu.test(e)}async function dX(e,t){if(uX(e.name)){let n=document.createElement(`video`);return n.preload=`metadata`,n.muted=!0,await new Promise((e,r)=>{n.addEventListener(`loadedmetadata`,()=>{e()},{once:!0}),n.addEventListener(`error`,()=>{r(Error(`MP4 metadata could not be read`))},{once:!0}),n.src=t}),{file:e,url:t,width:n.videoWidth,height:n.videoHeight}}let n=new Image;return n.src=t,await n.decode(),{file:e,url:t,width:n.naturalWidth,height:n.naturalHeight}}var fX={title:`Image too large`,message:`Download supports images up to 32 MiB. Choose a smaller image.`};async function pX(e,t){let n=()=>{if(t.throwIfAborted(),e.kind===`computer`&&e.connection.app.context.get().computerId!==e.computerId)throw new K(`Print Computer changed`,{code:`SELECTION_CHANGED`,retryable:!1})};if(n(),e.file.size>33554432)throw new sX(`too-large`);let r=e.kind===`computer`?await KL(e.connection.app.capabilities,{path:e.path},{signal:t}):e.file;if(n(),r.size>33554432)throw new sX(`too-large`);let i=e.kind===`computer`?e.path:r.name,a=(i.split(`/`).at(-1)??`print`).replace(/\.[^.]*$/,``)||`print`;if(uX(i))return n(),new File([r],`${a}.mp4`,{type:`video/mp4`});let o=await lX(new Uint8Array(await r.arrayBuffer()));return n(),new File([Uint8Array.from(o.bytes)],`${a}.${o.extension}`,{type:o.type})}function mX(e){return e instanceof sX?{...{"too-large":fX,"signed-image":{title:`Download unavailable`,message:`This image has signed metadata that Prints cannot safely remove.`},"invalid-image":{title:`Couldn't prepare the image`,message:`Prints couldn't remove this image's private details. Choose another image.`},"unsupported-format":{title:`Download unavailable`,message:`Prints cannot safely export this file format yet.`}}[e.reason],retryable:!1}:uc(e,{FILE_TOO_LARGE:fX})}function hX(e){return{...{"no-user-gesture":{title:`Click to download`,message:`Click Download in Prints to save this image.`},"too-large":fX,"invalid-request":{title:`Download unavailable`,message:`The prepared image could not be saved. Reopen its information and try again.`},unavailable:{title:`Download unavailable`,message:`The host cannot save files right now. Reopen Prints and try again.`},denied:{title:`Download denied`,message:`Your browser did not allow this download. Check its download settings and try again.`},busy:{title:`Download busy`,message:`Wait for the current browser action to finish, then try again.`}}[e.reason],retryable:!1}}Y({operation:nC(`read-library`),computerId:HC});var gX=oC.pipe(X(BC(4096)),X(xC(e=>e.startsWith(`/`)&&e!==`/`&&!e.includes(`\0`)&&!e.endsWith(`/`)&&!e.split(`/`).some(e=>e===`.`||e===`..`))));Y({path:hC(gX)});var _X=function(e,t,n){if(t!=null){if(typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Object expected.`);var r,i;if(n){if(!Symbol.asyncDispose)throw TypeError(`Symbol.asyncDispose is not defined.`);r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw TypeError(`Symbol.dispose is not defined.`);r=t[Symbol.dispose],n&&(i=r)}if(typeof r!=`function`)throw TypeError(`Object not disposable.`);i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},vX=(function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,`An error was suppressed during disposal.`):n,t.hasError=!0}var r,i=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var e=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(e).then(a,function(e){return n(e),a()})}else i|=1}catch(e){n(e)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}})(typeof SuppressedError==`function`?SuppressedError:function(e,t,n){var r=Error(n);return r.name=`SuppressedError`,r.error=e,r.suppressed=t,r}),yX=class extends K{stage;constructor(e){super(e.message,{code:e.code,retryable:e.retryable}),this.stage=e.stage??null}},bX=e=>oC.pipe(X(LC(1)),X(BC(e))),xX=Y({requestId:bX(256),computerId:bX(256)}),SX=sC.pipe(X(FC()),X(xC(Number.isSafeInteger,{message:`Expected a safe integer`}))),CX=SX.pipe(X(jC(0))),wX=SX.pipe(X(MC(0))),TX=mC([`first-frame`,`last-frame`,`reference`]),EX=mC([`480p`,`720p`,`768p`,`1080p`,`4k`]),DX=mC([`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`,`9:21`]),OX=Y({path:bX(4096),role:tC(TX)}),kX=Y({path:bX(4096),role:TX}),AX=Y({computerId:bX(256),path:bX(4096)}),jX=Y({defaultHeight:CX,defaultSteps:hC(wX),defaultWidth:CX,dimensions:mC([`none`,`own`]),maxDimension:hC(CX),maxReferences:wX,maxSteps:hC(CX),referenceField:hC(bX(256)),steps:mC([`steps`,`num_steps`,`fixed`]),transport:mC([`json`,`multipart`])}),MX=Y({minSeconds:CX,maxSeconds:CX,defaultSeconds:CX,durations:dC(CX),provider:mC([`seedance`,`veo`,`minimax`]),formats:dC(Y({resolution:EX,aspectRatio:DX,width:CX,height:CX})),defaultResolution:EX,defaultAspectRatio:DX,defaultGenerateAudio:hC(cC),maxPromptLength:CX,referenceRoles:dC(TX),maxReferenceImages:wX,referenceResolutions:dC(EX),prices:dC(Y({resolution:EX,silentMilliunitsPerSecond:CX,audioMilliunitsPerSecond:CX}))}),NX=dC(Y({id:bX(256),input:jX,kind:mC([`image`,`video`]),label:bX(512),tier:mC([`draft`,`balanced`,`premium`,`max`]),outputFormats:dC(mC([`png`,`jpeg`,`webp`])).pipe(X(BC(3))),sizes:hC(dC(oC.pipe(X(wC(/^\d+x\d+$/u))))),video:hC(MX)})),PX=Y({[Symbol.dispose]:tC(rC),computerId:bX(256),models:NX,canGenerate:cC}),FX=Y({model:bX(256),prompt:bX(2048),width:CX.pipe(X(NC(5040))),height:CX.pipe(X(NC(5040))),steps:tC(CX),durationSeconds:tC(CX),resolution:tC(EX),aspectRatio:tC(DX),generateAudio:tC(cC),references:tC(dC(OX).pipe(X(BC(4))))});Y({model:bX(256),prompt:bX(2048),resolution:tC(EX),aspectRatio:tC(DX),durationSeconds:tC(CX.pipe(X(MC(4)),X(NC(15)))),generateAudio:tC(cC),references:tC(dC(kX).pipe(X(BC(4))))});var IX=[`admission`,`generation-authorization`,`settings`,`estimate`,`billing`,`operation`,`provider`,`normalization`,`artifact`,`destination-authorization`,`destination-write`],LX=Y({destination:Y({path:bX(4096)}),settings:rC}),RX=Y({[Symbol.dispose]:tC(rC),bytes:CX,costMilliunits:wX,destination:AX,format:mC([`png`,`jpeg`,`gif`,`webp`,`mp4`]),height:CX,model:bX(256),width:CX});Y({...RX.fields,format:nC(`mp4`)});var zX=Y({message:bX(512),stage:tC(mC(IX)),code:mC([`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`DISCONNECTED`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`TIMEOUT`]),retryable:cC}),BX=pC([Y({[Symbol.dispose]:tC(rC),kind:nC(`succeeded`),result:RX}),Y({[Symbol.dispose]:tC(rC),kind:nC(`failed`),failure:zX})]),VX=Pj({reference:Ij(Fj(Bo().transform(e=>QS(xX)(e)))),generate:Ij(Fj(Bo().transform(e=>{let t=QS(BX,{onExcessProperty:`error`})(e);return t.kind===`succeeded`?{kind:t.kind,result:{bytes:t.result.bytes,costMilliunits:t.result.costMilliunits,destination:t.result.destination,format:t.result.format,height:t.result.height,model:t.result.model,width:t.result.width}}:{kind:t.kind,failure:t.failure}})))}),HX=Nj(`media.generation`,5,js(()=>Pj({describe:Ij(Fj(Bo().transform(e=>{let{computerId:t,canGenerate:n,models:r}=QS(PX,{onExcessProperty:`error`})(e);return{computerId:t,canGenerate:n,models:r}}))),createAttempt:Ij(VX),restoreAttempt:Ij(VX),cancelAttempt:Lj})));function UX(e,t){try{return QS(e,{onExcessProperty:`error`})(t)}catch(e){throw new K(`The Media capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}}function WX(e){return e instanceof K?e:new K(`The Media capability failed`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}function GX(e){if(e?.aborted)throw new K(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1})}function KX(e){let t;try{t=QS(LX,{onExcessProperty:`error`})(e)}catch(e){throw new K(`Media generation input is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let n;try{n=qX(QS(FX,{onExcessProperty:`error`})(t.settings))}catch(e){throw new K(`Media generation settings are invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let r={path:t.destination.path.trim()};if(r.path.length===0)throw new K(`Media generation destination is invalid`,{code:`INVALID_ARGUMENT`,retryable:!1});return Object.freeze({destination:Object.freeze(r),settings:n})}function qX(e){let t=(e,t)=>{let n=e.trim();if(n.length===0)throw Error(`${t} must not be blank`);return n},n={model:t(e.model,`model`),prompt:t(e.prompt,`prompt`),width:e.width,height:e.height};return e.steps!==void 0&&(n.steps=e.steps),e.durationSeconds!==void 0&&(n.durationSeconds=e.durationSeconds),e.resolution!==void 0&&(n.resolution=e.resolution),e.aspectRatio!==void 0&&(n.aspectRatio=e.aspectRatio),e.generateAudio!==void 0&&(n.generateAudio=e.generateAudio),e.references!==void 0&&(n.references=Object.freeze(e.references.map(e=>Object.freeze({...e,path:t(e.path,`reference`)})))),Object.freeze(n)}function JX(e){let t=UX(NX,e),n=new Set;for(let e of t){if(n.has(e.id))throw new K(`The Media capability repeated a model`,{code:`PROTOCOL`,retryable:!1});n.add(e.id)}return Object.freeze(t.map(e=>Object.freeze(e)))}function YX(e,t,n){let r=UX(RX,e);if(r.model!==t.settings.model||r.destination.computerId!==n||r.destination.path!==t.destination.path||r.width!==t.settings.width||r.height!==t.settings.height)throw new K(`The Media capability returned an unrelated result`,{code:`PROTOCOL`,retryable:!1});return Object.freeze({bytes:r.bytes,costMilliunits:r.costMilliunits,destination:Object.freeze({...r.destination}),format:r.format,height:r.height,model:r.model,width:r.width})}async function XX(e){try{let t=e.require(HX);{let e={stack:[],error:void 0,hasError:!1};try{let n=UX(PX,_X(e,IA(await t.describe()),!1).value),r=n.computerId.trim();if(r.length===0)throw new K(`The Media capability returned no Computer`,{code:`PROTOCOL`,retryable:!1});let i=JX(n.models),a=async e=>{let n=IA(e),i;try{{let t={stack:[],error:void 0,hasError:!1};try{let n=_X(t,IA(await e.reference()),!1),a=UX(Y({...xX.fields,[Symbol.dispose]:tC(rC)}),n.value);if(i={requestId:a.requestId,computerId:a.computerId},i.computerId!==r)throw new K(`Media attempt belongs to another Computer`,{code:`IDENTITY`,retryable:!1})}catch(e){t.error=e,t.hasError=!0}finally{vX(t)}}}catch(e){throw n[Symbol.dispose](),WX(e)}let a=!1;return{reference:Object.freeze(i),async generate(n,o={}){if(a)throw new K(`Media generation attempt is closed`,{code:`CAPABILITY_DENIED`,retryable:!1});GX(o.signal);let s=KX(n),c=o.signal,l,u,d=()=>(u??=t.cancelAttempt(i),u);try{let t=e.generate(s),n=c===void 0?await t:await Promise.race([t,new Promise((e,t)=>{l=()=>{d().then(()=>{t(new K(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1}))},t)},c.addEventListener(`abort`,l,{once:!0}),c.aborted&&l()})]);c?.aborted&&(await d(),GX(c)),GX(c);{let e={stack:[],error:void 0,hasError:!1};try{let t=UX(BX,_X(e,IA(n),!1).value);if(t.kind===`failed`)throw new yX(t.failure);return YX(t.result,s,r)}catch(t){e.error=t,e.hasError=!0}finally{vX(e)}}}catch(e){throw c?.aborted&&(await d(),GX(c)),WX(e)}finally{l!==void 0&&c?.removeEventListener(`abort`,l)}},[Symbol.dispose](){a||(a=!0,n[Symbol.dispose]())}}};return Object.freeze({computerId:r,canGenerate:n.canGenerate,models:i,async createAttempt(){return a(await t.createAttempt())},async restoreAttempt(e){let n=UX(xX,e);if(n.computerId!==r)throw new K(`Select the original Computer to retry this generation`,{code:`IDENTITY`,retryable:!1});let i=await a(await t.restoreAttempt(n));if(i.reference.requestId!==n.requestId)throw i[Symbol.dispose](),new K(`Media restore changed the request identity`,{code:`PROTOCOL`,retryable:!1});return i}})}catch(t){e.error=t,e.hasError=!0}finally{vX(e)}}}catch(e){throw WX(e)}}function ZX(e,t){console.error(`Prints operation failed`,JSON.stringify({operation:e,errorKind:t instanceof Error?`error`:`non-error`,stage:t instanceof yX?t.stage:null}),Mf(t))}function QX(e,t){let n=(0,f.useRef)(null),r=Yl({gcTime:0,mutationFn:async t=>{let n=await pX(e,t.signal),r=new Uint8Array(await n.arrayBuffer());return t.signal.throwIfAborted(),{kind:`saveFile`,name:n.name,mime:n.type,bytes:r}},onError:(e,t)=>{t.signal.aborted||ZX(`prepare-print-download`,e)}}),{mutate:i,reset:a}=r;(0,f.useEffect)(()=>{let r=new AbortController;n.current=r;let o=()=>{r.abort(),a()},s=t?.context.subscribe(t=>{e.kind===`computer`&&t.computerId!==e.computerId&&o()}),c=t?.lifecycle.subscribe(e=>{(e===`disconnected`||e===`disposing`||e===`disposed`)&&o()});return i(r),()=>{s?.(),c?.(),r.abort(),n.current===r&&(n.current=null)}},[e,t,i,a]);let o=Yl({gcTime:0,mutationFn:e=>e,onError:e=>{ZX(`download-print`,e)}}),s=r.error??o.error,c=s?mX(s):o.data?.kind===`refused`?hX(o.data):null;return{preparing:r.isIdle||r.isPending,isPending:o.isPending,disabled:!r.data||o.isPending,failure:c,start:()=>{if(r.data&&!o.isPending&&!n.current?.signal.aborted){let e=t?t.ui.requestBrowserAction(r.data):Promise.resolve({kind:`refused`,reason:`unavailable`});o.mutate(e)}}}}function $X({image:e,app:t,onClose:n}){let r=(0,f.useRef)(null),i=QX(e.source,t),a=i.failure;return(0,f.useEffect)(()=>{let e=document.activeElement;return r.current?.focus(),()=>{e instanceof HTMLElement&&e.isConnected&&e.focus()}},[]),(0,J.jsxs)(_L,{ref:r,className:`prints-info-drawer`,role:`region`,"aria-label":`Image information`,tabIndex:-1,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-sm`,children:[(0,J.jsx)(`h2`,{className:`text-base font-semibold`,children:`Image info`}),(0,J.jsx)(gL,{"aria-label":`Close image information`,icon:(0,J.jsx)(kL,{}),onClick:n})]}),(0,J.jsxs)(Fte,{density:`compact`,children:[(0,J.jsxs)(yL,{children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`File`}),(0,J.jsx)(`span`,{className:`break-all`,children:e.file.name})]}),(0,J.jsxs)(yL,{children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Size`}),(0,J.jsxs)(`span`,{children:[e.width,` × `,e.height]})]})]}),(0,J.jsxs)(mL,{onClick:i.start,disabled:i.disabled,"aria-busy":i.preparing||i.isPending,children:[(0,J.jsx)(Bte,{"aria-hidden":`true`,size:16}),i.preparing?`Preparing download…`:i.isPending?`Downloading…`:`Download`]}),a?(0,J.jsxs)(`p`,{role:`alert`,className:`text-sm`,children:[a.title,`. `,a.message]}):null]})}var eZ=24,tZ={all:e=>eM.of(e,`prints`,`gallery`),listings:e=>[...tZ.all(e),`listing`],listing:(e,t)=>[...tZ.listings(e),t],file:(e,t)=>[...tZ.all(e),`file`,t]};function nZ(e,t){let n=e?.context.get().computerId;return Kl({queryKey:tZ.listing(e,t),initialPageParam:0,enabled:!!(n&&t&&e.capabilities.has(PL)&&e.capabilities.has(GL)),queryFn:async({pageParam:r,signal:i})=>{if(!e||!n||!t)throw new K(`No Computer folder selected`,{code:`SELECTION_CHANGED`,retryable:!1});let a=[],o=r;do{if(i.throwIfAborted(),e.context.get().computerId!==n)throw new K(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1});let r=await qL(e.capabilities,{path:t,limit:eZ-a.length,offset:o});if(i.throwIfAborted(),r.nextOffset!==null&&r.nextOffset<=o)throw new K(`Directory pagination did not advance`,{code:`PROTOCOL`,retryable:!1});a.push(...r.entries.filter(e=>e.type===`file`&&/\.(avif|gif|jpe?g|png|svg|webp|mp4)$/i.test(e.name)).map(e=>({...e,path:`${r.path.replace(/\/$/,``)}/${e.name}`}))),o=r.nextOffset}while(a.length<eZ&&o!==null);return{entries:a,nextOffset:o}},getNextPageParam:e=>e.nextOffset})}function rZ(e,t,n){return{...rM(e,GL,[...tZ.file(e,t.path),t.modifiedAt,t.size],async(n,r)=>{if(!e)throw new K(`Prints disconnected`,{code:`DISCONNECTED`,retryable:!0});let i=await KL(e.capabilities,{path:t.path},{signal:r});return new File([i],i.name,{type:i.type,lastModified:t.modifiedAt})}),enabled:!!(n&&e?.context.get().computerId&&e.capabilities.has(GL)),structuralSharing:!1}}function iZ(e,t){let n=e?.app??null,r=kj(n),i=_c(),[a,o]=(0,f.useState)(()=>new Set),s=(0,f.useCallback)(e=>{if(!r)return;let t=`${r}:${e}`;o(e=>e.has(t)?e:new Set([...e,t]))},[r]),c=nZ(n,t),l=Zl(c),u=(0,f.useMemo)(()=>c.enabled?l.data?.pages.flatMap(e=>e.entries)??[]:[],[l.data,c.enabled]),d=(0,f.useCallback)(e=>({files:e.flatMap((e,t)=>e.data?[{path:u[t].path,file:e.data}]:[]),failures:e.flatMap((e,t)=>e.isError?[u[t].name]:[]),loading:e.some(e=>e.isLoading)}),[u]),p=Hl({queries:u.map(e=>rZ(n,e,!!(r&&a.has(`${r}:${e.path}`)))),combine:d});return(0,f.useEffect)(()=>{if(!n)return;let e=tZ.all(n),t=tZ.listings(n),a=!0;i.invalidateQueries({queryKey:e});let o=()=>{i.cancelQueries({queryKey:e})},s=n.context.subscribe(e=>{e.computerId!==r&&o()}),c=n.lifecycle.subscribe(e=>{(e===`disconnected`||e===`disposing`||e===`disposed`)&&o()}),l=n.capabilities.subscribe(()=>{queueMicrotask(()=>{!a||n.context.get().computerId!==r||i.resetQueries({queryKey:t})})});return()=>{a=!1,s(),c(),l(),o()}},[n,r,e,i]),{entries:u,loadFile:s,files:p.files,failures:p.failures,error:l.error,loading:l.isFetching||p.loading,hasNextPage:l.hasNextPage,nextPageReady:l.hasNextPage&&!l.isFetching&&!l.error,refresh:()=>{l.refetch({cancelRefetch:!1})},loadMore:()=>{l.isFetching||l.fetchNextPage({cancelRefetch:!1})}}}function aZ(e){return e.replace(/\s/gu,` `).replace(/ +/g,` `).trim()}function oZ(e,t){let[n,r]=(0,f.useState)([]),i=(0,f.useRef)(new Map),a=(0,f.useRef)(Promise.resolve()),[o,s]=(0,f.useState)(null),c=(0,f.useRef)(new Map),l=(0,f.useRef)(e);l.current=e;let u=(0,f.useRef)(t);u.current=t;let d=(e,t,n)=>{let a=i.current.get(e);a&&i.current.set(e,{...a,status:t,message:n}),r([...i.current.values()])},p=(0,f.useCallback)(async(e,t)=>{let n=()=>t.signal.aborted;if(n()){d(e.id,`cancelled`,`Cancelled before sending`),c.current.delete(e.id);return}let r=e.dimensions;if(!r)try{let t=await dX(e.file,e.previewUrl);r={width:t.width,height:t.height},e.dimensions=r;let n=i.current.get(e.id);n&&i.current.set(e.id,{...n,dimensions:r})}catch(t){ZX(`decode-upload-image`,t),d(e.id,`error`,`Could not decode this image. No upload was sent.`),c.current.delete(e.id);return}try{if(n()){d(e.id,`cancelled`,`Cancelled before sending`);return}if(e.app.context.get().computerId!==e.computerId){d(e.id,`error`,`Computer changed. Select the original Computer and retry. No upload was sent.`);return}u.current({id:e.id,path:e.path,computerId:e.computerId,app:e.app,width:r.width,height:r.height}),d(e.id,`sending`,`Sending; awaiting Computer completion`),await ZL(e.app.capabilities,{path:e.path,content:e.file.slice()},{signal:t.signal}),d(e.id,`complete`,`Written to Computer`);try{await l.current(e.path,e.app,e.computerId)}catch(t){ZX(`refresh-upload-preview`,t),d(e.id,`complete`,`Written; fresh preview unavailable`)}}catch(t){n()||ZX(`write-computer-upload`,t),d(e.id,n()?`cancelled`:`error`,n()?`Cancelled request; check Computer before retrying`:`Completion not confirmed; check Computer or retry`)}finally{c.current.delete(e.id)}},[]),m=e=>{let t=new AbortController;c.current.set(e.id,t),d(e.id,`queued`,`Queued`),a.current=a.current.then(()=>p(e,t))},h=(0,f.useCallback)(()=>{for(let e of c.current.values())e.abort()},[]);return(0,f.useEffect)(()=>()=>{h();for(let e of i.current.values())URL.revokeObjectURL(e.previewUrl)},[h]),{items:n,error:o,cancelAll:h,add(e,t,n){s(null);let r=[...i.current.values()].reduce((e,t)=>e+t.file.size,0);for(let a of e){if(!a.type.startsWith(`image/`)){s(`Only image files can be uploaded here`);continue}if(i.current.size>=8||r+a.size>67108864){s(`Upload queue limit: eight files and 64 MiB. Remove finished rows before adding more.`);break}let e=n.context.get().computerId;if(!e){s(`Select a Computer before uploading images.`);continue}let o=`${t.replace(/\/$/,``)}/upload-${Hj(8)}-${aZ(a.name)}`;if(i.current.has(o)){s(`This path is already in the queue. Retry or remove its existing row.`);continue}let c={computerId:e,id:o,file:a,previewUrl:URL.createObjectURL(a),app:n,path:o,status:`queued`,message:`Queued`};i.current.set(c.id,c),r+=a.size,m(c)}},cancel(e){c.current.get(e)?.abort()},retry(e){let t=n.find(t=>t.id===e);t&&!c.current.has(e)&&m(t)},remove(e){if(!c.current.has(e)){let t=i.current.get(e);t&&URL.revokeObjectURL(t.previewUrl),i.current.delete(e),r([...i.current.values()])}}}}function sZ(e,t){let n=t.path,r=kj(e?.app),i=(0,f.useRef)(new Set),a=(0,f.useRef)(0),o=(0,f.useRef)(e);o.current=e;let s=e?.app.capabilities.has(PL)===!0,c=e?.app.capabilities.has(GL)===!0,l=e?.app.capabilities.has(JL)===!0,u=iZ(e,t.galleryPath),[d,p]=(0,f.useState)([]),[m,h]=(0,f.useState)([]),[g,_]=(0,f.useState)([]),[v,y]=(0,f.useState)([]);(0,f.useEffect)(()=>{y([])},[e]);let b=e=>{y(t=>t.some(t=>t.key===e.key)?t.map(t=>t.key===e.key?e:t):[...t,e])},[x,S]=(0,f.useState)(!1),C=(0,f.useMemo)(()=>[...u.error?[`Could not refresh the Media gallery`]:[],...u.failures],[u.error,u.failures]),w=(0,f.useRef)(new WeakMap),T=(0,f.useMemo)(()=>{if(!c||!s)return d.filter(e=>e.kind===`local`);let t=r?u.files.map(({file:t,path:n})=>({kind:`computer`,computerId:r,connection:e,file:t,path:n})):[],i=d.filter(t=>t.kind===`local`||t.computerId===r&&t.connection===e&&t.path.slice(0,t.path.lastIndexOf(`/`))===n?.replace(/\/$/,``));return[...t.filter(e=>!i.some(t=>t.kind===`computer`&&e.kind===`computer`&&t.path===e.path)),...i]},[e,r,n,u.files,d,c,s]),E=(0,f.useCallback)(()=>{a.current+=1;for(let e of i.current)e.abort();i.current.clear()},[]);(0,f.useEffect)(()=>{if(!e)return()=>{E()};let t=e.app.lifecycle.subscribe(e=>{(e===`disconnected`||e===`disposing`||e===`disposed`)&&E()});return()=>{t(),E()}},[e,E]),(0,f.useEffect)(()=>{if(e)return e.app.context.subscribe(e=>{e.computerId!==r&&E()})},[e,r,E]),(0,f.useEffect)(()=>{y([]),p(e=>e.filter(e=>e.kind===`local`))},[r]);let D=async(e,t,n,r)=>{let s=r??n.app.context.get().computerId;if(!s){_([`The selected Computer is unavailable`]);return}if(t===`open`){try{await(o.current??n).app.ui.openNavigation({computerId:s,path:e})}catch(t){ZX(`open-computer-file`,t),_([`Could not open ${e} in Inkcap`])}return}if(o.current!==n){_([`Computer selection changed`]);return}if(n.app.context.get().computerId!==s){_([`Computer selection changed before the preview was loaded`]);return}let c=a.current,l=new AbortController;i.current.add(l);try{let t=await KL(n.app.capabilities,{path:e},{signal:l.signal});if(l.signal.aborted||c!==a.current)return;y(n=>n.map(n=>n.key===`${s}:${e}`?{...n,previewFile:t}:n)),p(r=>[...r.filter(t=>t.kind!==`computer`||t.path!==e||t.computerId!==s),{kind:`computer`,computerId:s,file:t,path:e,connection:n}])}catch(t){l.signal.aborted||(ZX(`read-computer-file`,t),_([`Could not read ${e}`]),y(t=>t.map(t=>t.key===`${s}:${e}`?{...t,error:`Saved; preview unavailable. Retry loading it.`}:t)))}finally{i.current.delete(l)}},O=(0,f.useRef)(new Set),k=(0,f.useRef)(new Set),A=(0,f.useCallback)(e=>{URL.revokeObjectURL(e),O.current.delete(e)},[]);(0,f.useEffect)(()=>{let e=!0,t=new Set,n=new Map,r=new Set,i=[...T].sort((e,t)=>t.file.lastModified-e.file.lastModified||e.file.name.localeCompare(t.file.name)).map(e=>{let t=URL.createObjectURL(e.file);return O.current.add(t),{source:e,file:e.file,url:t}}),a=i.length;return _(C),S(a>0),a===0&&h([]),i.forEach(({file:o,url:s,source:c},l)=>{let u=w.current.get(o);u||(u=(async()=>{let e=URL.createObjectURL(o);try{let{width:t,height:n}=await dX(o,e);return{width:t,height:n}}finally{URL.revokeObjectURL(e)}})(),w.current.set(o,u)),u.then(r=>{e&&(n.set(l,{...r,file:o,url:s,source:c}),t.add(s),h(i.flatMap((e,t)=>{let r=n.get(t);return r?[r]:[]})),y(e=>e.map(e=>e.previewFile===o?{...e,resolved:!0,previewFile:void 0,error:void 0}:e)))}).catch(t=>{e&&(ZX(`decode-gallery-image`,t),A(s),r.add(o.name),_([...C,...r]),c.kind===`computer`&&y(e=>e.map(e=>e.key===`${c.computerId}:${c.path}`?{...e,error:`Could not decode the saved image.`}:e)))}).finally(()=>{--a,e&&a===0&&(S(!1),h(i.flatMap((e,t)=>{let r=n.get(t);return r?[r]:[]})))})}),()=>{e=!1;for(let{url:e}of i)t.has(e)||A(e)}},[T,C,A]),(0,f.useEffect)(()=>{let e=new Set(m.map(e=>e.url));for(let t of k.current)e.has(t)||A(t);k.current=e},[m,A]),(0,f.useEffect)(()=>{let e=O.current;return()=>{for(let t of e)URL.revokeObjectURL(t);e.clear()}},[]);let j=oZ(async(e,t,n)=>{let r=o.current,i=r?.app===t&&t.context.get().computerId===n?r:null;i&&await D(e,`add`,i,n)},e=>{o.current?.app===e.app&&e.app.context.get().computerId===e.computerId&&b({key:`${e.computerId}:${e.path}`,path:e.path,computerId:e.computerId,width:e.width,height:e.height,uploadId:e.id})});return(0,f.useEffect)(()=>{let t=j.cancelAll,n=e?.app.lifecycle.subscribe(e=>{(e===`disposing`||e===`disconnected`||e===`disposed`)&&t()});return()=>{n?.(),t()}},[e,j.cancelAll]),{images:m,failed:g,loading:x,gallery:u,gallerySlots:v,canBrowse:s,canRead:c,canWrite:l,reserveSlot:b,openComputerFile:D,uploads:j,uploadFiles:async i=>{if(!e||!l||n===null)return;let a=e,s=r,c=await t.ensureCreated();if(c){_([c]);return}o.current===a&&a.app.context.get().computerId===s&&j.add(i,n,a.app)},failSlot:(e,t)=>{y(n=>n.map(n=>n.key===e?{...n,error:t}:n))},clearSlotError:e=>{y(t=>t.map(t=>t.key===e?{...t,error:void 0}:t))},removeSlot:e=>{y(t=>t.filter(t=>t.key!==e))}}}var cZ=`@cf/black-forest-labs/flux-2-klein-4b`,lZ={landscape:{height:768,width:1024},portrait:{height:1024,width:768},square:{height:1024,width:1024}},uZ=[`landscape`,`portrait`,`square`];function dZ(e){return uc(e,{INSUFFICIENT_CREDIT:{title:`Couldn’t create image`,message:`Media generation needs Team credits. Add credits in Billing, then retry.`}})}function fZ(){return{destination:void 0,height:768,model:cZ,prompt:``,references:[],steps:void 0,width:1024}}function pZ(e,t,n=`png`){if(e.trim().length===0)throw Error(`Media generation token must not be empty.`);let r=e.trim();if(!/^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/.test(r))throw Error(`Media generation basename contains invalid characters.`);return`${t.replace(/\/$/,``)}/generated-${r}.${n}`}function mZ(e,t,n){let r=e.destination?.trim();if(r)return r;let i=n?.outputFormats.includes(`png`)?`png`:n?.outputFormats[0]??`png`,a=n?.kind===`video`?`mp4`:i===`jpeg`?`jpg`:i;return pZ(Kj({count:4}),t,a)}function hZ(e,t){for(let n of uZ){let r=lZ[n];if(r.width===e&&r.height===t)return n}return`custom`}function gZ(e){return e?.kind===`video`?`Generate video`:`Generate image`}function _Z(e){return e!==void 0&&e.sizes!==null?e.sizes.flatMap(e=>{let t=/^(\d+)x(\d+)$/u.exec(e);if(t===null)return[];let n=Number(t[1]),r=Number(t[2]);return[{value:e,label:`${String(n)} × ${String(r)}`,width:n,height:r}]}):uZ.map(e=>({value:e,label:`${String(lZ[e].width)} × ${String(lZ[e].height)}`,...lZ[e]}))}function vZ(e,t){return t.input.dimensions!==`none`&&cee(ZS(SZ(()=>t))({model:t.id,width:e.width,height:e.height}))?{width:e.width,height:e.height}:{width:t.input.defaultWidth,height:t.input.defaultHeight}}function yZ(e,t){return e.find(e=>e.id===t)}function bZ(e,t){return{...e,height:t.input.defaultHeight,model:t.id,steps:t.input.steps===`fixed`?void 0:t.input.defaultSteps??void 0,durationSeconds:t.video?.defaultSeconds,width:t.input.defaultWidth}}function xZ(e){let t={height:e.height,model:e.model,prompt:e.prompt.trim(),width:e.width};return e.steps!==void 0&&(t.steps=e.steps),e.durationSeconds!==void 0&&(t.durationSeconds=e.durationSeconds),e.references.length>0&&(t.references=e.references),{destination:{path:e.destination?.trim()??``},settings:t}}function SZ(e){return Y({model:oC,width:sC,height:sC,durationSeconds:eC(gC(sC)),steps:eC(gC(sC))}).check(xC(t=>{let n=e(t.model);if(!Number.isSafeInteger(t.width)||t.width<1)return{path:[`width`],issue:`Width must be a positive integer.`};if(!Number.isSafeInteger(t.height)||t.height<1)return{path:[`height`],issue:`Height must be a positive integer.`};if(n!==void 0){if(n.input.dimensions===`own`){let e=n.input.maxDimension??4096;if(t.width<256||t.height<256)return{path:[t.width<256?`width`:`height`],issue:`${n.label} requires dimensions of at least 256 × 256.`};if(t.width>e||t.height>e)return{path:[t.width>e?`width`:`height`],issue:`${n.label} accepts dimensions up to ${String(e)}.`}}if(n.sizes!==null&&!n.sizes.includes(`${String(t.width)}x${String(t.height)}`))return{path:[`width`],issue:`${n.label} accepts only these sizes: ${n.sizes.join(`, `)}.`};if(n.video!==null&&t.durationSeconds!==void 0&&(!Number.isSafeInteger(t.durationSeconds)||t.durationSeconds<n.video.minSeconds||t.durationSeconds>n.video.maxSeconds))return{path:[`durationSeconds`],issue:`${n.label} makes clips from ${String(n.video.minSeconds)} to ${String(n.video.maxSeconds)} seconds.`};if(n.input.steps===`fixed`&&t.steps!==void 0)return{path:[`steps`],issue:`${n.label} uses fixed steps.`};if(t.steps!==void 0&&(!Number.isSafeInteger(t.steps)||t.steps<1||n.input.maxSteps!==null&&t.steps>n.input.maxSteps))return{path:[`steps`],issue:`${n.label} accepts at most ${String(n.input.maxSteps??`the provider limit`)} steps.`}}}))}function CZ(e,t){if(e.destination?.trim().length===0)return`A destination file path is required.`;if(e.prompt.trim().length===0)return`Describe the image to generate.`;if(t===void 0)return`Choose a model from the granted registry.`;let n=ZS(SZ(()=>t))(e);if(yp(n))return mv()(n.failure.issue).issues.map(e=>e.message).join(` `);if(e.references.length>t.input.maxReferences)return`${t.label} accepts at most ${String(t.input.maxReferences)} reference images.`;if(e.references.length>0&&t.input.referenceField===null)return`${t.label} does not accept reference images.`}var wZ=HC,TZ=dC(HC.pipe(X(BC(1024)))).pipe(X(BC(200)));pC([Y({operation:nC(`read-notices`),computerId:wZ}),Y({operation:nC(`dismiss-notices`),computerId:wZ,keys:TZ})]);var EZ=Y({keys:TZ});async function DZ(e,t){return QS(EZ)(await e.require(aM).request(JSON.stringify(t)))}pC([Y({operation:nC(`read-folder`),computerId:wZ}),Y({operation:nC(`select-folder`),computerId:wZ,path:gX})]);var OZ=Y({path:gX,configured:cC});async function kZ(e,t){return QS(OZ)(await e.require(aM).request(JSON.stringify(t)))}var AZ={models:e=>eM.of(e,`prints`,`models`),folder:e=>eM.of(e,`prints`,`folder`),dismissals:e=>eM.of(e,`prints`,`dismissals`)};function jZ(e){return{...rM(e,HX,AZ.models(e),async(t,n)=>{if(!e)throw Error(`Prints is disconnected`);let r=await XX(e.capabilities);return n.throwIfAborted(),r}),enabled:!!(e?.context.get().computerId&&e.capabilities.has(HX)),structuralSharing:!1}}function MZ(e){let t=e?.context.get().computerId;return{...rM(e,aM,AZ.folder(e),async(n,r)=>{if(!e||!t)throw Error(`No Computer selected`);let i=await kZ(e.capabilities,{operation:`read-folder`,computerId:t});if(r.throwIfAborted(),e.context.get().computerId!==t)throw new K(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1});return i}),enabled:!!(t&&e.capabilities.has(aM))}}function NZ(e){let t=e?.context.get().computerId;return{...rM(e,aM,AZ.dismissals(e),async(n,r)=>{if(!e||!t)throw Error(`No Computer selected`);let i=await DZ(e.capabilities,{operation:`read-notices`,computerId:t});return r.throwIfAborted(),i}),enabled:!!(t&&e.capabilities.has(aM))}}var PZ=e=>oC.pipe(X(LC(1)),X(BC(e))),FZ=sC.pipe(X(FC()),X(xC(Number.isSafeInteger,{message:`Expected a safe integer`}))),IZ=FZ.pipe(X(jC(0))),LZ=Y({bytes:IZ,costMilliunits:FZ.pipe(X(MC(0))),destination:Y({computerId:PZ(256),path:PZ(4096)}),format:mC([`png`,`jpeg`,`gif`,`webp`,`mp4`]),height:IZ,model:PZ(256),width:IZ}),RZ=Y({operation:nC(`complete-generation`),reference:xX,result:LZ,derivedFrom:tC(PZ(256)),references:tC(dC(hC(PZ(256))))}),zZ=Y({reference:xX,input:LX});pC([Y({operation:nC(`remember-generation`),record:zZ}),Y({operation:nC(`forget-generation`),reference:xX}),Y({operation:nC(`list-generations`),after:hC(oC)})]);function BZ(e){return{reference:e.reference,input:KX(e.input)}}async function VZ(e,t){let n=BZ(QS(zZ,{onExcessProperty:`error`})(t)),r=BZ(QS(zZ,{onExcessProperty:`error`})(await e.require(aM).request(JSON.stringify({operation:`remember-generation`,record:n}))));if(JSON.stringify(r)!==JSON.stringify(n))throw new K(`Prints did not confirm the original generation command`,{code:`PROTOCOL`,retryable:!1});return r}async function HZ(e,t){QS(Y({removed:cC}))(await e.require(aM).request(JSON.stringify({operation:`forget-generation`,reference:t})))}async function UZ(e,t=null){let n=QS(Y({records:dC(zZ),next:hC(oC)}),{onExcessProperty:`error`})(await e.require(aM).request(JSON.stringify({operation:`list-generations`,after:t})));return{records:n.records.map(BZ),next:n.next}}async function WZ(e,t,n){let r=QS(RZ,{onExcessProperty:`error`})({operation:`complete-generation`,reference:t,result:n}),i=QS(Y({printId:oC,computerId:oC}))(await e.require(aM).request(JSON.stringify(r)));if(i.printId!==t.requestId||i.computerId!==t.computerId)throw new K(`Prints did not confirm the saved generation`,{code:`PROTOCOL`,retryable:!1})}var GZ=XS(Y({reference:xX}));function KZ({connection:e,folder:t,effects:n}){let r=e?.app??null,i=kj(r),a=(0,f.useRef)(e);a.current=e;let o=(0,f.useRef)(n);o.current=n;let s=_c(),c=eM.of(r,`prints`,`generation`),l=[...c,`recovery`],u=Wl(jZ(r)),d=u.isError?void 0:u.data,p=d?.models??[],m=r?.capabilities.has(HX)===!0,h=d?.canGenerate??!1,g=u.error?uc(u.error).message:d?.models.length===0?`The granted Media model registry is empty.`:null,_=Zl({queryKey:l,enabled:r!==null&&i!==null,initialPageParam:null,queryFn:async({pageParam:e,signal:t})=>{if(!r)throw new K(`Prints disconnected`,{code:`DISCONNECTED`,retryable:!0});if(r.context.get().computerId!==i)throw new K(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1});let n=await UZ(r.capabilities,e);return t.throwIfAborted(),n},getNextPageParam:e=>e.next}),v=(0,f.useMemo)(()=>Array.from(new Map(_.data?.pages.flatMap(e=>e.records).map(e=>[e.reference.requestId,e])??[]).values()),[_.data]),y=(0,f.useRef)(new Map),b=(0,f.useRef)(0),x=(0,f.useRef)(null),[S,C]=(0,f.useState)(null),[w,T]=(0,f.useState)(null),E=e=>a.current===e.connection&&e.connection.app.context.get().computerId===e.reference.computerId,D=(e,t)=>{s.setQueryData(e,e=>e&&{...e,pages:e.pages.map(e=>({...e,records:e.records.filter(e=>e.reference.requestId!==t)}))})},O=Yl({mutationKey:[...c,`run`],mutationFn:async e=>{e.controller.signal.throwIfAborted();let t=BZ({reference:e.reference,input:e.input});await VZ(e.connection.app.capabilities,t),e.controller.signal.throwIfAborted();let n=await e.session.restoreAttempt(e.reference),r;try{r=await n.generate(t.input,{signal:e.controller.signal})}finally{n[Symbol.dispose]()}return await WZ(e.connection.app.capabilities,t.reference,r),{input:e.input,result:r}},onMutate:e=>{!E(e)||e.controller.signal.aborted||o.current.reserve({key:`${e.reference.computerId}:${e.input.destination.path}`,computerId:e.reference.computerId,path:e.input.destination.path,width:e.draft.width,height:e.draft.height})},onSuccess:(e,t)=>{D(t.recoveryKey,t.reference.requestId),x.current?.reference.requestId===t.reference.requestId&&(x.current=null),!(!E(t)||t.controller.signal.aborted)&&o.current.saved(e,t.connection)},onError:(e,n)=>{ZX(`generate-media`,e),!(!E(n)||n.controller.signal.aborted)&&(t.recheck(),o.current.failed(`${n.reference.computerId}:${n.input.destination.path}`,dZ(e).message))},onSettled:(e,t,n)=>{y.current.get(n.reference.requestId)===n.controller&&y.current.delete(n.reference.requestId)}}),k=Yl({mutationKey:[...c,`discard`],mutationFn:async e=>{await HZ(e.connection.app.capabilities,e.reference)},onSuccess:(e,t)=>{D(t.recoveryKey,t.reference.requestId),x.current?.reference.requestId===t.reference.requestId&&(x.current=null)},onError:(e,t)=>{E(t)&&T(uc(e).message)},onSettled:(e,t,n)=>{y.current.get(n.reference.requestId)===n.controller&&y.current.delete(n.reference.requestId)}}),A=Jl({filters:{mutationKey:c,status:`pending`},select:e=>aee(GZ(e.state.variables))?.reference.requestId}),j=new Set(A.filter(e=>e!==void 0));(0,f.useEffect)(()=>{C(null),T(null),x.current=null;let e=eM.of(r,`prints`,`generation`,`recovery`),t=r?.capabilities.subscribe(()=>{queueMicrotask(()=>{s.resetQueries({queryKey:e,exact:!0})})}),n=()=>{b.current+=1;for(let e of y.current.values())e.abort();y.current.clear(),s.cancelQueries({queryKey:e})},a=r?.context.subscribe(e=>{e.computerId!==i&&n()}),o=r?.lifecycle.subscribe(e=>{(e===`disposing`||e===`disposed`||e===`disconnected`)&&n()});return()=>{a?.(),o?.(),t?.(),n()}},[r,i,e,s]);let M=e=>{let t=e.reference.requestId;if(y.current.has(t))return!1;if(!E(e))return T(`Select the original Computer to retry this generation.`),!1;if(d?.computerId!==e.reference.computerId)return T(`Media access is unavailable for the original Computer.`),!1;let n=new AbortController;return y.current.set(t,n),x.current=e,C(null),T(null),b.current+=1,O.mutate({...e,session:d,controller:n,ticket:b.current,recoveryKey:l}),!0},N=async n=>{if(!e?.app.capabilities.has(JL)||!h)return!1;if(t.path===null)return t.setEditing(!0),!1;x.current=null;let r=yZ(p,n.model),i=CZ(n,r);if(i)return C({kind:`error`,message:i}),!1;if(!m||!d)return C(null),!1;let o=e,s=o.app.context.get().computerId,c=b.current,l={...n,destination:mZ(n,t.path,r)},u=xZ(l),f;try{let e=await t.ensureCreated();if(e)return C({kind:`error`,message:e}),!1;if(b.current!==c||a.current!==o||o.app.context.get().computerId!==s)return!1;let n=await d.createAttempt();f=n.reference,n[Symbol.dispose]()}catch(e){return b.current===c&&a.current===o&&o.app.context.get().computerId===s&&C({kind:`error`,...dZ(e)}),!1}return b.current!==c||a.current!==o||o.app.context.get().computerId!==s?!1:M({connection:o,reference:f,input:u,draft:l})},P=O.variables;return{state:S??(P&&E(P)&&P.ticket===b.current?O.isPending?{kind:`pending`,draft:P.draft}:O.isError?{kind:`error`,...dZ(O.error)}:{kind:`completed`,record:O.data}:null)??(!e||!m||i===null?{kind:`unavailable`,reason:`Image creation is unavailable for this Computer right now.`}:g?{kind:`unavailable`,reason:g}:d?{kind:`ready`}:{kind:`loading`}),models:p,modelsLoading:u.isFetching,modelsError:g,canGenerate:h,mediaCapability:m,retryModels:()=>{u.refetch()},submit:N,isRunning:()=>y.current.size>0,activeGenerations:j,pendingGenerations:v,recoveryError:w??(_.error?uc(_.error).message:null),reportRecoveryError:e=>{T(uc(e).message)},hasMore:_.hasNextPage,loadMore:()=>{_.isFetching||_.fetchNextPage()},resume:t=>{if(!e||d?.computerId!==t.reference.computerId){T(`Select the original Computer to retry this generation.`);return}M({connection:e,...t,draft:{...t.input.settings,references:t.input.settings.references??[],destination:t.input.destination.path}})},discard:t=>{if(!e||y.current.has(t.reference.requestId))return;let n=new AbortController;y.current.set(t.reference.requestId,n),k.mutate({...t,connection:e,controller:n,draft:{...t.input.settings,references:t.input.settings.references??[]},recoveryKey:l})},retryPath:e=>{let t=x.current;return t?.input.destination.path!==e||!E(t)?!1:(M(t),!0)},retry:x.current&&E(x.current)?()=>{x.current&&M(x.current)}:void 0,errorKey:`generation:${x.current?.reference.requestId??`draft`}:${String(b.current)}`}}function qZ({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 JZ(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 YZ=[],XZ=0,{link:ZZ,unlink:QZ,propagate:$Z,checkDirty:eQ,shallowPropagate:tQ}=qZ({update(e){return e._update()},notify(e){YZ[rQ++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,sQ(e))}}),nQ=0,rQ=0,iQ,aQ=0;function oQ(e){try{++aQ,e()}finally{--aQ||cQ()}}function sQ(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=QZ(n,e)}function cQ(){if(!(aQ>0)){for(;nQ<rQ;){let e=YZ[nQ];YZ[nQ++]=void 0,e.notify()}nQ=0,rQ=0}}function lQ(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 iQ!==void 0&&ZZ(i,iQ,XZ),i._snapshot},subscribe(e){let t=JZ(e),n={current:!1},r=uQ(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=iQ,o=t?.compare??Object.is;if(n)iQ=i,++XZ,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{iQ=a,n&&(i.flags&=-5),sQ(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&eQ(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&tQ(e)}}else e&32&&(i.flags=e&-33);return iQ!==void 0&&ZZ(i,iQ,XZ),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&($Z(e),tQ(e),cQ())}},i}function uQ(e){let t=()=>{let t=iQ;iQ=n,++XZ,n.depsTail=void 0,n.flags=6;try{return e()}finally{iQ=t,n.flags&=-5,sQ(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&&eQ(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,sQ(this)}};return t(),n}var dQ=class{constructor(e,t){this.atom=lQ(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(JZ(e))}},fQ=class{constructor(e){this.atom=lQ(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(JZ(e))}};function pQ(e,t){return typeof e==`function`?new fQ(e):t?new dQ(e,t):new dQ(e)}var mQ=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 hQ(e,t){return new mQ(e,t).maybeExecute}var gQ=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)}},_Q=new class extends gQ{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function vQ(e,t){return typeof e==`function`?e(t):e}function yQ(e,t){return DQ(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function bQ(e,t,n){let r=DQ(t);function i(e){if(!r.length)return vQ(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 xQ(e,t){let n=DQ(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 SQ=46,CQ=91,wQ=93,TQ=48,EQ=57;function DQ(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)===CQ),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===SQ||s===CQ||s===wQ){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==TQ),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!==wQ&&(a!==-1||s!==wQ)&&(a!==s||s!==SQ&&s!==CQ)&&n.push(``);r=o+1,i=!0}else(s<TQ||s>EQ)&&(i=!1);a=s}return n.length||n.push(``),n}function OQ(e){return!(Array.isArray(e)&&e.length===0)}function kQ(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 AQ(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 jQ=e=>!!e&&typeof e==`object`&&`fields`in e;function MQ(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)||!MQ(e[i],t[i]))return!1;return!0}var NQ=({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},PQ=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function FQ(e,t){return e==null?t:{...e,...t}}for(var IQ=256,LQ=[],RQ;IQ--;)LQ[IQ]=(IQ+256).toString(16).substring(1);function zQ(){let e=0,t,n=``;if(!RQ||IQ+16>256){for(RQ=Array(256),e=256;e--;)RQ[e]=256*Math.random()|0;e=0,IQ=0}for(;e<16;e++)t=RQ[IQ+e],n+=e===6?LQ[t&15|64]:e===8?LQ[t&63|128]:LQ[t],e&1&&e>1&&e<11&&(n+=`-`);return IQ++,n}var BQ=hQ(e=>_Q.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function VQ(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]=VQ(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,VQ(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(VQ(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=VQ(e[n]));return t}function HQ(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var UQ=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 WQ(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 GQ=(e,t)=>{let n=WQ(e,t);return{form:n,fields:n}},KQ={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:GQ(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:GQ(r.issues,e)}},qQ=e=>!!e&&`~standard`in e,JQ={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function YQ(e){function t(t){let n=e.getFieldMeta(t)??JQ;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=()=>JQ;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function XQ(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 ZQ=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{BQ(this)}),t=_Q.on(`request-form-state`,e=>{e.payload.id===this._formId&&_Q.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=_Q.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=_Q.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(),_Q.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return _Q.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&&!MQ(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!MQ(e.defaultState,t.defaultState)&&!this.state.isTouched;if(!(!n&&!r)){if(oQ(()=>{this.baseStore.setState(()=>XQ(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=YQ(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}_Q.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=bQ(t,e.instance.name,e.instance.options.defaultValue))}),XQ({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return oQ(()=>{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 oQ(()=>{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=kQ(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||UQ}),r=!1,i={};return oQ(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=QQ(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=$Q(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)??JQ,r=a?.[e],{newErrorValue:s,newSource:c}=NQ({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=JQ)=>({...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=$Q(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=$Q(`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=AQ(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||UQ});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=$Q(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}=QQ(r);s&&(i=i?{...i,...s}:s);let c=$Q(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)??JQ,r=i?.[e],{newErrorValue:a,newSource:o}=NQ({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=JQ)=>({...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})),oQ(()=>{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}),_Q.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}),_Q.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}oQ(()=>{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}),oQ(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),_Q.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),_Q.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>yQ(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]:vQ(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=JQ,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;oQ(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:bQ(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=xQ(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),YQ(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],FQ(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),YQ(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),FQ(r,{dontValidate:!0})),YQ(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),FQ(n,{dontValidate:!0})),YQ(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 bQ(bQ(e,`${t}`,i),`${n}`,r)},FQ(r,{dontValidate:!0})),YQ(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},FQ(r,{dontValidate:!0})),YQ(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,[],FQ(t,{dontValidate:!0})),YQ(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=yQ(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:JQ},values:i===void 0?t.values:bQ(t.values,e,i)}})},this.setErrorMap=e=>{oQ(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(jQ(t)){let{formError:e,fieldErrors:r}=QQ(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=>KQ.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>KQ.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??zQ(),this._devtoolsSubmissionOverride=!1;let t=XQ({...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||!jQ(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=pQ(t);let n;this.fieldMetaDerived=pQ(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=yQ(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=!OQ(u),f=!o.isDirty,p=MQ(l,this.getFieldInfo(a)?.instance?.options.defaultValue??yQ(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=pQ(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||!HQ(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&&HQ(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=pQ(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&&jQ(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&&MQ(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 qQ(e.validate)?KQ[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function QQ(e){return e?jQ(e)?{formError:QQ(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function $Q(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 e$=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]:{...JQ,isTouched:e.fieldMetaBase[this.name]?.isTouched??JQ.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??JQ.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??JQ.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&&(MQ(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,FQ(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,FQ(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,FQ(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,FQ(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,FQ(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,FQ(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,FQ(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,FQ(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=kQ(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||UQ}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=kQ(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||UQ});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;oQ(()=>{let e=(e,n)=>{let r=n$(n.cause),a=n.validate?t$(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}=PQ({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=n$(`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=AQ(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||UQ}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=AQ(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||UQ});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)));oQ(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=n$(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=t$(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=PQ({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)),oQ(()=>{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=>HQ(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[n$(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[n$(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=>KQ.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>KQ.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)HQ(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=pQ(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...JQ,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!MQ(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 qQ(e.validate)?KQ[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 t$(e){if(e)return e}function n$(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 r$(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function i$(e){return{...JQ,...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 a$=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??r$({});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&&(MQ(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,{...JQ,...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]??r$({...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;s$(t)&&(n=t.group,r=t.fields);let i=o$(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]:r$({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,FQ(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 e$&&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&&HQ(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}=NQ({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=JQ)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=kQ(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||UQ}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=kQ(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||UQ});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;oQ(()=>{let t=(t,r)=>{let i=l$(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&&s$(s)&&(c=s.group,l=s.fields);let u=o$(c),d=n[i],{newErrorValue:f,newSource:p}=PQ({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=l$(`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=AQ(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||UQ}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=AQ(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||UQ});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=l$(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&&s$(o)&&(l=o.group,u=o.fields);let d=o$(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=PQ({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 oQ(()=>{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=>HQ(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[l$(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>HQ(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})),oQ(()=>{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}oQ(()=>{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}),oQ(()=>{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=pQ(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??i$(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!MQ(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(qQ(e.validate)){let t=KQ[e.type](e.value,e.validate);return e.type===`validate`?c$(t):t.then(c$)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function o$(e){if(e)return e}function s$(e){return!!e&&typeof e==`object`&&`fields`in e}function c$(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 l$(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 u$(e,t){if(!t)return;let n=Object.assign({},e,{state:VQ(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 oQ(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var d$=o((e=>{var t=d();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 u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),f$=o(((e,t)=>{t.exports=d$()})),p$=o((e=>{var t=d(),n=f$();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}})),m$=o(((e,t)=>{t.exports=p$()}))();function h$(e,t){return e===t}function g$(e,t=e=>e,n){let r=n?.compare??h$,i=(0,f.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,f.useCallback)(()=>e.get(),[e]);return(0,m$.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var _$=typeof window<`u`?f.useLayoutEffect:f.useEffect;function v$(e){let[t,n]=(0,f.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,f.useState)(()=>new e$({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new e$({...e}),i(a),n({form:e.form,name:e.name}));let o=g$(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=g$(a.store,e=>e.meta.isTouched),c=g$(a.store,e=>e.meta.isBlurred),l=g$(a.store,e=>e.meta.isDirty),u=g$(a.store,e=>e.meta.errorMap),d=g$(a.store,e=>e.meta.errorSourceMap),p=g$(a.store,e=>e.meta.isValidating),m=(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:p}}}}}),[a,e.mode,o,s,c,l,u,d,p]);return _$(a.mount,[a]),_$(()=>{a.update(e)}),m}var y$=(({children:e,...t})=>{let n=v$(t),r=(0,f.useMemo)(()=>vQ(e,n),[e,n]);return(0,J.jsx)(J.Fragment,{children:r})});function b$(){return(0,f.useState)(()=>zQ())[0]}var x$=f,S$=`18.3.1`.split(`.`)[0]===`17`?b$:x$.useId;function C$(e){let[t,n]=(0,f.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,f.useState)(()=>new a$({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new a$({...e})),n({form:e.form,name:e.name}));let a=g$(r.store,e=>e.value),o=g$(r.store,e=>e.meta.isTouched),s=g$(r.store,e=>e.meta.isBlurred),c=g$(r.store,e=>e.meta.isDirty),l=g$(r.store,e=>e.meta.errorMap),u=g$(r.store,e=>e.meta.errorSourceMap),d=g$(r.store,e=>e.meta.isValidating),p=g$(r.store,e=>e.meta.isSubmitting),m=g$(r.store,e=>e.meta.isSubmitted),h=g$(r.store,e=>e.meta.submissionAttempts),g=g$(r.store,e=>e.meta.isSubmitSuccessful),_=g$(r.store,e=>e.meta.canSubmit),v=g$(r.store,e=>e.meta.isValid),y=g$(r.store,e=>e.meta.isFieldsValid),b=g$(r.store,e=>e.meta.isFieldsValidating),x=g$(r.store,e=>e.meta.isGroupValid),S=(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:p,isSubmitted:m,submissionAttempts:h,isSubmitSuccessful:g,canSubmit:_,isValid:v,isFieldsValid:y,isFieldsValidating:b,isGroupValid:x}}}}}),[r,a,o,s,c,l,u,d,p,m,h,g,_,v,y,b,x]);return _$(r.mount,[r]),_$(()=>{r.update(e)}),S}var w$=(({children:e,...t})=>{let n=C$(t),r=(0,f.useMemo)(()=>vQ(e,n),[e,n]);return(0,J.jsx)(J.Fragment,{children:r})});function T$({form:e,selector:t=e=>e,children:n}){let r=g$(e.store,t);return(0,J.jsx)(J.Fragment,{children:vQ(n,r)})}function E$(e){let t=S$(),[n,r]=(0,f.useState)(e?.formId),[i,a]=(0,f.useState)(()=>new ZQ({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new ZQ({...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,J.jsx)(y$,{...e,form:i})},e.FormGroup=function(e){return(0,J.jsx)(w$,{...e,form:i})},e.Subscribe=function(e){return(0,J.jsx)(T$,{form:i,selector:e.selector,children:e.children})},e},[i]);_$(i.mount,[]),_$(()=>{i.update(e)});let s=(0,f.useRef)(!1);return _$(()=>{s.current&&e?.transform&&u$(i,e.transform)},[i,e?.transform]),_$(()=>{s.current=!0}),o}var D$=(0,f.forwardRef)(function({tone:e=`neutral`,size:t=`md`,pressed:n=!1,className:r,...i},a){return(0,J.jsx)(`kbd`,{...i,ref:a,className:Z(`caps-keycap`,r),"data-tone":e,"data-size":t,"data-pressed":n})}),O$=(0,f.forwardRef)(function({label:e,shortcut:t,icon:n,readout:r,tone:i=`neutral`,pressed:a,expanded:o,className:s,type:c=`button`,...l},u){let d=a??o;return(0,J.jsxs)(`button`,{...l,ref:u,type:c,className:Z(`caps-keycap-button`,s),"data-tone":i,"aria-pressed":a,"aria-expanded":o,"aria-keyshortcuts":l[`aria-keyshortcuts`]??t,children:[d===void 0?null:(0,J.jsx)(`span`,{className:`caps-keycap-led`,"data-lit":d,"aria-hidden":`true`}),n?(0,J.jsx)(`span`,{className:`caps-keycap-button-icon`,"aria-hidden":`true`,children:n}):null,e===null?null:(0,J.jsx)(`span`,{className:`caps-keycap-button-label`,children:e}),r,t?(0,J.jsx)(D$,{size:`sm`,tone:`neutral`,"aria-hidden":`true`,children:t}):null]})}),k$={...f},A$={};function j$(e,t){let n=f.useRef(A$);return n.current===A$&&(n.current=e(t)),n}var M$=k$.useInsertionEffect,N$=M$&&M$!==k$.useLayoutEffect?M$:e=>e();function P$(e){let t=j$(F$).current;return t.next=e,N$(t.effect),t.trampoline}function F$(){let e={next:void 0,callback:I$,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function I$(){}function L$(){}var R$=Object.freeze([]),z$=Object.freeze({});function B$(e){f.useEffect(e,R$)}var V$=0,H$=class e{static create(){return new e}currentId=V$;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=V$,t()},e)}isStarted(){return this.currentId!==V$}clear=()=>{this.currentId!==V$&&(clearTimeout(this.currentId),this.currentId=V$)};disposeEffect=()=>this.clear};function U$(){let e=j$(H$.create).current;return B$(e.disposeEffect),e}function W$(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 G$=W$(`https://base-ui.com/production-error`,`Base UI`),K$=f.createContext(void 0);function q$(){let e=f.useContext(K$);if(e===void 0)throw Error(G$(53));return e}function J$(e,t,n,r){let i=j$(X$).current;return Z$(i,e,t,n,r)&&$$(i,[e,t,n,r]),i.callback}function Y$(e){let t=j$(X$).current;return Q$(t,e)&&$$(t,e),t.callback}function X$(){return{callback:null,cleanup:null,refs:[]}}function Z$(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Q$(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function $$(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}}}}}}var e1=18;function t1(e){return e1>=e}function n1(e){if(!f.isValidElement(e))return null;let t=e,n=t.props;return(t1(19)?n?.ref:t.ref)??null}function r1(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function i1(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 a1(e,t){return typeof e==`function`?e(t):e}function o1(e,t){return typeof e==`function`?e(t):e}var s1={};function c1(e,t,n,r,i){if(!n&&!r&&!i&&!e)return u1(t);let a=u1(e);return t&&(a=d1(a,t)),n&&(a=d1(a,n)),r&&(a=d1(a,r)),i&&(a=d1(a,i)),a}function l1(e){if(e.length===0)return s1;if(e.length===1)return u1(e[0]);let t=u1(e[0]);for(let n=1;n<e.length;n+=1)t=d1(t,e[n]);return t}function u1(e){return h1(e)?{...e(s1)}:f1(e)}function d1(e,t){return h1(t)?t(e):p1(e,t)}function f1(e){let t={...e};for(let e in t){let n=t[e];m1(e,n)&&(t[e]=_1(n))}return t}function p1(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=r1(e.style,r);break;case`className`:e[n]=y1(e.className,r);break;default:e[n]=m1(n,r)?g1(e[n],r):r}}return e}function m1(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 h1(e){return typeof e==`function`}function g1(e,t){return t?e?(...n)=>{let r=n[0];if(b1(r)){let i=r;v1(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:_1(t):e}function _1(e){return e&&((...t)=>{let n=t[0];return b1(n)&&v1(n),e(...t)})}function v1(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function y1(e,t){return t?e?t+` `+e:t:e}function b1(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function x1(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=T1(r));let i=S1(t,n,r);if(n.enabled===!1)return null;let a=n.state??z$;return E1(e,r,i,a)}function S1(e,t,n){let{className:r,style:i}=e,{state:a=z$,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?a1(r,a):void 0,d=l?o1(i,a):void 0,f=l?i1(a,c):z$,p=l&&s?C1(s):void 0,m=l?r1(f,p)??{}:z$;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Y$([m.ref,n1(n),...o]):J$(m.ref,n1(n),o):J$(null,null)),l?(u!==void 0&&(m.className=y1(m.className,u)),d!==void 0&&(m.style=r1(m.style,d)),m):z$}function C1(e){return Array.isArray(e)?l1(e):c1(void 0,e)}var w1=Symbol.for(`react.lazy`);function T1(e){if(e?.$$typeof!==w1)return e;let t=f.Children.toArray(e)[0];return f.isValidElement(t)?t:e}function E1(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=c1(n,t.props);return e.ref=n.ref,f.cloneElement(t,e)}return D1(e,n)}function D1(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)}function O1(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var k1=`base-ui-disable-scrollbar`,A1={className:k1,getElement(e){return(0,J.jsx)(`style`,{nonce:e,href:k1,precedence:`base-ui:low`,children:`.${k1}{scrollbar-width:none}.${k1}::-webkit-scrollbar{display:none}`})}};function j1(){let[,e]=f.useState({});return f.useCallback(()=>{e({})},[])}var M1=0;function N1(e,t=`mui`){let n=f.useRef(void 0),r=j1(),i=e??n.current;return f.useEffect(()=>{n.current??(M1+=1,n.current=`${t}-${M1}`,e??r())},[e,t,r]),i}var P1=k$.useId;function F1(e,t){if(P1!==void 0){let n=P1();return e??(t?`${t}-${n}`:n)}return N1(e,t)}function I1(e){return F1(e,`base-ui`)}var L1=`data-has-overflow-x`,R1=`data-has-overflow-y`,Jte=`data-overflow-x-start`,z1=`data-overflow-x-end`,B1=`data-overflow-y-start`,V1=`data-overflow-y-end`,H1=e=>t=>t?{[e]:``}:null,U1={hasOverflowX:H1(L1),hasOverflowY:H1(R1),overflowXStart:H1(Jte),overflowXEnd:H1(z1),overflowYStart:H1(B1),overflowYEnd:H1(V1),cornerHidden:()=>null};function W1(){return typeof window<`u`}function G1(e){return J1(e)?(e.nodeName||``).toLowerCase():`#document`}function K1(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q1(e){return((J1(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function J1(e){return W1()?e instanceof Node||e instanceof K1(e).Node:!1}function Y1(e){return W1()?e instanceof Element||e instanceof K1(e).Element:!1}function X1(e){return W1()?e instanceof HTMLElement||e instanceof K1(e).HTMLElement:!1}function Z1(e){return!W1()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K1(e).ShadowRoot}function Q1(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=l0(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function $1(e){return/^(table|td|th)$/.test(G1(e))}function e0(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var t0=/transform|translate|scale|rotate|perspective|filter/,n0=/paint|layout|strict|content/,r0=e=>!!e&&e!==`none`,i0;function a0(e){let t=Y1(e)?l0(e):e;return r0(t.transform)||r0(t.translate)||r0(t.scale)||r0(t.rotate)||r0(t.perspective)||!s0()&&(r0(t.backdropFilter)||r0(t.filter))||t0.test(t.willChange||``)||n0.test(t.contain||``)}function o0(e){let t=d0(e);for(;X1(t)&&!c0(t);){if(a0(t))return t;if(e0(t))return null;t=d0(t)}return null}function s0(){return i0??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),i0}function c0(e){return/^(html|body|#document)$/.test(G1(e))}function l0(e){return K1(e).getComputedStyle(e)}function u0(e){return Y1(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function d0(e){if(G1(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Z1(e)&&e.host||q1(e);return Z1(t)?t.host:t}function f0(e){let t=d0(e);return c0(t)?(e.ownerDocument||e).body:X1(t)&&Q1(t)?t:f0(t)}function p0(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=f0(e),i=r===e.ownerDocument?.body,a=K1(r);if(i){let e=m0(a);return t.concat(a,a.visualViewport||[],Q1(r)?r:[],e&&n?p0(e):[])}return t.concat(r,p0(r,[],n))}function m0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function h0(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:g0,platform:_0,maxTouchPoints:v0}=h0(),y0=g0.toLowerCase(),b0=_0.toLowerCase(),x0=/^i(os$|p)/.test(b0)||b0===`macintel`&&v0>1,S0=`android`,C0=b0===S0||y0.includes(S0),w0=!x0&&b0.startsWith(`mac`);b0.startsWith(`win`),!C0&&/^(linux|chrome os)/.test(b0);var T0=w0||x0,E0=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!E0&&y0.includes(`firefox`),!E0&&y0.includes(`chrom`);var D0=T0,O0=/jsdom|happydom/.test(y0);function k0(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function A0(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Z1(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function j0(e,t){let n=e;for(;n;){if(Y1(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Z1(n)?n.host:null)}return null}function M0(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var N0=`data-base-ui-focusable`,P0=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,F0=`data-starting-style`,I0=`data-ending-style`,L0={[F0]:``},R0={[I0]:``},z0={transitionStatus(e){return e===`starting`?L0:e===`ending`?R0:null}},B0=`data-open`,V0=`data-closed`,H0=`data-anchor-hidden`,U0=`data-popup-open`,W0=`data-pressed`,G0={[U0]:``},K0={[U0]:``,[W0]:``},q0={[B0]:``},J0={[V0]:``},Y0={[H0]:``},X0={open(e){return e?G0:null}},Z0={open(e){return e?K0:null}},Q0={open(e){return e?q0:J0},anchorHidden(e){return e?Y0:null}},$0={...Q0,...z0},e2=`data-trigger-disabled`;function t2(e,t){if(!Y1(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(e2);for(let[,e]of t.entries())if(A0(e,n))return!e.hasAttribute(e2);return!1}function n2(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 r2(e){return e.matches(`html,body`)}function i2(e){return X1(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function a2(e){return j0(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${P0}`)!=null}function o2(e){return e?e.getAttribute(`role`)===`combobox`&&i2(e):!1}function s2(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function c2(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...c2(e,t.id,n)])}function l2(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 u2(e){e.preventDefault(),e.stopPropagation()}function d2(e){return`nativeEvent`in e}function f2(e){return e.pointerType===``&&e.isTrusted?!0:C0&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function p2(e){return O0?!1:!C0&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(C0||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function m2(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function h2(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var g2=Math.min,_2=Math.max,v2=Math.round,y2=Math.floor,b2=e=>({x:e,y:e}),x2={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function S2(e,t,n){return _2(e,g2(t,n))}function C2(e,t){return typeof e==`function`?e(t):e}function w2(e){return e.split(`-`)[0]}function T2(e){return e.split(`-`)[1]}function E2(e){return e===`x`?`y`:`x`}function D2(e){return e===`y`?`height`:`width`}function O2(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function k2(e){return E2(O2(e))}function A2(e,t,n){n===void 0&&(n=!1);let r=T2(e),i=k2(e),a=D2(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=z2(o)),[o,z2(o)]}function j2(e){let t=z2(e);return[M2(e),t,M2(t)]}function M2(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var N2=[`left`,`right`],P2=[`right`,`left`],F2=[`top`,`bottom`],I2=[`bottom`,`top`];function L2(e,t,n){switch(e){case`top`:case`bottom`:return n?t?P2:N2:t?N2:P2;case`left`:case`right`:return t?F2:I2;default:return[]}}function R2(e,t,n,r){let i=T2(e),a=L2(w2(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(M2)))),a}function z2(e){let t=w2(e);return x2[t]+e.slice(t.length)}function B2(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function V2(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:B2(e)}function H2(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 U2(e){return e.visibility===`hidden`||e.visibility===`collapse`}function W2(e,t=e?l0(e):null){return!e||!e.isConnected||!t||U2(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}function G2(e){return e?.ownerDocument||document}var K2=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function q2(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Z1(n)?n.host:null}function J2(e){for(let t of Array.from(e.children))if(G1(t)===`summary`)return t;return null}function Y2(e,t){let n=J2(t);return!!n&&(e===n||A0(n,e))}function X2(e){let t=e?G1(e):``;return e!=null&&e.matches(K2)&&(t!==`summary`||e.parentElement!=null&&G1(e.parentElement)===`details`&&J2(e.parentElement)===e)&&(t!==`details`||J2(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Z2(e){if(!X2(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=q2(t)){let n=t!==e,r=G1(t)===`slot`;if(t.hasAttribute(`inert`)||n&&G1(t)===`details`&&!t.open&&!Y2(e,t)||t.hasAttribute(`hidden`)||!r&&!Q2(t,n))return!1}return!0}function Q2(e,t){let n=l0(e);return t?n.display!==`none`:W2(e,n)}function $2(e){let t=e.tabIndex;if(t<0){let t=G1(e);if(t===`details`||t===`audio`||t===`video`||X1(e)&&e.isContentEditable)return 0}return t}function e4(e){if(G1(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function t4(e,t){let n=e4(e);if(!n)return!0;let r=t.find(e=>{let t=e4(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=e4(e);return t?.name===n.name&&t.form===n.form})===n}function n4(e){if(X1(e)&&G1(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return X1(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function r4(e,t){n4(e).forEach(e=>{X2(e)&&t.push(e),r4(e,t)})}function i4(e,t,n){n4(e).forEach(e=>{X1(e)&&e.matches(t)&&n.push(e),i4(e,t,n)})}function a4(e){return Z2(e)&&$2(e)>=0}function o4(e){let t=[];return r4(e,t),t.filter(Z2)}function s4(e){let t=o4(e);return t.filter(e=>$2(e)>=0&&t4(e,t))}function c4(e,t){let n=s4(e),r=n.length;if(r===0)return;let i=k0(G2(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function l4(e){return c4(G2(e).body,1)||e}function u4(e){return c4(G2(e).body,-1)||e}function d4(e,t,n){if(!e)return null;let r=[];r4(G2(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Z2);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!A0(n,o)&&a4(o)&&t4(o,a))return o}return r[i]}function f4(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!A0(n,r)}function p4(e){s4(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function m4(e){let t=[];i4(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var h4=f.createContext(void 0),g4={disableStyleElements:!1};function _4(){return f.useContext(h4)??g4}var v4=`--scroll-area-corner-height`,y4=`--scroll-area-corner-width`,b4=`data-orientation`,x4={x:0,y:0},S4={width:0,height:0},C4={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},w4={x:!0,y:!0,corner:!0},T4=f.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=E4(i),d=I1(),p=U$(),m=U$(),{nonce:h,disableStyleElements:g}=_4(),[_,v]=f.useState(!1),[y,b]=f.useState(!1),[x,S]=f.useState(!1),[C,w]=f.useState(!1),[T,E]=f.useState(!1),[D,O]=f.useState(S4),[k,A]=f.useState(S4),[j,M]=f.useState(C4),[N,P]=f.useState(w4),F=f.useRef(null),I=f.useRef(null),L=f.useRef(null),R=f.useRef(null),z=f.useRef(null),ee=f.useRef(null),te=f.useRef(null),ne=f.useRef(null),B=f.useRef(0),re=f.useRef(0),V=f.useRef(0),H=f.useRef(0),ie=f.useRef(`vertical`),ae=f.useRef(x4),oe=f.useRef(null);function se(e){let t=e?S:b,n=e?p:m;t(!0),n.start(500,()=>{t(!1)})}let ce=P$(e=>{let t=e.x-ae.current.x,n=e.y-ae.current.y;ae.current=e,n!==0&&se(!0),t!==0&&se(!1)}),le=P$(()=>{let e=I.current;e&&oe.current===null&&(oe.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),U=P$(e=>{if(e.button!==0||ne.current!==null&&(ie.current===`vertical`?z.current:ee.current)?.hasPointerCapture(ne.current))return;ne.current=e.pointerId,B.current=e.clientY,re.current=e.clientX,ie.current=e.currentTarget.getAttribute(b4);let t=I.current;t&&(V.current=t.scrollTop,H.current=t.scrollLeft,le()),(ie.current===`vertical`?z.current:ee.current)?.setPointerCapture(e.pointerId)}),ue=P$(e=>{if(e.pointerId!==ne.current)return;ne.current=null,(ie.current===`vertical`?S:b)(!1),oe.current!==null&&(I.current&&(I.current.style.scrollSnapType=oe.current),oe.current=null);let t=ie.current===`vertical`?z.current:ee.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),de=P$(e=>{if(e.pointerId!==ne.current)return;if(e.buttons%2==0){ue(e);return}let t=I.current;if(!t)return;let n=ie.current===`vertical`,r=n?z.current:ee.current,i=n?L.current:R.current;if(!r||!i)return;let a=n?`y`:`x`,o=O1(i,`padding`,a),s=O1(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-B.current:e.clientX-re.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?V.current:H.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),se(n)});function fe(e){w(e.pointerType===`touch`)}function pe(e){if(fe(e),e.pointerType!==`touch`){let t=A0(F.current,e.target);v(t)}}let me=f.useMemo(()=>({scrolling:y||x,hasOverflowX:!N.x,hasOverflowY:!N.y,overflowXStart:j.xStart,overflowXEnd:j.xEnd,overflowYStart:j.yStart,overflowYEnd:j.yEnd,cornerHidden:N.corner}),[y,x,N.x,N.y,N.corner,j]),he={role:`presentation`,onPointerEnter:pe,onPointerMove:pe,onPointerDown:fe,onPointerLeave(){v(!1)},style:{position:`relative`,[v4]:`${D.height}px`,[y4]:`${D.width}px`}},ge=x1(`div`,e,{state:me,ref:[t,F],props:[he,o],stateAttributesMapping:U1}),_e=f.useMemo(()=>({handlePointerDown:U,handlePointerMove:de,handlePointerUp:ue,handleScroll:ce,disableViewportSnap:le,cornerSize:D,setCornerSize:O,thumbSize:k,setThumbSize:A,hasMeasuredScrollbar:T,setHasMeasuredScrollbar:E,touchModality:C,cornerRef:te,scrollingX:y,scrollingY:x,hovering:_,setHovering:v,viewportRef:I,scrollbarYRef:L,scrollbarXRef:R,thumbYRef:z,thumbXRef:ee,rootId:d,hiddenState:N,setHiddenState:P,overflowEdges:j,setOverflowEdges:M,viewportState:me,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[U,de,ue,ce,le,D,k,T,C,y,x,_,d,N,j,me,s,c,l,u]);return(0,J.jsxs)(K$.Provider,{value:_e,children:[!g&&A1.getElement(h),ge]})});function E4(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}var D4=typeof document<`u`?f.useLayoutEffect:()=>{};function O4(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var k4=f.createContext(void 0);function A4(){let e=f.useContext(k4);if(e===void 0)throw Error(G$(55));return e}var j4=f.createContext(void 0);function M4(){return f.useContext(j4)?.direction??`ltr`}function N4(e,t){if(t<=0)return 0;let n=O4(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function P4(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var F4=`--scroll-area-overflow-x-start`,I4=`--scroll-area-overflow-x-end`,L4=`--scroll-area-overflow-y-start`,R4=`--scroll-area-overflow-y-end`,z4=`--scroll-area-thumb-height`,B4=`--scroll-area-thumb-width`,V4=[F4,I4,L4,R4],H4=!1;function U4(){H4||E0||(typeof CSS<`u`&&`registerProperty`in CSS&&V4.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),H4=!0)}var W4=f.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{viewportRef:o,scrollbarYRef:s,scrollbarXRef:c,thumbYRef:l,thumbXRef:u,cornerRef:d,cornerSize:p,setCornerSize:m,setThumbSize:h,rootId:g,setHiddenState:_,hiddenState:v,setHasMeasuredScrollbar:y,handleScroll:b,touchModality:x,setHovering:S,setOverflowEdges:C,overflowEdgeThreshold:w,viewportState:T}=q$(),E=M4(),D=f.useRef(!0),O=f.useRef([NaN,NaN,NaN,NaN]),k=U$(),A=U$(),j=P$(()=>{let e=o.current,t=s.current,n=c.current,r=l.current,i=u.current,a=d.current;if(!e)return;let f=e.scrollHeight,g=e.scrollWidth,v=e.clientHeight,b=e.clientWidth,x=e.scrollTop,S=e.scrollLeft,T=O.current,D=Number.isNaN(T[0]);if(T[0]=v,T[1]=f,T[2]=b,T[3]=g,D&&y(!0),f===0||g===0)return;let k=G4(e),A=k.y,j=k.x,M=b/g,N=v/f,P=Math.max(0,g-b),F=Math.max(0,f-v),I=0,L=0;j||(I=N4(E===`rtl`?-S:S,P),L=P-I);let R=A?0:N4(x,F),z=A?0:F-R,ee=j?0:b,te=A?0:v,ne=0,B=0;!j&&!A&&(ne=t?.offsetWidth||0,B=n?.offsetHeight||0);let re=p.width===0&&p.height===0,V=re?ne:0,H=re?B:0,ie=O1(n,`padding`,`x`),ae=O1(t,`padding`,`y`),oe=O1(i,`margin`,`x`),se=O1(r,`margin`,`y`),ce=ee-ie-oe,le=te-ae-se,U=n?Math.min(n.offsetWidth-V,ce):ce,ue=t?Math.min(t.offsetHeight-H,le):le,de=Math.max(16,U*M),fe=Math.max(16,ue*N);if(h(e=>K4(e,{width:de,height:fe})),t&&r){let e=q4(r,z4,x,F,f,fe,t.offsetHeight-fe-ae-se);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-de-ie-oe,t=q4(i,B4,E===`rtl`?-S:S,P,g,de,e);i.style.transform=`translate3d(${E===`rtl`?-t:t}px,0,0)`}let pe=[I,L,R,z];V4.forEach((t,n)=>{e.style.setProperty(t,`${pe[n]}px`)}),a&&m(e=>K4(e,{width:ne,height:B})),_(e=>K4(e,k));let me={xStart:!j&&I>w.xStart,xEnd:!j&&L>w.xEnd,yStart:!A&&R>w.yStart,yEnd:!A&&z>w.yEnd};C(e=>K4(e,me))});D4(()=>{U4()},[]),D4(()=>{queueMicrotask(j)},[j,v,E,w.xStart,w.xEnd,w.yStart,w.yEnd]),D4(()=>{o.current?.matches(`:hover`)&&S(!0)},[o,S]),D4(()=>{let e=o.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=O.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}j()});return n.observe(e),A.start(0,()=>{let t=P4(e,{subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished.then(L$))).then(j).catch(()=>{})}),()=>{n.disconnect(),A.clear()}},[j,o,A]);function M(){D.current=!1}let N={...g&&{"data-id":`${g}-viewport`},tabIndex:v.x&&v.y?-1:0,className:A1.className,style:{overflow:`scroll`},onScroll(){o.current&&(j(),(x||!D.current)&&b({x:o.current.scrollLeft,y:o.current.scrollTop}),k.start(100,()=>{D.current=!0}))},onWheel:M,onPointerMove:M,onPointerEnter:M,onKeyDown:M},P=x1(`div`,e,{ref:[t,o],state:T,props:[N,a],stateAttributesMapping:U1}),F=f.useMemo(()=>({computeThumbPosition:j}),[j]);return(0,J.jsx)(k4.Provider,{value:F,children:P})});function G4(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function K4(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function q4(e,t,n,r,i,a,o){let s=O4(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}function J4(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Y4=f.createContext(void 0);function X4(){let e=f.useContext(Y4);if(e===void 0)throw Error(G$(54));return e}var Z4=f.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:p,scrollbarXRef:m,viewportRef:h,thumbYRef:g,thumbXRef:_,handlePointerDown:v,handlePointerUp:y,handleScroll:b,disableViewportSnap:x,rootId:S,thumbSize:C,hasMeasuredScrollbar:w,viewportState:T}=q$(),E=i===`vertical`,D={...T,hovering:c,scrolling:E?u:l,orientation:i},O=M4(),k=!w&&!a,A=E?d.y:d.x,j=a||!A;f.useEffect(()=>{if(!j)return;let e=h.current,t=E?p.current:m.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!E,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&O===`rtl`?-a:0,s=n&&O===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),b({x:e.scrollLeft,y:e.scrollTop}))}return J4(t,`wheel`,n,{passive:!1})},[O,b,E,m,p,j,h]);let M={...S&&{"data-id":`${S}-scrollbar`},"aria-hidden":!0,onPointerDown(e){if(e.button!==0)return;let t=M0(e.nativeEvent),n=E?g.current:_.current;if(n&&A0(n,t))return;let r=h.current;if(!r)return;let i=E?p.current:m.current;if(!n||!i)return;let a=E?`y`:`x`,o=O1(n,`margin`,a),s=O1(i,`padding`,a),c=E?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=E?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=E?r.scrollHeight:r.scrollWidth,f=E?r.clientHeight:r.clientWidth,y=(E?i.offsetHeight:i.offsetWidth)-c-s-o;if(y<=0)return;let S=u/y,C=d-f;x(),E?r.scrollTop=S*C:r.scrollLeft=O===`rtl`?-(1-S)*C:S*C,b({x:r.scrollLeft,y:r.scrollTop}),v(e)},onMouseDown(e){e.preventDefault()},onPointerUp:y,onPointerCancel:y,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:k?`hidden`:void 0,...E?{top:0,bottom:`var(${v4})`,insetInlineEnd:0,[z4]:`${C.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${y4})`,bottom:0,[B4]:`${C.width}px`}}},N=x1(`div`,e,{ref:[t,E?p:m],state:D,props:[M,s],stateAttributesMapping:U1});return j?(0,J.jsx)(Y4.Provider,{value:i,children:N}):null}),Q4=f.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{computeThumbPosition:o}=A4(),{hasMeasuredScrollbar:s,viewportState:c}=q$(),l=f.useRef(null),u=f.useRef(s);return D4(()=>{if(typeof ResizeObserver>`u`)return;let e=!1,t=new ResizeObserver(()=>{!e&&(e=!0,!u.current)||o()});return l.current&&t.observe(l.current),()=>{t.disconnect()}},[o]),x1(`div`,e,{ref:[t,l],state:c,stateAttributesMapping:U1,props:[{role:`presentation`,style:{minWidth:`fit-content`}},a]})}),$4=f.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=q$(),m=X4(),h=m===`vertical`;return x1(`div`,e,{ref:[t,h?o:s],state:{scrolling:h?f:d,orientation:m},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...h?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),e3=Object.freeze({ease:`linear`,duration:0});function t3(e,t){let n=hP(e,t.duration);return n<=0?e3:e.steps>0?{ease:nL(e.steps),duration:n}:{ease:tL({bounce:mP(e,t.bounce),duration:n}),duration:n}}function n3(e,t){let n=pP(e,t.duration);return{ease:e.steps>0?nL(e.steps):t.ease,duration:n}}function r3(e,t,n){let r=(Math.abs(t)-Math.abs(e))/Math.max(16,n);if(Math.abs(r)<.035)return null;let i=Math.min(.04,Math.abs(r)*.3),a=r>0,o=Math.sign(t||e);return{scaleY:1+(a?i:-i),scaleX:1+(a?-i/2:i/2),origin:(a?o>0:o<0)?`center top`:`center bottom`}}function i3(e,t,n){if(t<=0||Math.abs(n)<4)return null;let r=e<=0&&n<0,i=e>=t-1&&n>0;if(!r&&!i)return null;let a=Math.min(.06,Math.abs(n)/120*.06);return{scaleY:1-a,scaleX:1+a/2,origin:r?`center top`:`center bottom`}}var a3=(0,f.forwardRef)(function({children:e,className:t,surface:n=!1,surfaceSize:r,surfaceDepth:i,screen:a=!1,...o},s){let c=(0,f.useRef)(null),l=(0,f.useRef)(null),u=SP();(0,f.useEffect)(()=>{let e=c.current,t=e?.querySelector(`.caps-scroll-viewport`);if(!t||!e)return;let n=null,r,i=t.scrollTop,a=performance.now(),o=0,s=e=>{let t=l.current;if(!e||u||!t)return;n?.cancel(),t.style.transformOrigin=e.origin;let r=dP(t),i=n3(r,{ease:`outQuad`,duration:45}),a=t3(r,{bounce:.18,duration:180});n=$I(t,{scaleY:[{to:e.scaleY,...i},{to:1,...a}],scaleX:[{to:e.scaleX,...i},{to:1,...a}]})},d=(e,t)=>{let n=r3(o,e,t);o=e,s(n)},f=e=>{if(e.ctrlKey||Math.abs(e.deltaX)>Math.abs(e.deltaY))return;let n=e.deltaMode===1?16:e.deltaMode===2?t.clientHeight:1,i=i3(t.scrollTop,t.scrollHeight-t.clientHeight,e.deltaY*n);i&&(clearTimeout(r),o=0,s(i))},p=()=>{let e=performance.now(),n=e-a,s=n>100?16:Math.max(16,n),c=t.scrollTop-i;n>100&&(o=0),d(c/s,s),i=t.scrollTop,a=e,clearTimeout(r),r=setTimeout(()=>{d(0,32)},64)};return t.addEventListener(`scroll`,p,{passive:!0}),e.addEventListener(`wheel`,f,{passive:!0}),()=>{clearTimeout(r),n?.cancel(),l.current&&(l.current.style.transform=`none`),t.removeEventListener(`scroll`,p),e.removeEventListener(`wheel`,f)}},[a,n,u]);let d=(0,J.jsx)(W4,{render:a?(0,J.jsx)(vL,{}):(0,J.jsx)(`div`,{}),...o,ref:s,className:`caps-scroll-viewport`,children:(0,J.jsx)(Q4,{style:{minWidth:0},children:e})});return(0,J.jsxs)(T4,{render:n?(0,J.jsx)(_L,{size:r??`md`,depth:i??`shallow`}):(0,J.jsx)(`div`,{}),ref:c,className:Z(`caps-scroll-area`,t),children:[a?(0,J.jsx)(`div`,{className:`caps-display-gasket caps-scroll-display`,children:d}):d,(0,J.jsx)(_L,{size:`sm`,depth:`deep`,placement:`embedded`,className:`caps-scroll-track-surface`,children:(0,J.jsx)(Z4,{className:`caps-scroll-track`,children:(0,J.jsx)($4,{className:`caps-scroll-thumb`,children:(0,J.jsx)(`span`,{className:`caps-scroll-thumb-surface`,ref:l})})})})]})}),o3=(0,f.forwardRef)(function({className:e,invalid:t,...n},r){return(0,J.jsx)(`input`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:Z(`input caps-input w-full`,e),ref:r})});(0,f.forwardRef)(function({leading:e,className:t,...n},r){return(0,J.jsxs)(`span`,{className:`caps-search-input`,"data-leading":e?`true`:void 0,children:[e?(0,J.jsx)(`span`,{className:`caps-search-leading`,"aria-hidden":`true`,children:e}):null,(0,J.jsx)(o3,{...n,type:`search`,className:t,ref:r})]})});var s3=(0,f.forwardRef)(function({className:e,invalid:t,...n},r){return(0,J.jsxs)(`span`,{className:`caps-select-shell`,children:[(0,J.jsx)(`select`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:Z(`select select-bordered caps-select w-full`,t&&`select-error`,e),ref:r}),!n.multiple&&(!n.size||n.size<=1)?(0,J.jsx)(wL,{className:`caps-select-chevron`,"aria-hidden":`true`}):null]})}),c3={2:`h2`,3:`h3`,4:`h4`};function l3(e,t){let{reduced:n}=t,r=e&&!n,i=pP(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 u3=(0,f.forwardRef)(function({actions:e,className:t,description:n,headingLevel:r=2,suggestions:i,thinking:a=!1,title:o,visual:s,renderVisual:c,variant:l=`plain`,...u},d){let p=(0,f.useId)(),m=(0,f.useRef)(null),h=fP(m),g=l3(l===`speech`,h)&&!a,_=c3[r],v=c?c({speaking:g,thinking:a}):s,y=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(_,{ref:m,className:`empty-state-title`,id:u[`aria-labelledby`]?void 0:p,children:o}),(0,J.jsx)(`p`,{children:n}),i&&i.length>0?(0,J.jsx)(`ul`,{"aria-label":`Try one of these`,className:`empty-state-suggestions`,children:i.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(mL,{size:`sm`,variant:`outline`,onClick:e.onSelect,children:e.label})},e.label))}):null,e?(0,J.jsx)(`div`,{className:`empty-state-actions`,children:e}):null]});return(0,J.jsxs)(`section`,{...u,"aria-labelledby":u[`aria-labelledby`]??p,className:Z(`empty-state`,l!==`plain`&&`empty-state-${l}`,t),ref:d,children:[v?(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`empty-state-visual`,children:v}):null,l===`speech`?(0,J.jsx)(`div`,{className:`empty-state-bubble`,children:y}):y]})});function d3(e,t){return{kind:`button`,id:`folder`,text:t.checking?`Checking…`:`prints`,icon:`folder`,title:e===null?`Choose where Prints saves images`:tT(`Save prints to ${e}`,1024),opens:`dialog`,expanded:t.editing}}var f3=IM(`card caps-card`,{variants:{variant:{surface:`caps-card-surface`,outline:`caps-card-outline`,interactive:`caps-card-interactive`,game:`caps-card-game caps-card-interactive`,fit:`caps-card-fit`},density:{regular:``,compact:`caps-card-compact`}},defaultVariants:{variant:`surface`,density:`regular`}}),p3=(0,f.forwardRef)(function({className:e,density:t,featured:n=!1,state:r,variant:i,...a},o){return(0,J.jsx)(`div`,{...a,className:Z(f3({density:t,variant:i}),n&&`caps-card-featured`,e),"data-state":r,ref:o})});(0,f.forwardRef)(function({className:e,density:t,variant:n,width:r=`default`,...i},a){return(0,J.jsx)(`main`,{className:`caps-centered-card-stage`,children:(0,J.jsx)(p3,{...i,className:Z(`caps-centered-card`,r===`wide`&&`caps-centered-card-wide`,e),ref:a,variant:n??`surface`,...t?{density:t}:{}})})}),(0,f.forwardRef)(function({alignment:e=`start`,className:t,...n},r){return(0,J.jsx)(`div`,{...n,className:Z(`caps-card-header`,e===`center`&&`caps-card-header-centered`,t),ref:r})}),(0,f.forwardRef)(function({className:e,level:t=3,...n},r){return(0,J.jsx)(t===2?`h2`:`h3`,{...n,className:Z(`caps-card-title`,e),ref:r})}),(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(`p`,{...t,className:Z(`caps-card-description`,e),ref:n})}),(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(`div`,{...t,className:Z(`caps-card-content`,e),ref:n})}),(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(`div`,{...t,className:Z(`caps-card-footer`,e),ref:n})});var m3=(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(`div`,{...t,ref:n,className:Z(`caps-popover-anchor`,e)})}),h3=(0,f.forwardRef)(function({className:e,open:t,side:n=`top`,...r},i){return t?(0,J.jsx)(`div`,{...r,ref:i,className:Z(`caps-popover`,e),"data-side":n}):null});(0,f.forwardRef)(function({active:e,className:t,onMouseDown:n,...r},i){return(0,J.jsx)(`div`,{role:`option`,"aria-selected":e,...r,ref:i,className:Z(`caps-popover-option`,t),"data-active":e,onMouseDown:e=>{e.preventDefault(),n?.(e)}})});function g3(e){let t=kj(e),n=(0,f.useRef)(e);n.current=e;let r=_c(),i=Wl(MZ(e)),a=Zl(nZ(e,i.data?.configured?i.data.path:null)),[o,s]=(0,f.useState)(null),c=n=>n?.app===e&&n.computerId===t,l=Yl({mutationKey:AZ.folder(e),mutationFn:async({owner:e,id:t,path:r,create:i})=>{let a=()=>{if(n.current!==e||e.context.get().computerId!==t)throw new K(`Computer selection changed`,{code:`SELECTION_CHANGED`,retryable:!1})};return a(),i&&await e.capabilities.require(JL).mkdir({path:r}),a(),await qL(e.capabilities,{path:r,limit:1,offset:0}),a(),kZ(e.capabilities,{operation:`select-folder`,computerId:t,path:r})},onSuccess:(e,t)=>{t.owner===n.current&&t.owner.context.get().computerId===t.id&&s(null)},onSettled:(e,t,n)=>Promise.all([r.invalidateQueries({queryKey:n.queryKey,exact:!0}),r.invalidateQueries({queryKey:tZ.listing(n.owner,n.path),exact:!0})])}),u=l.variables?.owner===e&&l.variables.id===t,d=i.isFetching||u&&l.isPending,p=async(n,r)=>{if(!e||!t||d)return`Computer selection changed. Try again.`;let i=n.trim();if(!JS(gX)(i))return`Enter an absolute Computer folder, such as /media.`;try{return await l.mutateAsync({owner:e,id:t,path:i,create:r,queryKey:AZ.folder(e)}),null}catch{return`Could not use this folder. Check its location and your Computer permissions.`}},m=i.isError||a.isError;return{path:m?null:i.data?.path??null,galleryPath:m||!i.data?.configured?null:i.data.path,computerId:t,available:e?.capabilities.has(aM)===!0,writable:e?.capabilities.has(JL)===!0,busy:d,error:m?`Your media folder is unavailable. Choose or create a folder.`:null,editing:c(o),setEditing:n=>{s(n?{app:e,computerId:t}:null)},choose:p,ensureCreated:async()=>i.data?i.data.configured?null:p(i.data.path,!0):`Your Prints library is still loading.`,recheck:()=>{r.invalidateQueries({queryKey:tZ.listing(e,i.data?.path??null),exact:!0}),r.invalidateQueries({queryKey:AZ.folder(e),exact:!0})}}}var _3=XS(oC),v3=XS(Y({message:oC}));function y3(e){for(let t of e.errors){let e=oee(iee(see(v3(t),e=>e.message),()=>_3(t)));if(e!==void 0&&e.length>0)return e}}var b3=(0,f.forwardRef)(function({children:e,className:t,optional:n,required:r,...i},a){return(0,J.jsxs)(`label`,{...i,className:Z(`label caps-label cursor-pointer justify-start gap-sm text-sm font-semibold text-base-content`,t),ref:a,children:[e,r?(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`text-error`,children:`*`}):null,n&&!r?(0,J.jsx)(`span`,{className:`caps-label-optional`,children:`Optional`}):null]})}),x3=(0,f.forwardRef)(function({children:e,className:t,...n},r){return(0,J.jsx)(`div`,{...n,className:Z(`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:Z(`join-item caps-input-group-control`,e.props.className)}):e)})}),S3=(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(`div`,{...t,className:Z(`join-item flex items-center border border-base-300 bg-base-200 px-md text-sm text-base-content`,e),ref:n})});function C3(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=SP(),[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(!_P(n)){e||l(!1);return}let i=dP(n),a=`translateY(${String(i.distance)}px)`,c=gP(i,i.ease),d=n.getBoundingClientRect().height,f=C3(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:gP(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,J.jsx)(`div`,{...i,ref:o,className:Z(`caps-presence`,r),"data-present":e,"aria-hidden":!e||void 0,children:n}):null});var w3=(0,f.forwardRef)(function({open:e,children:t,className:n,...r},i){return(0,J.jsx)(`div`,{...r,ref:i,className:Z(`caps-collapse`,n),"data-open":e,"aria-hidden":!e||void 0,children:(0,J.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=SP(),[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 p=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{let e=o.current;if(!e||!(`ResizeObserver`in globalThis))return;p.current=e.getBoundingClientRect();let t=new ResizeObserver(()=>{e.getAnimations().length===0&&(p.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(!_P(e)){d([]);return}let r=p.current,i=e.getBoundingClientRect(),a=dP(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:gP(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:gP(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:gP(a,a.ease)})),()=>{for(let e of c)e.cancel()}},[e,s]),(0,J.jsx)(`div`,{...i,ref:o,className:Z(`caps-swap`,r),"data-anchor":t,children:[...u.map(e=>(0,J.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-leaving":e.key,"aria-hidden":`true`,children:e.content},e.key)),(0,J.jsx)(`div`,{className:`caps-swap-layer`,"data-swap-current":``,children:n},e)]})});function T3({children:e,...t}){let[n,r]=(0,f.useState)(e);return e&&e!==n&&r(e),(0,J.jsx)(w3,{...t,className:Z(`caps-field-error-reveal`,t.className),open:!!e,children:(0,J.jsx)(`div`,{className:`caps-field-error`,role:`alert`,"aria-hidden":!e,children:n})})}function E3({children:e,divider:t=!0,error:n,layout:r=`end`,status:i,...a}){return(0,J.jsxs)(`footer`,{...a,className:Z(`caps-form-footer`,a.className),"data-divider":t,"data-layout":r,children:[(0,J.jsx)(T3,{children:n}),(0,J.jsxs)(`div`,{className:`caps-form-footer-row`,children:[i?(0,J.jsx)(`div`,{className:`caps-form-footer-status`,role:`status`,children:i}):null,(0,J.jsx)(`div`,{className:`caps-form-footer-actions`,children:e})]})]})}var D3=(0,f.forwardRef)(function({busy:e=!1,children:t,className:n,...r},i){return(0,J.jsx)(`form`,{...r,"aria-busy":e||void 0,className:Z(`caps-form`,n),ref:i,children:(0,J.jsx)(`fieldset`,{className:`caps-form-body`,disabled:e,children:t})})}),O3={2:`h2`,3:`h3`,4:`h4`},k3=(0,f.forwardRef)(function({children:e,className:t,description:n,level:r=3,title:i,...a},o){let s=(0,f.useId)(),c=O3[r];return(0,J.jsxs)(`section`,{...a,"aria-labelledby":`${s}-title`,className:Z(`caps-form-section`,t),ref:o,children:[(0,J.jsxs)(`header`,{className:`caps-form-section-copy`,children:[(0,J.jsx)(c,{className:`caps-form-section-title`,id:`${s}-title`,children:i}),n?(0,J.jsx)(`p`,{className:`caps-form-section-description`,children:n}):null]}),(0,J.jsx)(`div`,{className:`caps-form-section-fields`,children:e})]})}),A3=(0,f.forwardRef)(function({children:e,className:t,description:n,error:r,legend:i,...a},o){let s=(0,f.useId)(),c=[n?`${s}-description`:a[`aria-describedby`],r?`${s}-error`:null].filter(Boolean).join(` `)||void 0;return(0,J.jsxs)(`fieldset`,{...a,"aria-describedby":c,"aria-invalid":r?!0:a[`aria-invalid`],className:Z(`caps-fieldset`,t),ref:o,children:[(0,J.jsx)(`legend`,{className:`caps-fieldset-legend`,children:i}),n?(0,J.jsx)(`p`,{className:`caps-fieldset-description`,id:`${s}-description`,children:n}):null,(0,J.jsx)(`div`,{className:`caps-fieldset-fields`,children:e}),r===void 0?null:(0,J.jsx)(T3,{id:`${s}-error`,children:r})]})});function j3(e){let t=[];return f.Children.forEach(e.props.children,e=>{(0,f.isValidElement)(e)&&e.type!==S3&&t.push(e)}),t[0]??null}var M3=(0,f.forwardRef)(function({children:e,className:t,description:n,error:r,icon:i,label:a,optional:o,orientation:s=`vertical`,readout:c=!1,required:l,...u},d){let p=(0,f.useId)(),m=(0,f.isValidElement)(e)?e:null,h=m?.type===x3,g=h?j3(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=l===!0||g?.props.required,S=r?!0:g?.props[`aria-invalid`],C=l===!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&&!c?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,J.jsx)(b3,{htmlFor:c?void 0:_,className:s===`inline`?`font-normal`:void 0,...l===void 0?{}:{required:l},...o===void 0?{}:{optional:o},children:a}):null,D=a||n?(0,J.jsxs)(`div`,{className:`caps-field-copy`,children:[E,n?(0,J.jsx)(`p`,{className:`caps-field-description`,id:v,children:n}):null]}):null,O=i?(0,J.jsxs)(`div`,{className:`caps-field-lead`,children:[(0,J.jsx)(`span`,{className:`caps-field-icon`,"aria-hidden":`true`,children:i}),D]}):D;return(0,J.jsxs)(`div`,{...u,className:Z(`caps-field`,t),"data-orientation":s,ref:d,children:[s===`horizontal`?(0,J.jsxs)(`div`,{className:`caps-field-row`,children:[O,T]}):s===`inline`?(0,J.jsxs)(`div`,{className:`caps-field-row`,children:[T,O]}):(0,J.jsxs)(J.Fragment,{children:[O,T]}),(0,J.jsx)(T3,{id:y,children:r})]})});function N3(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}var P3=`M 9.86 38.14 A 20 20 0 1 1 38.14 38.14`,F3=6,I3=new Map([[`ArrowUp`,1],[`ArrowDown`,-1],[`PageUp`,10],[`PageDown`,-10]]),L3=(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:p,value:m,wrap:h=!1,...g},_){let[v,y]=(0,f.useState)(n),[b,x]=(0,f.useState)(null),S=m===void 0?v:m,C=N3(d),w=e=>{let t=Number(e.toFixed(C));return s!==void 0&&t<s?s:o!==void 0&&t>o?o:t},T=e=>{let t=e===null?null:w(e);y(t),x(null),t!==S&&u?.(t)},E=()=>{if(b===null)return;let e=Number(b);T(b.trim()===``||!Number.isFinite(e)?null:e)},D=e=>{let t=(S??s??0)+e*d;if(h&&s!==void 0&&o!==void 0){if(t>o){T(s);return}if(t<s){T(o);return}}T(t)},O=s!==void 0&&S!==null&&S<=s,k=o!==void 0&&S!==null&&S>=o,A=r===!0,j=(0,f.useRef)(null),M=s!==void 0&&o!==void 0&&o>s?((S??s)-s)/(o-s):null,N=e=>{A||(e.currentTarget.setPointerCapture(e.pointerId),j.current={y:e.clientY,value:S??s??0})},P=e=>{if(!j.current)return;let t=Math.trunc((j.current.y-e.clientY)/F3),n=w(j.current.value+t*d);n!==S&&T(n)},F=()=>{j.current=null};return(0,J.jsxs)(`span`,{className:Z(`caps-number-field`,e),"data-at-max":k||void 0,"data-at-min":O||void 0,"data-disabled":A||void 0,"data-wrap":h||void 0,children:[M===null?null:(0,J.jsxs)(`svg`,{className:`caps-number-field-dial`,viewBox:`0 0 48 48`,"aria-hidden":`true`,focusable:`false`,onPointerDown:N,onPointerMove:P,onPointerUp:F,onPointerCancel:F,children:[(0,J.jsx)(`path`,{className:`caps-number-field-dial-track`,d:P3,pathLength:100}),(0,J.jsx)(`path`,{className:`caps-number-field-dial-level`,d:P3,pathLength:100,strokeDasharray:`${String(Math.max(.5,M*100))} 100`})]}),(0,J.jsx)(mL,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-decrement`,"aria-label":t,"aria-controls":g.id,tabIndex:-1,disabled:A||O&&!h,onClick:()=>{D(-1)},children:(0,J.jsx)(Kte,{"aria-hidden":`true`})}),(0,J.jsxs)(`span`,{className:`caps-number-field-readout`,children:[(0,J.jsx)(`input`,{...g,"aria-invalid":a?!0:g[`aria-invalid`]===!1?void 0:g[`aria-invalid`],className:`input caps-input caps-number-field-input`,disabled:r,inputMode:g.inputMode??(C>0?`decimal`:`numeric`),max:o,min:s,onBlur:e=>{E(),c?.(e)},onChange:e=>{x(e.target.value)},onKeyDown:e=>{if(l?.(e),e.defaultPrevented)return;let t=I3.get(e.key);t===void 0?e.key===`Home`&&s!==void 0?(e.preventDefault(),T(s)):e.key===`End`&&o!==void 0?(e.preventDefault(),T(o)):e.key===`Enter`&&E():(e.preventDefault(),D(t))},ref:_,step:d,type:`number`,value:b??(S===null?``:String(S))}),p?(0,J.jsx)(`span`,{className:`caps-number-field-unit`,"aria-hidden":`true`,children:p}):null]}),(0,J.jsx)(mL,{type:`button`,variant:`outline`,size:`icon`,className:`caps-number-field-increment`,"aria-label":i,"aria-controls":g.id,tabIndex:-1,disabled:A||k&&!h,onClick:()=>{D(1)},children:(0,J.jsx)(qte,{"aria-hidden":`true`})})]})}),R3={dot:{y:-4,height:8,cy:0},pill:{y:-16,height:32,cy:0},bang:{y:-16,height:20,cy:12}};function z3({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)(R3[t]).current,d=(0,f.useRef)(t===`dot`?1:4).current,p=(0,f.useRef)(+(t===`bang`)).current,m=(0,f.useRef)(t),h=fP(s),{reduced:g}=h;return(0,f.useLayoutEffect)(()=>{if(!i.current||!a.current||!c.current||!l.current)return;let e=R3[t],n=g||m.current===t;m.current=t;let r=dP(i.current),o=n?{duration:0}:t3(r,{bounce:.3,duration:360}),s=$I(i.current,{y:e.y,height:e.height,...o}),u=$I(a.current,{cy:e.cy,...n?{duration:0}:{delay:pP(r,35),...t3(r,{bounce:.3,duration:420})}}),d=$I(c.current,{gradientTransform:`matrix(1 0 0 ${t===`dot`?`1`:`4`} 0 0)`,...o}),f=$I(l.current,{opacity:+(t===`bang`),...n?e3:n3(r,{ease:`inOutSine`,duration:220})});return()=>{s.cancel(),u.cancel(),d.cancel(),f.cancel()}},[t,g]),(0,f.useLayoutEffect)(()=>{if(!o.current||!s.current||g||n===`none`)return;let e=n===`pulse`?$I(o.current,{opacity:[1,.45],...n3(h,{ease:`inOutSine`,duration:750}),alternate:!0,loop:!0}):$I(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}},...n3(h,{ease:`inOutSine`,duration:1e3}),loop:!0}),t=cL(s.current,t=>{t?e.resume():e.pause()});return()=>{t(),e.revert()}},[n,g,h]),(0,J.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,J.jsxs)(`defs`,{children:[(0,J.jsx)(sL,{id:r,values:oL}),(0,J.jsx)(rL,{ref:c,id:`${r}-surface`,transform:`matrix(1 0 0 ${String(d)} 0 0)`}),(0,J.jsxs)(`radialGradient`,{id:`${r}-drop-light`,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`10.4`,r:`5.6`,children:[(0,J.jsx)(`stop`,{offset:`0`,stopColor:`var(--color-white)`,style:{stopOpacity:`calc(var(--depth) * 0.5)`}}),(0,J.jsx)(`stop`,{offset:`1`,stopColor:`var(--color-white)`,stopOpacity:`0`})]}),(0,J.jsx)(iL,{id:`${r}-shadow`}),(0,J.jsx)(`mask`,{id:`${r}-silhouette`,maskUnits:`userSpaceOnUse`,x:`-12`,y:`-24`,width:`24`,height:`48`,style:{maskType:`alpha`},children:(0,J.jsxs)(`g`,{fill:`var(--color-white)`,filter:`url(#${r})`,children:[(0,J.jsx)(`rect`,{ref:i,x:`-4`,y:u.y,width:`8`,height:u.height,rx:`4`}),(0,J.jsx)(`circle`,{ref:a,cx:`0`,cy:u.cy,r:`4`})]})})]}),(0,J.jsx)(`g`,{ref:o,filter:`url(#${r}-shadow)`,children:(0,J.jsxs)(`g`,{mask:`url(#${r}-silhouette)`,children:[(0,J.jsx)(`rect`,{x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-surface)`}),(0,J.jsx)(`rect`,{ref:l,x:`-12`,y:`-24`,width:`24`,height:`48`,fill:`url(#${r}-drop-light)`,opacity:p})]})})]})}var B3=.28;function V3(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?B3: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 H3=7.25;function U3({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),p=(0,f.useRef)(V3(t,n)).current,m=(0,f.useRef)(t),h=SP();(0,f.useLayoutEffect)(()=>{let e=i.current,r=a.current,c=o.current,f=s.current,p=l.current,g=u.current,_=d.current;if(!e||!r||!c||!f||!p||!g||!_)return;let v=V3(t,n),y=m.current;m.current=t;let b=dP(e),x=h||y===t&&t!==`arc`,S=x?h?{ease:b.ease,duration:b.fast}:e3:n3(b,{ease:`outQuad`,duration:160}),C=(t===`check`||t===`cross`)&&!x,w=n3(b,{ease:`inOutSine`,duration:220}),T=[$I(r,{opacity:v.dashes,...S}),$I(c,{opacity:v.track*.28,...S}),$I(f,{opacity:v.arc,"stroke-dasharray":`${String(v.sweep)} 1`,...x?h?e3:S:w}),$I(p,{r:v.disc*H3,...C?{delay:w.duration*.7,...t3(b,{bounce:.35,duration:360})}:h?e3:n3(b,{ease:`inCubic`,duration:140})}),$I(g,{"stroke-dashoffset":1-v.tick,...C&&v.tick>0?{delay:w.duration*.7+b.fast,...n3(b,{ease:`outCubic`,duration:240})}:e3}),$I(_,{"stroke-dashoffset":1-v.cross,...C&&v.cross>0?{delay:w.duration*.7+b.fast,...n3(b,{ease:`outCubic`,duration:240})}:e3})];return t===`cross`&&C&&b.shake>0&&T.push($I(e,{translateX:[0,-b.shake,b.shake,-b.shake/2,0],delay:w.duration+b.fast,...n3(b,{ease:`linear`,duration:300})})),()=>{for(let e of T)e.cancel()}},[t,n,h]);let g=t===`arc`&&n===void 0&&!h;return(0,f.useLayoutEffect)(()=>{if(!g||!c.current||!i.current)return;let e=dP(i.current),t=$I(c.current,{rotate:[0,360],...n3(e,{ease:`linear`,duration:900}),loop:!0}),n=cL(i.current,e=>{e?t.resume():t.pause()});return()=>{n(),t.revert()}},[g]),(0,J.jsxs)(`svg`,{ref:i,"aria-hidden":`true`,className:`caps-status-mark ${e??``}`,viewBox:`0 0 16 16`,focusable:`false`,children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsx)(rL,{id:`${r}-surface`,transform:`matrix(1.6 0 0 1.6 8 8)`}),(0,J.jsxs)(`mask`,{id:`${r}-knock`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`16`,height:`16`,children:[(0,J.jsx)(`rect`,{width:`16`,height:`16`,fill:`var(--color-white)`}),(0,J.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-p.tick}),(0,J.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-p.cross})]})]}),(0,J.jsx)(`circle`,{ref:a,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`1.7 2.2`,opacity:p.dashes}),(0,J.jsx)(`circle`,{ref:o,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,opacity:p.track*.28}),(0,J.jsx)(`g`,{ref:c,className:`caps-status-mark-spin`,children:(0,J.jsx)(`circle`,{ref:s,cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,pathLength:1,strokeDasharray:`${String(p.sweep)} 1`,transform:`rotate(-90 8 8)`,opacity:p.arc})}),(0,J.jsx)(`circle`,{ref:l,cx:`8`,cy:`8`,r:p.disc*H3,fill:`url(#${r}-surface)`,mask:`url(#${r}-knock)`})]})}var W3=new Set([`ring`,`arc`,`check`,`cross`]);function G3(e){return W3.has(e)}var K3={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`},q3=(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,J.jsxs)(`span`,{...c,className:Z(`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:[G3(n)?(0,J.jsx)(U3,{className:K3[i],glyph:n,progress:s}):(0,J.jsx)(z3,{className:K3[i],glyph:n,motion:r}),t===void 0?null:(0,J.jsx)(`span`,{children:t})]})}),J3={neutral:`progress-neutral`,primary:`progress-primary`,secondary:`progress-secondary`,accent:`progress-accent`,success:`progress-success`,info:`progress-info`,warning:`progress-warning`,error:`progress-error`},Y3=(0,f.forwardRef)(function({className:e,tone:t=`primary`,...n},r){return(0,J.jsx)(`progress`,{...n,"data-complete":n.value!==void 0&&Number(n.value)>=Number(n.max??1)?`true`:void 0,className:Z(`progress caps-gooey-motion caps-gooey-progress w-full`,J3[t],e),ref:r})});(0,f.forwardRef)(function({label:e,value:t,max:n,tone:r=`info`,className:i,...a},o){return(0,J.jsxs)(`div`,{...a,ref:o,className:Z(`caps-game-meter`,i),children:[(0,J.jsxs)(`div`,{className:`caps-game-meter-readout`,children:[(0,J.jsx)(`span`,{children:e}),(0,J.jsxs)(`span`,{className:`caps-game-meter-value`,children:[t,` / `,n]})]}),(0,J.jsx)(Y3,{"aria-label":e,value:t,max:n,tone:r})]})});function X3({className:e,items:t,onCancel:n,onRemove:r,onRetry:i,rowClassName:a}){return t.length?(0,J.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,J.jsx)($3,{item:e,onCancel:n,onRemove:r,onRetry:i,...a===void 0?{}:{rowClassName:a}},e.id))}):null}function Z3({action:e,id:t,onAction:n,retry:r=!1}){return e?(0,J.jsx)(gL,{"aria-label":e.accessibleLabel,title:e.label,variant:`ghost`,size:`xs`,className:`motion-reduce:transition-none`,icon:r?(0,J.jsx)(EL,{}):(0,J.jsx)(kL,{}),onClick:()=>void n(t),type:`button`}):null}function Q3({item:e}){return(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`span`,{className:`block min-w-0 truncate`,title:e.name,children:e.name}),(0,J.jsx)(`div`,{className:`caps-upload-details`,children:(0,J.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 $3({item:e,onCancel:t,onRemove:n,onRetry:r,rowClassName:i}){return(0,J.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,J.jsx)(`img`,{alt:``,className:`caps-upload-preview mask mask-squircle size-8 shrink-0 object-cover`,src:e.preview.url}):(0,J.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,J.jsx)(Ute,{className:`size-4`})}),(0,J.jsx)(Q3,{item:e}),(0,J.jsx)(e6,{actions:e.actions,id:e.id,onCancel:t,onRemove:n,onRetry:r}),(0,J.jsx)(Y3,{"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 e6({actions:e,id:t,onCancel:n,onRemove:r,onRetry:i}){return(0,J.jsxs)(`div`,{className:`caps-upload-actions flex min-w-0 flex-wrap justify-end gap-xs`,children:[(0,J.jsx)(Z3,{action:e.retry,id:t,onAction:i,retry:!0}),(0,J.jsx)(Z3,{action:e.cancel,id:t,onAction:n}),(0,J.jsx)(Z3,{action:e.remove,id:t,onAction:r})]})}var t6={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`},n6={blurStdDeviation:.22,alphaSlope:18,alphaIntercept:-8};function r6({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=SP();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=dP(n.current),c=n3(s,{ease:`inCubic`,duration:160}),l=$I(n.current,{d:{to:t6[e],...o?e3:n3(s,{ease:`outCubic`,duration:200})},"stroke-dashoffset":{to:+!t,...o?e3:t?n3(s,{ease:`inOutSine`,duration:260}):c},"stroke-width":o?{to:t?2.4:0,duration:0}:t&&!r?[{to:2.2,...n3(s,{ease:`outCubic`,duration:65})},{to:2.4,delay:pP(s,120),...t3(s,{bounce:.35,duration:220})}]:{to:t?2.4:0,...c}});return()=>{l.cancel()}},[e,a]),(0,J.jsxs)(`svg`,{className:`caps-checkbox-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsx)(rL,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,J.jsx)(iL,{id:`${t}-shadow`}),(0,J.jsx)(aL,{id:`${t}-inset`}),(0,J.jsx)(sL,{id:`${t}-goo`,values:n6}),(0,J.jsxs)(`filter`,{id:`${t}-relief`,x:`-25%`,y:`-25%`,width:`150%`,height:`150%`,colorInterpolationFilters:`sRGB`,children:[(0,J.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.28`,result:`relief`}),(0,J.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,J.jsx)(`feDistantLight`,{azimuth:`225`,elevation:`55`})}),(0,J.jsx)(`feComposite`,{in:`light`,in2:`SourceAlpha`,operator:`in`,result:`clipped-light`}),(0,J.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`clipped-light`,mode:`screen`})]}),(0,J.jsx)(`mask`,{id:`${t}-contour`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`12`,height:`12`,style:{maskType:`alpha`},children:(0,J.jsx)(`path`,{ref:n,d:t6[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,J.jsx)(`clipPath`,{id:`${t}-well`,children:(0,J.jsx)(`rect`,{x:`1`,y:`1`,width:`10`,height:`10`,rx:`2.5`})})]}),(0,J.jsx)(`rect`,{className:`caps-checkbox-track`,x:`0.5`,y:`0.5`,width:`11`,height:`11`,rx:`3`,filter:`url(#${t}-inset)`}),(0,J.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,J.jsx)(`g`,{filter:`url(#${t}-shadow)`,children:(0,J.jsx)(`g`,{filter:`url(#${t}-relief)`,children:(0,J.jsx)(`g`,{mask:`url(#${t}-contour)`,children:(0,J.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,p]=(0,f.useState)(o),m=a??d,h=i?`mixed`:m?`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&&p(o)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[a,o,c.form]),(0,J.jsxs)(`span`,{className:`caps-checkbox`,"data-appearance":t===`compact`?t:void 0,"data-state":h,"data-custom-indicator":n!==void 0||void 0,children:[(0,J.jsx)(`input`,{...c,checked:m,"aria-checked":i?`mixed`:m,"aria-invalid":r?!0:c[`aria-invalid`]===!1?void 0:c[`aria-invalid`],className:Z(`caps-checkbox-input`,e),onChange:e=>{a===void 0&&p(e.target.checked),s?.(e),e.currentTarget.indeterminate=i},ref:u,type:`checkbox`}),n===void 0?(0,J.jsx)(r6,{state:h}):n]})}),a6=Yj({keyCode:Zj(229)});function o6(e){return e.nativeEvent.isComposing||gt(a6,e.nativeEvent).success}var s6=[],c6=void 0;function l6(){return c6}function u6(e){s6.push(e)}function d6(e){let t=(t,n)=>{let r=j$(p6).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 f6(e){return f.forwardRef(d6(e))}function p6(){return{didInitialize:!1}}function m6(e,t){return t!=null&&!m2(t)?0:typeof e==`function`?e():e}function h6(e,t,n){let r=m6(e,n);return typeof r==`number`?r:r?.[t]}function g6(e){return typeof e==`function`?e():e}function _6(e,t){return t||e===`click`||e===`mousedown`}function v6(e){return e?.includes(`mouse`)&&e!==`mousedown`}function y6(e,t,n,r){let i=!1,a=!1,o=r??z$;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 b6=`none`,x6=`trigger-press`,S6=`trigger-hover`,C6=`outside-press`,w6=`close-press`,T6=`focus-out`,E6=`escape-key`,D6=`imperative-action`;function O6(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function k6(e){let t=j$(A6,e).current;return t.next=e,D4(t.effect),t}function A6(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var j6=null;globalThis.requestAnimationFrame;var M6=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)}},N6=class e{static create(){return new e}static request(e){return M6.request(e)}static cancel(e){return M6.cancel(e)}currentId=j6;request(e){this.cancel(),this.currentId=M6.request(()=>{this.currentId=j6,e()})}cancel=()=>{this.currentId!==j6&&(M6.cancel(this.currentId),this.currentId=j6)};disposeEffect=()=>this.cancel};function P6(){let e=j$(N6.create).current;return B$(e.disposeEffect),e}var F6={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},I6={...F6,position:`fixed`,margin:0,top:0,left:0};({...F6});var L6=f.forwardRef(function(e,t){let[n,r]=f.useState();D4(()=>{D0&&E0&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,J.jsx)(`span`,{...e,ref:t,style:I6,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function R6(e){return`data-base-ui-${e}`}var z6=0;function B6(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(z6);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),L$;let o=requestAnimationFrame(a);return z6=o,()=>{z6===o&&(cancelAnimationFrame(o),z6=0)}}var V6=`data-base-ui-inert`,H6=new WeakMap,U6=new WeakSet,W6=new WeakMap,G6=0;function K6(e){return e?Z1(e)?e.host:K6(e.parentNode):null}var q6=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=K6(t);return e.contains(n)?n:null}).filter(e=>e!=null),J6=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Y6=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{G1(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function X6(e,t,n,{mark:r=!0}){let i=q6(t,e),a=r?Y6(t,J6(i),new Set(i)):[],o=[],s=[];if(n){let e=q6(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Y6(t,J6(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(H6.get(e)||0)+1;H6.set(e,r),o.push(e),r===1&&n&&U6.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(W6.get(e)||0)+1;W6.set(e,t),s.push(e),t===1&&e.setAttribute(V6,``)}),G6+=1,()=>{o.forEach(e=>{let t=(H6.get(e)||0)-1;H6.set(e,t),t||(U6.has(e)||e.removeAttribute(`aria-hidden`),U6.delete(e))}),r&&s.forEach(e=>{let t=(W6.get(e)||0)-1;W6.set(e,t),t||e.removeAttribute(V6)}),--G6,G6||(H6=new WeakMap,U6=new WeakSet,W6=new WeakMap)}}function Z6(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=G2(e[0]).body;return X6(e,i,n,{mark:r})}var Q6={style:{transition:`none`}},$6=`data-base-ui-click-trigger`,e8={fallbackAxisSide:`end`},t8={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},n8=l(tu(),1),r8=f.createContext(null),i8=()=>f.useContext(r8),a8=R6(`portal`);function o8(e={}){let{ref:t,container:n,componentProps:r=z$,elementProps:i}=e,a=F1(),o=i8()?.portalNode,[s,c]=f.useState(null),[l,u]=f.useState(null),d=P$(e=>{e!==null&&u(e)}),p=f.useRef(null);D4(()=>{if(n===null){p.current&&(p.current=null,u(null),c(null));return}let e=(n&&(J1(n)?n:n.current))??o??document.body;if(e==null){p.current&&(p.current=null,u(null),c(null));return}p.current!==e&&(p.current=e,u(null),c(e))},[n,o]);let m=x1(`div`,r,{ref:[t,d],props:[{id:a,[a8]:``},i]}),h=s&&m?n8.createPortal(m,s):null;return{node:l,nodeId:f.isValidElement(m)?m.props.id:void 0,subtree:h}}var s8=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}=o8({container:o,ref:t,componentProps:e,elementProps:c}),p=f.useRef(null),m=f.useRef(null),h=f.useRef(null),g=f.useRef(null),[_,v]=f.useState(null),y=f.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!l;f.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&f4(e)&&(e.type===`focusin`?y.current&&=(m4(l),!1):(p4(l),y.current=!0))}return O6(J4(l,`focusin`,e,!0),J4(l,`focusout`,e,!0))},[l,b]),D4(()=>{!l||x!==!0||!y.current||(m4(l),y.current=!1)},[x,l]);let C=f.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return(0,J.jsxs)(f.Fragment,{children:[d,(0,J.jsxs)(r8.Provider,{value:C,children:[S&&l&&(0,J.jsx)(L6,{"data-type":`outside`,ref:p,onFocus:e=>{f4(e,l)?h.current?.focus():u4(_?_.domReference:null)?.focus()}}),S&&l&&(0,J.jsx)(`span`,{role:s,"aria-owns":u,style:t8}),l&&n8.createPortal(a,l),S&&l&&(0,J.jsx)(L6,{"data-type":`outside`,ref:m,onFocus:e=>{f4(e,l)?g.current?.focus():(l4(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,y6(`focus-out`,e.nativeEvent)))}})]})]})});function c8(){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 l8=class{nodesRef={current:[]};events=c8();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)}},u8=f.createContext(null),d8=f.createContext(null),f8=()=>f.useContext(u8)?.id||null,p8=e=>{let t=f.useContext(d8);return e??t};function m8(e){let t=F1(),n=p8(e),r=f8();return D4(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function h8(e){let{children:t,id:n}=e,r=f8();return(0,J.jsx)(u8.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function g8(e){let{children:t,externalTree:n}=e,r=j$(()=>n??new l8).current;return(0,J.jsx)(d8.Provider,{value:r,children:t})}function _8(e){return e==null?e:`current`in e?e.current:e}function v8(e,t){let n=K1(M0(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(f2(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var y8=20,b8=[];function x8(){b8=b8.filter(e=>e.deref()?.isConnected)}function S8(e){x8(),e&&G1(e)!==`body`&&(b8.push(new WeakRef(e)),b8.length>y8&&(b8=b8.slice(-20)))}function C8(){return x8(),b8[b8.length-1]?.deref()}function w8(e){return e?a4(e)?e:s4(e)[0]||e:null}function T8(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=o4(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return a4(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 E8(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:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=P$(()=>x.current.floatingContext?.nodeId),C=i===!1,w=o2(v)&&C,T=k6(i),E=k6(a),D=k6(o),O=k6(u),k=k6(_),A=p8(h),j=i8(),M=f.useRef(!1),N=f.useRef(!1),P=f.useRef(!1),F=f.useRef(null),I=f.useRef(``),L=f.useRef(``),R=f.useRef(null),z=f.useRef(null),ee=J$(R,m,j?.beforeInsideRef),te=J$(z,j?.afterInsideRef),ne=U$(),B=U$(),re=P6(),V=j!=null,H=s2(y),ie=P$((e=H)=>e?s4(e):[]),ae=P$(()=>g?.().filter(e=>e!=null)??[]);f.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&A0(H,k0(G2(H)))&&ie().length===0&&!w&&u2(e)}return J4(G2(H),`keydown`,e)},[r,H,c,w,ie]),f.useEffect(()=>{if(r||!_)return;let e=G2(H);function t(){P.current=!1}function n(e){let t=M0(e),n=ae(),r=A0(y,t)||A0(v,t)||A0(j?.portalNode,t)||n.some(e=>e===t||A0(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,j0(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,B.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return O6(J4(e,`pointerdown`,n,!0),J4(e,`pointerup`,t,!0),J4(e,`pointercancel`,t,!0),J4(e,`keydown`,i,!0),t)},[r,y,v,H,_,j,B,ae]),f.useEffect(()=>{if(r||!l)return;let e=G2(H);function n(){N.current=!0,B.start(0,()=>{N.current=!1})}function i(e){let t=M0(e);a4(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=M0(n);c&&r==null&&a!=null&&A0(y,a)&&S8(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=ae(),f=r?.hasAttribute(R6(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,_8(p),_8(d)].includes(r),m=!(A0(v,r)||A0(y,r)||A0(r,y)||A0(j?.portalNode,r)||u.some(e=>e===r||A0(e,r))||l.hasMatchingElement(e=>A0(e,r))||f||A&&(c2(A.nodesRef.current,o).find(e=>A0(e.context?.elements.floating,r)||A0(e.context?.elements.domReference,r))||l2(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,s2(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&H&&T8(H),s&&i!==v&&!W2(a)&&k0(e)===e.body){if(X1(H)&&(H.focus(),s===`popup`)){re.request(()=>{H.focus()});return}let e=ie(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;X1(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!c)&&r&&m&&!N.current&&(w||r!==C8())&&(M.current=!0,t.setOpen(!1,y6(T6,n)))})}function o(){P.current||(x.current.insideReactTree=!0,ne.start(0,()=>{x.current.insideReactTree=!1}))}let u=X1(v)?v:null;if(!(!y&&!u))return O6(u&&J4(u,`focusout`,a),u&&J4(u,`pointerdown`,n),y&&J4(y,`focusin`,i),y&&J4(y,`focusout`,a),y&&j&&J4(y,`focusout`,o,!0))},[r,v,y,H,c,A,j,t,l,s,ie,w,S,x,ne,B,re,d,p,ae]),f.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${R6(`portal`)}]`)||[]),t=(A?l2(A.nodesRef.current,S()):[]).find(e=>o2(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Z6([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...ae(),t,_8(p),_8(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Z6([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,j,w,A,S,d,p,ae]),D4(()=>{if(!_||r||!X1(H))return;I.current=``,L.current=``;let e=G2(H),t=k0(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||A0(H,t))return;let i=null,a=()=>(i??=ie(H),i[0]||H),o;o=r===!0||r===null?a():_8(r),o||=a();let s=A0(H,k0(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&f2(c);B6(o,{sync:l,preventScroll:o===H,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=k0(e);return!(t!==o&&A0(H,t))}})})},[r,_,H,ie,T,O,k,x]);let oe=f.useRef(null);D4(()=>{if(r||!H){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=G2(H),t=k0(e),n=O.current==null;S8(t);function i(e){if(e.open||(I.current=v8(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(R6(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(f2(e.nativeEvent)||p2(e.nativeEvent))M.current=!1;else{let e=!1;G2(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&G1(t)!==`body`?t:null,s=n?o||a:a||o;return s||=C8()||null,typeof i==`boolean`?s:_8(i)||s||null}return()=>{b.off(`openchange`,i);let t=k0(e),n=ae(),r=A0(y,t)||n.some(e=>e===t||A0(e,t))||A&&c2(A.nodesRef.current,S(),!1).some(e=>A0(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=w8(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&X1(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,H,E,D,O,b,A,v,S,ae]),D4(()=>{if(!E0||_||!y)return;let e=k0(G2(y));!X1(e)||!i2(e)||A0(y,e)&&e.blur()},[_,y]),D4(()=>{if(!(r||!j))return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,l,v]),D4(()=>{if(!(r||!H))return T8(H),()=>{queueMicrotask(x8)}},[r,H]);let se=!r&&(!c||!w)&&(V||c);return(0,J.jsxs)(f.Fragment,{children:[se&&(0,J.jsx)(L6,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=ie();B6(e[e.length-1])}else j?.portalNode&&(M.current=!1,f4(e,j.portalNode)?l4(v)?.focus():_8(p??j.beforeOutsideRef)?.focus())}}),n,se&&(0,J.jsx)(L6,{"data-type":`inside`,ref:te,onFocus:e=>{c?B6(ie()[0]):j?.portalNode&&(l&&(M.current=!0),f4(e,j.portalNode)?u4(v)?.focus():_8(d??j.afterOutsideRef)?.focus())}})]})}function D8(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=x6}=t,l=e.context.dataRef,u=f.useRef(void 0),d=P6(),p=U$(),m=f.useMemo(()=>{function t(t,n,r,i){let a=y6(c,n,r);t&&i===`touch`&&s>0?p.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=m2(e.pointerType,!0)&&p2(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||m2(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=M0(s),p=i2(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}m2(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,p,s]);return f.useMemo(()=>n?{reference:m}:z$,[n,m])}function O8(){return!1}function k8(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function A8(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=O8,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:p}=e.context,m=p8(c),h=P$(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=P$(()=>a),{escapeKey:y,outsidePress:b}=k8(s),x=f.useRef(!1),S=f.useRef(!1),C=f.useRef(!1),w=f.useRef(!1),T=f.useRef(!1),E=f.useRef(``),D=f.useRef(null),O=U$(),k=U$(),A=U$(),j=P$(()=>{k.clear(),d.current.insideReactTree=!1}),M=P$(e=>{let t=d.current.floatingContext?.nodeId;return(m?c2(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=P$(t=>n2(t,e.select(`floatingElement`))||n2(t,e.select(`domReferenceElement`))),P=P$(t=>{o()&&e.setOpen(!1,y6(x6,t.nativeEvent))}),F=P$(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=d2(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=y6(E6,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=P$(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=P$(t=>{if(!l||!n||t.button!==0)return;let r=M0(t.nativeEvent);A0(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=P$(e=>{!l||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});f.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),f.useEffect(()=>j,[j]),f.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new H$,i=G2(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(E0?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=d.current.floatingContext?.nodeId,n=m&&c2(m.nodesRef.current,t).some(t=>n2(e,t.context?.elements.floating));return N(e)||n}function k(n){if(p(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=M0(n),i=`[${R6(`inert`)}]`,a=Y1(r)?r.getRootNode():null,o=Array.from((Z1(a)?a:G2(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>A0(e,r))))return;let c=Y1(r)?r:null;for(;c&&!c0(c);){let e=d0(c);if(c0(e)||!Y1(e))break;c=e}if(!(o.length&&Y1(r)&&!r2(r)&&!A0(r,e.select(`floatingElement`))&&o.every(e=>!A0(c,e)))){if(X1(r)&&!(`touches`in n)){let e=c0(r),t=l0(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(!h(n)){if(f()===`intentional`){if(n.detail!==0&&!f2(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,y6(C6,n)),j())}}}function P(t){f()!==`sloppy`||t.pointerType===`touch`||!e.select(`open`)||!n||N(t)||k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=M0(e);if(!n)return;let r=J4(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),!(e.type===`mousedown`&&D.current&&!D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function ee(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;if(c(),f()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!h(e)){if(n){s();return}typeof g==`function`&&!g(e)||(t.clear(),C.current=!0,j())}}}function te(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}function B(e){f()!==`sloppy`||!D.current||N(e)||(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function re(e){L(e,B)}let V=O6(r&&O6(J4(i,`keydown`,F),J4(i,`compositionstart`,a),J4(i,`compositionend`,o)),_&&O6(J4(i,`click`,z,!0),J4(i,`pointerdown`,z,!0),J4(i,`pointerup`,ee,!0),J4(i,`pointercancel`,ee,!0),J4(i,`mousedown`,z,!0),J4(i,`mouseup`,ee,!0),J4(i,`touchstart`,R,{capture:!0,passive:!0}),J4(i,`touchmove`,ne,{capture:!0,passive:!0}),J4(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{V(),t.clear(),c(),C.current=!1}},[d,u,r,_,g,l,n,y,b,F,j,v,M,N,m,e,O,A]);let z=f.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=f.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return f.useMemo(()=>n?{reference:z,floating:ee,trigger:z}:{},[n,z,ee])}function j8(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),D4(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Y1(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 M8(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),D4(()=>{if(!e&&o&&i!==`ending`&&n){let e=N6.request(()=>{a(`ending`)});return()=>{N6.cancel(e)}}},[e,o,i,n]),D4(()=>{if(!e||t||i===void 0)return;let n=N6.request(()=>{a(void 0)});return()=>{N6.cancel(n)}},[t,e,i]),D4(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=N6.request(()=>{a(`idle`)});return()=>{N6.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var N8=null;function P8(e){if(!N8){let e=[];N8=e,queueMicrotask(()=>{N8=null,n8.flushSync(()=>{for(let t of e)t()})})}N8.push(e)}function F8(e,t=!1,n=!1){let r=P6();return P$((i,a=null)=>{r.cancel();let o=_8(e);if(o==null)return;let s=o,c=()=>{if(!n){n8.flushSync(i);return}P8(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(P4(s).map(e=>e.finished.then(L$))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(P4(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=F0;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 I8(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=P$(a),s=F8(r,n,i);f.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function L8(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=P$(i),{mounted:c,setMounted:l,transitionStatus:u}=M8(t,!1,!1,o),d=!t&&r;D4(()=>{t&&s(!1)},[t,s]);let p=f.useRef(c),m=f.useRef(!1),h=j1(),g=()=>{p.current=!1,l(!1),a()};D4(()=>{p.current=c,m.current&&(m.current=!1,!t&&c&&g())});let _=P$(()=>{if(p.current){if(t){m.current=!0,h();return}g()}});return I8({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}var R8={tabIndex:-1,[N0]:``};function z8(e){return t=>t!==`touch`||e.current}function B8(e,t=!1){let n=F1(),r=f8()!=null,i=j$(()=>e(n,r)).current;return j8({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function V8({handle:e,store:t}){return D4(()=>e.attachStore(t),[e,t]),null}function H8(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function U8(e,t){let n=f.useRef(null);return P$(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),H8(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),H8(t))})}function W8(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 G8(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function K8(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=U8(e,n),o=P$(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=P$(e=>{a(e),e&&o(e)});return D4(()=>(s(t.current),()=>s(null)),[s,t,n,e]),D4(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function q8(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=f.useRef(null),i=e.useState(`open`);D4(()=>{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=y6(b6);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 J8(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=L8({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 j$(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Y8(e,t){e.useSyncedValues(t),D4(()=>()=>{e.update({activeTriggerProps:z$,inactiveTriggerProps:z$,popupProps:z$})},[e])}function X8(e,t){D4(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),D4(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Z8=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}},Q8=f$(),$8=t1(19)?n5:r5;function e5(e,t,n,r,i){return $8(e,t,n,r,i)}function t5(e,t,n,r,i){let a=f.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Q8.useSyncExternalStore)(e.subscribe,a,a)}u6({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,Q8.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function n5(e,t,n,r,i){let a=l6();if(!a)return t5(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 r5(e,t,n,r,i){return(0,m$.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var i5=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 e5(this,e,t,n,r)}},a5=class extends i5{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){f.useDebugValue(e);let n=this;D4(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;D4(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;D4(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){f.useDebugValue(e);let n=this,r=t!==void 0;D4(()=>{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),e5(this,this.selectors[e],t,n,r)}useContextCallback(e,t){f.useDebugValue(e);let n=P$(t??L$);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)}})}},o5={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},s5=class extends a5{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:c8(),nested:n,triggerElements:i},o5),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&h2(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 c5(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new s5({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:z$,inactiveTriggerProps:z$,popupProps:z$}}var l5=e=>e.triggerIdProp??e.activeTriggerId,u5=e=>e.openProp??e.open,d5=e=>(e.popupElement?.id??e.floatingId)||void 0;function f5(e,t){return t!==void 0&&u5(e)&&l5(e)===t}function p5(e,t){return f5(e,t)?!0:t!==void 0&&u5(e)&&l5(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var m5={open:u5,mounted:e=>e.mounted,transitionStatus:e=>u5(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:l5,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:d5,isTriggerActive:(e,t)=>t!==void 0&&l5(e)===t,isOpenedByTrigger:(e,t)=>f5(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&l5(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>p5(e,t)?d5(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function h5(e){let t=f.useCallback(t=>e===void 0?L$:e.subscribeStore(t),[e]),n=f.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Q8.useSyncExternalStore)(t,n,()=>e?.serverStore)}var g5=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new H$;restTimeout=new H$;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},_5=new WeakMap;function v5(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&_5.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),_5.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function y5(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=_5.get(n);a&&a!==e&&v5(a),v5(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,_5.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function b5(e){let t=e.context.dataRef.current,n=j$(()=>t.hoverInteractionState??g5.create()).current;return t.hoverInteractionState||=n,B$(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function x5(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=p8(),u=f8(),d=b5(e),p=U$(),m=P$(()=>_6(c.current.openEvent?.type,d.interactedInside)),h=P$(()=>v6(c.current.openEvent?.type)),g=P$(()=>{v5(d)});D4(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),f.useEffect(()=>g,[g]),D4(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&h()&&Y1(s)&&o){let e=s,t=o,n=G2(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??j0(e,`[data-rootownerid]`)??n.body;return y5(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,a,s,o,d,h,l,u,g]),f.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&c2(l.nodesRef.current,u).length>0)}function a(t){let n=h6(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,y6(S6,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=M0(e);if(!a2(t)){d.interactedInside=!1;return}d.interactedInside=j0(t,`[aria-haspopup]`)!=null}function f(){d.openChangeTimeout.clear(),p.clear(),l?.events.off(`floating.closed`,v),g()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(t2(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(l&&r&&Y1(o)&&c2(l.nodesRef.current,r,!1).some(e=>A0(e.context?.elements.floating,o)))){if(d.handler){d.handler(n);return}g(),h()&&!m()&&a(n)}}function v(n){!l||!u||t()||p.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,y6(S6,n)),l.events.emit(`floating.closed`,n)})}let y=o;return O6(y&&J4(y,`mouseenter`,f),y&&J4(y,`mouseleave`,_),y&&J4(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,h,m,g,d,l,u,p])}var S5={current:null};function C5(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=S5,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:p,shouldOpen:m,guardStaleOpen:h=!1}=t,{dataRef:g,events:_}=e.context,v=p8(l),y=b5(e),b=f.useRef(!1),x=k6(i),S=k6(r),C=k6(o),w=k6(n),T=k6(m),E=k6(p),D=P$(()=>_6(g.current.openEvent?.type,y.interactedInside)),O=P$(()=>T.current?.()!==!1),k=P$((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!A0(t,n);if(!Y1(r))return!1;let a=r;return i.hasMatchingElement(e=>A0(e,a))&&(!t||!A0(t,a))}),A=P$(()=>{y.handler&&=(G2(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=P$(()=>{v5(y)});return u&&(y.handleCloseOptions=i?.__options),f.useEffect(()=>A,[A]),f.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===S6,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),f.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=h6(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,y6(S6,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,y6(S6,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Y1(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!m2(y.pointerType))return;let n=g6(C.current),r=h6(S.current,`open`,y.pointerType),i=M0(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Y1(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(A0(t,i)){c=t;break}}Y1(o)&&Y1(s)&&!e.context.triggerElements.hasElement(o)&&A0(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&Y1(c)&&Y1(s)&&A0(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){O()&&e.setOpen(!0,y6(S6,t,c));return}m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,y6(S6,t,c))}):g&&O()&&e.setOpen(!0,y6(S6,t,c)))}function o(n){if(D()){j();return}A();let r=G2(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!t2(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n);return}(y.pointerType!==`touch`||!A0(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){A0(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=h?J4(r,`mouseout`,l):void 0;return s?O6(J4(r,`mousemove`,i,{once:!0}),J4(r,`mouseenter`,i),J4(r,`mouseleave`,o),f):O6(J4(r,`mouseenter`,i),J4(r,`mouseleave`,o),f)},[A,j,g,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,h]),f.useMemo(()=>{if(!n)return;function t(e){y.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=k(i,r,t.target);if(a&&!m2(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;y5(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=g6(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,y6(S6,n,r))}y.pointerType===`touch`?n8.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}var w5=.1,T5=w5*w5,E5=.5;function D5(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function O5(e,t,n,r,i,a,o,s,c,l){let u=!1;return D5(e,t,n,r,i,a)&&(u=!u),D5(e,t,i,a,o,s)&&(u=!u),D5(e,t,o,s,c,l)&&(u=!u),D5(e,t,c,l,n,r)&&(u=!u),u}function k5(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function A5(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 j5(e={}){let{blockPointerEvents:t=!1}=e,n=new H$,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*T5;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=M0(r),g=r.type===`mouseleave`,_=A0(u,h),v=A0(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Y1(r.relatedTarget)&&A0(u,r.relatedTarget))return;function y(){return!!(s&&c2(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=A5(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=A5(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=A5(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=A5(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!k5(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?E5/2:E5*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+E5+1,o=C||T?S.bottom-E5:S.top,s=C?T?S.bottom-E5:S.top:S.bottom-E5;M=O5(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?E5/2:E5*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-E5,o=C||T?S.top+E5:S.bottom,s=C?T?S.top+E5:S.bottom:S.top+E5;M=O5(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?E5/2:E5*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+E5+1,o=w||E?S.right-E5:S.left,s=w?E?S.right-E5:S.left:S.right-E5;M=O5(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?E5/2:E5*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-E5,o=w||E?S.left+E5:S.right,s=w?E?S.left+E5:S.right:S.left+E5;M=O5(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 M5(e,t,n){let{reference:r,floating:i}=e,a=O2(t),o=k2(t),s=D2(o),c=w2(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=T2(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function N5(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}=C2(t,e),p=V2(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=H2(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=H2(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 P5=50,F5=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:N5},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=M5(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<P5&&(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}=M5(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},I5=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}=C2(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=w2(r),_=O2(o),v=w2(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[z2(o)]:j2(o)),x=p!==`none`;!d&&x&&b.push(...R2(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=A2(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`||_===O2(t)||T.every(e=>O2(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=O2(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{}}}},L5=new Set([`left`,`top`]);async function R5(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=w2(n),s=T2(n),c=O2(n)===`y`,l=L5.has(o)?-1:1,u=a&&c?-1:1,d=C2(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 z5=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 R5(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}}}}},B5=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}=C2(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=O2(i),p=E2(f),m=u[p],h=u[f],g=(e,t)=>S2(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}}}}}},V5=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}=C2(e,t),u={x:n,y:r},d=O2(i),f=E2(d),p=u[f],m=u[d],h=C2(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=L5.has(w2(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}}}},H5=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}=C2(e,t),c=await i.detectOverflow(t,s),l=w2(n),u=T2(n),d=O2(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=g2(p-c[m],g),y=g2(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*_2(c.left,c.right):S=p-2*_2(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 U5(e){let t=l0(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=X1(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=v2(n)!==a||v2(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function W5(e){return Y1(e)?e:e.contextElement}function G5(e){let t=W5(e);if(!X1(t))return b2(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=U5(t),o=(a?v2(n.width):n.width)/r,s=(a?v2(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var K5=b2(0);function q5(e){let t=K1(e);return!s0()||!t.visualViewport?K5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function J5(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===K1(e)}function Y5(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=W5(e),o=b2(1);t&&(r?Y1(r)&&(o=G5(r)):o=G5(e));let s=J5(a,n,r)?q5(a):b2(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=K1(a),t=Y1(r)?K1(r):r,n=e,i=m0(n);for(;i&&t!==n;){let e=G5(i),t=i.getBoundingClientRect(),r=l0(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=K1(i),i=m0(n)}}return H2({width:u,height:d,x:c,y:l})}function X5(e,t){let n=u0(e).scrollLeft;return t?t.left+n:Y5(q1(e)).left+n}function Z5(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-X5(e,n),y:n.top+t.scrollTop}}function Q5(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q1(r),s=t?e0(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=b2(1),u=b2(0),d=X1(r);if((d||!a)&&((G1(r)!==`body`||Q1(o))&&(c=u0(r)),d)){let e=Y5(r);l=G5(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Z5(o,c):b2(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 $5(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function e7(e){let t=u0(e),n=e.ownerDocument.body,r=_2(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=_2(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+X5(e),o=-t.scrollTop;return l0(n).direction===`rtl`&&(a+=_2(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var t7=25;function n7(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=K1(e),a=q1(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!s0()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(X5(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<=t7&&(s-=o)}return{width:s,height:c,x:l,y:u}}function r7(e,t){let n=Y5(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G5(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function i7(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=n7(e,n,t);else if(t===`document`)r=e7(q1(e));else if(Y1(t))r=r7(t,n);else{let n=q5(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return H2(r)}function a7(e,t){let n=t.get(e);if(n)return n;let r=p0(e,[],!1).filter(e=>Y1(e)&&G1(e)!==`body`),i=null,a=l0(e).position===`fixed`,o=a?d0(e):e;for(;Y1(o)&&!c0(o);){let e=l0(o),t=a0(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=d0(o)}return t.set(e,r),r}function Yte(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?e0(t)?[]:a7(t,this._c):[].concat(n),r],o=i7(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=i7(t,a[e],i);s=_2(n.top,s),c=g2(n.right,c),l=g2(n.bottom,l),u=_2(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Xte(e){let{width:t,height:n}=U5(e);return{width:t,height:n}}function Zte(e,t,n){let r=X1(t),i=q1(t),a=n===`fixed`,o=Y5(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=b2(0);if((r||!a)&&((G1(t)!==`body`||Q1(i))&&(s=u0(t)),r)){let e=Y5(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=X5(i));let l=i&&!r&&!a?Z5(i,s):b2(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 o7(e){return l0(e).position===`static`}function s7(e,t){if(!X1(e)||l0(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q1(e)===n&&(n=n.ownerDocument.body),n}function c7(e,t){let n=K1(e);if(e0(e))return n;if(!X1(e)){let t=d0(e);for(;t&&!c0(t);){if(Y1(t)&&!o7(t))return t;t=d0(t)}return n}let r=s7(e,t);for(;r&&$1(r)&&o7(r);)r=s7(r,t);return r&&c0(r)&&o7(r)&&!a0(r)?n:r||o0(e)||n}var Qte=async function(e){let t=this.getOffsetParent||c7,n=this.getDimensions,r=await n(e.floating);return{reference:Zte(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $te(e){return l0(e).direction===`rtl`}var ene={convertOffsetParentRelativeRectToViewportRelativeRect:Q5,getDocumentElement:q1,getClippingRect:Yte,getOffsetParent:c7,getElementRects:Qte,getClientRects:$5,getDimensions:Xte,getScale:G5,isElement:Y1,isRTL:$te};function l7(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tne(e,t,n){let r=null,i,a=q1(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=y2(d),h=y2(a.clientWidth-(u+f)),g=y2(a.clientHeight-(d+p)),_=y2(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:_2(0,g2(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!l7(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=K1(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function u7(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=W5(e),u=i||a?[...l?p0(l):[],...t?p0(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?tne(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?Y5(e):null;c&&g();function g(){let t=Y5(e);h&&!l7(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 nne=z5,rne=B5,ine=I5,ane=H5,one=V5,sne=(e,t,n)=>{let r=new Map,i=n??{},a={...ene,...i.platform,_c:r};return F5(e,t,{...i,platform:a})},d7=typeof document<`u`?f.useLayoutEffect:function(){};function f7(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(!f7(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)&&!f7(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function p7(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function m7(e,t){let n=p7(e);return Math.round(t*n)/n}function h7(e){let t=f.useRef(e);return d7(()=>{t.current=e}),t}function cne(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}),[p,m]=f.useState(r);f7(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),E=c!=null,D=h7(c),O=h7(i),k=h7(l),A=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),sne(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!f7(T.current,t)&&(T.current=t,n8.flushSync(()=>{d(t)}))})},[p,t,n,O,k]);d7(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=f.useRef(!1);d7(()=>(j.current=!0,()=>{j.current=!1}),[]),d7(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=f.useMemo(()=>({reference:x,floating:S}),[x,S]),P=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=m7(N.floating,u.x),r=m7(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...p7(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var lne=(e,t)=>{let n=nne(e);return{name:n.name,fn:n.fn,options:[e,t]}},une=(e,t)=>{let n=rne(e);return{name:n.name,fn:n.fn,options:[e,t]}},dne=(e,t)=>({fn:one(e).fn,options:[e,t]}),fne=(e,t)=>{let n=ine(e);return{name:n.name,fn:n.fn,options:[e,t]}},pne=(e,t)=>{let n=ane(e);return{name:n.name,fn:n.fn,options:[e,t]}},g7=f.createContext(void 0);function _7(e){let t=f.useContext(g7);if(t===void 0&&!e)throw Error(G$(47));return t}var mne={...m5,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!m5.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&m5.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>m5.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},hne=class extends a5{constructor(e,t,n){let r=new Z8;super(gne(e,r,t,n),_ne(r),mne)}setOpen=(e,t)=>{let n=t.reason===S6,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=G8(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=W8(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}),n8.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function gne(e,t,n,r=!1){let i={...c5(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 _ne(e){return{popupRef:f.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:f.createRef(),beforeTriggerFocusGuardRef:f.createRef(),beforeContentFocusGuardRef:f.createRef(),stickIfOpenTimeout:new H$,stickIfOpen:!0,triggerElements:e}}var v7=d6(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=yne(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),p=u.useState(`mounted`),m=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),X8(u,d),q8(u);let{forceUnmount:h}=J8(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:h,close:()=>u.setOpen(!1,y6(D6))}),[h,u]);let g=d||p||s!=null;return(0,J.jsxs)(g7.Provider,{value:u,children:[s&&(0,J.jsx)(V8,{handle:s,store:u}),g&&(0,J.jsx)(bne,{store:u,modal:o}),typeof t==`function`?t({payload:m}):t]})});function vne(e){return _7(!0)?(0,J.jsx)(v7,{props:e}):(0,J.jsx)(g8,{children:(0,J.jsx)(v7,{props:e})})}function yne(e,t){let n=B8((e,n)=>new hne(t,e,n));return f.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function bne({store:e,modal:t}){let n=A8(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Y8(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var xne=f.createContext(void 0);function Sne(e=!1){let t=f.useContext(xne);if(t===void 0&&!e)throw Error(G$(16));return t}function Cne(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 y7(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(K1(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 b7(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=f.useRef(null),s=Sne(!0),c=a??s!==void 0,{props:l}=Cne({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=f.useCallback(()=>{let e=o.current;x7(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return D4(u,[u]),{getButtonProps:f.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return c1({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(v1(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=x7(r),s=!i&&wne(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(),y7(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),y7(r,e)))},onKeyUp(e){if(!t){if(v1(e),a?.(e),e.target===e.currentTarget&&i&&c&&x7(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),y7(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:P$(e=>{o.current=e,u()})}}function x7(e){return X1(e)&&e.tagName===`BUTTON`}function wne(e){return X1(e)&&e.tagName===`A`&&!!e.href}function Tne(e,t){function n(n,r,i){let a=n.currentTarget;n8.flushSync(()=>{e.setOpen(!1,y6(T6,n.nativeEvent,a))}),d4(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&&f4(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Ene(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 S7(e,t){let{onClick:n,onPointerDown:r}=Ene(P$((n,r)=>{(typeof e==`function`?e():e)||t(r||(x0?`touch`:``))}));return f.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var Dne=f6(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:p,...m}=e,h=_7(!0),g=h5(s)??h;if(!g)throw Error(G$(74));let _=I1(p),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=f.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=K8(_,S,g,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=g.useState(`isPressOpenedByTrigger`,_),E=g.useState(`isTouchPressOpen`,l),D=g.useState(`hasTriggerFocusGuards`,_),O=C5(y,{enabled:!a&&l&&!E,mouseOnly:!0,move:!1,handleClose:j5(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),k=D8(y,{stickIfOpen:P$(()=>g.context.stickIfOpen)}),A=S7(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),j=g.useState(`triggerProps`,w),{getButtonProps:M,buttonRef:N}=b7({disabled:a,native:o}),P={open(e){return T?Z0.open(e):X0.open(e)}},{handlePreFocusGuardFocus:F,handleFocusTargetFocus:I}=Tne(g,S),L=x1(`button`,e,{state:{disabled:a,open:b},ref:[N,t,C,S],props:[k.reference,O,j,A,{[$6]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},m,M],stateAttributesMapping:P}),R=(0,J.jsx)(f.Fragment,{children:L},_);return D?(0,J.jsxs)(f.Fragment,{children:[(0,J.jsx)(L6,{ref:g.context.beforeTriggerFocusGuardRef,onFocus:F}),R,(0,J.jsx)(L6,{ref:g.context.triggerFocusTargetRef,onFocus:I})]}):R}),C7=f.createContext(void 0);function One(){let e=f.useContext(C7);if(e===void 0)throw Error(G$(45));return e}var kne=f.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return _7().useState(`mounted`)||n?(0,J.jsx)(C7.Provider,{value:n,children:(0,J.jsx)(s8,{ref:t,...r})}):null});function w7(e){return t1(19)?e:e?`true`:void 0}var T7=f.createContext(void 0);function Ane(){let e=f.useContext(T7);if(!e)throw Error(G$(46));return e}function jne(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),p=p8(n),m=f.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=cne({...e,elements:{...m,...l&&{reference:l}}}),g=f.useCallback(e=>{let t=Y1(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=f.useMemo(()=>({...h.refs,setPositionReference:g,domReference:d}),[h.refs,g]),v=f.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),y=f.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,s,c]);return D4(()=>{o&&(d.current=o)},[o]),D4(()=>{r.context.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),f.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var Mne=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}=C2(e,t)||{};if(l==null)return{};let d=V2(u),f={x:n,y:r},p=k2(i),m=D2(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=S2(D,k,O),j=!c.arrow&&T2(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}}}),Nne=(e,t)=>{let{name:n,fn:r}=Mne(e);return{name:n,fn:r,options:[e,t]}},Pne={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}}}},Fne={sideX:`left`,sideY:`top`},Ine=`--available-width`,Lne=`--available-height`,Rne=`--anchor-width`,zne=`--anchor-height`,Bne=`--transform-origin`,E7=Ine,D7=Lne;function O7(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 k7(e,t,n){let{rects:r,placement:i}=e;return{side:O7(t,w2(i),n),align:T2(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Vne(e){return Hne(e,jne)}function Hne(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:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=P$(k),j=k?A:n,M=k6(n),N=k6(_),P=M4()===`rtl`,[F,I]=f.useState(null);!_&&F!==null&&I(null);let L=S===`placement`,R=F?w2(F):null,z=F&&L?T2(F)||`center`:null,ee=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],te=z||o,ne=te===`center`?ee:`${ee}-${te}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let re=+(i===`bottom`),V=+(i===`top`),H=+(i===`right`),ie=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},oe=f.useRef(null),se=k6(a),ce=k6(s),le=typeof a==`function`?0:a,U=typeof s==`function`?0:s,ue=[];m&&ue.push(m),ue.push(lne(e=>{let t=k7(e,i,P),n=typeof se.current==`function`?se.current(t):se.current,r=typeof ce.current==`function`?ce.current(t):ce.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,U,P,i]));let de=T===`none`&&w!==`shift`,fe=!de&&(u||D||w===`shift`),pe=w===`none`?null:fne({...ae,padding:{top:B.top+1+re,right:B.right+1+ie,bottom:B.bottom+1+V,left:B.left+1+H},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),me=de?null:une({...ae,rootBoundary:O,mainAxis:T!==`none`,crossAxis:fe,limiter:u||D?void 0:dne(e=>{if(!oe.current)return{};let{width:t,height:n}=oe.current.getBoundingClientRect(),r=O2(w2(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[ae,u,D,O,B,T]);w===`shift`||T===`shift`||te===`center`?ue.push(me,pe):ue.push(pe,me),ue.push(pne({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(E7,`${t}px`),i.setProperty(D7,`${n}px`);let a=K1(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(Rne,`${u}px`),i.setProperty(zne,`${d}px`)}}),Nne(e=>({element:oe.current||G2(e.elements.floating).createElement(`div`),padding:oe.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=w2(r),u=T2(r),d=O2(l)===`y`,f=oe.current,p=typeof a==`function`?a(k7(e,i,P)):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 fe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Bne,d?`${m} ${h}`:`${h} ${m}`),{}}},Pne,x),D4(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let he=f.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:ge,elements:_e,x:ve,y:ye,middlewareData:W,update:be,placement:xe,context:Se,isPositioned:Ce,floatingStyles:we}=t({rootContext:g,open:h?_:void 0,placement:ne,middleware:ue,strategy:r,whileElementsMounted:h?void 0:(...e)=>u7(...e,he),nodeId:b,externalTree:C}),{sideX:Te,sideY:Ee}=W.adaptiveOrigin||Fne,De=Ce?r:`fixed`,Oe=f.useMemo(()=>{let e;return e=Ce?x?{position:De,[Te]:ve,[Ee]:ye}:{...we,position:De}:{position:De,top:0,left:0},e[E7]=`100vw`,e[D7]=`100vh`,Ce||(e.opacity=0),e},[x,De,Te,ve,Ee,ye,we,Ce]),ke=f.useRef(null);D4(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(A7(t)?t.current:t)||null;n!==ke.current&&(ge.setPositionReference(n),ke.current=n)},[_,ge,j,M]),f.useEffect(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&A7(e)&&e.current!==ke.current&&(ge.setPositionReference(e.current),ke.current=e.current)},[_,ge,j,M]),f.useEffect(()=>{if(h&&_&&_e.reference&&_e.floating)return u7(_e.reference,_e.floating,be,he)},[h,_,_e,be,he]);let Ae=w2(xe),je=O7(i,Ae,P),Me=T2(xe)||`center`,Ne=!!W.hide?.referenceHidden;D4(()=>{S&&_&&Ce&&(Ae!==ee||L&&Me!==te)&&I(xe)},[S,L,_,Ce,xe,Ae,Me,ee,te]);let Pe=f.useMemo(()=>({position:`absolute`,top:W.arrow?.y,left:W.arrow?.x}),[W.arrow]),Fe=W.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:Oe,arrowStyles:Pe,arrowRef:oe,arrowUncentered:Fe,side:je,align:Me,physicalSide:Ae,anchorHidden:Ne,refs:ge,context:Se,isPositioned:Ce,update:be}),[Oe,Pe,oe,Fe,je,Me,Ae,Ne,ge,Se,Ce,be])}function A7(e){return e!=null&&`current`in e}var j7=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,J.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Une(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=f.useRef(null),o=f.useRef(null),s=F8(r);D4(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),D4(()=>{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 M7(e){return e===`starting`?Q6:z$}function Wne(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),x1(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},M7(r),i],stateAttributesMapping:Q0})}var N7={},P7={},F7=``;function I7(e,t){return Q1(e)?e:t}function L7(e,t,n){return/hidden|clip/.test(e.getComputedStyle(I7(t,n)).overflowY)}function Gne(e){if(typeof document>`u`)return!1;let t=G2(e);return K1(t).innerWidth-t.documentElement.clientWidth>0}function Kne(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=G2(e),n=t.documentElement,r=t.body,i=I7(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 qne(e){let t=G2(e),n=t.documentElement,r=t.body,i=I7(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 Jne(e){let t=G2(e),n=t.documentElement,r=t.body,i=K1(n),a=0,o=0,s=!1,c=N6.create();if(E0&&(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,N7={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},F7=n.style.scrollBehavior,P7={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=I7(n,r);if(s=Kne(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,N7),Object.assign(r.style,P7),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=F7)}function d(){u(),c.request(l)}l();let f=J4(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Yne=new class{lockCount=0;restore=null;timeoutLock=H$.create();timeoutUnlock=H$.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=G2(e),n=t.documentElement,r=t.body,i=K1(n);if(L7(i,n,r)){let t=new i.MutationObserver(()=>{L7(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=x0||!Gne(e);this.restore=a?qne(e):Jne(e)}};function R7(e=!0,t=null){D4(()=>{if(e)return Yne.acquire(t)},[e,t])}var Xne=20;function Zne(e,t,n,r){let[i,a]=f.useState(!1);D4(()=>{if(!e||!t||n==null){a(!1);return}let r=G2(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Xne)},[e,t,n]),R7(e&&(!t||i),r)}var Qne=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=e8,..._}=e,v=_7(),y=One(),b=m8(),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=Vne({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`)});Une({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;Zne(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=Wne(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,J.jsxs)(T7.Provider,{value:j,children:[S&&M&&(0,J.jsx)(j7,{inert:w7(!C),cutout:T}),(0,J.jsx)(h8,{id:b,children:P})]})}),z7=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),$ne=f.createContext(void 0);function ere(e){let t=f.useContext($ne);if(t===void 0&&!e)throw Error(G$(69));return t}var tre=f.createContext(void 0);function nre(){let[e,t]=f.useState(0),n=P$(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:f.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var rre=f.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=_7(),l=Ane(),u=ere(!0)!=null,{context:d,hasClosePart:f}=nre(),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`);I8({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),x5(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?z8(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=x1(`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`,...R8,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&z7.has(e.key)&&e.stopPropagation()}},M7(g),s],stateAttributesMapping:$0});return(0,J.jsx)(E8,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:X1(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,J.jsx)(tre.Provider,{value:d,children:M})})}),B7=`data-glide-stand-in`;function V7(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 H7(e){return{transform:`translate(${String(e.x)}px, ${String(e.y)}px)`,width:`${String(e.width)}px`,height:`${String(e.height)}px`}}function U7(e){let t=(0,f.useRef)(null);return(0,f.useCallback)(n=>{t.current?.(),t.current=n?ire(n,e):null},[e])}function ire(e,t){if(!_P(e))return()=>void 0;let n=e.ownerDocument,r=e.querySelector(t),i=r?V7(e,r):null,a=null,o=null,s=new Set,c=()=>{for(let e of s)e.removeAttribute(B7);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=dP(e),u=V7(e,t),d=o&&a?V7(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(B7,`measure`);let f=getComputedStyle(t),p=f.backgroundColor,m=f.borderRadius;for(let e of[t,n])e&&(e.setAttribute(B7,``),s.add(e));let h=l();h.hidden=!1,h.style.backgroundColor=p,h.style.borderRadius=m;let g=h.animate([H7(d),H7(u)],{duration:r.normal,easing:gP(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 are=(0,f.createContext)(void 0),ore=(0,f.createContext)(null);function W7(e){let t=(0,f.useContext)(ore);return t===null?Object.hasOwn(globalThis,`document`)?document.body:null:t[e]}function sre(e){let t=(0,f.useContext)(are),n=(0,f.useRef)(e);n.current=e,(0,f.useEffect)(()=>t?.(()=>{n.current()}),[t])}function G7({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 cre=(0,f.forwardRef)(function({children:e,className:t,type:n=`button`,...r},i){return(0,J.jsxs)(`button`,{...r,ref:i,type:n,className:Z(`select caps-select caps-combobox-trigger w-full`,t),children:[(0,J.jsx)(`span`,{children:e}),(0,J.jsx)(wL,{className:`caps-select-chevron`,"aria-hidden":`true`})]})});function lre({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:p,trigger:m}){let h=`${a}-listbox`,[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(t),[S,C]=(0,f.useState)(e),w=p??(b===null?[]:[b]),T=m?d??S:!0,E=(0,f.useMemo)(()=>{let e=g.trim().toLowerCase();return e?s.filter(t=>r(t).toLowerCase().includes(e)):s},[r,s,g]),D=G7({getKey:n,isDisabled:o,items:E});(0,f.useEffect)(()=>{if(D.activeKey!==null)return;let e=D.enabledItems.find(e=>w.includes(n(e)))??D.enabledItems[0];e&&D.setActiveKey(n(e))},[D.activeKey,D.enabledItems,D.setActiveKey,n,w]);let O=e=>{y(!1),e||_(``),d===void 0&&C(e),c?.(e)},k=e=>`${h}-option-${encodeURIComponent(e)}`,A=e=>{let t=n(e);p===void 0&&x(t),l(e),m&&!u&&O(!1)},j=e=>{y(!0),_(e.target.value),D.setActiveKey(null)},M=e=>{if(o6(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?(y(!0),e.preventDefault(),D.move(t[0],t[1])):e.key===`Enter`&&D.activeItem&&(e.preventDefault(),A(D.activeItem))},N=(0,f.useMemo)(()=>{if(!i)return[{label:``,items:E}];let e=new Map;for(let t of E){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}))},[E,i]);return{keyboardNavigation:v,onPointerMove:()=>{y(!1)},activeKey:D.activeKey,activeItem:D.activeItem,groups:N,inputValue:g,listboxId:h,onInputChange:j,onInputKeyDown:M,optionId:k,open:T,commit:A,selectedKeys:w,setOpen:O}}function ure(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:p,getLabel:m,getSearchText:h=m,groupBy:g,id:_,inputProps:v,inputRef:y,isDisabled:b=()=>!1,items:x,onOpenChange:S,onValueChange:C,multiple:w,open:T,placeholder:E=`Search…`,renderItem:D,rootRef:O,trigger:k,triggerRef:A,value:j,...M}=e,N=e=>{let t=p(e);if(w){let e=j.includes(t)?j.filter(e=>e!==t):[...j,t];C?.(e,x.filter(t=>e.includes(p(t))))}else C?.(t,e)},P;w?P=j:j!==void 0&&(P=j===null?[]:[j]);let F=(0,f.useId)(),I=k?.props??v,L=_??I?.id??F,R={id:L,"aria-describedby":[t,I?.[`aria-describedby`]].filter(Boolean).join(` `)||void 0,"aria-invalid":n??I?.[`aria-invalid`],"aria-label":I?.[`aria-label`]??r,"aria-labelledby":I?.[`aria-labelledby`]??i,"aria-required":a??I?.[`aria-required`]},{keyboardNavigation:z,onPointerMove:ee,activeItem:te,activeKey:ne,commit:B,groups:re,inputValue:V,listboxId:H,onInputChange:ie,onInputKeyDown:ae,open:oe,optionId:se,selectedKeys:ce,setOpen:le}=lre({defaultOpen:l,defaultValue:u,getKey:p,getSearchText:h,groupBy:g,id:L,isDisabled:b,items:x,onOpenChange:S,onCommit:N,multiple:w??!1,controlledOpen:T,controlledKeys:P,trigger:k});sre(()=>{k&&le(!1)});let U=W7(`popover`),ue=s===void 0?U:s,de=U7(`.caps-combobox-option[data-active="true"]:not(:disabled), [data-navigation="pointer"] .caps-combobox-option:hover:not(:disabled)`),fe=(0,J.jsx)(o3,{...v,...k?{}:R,"aria-activedescendant":te?se(p(te)):void 0,"aria-autocomplete":`list`,"aria-controls":H,"aria-expanded":!0,className:Z(`input-sm`,v?.className),id:k?v?.id??`${L}-input`:L,onChange:e=>{v?.onChange?.(e),ie(e)},onKeyDown:e=>{v?.onKeyDown?.(e),e.defaultPrevented||ae(e)},placeholder:v?.placeholder??E,ref:y,role:`combobox`,value:V}),pe=(0,J.jsx)(`div`,{id:H,ref:de,className:`caps-combobox-list`,"data-navigation":z?`keyboard`:`pointer`,onPointerMove:ee,role:`listbox`,"aria-multiselectable":w??void 0,children:re.every(e=>e.items.length===0)?(0,J.jsx)(`div`,{className:`px-md py-md text-sm text-base-content`,children:d}):re.map(e=>(0,J.jsxs)(`div`,{"aria-label":e.label||void 0,role:e.label?`group`:void 0,children:[e.label?(0,J.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=p(e),n=b(e),r=ne===t,i={active:r,disabled:n,selected:ce.includes(t)};return(0,J.jsxs)(`button`,{"aria-disabled":n||void 0,"aria-selected":i.selected,className:`caps-combobox-option`,"data-active":r&&z,disabled:n,id:se(t),onClick:()=>{B(e)},onMouseDown:e=>{e.preventDefault()},role:`option`,tabIndex:-1,type:`button`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`caps-combobox-check`,children:i.selected?(0,J.jsx)(CL,{}):null}),D?.(e,r,i)??m(e)]},t)})]},e.label))});return k?(0,J.jsx)(`div`,{...M,className:Z(M.className),ref:O,children:(0,J.jsxs)(vne,{modal:!0,onOpenChange:le,open:oe,children:[(0,J.jsx)(Dne,{...R,"aria-haspopup":`dialog`,className:`btn`,ref:A,render:k}),ue===null?null:(0,J.jsx)(kne,{container:ue,children:(0,J.jsx)(Qne,{align:`start`,side:`bottom`,sideOffset:4,children:(0,J.jsxs)(rre,{"data-active-tone":o,className:Z(`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,J.jsx)(`div`,{className:`caps-combobox-search`,children:fe}),pe]})})})]})}):(0,J.jsx)(`div`,{...M,className:Z(M.className),ref:O,children:(0,J.jsxs)(`div`,{className:Z(`caps-combobox-panel`,c),"data-active-tone":o,children:[(0,J.jsx)(`div`,{className:`caps-combobox-search`,children:fe}),pe]})})}function K7({icon:e,caption:t}){return(0,J.jsxs)(`span`,{className:`caps-icon-choice-mark`,"aria-hidden":`true`,children:[(0,J.jsx)(`span`,{className:`caps-icon-choice-art`,children:e}),t?(0,J.jsx)(`span`,{className:`caps-icon-choice-caption`,children:t}):null,(0,J.jsx)(`span`,{className:`caps-icon-choice-lamp`})]})}var dre=(0,f.forwardRef)(function({label:e,icon:t,caption:n,appearance:r,className:i,...a},o){return(0,J.jsx)(`label`,{className:`caps-icon-choice`,"data-appearance":r===`compact`?r:void 0,children:(0,J.jsx)(i6,{...a,appearance:r??`default`,"aria-label":e,className:Z(`caps-icon-choice-input`,i),indicator:(0,J.jsx)(K7,{icon:t,caption:n}),ref:o})})});function fre({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=fP(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=n3(o,{ease:`outCubic`,duration:75}),c=e?t3(o,{bounce:.65,duration:300}):n3(o,{ease:`inCubic`,duration:100}),l=$I(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,J.jsxs)(`svg`,{ref:a,className:`caps-radio-visual`,width:`24`,height:`24`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsx)(rL,{id:`${t}-surface`,transform:`matrix(1 0 0 1 6 6)`}),(0,J.jsx)(iL,{id:`${t}-shadow`}),(0,J.jsx)(aL,{id:`${t}-inset`}),(0,J.jsx)(`clipPath`,{id:`${t}-well`,children:(0,J.jsx)(`circle`,{cx:`6`,cy:`6`,r:`5`})})]}),(0,J.jsx)(`circle`,{className:`caps-radio-track`,cx:`6`,cy:`6`,r:`5.5`,filter:`url(#${t}-inset)`}),(0,J.jsx)(`g`,{clipPath:`url(#${t}-well)`,children:(0,J.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 q7=(0,f.createContext)(null),pre=(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 p=i??`radio-group-${u}`,[m,h]=(0,f.useState)(n),g=s??m;return(0,f.useEffect)(()=>{let e=d.current?.form;if(!e||s!==void 0)return;let t=e=>{queueMicrotask(()=>{e.defaultPrevented||h(n)})};return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[s,n,c.form]),(0,J.jsx)(q7.Provider,{value:{disabled:r,name:p,onValueChange:e=>{s===void 0&&h(e),a?.(e)},value:g},children:(0,J.jsx)(`fieldset`,{...c,className:Z(`flex gap-md`,o===`horizontal`?`flex-row flex-wrap`:`flex-col`,t),disabled:r,role:c.role??`radiogroup`,ref:d,children:e})})}),J7=(0,f.forwardRef)(function({className:e,indicator:t,onChange:n,onClick:r,value:i,...a},o){let s=(0,f.useContext)(q7);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,J.jsxs)(`span`,{className:`caps-radio`,"data-checked":c,"data-custom-indicator":t!==void 0||void 0,children:[(0,J.jsx)(`input`,{...a,"aria-checked":c,checked:c,className:Z(`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,J.jsx)(fre,{checked:c}):t]})}),mre=(0,f.forwardRef)(function({description:e,id:t,meta:n,title:r,...i},a){let o=(0,f.useContext)(q7),s=(0,f.useId)(),c=t??s,l=o?.value===i.value,u=o?.disabled===!0||i.disabled===!0;return(0,J.jsxs)(`label`,{className:`caps-choice-card`,"data-checked":l,"data-disabled":u||void 0,htmlFor:c,children:[(0,J.jsx)(J7,{...i,"aria-describedby":e?`${c}-description`:void 0,"aria-labelledby":`${c}-title`,id:c,ref:a}),(0,J.jsxs)(`span`,{className:`caps-choice-card-copy`,children:[(0,J.jsx)(`span`,{className:`caps-choice-card-title`,id:`${c}-title`,children:r}),e?(0,J.jsx)(`span`,{className:`caps-choice-card-description`,id:`${c}-description`,children:e}):null]}),n?(0,J.jsx)(`span`,{className:`caps-choice-card-meta`,children:n}):null]})}),hre=(0,f.forwardRef)(function({label:e,icon:t,caption:n,className:r,...i},a){return(0,J.jsx)(`label`,{className:`caps-icon-choice`,children:(0,J.jsx)(J7,{...i,"aria-label":e,className:Z(`caps-icon-choice-input`,r),indicator:(0,J.jsx)(K7,{icon:t,caption:n}),ref:a})})});function gre({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=SP();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=dP(n.current),c=t3(s,{bounce:.25,duration:440}),l=n3(s,{ease:`inOutSine`,duration:100}),u=$I(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=$I(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,J.jsxs)(`svg`,{className:`caps-switch-visual`,width:`40`,height:`24`,viewBox:`0 0 20 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsx)(rL,{ref:r,id:`${t}-surface`,transform:i?`matrix(2 0 0 1 10 6)`:`matrix(1 0 0 1 6 6)`}),(0,J.jsx)(iL,{id:`${t}-shadow`}),(0,J.jsx)(aL,{id:`${t}-inset`}),(0,J.jsx)(`clipPath`,{id:`${t}-track`,children:(0,J.jsx)(`rect`,{x:`1`,y:`1`,width:`18`,height:`10`,rx:`5`})})]}),(0,J.jsx)(`rect`,{className:`caps-switch-track`,filter:`url(#${t}-inset)`,x:`0.5`,y:`0.5`,width:`19`,height:`11`,rx:`5.5`}),(0,J.jsx)(`g`,{clipPath:`url(#${t}-track)`,children:(0,J.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 _re=(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,J.jsxs)(`span`,{className:`caps-switch`,"data-checked":u,children:[(0,J.jsx)(`input`,{...a,checked:u,className:Z(`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,J.jsx)(gre,{checked:u})]})}),Y7=(0,f.forwardRef)(function({className:e,invalid:t,...n},r){return(0,J.jsx)(`textarea`,{...n,"aria-invalid":t?!0:n[`aria-invalid`]===!1?void 0:n[`aria-invalid`],className:Z(`textarea textarea-bordered w-full`,t&&`textarea-error`,e),ref:r})}),vre=XS(oC),yre=XS(cC),bre=XS(hC(TC)),xre=XS(dC(oC)),X7=dC(yC(File)),Sre=XS(X7),Z7=pC([oC,TC,cC,iC,aC,dC(oC),X7]),Cre=XS(Z7),Q7=e=>gp(vre(e.state.value),()=>``),$7=e=>gp(yre(e.state.value),()=>!1),wre=e=>gp(bre(e.state.value),()=>null),Tre=e=>gp(xre(e.state.value),()=>[]),Ere=e=>gp(Sre(e.state.value),()=>[]),Dre=e=>gp(Cre(e.state.value),()=>null);function Ore({field:e,spec:t,locked:n,...r}){let[i,a]=(0,f.useState)(!1);return(0,J.jsxs)(x3,{children:[(0,J.jsx)(o3,{...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:Q7(e),onBlur:e.handleBlur,onChange:t=>{e.handleChange(t.currentTarget.value)}}),(0,J.jsx)(mL,{type:`button`,variant:`outline`,size:`icon`,"aria-label":i?`Hide`:`Show`,"aria-pressed":i,disabled:n,onClick:()=>{a(e=>!e)},children:i?(0,J.jsx)(Vte,{"aria-hidden":`true`}):(0,J.jsx)(Hte,{"aria-hidden":`true`})})]})}var kre={text:`text`,email:`email`,url:`url`,tel:`tel`};function Are({spec:e,field:t,locked:n,...r}){let i=Ere(t),a=n||e.readOnly===!0,o=(0,f.useRef)(null);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[(0,J.jsx)(CP,{asChild:!0,children:(0,J.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,J.jsx)(mL,{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,J.jsx)(X3,{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 jre({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,J.jsx)(o3,{...a,type:kre[e.kind],inputMode:e.kind===`text`?void 0:e.kind,autoComplete:e.autoComplete,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:Q7(t),onChange:e=>{i(e.currentTarget.value)}});case`textarea`:return(0,J.jsx)(Y7,{...a,rows:e.rows??3,placeholder:e.placeholder,maxLength:e.maxLength,readOnly:e.readOnly,value:Q7(t),onChange:e=>{i(e.currentTarget.value)}});case`secret`:return(0,J.jsx)(Ore,{...r,field:t,spec:e,locked:n});case`money`:return(0,J.jsxs)(x3,{children:[(0,J.jsx)(S3,{className:`caps-field-currency`,children:e.currency??`USD`}),(0,J.jsx)(o3,{...a,inputMode:`decimal`,autoComplete:`off`,className:`caps-field-amount`,placeholder:e.placeholder??`0.00`,readOnly:e.readOnly,value:Q7(t),onChange:e=>{i(e.currentTarget.value)}})]});case`date`:return(0,J.jsx)(o3,{...a,type:`date`,readOnly:e.readOnly,value:Q7(t),onChange:e=>{i(e.currentTarget.value)}});case`number`:return(0,J.jsx)(L3,{...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:wre(t),onValueChange:e=>{t.handleChange(e)}});case`select`:return(0,J.jsxs)(s3,{...a,value:Q7(t),onChange:e=>{i(e.currentTarget.value)},children:[e.placeholder===void 0?null:(0,J.jsx)(`option`,{value:``,disabled:!0,children:e.placeholder}),e.options.map(e=>(0,J.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]});case`combobox`:return(0,J.jsx)(ure,{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:Q7(t),...e.placeholder===void 0?{}:{placeholder:e.placeholder},trigger:(0,J.jsx)(cre,{name:e.name,disabled:n||e.readOnly===!0,onBlur:t.handleBlur,children:e.options.find(e=>e.value===Q7(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,J.jsx)(Are,{...r,spec:e,field:t,locked:n});case`checkbox`:return(0,J.jsx)(i6,{...a,disabled:n||e.readOnly===!0,checked:$7(t),onChange:e=>{t.handleChange(e.currentTarget.checked)}});case`switch`:return(0,J.jsx)(_re,{...a,disabled:n||e.readOnly===!0,checked:$7(t),onCheckedChange:e=>{t.handleChange(e)}});case`radio`:case`icon-radio`:case`checkboxes`:case`icon-checkboxes`:return null}}var Mre=new Set([`radio`,`icon-radio`,`checkboxes`,`icon-checkboxes`]);function Nre({spec:e,field:t,locked:n,error:r}){let i=n||e.readOnly===!0,a=e.label;if(e.kind===`checkboxes`||e.kind===`icon-checkboxes`){let n=Tre(t),o=(e,r)=>{t.handleChange(r?[...n,e]:n.filter(t=>t!==e))};return(0,J.jsx)(A3,{legend:a,description:e.help,disabled:i,error:r??null,children:e.kind===`icon-checkboxes`?(0,J.jsx)(`div`,{className:`caps-field-icon-choices`,children:e.options.map(r=>(0,J.jsx)(dre,{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=>{o(r.value,e.currentTarget.checked)}},r.value))}):e.options.map(r=>(0,J.jsx)(M3,{label:r.label,description:r.description,orientation:`inline`,children:(0,J.jsx)(i6,{name:e.name,value:r.value,disabled:r.disabled,checked:n.includes(r.value),onBlur:t.handleBlur,onChange:e=>{o(r.value,e.currentTarget.checked)}})},r.value))})}let o=e.options.some(e=>e.description!==void 0||e.meta!==void 0);return(0,J.jsx)(A3,{legend:a,description:e.help,disabled:i,error:r??null,children:(0,J.jsx)(pre,{name:e.name,"aria-label":a,value:Q7(t),onValueChange:e=>{t.handleChange(e),t.handleBlur()},orientation:e.kind===`icon-radio`||o?`horizontal`:`vertical`,children:e.options.map(t=>e.kind===`icon-radio`?(0,J.jsx)(hre,{value:t.value,label:t.label,...t.caption===void 0?{}:{caption:t.caption},icon:t.icon,disabled:t.disabled},t.value):o?(0,J.jsx)(mre,{value:t.value,title:t.label,description:t.description,meta:t.meta,disabled:t.disabled},t.value):(0,J.jsx)(M3,{label:t.label,orientation:`inline`,children:(0,J.jsx)(J7,{value:t.value,disabled:t.disabled})},t.value))})})}function Pre({spec:e,field:t,locked:n,error:r,render:i,...a}){return i({name:e.name,label:e.label,help:e.help,value:Dre(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 Fre({form:e,spec:t,locked:n}){let r=v$({form:e,name:t.name}),i=g$(e.store,e=>e.submissionAttempts>0),a=r.state.meta.isBlurred||i?y3(r.state.meta):void 0;if(t.render===void 0&&Mre.has(t.kind))return(0,J.jsx)(Nre,{spec:t,field:r,locked:n,error:a});let o=t.kind===`checkbox`?`inline`:(t.layout??(t.kind===`switch`?`row`:`stacked`))===`row`?`horizontal`:`vertical`;return(0,J.jsx)(M3,{label:t.label,description:t.help,icon:t.icon,orientation:o,error:a,...t.required===void 0?{}:{required:t.required},...t.optional===void 0?{}:{optional:t.optional},children:t.render===void 0?(0,J.jsx)(jre,{spec:t,field:r,locked:n}):(0,J.jsx)(Pre,{spec:t,field:r,locked:n,error:a,render:t.render})})}var Ire=XS(uC(oC,Z7));function e9({form:e,spec:t,locked:n}){let r=t.when;return g$(e.store,e=>r===void 0||r(gp(Ire(e.values),()=>({}))))?(0,J.jsx)(Fre,{form:e,spec:t,locked:n}):null}function Lre({form:e,section:t,locked:n}){let r=t.fields.map(t=>(0,J.jsx)(e9,{form:e,spec:t,locked:n},t.name));return t.title===void 0?r:(0,J.jsx)(k3,{title:t.title,description:t.description,children:r})}function Rre({model:e,names:t,disabled:n=!1}){let r=e.form;return t===void 0?e.description.sections.map(e=>(0,J.jsx)(Lre,{form:r,section:e,locked:n},e.id??``)):t.map(t=>{let i=e.description.fields.find(e=>e.name===t);return i===void 0?null:(0,J.jsx)(e9,{form:r,spec:i,locked:n},t)})}var t9=class{annotation;constructor(e){this.annotation=e}},zre=class{sections;constructor(e){this.sections=e}},n9=`caps/form`,r9=0;function i9(e){r9+=1;let t={[`${n9}:${String(r9)}`]:new t9(e)};return e.label!==void 0&&(t.title=e.label),e.help!==void 0&&(t.description=e.help),t}oC.annotate(i9({kind:`secret`})).pipe(_C(`Secret`));var a9=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 Bre(e){return Object.values(e??{}).reduce((e,t)=>t instanceof t9?{...e,...t.annotation}:e,{})}function o9(e){return e.reduce((e,t)=>({...e,...Bre(t)}),{})}function s9(e){let t=e?.[n9];return t instanceof zre?t.sections:{}}var c9=XS(oC);function l9(e){if(Hv(e))return hp(c9(e.literal),{onNone:()=>null,onSome:e=>[e]});if(!Kv(e))return null;let t=[];for(let n of e.types){if(Lv(n))continue;let e=l9(n);if(e===null)return null;t.push(...e)}return t}function u9(e){if(zv(e))return{type:`string`,literals:[]};if(Bv(e))return{type:`number`,nullable:!1};if(Vv(e))return{type:`boolean`};let t=l9(e);if(t!==null)return{type:`string`,literals:t};if(Wv(e)){let[t]=e.rest;if(t===void 0)return null;if(zv(t))return{type:`strings`,literals:[]};let n=l9(t);return n===null?null:{type:`strings`,literals:n}}if(Kv(e)){let t=e.types.filter(e=>!Lv(e)&&!Iv(e)),n=e.types.some(e=>Iv(e)),[r]=t;if(t.length!==1||r===void 0)return null;let i=u9(r);return i?.type===`number`?{type:`number`,nullable:n}:n?null:i}return null}function Vre(e){let t=e.ast;if(!Gv(t))throw Error(`A schema form needs a Schema.Struct.`);return{fields:t.propertySignatures.map(e=>{let t=String(e.name),n=Nb(e.type),r=o9([e.type.annotations,...(e.type.checks??[]).map(e=>e.annotations)]),i=r.kind===`file`?{type:`files`}:u9(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:Zb(e.type),description:Qb(e.type)}}),sections:s9(Xb(t))}}function d9(e){let t=e,n=!1,r=!1;for(;;)if(t instanceof fs)n=!0,t=t.unwrap();else if(t instanceof gs)r=!0,t=t.unwrap();else if(t instanceof vs)t=t.unwrap();else if(t instanceof Es)t=t.in;else return{node:t,optional:n,nullable:r}}function f9(e){if(e instanceof Xo){let t=e.options.map(e=>f9(e));return t.some(e=>e===null)?null:t.flatMap(e=>e??[])}let t=e instanceof os?e.options:e instanceof cs?[...e.values]:null;if(t===null)return null;let n=t.map(e=>c9(e));return n.every(mp)?n.map(e=>e.value):null}function Hre(e){let{node:t,nullable:n}=d9(e);if(t instanceof so)return{type:`string`,literals:[]};if(t instanceof jo)return{type:`number`,nullable:n};if(t instanceof Fo)return{type:`boolean`};let r=f9(t);if(r!==null)return{type:`string`,literals:r};if(t instanceof Go){let e=d9(t.element).node;if(e instanceof so)return{type:`strings`,literals:[]};let n=f9(e);return n===null?null:{type:`strings`,literals:n}}return null}function p9(e){let t=[e];for(;;){let e=t[t.length-1];if(e===void 0)break;let n=e instanceof fs||e instanceof gs||e instanceof vs?e.unwrap():e instanceof Es?e.in:e;if(n===e)break;t.push(n)}return t.reverse().map(e=>Xr.get(e))}function m9(e){return p9(e).reduce((e,t)=>({...e,...t}),{})}function Ure(e){return Object.entries(e.shape)}function Wre(e){let t=d9(e).node;if(!(t instanceof qo))throw Error(`A schema form needs a z.object.`);return{fields:Ure(t).map(([e,t])=>{let n=o9(p9(t)),r=n.kind===`file`?{type:`files`}:Hre(t);if(r===null)throw Error(`Schema field "${e}" has no form control. Annotate it with field({ render }) or a kind.`);let i=m9(t);return{name:e,valueType:r,optional:d9(t).optional,annotation:n,title:i.title,description:i.description}}),sections:s9(m9(e))}}function Gre(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??a9(e),description:r.description,meta:r.meta,icon:r.icon,caption:r.caption,disabled:r.disabled===!0}})}function Kre(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 qre(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 Jre(e){let t=e instanceof ao?Wre(e):Vre(e),n=t.fields.map((e,t)=>{let{kind:n,...r}=e.annotation,i=Gre(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??a9(e.name),help:a,kind:n??Kre(e.valueType,i),options:i,optionalInSchema:e.optional,index:t}}),r={};t.fields.forEach((e,t)=>{let i=n[t];i&&(r[e.name]=qre(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 h9(e){let t=e instanceof ao?e:qS(e);return{"~standard":{...t[`~standard`],validate:e=>{let n=t[`~standard`].validate(e);return n instanceof Promise?n.then(e=>g9(e)):g9(n)}}}}function g9(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 _9=`onServer`;function Yre(e){return e.state.meta.errorMap.onServer!==void 0}function Xre(e){e.setMeta(e=>({...e,errorMap:{...e.errorMap,[_9]:void 0}}))}function Zre(e,t,n){e.setFieldMeta(t,e=>({...e,isBlurred:!0,errorMap:{...e.errorMap,[_9]:n}}))}function v9(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);MQ(a,e.defaultValues)||(o(e.defaultValues),c(null));let{schema:l}=e,u=(0,f.useMemo)(()=>Jre(l),[l]),d=(0,f.useMemo)(()=>h9(l),[l]),p=E$({defaultValues:s??a,validators:{onChange:d,onSubmit:d},listeners:{onChange:({fieldApi:e})=>{n(null),i(null),Yre(e)&&Xre(e)}},onSubmit:async({value:t,formApi:r})=>{n(null),i(null);let a=await h9(l)[`~standard`].validate(t);if(a.issues){n(a.issues[0]?.message??`Check the form and try again.`);return}let o=await e.onSubmit(a.value,t)??{kind:`saved`};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&&Zre(e,t,n);return}let s=o.values??t;c(s),r.reset(s),i(o.message??`Saved`)}});return{description:u,form:p,error:t,saved:r,discard:()=>{n(null),i(null),p.reset()},submit:()=>p.handleSubmit()}}function y9(e){return{dirty:g$(e.form.store,e=>!e.isDefaultValue),submitting:g$(e.form.store,e=>e.isSubmitting),canSubmit:g$(e.form.store,e=>e.canSubmit)}}function b9({model:e,submitLabel:t=`Save changes`,discardLabel:n,allowClean:r,footer:i,children:a,disabled:o=!1,...s}){let{submitting:c}=y9(e);return(0,J.jsxs)(D3,{...s,busy:c,noValidate:!0,onSubmit:t=>{t.preventDefault(),e.form.state.isSubmitting||e.submit()},children:[a??(0,J.jsx)(Rre,{model:e,disabled:o}),i===void 0?(0,J.jsx)(eie,{model:e,label:t,...n===void 0?{}:{discardLabel:n},...r===void 0?{}:{allowClean:r}}):i]})}function Qre({schema:e,defaultValues:t,onSubmit:n,...r}){let i=v9({schema:e,defaultValues:t,onSubmit:n});return(0,J.jsx)(b9,{...r,model:i})}function $re(e){return`model`in e?(0,J.jsx)(b9,{...e}):(0,J.jsx)(Qre,{...e})}function eie({model:e,label:t,discardLabel:n,allowClean:r=!1,dirtyLabel:i=`Unsaved changes`,buttonProps:a,...o}){let{dirty:s,submitting:c,canSubmit:l}=y9(e),u=c?null:e.saved&&!s?(0,J.jsx)(q3,{tone:`success`,size:`compact`,label:e.saved}):s?(0,J.jsx)(q3,{tone:`neutral`,size:`compact`,label:i}):null;return(0,J.jsxs)(E3,{...o,error:e.error,status:u,children:[n&&s?(0,J.jsx)(mL,{type:`button`,variant:`ghost`,disabled:c,onClick:e.discard,children:n}):null,(0,J.jsx)(mL,{...a,type:`submit`,loading:c,disabled:c||!l||!s&&!r,children:t})]})}var x9=f.createContext(void 0);function S9(e){let t=f.useContext(x9);if(!e&&t===void 0)throw Error(G$(27));return t}var tie=f.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=S9(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return x1(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:$0,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),nie=f.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=S9(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=b7({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,y6(w6,e.nativeEvent))}return x1(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),rie=f.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=S9(),c=I1(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),x1(`p`,e,{ref:t,props:[{id:c},o]})}),C9=f.createContext(void 0);function iie(){let e=f.useContext(C9);if(e===void 0)throw Error(G$(26));return e}var aie=`--nested-dialogs`,oie=`data-nested-dialog-open`,sie={...Q0,...z0,nestedDialogOpen(e){return e?{[oie]:``}:null}},cie=f.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=S9(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);iie(),I8({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?z8(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=x1(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...R8,hidden:!m,onKeyDown(e){z7.has(e.key)&&e.stopPropagation()},style:{[aie]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:sie});return(0,J.jsx)(E8,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),lie=f.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=S9(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,J.jsx)(C9.Provider,{value:n,children:(0,J.jsxs)(s8,{ref:t,...r,children:[a&&o===!0&&(0,J.jsx)(j7,{ref:i.context.internalBackdropRef,inert:w7(!s)}),e.children]})}):null});function uie({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=f.useState(0),[d,p]=f.useState(0),m=l===0,h=A8(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=M0(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||A0(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return R7(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{!e.select(`open`)&&!e.select(`mounted`)||(u(t),p(n))}),D4(()=>{!r&&!i&&(u(0),p(0))},[r,i]),D4(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Y8(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var die={...m5,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},fie=class extends a5{constructor(e,t,n){let r=new Z8,i=pie(e,r,t,n);super(i,mie(r),die)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(W8(this.state,e,t.trigger)))}};function pie(e,t,n,r=!1){return{...c5(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function mie(e){return{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function hie(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:p=null}=t,m=e===`drawer`,h=e===`alert-dialog`,g=h?!0:c,_=h||s,v=h?`alertdialog`:`dialog`,y=S9(!0),b={modal:g,disablePointerDismissal:_,nested:y!=null,role:v},x=B8((e,t)=>new fie({open:i,openProp:r,activeTriggerId:p,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);X8(x,S),q8(x);let{forceUnmount:T}=J8(S,x);f.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,y6(D6))}),[T,x]);let E=S||C||u!=null;return(0,J.jsxs)(x9.Provider,{value:x,children:[u&&(0,J.jsx)(V8,{handle:u,store:x}),E&&(0,J.jsx)(uie,{store:x,parentContext:y?.context,isDrawer:m}),typeof n==`function`?n({payload:w}):n]})}var gie=d6(function(e){return hie(`dialog`,e)}),_ie=f.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=S9(),c=I1(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),x1(`h2`,e,{ref:t,props:[{id:c},o]})}),vie=f6(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=S9(!0),p=h5(l)??d;if(!p)throw Error(G$(79));let m=I1(s),h=p.useState(`floatingRootContext`),g=p.useState(`isOpenedByTrigger`,m),_=p.useState(`triggerPopupId`,m),v=f.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=K8(m,v,p,{payload:c}),{getButtonProps:x,buttonRef:S}=b7({disabled:a,native:o}),C=D8(h),w=S7(()=>p.select(`open`),e=>{p.set(`openMethod`,e)}),T={disabled:a,open:g},E=p.useState(`triggerProps`,b);return x1(`button`,e,{state:T,ref:[S,t,y,v],props:[C.reference,E,w,{[$6]:``,id:m,"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":_},u,x],stateAttributesMapping:X0})}),w9=(0,f.createContext)(null);function yie({children:e,interactionOwner:t=`local`,modal:n=!0,onOpenChange:r,...i}){return(0,J.jsx)(w9.Provider,{value:{interactionOwner:t,modal:n},children:(0,J.jsx)(gie,{...i,modal:n,onOpenChange:(e,n)=>{if(t===`host`&&!e&&n.reason===`escape-key`){n.cancel(),n.allowPropagation();return}r?.(e,n)},children:e})})}function T9(){let e=(0,f.useContext)(w9);if(!e)throw Error(`Dialog parts must be used inside <Dialog>`);return e}(0,f.forwardRef)(function({className:e,type:t=`button`,...n},r){return(0,J.jsx)(vie,{...n,className:t=>Z(`btn`,cP(e,t)),ref:r,type:t})});var bie=(0,f.forwardRef)(function({container:e,...t},n){let r=W7(`dialog`);return e==null&&r===null?null:(0,J.jsx)(lie,{...t,container:e??r,ref:n})}),xie=(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(tie,{...t,ref:n,className:t=>Z(`caps-dialog-backdrop fixed inset-0 bg-black/40`,cP(e,t))})}),Sie=(0,f.forwardRef)(function({className:e,finalFocus:t,...n},r){let i=T9();return(0,J.jsx)(cie,{...n,className:t=>Z(`caps-dialog-popup max-h-screen w-11/12 max-w-(--container-lg) overflow-y-auto overscroll-contain rounded-box bg-base-100 p-lg text-base-content shadow-xl`,cP(e,t)),finalFocus:i.interactionOwner===`host`?!1:t??!0,ref:r})}),Cie=(0,f.forwardRef)(function({container:e,keepMounted:t=!0,className:n,...r},i){let{modal:a}=T9();return(0,J.jsxs)(bie,{container:e,keepMounted:t,children:[a===!0?(0,J.jsx)(xie,{}):null,(0,J.jsx)(Sie,{...r,className:e=>Z(`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,cP(n,e)),ref:i})]})});function wie({className:e,...t}){return(0,J.jsx)(`div`,{...t,className:Z(`flex justify-end gap-sm`,e)})}function Tie({className:e,...t}){return(0,J.jsx)(`div`,{...t,className:Z(`flex flex-col gap-sm`,e)})}var Eie=(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(_ie,{...t,className:t=>Z(`text-lg font-semibold`,cP(e,t)),ref:n})});(0,f.forwardRef)(function({className:e,...t},n){return(0,J.jsx)(rie,{...t,className:t=>Z(`text-sm text-base-content`,cP(e,t)),ref:n})});var Die=(0,f.forwardRef)(function({className:e,type:t=`button`,...n},r){return(0,J.jsx)(nie,{...n,className:t=>Z(`btn btn-ghost`,cP(e,t)),ref:r,type:t})});function Oie({items:e,openId:t,onOpenChange:n,leading:r,trailing:i,placement:a=`housing`,align:o=`end`,hostInset:s,className:c,...l}){let u=(0,f.useId)(),d=(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)(()=>{s===void 0?d.current?.style.removeProperty(`--caps-status-tray-host-inset`):d.current?.style.setProperty(`--caps-status-tray-host-inset`,`${String(Math.max(0,s))}px`)},[s]),(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&&!d.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,J.jsxs)(m3,{...l,ref:d,className:Z(`caps-status-tray`,c),"data-placement":a,"data-align":o,children:[h?(0,J.jsxs)(h3,{open:!0,ref:p,tabIndex:-1,side:`top`,id:`${u}-${h.id}`,role:`dialog`,"aria-labelledby":`${u}-title`,className:`caps-status-tray-panel`,"data-status-tray-panel":h.id,children:[(0,J.jsxs)(`div`,{className:`caps-status-tray-head`,children:[h.tone?(0,J.jsx)(q3,{size:`compact`,tone:h.tone,glyph:h.glyph??`dot`}):null,(0,J.jsx)(`span`,{id:`${u}-title`,className:`caps-status-tray-title`,children:h.title??h.label}),h.actions,(0,J.jsx)(gL,{"aria-label":`Close tray`,icon:(0,J.jsx)(kL,{"aria-hidden":`true`}),onClick:_})]}),(0,J.jsx)(`div`,{className:`caps-status-tray-body`,children:h.content})]}):null,a===`host`?null:(0,J.jsxs)(`div`,{className:`caps-status-tray-row`,children:[r,(0,J.jsx)(`div`,{className:`caps-status-tray-chips`,children:e.map(e=>(0,J.jsxs)(f.Fragment,{children:[(0,J.jsxs)(`button`,{ref:t=>{t?m.current.set(e.id,t):m.current.delete(e.id)},type:`button`,className:`caps-status-tray-chip`,"aria-expanded":g===e.id,"aria-controls":g===e.id?`${u}-${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:[e.tone?(0,J.jsx)(q3,{size:`compact`,glyph:e.glyph??`dot`,motion:e.motion??`none`,tone:e.tone}):null,(0,J.jsx)(`span`,{className:`caps-status-tray-label`,children:e.label}),e.count!==void 0&&e.count>0?(0,J.jsx)(`span`,{className:`caps-status-tray-count`,children:e.count}):null]}),e.after]},e.id))}),i]})]})}function kie({children:e,className:t,...n}){return(0,J.jsx)(`div`,{...n,className:Z(`caps-status-tray-list`,t),children:e})}function E9({icon:e,primary:t,secondary:n,actions:r,className:i,...a}){return(0,J.jsxs)(`div`,{...a,className:Z(`caps-status-tray-item`,i),children:[e?(0,J.jsx)(`span`,{className:`caps-status-tray-icon`,children:e}):null,(0,J.jsxs)(`span`,{className:`caps-status-tray-text`,children:[(0,J.jsx)(`span`,{className:`caps-status-tray-primary`,children:t}),n?(0,J.jsx)(`span`,{className:`caps-status-tray-secondary`,children:n}):null]}),r?(0,J.jsx)(`span`,{className:`caps-status-tray-actions`,children:r}):null]})}function D9({children:e=`All caught up.`,title:t}){return(0,J.jsxs)(`div`,{className:`caps-status-tray-note`,children:[t?(0,J.jsx)(`strong`,{className:`caps-status-tray-note-title`,children:t}):null,(0,J.jsx)(`p`,{children:e})]})}var O9={error:0,warning:1,info:2};function Aie(e,t){let n=t.generating+t.uploading>0;if(n)return{busy:n,glyph:`dot`,tone:`accent`,label:[t.generating?`Creating ${String(t.generating)}`:``,t.uploading?`Uploading ${String(t.uploading)}`:``].filter(Boolean).join(` · `)};let r=[...e].sort((e,t)=>Number(t.blocking??!1)-Number(e.blocking??!1)||O9[e.tone]-O9[t.tone]).at(0);return r?{busy:n,glyph:r.tone===`error`?`bang`:`dot`,tone:r.tone,label:r.short+(e.length>1?` +${String(e.length-1)}`:``)}:null}var jie={Setup:(0,J.jsx)(DL,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),Images:(0,J.jsx)(TL,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),Uploads:(0,J.jsx)(OL,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`})};function Mie({notices:e,activity:t,uploads:n,activityOpen:r,onActivityOpenChange:i,onDismiss:a,onDismissAll:o,onLoadMore:s,send:c,controls:l}){let u=Aie(e,t),d=[];return u&&d.push({id:`activity`,label:`Activity`,count:e.length+t.generating+t.uploading,tone:u.tone,glyph:u.glyph,motion:u.busy?`pulse`:`none`,accessibleLabel:`Activity: ${u.label}`,title:`Activity`,content:(0,J.jsx)(Nie,{notices:e,uploads:n,onDismiss:a,onDismissAll:o,onLoadMore:s})}),(0,J.jsx)(Oie,{className:`prints-footer`,items:d,openId:r?`activity`:null,onOpenChange:e=>{i(e===`activity`)},leading:l,trailing:c})}function Nie({notices:e,uploads:t,onDismiss:n,onDismissAll:r,onLoadMore:i}){let a=[`Setup`,`Images`,`Uploads`].map(t=>({group:t,items:e.filter(e=>e.group===t)})).filter(e=>e.items.length);return(0,J.jsxs)(`div`,{className:`prints-instrument`,children:[a.map(({group:e,items:t})=>(0,J.jsxs)(`section`,{"aria-label":e,className:`prints-notice-group`,children:[(0,J.jsx)(bL,{level:3,children:e}),(0,J.jsx)(kie,{children:t.map(e=>(0,J.jsx)(E9,{icon:jie[e.group],primary:e.title,secondary:e.detail,actions:(0,J.jsxs)(`div`,{className:`prints-notice-actions`,"aria-label":`Actions for ${e.title}`,children:[e.actions?.map(e=>(0,J.jsx)(mL,{variant:`ghost`,size:`xs`,onClick:e.run,children:e.label},e.label)),e.blocking?null:(0,J.jsx)(gL,{"aria-label":`Dismiss ${e.title}`,icon:(0,J.jsx)(kL,{"aria-hidden":`true`}),onClick:()=>{n(e.key)}})]})},e.key))})]},e)),e.length?null:(0,J.jsx)(D9,{children:`All caught up.`}),t&&t.items.length>0?(0,J.jsxs)(`section`,{"aria-label":`Upload queue`,className:`prints-upload-bank`,children:[(0,J.jsx)(bL,{level:3,children:`Uploading`}),(0,J.jsx)(X3,{...t})]}):null,(0,J.jsxs)(`div`,{className:`prints-panel-footer`,children:[(0,J.jsx)(`span`,{className:`prints-footer-note`,children:`Clear keeps setup notices`}),(0,J.jsx)(mL,{variant:`ghost`,size:`xs`,disabled:!e.some(e=>!e.blocking),onClick:r,children:`Clear`}),i?(0,J.jsx)(mL,{variant:`ghost`,size:`xs`,onClick:i,children:`Load more activity`}):null]})]})}function Pie({folder:e}){return(0,J.jsx)(yie,{open:e.editing,onOpenChange:e.setEditing,children:(0,J.jsxs)(Cie,{children:[(0,J.jsx)(Tie,{children:(0,J.jsx)(Eie,{children:`Save prints to`})}),(0,J.jsx)(Iie,{folder:e},e.computerId),(0,J.jsx)(wie,{children:(0,J.jsx)(Die,{render:(0,J.jsx)(mL,{variant:`outline`,size:`sm`}),children:`Close`})})]})})}var Fie=Y({path:KC.check(xC(JS(gX),{message:`Enter an absolute Computer folder, such as /media.`})).annotate(i9({label:`Folder`,placeholder:`/media`}))});function Iie({folder:e}){let t=(0,f.useRef)(!1),n=v9({schema:Fie,defaultValues:{path:e.path??`/media`},onSubmit:async({path:n})=>{let r=await e.choose(n,t.current);return r?{kind:`refused`,fields:{path:r}}:{kind:`saved`}}}),r=e=>{t.current=e,n.form.setFieldMeta(`path`,e=>({...e,errorMap:{...e.errorMap,onServer:void 0}}))},i=e.busy||!e.writable;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)($re,{model:n,disabled:i,footer:(0,J.jsxs)(E3,{divider:!1,children:[(0,J.jsx)(O$,{className:`[--caps-keycap-width:auto]`,label:`Use`,type:`submit`,disabled:i,onClick:()=>{r(!1)}}),(0,J.jsx)(O$,{className:`[--caps-keycap-width:auto]`,label:`Create`,type:`submit`,disabled:i,onClick:()=>{r(!0)}})]})}),e.error?(0,J.jsx)(E9,{role:`alert`,icon:(0,J.jsx)(Wte,{"aria-hidden":`true`,className:`size-[var(--stipe-icon-size-sm)]`}),primary:e.error}):(0,J.jsx)(D9,{children:e.writable?`Prints saves new images and uploads here and shows this folder as your gallery.`:`This Computer is read-only for Prints, so the folder can’t change.`})]})}function Lie({connected:e,mediaCapability:t,modelsError:n,retryModels:r,modelsLoading:i,canGenerate:a,canWrite:o,generationError:s,recoveryError:c,pendingGenerations:l,activeGenerations:u,gallerySlots:d,computerId:f,failed:p,uploadError:m,uploads:h,permissions:g,resume:_,discard:v,retryUpload:y}){let b=[];if(e)f===null?b.push({key:`no-computer`,group:`Setup`,tone:`info`,blocking:!0,short:`Choose a Computer`,title:`No Computer selected`,detail:`Choose a Computer for this window, or create one in Grove.`}):t?n===null?!i&&!a&&b.push({key:`approval`,group:`Setup`,tone:`warning`,blocking:!0,short:`Generation not enabled`,title:`Media generation isn’t enabled`,detail:`Turn it on in this App’s Team permissions. Images already generated can still be saved.`,actions:[{label:`Permissions`,run:()=>{g()}}]}):b.push({key:`models:${n}`,group:`Setup`,tone:`warning`,blocking:!0,short:`Models unavailable`,title:`Couldn’t load image models`,detail:n,actions:[{label:`Retry`,run:r}]}):b.push({key:`no-media`,group:`Setup`,tone:`info`,blocking:!0,short:`Image creation off`,title:`Image creation is off for this Computer`,detail:`You can still browse and upload images.`});else{let e=uc(new K(`Prints disconnected`,{code:`DISCONNECTED`,retryable:!0}));b.push({key:`disconnected`,group:`Setup`,tone:`warning`,blocking:!0,short:e.title,title:e.title,detail:e.message})}e&&f!==null&&!o&&b.push({key:`read-only`,group:`Setup`,tone:`info`,blocking:!0,short:`Read-only`,title:`Read-only Computer`,detail:`Uploads and new prints are off.`}),s!==null&&b.push({key:s.key,group:`Images`,tone:`error`,short:`Image failed`,title:`Couldn’t create image`,detail:s.message,actions:s.billing?[{label:`Open Billing`,run:s.billing}]:s.retry?[{label:`Retry`,run:s.retry}]:[]}),c!==null&&b.push({key:`recovery:${c}`,group:`Images`,tone:`error`,short:`Retry blocked`,title:c});for(let e of l)u.has(e.reference.requestId)||d.some(t=>t.computerId===e.reference.computerId&&t.path===e.input.destination.path)||b.push({key:`unfinished:${e.reference.requestId}`,group:`Images`,tone:`info`,short:`Unfinished image`,title:`Unfinished image`,detail:e.reference.computerId===f?e.input.settings.prompt:`${e.input.settings.prompt} · on Computer ${e.reference.computerId}`,actions:[...e.reference.computerId===f?[{label:`Resume`,run:()=>{_(e)}}]:[],{label:`Discard`,run:()=>{v(e)}}]});p.length>0&&b.push({key:`files:${p.join(`|`)}`,group:`Images`,tone:`error`,short:`Couldn’t open images`,title:`Couldn’t open some images`,detail:p.join(`, `)}),m!==null&&b.push({key:`uploads:${m}`,group:`Uploads`,tone:`error`,short:`Upload failed`,title:`Couldn’t add images`,detail:m});for(let e of h)(e.status===`error`||e.status===`cancelled`)&&b.push({key:`upload:${e.id}:${e.status}`,group:`Uploads`,tone:e.status===`error`?`error`:`info`,short:`Upload failed`,title:`${e.file.name} wasn’t saved`,detail:e.message,actions:[{label:`Retry`,run:()=>{y(e.id)}}]});return b}function Rie(e,t){let n=Wl(NZ(e)),r=Yl(iM({queryKey:AZ.dismissals(e),mutationFn:({owner:e,id:t,keys:n})=>DZ(e.capabilities,{operation:`dismiss-notices`,computerId:t,keys:n}),apply:(e,t)=>({keys:[...new Set([...e.keys,...t.keys])].slice(-200)})})),i=n=>{e&&t&&n.length>0&&r.mutate({owner:e,id:t,keys:n})};return{error:r.variables?.owner===e&&r.variables.id===t&&r.isError?`Could not dismiss activity. Please try again.`:n.isError?`Could not load dismissed activity. Notices may reappear.`:null,visible:e=>e.filter(e=>(e.blocking??!1)||!n.data?.keys.includes(e.key)),dismiss:e=>{i([e])},dismissAll:e=>{i(e.filter(e=>!e.blocking).map(e=>e.key).slice(-200))}}}var k9=0,A9=1,zie=2,Bie=0,j9=1;function Vie(e,t,n){let r=e.list,i;for(;r;){if(r.index===n)return!1;if(t>r.high)break;i=r,r=r.next}return i||(e.list={index:n,high:t,next:r}),i&&(i.next={index:n,high:t,next:i.next}),!0}function Hie(e,t){let n=e.list;if(n.index===t)return n.next===null?Bie:(e.list=n.next,j9);let r=n;for(n=n.next;n!==null;){if(n.index===t)return r.next=n.next,j9;r=n,n=n.next}}var M9={low:0,max:0,high:0,C:zie,P:void 0,R:void 0,L:void 0,list:void 0};M9.P=M9,M9.L=M9,M9.R=M9;function N9(e){let t=e.high;e.max=e.L===M9&&e.R===M9?t:e.L===M9?Math.max(e.R.max,t):e.R===M9?Math.max(e.L.max,t):Math.max(Math.max(e.L.max,e.R.max),t)}function P9(e){let t=e;for(;t.P!==M9;)N9(t.P),t=t.P}function F9(e,t){if(t.R===M9)return;let n=t.R;t.R=n.L,n.L!==M9&&(n.L.P=t),n.P=t.P,t.P===M9?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.L=t,t.P=n,N9(t),N9(n)}function I9(e,t){if(t.L===M9)return;let n=t.L;t.L=n.R,n.R!==M9&&(n.R.P=t),n.P=t.P,t.P===M9?e.root=n:t===t.P.R?t.P.R=n:t.P.L=n,n.R=t,t.P=n,N9(t),N9(n)}function L9(e,t,n){t.P===M9?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.P=t.P}function Uie(e,t){let n;for(;t!==M9&&t.C===A9;)t===t.P.L?(n=t.P.R,n.C===k9&&(n.C=A9,t.P.C=k9,F9(e,t.P),n=t.P.R),n.L.C===A9&&n.R.C===A9?(n.C=k9,t=t.P):(n.R.C===A9&&(n.L.C=A9,n.C=k9,I9(e,n),n=t.P.R),n.C=t.P.C,t.P.C=A9,n.R.C=A9,F9(e,t.P),t=e.root)):(n=t.P.L,n.C===k9&&(n.C=A9,t.P.C=k9,I9(e,t.P),n=t.P.L),n.R.C===A9&&n.L.C===A9?(n.C=k9,t=t.P):(n.L.C===A9&&(n.R.C=A9,n.C=k9,F9(e,n),n=t.P.L),n.C=t.P.C,t.P.C=A9,n.L.C=A9,I9(e,t.P),t=e.root));t.C=A9}function Wie(e){for(;e.L!==M9;)e=e.L;return e}function Gie(e,t){let n;for(;t.P.C===k9;)t.P===t.P.P.L?(n=t.P.P.R,n.C===k9?(t.P.C=A9,n.C=A9,t.P.P.C=k9,t=t.P.P):(t===t.P.R&&(t=t.P,F9(e,t)),t.P.C=A9,t.P.P.C=k9,I9(e,t.P.P))):(n=t.P.P.L,n.C===k9?(t.P.C=A9,n.C=A9,t.P.P.C=k9,t=t.P.P):(t===t.P.L&&(t=t.P,I9(e,t)),t.P.C=A9,t.P.P.C=k9,F9(e,t.P.P)));e.root.C=A9}function Kie(){let e={root:M9,size:0},t={};return{insert(n,r,i){let a=e.root,o=M9;for(;a!==M9&&(o=a,n!==o.low);)a=n<a.low?a.L:a.R;if(n===o.low&&o!==M9){if(!Vie(o,r,i))return;o.high=Math.max(o.high,r),N9(o),P9(o),t[i]=o,e.size++;return}let s={low:n,high:r,max:r,C:k9,P:o,L:M9,R:M9,list:{index:i,high:r,next:null}};o===M9?e.root=s:(s.low<o.low?o.L=s:o.R=s,P9(s)),Gie(e,s),t[i]=s,e.size++},remove(n){let r=t[n];if(r===void 0)return;delete t[n];let i=Hie(r,n);if(i===void 0)return;if(i===j9){r.high=r.list.high,N9(r),P9(r),e.size--;return}let a=r,o=a.C,s;r.L===M9?(s=r.R,L9(e,r,r.R)):r.R===M9?(s=r.L,L9(e,r,r.L)):(a=Wie(r.R),o=a.C,s=a.R,a.P===r?s.P=a:(L9(e,a,a.R),a.R=r.R,a.R.P=a),L9(e,r,a),a.L=r.L,a.L.P=a,a.C=r.C),N9(s),P9(s),o===A9&&Uie(e,s),e.size--},search(t,n,r){let i=[e.root];for(;i.length!==0;){let e=i.pop();if(!(e===M9||t>e.max)&&(e.L!==M9&&i.push(e.L),e.R!==M9&&i.push(e.R),e.low<=n&&e.high>=t)){let n=e.list;for(;n!==null;)n.high>=t&&r(n.index,e.low),n=n.next}}},get size(){return e.size}}}var qie=e=>{let t=f.useRef(e);return f.useEffect(()=>{t.current=e}),t},R9=(e,t)=>{let n=t||Jie,r,i;return function(){return r&&n(arguments,r)?i:i=e.apply(null,r=arguments)}},Jie=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3],z9=class{constructor(){this.set=void 0,this.get=void 0;let e,t;this.get=n=>n===e?t:void 0,this.set=(n,r)=>{e=n,t=r}}},B9=e=>{try{return new e}catch{let e={};return{set(t,n){e[t]=n},get(t){return e[t]}}}},Yie=e=>{let t=e.length,n=B9(e[0]),r,i,a,o,s=t===1;return t<3?{g:e=>(r=n.get(e[0]))===void 0||s?r:r.get(e[1]),s:(t,a)=>(s?n.set(t[0],a):(r=n.get(t[0]))===void 0?(i=B9(e[1]),i.set(t[1],a),n.set(t[0],i)):r.set(t[1],a),a)}:{g:e=>{for(o=n,a=0;a<t;a++)if((o=o.get(e[a]))===void 0)return;return o},s:(r,s)=>{for(o=n,a=0;a<t-1;a++)(i=o.get(r[a]))===void 0?(i=B9(e[a+1]),o.set(r[a],i),o=i):o=i;return o.set(r[t-1],s),s}}},Xie=(e,t)=>{let n,{g:r,s:i}=Yie(e);return function(){return(n=r(arguments))===void 0?i(arguments,t.apply(null,arguments)):n}},Zie=new WeakMap;function Qie(){let e=f.useState($ie)[1];return f.useRef(()=>e({})).current}var $ie={},V9=f.createElement;function eae(e){let{positioner:t,resizeObserver:n,items:r,as:i=`div`,id:a,className:o,style:s,role:c=`grid`,tabIndex:l=0,containerRef:u,itemAs:d=`div`,itemStyle:p,itemHeightEstimate:m=300,itemKey:h=rae,overscanBy:g=2,scrollTop:_,isScrolling:v,height:y,render:b,onRender:x}=e,S=0,C,w=Qie(),T=aae(t,n),E=r.length,{columnWidth:D,columnCount:O,range:k,estimateHeight:A,size:j,shortestColumn:M}=t,N=j(),P=M(),F=[],I=c===`list`?`listitem`:c===`grid`?`gridcell`:void 0,L=qie(x);g=y*g;let R=_+g,z=P<R&&N<E;if(k(Math.max(0,_-g/2),R,(e,t,n)=>{let i=r[e],a=h(i,e),o={top:n,left:t,width:D,writingMode:`horizontal-tb`,position:`absolute`};F.push(V9(d,{key:a,ref:T(e),role:I,style:typeof p==`object`&&p?Object.assign({},o,p):o},U9(b,e,i,D))),C===void 0?(S=e,C=e):(S=Math.min(S,e),C=Math.max(C,e))}),z){let e=Math.min(E-N,Math.ceil((_+g-P)/m*O)),t=N,n=iae(D);for(;t<N+e;t++){let e=r[t],i=h(e,t);F.push(V9(d,{key:i,ref:T(t),role:I,style:typeof p==`object`?Object.assign({},n,p):n},U9(b,t,e,D)))}}f.useEffect(()=>{typeof L.current==`function`&&C!==void 0&&L.current(S,C,r),H9=`1`},[S,C,r,L]),f.useEffect(()=>{z&&w()},[z,t]);let ee=tae(v,A(E,m));return V9(i,{ref:u,key:H9,id:a,role:c,className:o,tabIndex:l,style:typeof s==`object`?nae(ee,s):ee,children:F})}var H9=`0`,U9=Xie([z9,{},WeakMap,z9],(e,t,n,r)=>V9(e,{index:t,data:n,width:r})),tae=R9((e,t)=>({position:`relative`,width:`100%`,maxWidth:`100%`,height:Math.ceil(t),maxHeight:Math.ceil(t),willChange:e?`contents`:void 0,pointerEvents:e?`none`:void 0})),W9=(e,t)=>e[0]===t[0]&&e[1]===t[1],nae=R9((e,t)=>Object.assign({},e,t),W9);function rae(e,t){return t}var iae=R9(e=>({width:e,zIndex:-1e3,visibility:`hidden`,position:`absolute`,writingMode:`horizontal-tb`}),(e,t)=>e[0]===t[0]),aae=R9((e,t)=>n=>r=>{r!==null&&(t&&(t.observe(r),Zie.set(r,n)),e.get(n)===void 0&&e.set(n,r.offsetHeight))},W9),oae=function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=n);let i=Kie(),a=Array(e),o=[],s=Array(e);for(let t=0;t<e;t++)a[t]=0,s[t]=[];return{columnCount:e,columnWidth:t,set:function(e,c){c===void 0&&(c=0);let l=0;for(let e=1;e<a.length;e++)a[e]<a[l]&&(l=e);let u=a[l]||0;a[l]=u+c+r,s[l].push(e),o[e]={left:l*(t+n),top:u,height:c,column:l},i.insert(u,u+c,e)},get:e=>o[e],update:t=>{let n=Array(e),c=0,l=0;for(;c<t.length-1;c++){let e=t[c],r=o[e];r.height=t[++c],i.remove(e),i.insert(r.top,r.top+r.height,e),n[r.column]=n[r.column]===void 0?e:Math.min(e,n[r.column])}for(c=0;c<n.length;c++){if(n[c]===void 0)continue;let e=s[c],t=sae(e,n[c]),u=s[c][t],d=o[u];for(a[c]=d.top+d.height+r,l=t+1;l<e.length;l++){let t=e[l],n=o[t];n.top=a[c],a[c]=n.top+n.height+r,i.remove(t),i.insert(n.top,n.top+n.height,t)}}},range:(e,t,n)=>i.search(e,t,(e,t)=>n(e,o[e].left,t)),estimateHeight:(t,n)=>{let r=Math.max(0,Math.max.apply(null,a));return t===i.size?r:r+Math.ceil((t-i.size)/e)*n},shortestColumn:()=>a.length>1?Math.min.apply(null,a):a[0]||0,size(){return i.size},all(){return o}}},sae=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=n+r>>>1,a=e[i];if(a===t)return i;a<=t?n=i+1:r=i-1}return-1},cae={queued:`Waiting to start`,generating:`Generating`,refining:`Refining`,done:void 0,failed:void 0},lae=(0,f.forwardRef)(function({status:e,children:t,aspectRatio:n,label:r,indicator:i,failure:a,className:o,style:s,...c},l){let u=(0,f.useRef)(null);(0,f.useImperativeHandle)(l,()=>u.current);let d=(0,f.useRef)(e),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(e);h!==e&&(g(e),m(e===`done`)),(0,f.useLayoutEffect)(()=>{let t=u.current,n=d.current;if(d.current=e,!t||n===e)return;if(!_P(t)){m(!1);return}let r=dP(t),i=gP(r,r.ease),a=[],o=t.querySelector(`:scope > [data-layer="media"]`),s=t.querySelector(`:scope > [data-layer="placeholder"]`),c=t.querySelector(`:scope > [data-layer="failure"]`);if(e===`done`&&o){let e=o.animate(r.reduced?[{opacity:0},{opacity:1}]:[{opacity:0,filter:`blur(10px)`,transform:`scale(1.03)`},{opacity:1,filter:`blur(0px)`,transform:`none`}],{duration:r.reduced?r.fast:r.slow*2,easing:i,fill:`backwards`});e.addEventListener(`finish`,()=>{m(!1)}),a.push(e),s&&a.push(s.animate([{opacity:1},{opacity:0}],{duration:r.reduced?r.fast:r.slow,easing:i,fill:`forwards`}))}return e===`failed`&&c&&a.push(c.animate([{opacity:0,transform:`translateY(${String(r.distance)}px)`},{opacity:1,transform:`none`}],{duration:r.normal,easing:i})),n===`failed`&&s&&a.push(s.animate([{opacity:.4},{opacity:1}],{duration:r.normal,easing:i})),()=>{for(let e of a)e.cancel()}},[e]);let _=e===`queued`||e===`generating`||e===`refining`,v=r??cae[e],y=e===`done`||e===`refining`;return(0,J.jsxs)(`div`,{...c,ref:u,className:Z(`caps-generation-frame`,o),"data-status":e,"data-aspect":n===void 0?void 0:``,"aria-busy":_,style:n===void 0?s:{aspectRatio:n,...s},children:[e===`done`&&!p?null:(0,J.jsxs)(`div`,{className:Z(`caps-generation-placeholder`,e===`queued`&&`skeleton`),"data-layer":`placeholder`,role:e===`done`?void 0:`status`,"aria-hidden":e===`done`||void 0,children:[e===`generating`||e===`refining`||e===`done`?i??(0,J.jsx)(fL,{decorative:!0,size:`lg`,variant:`bloom`}):null,v===void 0?null:(0,J.jsx)(CP,{children:v})]}),y?(0,J.jsx)(`div`,{className:`caps-generation-media`,"data-layer":`media`,children:t}):null,e===`failed`&&a!==void 0?(0,J.jsx)(`div`,{className:`caps-generation-failure`,"data-layer":`failure`,role:`alert`,children:a}):null]})}),uae=`modulepreload`,dae=function(e,t){return new URL(e,t).href},G9={},fae=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=dae(t,n),t=s(t),t in G9)return;G9[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:uae,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},K9=0,pae=320,mae=656;function hae(e,t){return e<=0||!Number.isFinite(t)||t<=0?0:e===1?1:e<=4?2:t>=1280?4:t>=mae?3:2}function q9({item:e}){return uX(e.path)?(0,J.jsx)(`video`,{"aria-label":e.path,className:`block h-full w-full object-cover`,"data-media-thumb":!0,loop:!0,muted:!0,playsInline:!0,src:e.url}):(0,J.jsx)(`img`,{alt:e.path,className:`block h-full w-full object-cover`,"data-media-thumb":!0,src:e.url})}var gae=(0,f.memo)(function({item:e}){let t=(0,f.useRef)(null);(0,f.useEffect)(()=>{e.onVisible?.()},[e.onVisible]);let[n,r]=(0,f.useState)(e.pending===!0&&!e.onVisible);return e.pending&&!e.onVisible&&!n&&r(!0),(0,f.useLayoutEffect)(()=>{let r=t.current;if(!r||e.pending||n)return;let i=window.matchMedia(`(prefers-reduced-motion: reduce)`);if(i.matches)return;let a=!0,o,s,c=()=>o?.();return fae(async()=>{let{animate:e,spring:t}=await Promise.resolve().then(()=>Cte);return{animate:e,spring:t}},void 0,import.meta.url).then(({animate:e,spring:t})=>{if(!a)return;let n=e(r,{opacity:{from:0,to:1,duration:160,ease:`outQuad`},translateY:{from:6,to:0,ease:t({bounce:.16,duration:320})},scale:{from:.985,to:1,ease:t({bounce:.16,duration:320})}});o=()=>{n.complete()},s=()=>{n.revert()}}),i.addEventListener(`change`,c),()=>{a=!1,i.removeEventListener(`change`,c),s?.()}},[e.key,e.pending,n]),(0,J.jsxs)(`div`,{ref:t,className:`prints-gallery-tile`,"data-referenced":e.referenced?!0:void 0,children:[(0,J.jsx)(`button`,{className:`block h-full w-full overflow-hidden bg-base-200 p-0 text-left`,"data-media-thumb-wrap":!0,type:`button`,disabled:e.pending,onClick:()=>{e.onOpen(e.path)},onKeyDown:t=>{t.key.toLowerCase()===`i`&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&e.onInfo&&(t.preventDefault(),e.onInfo())},title:e.path,children:(0,J.jsx)(`div`,{className:`caps-item block! h-full w-full overflow-hidden rounded-none! border-0! bg-transparent! shadow-none! z-auto! -outline-offset-2!`,"data-selected":e.selected??!1,children:e.pending||n||e.error?(0,J.jsx)(lae,{"data-media-pending":e.pending?`true`:void 0,failure:e.error?(0,J.jsx)(`span`,{title:e.error,className:`prints-tile-failed`,children:(0,J.jsx)(q3,{size:`compact`,appearance:`chip`,glyph:`bang`,tone:`error`,label:`Not saved`})}):void 0,indicator:(0,J.jsx)(fL,{decorative:!0,size:`fill`,tone:`accent`,variant:`bloom`}),label:e.pendingLabel??`Preparing image…`,status:e.pending?e.error?`failed`:`generating`:`done`,children:e.pending?null:(0,J.jsx)(q9,{item:e})}):(0,J.jsx)(q9,{item:e})})}),e.error?(0,J.jsxs)(`div`,{className:`prints-gallery-pending-actions`,children:[e.onRetry?(0,J.jsx)(gL,{"aria-label":`Retry ${e.path}`,icon:(0,J.jsx)(EL,{}),onClick:e.onRetry}):null,e.onDismiss?(0,J.jsx)(gL,{"aria-label":`Dismiss ${e.path}`,icon:(0,J.jsx)(kL,{}),onClick:e.onDismiss}):null]}):null,(0,J.jsxs)(`div`,{className:`prints-gallery-tools`,children:[!e.pending&&e.onInfo?(0,J.jsx)(gL,{"aria-label":`Image info: ${e.path}`,title:`Image info (I)`,"aria-keyshortcuts":`I`,onClick:e.onInfo,icon:(0,J.jsx)(Gte,{})}):null,!e.pending&&e.onToggleReference?(0,J.jsx)(gL,{className:`prints-gallery-reference`,"aria-label":`${e.referenced?`Remove reference`:`Add reference`}: ${e.path}`,title:e.referenced?`Remove reference`:`Add reference`,"aria-pressed":e.referenced??!1,disabled:e.referenceDisabled,onClick:e.onToggleReference,icon:e.referenced?(0,J.jsx)(CL,{}):(0,J.jsx)(TL,{})}):null]})]})}),_ae=(0,f.memo)(function({children:e,style:t,...n}){return(0,J.jsx)(`div`,{"data-media-grid":!0,...n,style:t,children:e})});function vae(e,t){let[n,r]=(0,f.useState)({height:0,width:0});return(0,f.useEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{r(e=>{let n={height:t.clientHeight,width:t.clientWidth};return n.width===e.width&&n.height===e.height?e:n})};n();let i=new ResizeObserver(n);return i.observe(t),window.addEventListener(`resize`,n),()=>{i.disconnect(),window.removeEventListener(`resize`,n)}},[e,t]),n}function yae(e){let[t,n]=(0,f.useState)(0),[r,i]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{let t=e.current;if(!t)return;let r=null,a=()=>{n(t.scrollTop),i(!0),r!==null&&clearTimeout(r),r=setTimeout(()=>{i(!1)},150)};return t.addEventListener(`scroll`,a,{passive:!0}),()=>{t.removeEventListener(`scroll`,a),r!==null&&clearTimeout(r)}},[e]),{isScrolling:r,scrollTop:t}}function bae(e,t){let n=Math.max(1,hae(e.length,t));return(0,f.useMemo)(()=>{let r=Math.floor((t-(n-1)*K9)/n),i=oae(n,r,K9);return r>0&&e.forEach((e,t)=>{let n=e.height>0?e.width/e.height:1;i.set(t,r/n)}),i},[e,t,n])}var xae=(0,f.memo)(function({data:e,width:t}){let n=e.height>0?e.width/e.height:1;return(0,J.jsx)(`div`,{"data-media-tile":e.key,style:{height:t/n,width:t},children:(0,J.jsx)(gae,{item:e})})});function J9(e,t){let n=Array.from(e.querySelectorAll(`[data-media-tile]`)).find(e=>e.dataset.mediaTile===t)?.querySelector(`[data-media-thumb-wrap]`);return!n||n.disabled?!1:(n.focus({preventScroll:!0}),!0)}function Sae(e,t,n){let r=e.ownerDocument;(r.activeElement!==r.body||J9(e,t))&&n()}function Cae(e,t,n){let r=n.top+t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;return(r<e.scrollTop||r+n.height>e.scrollTop+e.clientHeight)&&e.scrollTo({top:r,behavior:`instant`}),r}var wae=(0,f.memo)(function({items:e,scrollRef:t,focus:n}){let r=vae(t,e.length),i=r.width||pae,a=bae(e,i),{isScrolling:o,scrollTop:s}=yae(t),c=(0,f.useRef)(new Set),l=(0,f.useRef)(null),u=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(!n)return;let o=l.current===n.requestId;if(o&&u.current===i)return;let s=t.current,c=e.findIndex(e=>e.key===n.key),d=a.get(c);if(!s||!d||r.height===0)return;let f=s.querySelector(`[data-media-grid]`);if(!f)return;let p=Cae(s,f,d);if(o){Sae(s,n.key,()=>{u.current=i});return}J9(s,n.key)?(l.current=n.requestId,u.current=i,n.onFocus()):s.scrollTo({top:p,behavior:`instant`})},[n,e,r.height,t,s,a,i]),(0,f.useEffect)(()=>{let n=t.current;if(!n||r.width===0||r.height===0)return;let i=e.reduce((e,t,n)=>t.pending&&!t.onVisible&&!c.current.has(t.key)?n:e,-1);if(c.current=new Set(e.map(e=>e.key)),i<0)return;let o=a.get(i),s=n.querySelector(`[data-media-grid]`);if(!o||!s)return;let l=s.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop+o.top,u=l+o.height;l>=n.scrollTop&&u<=n.scrollTop+n.clientHeight||n.scrollTo({top:Math.max(0,l-Math.max(0,(n.clientHeight-o.height)/2)),behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`})},[e,r.width,r.height,t,a]);let d=(0,f.useCallback)(({data:e,width:t})=>(0,J.jsx)(xae,{data:e,width:t}),[]);return eae({as:_ae,height:r.height,isScrolling:o,itemKey:e=>e.key,items:e,overscanBy:2,positioner:a,render:d,scrollTop:s})});function Tae({items:e,scrollRef:t,focus:n}){return(0,J.jsx)(`section`,{"data-media-mosaic":!0,children:(0,J.jsx)(wae,{items:e,scrollRef:t,focus:n})})}function Eae(e,t,n){let r=new Map(e.map(e=>[e.key,e])),i=new Set(t.map(e=>e.key));return[...t.filter(e=>!e.resolved||r.has(e.key)).map(e=>{let t=r.get(e.key);return t&&e.resolved?t:n(e)}),...e.filter(e=>!i.has(e.key))]}var Dae=(0,f.forwardRef)(function({className:e,items:t,onKeyDown:n,onSelect:r,selected:i,...a},o){let s=(0,f.useId)(),c=(0,f.useRef)(null);(0,f.useImperativeHandle)(o,()=>c.current);let l=U7(`[role="option"][data-active]`),u=(0,f.useCallback)(e=>{c.current=e,l(e)},[l]),d=G7({getKey:e=>e.id,isDisabled:e=>e.disabled===!0,items:t}),{activeKey:p,enabledItems:m}=d;(0,f.useEffect)(()=>{p&&m.some(e=>e.id===p)||d.setActiveKey(i&&m.some(e=>e.id===i)?i:m[0]?.id??null)},[p,d.setActiveKey,m,i]);let h=e=>`${s}-option-${encodeURIComponent(e)}`;return(0,J.jsx)(`ul`,{...a,ref:u,"aria-activedescendant":p?h(p):void 0,className:[`menu max-h-56 overflow-y-auto rounded-none bg-base-100 shadow-lg`,e].filter(Boolean).join(` `),onKeyDown:e=>{n?.(e),!(e.defaultPrevented||!m.length)&&(e.key===`ArrowDown`?(e.preventDefault(),d.move(1)):e.key===`ArrowUp`?(e.preventDefault(),d.move(-1)):e.key===`Home`?(e.preventDefault(),d.move(-1,`start`)):e.key===`End`?(e.preventDefault(),d.move(1,`end`)):(e.key===`Enter`||e.key===` `)&&p&&(e.preventDefault(),r(p)))},role:`listbox`,tabIndex:0,children:t.map(e=>(0,J.jsx)(`li`,{role:`none`,children:(0,J.jsxs)(`div`,{"aria-disabled":e.disabled===!0||void 0,"aria-selected":i===e.id,"data-active":p===e.id||void 0,className:[`flex w-full items-center gap-sm px-md py-xs text-left text-xs`,p===e.id?`bg-base-300 text-base-content`:`text-base-content`,e.disabled?`cursor-not-allowed bg-[var(--stipe-surface)] text-base-content outline outline-1 outline-dashed outline-base-300`:`cursor-pointer`].join(` `),"aria-keyshortcuts":e.shortcut,"data-search-option":e.id,id:h(e.id),onClick:()=>{e.disabled||r(e.id)},role:`option`,children:[e.shortcut?(0,J.jsx)(`kbd`,{className:`kbd kbd-sm min-w-6 shrink-0`,children:e.shortcut}):null,(0,J.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),e.description?(0,J.jsx)(`span`,{className:`text-xs text-base-content`,children:e.description}):null]})},e.id))})});function Oae(e,t=/Mac|iPhone|iPad/u.test(globalThis.navigator.userAgent)){return e.split(` `).map((n,r)=>n===`<leader>`?`Ctrl K`:r>0&&e.startsWith(`<leader> `)?n:n.split(`+`).map(e=>e===`mod`?t?`⌘`:`Ctrl`:e===`escape`?`Esc`:e.length===1?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)).join(n===`ctrl+k`||n===`mod+k`?` `:`+`)).join(` `)}function Y9(e){let t=new Map;for(let n of e.bindings)t.set(n.commandId,[...t.get(n.commandId)??[],Oae(n.binding)]);return e.slash.map(e=>({alias:e.alias,commandId:e.commandId,title:e.title,description:e.description,category:e.category,order:e.order,grammar:e.arguments,consumesDraft:e.consumesDraft,keys:t.get(e.commandId)??[],availability:e.availability}))}function kae(e,t){let n=e.toLocaleLowerCase(),r=t.toLocaleLowerCase();if(r.length===0)return{tier:0,spread:0,indices:[]};let i=e=>Array.from({length:r.length},(t,n)=>e+n);if(n.startsWith(r))return{tier:0,spread:n.length-r.length,indices:i(0)};let a=n.search(RegExp(`[-_\\s]${r.replaceAll(/[.*+?^${}()|[\]\\]/gu,`\\$&`)}`,`u`));if(a>=0)return{tier:1,spread:a,indices:i(a+1)};let o=n.indexOf(r);if(o>=0)return{tier:2,spread:o,indices:i(o)};let s=[],c=0;for(let e of r){let t=n.indexOf(e,c);if(t<0)return;s.push(t),c=t+1}let l=s[0]??0;return{tier:3,spread:(s.at(-1)??0)-l-r.length+1,indices:s}}function Aae(e,t,n,r){return e.map(e=>({entry:e,match:kae(t(e),n)})).filter(e=>e.match!==void 0).sort((e,n)=>e.match.tier-n.match.tier||e.match.spread-n.match.spread||r(e.entry)-r(n.entry)||t(e.entry).localeCompare(t(n.entry))).map(({entry:e,match:t})=>({entry:e,indices:t.indices}))}var X9=[`help`,`login`,`model`];function jae(e,t,n={}){if(!t.startsWith(`/`)||t.includes(`
|
|
91
|
-
`))return{kind:`none`};let r=t.search(/\s/u);if(r<0){let r=t.slice(1);return{kind:`commands`,query:r,items:Aae(e.filter(e=>e.availability.status===`available`&&(r.length===0?e.category===(n.idleCategory??`Conversation`)||X9.includes(e.alias):e.category!==`Advanced`||e.alias.toLocaleLowerCase().startsWith(r.toLocaleLowerCase()))),e=>e.alias,r,e=>{let t=X9.indexOf(e.alias);return r.length===0&&t>=0?t-X9.length:e.order}).map(({entry:e,indices:t})=>({command:e,label:`/${e.alias}`,matches:t.map(e=>e+1),insert:e.grammar===void 0?`/${e.alias}`:`/${e.alias} `}))}}let i=t.slice(1,r),a=e.find(e=>e.alias===i);if(a?.grammar===void 0||a.availability.status!==`available`)return{kind:`none`};let o=t.slice(r).trimStart(),s=(o.includes(` `)?[]:a.grammar.words??[]).filter(e=>e.word.toLocaleLowerCase().startsWith(o.toLocaleLowerCase())).map(e=>({word:e,label:e.word,matches:Array.from({length:o.length},(e,t)=>t),insert:`/${i} ${e.word}`}));return{kind:`arguments`,command:a,query:o,hint:`/${i} ${a.grammar.hint}`,items:s}}function Mae({disabled:e,onChange:t,onSend:n,onSlashMove:r,onSlashPick:i,placeholder:a,slashCount:o,value:s}){let c=(0,f.useRef)(null),l=(0,f.useRef)(s),[u,d]=(0,f.useState)([]),[p,m]=(0,f.useState)(-1),[h,g]=(0,f.useState)(!1),_=(0,f.useRef)(!1),v=(0,f.useRef)(!1);l.current=s,(0,f.useLayoutEffect)(()=>{if(h||e||!v.current)return;v.current=!1;let t=c.current;t&&t.ownerDocument.activeElement===t.ownerDocument.body&&t.focus({preventScroll:!0})},[e,h]),(0,f.useLayoutEffect)(()=>{let e=c.current;e&&(e.style.height=`auto`,e.style.height=`${String(Math.min(e.scrollHeight,160))}px`)},[s]);let y=(0,f.useCallback)(async()=>{let r=l.current.trim();if(!(!r||e||_.current)){v.current=c.current===c.current?.ownerDocument.activeElement,_.current=!0,g(!0);try{if(!await n())return;d(e=>e.at(-1)===r?e:[...e,r].slice(-20)),m(-1),t(``)}finally{_.current=!1,g(!1)}}},[e,t,n]);return(0,J.jsx)(`div`,{className:`relative min-w-0 flex-1`,children:(0,J.jsx)(Y7,{"aria-label":`Image prompt`,className:`min-h-12 max-h-40 w-full resize-none !border-0 !bg-transparent !shadow-none focus:!outline-none`,"data-generation-prompt":!0,disabled:e===!0||h,onChange:e=>{t(e.currentTarget.value),m(-1)},onKeyDown:e=>{if(!o6(e)){if(s.startsWith(`/`)){if(e.key===`ArrowUp`&&o){e.preventDefault(),r(-1);return}if(e.key===`ArrowDown`&&o){e.preventDefault(),r(1);return}if(e.key===`Enter`&&!e.shiftKey){e.preventDefault(),o&&i();return}if(e.key===`Escape`){e.preventDefault(),t(s.slice(1));return}}if(e.key===`Enter`&&!e.shiftKey){e.preventDefault(),y();return}if(e.key===`ArrowUp`&&c.current?.selectionStart===0&&u.length&&(p===-1||p>0)){e.preventDefault();let n=p===-1?u.length-1:p-1;m(n),t(u[n]);return}if(e.key===`ArrowDown`&&p!==-1){e.preventDefault();let n=p+1;n>=u.length?(m(-1),t(``)):(m(n),t(u[n]))}}},placeholder:a,ref:c,rows:1,value:s})})}function Nae({index:e,matches:t,onPick:n}){return t.length?(0,J.jsx)(Dae,{className:`absolute bottom-full left-0 right-0 z-30 mb-1`,items:t.map(e=>({description:e.description,id:e.id,label:`/${e.slash} ${e.title}`})),onSelect:e=>{n(t.findIndex(t=>t.id===e))},selected:t[e]?.id}):(0,J.jsx)(h3,{open:!0,side:`top`,className:`left-0 right-0 z-30 px-3 py-1.5 text-xs text-dim`,children:`No matching commands`})}function Pae(e,t){let[n,r]=(0,f.useState)(0),i=t.startsWith(`/`),a=(0,f.useMemo)(()=>{if(!i)return[];let n=jae(e.map((e,t)=>({alias:e.slash,commandId:e.id,title:e.title,description:e.description,category:`Prompt`,order:t,keys:[],availability:{status:`available`}})),t,{idleCategory:`Prompt`});return n.kind===`commands`?n.items.flatMap(({command:t})=>e.find(e=>e.id===t.commandId)??[]):[]},[t,e,i]);return(0,f.useEffect)(()=>{r(0)},[t]),{moveSlash:e=>{r(t=>a.length?(t+e+a.length)%a.length:0)},resetSlash:()=>{r(0)},slashIndex:n,slashMatches:a,slashOpen:i}}var Z9=Y({destination:eC(hC(oC)),height:eC(IC),model:eC(oC),prompt:eC(oC),references:eC(dC(Y({path:oC}))),steps:eC(hC(IC)),width:eC(IC)}),Fae=as(co(),Bs()).parse(structuredClone(Vee(Z9,{onExcessProperty:`error`}).schema)),Q9=(e,t,n,r)=>({id:e,title:t,category:`Image generation`,description:n,projections:{agent:{}},action:r===void 0?{presentation:{type:`action`}}:{inputSchema:r,presentation:{type:`action`}}}),Iae=Q9(`inspect-generation-draft`,`Inspect image draft`,`Read the current Prints image form and available models`),Lae=Q9(`set-generation-draft`,`Edit image draft`,`Set selected Prints image form fields; this does not generate an image`,Fae),Rae=Q9(`submit-generation-draft`,`Generate image`,`Submit the current Prints image form using the same action as the Send button`);function zae(e,t){let n=!1,r=new Set,i=(t,i)=>{e.commands.register(t,i).then(e=>{n?e():r.add(e)},()=>void 0)};return i(Iae,()=>{if(n)return;let e=t.readDraft();return{draft:{destination:e.destination??null,height:e.height,model:e.model,prompt:e.prompt,references:e.references.map(e=>({path:e.path})),steps:e.steps??null,width:e.width},models:t.readModels().map(e=>({id:e.id,label:e.label,defaultHeight:e.input.defaultHeight,defaultWidth:e.input.defaultWidth,maxReferences:e.input.maxReferences}))}}),i(Lae,({arguments:e})=>{if(n)return;let r=QS(Z9,{onExcessProperty:`error`})(e);t.setDraft(r)}),i(Rae,async()=>{if(!n)return{accepted:await t.submit()}}),()=>{if(!n){n=!0;for(let e of r)e();r.clear()}}}function Bae(e){return[{id:`clear-prompt`,title:`Clear prompt`,category:`Prompt`,description:`Remove the current prompt`,projections:{slash:{aliases:[`clear`],order:0},palette:{}},handler:()=>{e().clear()}},...uZ.map((t,n)=>({id:`size-${t}`,title:`Use ${t} size`,category:`Prompt`,description:`Use ${String(lZ[t].width)} × ${String(lZ[t].height)}`,projections:{slash:{aliases:[t],order:n+1},palette:{}},handler:()=>{e().useSize(t)}}))]}function Vae(e,t){let n=(0,f.useRef)(e);n.current=e;let r=jj(t,{sourceId:`media-prompt`,namespace:`media`},(0,f.useCallback)(()=>Bae(()=>n.current),[])),i=(0,f.useSyncExternalStore)(r.subscribe,r.snapshot,r.snapshot);return{items:(0,f.useMemo)(()=>Y9(i).map(e=>({id:e.commandId,slash:e.alias,title:e.title,description:e.description})),[i]),run:e=>{r.execute(e,{origin:`slash`})}}}var Hae=[`a mushroom knight`,`moss on a keyboard`,`your Agent's selfie`];function Uae(e){let t=(0,f.useRef)(!1),n=E$({defaultValues:fZ(),onSubmit:async({value:n})=>{t.current=await e.current(n)}}),r=(0,f.useCallback)(async()=>(t.current=!1,await n.handleSubmit(),t.current),[n]);return Object.assign(n,{submitCurrent:r})}function Wae({actions:e,guidance:t,commandApp:n,form:r,models:i,modelsLoading:a,mediaCapability:o,submitting:s,values:c,computerId:l,mediaDirectory:u,referenceImages:d,onSubmit:p,footer:m}){let h=yZ(i,c.model),g=h?.input.dimensions===`none`,[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(!1),x=h!==void 0&&h.sizes!==null,S=_Z(h),C=x?`${String(c.width)}x${String(c.height)}`:_?`custom`:hZ(c.width,c.height),w=(h?.input.maxReferences??0)>0,T=Vae({clear:()=>{r.setFieldValue(`prompt`,``)},useSize:e=>{v(!1),r.setFieldValue(`width`,lZ[e].width),r.setFieldValue(`height`,lZ[e].height),r.setFieldValue(`prompt`,``)}},n),E=Pae(T.items,c.prompt),D=e=>{let t=E.slashMatches.at(e);t&&(E.resetSlash(),T.run(t.id))};return(0,J.jsx)(m3,{className:`prints-composer-anchor`,children:(0,J.jsxs)(p3,{"aria-label":`Image generation`,className:`prints-composer`,"data-generation-form":!0,children:[(0,J.jsxs)(`form`,{"aria-busy":s,onSubmit:e=>{e.preventDefault(),p()},children:[c.references.length>0?(0,J.jsx)(`div`,{className:`prints-reference-tray`,"aria-label":`Image references`,children:c.references.map((e,t)=>{let n=d.find(t=>t.path===e.path);return(0,J.jsxs)(`div`,{className:`prints-reference-tile`,title:e.path,children:[(0,J.jsx)(`div`,{className:`prints-reference-face mask mask-squircle`,children:n?(0,J.jsx)(`img`,{src:n.url,alt:e.path.split(`/`).at(-1)}):(0,J.jsxs)(`span`,{children:[`Ref `,t+1]})}),(0,J.jsx)(gL,{icon:(0,J.jsx)(kL,{}),className:`prints-reference-remove`,"aria-label":`Remove reference ${String(t+1)}`,onClick:()=>{r.setFieldValue(`references`,c.references.filter(t=>t.path!==e.path))}})]},e.path)})}):null,(0,J.jsx)(r.Field,{name:`prompt`,children:e=>(0,J.jsxs)(`div`,{className:`prints-prompt`,children:[E.slashOpen?(0,J.jsx)(Nae,{index:E.slashIndex,matches:E.slashMatches,onPick:D}):null,(0,J.jsx)(Mae,{disabled:!o||a||i.length===0||s,onChange:t=>{e.handleChange(t)},onSend:p,onSlashMove:E.moveSlash,onSlashPick:()=>{D(E.slashIndex)},placeholder:`What are we making?`,slashCount:E.slashMatches.length,value:e.state.value})]})})]}),t?(0,J.jsxs)(`div`,{className:`prints-composer-guidance`,role:`status`,"data-composer-guidance":!0,children:[(0,J.jsx)(`span`,{children:t.group===`Images`&&t.detail?t.detail:(0,J.jsxs)(J.Fragment,{children:[t.title,`. `,t.detail]})}),t.actions?.map(e=>(0,J.jsx)(mL,{variant:`ghost`,size:`xs`,onClick:e.run,children:e.label},e.label))]}):null,m((0,J.jsxs)(J.Fragment,{children:[e,w&&c.references.length>0?(0,J.jsxs)(`span`,{className:`prints-reference-count`,"data-generation-references":!0,children:[c.references.length,` /`,` `,h?.input.maxReferences??0,` references`]}):null,(0,J.jsx)(r.Field,{name:`model`,children:e=>(0,J.jsxs)(`label`,{className:`prints-model`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Model`}),(0,J.jsxs)(s3,{"aria-label":`Generation model`,"data-generation-model":!0,className:`select-sm`,disabled:a||!o,onChange:t=>{let n=yZ(i,t.currentTarget.value);if(e.handleChange(t.currentTarget.value),!n)return;n.input.steps===`fixed`&&b(!1);let a=r.store.state.fieldMeta,o=bZ(c,n),s=vZ(c,n);(n.input.dimensions===`none`||n.sizes!==null)&&v(!1),r.setFieldValue(`width`,s.width),r.setFieldValue(`height`,s.height),(n.input.steps===`fixed`||!a.steps?.isTouched)&&r.setFieldValue(`steps`,o.steps),n.input.maxReferences===0?r.setFieldValue(`references`,[]):r.store.state.values.references.length>n.input.maxReferences&&r.setFieldValue(`references`,r.store.state.values.references.slice(0,n.input.maxReferences))},value:e.state.value,children:[i.length===0?(0,J.jsx)(`option`,{value:``,children:l===null?`Choose a Computer`:a?`Loading models…`:`Models unavailable`}):null,i.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.label.split(` — `)[0]},e.id))]})]})}),(0,J.jsxs)(`label`,{className:`prints-size`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Size`}),(0,J.jsx)(s3,{"aria-label":`Generation size`,"data-generation-size":!0,className:`select-sm`,disabled:g,title:g?`This model chooses the output size.`:void 0,onChange:e=>{let t=e.currentTarget.value;v(t===`custom`);let n=S.find(e=>e.value===t);n&&(r.setFieldValue(`width`,n.width),r.setFieldValue(`height`,n.height))},value:g?`provider`:C,children:g?(0,J.jsx)(`option`,{value:`provider`,children:`Model default`}):(0,J.jsxs)(J.Fragment,{children:[S.map(e=>(0,J.jsx)(`option`,{value:e.value,children:e.label},e.value)),x?null:(0,J.jsx)(`option`,{value:`custom`,children:`Custom size`})]})})]}),!g&&!x&&C===`custom`?(0,J.jsxs)(`div`,{className:`prints-custom-size`,children:[(0,J.jsx)(r.Field,{name:`width`,children:e=>(0,J.jsxs)(`label`,{className:`space-y-1`,children:[(0,J.jsx)(`span`,{className:`text-xs font-bold`,children:`Width`}),(0,J.jsx)(o3,{"aria-label":`Generation width`,"data-generation-width":!0,max:4096,min:1,onChange:t=>{e.handleChange(Number(t.currentTarget.value)||1)},type:`number`,value:e.state.value})]})}),(0,J.jsx)(r.Field,{name:`height`,children:e=>(0,J.jsxs)(`label`,{className:`space-y-1`,children:[(0,J.jsx)(`span`,{className:`text-xs font-bold`,children:`Height`}),(0,J.jsx)(o3,{"aria-label":`Generation height`,"data-generation-height":!0,max:4096,min:1,onChange:t=>{e.handleChange(Number(t.currentTarget.value)||1)},type:`number`,value:e.state.value})]})})]}):null,h?.video?(0,J.jsx)(r.Field,{name:`durationSeconds`,children:e=>(0,J.jsxs)(`label`,{className:`block space-y-1`,children:[(0,J.jsx)(`span`,{className:`text-xs font-bold`,children:`Seconds`}),(0,J.jsx)(o3,{"aria-label":`Video length in seconds`,"data-generation-duration":!0,max:h.video?.maxSeconds,min:h.video?.minSeconds,onChange:t=>{e.handleChange(Number(t.currentTarget.value)||void 0)},type:`number`,value:e.state.value??``})]})}):null,h&&h.input.steps!==`fixed`?(0,J.jsxs)(m3,{className:`prints-advanced`,children:[(0,J.jsx)(gL,{"aria-label":`Generation settings`,"aria-expanded":y,title:`Generation settings`,type:`button`,icon:(0,J.jsx)(DL,{}),iconSize:`sm`,size:`sm`,onClick:()=>{b(!y)}}),(0,J.jsx)(h3,{open:y,side:`top`,className:`prints-advanced-panel z-30`,children:(0,J.jsx)(r.Field,{name:`steps`,children:e=>(0,J.jsxs)(`label`,{className:`block space-y-1`,children:[(0,J.jsx)(`span`,{className:`text-xs font-bold`,children:`Steps (optional)`}),(0,J.jsx)(o3,{"aria-label":`Generation steps`,"data-generation-steps":!0,max:h.input.maxSteps??void 0,min:1,onChange:t=>{e.handleChange(t.currentTarget.value===``?void 0:Number(t.currentTarget.value))},type:`number`,value:e.state.value??``})]})})})]}):null,l&&u?(0,J.jsxs)(`span`,{className:`sr-only`,"data-generation-computer":!0,title:`Saved to ${l}:${u}`,children:[`Saves to `,u]}):null]}),(0,J.jsx)(mL,{"aria-label":gZ(h),title:gZ(h),className:`prints-generate`,variant:`primary`,size:`sm`,"data-generation-submit":!0,disabled:!o||a||i.length===0||s,"aria-busy":s,onClick:()=>{p()},type:`button`,children:s?(0,J.jsx)(fL,{decorative:!0,size:`sm`}):(0,J.jsx)(zte,{"aria-hidden":`true`,size:20})}))]})})}function Gae({connection:e}){let t=(0,f.useRef)(e);t.current=e;let n=g3(e?.app??null),[r,i]=(0,f.useState)(!1),a=Rie(e?.app??null,n.computerId),[o,s]=(0,f.useState)(null);(0,f.useEffect)(()=>{s(null)},[e,n.computerId]);let c=n.path,{gallery:l,images:u,failed:d,loading:p,gallerySlots:m,canBrowse:h,canRead:g,canWrite:_,reserveSlot:v,failSlot:y,clearSlotError:b,removeSlot:x,openComputerFile:S,uploads:C,uploadFiles:w}=sZ(e,n),T=pM(e,(e,t,n,r)=>(l.refresh(),S(e,t,n,r))),E=l.entries.some(e=>e.path===T.target?.path);(0,f.useEffect)(()=>{T.target&&!E&&l.nextPageReady&&l.loadMore()},[T.target,E,l.nextPageReady,l.loadMore]);let D=u.find(e=>e.source.kind===`computer`&&e.source.computerId===T.target?.computerId&&e.source.path===T.target.path),O=new Set([...l.entries.map(e=>`${n.computerId??``}:${e.path}`),...u.map(e=>e.source.kind===`computer`?`${e.source.computerId}:${e.source.path}`:e.file.name)]).size;Aj(e?.app,[...n.available?[d3(n.path,{checking:n.busy&&n.path===null,editing:n.editing})]:[],...h?[{kind:`text`,id:`prints`,text:`${String(O)} ${O===1?`print`:`prints`}`}]:[]],e=>e.itemId!==`folder`||!n.available?!1:(n.setEditing(!0),!0),t=>{ZX(`prints.status.report`,t),e?.app.ui.showToast({message:`Prints couldn't update its status bar.`,tone:`error`}).catch(e=>{ZX(`prints.status.toast`,e)})});let k=KZ({connection:e,folder:n,effects:{reserve:v,failed:y,saved:({result:e},t)=>{g?S(e.destination.path,`add`,t,e.destination.computerId):y(`${e.destination.computerId}:${e.destination.path}`,`Image saved, but this App cannot read its preview.`)}}}),{state:A,models:j,modelsLoading:M,modelsError:N,canGenerate:P,mediaCapability:F,pendingGenerations:I,activeGenerations:L,recoveryError:R}=k,z=(0,f.useRef)(j),ee=(0,f.useRef)(k);ee.current=k;let te=(0,f.useRef)(null),ne=(0,f.useRef)(null),B=(0,f.useRef)(0),re=(0,f.useRef)(k.submit);re.current=k.submit;let V=Uae(re),H=(0,f.useRef)(V);H.current=V;let ie=g$(V.store,e=>e.values),ae=g$(V.store,e=>e.isSubmitting),oe=e?.app;(0,f.useEffect)(()=>{if(oe)return zae(oe,{readDraft:()=>H.current.store.state.values,readModels:()=>z.current,setDraft:e=>{let t=H.current;if(e.model!==void 0){let n=yZ(z.current,e.model);if(!n)throw Error(`Choose a model from the granted registry.`);let r=bZ(t.store.state.values,n);t.setFieldValue(`model`,r.model),t.setFieldValue(`width`,r.width),t.setFieldValue(`height`,r.height),t.setFieldValue(`steps`,r.steps),t.setFieldValue(`references`,t.store.state.values.references.slice(0,n.input.maxReferences))}e.destination!==void 0&&t.setFieldValue(`destination`,e.destination??void 0),e.height!==void 0&&t.setFieldValue(`height`,e.height),e.prompt!==void 0&&t.setFieldValue(`prompt`,e.prompt),e.references!==void 0&&t.setFieldValue(`references`,e.references),e.steps!==void 0&&t.setFieldValue(`steps`,e.steps??void 0),e.width!==void 0&&t.setFieldValue(`width`,e.width)},submit:()=>H.current.store.state.isSubmitting||ee.current.isRunning()?Promise.resolve(!1):H.current.submitCurrent()})},[oe]),(0,f.useEffect)(()=>{z.current=j},[j]),(0,f.useEffect)(()=>{if(j.length===0||N)return;let e=j.find(e=>e.id===`@cf/black-forest-labs/flux-2-klein-4b`)??j[0];if(!V.store.state.fieldMeta.model?.isTouched){let t=bZ(V.store.state.values,e);V.setFieldValue(`model`,t.model),V.store.state.fieldMeta.width?.isTouched||V.setFieldValue(`width`,t.width),V.store.state.fieldMeta.height?.isTouched||V.setFieldValue(`height`,t.height),V.store.state.fieldMeta.steps?.isTouched||V.setFieldValue(`steps`,t.steps)}},[V,N,j]);let se=yZ(j,ie.model),ce=ie.references,le=se?.input.maxReferences??0,U=(0,f.useRef)({openComputerFile:S,retryPath:k.retryPath,uploads:C});U.current={openComputerFile:S,retryPath:k.retryPath,uploads:C};let ue=D?D.source.kind===`computer`?`${D.source.computerId}:${D.source.path}`:D.file.name:null,de=(0,f.useMemo)(()=>u.map(e=>({key:e.source.kind===`computer`?`${e.source.computerId}:${e.source.path}`:e.file.name,selected:(e.source.kind===`computer`?`${e.source.computerId}:${e.source.path}`:e.file.name)===ue,path:e.source.kind===`computer`?e.source.path:e.file.name,referenced:ce.some(t=>e.source.kind===`computer`&&t.path===e.source.path),referenceDisabled:ce.length>=le&&!ce.some(t=>e.source.kind===`computer`&&t.path===e.source.path),onToggleReference:e.source.kind===`computer`&&le>0?()=>{if(e.source.kind!==`computer`)return;let t=e.source.path,n=ce.some(e=>e.path===t);V.setFieldValue(`references`,n?ce.filter(e=>e.path!==t):[...ce,{path:t}])}:void 0,onInfo:()=>{s(e)},url:e.url,width:e.width,height:e.height,onOpen:()=>{e.source.kind===`computer`?U.current.openComputerFile(e.source.path,`open`,e.source.connection,e.source.computerId):window.open(e.url,`_blank`,`noopener,noreferrer`)}})),[u,ce,le,V,ue]),fe=(0,f.useMemo)(()=>{let e=n.computerId;if(!e)return de;let t=new Map(de.map(e=>[e.key,e])),r=[...l.entries].sort((e,t)=>t.modifiedAt-e.modifiedAt||e.name.localeCompare(t.name)).map(n=>{let r=`${e}:${n.path}`;return t.get(r)??{key:r,path:n.path,width:1,height:1,url:``,pending:!0,pendingLabel:`Loading print…`,onOpen:()=>void 0,onVisible:()=>{l.loadFile(n.path)},error:l.failures.includes(n.name)?`Could not load this print.`:void 0}}),i=new Set(r.map(e=>e.key));return[...r,...de.filter(e=>!i.has(e.key)&&e.key!==ue)]},[de,l.entries,l.loadFile,l.failures,n.computerId,ue]),pe=A.kind===`pending`,me=(0,f.useMemo)(()=>Eae(fe,m,e=>{let n=C.items.find(t=>t.id===e.uploadId),r=e.error??(n?.status===`error`||n?.status===`cancelled`?n.message:void 0);return{key:e.key,path:e.path,width:e.width,height:e.height,url:``,pending:!0,error:r,pendingLabel:n?.status===`complete`||A.kind===`completed`?`Loading preview…`:e.uploadId?`Uploading image…`:`Creating image…`,onOpen:()=>void 0,onRetry:r&&(g||n&&n.status!==`complete`)?()=>{if(b(e.key),n&&n.status!==`complete`){U.current.uploads.retry(n.id);return}!e.uploadId&&U.current.retryPath(e.path)||t.current&&U.current.openComputerFile(e.path,`add`,t.current,e.computerId)}:void 0,onDismiss:r?()=>{x(e.key),e.uploadId&&U.current.uploads.remove(e.uploadId)}:void 0}}),[fe,m,C.items,A.kind,g]),he=ae||pe,ge=m.some(e=>e.error!==void 0),_e=C.items.filter(e=>e.computerId===n.computerId),ve=A.kind===`error`&&N===null?{key:k.errorKey,message:A.message,billing:A.action===`billing`&&e?()=>{e.app.ui.openTeamBilling().catch(n=>{ZX(`open-team-billing`,n),t.current===e&&k.reportRecoveryError(n)})}:void 0,retry:ge?k.retry:void 0}:null,ye=Lie({connected:e!==null,mediaCapability:F,modelsError:N,retryModels:k.retryModels,modelsLoading:M,canGenerate:P,canWrite:_,generationError:ve,recoveryError:R,pendingGenerations:I,activeGenerations:L,gallerySlots:m,computerId:n.computerId,failed:d,uploadError:C.error,uploads:_e,permissions:()=>{e?.app.ui.requestAppPermissions({}).catch(e=>{k.reportRecoveryError(e)})},resume:e=>{k.resume(e)},discard:e=>{k.discard(e)},retryUpload:e=>{C.retry(e)}});a.error&&ye.push({key:`dismissal-storage`,group:`Setup`,tone:`warning`,blocking:!0,short:`Activity not saved`,title:`Activity not saved`,detail:a.error});let W=a.visible(ye),be={generating:L.size,uploading:_e.filter(e=>e.status===`sending`||e.status===`queued`).length},xe={items:_e.filter(e=>e.status===`sending`||e.status===`queued`).map(e=>({id:e.id,name:e.file.name,preview:{kind:`image`,url:e.previewUrl},progress:null,progressLabel:``,statusLabel:e.message,actions:{cancel:{label:`Cancel`,accessibleLabel:`Cancel ${e.file.name}`}}})),onCancel:e=>{C.cancel(e)},onRetry:e=>{C.retry(e)},onRemove:e=>{C.remove(e)}};return(0,J.jsxs)(`main`,{className:`h-full w-full flex flex-col overflow-hidden`,"data-app-pane":`media`,"data-generation-state":A.kind,"data-computer-capability":h?`connected`:`absent`,onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&_&&(e.preventDefault(),w(t.map(e=>(B.current+=1,new File([e],`paste-${String(B.current)}-${aZ(e.name)}`,{type:e.type,lastModified:e.lastModified})))))},children:[(0,J.jsxs)(`div`,{className:`prints-gallery-region`,children:[(0,J.jsx)(a3,{screen:!0,surface:!0,surfaceSize:`lg`,surfaceDepth:`deep`,ref:te,className:`flex-1 min-h-0`,"data-media-scroll":!0,"aria-busy":p||l.loading,onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault();let t=Array.from(e.dataTransfer.files);t.length&&_&&w(t)},children:(0,J.jsxs)(`div`,{className:`prints-gallery-content`,children:[me.length>0?(0,J.jsx)(Tae,{items:me,scrollRef:te,focus:D&&T.target?{key:`${T.target.computerId}:${T.target.path}`,requestId:T.target.requestId,onFocus:()=>{s(D)}}:void 0}):p||l.loading?(0,J.jsx)(u3,{variant:`hint`,role:`status`,"aria-live":`polite`,title:`Loading prints…`,description:`Your library is on its way.`}):(0,J.jsx)(u3,{"aria-live":`polite`,"data-absence":!0,"data-media-empty":!0,role:`status`,variant:`panel`,visual:(0,J.jsx)(TL,{}),title:`Nothing printed yet.`,description:n.computerId===null?`Your images will appear here.`:n.available&&c===null?`Pick a folder in the composer below, then describe something or drop in images.`:`Describe something and it lands here, or drop in images from your Computer.`,...F?{suggestions:Hae.map(e=>({label:e,onSelect:()=>{V.setFieldValue(`prompt`,e)}}))}:{}}),l.hasNextPage&&(0,J.jsx)(mL,{variant:`ghost`,disabled:l.loading,onClick:l.loadMore,children:l.loading?`Loading images…`:`Load more images`})]})}),T.error?(0,J.jsx)(`p`,{role:`alert`,children:`Could not open this print. It may no longer be available on this Computer.`}):null,o&&(o.source.kind===`local`||o.source.connection===e&&o.source.computerId===n.computerId)?(0,J.jsx)($X,{image:o,app:e?.app??null,onClose:()=>{s(null)}},o.url):null]}),(0,J.jsxs)(`div`,{className:`prints-composer-dock`,children:[(0,J.jsx)(`section`,{"aria-label":`Computer uploads`,className:`prints-uploads`,children:(0,J.jsx)(`input`,{ref:ne,type:`file`,disabled:!_||c===null,accept:`image/*`,multiple:!0,hidden:!0,"aria-label":`Choose images to upload`,onChange:e=>{w(Array.from(e.currentTarget.files??[])),e.currentTarget.value=``}})}),(0,J.jsx)(Wae,{guidance:W.find(e=>e.blocking&&e.group===`Setup`)??(A.kind===`error`?W.find(e=>e.key===ve?.key):void 0),commandApp:oe,footer:(e,t)=>(0,J.jsx)(Mie,{notices:W,activity:be,uploads:xe,activityOpen:r,onActivityOpenChange:i,onDismiss:a.dismiss,onDismissAll:()=>{a.dismissAll(ye)},onLoadMore:k.hasMore?k.loadMore:void 0,controls:e,send:t}),actions:(0,J.jsx)(O$,{"aria-label":`Upload images`,title:_?`Upload images to Computer`:`Connect a writable Computer to upload`,icon:(0,J.jsx)(OL,{}),label:null,className:`prints-upload-key`,disabled:!_||c===null,onClick:()=>ne.current?.click()}),form:V,mediaCapability:F&&P&&_&&c!==null,models:j,modelsLoading:M,onSubmit:V.submitCurrent,submitting:he,values:ie,computerId:n.computerId,mediaDirectory:c,referenceImages:u.flatMap(e=>e.source.kind===`computer`?[{path:e.source.path,url:e.url}]:[])})]}),(0,J.jsx)(Pie,{folder:n})]})}var $9=document.getElementById(`media-root`);if(!$9)throw Error(`Media root is missing`);Tj($9,{name:`Prints`,queryClient:nM()},({app:e})=>(0,f.createElement)(Gae,{connection:e?{app:e}:null}));
|