import{d as w,E as b,aC as x,am as E,an as S,p,aD as A,m as B,u as g,b as C,aQ as T,aR as l,aS as P}from"./TwTPH6iZ.js";import{B as O}from"./CFFbbuus.js";import{c as j,o as d}from"./BfcgiW2_.js";function nt(t,e,...n){var r=new O(t);w(()=>{const i=e()??null;r.ensure(i,i&&(s=>i(s,...n)))},b)}function I(t){return typeof t=="function"}function W(t){return t!==null&&typeof t=="object"}const R=["string","number","bigint","boolean"];function _(t){return t==null||R.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>_(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const c=Symbol("box"),f=Symbol("is-writable");function k(t){return W(t)&&c in t}function F(t){return o.isBox(t)&&f in t}function o(t){let e=x(E(t));return{[c]:!0,[f]:!0,get current(){return p(e)},set current(n){S(e,n,!0)}}}function L(t,e){const n=A(t);return e?{[c]:!0,[f]:!0,get current(){return p(n)},set current(r){e(r)}}:{[c]:!0,get current(){return t()}}}function M(t){return o.isBox(t)?t:I(t)?o.with(t):o(t)}function $(t){return Object.entries(t).reduce((e,[n,r])=>o.isBox(r)?(o.isWritableBox(r)?Object.defineProperty(e,n,{get(){return r.current},set(i){r.current=i}}):Object.defineProperty(e,n,{get(){return r.current}}),e):Object.assign(e,{[n]:r}),{})}function v(t){return o.isWritableBox(t)?{[c]:!0,get current(){return t.current}}:t}o.from=M;o.with=L;o.flatten=$;o.readonly=v;o.isBox=k;o.isWritableBox=F;function H(t,e){const n=RegExp(t,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,e):r}}const N=H(/[A-Z]/,t=>`-${t.toLowerCase()}`);function V(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${N(e)}: ${t[e]};`).join(`
`)}function D(t={}){return V(t).replace(`
`," ")}const z={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},rt=D(z),K=typeof window<"u"?window:void 0;function Q(t){let e=t.activeElement;for(;e?.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}class U{#e;#t;constructor(e={}){const{window:n=K,document:r=n?.document}=e;n!==void 0&&(this.#e=r,this.#t=j(i=>{const s=d(n,"focusin",i),u=d(n,"focusout",i);return()=>{s(),u()}}))}get current(){return this.#t?.(),this.#e?Q(this.#e):null}}new U;function X(t,e){switch(t){case"post":g(e);break;case"pre":B(e);break}}function h(t,e,n,r={}){const{lazy:i=!1}=r;let s=!i,u=Array.isArray(t)?[]:void 0;X(e,()=>{const a=Array.isArray(t)?t.map(y=>y()):t();if(!s){s=!0,u=a;return}const m=C(()=>n(a,u));return u=a,m})}function Y(t,e,n){h(t,"post",e,n)}function Z(t,e,n){h(t,"pre",e,n)}Y.pre=Z;class ot{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return T(this.#t)}get(){const e=l(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const n=l(this.#t);return n===void 0?e:n}set(e){return P(this.#t,e)}}function it(t){g(()=>()=>{t()})}const q=typeof document<"u",st=G();function G(){return q&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ut(t){return t instanceof HTMLElement}function ct(t){return t instanceof Element}function at(t){return t!==null}function ft(t){return t instanceof HTMLInputElement&&"select"in t}function lt(t,e){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}export{ot as C,_ as a,o as b,D as c,K as d,ct as e,ft as f,lt as g,ut as h,q as i,st as j,rt as k,at as l,it as o,nt as s,Y as w};
