@maudecode/kanvil 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/server/dist/{auth-BscXb1NQ.mjs → auth-I1XEr0d4.mjs} +272 -7
- package/apps/server/dist/{config-Qxr_7oqZ.mjs → config-CbNqtJEj.mjs} +8 -2
- package/apps/server/dist/index.mjs +22 -186
- package/apps/server/dist/migrate.mjs +1 -1
- package/apps/server/dist/recover.mjs +21 -6
- package/apps/server/drizzle/0013_authentication_policy.sql +2 -0
- package/apps/server/drizzle/meta/0013_snapshot.json +4240 -0
- package/apps/server/drizzle/meta/_journal.json +7 -0
- package/apps/web/dist/assets/{CompositeItem-D9KvUNiq.js → CompositeItem-BWPJ5Mol.js} +1 -1
- package/apps/web/dist/assets/admin-settings-DZqkC6ju.js +1 -0
- package/apps/web/dist/assets/{date-picker-lhXxKIlN.js → date-picker-6H_iwP6t.js} +1 -1
- package/apps/web/dist/assets/{ellipsis-CN74O_EP.js → ellipsis-BT172Uvu.js} +1 -1
- package/apps/web/dist/assets/{forms-456UbfIC.js → forms-B4Vg3CPz.js} +23 -23
- package/apps/web/dist/assets/image-edit-trigger-DGmVtWLC.js +1 -0
- package/apps/web/dist/assets/index-C_a21taR.js +50 -0
- package/apps/web/dist/assets/index-DM-D_3Sv.css +2 -0
- package/apps/web/dist/assets/kbd-tTQGZxaK.js +1 -0
- package/apps/web/dist/assets/link-DoIP9KJ6.js +2 -0
- package/apps/web/dist/assets/{list-order-1UoOT5nR.js → list-order-Bzsrihyr.js} +1 -1
- package/apps/web/dist/assets/member-directory-BiCE8DRq.js +1 -0
- package/apps/web/dist/assets/popover-BhzZ0U1d.js +1 -0
- package/apps/web/dist/assets/project-label-provider-9L7Uts3_.js +1 -0
- package/apps/web/dist/assets/project-settings-Q7Q9Reec.js +1 -0
- package/apps/web/dist/assets/{rotate-ccw-BLeWpuu1.js → rotate-ccw-sjyLwLLy.js} +1 -1
- package/apps/web/dist/assets/settings-B6qD6q1J.js +1 -0
- package/apps/web/dist/assets/settings-layout-B-AwUIMu.js +1 -0
- package/apps/web/dist/assets/switch-D0nFHj6l.js +1 -0
- package/apps/web/dist/assets/{table-BQbZG4BK.js → table-CYZiwo9g.js} +1 -1
- package/apps/web/dist/assets/ticket-detail-B-3vbHSB.js +2 -0
- package/apps/web/dist/assets/ticket-editor-C3d8TZIT.js +1 -0
- package/apps/web/dist/assets/ticket-list-LtGGOnwN.js +5 -0
- package/apps/web/dist/assets/ticket-tags-2rdmkcJV.js +1 -0
- package/apps/web/dist/assets/{upload-5Wg5ou_Z.js → upload-DXPRzAaa.js} +1 -1
- package/apps/web/dist/assets/useNavigate-DFohfUD3.js +1 -0
- package/apps/web/dist/assets/workspace-settings-D3tCm1vH.js +1 -0
- package/apps/web/dist/index.html +8 -4
- package/docs/api.md +4 -0
- package/docs/releasing.md +3 -1
- package/docs/self-hosting.md +9 -1
- package/package.json +2 -1
- package/apps/web/dist/assets/admin-settings-B0u2-aAK.js +0 -1
- package/apps/web/dist/assets/camera-Cv5wKkKn.js +0 -1
- package/apps/web/dist/assets/index-CVzq9BMC.css +0 -2
- package/apps/web/dist/assets/index-Dt8wYIVA.js +0 -51
- package/apps/web/dist/assets/instance-BCNvOvYa.js +0 -1
- package/apps/web/dist/assets/member-directory-C81ugis6.js +0 -1
- package/apps/web/dist/assets/popover-BWk65ByY.js +0 -1
- package/apps/web/dist/assets/project-settings-DnpVfVf5.js +0 -1
- package/apps/web/dist/assets/settings-DUXuOgWn.js +0 -1
- package/apps/web/dist/assets/settings-layout-xR4hrfte.js +0 -1
- package/apps/web/dist/assets/ticket-detail-B9M_eaVu.js +0 -2
- package/apps/web/dist/assets/ticket-editor-Chg1lDuU.js +0 -1
- package/apps/web/dist/assets/ticket-list-C8500tXj.js +0 -5
- package/apps/web/dist/assets/ticket-tags-cbwQ93Gt.js +0 -1
- package/apps/web/dist/assets/workspace-settings-Dte44Kkx.js +0 -1
|
@@ -52,41 +52,41 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
52
52
|
|
|
53
53
|
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=N,c=!Ue.jitless,l=c&&P.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?wr([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Dr(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=>!pe(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=>ve(e,r,We())))}),t)}var Or=H(`$ZodUnion`,(e,t)=>{xn.init(e,t),Ne(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Ne(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Ne(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Ne(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>b(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=>Dr(t,r,e,i)):Dr(o,r,e,i)}});function kr(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Ar=H(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Or.init(e,t);let n=e._zod.parse;Ne(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||S(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=C(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=v(()=>kr(t));e._zod.parse=(i,a)=>{let o=i.value;if(!N(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._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()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),jr=H(`$ZodIntersection`,(e,t)=>{xn.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])=>Nr(e,t,n)):Nr(e,i,a)}});function Mr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(F(e)&&F(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Mr(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=Mr(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 Nr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Mr(t.value,n.value);if(!c.valid){if(pe(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Pr=H(`$ZodTuple`,(e,t)=>{xn.init(e,t);let n=t.items,r=Ue.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=Fr(n,`optin`),l=Fr(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length),d=t.rest?a?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=pe(t)))}if(t.rest&&!f){let e=n.length-1,r=o.slice(n.length),c=i.issues.length;for(let n of r){if(d&&i.issues.length!==c){if(pe(i,c))break;c=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>Ir(t,i,e))):Ir(r,i,e)}}return s.length?Promise.all(s).then(()=>Lr(u,i,n,o,l)):Lr(u,i,n,o,l)}});function Fr(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function Ir(e,t,n){e.issues.length&&t.issues.push(...he(n,e.issues)),t.value[n]=e.value}function Lr(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...he(a,o.issues))}t.value[a]=o.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 Rr=H(`$ZodRecord`,(e,t)=>{xn.init(e,t);let n=Ue.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!F(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ve(e,i,We())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...he(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...he(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Yt.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>ve(e,i,We())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...he(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...he(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),zr=H(`$ZodEnum`,(e,t)=>{xn.init(e,t);let n=m(t.entries),r=new Set(n);e._zod.values=r,Ne(e,`pattern`,e=>{let t=m(e.def.entries).filter(e=>L.has(typeof e));return RegExp(t.length?`^(${t.map(e=>R(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),Br=H(`$ZodLiteral`,(e,t)=>{xn.init(e,t);let n=new Set(t.values);e._zod.values=n,Ne(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?R(e):e?R(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),Vr=H(`$ZodTransform`,(e,t)=>{xn.init(e,t),e._zod.optin=`optional`,Ue.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new He(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));if(i instanceof Promise)throw new Ve;return n.value=i,n}});function Hr(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ur=H(`$ZodOptional`,(e,t)=>{xn.init(e,t),Ne(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Ne(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Ne(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${b(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Hr(e,t)):Hr(e,r)}return t.innerType._zod.run(e,n)}}),Wr=H(`$ZodExactOptional`,(e,t)=>{Ur.init(e,t),Ne(e,`values`,e=>e.def.innerType._zod.values),Ne(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Gr=H(`$ZodNullable`,(e,t)=>{xn.init(e,t),Ne(e,`optin`,e=>e.def.innerType._zod.optin),Ne(e,`optout`,e=>e.def.innerType._zod.optout),Ne(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${b(t.source)}|null)$`):void 0}),Ne(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Kr=H(`$ZodDefault`,(e,t)=>{xn.init(e,t),e._zod.optin=`defaulted`,Ne(e,`values`,e=>e.def.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=>qr(e,t)):qr(r,t)}});function qr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Jr=H(`$ZodPrefault`,(e,t)=>{xn.init(e,t),e._zod.optin=`defaulted`,Ne(e,`values`,e=>e.def.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))}),Yr=H(`$ZodNonOptional`,(e,t)=>{xn.init(e,t),Ne(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].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=>Xr(t,e)):Xr(i,e)}});function Xr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Zr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ve(e,r,We()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Qr=H(`$ZodCatch`,(e,t)=>{xn.init(e,t),Ne(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Ne(e,`optout`,e=>e.def.innerType._zod.optout),Ne(e,`values`,e=>e.def.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({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Zr(e,r,t,n)):Zr(e,r,t,n)}}),$r=H(`$ZodPipe`,(e,t)=>{xn.init(e,t),Ne(e,`values`,e=>e.def.in._zod.values),Ne(e,`optin`,e=>e.def.in._zod.optin),Ne(e,`optout`,e=>e.def.out._zod.optout),Ne(e,`propValues`,e=>e.def.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=>ei(e,t.in,n)):ei(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ei(e,t.out,n)):ei(r,t.out,n)}});function ei(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ti=H(`$ZodReadonly`,(e,t)=>{xn.init(e,t),Ne(e,`propValues`,e=>e.def.innerType._zod.propValues),Ne(e,`values`,e=>e.def.innerType._zod.values),Ne(e,`optin`,e=>e.def.innerType?._zod?.optin),Ne(e,`optout`,e=>e.def.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(ni):ni(r)}});function ni(e){return e.memo||(e.value=Object.freeze(e.value)),e}var ri=H(`$ZodCustom`,(e,t)=>{en.init(e,t),xn.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=>ii(t,n,r,e));ii(i,n,r,e)}});function ii(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(Ce(e))}}var ai=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},oi=`~memo`,si=[];function ci(e){return typeof e==`object`&&!!e}function li(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ui=new WeakMap,di=0,fi=1,pi=2;function mi(e,t,n){let r=ui.get(e);if(r!==void 0)return r?pi:di;if(t.has(e))return pi;t.add(e);let i=di,a=e=>{if(i!==pi&&e?._zod){let r=mi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=di;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?fi:o.value?._zod?mi(o.value,t,n):di;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=C(c);s(e?o(e,!0):fi),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?mi(r,t,!1):fi);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),hi(e,i)}function hi(e,t){return t!==fi&&ui.set(e,t===pi),t}function gi(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var _i,vi=[],yi={alloc(e,t,n){let r=_i;if(!r)return n;_i=void 0;let i={value:n,issues:null};return r.set(t.value,i),vi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&xi(n,e.value))throw new ai;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=mi(e,new Set,!1);if(i===di)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===pi||r?n=!0:r=!0}let l=s.value;if(!ci(l))return t(s,c);let u=c[oi];u||(u={buckets:new WeakMap,backEdges:void 0},c[oi]=u);let d;i===c?d=a:(d=gi(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...li(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;_i=d;let p=vi.length,m=t(s,c);_i=void 0;let h=vi.length>p?vi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?li(e.issues):si),e)):(h&&(h.issues=m.issues.length?li(m.issues):si),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function bi(){return yi}function xi(e,t){let n=e[oi]?.backEdges;return n!==void 0&&ci(t)&&n.has(t)}var Si=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Se(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ee(e.values[0])}`:`Invalid option: expected one of ${h(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${h(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ci(){return{localeError:Si()}}var wi,Ti=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 Ei(){return new Ti}(wi=globalThis).__zod_globalRegistry??(wi.__zod_globalRegistry=Ei());var Di=globalThis.__zod_globalRegistry;function Oi(e){return e.checks&&=[...e.checks],e}function ki(e,t){return new e(Oi({type:`string`,...B(t)}))}function Ai(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...B(t)})}function ji(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...B(t)})}function Mi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...B(t)})}function Ni(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...B(t)})}function Pi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...B(t)})}function Fi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...B(t)})}function Ii(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...B(t)})}function Li(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...B(t)})}function Ri(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...B(t)})}function zi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...B(t)})}function Bi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...B(t)})}function Vi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...B(t)})}function Hi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...B(t)})}function Ui(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...B(t)})}function Wi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...B(t)})}function Gi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...B(t)})}function Ki(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...B(t)})}function qi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...B(t)})}function Ji(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...B(t)})}function Yi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...B(t)})}function Xi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...B(t)})}function Zi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...B(t)})}function Qi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...B(t)})}function $i(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...B(t)})}function ea(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...B(t)})}function ta(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...B(t)})}function na(e,t){return new e(Oi({type:`number`,checks:[],...B(t)}))}function ra(e,t){return new e(Oi({type:`number`,coerce:!0,checks:[],...B(t)}))}function ia(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...B(t)})}function aa(e,t){return new e({type:`boolean`,...B(t)})}function oa(e,t){return new e({type:`null`,...B(t)})}function sa(e){return new e({type:`unknown`})}function ca(e,t){return new e({type:`never`,...B(t)})}function la(e,t){return new rn({check:`less_than`,...B(t),value:e,inclusive:!1})}function ua(e,t){return new rn({check:`less_than`,...B(t),value:e,inclusive:!0})}function da(e,t){return new an({check:`greater_than`,...B(t),value:e,inclusive:!1})}function fa(e,t){return new an({check:`greater_than`,...B(t),value:e,inclusive:!0})}function pa(e,t){return new on({check:`multiple_of`,...B(t),value:e})}function ma(e,t){return new cn({check:`max_length`,...B(t),maximum:e})}function ha(e,t){return new ln({check:`min_length`,...B(t),minimum:e})}function ga(e,t){return new un({check:`length_equals`,...B(t),length:e})}function _a(e,t){return new fn({check:`string_format`,format:`regex`,...B(t),pattern:e})}function va(e){return new pn({check:`string_format`,format:`lowercase`,...B(e)})}function ya(e){return new mn({check:`string_format`,format:`uppercase`,...B(e)})}function ba(e,t){return new hn({check:`string_format`,format:`includes`,...B(t),includes:e})}function xa(e,t){return new gn({check:`string_format`,format:`starts_with`,...B(t),prefix:e})}function Sa(e,t){return new _n({check:`string_format`,format:`ends_with`,...B(t),suffix:e})}function Ca(e){return new vn({check:`overwrite`,tx:e})}function wa(e){return Ca(t=>t.normalize(e))}function Ta(){return Ca(e=>e.trim())}function Ea(){return Ca(e=>e.toLowerCase())}function Da(){return Ca(e=>e.toUpperCase())}function Oa(){return Ca(e=>j(e))}function ka(e,t,n){return new e({type:`array`,element:t,...B(n)})}function Aa(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...B(n)})}function ja(e,t){let n=Ma(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ce(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ce(r))}},e(t.value,t)),t);return n}function Ma(e,t){let n=new en({check:`custom`,...B(t)});return n._zod.check=e,n}function Na(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&S(e,t,n[t]);return e}function Pa(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??Di,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Fa(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Ia(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),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;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,Ia(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Na(o.schema,c),t.io===`input`&&Ka(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 La(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ra(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;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}/${La(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+La(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>
|
|
54
54
|
|
|
55
|
-
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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function za(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;za(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Ba=new Set([`type`,`properties`,`required`,`additionalProperties`]),Va=[`oneOf`,`anyOf`];function Ha(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ua(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ba.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ha(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}S(n,r,e.length===1?e[0]:Ua(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ha(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Wa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ba)if(t in e)return;let n=t.filter(e=>Va.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ua(t);else{let e=n[0],i=Va.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ua([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Na(e,r))}function Ga(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)):Na(i,s),Na(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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())za(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Wa(e)}}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)}Na(i,n.defId?n.schema: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??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,S(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),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:Ja(t,`input`,e.processors),output:Ja(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ka(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 Ka(r.element,n);if(r.type===`set`)return Ka(r.valueType,n);if(r.type===`lazy`)return Ka(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`||r.type===`catch`)return Ka(r.innerType,n);if(r.type===`intersection`)return Ka(r.left,n)||Ka(r.right,n);if(r.type===`record`||r.type===`map`)return Ka(r.keyType,n)||Ka(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Ka(r.in,n)||Ka(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ka(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ka(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ka(e,n))return!0;return!!(r.rest&&Ka(r.rest,n))}return!1}var qa=(e,t={})=>n=>{let r=Pa({...n,processors:t});return Ia(e,r),Ra(r,e),Ga(r,e)},Ja=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Pa({...i??{},target:a,io:t,processors:n});return Ia(e,o),Ra(o,e),Ga(o,e)},Ya=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Xa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Za=(e,t)=>{Ya(e,`minimum`,t),Xa(e,`maximum`,t)},Qa=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},$a=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},eo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},to=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},no=(e,t)=>Ya(e,`minimum`,t.minimum),ro=(e,t)=>Xa(e,`maximum`,t.maximum),io=e=>(t,n)=>{to(t,n.format);let[r,i]=e[n.format];Ya(t,`minimum`,r),Xa(t,`maximum`,i)},ao={greater_than:(e,t)=>Ya(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Xa(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Qa(e,t.value),number_format:io(ne),bigint_format:io(re),min_length:no,max_length:ro,length_equals:(e,t)=>Za(e,t.length),min_size:no,max_size:ro,size_equals:(e,t)=>Za(e,t.size),string_format:(e,t)=>{to(e,t.format),t.pattern&&$a(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>eo(e,t.mime)};function oo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ao[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Ya(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Ya(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Xa(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Xa(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Qa(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&eo(t,i.mime);for(let e of i.patterns??[])$a(t,e);return t}var so={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},co=new Map([[rr,Lt],[ar,Rt]]),lo=e=>co.get(e)??e,uo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=oo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=so[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(lo);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}))])}},fo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=oo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Fa(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},po=(e,t,n,r)=>{n.type=`boolean`},mo=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ho=(e,t,n,r)=>{n.not={}},go=(e,t,n,r)=>{let i=e._zod.def,a=m(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},_o=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Fa(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Fa(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);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}},vo=(e,t,n,r)=>{Fa(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},yo=(e,t,n,r)=>{Fa(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},bo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=oo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Ia(a.element,t,{...r,path:[...r.path,`items`]})};function xo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?xo(t.out):t.type===`catch`?xo(t.innerType):e._zod.optin}var So=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Fa(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)S(i.properties,e,Ia(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?xo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Ia(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Co=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Ia(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wo=(e,t,n,r)=>{let i=e._zod.def,a=Ia(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Ia(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},To=(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)=>Ia(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Ia(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?xo(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=oo(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Eo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Eo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Eo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Yt:Jt).source)),p}var Do=new WeakMap;function Oo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Do.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Eo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var ko=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=oo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Ia(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)S(i.patternProperties,lo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Ia(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Do.get(t);n||(n=[],Do.set(t,n),t.deferred.push(()=>Oo(t))),n.push(e)}i.additionalProperties=Ia(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&xo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Ao=(e,t,n,r)=>{let i=e._zod.def,a=Ia(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`}]},jo=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mo=Symbol();function No(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Fa(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Mo):JSON.parse(o)}var Po=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=No(i.defaultValue,e,t,n,r);o!==Mo&&(n.default=o)},Fo=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=No(i.defaultValue,e,t,n,r);o!==Mo&&(n._prefault=o)},Io=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Fa(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Lo=(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;Ia(o,t,r);let s=t.seen.get(e);s.ref=o},Ro=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},zo=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bo=new WeakSet([Object.prototype,Error.prototype]);function Vo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Ho=(e,t)=>{Ze.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Bo.has(n)||(Bo.add(n),Vo(n,`format`,e=>t=>et(e,t)),Vo(n,`flatten`,e=>t=>$e(e,t)),Vo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,g,2)}),Vo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,g,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Uo=H(`ZodError`,Ho),Wo=H(`ZodError`,Ho,void 0,{Parent:Error}),Go=nt(Wo),Ko=rt(Wo),qo=it(Wo),Jo=ot(Wo),Yo=ft(Wo),Xo=pt(Wo),Zo=mt(Wo),Qo=ht(Wo),$o=gt(Wo),es=_t(Wo),ts=vt(Wo),ns=yt(Wo);function rs(){Ue.localeError||We(Ci())}function is(){Ue.memoizer||We({memoizer:bi()})}var as=H(`ZodType`,(e,t)=>(rs(),xn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(k(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 z(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ac(e,t))},superRefine(e,t){return this.check(jc(e,t))},overwrite(e){return this.check(Ca(e))},optional(){return fc(this)},exactOptional(){return mc(this)},nullable(){return gc(this)},nullish(){return fc(gc(this))},nonoptional(e){return Sc(this,e)},array(){return qs(this)},or(e){return Xs([this,e])},and(e){return ec(this,e)},transform(e){return Ec(this,uc(e))},default(e){return vc(this,e)},prefault(e){return bc(this,e)},catch(e){return wc(this,e)},pipe(e){return Ec(this,e)},readonly(){return Oc(this)},describe(e){let t=this.clone();return Di.add(t,{description:e}),t},meta(...e){if(e.length===0)return Di.get(this);let t=this.clone();return Di.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ee(this,`~standard`,{...wn(this),jsonSchema:{input:Ja(this,`input`),output:Ja(this,`output`)}})},set"~standard"(e){Te(this,`~standard`,e)},parse:function e(t,n){return Go(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ko(this,t,n,{callee:e})},safeParse(e,t){return qo(this,e,t)},async safeParseAsync(e,t){return Jo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Te(this,`spa`,e)},validate(e,t){return lt(this,e,t)},validateAsync(e,t){return dt(this,e,t)},encode:function e(t,n){return Yo(this,t,n,{callee:e})},decode:function e(t,n){return Xo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Zo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Qo(this,t,n,{callee:e})},safeEncode(e,t){return $o(this,e,t)},safeDecode(e,t){return es(this,e,t)},async safeEncodeAsync(e,t){return ts(this,e,t)},async safeDecodeAsync(e,t){return ns(this,e,t)},toJSONSchema(e){return qa(this,{})(e)},get description(){return Di.get(this)?.description},get _def(){return this._zod.def}}),os=H(`_ZodString`,(e,t)=>{Tn.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r)},De({format:e=>oo(e).format??null,minLength:e=>oo(e).minimum??null,maxLength:e=>oo(e).maximum??null},{regex(...e){return this.check(_a(...e))},includes(...e){return this.check(ba(...e))},startsWith(...e){return this.check(xa(...e))},endsWith(...e){return this.check(Sa(...e))},min(...e){return this.check(ha(...e))},max(...e){return this.check(ma(...e))},length(...e){return this.check(ga(...e))},nonempty(...e){return this.check(ha(1,...e))},lowercase(e){return this.check(va(e))},uppercase(e){return this.check(ya(e))},trim(){return this.check(Ta())},normalize(...e){return this.check(wa(...e))},toLowerCase(){return this.check(Ea())},toUpperCase(){return this.check(Da())},slugify(){return this.check(Oa())}})),ss=H(`ZodString`,(e,t)=>{Tn.init(e,t),os.init(e,t)},{email(e){return this.check(Ai(ps,e))},url(e){return this.check(Ii(_s,e))},jwt(e){return this.check(Zi(Ns,e))},emoji(e){return this.check(Li(ys,e))},guid(e){return this.check(ji(hs,e))},uuid(e){return this.check(Mi(gs,e))},uuidv4(e){return this.check(Ni(gs,e))},uuidv6(e){return this.check(Pi(gs,e))},uuidv7(e){return this.check(Fi(gs,e))},nanoid(e){return this.check(Ri(bs,e))},cuid(e){return this.check(zi(xs,e))},cuid2(e){return this.check(Bi(Ss,e))},ulid(e){return this.check(Vi(Cs,e))},base64(e){return this.check(Ji(As,e))},base64url(e){return this.check(Yi(js,e))},xid(e){return this.check(Hi(ws,e))},ksuid(e){return this.check(Ui(Ts,e))},ipv4(e){return this.check(Wi(Es,e))},ipv6(e){return this.check(Gi(Ds,e))},cidrv4(e){return this.check(Ki(Os,e))},cidrv6(e){return this.check(qi(ks,e))},e164(e){return this.check(Xi(Ms,e))},datetime(e){return this.check(Qi(ls,e))},date(e){return this.check($i(us,e))},time(e){return this.check(ea(ds,e))},duration(e){return this.check(ta(fs,e))}});function U(e){return ki(ss,e)}var cs=H(`ZodStringFormat`,(e,t)=>{En.init(e,t),os.init(e,t)}),ls=H(`ZodISODateTime`,(e,t)=>{Gn.init(e,t),cs.init(e,t)}),us=H(`ZodISODate`,(e,t)=>{Kn.init(e,t),cs.init(e,t)}),ds=H(`ZodISOTime`,(e,t)=>{qn.init(e,t),cs.init(e,t)}),fs=H(`ZodISODuration`,(e,t)=>{Jn.init(e,t),cs.init(e,t)}),ps=H(`ZodEmail`,(e,t)=>{kn.init(e,t),cs.init(e,t)});function ms(e){return Ai(ps,e)}var hs=H(`ZodGUID`,(e,t)=>{Dn.init(e,t),cs.init(e,t)}),gs=H(`ZodUUID`,(e,t)=>{On.init(e,t),cs.init(e,t)});function W(e){return Mi(gs,e)}var _s=H(`ZodURL`,(e,t)=>{Ln.init(e,t),cs.init(e,t)});function vs(e){return Ii(_s,e)}var ys=H(`ZodEmoji`,(e,t)=>{Rn.init(e,t),cs.init(e,t)}),bs=H(`ZodNanoID`,(e,t)=>{zn.init(e,t),cs.init(e,t)}),xs=H(`ZodCUID`,(e,t)=>{Bn.init(e,t),cs.init(e,t)}),Ss=H(`ZodCUID2`,(e,t)=>{Vn.init(e,t),cs.init(e,t)}),Cs=H(`ZodULID`,(e,t)=>{Hn.init(e,t),cs.init(e,t)}),ws=H(`ZodXID`,(e,t)=>{Un.init(e,t),cs.init(e,t)}),Ts=H(`ZodKSUID`,(e,t)=>{Wn.init(e,t),cs.init(e,t)}),Es=H(`ZodIPv4`,(e,t)=>{Yn.init(e,t),cs.init(e,t)}),Ds=H(`ZodIPv6`,(e,t)=>{Qn.init(e,t),cs.init(e,t)}),Os=H(`ZodCIDRv4`,(e,t)=>{$n.init(e,t),cs.init(e,t)}),ks=H(`ZodCIDRv6`,(e,t)=>{tr.init(e,t),cs.init(e,t)}),As=H(`ZodBase64`,(e,t)=>{ir.init(e,t),cs.init(e,t)}),js=H(`ZodBase64URL`,(e,t)=>{sr.init(e,t),cs.init(e,t)}),Ms=H(`ZodE164`,(e,t)=>{cr.init(e,t),cs.init(e,t)}),Ns=H(`ZodJWT`,(e,t)=>{ur.init(e,t),cs.init(e,t)}),Ps=H(`ZodNumber`,(e,t)=>{dr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.isFinite=!0},De({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=oo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=oo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=oo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>oo(e).format??null},{gt(e,t){return this.check(da(e,t))},gte(e,t){return this.check(fa(e,t))},min(e,t){return this.check(fa(e,t))},lt(e,t){return this.check(la(e,t))},lte(e,t){return this.check(ua(e,t))},max(e,t){return this.check(ua(e,t))},int(e){return this.check(Ls(e))},safe(e){return this.check(Ls(e))},positive(e){return this.check(da(0,e))},nonnegative(e){return this.check(fa(0,e))},negative(e){return this.check(la(0,e))},nonpositive(e){return this.check(ua(0,e))},multipleOf(e,t){return this.check(pa(e,t))},step(e,t){return this.check(pa(e,t))},finite(){return this}}));function Fs(e){return na(Ps,e)}var Is=H(`ZodNumberFormat`,(e,t)=>{fr.init(e,t),Ps.init(e,t)});function Ls(e){return ia(Is,e)}var Rs=H(`ZodBoolean`,(e,t)=>{pr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r)});function zs(e){return aa(Rs,e)}var Bs=H(`ZodNull`,(e,t)=>{mr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r)});function Vs(e){return oa(Bs,e)}var Hs=H(`ZodUnknown`,(e,t)=>{hr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Us(){return sa(Hs)}var Ws=H(`ZodNever`,(e,t)=>{gr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r)});function Gs(e){return ca(Ws,e)}var Ks=H(`ZodArray`,(e,t)=>{is(),br.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ha(e,t))},nonempty(e){return this.check(ha(1,e))},max(e,t){return this.check(ma(e,t))},length(e,t){return this.check(ga(e,t))},unwrap(){return this.element}});function qs(e,t){return ka(Ks,e,t)}var Js=H(`ZodObject`,(e,t)=>{is(),Er.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),Pe(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return oc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(k(this._zod.def,{catchall:e}))},passthrough(){return this.clone(k(this._zod.def,{catchall:Us()}))},loose(){return this.clone(k(this._zod.def,{catchall:Us()}))},strict(){return this.clone(k(this._zod.def,{catchall:Gs()}))},strip(){return this.clone(k(this._zod.def,{catchall:void 0}))},extend(e){return se(this,e)},safeExtend(e){return le(this,e)},merge(e){return ue(this,e)},pick(e){return ie(this,e)},omit(e){return oe(this,e)},partial(...e){return de(dc,this,e[0])},exactPartial(...e){return de(pc,this,e[0],`exactPartial`)},required(...e){return fe(xc,this,e[0])}});function G(e,t){return new Js({type:`object`,shape:e??{},...B(t)})}var Ys=H(`ZodUnion`,(e,t)=>{Or.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.options=t.options});function Xs(e,t){return new Ys({type:`union`,options:e,...B(t)})}var Zs=H(`ZodDiscriminatedUnion`,(e,t)=>{Ys.init(e,t),Ar.init(e,t)});function Qs(e,t,n){return new Zs({type:`union`,options:t,discriminator:e,...B(n)})}var $s=H(`ZodIntersection`,(e,t)=>{jr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function ec(e,t){return new $s({type:`intersection`,left:e,right:t})}var tc=H(`ZodTuple`,(e,t)=>{is(),Pr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new dc({type:`optional`,innerType:e}))})}});function nc(e,t,n){let r=t instanceof xn;return new tc({type:`tuple`,items:e,rest:r?t:null,...B(r?n:t)})}var rc=H(`ZodRecord`,(e,t)=>{is(),Rr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ic(e,t,n){return!t||!t._zod?new rc({type:`record`,keyType:U(),valueType:e,...B(t)}):new rc({type:`record`,keyType:e,valueType:t,...B(n)})}var ac=H(`ZodEnum`,(e,t)=>{zr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 ac({...t,checks:[],...B(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 ac({...t,checks:[],...B(r),entries:i})}});function oc(e,t){return new ac({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...B(t)})}var sc=H(`ZodLiteral`,(e,t)=>{Br.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(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 cc(e,t){return new sc({type:`literal`,values:Array.isArray(e)?e:[e],...B(t)})}var lc=H(`ZodTransform`,(e,t)=>{is(),Vr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new He(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ce(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ce(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function uc(e){return new lc({type:`transform`,transform:e})}var dc=H(`ZodOptional`,(e,t)=>{Ur.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fc(e){return new dc({type:`optional`,innerType:e})}var pc=H(`ZodExactOptional`,(e,t)=>{Wr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`optional`,innerType:e})}var hc=H(`ZodNullable`,(e,t)=>{Gr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gc(e){return new hc({type:`nullable`,innerType:e})}var _c=H(`ZodDefault`,(e,t)=>{Kr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vc(e,t){return new _c({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():I(t)}})}var yc=H(`ZodPrefault`,(e,t)=>{Jr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e,t){return new yc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():I(t)}})}var xc=H(`ZodNonOptional`,(e,t)=>{Yr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sc(e,t){return new xc({type:`nonoptional`,innerType:e,...B(t)})}var Cc=H(`ZodCatch`,(e,t)=>{Qr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wc(e,t){return new Cc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ie(t)})}var Tc=H(`ZodPipe`,(e,t)=>{$r.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.in=t.in,e.out=t.out});function Ec(e,t){return new Tc({type:`pipe`,in:e,out:t})}var Dc=H(`ZodReadonly`,(e,t)=>{ti.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oc(e){return new Dc({type:`readonly`,innerType:e})}var kc=H(`ZodCustom`,(e,t)=>{ri.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)});function Ac(e,t={}){return Aa(kc,e,t)}function jc(e,t){return ja(e,t)}function Mc(e){return Qi(ls,e)}function Nc(e){return ra(Ps,e)}var K=l(d(),1),Pc=l(p(),1),Fc=[`backlog`,`todo`,`in_progress`,`in_review`,`done`,`cancelled`],Ic=[`done`,`cancelled`],Lc=[`urgent`,`high`,`medium`,`low`,`none`],Rc=[`feature`,`bug`,`chore`,`research`,`documentation`],zc=[`low`,`med`,`high`],Bc=[`reader`,`writer`,`admin`],Vc=[`default`,`red`,`orange`,`amber`,`yellow`,`lime`,`green`,`emerald`,`teal`,`cyan`,`sky`,`blue`,`indigo`,`violet`,`purple`,`fuchsia`,`pink`,`rose`,`gray`],Hc=U().regex(/^#[0-9a-f]{6}$/i).overwrite(e=>e.toLowerCase()),Uc=Xs([oc(Vc),Hc]),Wc=e=>Vc.some(t=>t===e),Gc=e=>Hc.safeParse(e).success,Kc=e=>e?.split(`,`).includes(`admin`)??!1,qc=[`read`,`write`,`claim`,`admin`],Jc=1e7,Yc={backlog:`Backlog`,todo:`To do`,in_progress:`In progress`,in_review:`In review`,done:`Done`,cancelled:`Cancelled`},Xc={urgent:`Urgent`,high:`High`,medium:`Medium`,low:`Low`,none:`No priority`},Zc=U().min(1).max(80),Qc=Mc(),$c=Mc().refine(e=>new Date(e).getUTCFullYear()>=1,`Due date must be in year 1 or later`),el=Fs().int().positive(),tl=U().trim().min(1),nl=qs(tl.max(40)).max(30).overwrite(e=>[...new Set(e)]),rl=G({id:W(),projectId:W(),name:tl.max(40),color:Uc,version:el}),il={limit:Nc().int().min(1).max(100).default(50),offset:Nc().int().min(0).default(0)},al={requestId:W().optional()},ol=G({projectId:Zc}),sl=ol.extend({ticketId:Zc}),cl=G({q:U().trim().max(200).optional(),status:oc(Fc).optional(),priority:oc(Lc).optional(),kind:oc(Rc).optional(),difficulty:oc(zc).optional(),label:U().max(40).optional(),assigneeId:Xs([Zc,cc(`none`)]).optional(),parentId:Zc.optional(),archived:oc([`include`,`only`,`exclude`]).default(`exclude`),due:oc([`overdue`,`today`,`week`,`scheduled`,`none`]).optional(),sort:oc([`priority`,`updated`,`created`,`title`,`labels`,`due`,`number`,`status`,`difficulty`,`kind`,`assignee`]).default(`priority`),order:oc([`asc`,`desc`]).optional()}).strict(),ll={priority:`Priority`,updated:`Recently updated`,created:`Recently created`,title:`Title`,labels:`Labels`,due:`Due date`,number:`Ticket number`,status:`Status`,difficulty:`Difficulty`,kind:`Kind`,assignee:`Assignee`},ul={priority:`asc`,updated:`desc`,created:`desc`,title:`asc`,labels:`asc`,due:`asc`,number:`asc`,status:`asc`,difficulty:`asc`,kind:`asc`,assignee:`asc`},dl={overdue:`Overdue`,today:`Due today`,week:`Due this week`,scheduled:`Has a due date`,none:`No due date`},fl=G({title:tl.max(500).overwrite(e=>e.replace(/\s+/gu,` `)),description:U().max(1e5),acceptanceCriteria:U().max(5e4),status:oc(Fc),priority:oc(Lc),kind:oc(Rc),difficulty:oc(zc).nullable(),labels:nl,scopes:nl,assigneeId:U().nullable(),parentId:W().nullable(),automationReady:zs(),holdReason:U().trim().max(2e3).nullable(),dueAt:$c.nullable(),archived:zs()}).strict(),pl=fl.partial().refine(e=>Object.keys(e).length>0,`Provide at least one change`),ml=G({id:W(),slug:tl.max(80),name:tl.max(120),description:U(),version:el,createdAt:Qc,updatedAt:Qc,role:oc(Bc).nullable()}),hl=G({userId:U(),name:U(),email:U(),role:oc(Bc),image:U().nullable().optional(),source:oc([`project`,`workspace`]).optional(),inheritedRole:oc(Bc).nullable().optional()}),gl=G({iconName:U().nullable().default(null),iconColor:oc(Vc).default(`default`),image:U().nullable().default(null),workspaceId:W(),visibility:oc([`workspace`,`private`]),id:W(),key:U(),name:U(),description:U(),version:el,createdAt:Qc,updatedAt:Qc}),_l=fl.extend({claimRequired:zs(),id:W(),projectId:W(),key:U(),number:Fs().int().positive(),version:el,createdBy:U(),createdAt:Qc,updatedAt:Qc}),vl=G({project:gl,tickets:qs(_l),cursor:U().regex(/^\d+$/)}),yl=G({cursor:U().regex(/^\d+$/)}),bl=G({ready:zs(),reasons:qs(G({code:U(),message:U(),ticketId:W().optional()}))}),xl=G({id:W(),projectId:W(),ticketId:W(),actorId:U(),workerId:U(),expiresAt:Qc,createdAt:Qc}),Sl=G({id:W(),projectId:W(),sourceId:W(),targetId:W(),type:oc([`blocks`,`related`,`duplicate`,`causes`,`clones`,`implements`,`reviews`]),sourceKey:U().optional(),sourceTitle:U().optional(),targetKey:U().optional(),targetTitle:U().optional()}),Cl=oc([`outgoing`,`incoming`]),wl={blocks:[`Blocks`,`Is blocked by`],related:[`Related to`,`Related to`],duplicate:[`Duplicates`,`Is duplicated by`],causes:[`Causes`,`Is caused by`],clones:[`Clones`,`Is cloned by`],implements:[`Implements`,`Is implemented by`],reviews:[`Reviews`,`Is reviewed by`]},Tl=Sl.shape.type.options.flatMap(e=>(e===`related`?[`outgoing`]:Cl.options).map(t=>({value:`${e}:${t}`,label:wl[e][t===`outgoing`?0:1],type:e,direction:t})));function El(e){let[t,n]=nc([Sl.shape.type,Cl]).parse(U().parse(e).split(`:`));return{type:t,direction:n}}function Dl(e,t){let n=e.sourceId===t,r=n?e.targetId:e.sourceId,i=(n?e.targetKey:e.sourceKey)??r,a=n?e.targetTitle:e.sourceTitle;return{id:r,label:wl[e.type][+!n],title:`${i}${a?` · ${a}`:``}`}}var Ol=G({id:W(),projectId:W(),ticketId:W(),actorId:U(),body:U(),version:el,createdAt:Qc,updatedAt:Qc}),kl=G({id:W(),projectId:W(),ticketId:W(),actorId:U(),name:U(),contentType:U(),size:Fs().int().nonnegative(),createdAt:Qc}),Al=G({kind:oc([`pull_request`,`test`,`review`,`deployment`,`device`,`other`]),title:tl.max(200),url:vs().regex(/^https?:\/\//i,`Use an HTTP or HTTPS URL`),commit:U().regex(/^[a-f0-9]{40,64}$/i).nullable().default(null),outcome:oc([`reported`,`pending`,`passed`,`failed`]).default(`reported`),note:U().max(2e4).default(``)}),jl=Al.extend({id:W(),projectId:W(),ticketId:W(),actorId:U(),createdAt:Qc}),Ml=G({id:U().regex(/^\d+$/),projectId:W(),ticketId:W().nullable(),actorId:U(),type:U(),data:ic(U(),Us()),createdAt:Qc}),Nl=G({name:U(),description:U().default(``),version:U(),setupRequired:zs(),oidc:G({id:U(),name:U()}).nullable(),push:zs().default(!1)}),Pl=qs(G({id:W(),readAt:Qc.nullable(),event:Ml})),Fl=G({inApp:zs().default(!0),push:zs().default(!1)}),Il=G({inApp:zs(),push:zs().optional()}).strict();G({token:U().min(1).max(250)}).strict();var Ll=qs(G({id:U(),name:U().nullable(),start:U().nullable(),enabled:zs(),expiresAt:Qc.nullable(),createdAt:Qc,permissions:U().nullable(),metadata:U().nullable()})),Rl=G({id:U(),key:U(),name:U().nullable(),expiresAt:Qc.nullable()}),zl=G({ok:cc(!0)}),Bl={"label.created":`Label created`,"label.updated":`Label updated`,"label.deleted":`Label deleted`,"ticket.created":`Ticket created`,"ticket.updated":`Ticket updated`,"ticket.deleted":`Ticket deleted`,"ticket.claimed":`Work claimed`,"claim.renewed":`Claim renewed`,"claim.released":`Claim released`,"claim.recovered":`Claim recovered`,"comment.created":`Comment added`,"comment.updated":`Comment edited`,"comment.deleted":`Comment deleted`,"relation.added":`Relationship added`,"relation.removed":`Relationship removed`,"attachment.created":`File attached`,"attachment.deleted":`File removed`,"evidence.added":`Evidence attached`,"project.created":`Project created`,"project.updated":`Project updated`,"membership.updated":`Project access changed`};function Vl(e,t=!1){let n=e.type.replaceAll(`.`,` `).replaceAll(`_`,` `),r=Bl[e.type]??n.charAt(0).toUpperCase()+n.slice(1);return!t||!e.ticketId?r:`${r} · ${typeof e.data.key==`string`?e.data.key:e.ticketId}${typeof e.data.title==`string`?` · ${e.data.title}`:``}`}var Hl=e=>G({items:qs(e),total:Fs().int().nonnegative()}),Ul=(e,t,n,r,i,a)=>({input:e,output:t,method:n,path:r,scope:i,description:a}),Wl={list_workspaces:Ul(G({}),qs(ml),`GET`,`/workspaces`,`read`,`List accessible workspaces and the current membership role.`),create_workspace:Ul(G({...al,name:tl.max(120),slug:U().trim().regex(/^[a-z0-9][a-z0-9-]{1,79}$/),description:U().max(5e3).default(``)}).strict(),ml,`POST`,`/workspaces`,`write`,`Create a workspace and become its administrator.`),update_workspace:Ul(G({...al,workspaceId:W(),expectedVersion:el,name:tl.max(120),description:U().max(5e3)}).strict(),ml,`PATCH`,`/workspaces/{workspaceId}`,`admin`,`Update workspace details with version checks.`),list_workspace_members:Ul(G({workspaceId:W()}),qs(hl),`GET`,`/workspaces/{workspaceId}/members`,`read`,`List members of a workspace you belong to.`),set_workspace_member:Ul(G({...al,workspaceId:W(),email:ms(),role:oc(Bc).nullable()}).strict(),zl,`POST`,`/workspaces/{workspaceId}/members`,`admin`,`Manage workspace access; removal also revokes direct project access in this workspace.`),list_projects:Ul(G({workspaceId:W().optional()}),qs(gl.extend({openTickets:Fs().int().nonnegative(),overdueTickets:Fs().int().nonnegative()})),`GET`,`/projects`,`read`,`List projects accessible to the current identity, each with its open and overdue ticket counts.`),create_project:Ul(G({...al,workspaceId:W().optional(),visibility:oc([`workspace`,`private`]).default(`private`),key:U().trim().regex(/^[A-Z][A-Z0-9]{1,9}$/),name:tl.max(120),description:U().max(5e3).default(``)}).strict(),gl,`POST`,`/projects`,`write`,`Create a project with a permanent ticket prefix.`),get_project:Ul(ol,gl,`GET`,`/projects/{projectId}`,`read`,`Read project details, workspace identity, and appearance.`),set_project_icon:Ul(ol.extend({...al,expectedVersion:el,icon:Xs([G({kind:cc(`library`),name:U().regex(/^[a-z0-9-]{1,80}$/),color:oc(Vc).default(`default`)}).strict(),G({kind:cc(`image`),contentType:oc([`image/png`,`image/jpeg`,`image/webp`]),data:U().max(7e5)}).strict(),Vs()])}).strict(),gl,`POST`,`/projects/{projectId}/icon`,`admin`,`Choose an installed library icon, upload an image, or reset the project icon.`),update_project:Ul(ol.extend({...al,expectedVersion:el,visibility:oc([`workspace`,`private`]).optional(),name:tl.max(120),description:U().max(5e3)}).strict(),gl,`PATCH`,`/projects/{projectId}`,`admin`,`Update project details without changing its prefix.`),list_members:Ul(ol,qs(hl),`GET`,`/projects/{projectId}/members`,`read`,`List project members.`),set_member:Ul(ol.extend({...al,email:ms(),role:oc(Bc).nullable()}).strict(),zl,`POST`,`/projects/{projectId}/members`,`admin`,`Add or update an existing user's membership, or remove it with a null role.`),list_tickets:Ul(ol.extend({...cl.shape,...il}),Hl(_l),`GET`,`/projects/{projectId}/tickets`,`read`,`Search tickets with server-side filters, stable ordering, and pagination.`),list_ticket_labels:Ul(ol.extend({archived:cl.shape.archived}),qs(G({name:U(),count:Fs().int().nonnegative()})),`GET`,`/projects/{projectId}/labels`,`read`,`List distinct ticket labels and usage counts across the authorized project, independent of ticket pagination.`),list_project_labels:Ul(ol,qs(rl.extend({count:Fs().int().nonnegative()})),`GET`,`/projects/{projectId}/labels/catalog`,`read`,`List project label definitions, colors, and ticket counts, including unused labels and archived tickets.`),create_project_label:Ul(ol.extend({...al,name:tl.max(40),color:Uc.default(`gray`)}).strict(),rl,`POST`,`/projects/{projectId}/labels`,`admin`,`Create a reusable project label. Label names are unique within the project.`),update_project_label:Ul(ol.extend({...al,labelId:W(),expectedVersion:el,name:tl.max(40),color:Uc}).strict(),rl,`PATCH`,`/projects/{projectId}/labels/{labelId}`,`admin`,`Rename or recolor a project label. Renames update tickets and saved-view filters atomically.`),delete_project_label:Ul(ol.extend({...al,labelId:W(),expectedVersion:el}).strict(),zl,`DELETE`,`/projects/{projectId}/labels/{labelId}`,`admin`,`Delete a project label and remove it from tickets and saved-view filters atomically.`),list_label_colors:Ul(G({}),qs(G({value:Hc,createdAt:Qc})),`GET`,`/label-colors`,`read`,`List the site-wide custom label colors, newest first. A custom color joins the list when a label is saved with it.`),remove_label_color:Ul(G({...al,value:Hc}).strict(),zl,`POST`,`/label-colors/remove`,`write`,`Remove a custom color from the site-wide palette; instance administrators and the person who added it may do so. Labels already using it keep their color.`),get_ticket:Ul(sl,G({ticket:_l,readiness:bl,claim:xl.nullable(),subscribed:zs(),canReleaseClaim:zs()}),`GET`,`/projects/{projectId}/tickets/{ticketId}`,`read`,`Read a ticket by ID or key, with readiness and ownership.`),create_ticket:Ul(ol.extend({...al,title:fl.shape.title,description:U().max(1e5).default(``),acceptanceCriteria:U().max(5e4).default(``),status:oc(Fc).default(`todo`),priority:oc(Lc).default(`medium`),kind:oc(Rc).default(`feature`),difficulty:oc(zc).nullable().default(null),dueAt:$c.nullable().default(null),labels:nl.default([]),scopes:nl.default([]),assigneeId:U().nullable().default(null),parentId:W().nullable().default(null),automationReady:zs().default(!1),holdReason:U().trim().max(2e3).nullable().default(null),archived:zs().default(!1)}).strict(),_l,`POST`,`/projects/{projectId}/tickets`,`write`,`Create a ticket. Reuse requestId when retrying this write.`),update_ticket:Ul(sl.extend({...al,expectedVersion:el,changes:pl,claimId:W().optional()}).strict(),_l,`PATCH`,`/projects/{projectId}/tickets/{ticketId}`,`write`,`Update a ticket with optimistic concurrency. Worker completion requires its active claim.`),bulk_update_tickets:Ul(ol.extend({...al,tickets:qs(G({ticketId:Zc,expectedVersion:el})).min(1).max(100).refine(e=>new Set(e.map(e=>e.ticketId)).size===e.length,`Tickets must be unique`),changes:pl}).strict(),qs(_l),`POST`,`/projects/{projectId}/tickets/bulk`,`write`,`Apply an atomic bulk edit using each ticket's current version.`),delete_ticket:Ul(sl.extend({...al,expectedVersion:el}).strict(),zl,`DELETE`,`/projects/{projectId}/tickets/{ticketId}`,`admin`,`Delete a ticket and publish a deletion event.`),search_tickets:Ul(G({q:U().trim().min(1).max(200),workspaceId:W().optional(),limit:Nc().int().min(1).max(50).default(20)}).strict(),G({items:qs(G({ticket:_l,project:G({id:W(),key:U(),name:U()})}))}),`GET`,`/tickets/search`,`read`,`Search unarchived tickets by key or text across every accessible project, optionally within one workspace.`),list_eligible_tickets:Ul(ol.extend(il),Hl(G({ticket:_l,readiness:bl})),`GET`,`/projects/{projectId}/eligibility`,`read`,`Inspect eligibility and explicit blocking reasons for open tickets.`),list_relations:Ul(sl,qs(Sl),`GET`,`/projects/{projectId}/tickets/{ticketId}/relations`,`read`,`List incoming and outgoing ticket relationships.`),add_relation:Ul(sl.extend({...al,targetId:W(),type:Sl.shape.type,direction:Cl.optional()}).strict(),Sl,`POST`,`/projects/{projectId}/tickets/{ticketId}/relations`,`write`,`Relate tickets while rejecting dependency cycles.`),remove_relation:Ul(ol.extend({...al,relationId:W()}).strict(),zl,`DELETE`,`/projects/{projectId}/relations/{relationId}`,`write`,`Remove a ticket relationship.`),list_comments:Ul(sl.extend(il),Hl(Ol),`GET`,`/projects/{projectId}/tickets/{ticketId}/comments`,`read`,`Read ticket discussion.`),add_comment:Ul(sl.extend({...al,body:tl.max(5e4)}).strict(),Ol,`POST`,`/projects/{projectId}/tickets/{ticketId}/comments`,`write`,`Add a comment with authenticated attribution.`),update_comment:Ul(ol.extend({...al,commentId:W(),expectedVersion:el,body:tl.max(5e4)}).strict(),Ol,`PATCH`,`/projects/{projectId}/comments/{commentId}`,`write`,`Edit your own comment or moderate as a project administrator.`),delete_comment:Ul(ol.extend({...al,commentId:W(),expectedVersion:el}).strict(),zl,`DELETE`,`/projects/{projectId}/comments/{commentId}`,`write`,`Delete your own comment or moderate as a project administrator.`),list_activity:Ul(sl.extend(il),Hl(Ml),`GET`,`/projects/{projectId}/tickets/{ticketId}/activity`,`read`,`Read durable ticket activity.`),upload_attachment:Ul(sl.extend({...al,name:tl.max(255).refine(e=>{for(let t of e)if(t.charCodeAt(0)<32||t.charCodeAt(0)===127)return!1;return!0},`Use a filename without control characters`),contentType:U().max(120).regex(/^[a-z0-9][a-z0-9.+-]*\/[a-z0-9][a-z0-9.+-]*$/i).default(`application/octet-stream`),data:U().max(Math.ceil(Jc/3)*4)}).strict(),kl,`POST`,`/projects/{projectId}/tickets/{ticketId}/attachments`,`write`,`Upload up to 10 MB of base64-encoded bytes. The original filename is metadata, never a filesystem path.`),list_attachments:Ul(sl,qs(kl),`GET`,`/projects/{projectId}/tickets/{ticketId}/attachments`,`read`,`List authorized attachment metadata.`),delete_attachment:Ul(ol.extend({...al,attachmentId:W()}).strict(),zl,`DELETE`,`/projects/{projectId}/attachments/{attachmentId}`,`write`,`Remove an attachment.`),list_evidence:Ul(sl,qs(jl),`GET`,`/projects/{projectId}/tickets/{ticketId}/evidence`,`read`,`Read attributed evidence. Outcomes are reports from the submitting identity.`),add_evidence:Ul(sl.extend({...al,...Al.shape,claimId:W().optional()}).strict(),jl,`POST`,`/projects/{projectId}/tickets/{ticketId}/evidence`,`write`,`Attach evidence with its commit and provenance.`),claim_ticket:Ul(sl.extend({...al,workerId:tl.max(200),expectedVersion:el,leaseSeconds:Fs().int().min(30).max(3600).default(300)}).strict(),xl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim`,`claim`,`Atomically claim ready work. Expired claims require explicit recovery.`),renew_claim:Ul(sl.extend({...al,claimId:W(),leaseSeconds:Fs().int().min(30).max(3600).default(300)}).strict(),xl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim/renew`,`claim`,`Renew the caller's unexpired claim.`),release_claim:Ul(sl.extend({...al,claimId:W()}).strict(),zl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim/release`,`claim`,`Release the caller's claim.`),recover_claim:Ul(sl.extend({...al,claimId:W(),reason:tl.min(10).max(2e3),confirmedStopped:cc(!0)}).strict(),zl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim/recover`,`admin`,`Recover an expired claim only after confirming the worker stopped.`),set_subscription:Ul(sl.extend({...al,enabled:zs()}).strict(),zl,`POST`,`/projects/{projectId}/tickets/{ticketId}/subscription`,`read`,`Subscribe to ticket updates or unsubscribe.`),list_views:Ul(ol,qs(G({id:W(),name:U(),filters:cl})),`GET`,`/projects/{projectId}/views`,`read`,`List your saved project views.`),save_view:Ul(ol.extend({...al,name:tl.max(80),filters:cl}).strict(),G({id:W()}),`POST`,`/projects/{projectId}/views`,`read`,`Save a personal filtered view.`),delete_view:Ul(ol.extend({...al,viewId:W()}).strict(),zl,`DELETE`,`/projects/{projectId}/views/{viewId}`,`read`,`Delete your own saved view.`)},Gl=G({error:G({code:U(),message:U(),details:Us().optional()})}),Kl=G({status:Fs().int().min(400).max(599),code:U(),message:U()}),ql=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.details=r}};function Jl(e,t){return Wl[e].output.parse(t)}function Yl(e){if(e instanceof Error&&/fetch failed|failed to fetch|network request failed|could not connect to the server/i.test(e.message))return`Could not reach Kanvil. Check your connection and retry.`;if(e instanceof Uo)return e.issues.slice(0,3).map(e=>`${e.path.join(`.`)||`Input`}: ${e.message}`).join(`; `);if(e instanceof ql&&Array.isArray(e.details)){let t=qs(G({path:U(),message:U()})).safeParse(e.details);if(t.success)return t.data.slice(0,3).map(e=>`${e.path||`Input`}: ${e.message}`).join(`; `)}return e instanceof Error?e.message:typeof e==`string`?e:`The request could not be completed`}function Xl(e){return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}var Zl=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ql=o(((e,t)=>{t.exports=Zl()})),q=Ql(),$l=K.createContext(void 0),eu=e=>{let t=K.useContext($l);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},tu=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,q.jsx)($l.Provider,{value:e,children:t})),nu={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ru=new class{#e=nu;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 iu(e){setTimeout(e,0)}var au=typeof window>`u`||`Deno`in globalThis;function ou(){}function su(e,t){return typeof e==`function`?e(t):e}function cu(e){return typeof e==`number`&&e>=0&&e!==1/0}function lu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uu(e,t){return typeof e==`function`?e(t):e}function du(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==pu(o,t.options))return!1}else if(!hu(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 fu(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(mu(t.options.mutationKey)!==mu(a))return!1}else if(!hu(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function pu(e,t){return(t?.queryKeyHashFn||mu)(e)}function mu(e){return JSON.stringify(e,(e,t)=>bu(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function hu(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)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!hu(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!hu(e[r],t[r]))return!1;return!0}return!1}var gu=Object.prototype.hasOwnProperty;function _u(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=yu(e)&&yu(t);if(!r&&!(bu(e)&&bu(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:gu.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=_u(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function vu(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 yu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bu(e){if(!xu(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!xu(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function xu(e){return Object.prototype.toString.call(e)===`[object Object]`}function Su(e){return new Promise(t=>{ru.setTimeout(t,e)})}function Cu(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:_u(e,t)}function wu(e){return e}function Tu(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Eu(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Du=Symbol();function Ou(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Du?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ku(e,t){return typeof e==`function`?e(...t):!!e}function Au(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var ju=()=>au,Mu=()=>ju(),Nu=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(){}},Pu=new class extends Nu{#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`}},Fu=iu;function Iu(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Fu,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 Lu=Iu(),Ru=new class extends Nu{#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 zu(e){return Math.min(1e3*2**e,3e4)}function Bu(e){return(e??`online`)!==`online`||Ru.isOnline()}var Vu=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Hu(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ou);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Vu(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Pu.isFocused()&&(e.networkMode===`always`||Ru.isOnline())&&e.canRun(),p=()=>Bu(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(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??(Mu()?0:3),a=e.retryDelay??zu,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Su(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Uu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cu(this.gcTime)&&(this.#e=ru.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Mu()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(ru.clearTimeout(this.#e),this.#e=void 0)}};function Wu(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=>{Au(e,()=>t.signal,()=>n=!0)},u=Ou(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?Eu:Tu;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ku:Gu,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:Gu(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 Gu(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 Ku(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var qu=class extends Uu{#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=Xu(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=Xu(this.options);e.data!==void 0&&(this.setState(Yu(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Cu(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(ou).catch(ou):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=>uu(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Du||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>uu(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:!lu(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=Ou(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`?Wu(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=Hu({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Vu&&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 Vu){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,...Ju(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Yu(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),Lu.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ju(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bu(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Yu(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Xu(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 Zu=class extends Nu{#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),$u(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ed(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ed(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 uu(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&&!vu(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&td(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||uu(this.options.enabled,this.#t)!==uu(t.enabled,this.#t)||uu(this.options.staleTime,this.#t)!==uu(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||uu(this.options.enabled,this.#t)!==uu(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 vu(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(ou)),t}#h(e){return!Mu()&&uu(this.options.enabled,this.#t)!==!1&&cu(e)}#g(){this.#b();let e=uu(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=lu(this.#r.dataUpdatedAt,e)+1;this.#u=ru.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return uu(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=ru.setInterval(()=>{(this.options.refetchIntervalInBackground||Pu.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(ru.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(ru.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&&$u(e,t),o=i&&td(e,n,t,r);(a||o)&&(l={...l,...Ju(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=Cu(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=Cu(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:nd(e,t),refetch:this.refetch,isEnabled:uu(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),vu(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)})})();Lu.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 Qu(e,t){return uu(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||uu(t.retryOnMount,e)!==!1)}function $u(e,t){return Qu(e,t)||e.state.data!==void 0&&ed(e,t,t.refetchOnMount)}function ed(e,t,n){if(uu(t.enabled,e)!==!1&&uu(t.staleTime,e)!==`static`){let r=uu(n,e);return r===`always`||r!==!1&&nd(e,t)}return!1}function td(e,t,n,r){return(e!==t||uu(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&nd(e,n)}function nd(e,t){return uu(t.enabled,e)!==!1&&e.isStaleByTime(uu(t.staleTime,e))}var rd=class extends Uu{#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||id(),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=Hu({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),Lu.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function id(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ad=class extends Nu{#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),vu(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&mu(t.mutationKey)!==mu(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??id();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){Lu.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},od=K.createContext(!1),sd=()=>K.useContext(od),cd=od.Provider;function ld(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ud=K.createContext(ld()),dd=()=>K.useContext(ud),fd=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ku(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},pd=e=>{K.useEffect(()=>{e.clearReset()},[e])},md=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ku(n,[e.error,r])),hd=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))}},gd=(e,t)=>e?.suspense&&t.isPending,_d=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vd(e,t,n){let r=sd(),i=dd(),a=eu(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,hd(o),fd(o,i,s),pd(i);let[l]=K.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(K.useSyncExternalStore(K.useCallback(e=>{let t=d?l.subscribe(Lu.batchCalls(e)):ou;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),K.useEffect(()=>{l.setOptions(o)},[o,l]),gd(o,u))throw _d(o,l,i);if(md({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function yd(e,t){return vd(e,Zu,t)}function bd(e,t){let n=eu(t),[r]=K.useState(()=>new ad(n,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);let i=K.useSyncExternalStore(K.useCallback(e=>r.subscribe(Lu.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=K.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(ou)},[r]);if(i.error&&ku(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var xd=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Sd(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:xd(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Cd=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},wd=e=>{let t=Cd(e);return t.charAt(0).toUpperCase()+t.slice(1)},Td=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ed={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Dd(e){return e!=null}function Od(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ed.width,a=e.size??e.height??Ed.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Td(...c):Td(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ed[`stroke-width`])*Number(e.size??e.width??Ed.width)/Number(t.size??t.width??Ed.width):t.strokeWidth??Ed[`stroke-width`];return[`svg`,{...Object.entries(Ed).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Dd(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Dd(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Dd(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function kd(e,t={}){return Od(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Ad=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},jd=(0,K.createContext)({}),Md=()=>(0,K.useContext)(jd),Nd=(0,K.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Md()??{},y=!!c||Ad(d),[b,x,S=[]]=kd(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Td(v,s),hasA11yProp:y,attributes:d});return(0,K.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,K.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Pd(e,t=[],n=[]){let r=typeof e==`string`?Sd(e,t,n):e,i=(0,K.forwardRef)(({className:e,...t},n)=>(0,K.createElement)(Nd,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=wd(r.name)),i}var Fd={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Fd.node;var Id=Pd(Fd),Ld={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ld.node;var Rd=Pd(Ld),zd={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};zd.node;var Bd=Pd(zd),Vd={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Vd.node;var Hd=Pd(Vd),Ud={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Ud.node;var Wd=Pd(Ud),Gd={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Gd.node;var Kd=Pd(Gd),qd={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};qd.node;var Jd=Pd(qd),Yd={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Yd.node;var Xd=Pd(Yd),Zd={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Zd.node;var Qd=Pd(Zd),$d={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};$d.node;var ef=Pd($d),tf={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};tf.node;var nf=Pd(tf),rf={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};rf.node;var af=Pd(rf),of={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};of.node;var sf=Pd(of),cf={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};cf.node;var lf=Pd(cf),uf={name:`equal`,size:24,node:[[`line`,{x1:`5`,x2:`19`,y1:`9`,y2:`9`,key:`1nwqeh`}],[`line`,{x1:`5`,x2:`19`,y1:`15`,y2:`15`,key:`g8yjpy`}]]};uf.node;var df=Pd(uf),ff={name:`eye-off`,size:24,node:[[`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`}]]};ff.node;var pf=Pd(ff),mf={name:`eye`,size:24,node:[[`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`}]]};mf.node;var hf=Pd(mf),gf={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};gf.node;var _f=Pd(gf),vf={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};vf.node;var yf=Pd(vf),bf={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};bf.node;var xf=Pd(bf),Sf={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Sf.node;var Cf=Pd(Sf),wf={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};wf.node;var Tf=Pd(wf),Ef={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Ef.node;var Df=Pd(Ef),Of=48,kf=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Of-t;return n},Af=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},jf=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Of;n+=i>>>1^-(i&1),t[r]=n}return t},Mf=384,Nf=[],Pf=Af(kf(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Ff=Af(kf(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),If=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Lf=(()=>{let e=Pf.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Pf[n];i<Pf[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Pf[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Pf[i];a<Pf[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Rf=kf(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),zf=Af(kf(`123333359346463635126536711576`)),Bf=kf(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Vf=kf(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Hf=jf(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Uf=(()=>{let e=new Int32Array(319).fill(-1),t=jf(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=jf(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Wf=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Gf=jf(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Kf=jf(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),qf=jf(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),Jf=new Int32Array(995),Yf=new Int32Array(995),Xf=new Int32Array(995),Zf=``,Qf=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Gf.length;r++)for(let i of Wf[qf[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Qf[a*2]=Zf.length,Qf[a*2+1]=i.length,Zf+=i),Jf[n]=Gf[r],Yf[n]=Kf[r],Xf[n]=a,n++}}var $f=jf(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),ep=Af(kf(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),tp=jf(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),np=kf(`ij`),rp=kf(``),ip=kf(`1`),ap={GROUP_COUNT:Mf,customValidatorNames:Nf,edgeStart:Pf,labelStart:Ff,labelText:If,edgeTarget:Lf,nodeGroup:Rf,nodeVlist:Uf,vlistPat:zf,vlistOps:Bf,vlistRef:Vf,vlistGroup:Hf,litAnchor:Jf,litGroup:Yf,litPool:Xf,poolOffsets:Qf,poolText:Zf,adjGid:$f,adjStart:ep,adjTgt:tp,patGid:np,patTgt:rp,postfixLookupGroups:ip,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},op=`line`in Error(),sp=-1,cp=-1,lp=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},up=(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},dp=(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=(lp(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=(lp(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,B=n.prefix??e.prefix??``,ee=B===``?``:B+`:`,te=ee.length,ne=(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$/,ie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,se=0,ce=-1,le=-1,ue=-1,de=-1,fe=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,pe=e=>/\s/.test(String.fromCharCode(e)),me=(e,t,n)=>{if(se=0,ce=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)se=1;else if(r===40&&i===41)se=2;else return;ue=t+1,de=n-1;let a=t+1;if(fe(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!fe(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ce=t+1,le=a,ue=a+1)}},he=(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},V=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ge=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_e=e=>!!e&&!Number.isNaN(Number(e)),ve=(e,t,n)=>{if(n-t<11||!he(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&&he(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&he(e,t+10,t+18,`-normal/`)},ye=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],be=`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(` `)),xe=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Se=(e,t,n,r)=>{if(e>=10){if(e>=25)return ne[e-25](t.slice(n,r));let i=e-10;if(se!==ye[i])return!1;if(ce>=0){for(let e of be[i])if(he(t,ce,le,e))return!0;return!1}switch(xe[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ue,de);return re.test(e)&&!ie.test(e)}case 3:return _e(t.slice(ue,de));case 4:return oe.test(t.slice(ue,de));default:return ae.test(t.slice(ue,de))}}switch(e){case 0:return!0;case 1:return se===0;case 2:return se===1;case 3:return se===2;case 4:return V.test(t.slice(n,r));case 5:return _e(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&&_e(t.slice(n,r-1));case 8:return ge.test(t.slice(n,r));default:return ve(t,n,r)}},Ce=new Set(typeof E==`string`?E.split(` `):E),we=(e,t,n,r,i,a)=>{let o=lp(t,n,r)^(i?2654435769: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},Te=new Map,Ee=new Map,De=2,Oe=4096,ke=(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||Ce.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=Ee.get(s);return c===void 0&&Ee.set(s,c=De++),c},Ae=new Map,je=r,Me=r+4096,Ne=()=>je++,Pe=2097152,Fe=8192,Ie=new Int32Array(Fe),Le=Array(Fe).fill(null),Re=new Int32Array(Fe),ze=new Int32Array(Fe),Be=new Uint8Array(Fe),H=0,Ve=(e,t,n,r,i,a,o,s)=>{let c=e;if(Le[e]!==null){if(Le[e|1]===null)c=e|1;else if(!(H++&3))c=e|H>>2&1;else return}Le[c]=t.slice(n,r),Ie[c]=i,Re[c]=a,ze[c]=o,Be[c]=s},He=()=>Le.fill(null),Ue=256,We=[new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue)],[Ge,Ke,qe,Je]=We,Ye=new Uint8Array(Ue),Xe=new Uint8Array(Ue),Ze=()=>{Ue*=2,We=We.map(e=>{let t=new Int32Array(Ue);return t.set(e),t}),[Ge,Ke,qe,Je]=We;let e=new Uint8Array(Ue);e.set(Ye),Ye=e,Xe=new Uint8Array(Ue)},Qe=64,$e=new Int32Array(Qe),et=new Int32Array(Qe),tt=new Int32Array(r),nt=2048,rt=21,it=new Float64Array(nt),at=new Int32Array(nt),ot=0,st=(e,t)=>{if(e===0&&t<r)return tt[t]===ot?1:(tt[t]=ot,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>rt;for(;at[i]===ot;){if(it[i]===n)return 1;i=i+1&nt-1}return it[i]=n,at[i]=ot,0},ct=(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?sp:we(Ae,e,t+1,r,0,Ne)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=et[t];if(r>n)continue;let i=$e[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;me(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(Se(d[t],e,r,n))return p[h+t]}return sp},lt=e=>{let t=e.length,n=0,c=0,u=!1;(De>Oe||Te.size>Oe)&&(Te=new Map,Ee=new Map,De=2,He()),je>Me&&(Ae=new Map,je=r,He());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&pe(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&&pe(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ue&&Ze();let _=n++;Ge[_]=p,Ke[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Ie[y]===v&&Le[y]!==null&&Le[y].length===g?t=y:Ie[y|1]===v&&Le[y|1]!==null&&Le[y|1].length===g&&(t=y|1),t>=0){let n=Le[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){qe[_]=Re[t],Je[_]=ze[t],Ye[_]=Be[t];continue}}}let b=p;if(te!==0){if(h-p<=te||!e.startsWith(ee,p)){qe[_]=sp,Ve(y,e,p,h,v,sp,0,0);continue}b=p+te}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)&&($e[0]=0,et[0]=M,R=1);let z=cp,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?cp:P,B=R),P!==cp){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=cp;else{let e=i[P],t=i[P+1],c=cp;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===Qe){Qe*=2;let e=new Int32Array(Qe);e.set($e),$e=e;let t=new Int32Array(Qe);t.set(et),et=t}$e[R]=r,et[R]=t+2,R++}}A===D&&(z=F<I?cp:P,B=R);let ne=F<I?cp:P,re,ie=!1;if(A>=0){if(ie=!0,re=ct(e,E,A,z,B),re!==sp&&re<r&&j[re]){let t=ct(e,E,D,ne,R);t!==sp&&t!==re&&(re=t,ie=!1)}else re===sp&&(re=ct(e,E,D,ne,R),ie=!1)}else re=ct(e,E,D,ne,R);let ae=0,oe=0;re===sp?qe[_]=sp:(oe=+!!ie,ae=b>=C?+!!O:we(Te,e,b,C,+!!O,e=>ke(e,O)),qe[_]=re,Ye[_]=oe,Je[_]=ae),Ve(y,e,p,h,v,re,ae,oe)}if(n===0)return``;if(n===1)return Ge[0]===0&&Ke[0]===t?e:e.slice(Ge[0],Ke[0]);if(n*k>nt){for(;n*k>nt;)nt<<=1,rt--;it=new Float64Array(nt),at=new Int32Array(nt)}if(De>=Pe||je>=Pe)throw Error(`cn: too many distinct classes in one merge`);ot=ot+1|0,ot===0&&(tt.fill(0),at.fill(0),ot=1);let f=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===sp){Xe[e]=1;continue}let n=Je[e];if(st(n,t)===1)Xe[e]=0,f=!0;else if(Xe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)st(n,x[e]);if(Ye[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&st(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Xe[m]){m++;continue}let t=Ge[m],r=Ke[m],i=m+1;for(;i<n&&Xe[i]&&Ge[i]===r+1&&e.charCodeAt(r)===32;)r=Ke[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ut=16384,dt=new Int32Array(ut*2),ft=0,pt=1,mt=Object.create(null),ht=Object.create(null),gt=new Map,_t=new Map,vt=0,yt=0,bt=()=>{ft^=ut,pt=pt+1|0,yt=0},xt=e=>{let t=mt[e];if(t!==void 0)return t;let n=up(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=ht[e],t!==void 0)?(mt[e]=t,t):(t=lt(e),i?(mt[e]=t,++vt>z&&(vt=0,ht=mt,mt=Object.create(null),bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},St=e=>{let t=gt.get(e);if(t!==void 0)return t;let n=up(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=_t.get(e),t!==void 0)?(gt.set(e,t),t):(t=lt(e),i?(gt.set(e,t),++vt>z&&(vt=0,_t=gt,gt=new Map,bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},Ct=e=>{let t=up(e,0,e.length),n=(t&16383)+ft;return dt[n]===(t^pt)||dt[n^ut]===(t^pt-1)||(dt[n]=t^pt,++yt>ut&&bt(),!1)},wt=z===0?lt:op?e=>{let t=gt.get(e);return t===void 0?St(e):t}:xt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?wt(arguments[0]):wt(mp.apply(null,arguments))},mergeString:wt,seenBefore:z===0?()=>!1:Ct,mergeUncached:lt}},fp=(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:fp(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},pp=(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:fp(i,t);a&&(n&&(n+=` `),n+=a)}return n},mp=function(){return pp(arguments,!1)},hp=256,gp=16,_p=1024,vp=4096,yp=(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=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(vp).fill(``),l=Array(vp).fill(``),u=Array(vp).fill(``));let i=up(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(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},m=(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},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=fp(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>gp&&(_.miss=gp,_.skip=_p,_.e.length=0,_.at=0);let u=_.e;u.length<hp?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(fp(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;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(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},bp=dp(ap),J=yp(bp.mergeString,bp);bp.merge;function xp({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=K.useRef(e!==void 0),[a,o]=K.useState(()=>t);return[i&&e!==void 0?e:a,K.useCallback(e=>{i||o(e)},[])]}var Y=typeof document<`u`?K.useLayoutEffect:()=>{},Sp={...K},Cp={};function wp(e,t){let n=K.useRef(Cp);return n.current===Cp&&(n.current=e(t)),n}var Tp=Sp.useInsertionEffect,Ep=Tp&&Tp!==Sp.useLayoutEffect?Tp:e=>e();function X(e){let t=wp(Dp).current;return t.next=e,Ep(t.effect),t.trampoline}function Dp(){let e={next:void 0,callback:Op,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Op(){}function kp(e,t,n,r){let i=wp(jp).current;return Mp(i,e,t,n,r)&&Pp(i,[e,t,n,r]),i.callback}function Ap(e){let t=wp(jp).current;return Np(t,e)&&Pp(t,e),t.callback}function jp(){return{callback:null,cleanup:null,refs:[]}}function Mp(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Np(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Pp(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null: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 Fp=19;function Ip(e){return Fp>=e}function Lp(e){if(!K.isValidElement(e))return null;let t=e,n=t.props;return(Ip(19)?n?.ref:t.ref)??null}function Rp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function zp(){}var Bp=Object.freeze([]),Vp=Object.freeze({});function Hp(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)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Up(e,t){return typeof e==`function`?e(t):e}function Wp(e,t){return typeof e==`function`?e(t):e}var Gp={};function Kp(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Jp(t);let a=Jp(e);return t&&(a=Yp(a,t)),n&&(a=Yp(a,n)),r&&(a=Yp(a,r)),i&&(a=Yp(a,i)),a}function qp(e){if(e.length===0)return Gp;if(e.length===1)return Jp(e[0]);let t=Jp(e[0]);for(let n=1;n<e.length;n+=1)t=Yp(t,e[n]);return t}function Jp(e){return $p(e)?{...e(Gp)}:Xp(e)}function Yp(e,t){return $p(t)?t(e):Zp(e,t)}function Xp(e){let t={...e};for(let e in t){let n=t[e];Qp(e,n)&&(t[e]=tm(n))}return t}function Zp(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Rp(e.style,r);break;case`className`:e[n]=rm(e.className,r);break;default:e[n]=Qp(n,r)?em(e[n],r):r}}return e}function Qp(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 $p(e){return typeof e==`function`}function em(e,t){return t?e?(...n)=>{let r=n[0];if(im(r)){let i=r;nm(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:tm(t):e}function tm(e){return e&&((...t)=>{let n=t[0];return im(n)&&nm(n),e(...t)})}function nm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function rm(e,t){return t?e?t+` `+e:t:e}function im(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function am(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=lm(r));let i=om(t,n,r);if(n.enabled===!1)return null;let a=n.state??Vp;return um(e,r,i,a)}function om(e,t,n){let{className:r,style:i}=e,{state:a=Vp,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Up(r,a):void 0,d=l?Wp(i,a):void 0,f=l?Hp(a,c):Vp,p=l&&s?sm(s):void 0,m=l?Rp(f,p)??{}:Vp;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Ap([m.ref,Lp(n),...o]):kp(m.ref,Lp(n),o):kp(null,null)),l?(u!==void 0&&(m.className=rm(m.className,u)),d!==void 0&&(m.style=Rp(m.style,d)),m):Vp}function sm(e){return Array.isArray(e)?qp(e):Kp(void 0,e)}var cm=Symbol.for(`react.lazy`);function lm(e){if(e?.$$typeof!==cm)return e;let t=K.Children.toArray(e)[0];return K.isValidElement(t)?t:e}function um(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Kp(n,t.props);return e.ref=n.ref,K.cloneElement(t,e)}return dm(e,n)}function dm(e,t){return e===`button`?(0,K.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,K.createElement)(`img`,{alt:``,...t,key:t.key}):K.createElement(e,t)}var fm=K.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function pm(){return K.useContext(fm)}function mm(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),[,o]=K.useState(0),s=wp(gm).current,c=wp(hm).current,l=K.useRef(0),u=K.useRef(!0),d=K.useRef(null),f=K.useRef(null),p=X(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=X((e,t)=>{c.set(e,t),p()}),h=X(e=>{c.delete(e),p()}),g=X(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ym(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&bm(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=vm(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=X(()=>{let[e,t]=_m(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=X(e=>(s.add(e),()=>{s.delete(e)})),b=K.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,q.jsx)(fm.Provider,{value:b,children:t})}function hm(){return new Map}function gm(){return new Set}function _m(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>bm(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function vm(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ym(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function bm(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function xm(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 Sm=xm(`https://base-ui.com/production-error`,`Base UI`),Cm=K.createContext(void 0);function wm(){let e=K.useContext(Cm);if(e===void 0)throw Error(Sm(64));return e}var Tm=`data-activation-direction`,Em={tabActivationDirection:e=>({[Tm]:e})};function Dm(e,t,n,r){let i=!1,a=!1,o=r??Vp;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}}function Om(e,t,n){let r=n??Vp;return{reason:e,event:t??new Event(`base-ui`),...r}}var km=`none`,Am=`trigger-press`,jm=`trigger-hover`,Mm=`trigger-focus`,Nm=`outside-press`,Pm=`item-press`,Fm=`close-press`,Im=`focus-out`,Lm=`escape-key`,Rm=`list-navigation`,zm=`keyboard`,Bm=`pointer`,Vm=`cancel-open`,Hm=`sibling-open`,Um=`disabled`,Wm=`missing`,Gm=`initial`,Km=`imperative-action`,qm=`window-resize`,Jm=K.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=K.useRef([]),[f,p]=K.useState(()=>new Map),[m,h]=xp({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=K.useState(()=>new Map),y=K.useRef(void 0),b=K.useCallback(e=>Ym(_,e),[_]),[x,S]=K.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=Xm(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;Y(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=X((e,t)=>{t.activationDirection=Xm(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=X((e,t)=>{i?.(e,Dm(t,void 0,void 0,{activationDirection:`none`}))}),j=X((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=K.useCallback(e=>f.get(e),[f]),N=K.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=K.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=K.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=K.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=K.useRef(!u),R=K.useRef(r),z=K.useRef(u),B=K.useRef(!1);Y(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){B.current&&m!==null&&!y.current?.isConnected&&e(null,Wm);return}B.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===R.current&&(z.current=!1),z.current&&t&&m===R.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=Wm;r?i=Gm:t&&(i=Um),e(n,i)}else r&&F!=null&&(A(m,Gm),L.current=!1)},[I,g,A,F,h,_,m]);let ee=am(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:Em});return(0,q.jsx)(Cm.Provider,{value:P,children:(0,q.jsx)(mm,{elementsRef:d,children:ee})})});function Ym(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function Xm(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=Ym(r,e),c=Ym(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}function Zm(){return typeof window<`u`}function Qm(e){return th(e)?(e.nodeName||``).toLowerCase():`#document`}function $m(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function eh(e){return((th(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function th(e){return Zm()?e instanceof Node||e instanceof $m(e).Node:!1}function nh(e){return Zm()?e instanceof Element||e instanceof $m(e).Element:!1}function rh(e){return Zm()?e instanceof HTMLElement||e instanceof $m(e).HTMLElement:!1}function ih(e){return!Zm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $m(e).ShadowRoot}function ah(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=gh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function oh(e){return/^(table|td|th)$/.test(Qm(e))}function sh(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ch=/transform|translate|scale|rotate|perspective|filter/,lh=/paint|layout|strict|content/,uh=e=>!!e&&e!==`none`,dh;function fh(e){let t=nh(e)?gh(e):e;return uh(t.transform)||uh(t.translate)||uh(t.scale)||uh(t.rotate)||uh(t.perspective)||!mh()&&(uh(t.backdropFilter)||uh(t.filter))||ch.test(t.willChange||``)||lh.test(t.contain||``)}function ph(e){let t=vh(e);for(;rh(t)&&!hh(t);){if(fh(t))return t;if(sh(t))return null;t=vh(t)}return null}function mh(){return dh??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dh}function hh(e){return/^(html|body|#document)$/.test(Qm(e))}function gh(e){return $m(e).getComputedStyle(e)}function _h(e){return nh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vh(e){if(Qm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ih(e)&&e.host||eh(e);return ih(t)?t.host:t}function yh(e){let t=vh(e);return hh(t)?(e.ownerDocument||e).body:rh(t)&&ah(t)?t:yh(t)}function bh(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=yh(e),i=r===e.ownerDocument?.body,a=$m(r);if(i){let e=xh(a);return t.concat(a,a.visualViewport||[],ah(r)?r:[],e&&n?bh(e):[])}return t.concat(r,bh(r,[],n))}function xh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sh(e){return e?.ownerDocument||document}function Ch(){let[,e]=K.useState({});return K.useCallback(()=>{e({})},[])}var wh=0;function Th(e,t=`mui`){let n=K.useRef(void 0),r=Ch(),i=e??n.current;return K.useEffect(()=>{n.current??(wh+=1,n.current=`${t}-${wh}`,e??r())},[e,t,r]),i}var Eh=Sp.useId;function Dh(e,t){if(Eh!==void 0){let n=Eh();return e??(t?`${t}-${n}`:n)}return Th(e,t)}function Oh(e){return Dh(e,`base-ui`)}var kh=K.createContext(void 0);function Ah(e=!1){let t=K.useContext(kh);if(t===void 0&&!e)throw Error(Sm(16));return t}function jh(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:K.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 Mh(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new($m(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 Nh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=K.useRef(null),s=Ah(!0),c=a??s!==void 0,{props:l}=jh({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=K.useCallback(()=>{let e=o.current;Ph(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:K.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Kp({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(nm(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Ph(r),s=!i&&Fh(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(),Mh(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Mh(r,e)))},onKeyUp(e){t||(nm(e),a?.(e),e.target===e.currentTarget&&i&&c&&Ph(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Mh(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,u()})}}function Ph(e){return rh(e)&&e.tagName===`BUTTON`}function Fh(e){return rh(e)&&e.tagName===`A`&&!!e.href}var Ih=`data-composite-item-active`;function Lh(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=pm(),u=K.useRef(-1),[d,f]=K.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=K.useRef(null),h=K.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function Rh(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ah(),{ref:i,index:a}=Lh(e),o=n===a,s=K.useRef(null),c=kp(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var zh=K.createContext(void 0);function Bh(){let e=K.useContext(zh);if(e===void 0)throw Error(Sm(65));return e}function Vh(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Hh,platform:Uh,maxTouchPoints:Wh}=Vh(),Gh=Hh.toLowerCase(),Kh=Uh.toLowerCase(),qh=/^i(os$|p)/.test(Kh)||Kh===`macintel`&&Wh>1,Jh=`android`,Yh=Kh===Jh||Gh.includes(Jh),Xh=!qh&&Kh.startsWith(`mac`);Kh.startsWith(`win`),!Yh&&/^(linux|chrome os)/.test(Kh);var Zh=Xh||qh,Qh=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Qh&&Gh.includes(`firefox`),!Qh&&Gh.includes(`chrom`);var $h=Zh,eg=/jsdom|happydom/.test(Gh);function tg(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ih(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ng(e,t){let n=e;for(;n;){if(nh(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(ih(n)?n.host:null)}return null}function rg(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ig=`data-base-ui-focusable`,ag=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,og=`ArrowLeft`,sg=`ArrowRight`,cg=`ArrowUp`,lg=`ArrowDown`,ug=`data-starting-style`,dg=`data-ending-style`,fg={[ug]:``},pg={[dg]:``},mg={transitionStatus(e){return e===`starting`?fg:e===`ending`?pg:null}},hg=`data-open`,gg=`data-closed`,_g=`data-anchor-hidden`,vg=`data-popup-open`,yg=`data-pressed`,bg={[vg]:``},xg={[vg]:``,[yg]:``},Sg={[hg]:``},Cg={[gg]:``},wg={[_g]:``},Tg={open(e){return e?bg:null}},Eg={open(e){return e?xg:null}},Dg={open(e){return e?Sg:Cg},anchorHidden(e){return e?wg:null}},Og={...Dg,...mg},kg=`data-trigger-disabled`;function Ag(e,t){if(!nh(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(kg);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(kg);return!1}function jg(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 Mg(e){return e.matches(`html,body`)}function Ng(e){return rh(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Pg(e){return ng(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ag}`)!=null}function Fg(e){return e?e.getAttribute(`role`)===`combobox`&&Ng(e):!1}function Ig(e){if(!e||eg)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Lg(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Rg(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Rg(e,t.id,n)])}function zg(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 Bg(e){e.preventDefault(),e.stopPropagation()}function Vg(e){return`nativeEvent`in e}function Hg(e){return e.pointerType===``&&e.isTrusted?!0:Yh&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ug(e){return eg?!1:!Yh&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Yh||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Wg(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Gg(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Kg=Math.min,qg=Math.max,Jg=Math.round,Yg=Math.floor,Xg=e=>({x:e,y:e}),Zg={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Qg(e,t,n){return qg(e,Kg(t,n))}function $g(e,t){return typeof e==`function`?e(t):e}function e_(e){return e.split(`-`)[0]}function t_(e){return e.split(`-`)[1]}function n_(e){return e===`x`?`y`:`x`}function r_(e){return e===`y`?`height`:`width`}function i_(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function a_(e){return n_(i_(e))}function o_(e,t,n){n===void 0&&(n=!1);let r=t_(e),i=a_(e),a=r_(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=h_(o)),[o,h_(o)]}function s_(e){let t=h_(e);return[c_(e),t,c_(t)]}function c_(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var l_=[`left`,`right`],u_=[`right`,`left`],d_=[`top`,`bottom`],f_=[`bottom`,`top`];function p_(e,t,n){switch(e){case`top`:case`bottom`:return n?t?u_:l_:t?l_:u_;case`left`:case`right`:return t?d_:f_;default:return[]}}function m_(e,t,n,r){let i=t_(e),a=p_(e_(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(c_)))),a}function h_(e){let t=e_(e);return Zg[t]+e.slice(t.length)}function g_(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function __(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:g_(e)}function v_(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 y_(e,t){return t<0||t>=e.length}function b_(e,t){return C_(e.current,{disabledIndices:t})}function x_(e,t){return C_(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function S_(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>C_(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:y_(e,u)?-1:u,wrapped:d}}function C_(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&w_(e,a,r));return a}function w_(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!E_(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function T_(e){return e.visibility===`hidden`||e.visibility===`collapse`}function E_(e,t=e?gh(e):null){return!e||!e.isConnected||!t||T_(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var D_=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function O_(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ih(n)?n.host:null}function k_(e){for(let t of Array.from(e.children))if(Qm(t)===`summary`)return t;return null}function A_(e,t){let n=k_(t);return!!n&&(e===n||Z(n,e))}function j_(e){let t=e?Qm(e):``;return e!=null&&e.matches(D_)&&(t!==`summary`||e.parentElement!=null&&Qm(e.parentElement)===`details`&&k_(e.parentElement)===e)&&(t!==`details`||k_(e)==null)&&(t!==`input`||e.type!==`hidden`)}function M_(e){if(!j_(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=O_(t)){let n=t!==e,r=Qm(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Qm(t)===`details`&&!t.open&&!A_(e,t)||t.hasAttribute(`hidden`)||!r&&!N_(t,n))return!1}return!0}function N_(e,t){let n=gh(e);return t?n.display!==`none`:E_(e,n)}function P_(e){let t=e.tabIndex;if(t<0){let t=Qm(e);if(t===`details`||t===`audio`||t===`video`||rh(e)&&e.isContentEditable)return 0}return t}function F_(e){if(Qm(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function I_(e,t){let n=F_(e);if(!n)return!0;let r=t.find(e=>{let t=F_(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=F_(e);return t?.name===n.name&&t.form===n.form})===n}function L_(e){if(rh(e)&&Qm(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return rh(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function R_(e,t){L_(e).forEach(e=>{j_(e)&&t.push(e),R_(e,t)})}function z_(e,t,n){L_(e).forEach(e=>{rh(e)&&e.matches(t)&&n.push(e),z_(e,t,n)})}function B_(e){return M_(e)&&P_(e)>=0}function V_(e){let t=[];return R_(e,t),t.filter(M_)}function H_(e){let t=V_(e);return t.filter(e=>P_(e)>=0&&I_(e,t))}function U_(e,t){let n=H_(e),r=n.length;if(r===0)return;let i=tg(Sh(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function W_(e){return U_(Sh(e).body,1)||e}function G_(e){return U_(Sh(e).body,-1)||e}function K_(e,t,n){if(!e)return null;let r=[];R_(Sh(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(M_);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z(n,o)&&B_(o)&&I_(o,a))return o}return r[i]}function q_(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function J_(e){H_(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Y_(e){let t=[];z_(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 X_=K.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=wm(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=Bh(),{highlightedIndex:v,onHighlightedIndexChange:y}=Ah(),b=Oh(o),{compositeProps:x,compositeRef:S,index:C}=Rh({metadata:K.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=K.useRef(!1),E=K.useRef(null),D=X(e=>{E.current?.(),E.current=e?g(e):null});Y(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=tg(Sh(e));if(t&&Z(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=Nh({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=K.useRef(!1),M=K.useRef(!1);function N(e){f(a,Dm(km,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function F(e){w||r||h&&(!j.current||M.current)&&N(e)}function I(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=Sh(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return am(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:F,onPointerDown:I,[Ih]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:Em})}),Z_=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})),Q_=o(((e,t)=>{t.exports=Z_()})),$_=Q_(),ev=()=>()=>{},tv=()=>!0,nv=()=>!1;function rv(){return(0,$_.useSyncExternalStore)(ev,tv,nv)}function iv(){let[e,t]=K.useState(!1);return K.useEffect(()=>{t(!0)},[]),e}var av=Ip(18)?rv:iv;function ov(){return!av()}var sv=K.createContext(void 0),cv={disableStyleElements:!1};function lv(){return K.useContext(sv)??cv}function uv(e){let{script:t}=e,{nonce:n}=lv();return ov()?(0,q.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}function dv(e){let t=gh(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rh(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(Jg(n)!==a||Jg(r)!==o)&&(n=a,r=o),{width:n,height:r}}function fv(e,t){let n=(t??$m(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}var pv=`--active-tab-left`,mv=`--active-tab-right`,hv=`--active-tab-top`,gv=`--active-tab-bottom`,_v=`--active-tab-width`,vv=`--active-tab-height`,yv,bv={...Em,activeTabPosition:()=>null,activeTabSize:()=>null},xv=2,Sv=K.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=wm(),{tabsListElement:d,registerIndicatorUpdateListener:f}=Bh(),p=Ch();K.useEffect(()=>f(p),[f,p]);let m=0,h=0,g=0,_=0,v=0,y=0,b=!1;if(u!=null&&d!=null){let e=s(u);if(e!=null){b=!0;let{width:t,height:n}=dv(e),{width:r,height:i}=dv(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1,l=Cv(e,d);m=l.left,g=l.top;let u=(a.left-o.left)/s+d.scrollLeft-d.clientLeft,f=(a.top-o.top)/c+d.scrollTop-d.clientTop,p=Tv(e);Math.abs(u-p.x-m)<=xv&&Math.abs(f-p.y-g)<=xv&&(m=u,g=f),v=t,y=n,h=d.scrollWidth-m-v,_=d.scrollHeight-g-y}}let x=b?{left:m,right:h,top:g,bottom:_}:null,S=b?{width:v,height:y}:null,C=b?{[pv]:`${m}px`,[mv]:`${h}px`,[hv]:`${g}px`,[gv]:`${_}px`,[_v]:`${v}px`,[vv]:`${y}px`}:void 0,w=am(`span`,e,{state:{orientation:c,activeTabPosition:x,activeTabSize:S,tabActivationDirection:l},ref:t,props:[{role:`presentation`,style:C,hidden:!(b&&v>0&&y>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:bv});return u==null?null:(0,q.jsxs)(K.Fragment,{children:[w,i&&(yv||=(0,q.jsx)(uv,{script:``}))]})});function Cv(e,t){let n=wv(e),r=wv(t),i=n.left-r.left-t.clientLeft,a=n.top-r.top-t.clientTop,o=vh(e);for(;rh(o)&&o!==t&&!hh(o);)i-=o.scrollLeft,a-=o.scrollTop,o=vh(o);return{left:i,top:a}}function wv(e){let t=0,n=0,r=e;for(;r!=null;){t+=r.offsetLeft,n+=r.offsetTop;let e=r.offsetParent;e!=null&&(t+=e.clientLeft,n+=e.clientTop),r=e}return{left:t,top:n}}function Tv(e){let t=$m(e).getComputedStyle(e),{x:n,y:r}=fv(e,t),i=n,a=r,{translate:o}=t;if(o&&o!==`none`){let t=o.split(` `);i+=Ev(t[0],e.offsetWidth),a+=Ev(t[1],e.offsetHeight)}return{x:i,y:a}}function Ev(e,t){if(!e)return 0;let n=parseFloat(e);return Number.isFinite(n)?e.endsWith(`%`)?n/100*t:n:0}function Dv(e){return Ip(19)?e:e?`true`:void 0}function Ov(e){K.useEffect(e,Bp)}var kv=null;globalThis.requestAnimationFrame;var Av=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)}},jv=class e{static create(){return new e}static request(e){return Av.request(e)}static cancel(e){return Av.cancel(e)}currentId=kv;request(e){this.cancel(),this.currentId=Av.request(()=>{this.currentId=kv,e()})}cancel=()=>{this.currentId!==kv&&(Av.cancel(this.currentId),this.currentId=kv)};disposeEffect=()=>this.cancel};function Mv(){let e=wp(jv.create).current;return Ov(e.disposeEffect),e}function Nv(e){return e==null?e:`current`in e?e.current:e}function Pv(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Fv=null;function Iv(e){if(!Fv){let e=[];Fv=e,queueMicrotask(()=>{Fv=null,Pc.flushSync(()=>{for(let t of e)t()})})}Fv.push(e)}function Lv(e,t=!1,n=!1){let r=Mv();return X((i,a=null)=>{r.cancel();let o=Nv(e);if(o==null)return;let s=o,c=()=>{n?Iv(()=>{a?.aborted||i()}):Pc.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Pv(s).map(e=>e.finished.then(zp))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Pv(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=ug;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})}else r.request(l)})}function Rv(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X(a),s=Lv(r,n,i);K.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function zv(e,t=!1,n=!1,r=!1){let[i,a]=K.useState(e&&t?`idle`:void 0),[o,s]=K.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=jv.request(()=>{a(`ending`)});return()=>{jv.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t||i===void 0)return;let n=jv.request(()=>{a(void 0)});return()=>{jv.cancel(n)}},[t,e,i]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=jv.request(()=>{a(`idle`)});return()=>{jv.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var Bv=`data-index`,Vv={...Em,...mg},Hv=K.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=wm(),p=Oh(),{ref:m,index:h}=Lh(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=zv(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=K.useRef(null),w=am(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:Dv(!g),[Bv]:h},s],stateAttributesMapping:Vv});return Rv({open:g,ref:C,onComplete(){g||y(!1)}}),Y(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null});function Uv(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Wv=`ArrowUp`,Gv=`ArrowDown`,Kv=`ArrowLeft`,qv=`ArrowRight`,Jv=new Set([Wv,Gv,Kv,qv,`Home`,`End`]),Yv=`Shift`,Xv=[Yv,`Control`,`Alt`,`Meta`];function Zv(e){return rh(e)&&e.tagName===`INPUT`}function Qv(e){return!!(Zv(e)&&e.selectionStart!=null||rh(e)&&e.tagName===`TEXTAREA`)}function $v(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=ey(e,t,`left`),a=ty(e),o=ty(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=ey(e,t,`top`),r=ty(e),i=ty(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function ey(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function ty(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function ny(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=Bp}=e,[p,m]=K.useState(0),h=r!=null,g=K.useRef(null),_=kp(g,c),v=K.useRef([]),y=K.useRef(!1),b=K.useRef(null),x=o??p,S=X((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];$v(g.current,t,a,n)}}),C=X(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||w_(e,x,d)?S(ry(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(w_(t,x,d)){let e=C_(t,{disabledIndices:d});y_(t,e)||S(e)}$v(g.current,r,a,n)});Y(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(w_(e,x,d)){let t=C_(e,{disabledIndices:d});y_(e,t)||S(t)}},[d,o,x,v,S]);let w=X((e,t,n)=>i?i(e,t,n,v):n),T=X(e=>{let o=e.key===`Home`||e.key===`End`;if(!Jv.has(e.key)||!l&&o||iy(e,f)||!g.current)return;let s=a===`rtl`,c=s?Kv:qv,p=s?qv:Kv,m=n===`vertical`?Gv:c,_=n===`vertical`?Wv:p,y=rg(e.nativeEvent);if(y!=null&&Qv(y)&&!Uv(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=b_(v,d),T=x_(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=C_(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!y_(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=rg(e.nativeEvent);t&&n!=null&&Qv(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function ry(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!w_(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function iy(e,t){for(let n of Xv)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var ay=K.createContext(void 0);function oy(){return K.useContext(ay)?.direction??`ltr`}function sy(e){let{render:t,className:n,style:r,refs:i=Bp,props:a=Bp,state:o=Vp,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=ny({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:oy(),disabledIndices:v,modifierKeys:y}),k=am(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=K.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,q.jsx)(kh.Provider,{value:A,children:(0,q.jsx)(mm,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var cy=K.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=wm(),[d,f]=K.useState(0),[p,m]=K.useState(null),h=K.useRef(new Set),g=K.useRef(new Set),_=K.useRef(null);Y(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=X(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=X(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=K.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,q.jsx)(zh.Provider,{value:S,children:(0,q.jsx)(sy,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:Em,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:Bp})})});function ly(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=ly(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function uy(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ly(e))&&(r&&(r+=` `),r+=t);return r}var dy=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,fy=uy,py=(e,t)=>n=>{if(t?.variants==null)return fy(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=dy(t)||dy(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 fy(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)};function my({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(Jm,{"data-slot":`tabs`,"data-orientation":t,className:J(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var hy=py(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function gy({className:e,variant:t=`default`,...n}){return(0,q.jsxs)(cy,{"data-slot":`tabs-list`,"data-variant":t,className:J(`relative`,hy({variant:t}),e),...n,children:[n.children,t===`line`&&(0,q.jsx)(Sv,{renderBeforeHydration:!0,className:`absolute bg-primary transition-[left,top,width,height] duration-200 ease-out motion-reduce:transition-none group-data-horizontal/tabs:bottom-[-5px] group-data-horizontal/tabs:left-(--active-tab-left) group-data-horizontal/tabs:h-0.5 group-data-horizontal/tabs:w-(--active-tab-width) group-data-horizontal/tabs:rounded-full group-data-vertical/tabs:top-(--active-tab-top) group-data-vertical/tabs:-left-1 group-data-vertical/tabs:h-(--active-tab-height) group-data-vertical/tabs:w-0.5 group-data-vertical/tabs:rounded-full`})]})}function _y({className:e,...t}){return(0,q.jsx)(X_,{"data-slot":`tabs-trigger`,className:J(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-[13px] font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,e),...t})}function vy({className:e,...t}){return(0,q.jsx)(Hv,{"data-slot":`tabs-content`,className:J(`flex-1 text-sm outline-none`,e),...t})}function yy(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var by=e=>{switch(e){case`success`:return Cy;case`info`:return Ty;case`warning`:return wy;case`error`:return Ey;default:return null}},xy=Array(12).fill(0),Sy=({visible:e,className:t})=>K.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},K.createElement(`div`,{className:`sonner-spinner`},xy.map((e,t)=>K.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Cy=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),wy=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Ty=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ey=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Dy=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},K.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),K.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Oy=()=>{let[e,t]=K.useState(document.hidden);return K.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},ky=1,Ay=100,jy=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:ky++,My=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Ay;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=jy(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],K.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Py(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=jy(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Ny=(e,t)=>My.message(e,t),Py=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Fy=Object.assign(Ny,{success:My.success,info:My.info,warning:My.warning,error:My.error,custom:My.custom,message:My.message,promise:My.promise,dismiss:My.dismiss,loading:My.loading},{getHistory:()=>My.toasts,getToasts:()=>My.getActiveToasts()});yy(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Iy(e){return e.label!==void 0}var Ly=3,Ry=`24px`,zy=`16px`,By=4e3,Vy=356,Hy=14,Uy=45,Wy=200;function Gy(...e){return e.filter(Boolean).join(` `)}function Ky(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var qy=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=K.useState(null),[O,k]=K.useState(null),[A,j]=K.useState(!1),[M,N]=K.useState(!1),[P,F]=K.useState(!1),[I,L]=K.useState(!1),[R,z]=K.useState(!1),[B,ee]=K.useState(0),[te,ne]=K.useState(0),re=K.useRef(n.duration||y||By),ie=K.useRef(null),ae=K.useRef(null),oe=c===0,se=c+1<=o,ce=n.type,le=ce??`default`,ue=n.dismissible!==!1,de=n.className||``,fe=n.descriptionClassName||``,pe=K.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),me=K.useMemo(()=>n.closeButton??p,[n.closeButton,p]),he=K.useMemo(()=>n.duration||y||By,[n.duration,y]),V=K.useRef(0),ge=K.useRef(0),_e=K.useRef(0),ve=K.useRef(null),[ye,be]=b.split(`-`),xe=K.useMemo(()=>s.reduce((e,t,n)=>n>=pe?e:e+t.height,0),[s,pe]),Se=Oy(),Ce=K.useMemo(()=>e.swipeDirections??Ky(b),[e.swipeDirections,b]),we=n.invert||t,Te=ce===`loading`;ge.current=K.useMemo(()=>pe*x+xe,[pe,xe]),K.useEffect(()=>{re.current=he},[he]),K.useEffect(()=>{j(!0)},[]),K.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),K.useLayoutEffect(()=>{if(!A)return;let e=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=K.useCallback(()=>{N(!0),ee(ge.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Wy)},[n,d,a,ge]);K.useEffect(()=>{if(n.promise&&ce===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Se?(()=>{if(_e.current<V.current){let e=new Date().getTime()-V.current;re.current-=e}_e.current=new Date().getTime()})():re.current!==1/0&&(V.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},re.current)),()=>clearTimeout(e)},[u,i,n,ce,Se,Ee]),K.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return w?.loading?K.createElement(`div`,{className:Gy(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ce===`loading`},w.loading):K.createElement(Sy,{className:Gy(C?.loader,n?.classNames?.loader),visible:ce===`loading`})}let Oe=n.icon||w?.[ce]||by(ce);return K.createElement(`li`,{tabIndex:0,ref:ae,className:Gy(_,de,C?.toast,n?.classNames?.toast,C?.[le],n?.classNames?.[le]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":R,"data-removed":M,"data-visible":se,"data-y-position":ye,"data-x-position":be,"data-index":c,"data-front":oe,"data-swiping":P,"data-dismissible":ue,"data-type":ce,"data-invert":we,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?B:ge.current}px`,"--initial-height":S?`auto`:`${te}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),ve.current=null},onPointerDown:e=>{e.button!==2&&!Te&&ue&&(ie.current=new Date,ee(ge.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),ve.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!ue)return;ve.current=null;let e=Number(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?Ce.includes(e>0?`right`:`left`):Ce.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Uy||a>.11))ee(ge.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),L(!0);else{var o,s;(o=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),z(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!ve.current||!ue||window.getSelection()?.toString().length>0)return;let r=e.clientY-ve.current.y,i=e.clientX-ve.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(Ce.includes(`top`)||Ce.includes(`bottom`)){if(Ce.includes(`top`)&&r<0||Ce.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(Ce.includes(`left`)||Ce.includes(`right`))){if(Ce.includes(`left`)&&i<0||Ce.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&z(!0),(t=ae.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ae.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},me&&!n.jsx&&ce!==`loading`?K.createElement(`button`,{"aria-label":T,"data-disabled":Te,"data-close-button":!0,onClick:Te||!ue?()=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Gy(C?.closeButton,n?.classNames?.closeButton)},w?.close??Dy):null,(ce||n.icon||n.promise)&&n.icon!==null&&(w?.[ce]!==null||n.icon)?K.createElement(`div`,{"data-icon":``,className:Gy(C?.icon,n?.classNames?.icon)},ce===`loading`?n.icon||De():n.promise?De():null,ce===`loading`?null:Oe):null,K.createElement(`div`,{"data-content":``,className:Gy(C?.content,n?.classNames?.content)},K.createElement(`div`,{"data-title":``,className:Gy(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?K.createElement(`div`,{"data-description":``,className:Gy(v,fe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),K.isValidElement(n.cancel)?n.cancel:n.cancel&&Iy(n.cancel)?K.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Iy(n.cancel)&&ue&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:Gy(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,K.isValidElement(n.action)?n.action:n.action&&Iy(n.action)?K.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Iy(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:Gy(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Jy(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Yy(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?zy:Ry;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Xy=K.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Ly,toastOptions:g,dir:_=Jy(),gap:v=Hy,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=K.useState([]),w=K.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=K.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=K.useState([]),[O,k]=K.useState(!1),[A,j]=K.useState(!1),[M,N]=K.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=K.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=K.useRef(null),L=K.useRef(!1),R=K.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||My.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return K.useEffect(()=>My.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Pc.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),K.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),K.useEffect(()=>{S.length<=1&&k(!1)},[S]),K.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),K.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),K.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?K.createElement(`ol`,{key:t,dir:_===`auto`?Jy():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Vy}px`,"--gap":`${v}px`,...m,...Yy(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>K.createElement(qy,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Zy=o((e=>{var t=d(),n=Q_();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}})),Qy=o(((e,t)=>{t.exports=Zy()})),$y=K.createContext(void 0);function eb(){let e=K.useContext($y);if(e===void 0)throw Error(Sm(13));return e}var tb={imageLoadingStatus:()=>null},nb=K.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=K.useState(`idle`),c={imageLoadingStatus:o},l=K.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=am(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:tb});return(0,q.jsx)($y.Provider,{value:l,children:u})});function rb(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=K.useState(`idle`),s=o[1];return Y(()=>{if(!a)return zp;if(!e&&!i)return s(`error`),zp;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var ib={...tb,...mg},ab=K.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=eb(),[f,p]=rb(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=zv(m),v=K.useRef(null),y=K.useRef(!0);Y(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=X(e=>{i?.(e),d(e)});Y(()=>{f!==`idle`&&x(f)},[f,x]),Y(()=>()=>d(`idle`),[d]),Rv({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=am(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:ib,enabled:C});return C?T:null}),ob=0,sb=class e{static create(){return new e}currentId=ob;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ob,t()},e)}isStarted(){return this.currentId!==ob}clear=()=>{this.currentId!==ob&&(clearTimeout(this.currentId),this.currentId=ob)};disposeEffect=()=>this.clear};function cb(){let e=wp(sb.create).current;return Ov(e.disposeEffect),e}var lb=K.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=eb(),[c,l]=K.useState(i===0),u=cb();return K.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),am(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:tb,enabled:s!==`loaded`&&(i===0||c)})});function ub({className:e,size:t=`default`,...n}){return(0,q.jsx)(nb,{"data-slot":`avatar`,"data-size":t,className:J(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function db({className:e,...t}){return(0,q.jsx)(ab,{"data-slot":`avatar-image`,className:J(`aspect-square size-full rounded-full object-cover`,e),...t})}function fb({className:e,...t}){return(0,q.jsx)(lb,{"data-slot":`avatar-fallback`,className:J(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function pb({name:e,image:t,className:n}){return(0,q.jsxs)(ub,{"aria-hidden":`true`,className:J(`size-8 overflow-hidden rounded-full text-xs`,n),children:[t&&(0,q.jsx)(db,{src:t,alt:``}),(0,q.jsx)(fb,{className:`rounded-full bg-primary/10 font-medium text-primary text-[length:inherit]`,children:e.trim().split(/\s+/).slice(0,2).map(e=>e.slice(0,1)).join(``).toUpperCase()||`?`})]})}function mb({name:e,email:t,image:n}){return(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,q.jsx)(pb,{name:e,image:n}),(0,q.jsxs)(`span`,{className:`min-w-0`,children:[(0,q.jsx)(`span`,{className:`block wrap-anywhere whitespace-normal font-medium`,children:e}),(0,q.jsx)(`span`,{className:`block break-all whitespace-normal text-xs text-muted-foreground`,children:t})]})]})}var hb=Object.create(null),gb=e=>({}),_b=new Proxy(hb,{get(e,t){return gb()[t]??hb[t]},has(e,t){return t in gb()||t in hb},set(e,t,n){let r=gb(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=gb(!0);return delete n[t],!0},ownKeys(){let e=gb(!0);return Object.keys(e)}});_b.NODE_ENV;function vb(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return vb(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return vb(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return vb(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return vb(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return vb(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return vb(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return vb(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});var yb=1,bb=4,xb=8,Sb=24,Cb={eterm:bb,cons25:bb,console:bb,cygwin:bb,dtterm:bb,gnome:bb,hurd:bb,jfbterm:bb,konsole:bb,kterm:bb,mlterm:bb,mosh:Sb,putty:bb,st:bb,"rxvt-unicode-24bit":Sb,terminator:Sb,"xterm-kitty":Sb},wb=new Map(Object.entries({APPVEYOR:xb,BUILDKITE:xb,CIRCLECI:Sb,DRONE:xb,GITEA_ACTIONS:Sb,GITHUB_ACTIONS:Sb,GITLAB_CI:xb,TRAVIS:xb})),Tb=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Eb(){if(vb(`FORCE_COLOR`)!==void 0)switch(vb(`FORCE_COLOR`)){case``:case`1`:case`true`:return bb;case`2`:return xb;case`3`:return Sb;default:return yb}if(vb(`NODE_DISABLE_COLORS`)!==void 0&&vb(`NODE_DISABLE_COLORS`)!==``||vb(`NO_COLOR`)!==void 0&&vb(`NO_COLOR`)!==``||vb(`TERM`)===`dumb`)return yb;if(vb(`TMUX`))return Sb;if(`TF_BUILD`in _b&&`AGENT_NAME`in _b)return bb;if(`CI`in _b){for(let{0:e,1:t}of wb)if(e in _b)return t;return vb(`CI_NAME`)===`codeship`?xb:yb}if(`TEAMCITY_VERSION`in _b)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(vb(`TEAMCITY_VERSION`))===null?yb:bb;switch(vb(`TERM_PROGRAM`)){case`iTerm.app`:return!vb(`TERM_PROGRAM_VERSION`)||/^[0-2]\./.exec(vb(`TERM_PROGRAM_VERSION`))!==null?xb:Sb;case`HyperTerm`:case`MacTerm`:return Sb;case`Apple_Terminal`:return xb}if(vb(`COLORTERM`)===`truecolor`||vb(`COLORTERM`)===`24bit`)return Sb;if(vb(`TERM`)){if(/truecolor/.exec(vb(`TERM`))!==null)return Sb;if(/^xterm-256/.exec(vb(`TERM`))!==null)return xb;let e=vb(`TERM`).toLowerCase();if(Cb[e])return Cb[e];if(Tb.some(t=>t.exec(e)!==null))return bb}return vb(`COLORTERM`)?bb:yb}var Db=Symbol.for(`better-auth:global`),Ob=null,kb={},Ab=`1.7.8`;function jb(){return globalThis[Db]||(globalThis[Db]={version:Ab,epoch:1,context:kb},Ob=globalThis[Db]),Ob=globalThis[Db],Ob.version!==Ab&&(Ob.version=Ab,Ob.epoch++),globalThis[Db]}function Mb(){return jb().context.endpointContextAsyncStorage?.getStore()}var Nb={reset:`\x1B[0m`,bright:`\x1B[1m`,dim:`\x1B[2m`,undim:`\x1B[22m`,underscore:`\x1B[4m`,blink:`\x1B[5m`,reverse:`\x1B[7m`,hidden:`\x1B[8m`,fg:{black:`\x1B[30m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,white:`\x1B[37m`},bg:{black:`\x1B[40m`,red:`\x1B[41m`,green:`\x1B[42m`,yellow:`\x1B[43m`,blue:`\x1B[44m`,magenta:`\x1B[45m`,cyan:`\x1B[46m`,white:`\x1B[47m`}},Pb=[`debug`,`info`,`success`,`warn`,`error`];function Fb(e,t){return Pb.indexOf(t)>=Pb.indexOf(e)}var Ib={info:Nb.fg.blue,success:Nb.fg.green,warn:Nb.fg.yellow,error:Nb.fg.red,debug:Nb.fg.magenta},Lb=(e,t,n)=>{let r=new Date().toISOString();return n?`${Nb.dim}${r}${Nb.reset} ${Ib[e]}${e.toUpperCase()}${Nb.reset} ${Nb.bright}[Better Auth]:${Nb.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},Rb=(e=>{let t=e?.disabled!==!0,n=e?.level??`warn`,r=e?.disableColors===void 0?Eb()!==1:!e.disableColors,i=(i,a,o=[])=>{if(!t||!Fb(n,i))return;let s=Lb(i,a,r);!e||typeof e.log!=`function`?i===`error`?console.error(s,...o):i===`warn`?console.warn(s,...o):console.log(s,...o):e.log(i===`success`?`info`:i,a,...o)};return{...Object.fromEntries(Pb.map(e=>[e,(...[t,...n])=>i(e,t,n)])),get level(){return n}}})(),zb=()=>{let e=Mb()?.context.logger;return e&&e!==Bb?e:Rb},Bb={debug:(...e)=>zb().debug(...e),info:(...e)=>zb().info(...e),success:(...e)=>zb().success(...e),warn:(...e)=>zb().warn(...e),error:(...e)=>zb().error(...e),get level(){return zb().level}};function Vb(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}function Hb(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function Ub(e){let t=e.split(`
|
|
55
|
+
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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function za(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;za(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Ba=new Set([`type`,`properties`,`required`,`additionalProperties`]),Va=[`oneOf`,`anyOf`];function Ha(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ua(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ba.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ha(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}S(n,r,e.length===1?e[0]:Ua(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ha(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Wa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ba)if(t in e)return;let n=t.filter(e=>Va.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ua(t);else{let e=n[0],i=Va.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ua([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Na(e,r))}function Ga(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)):Na(i,s),Na(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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())za(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Wa(e)}}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)}Na(i,n.defId?n.schema: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??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,S(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),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:Ja(t,`input`,e.processors),output:Ja(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ka(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 Ka(r.element,n);if(r.type===`set`)return Ka(r.valueType,n);if(r.type===`lazy`)return Ka(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`||r.type===`catch`)return Ka(r.innerType,n);if(r.type===`intersection`)return Ka(r.left,n)||Ka(r.right,n);if(r.type===`record`||r.type===`map`)return Ka(r.keyType,n)||Ka(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Ka(r.in,n)||Ka(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ka(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ka(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ka(e,n))return!0;return!!(r.rest&&Ka(r.rest,n))}return!1}var qa=(e,t={})=>n=>{let r=Pa({...n,processors:t});return Ia(e,r),Ra(r,e),Ga(r,e)},Ja=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Pa({...i??{},target:a,io:t,processors:n});return Ia(e,o),Ra(o,e),Ga(o,e)},Ya=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Xa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Za=(e,t)=>{Ya(e,`minimum`,t),Xa(e,`maximum`,t)},Qa=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},$a=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},eo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},to=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},no=(e,t)=>Ya(e,`minimum`,t.minimum),ro=(e,t)=>Xa(e,`maximum`,t.maximum),io=e=>(t,n)=>{to(t,n.format);let[r,i]=e[n.format];Ya(t,`minimum`,r),Xa(t,`maximum`,i)},ao={greater_than:(e,t)=>Ya(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Xa(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Qa(e,t.value),number_format:io(ne),bigint_format:io(re),min_length:no,max_length:ro,length_equals:(e,t)=>Za(e,t.length),min_size:no,max_size:ro,size_equals:(e,t)=>Za(e,t.size),string_format:(e,t)=>{to(e,t.format),t.pattern&&$a(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>eo(e,t.mime)};function oo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ao[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Ya(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Ya(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Xa(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Xa(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Qa(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&eo(t,i.mime);for(let e of i.patterns??[])$a(t,e);return t}var so={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},co=new Map([[rr,Lt],[ar,Rt]]),lo=e=>co.get(e)??e,uo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=oo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=so[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(lo);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}))])}},fo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=oo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Fa(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},po=(e,t,n,r)=>{n.type=`boolean`},mo=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ho=(e,t,n,r)=>{n.not={}},go=(e,t,n,r)=>{let i=e._zod.def,a=m(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},_o=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Fa(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Fa(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);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}},vo=(e,t,n,r)=>{Fa(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},yo=(e,t,n,r)=>{Fa(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},bo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=oo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Ia(a.element,t,{...r,path:[...r.path,`items`]})};function xo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?xo(t.out):t.type===`catch`?xo(t.innerType):e._zod.optin}var So=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Fa(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)S(i.properties,e,Ia(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?xo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Ia(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Co=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Ia(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wo=(e,t,n,r)=>{let i=e._zod.def,a=Ia(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Ia(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},To=(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)=>Ia(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Ia(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?xo(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=oo(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Eo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Eo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Eo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Yt:Jt).source)),p}var Do=new WeakMap;function Oo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Do.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Eo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var ko=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=oo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Ia(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)S(i.patternProperties,lo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Ia(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Do.get(t);n||(n=[],Do.set(t,n),t.deferred.push(()=>Oo(t))),n.push(e)}i.additionalProperties=Ia(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&xo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Ao=(e,t,n,r)=>{let i=e._zod.def,a=Ia(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`}]},jo=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mo=Symbol();function No(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Fa(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Mo):JSON.parse(o)}var Po=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=No(i.defaultValue,e,t,n,r);o!==Mo&&(n.default=o)},Fo=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=No(i.defaultValue,e,t,n,r);o!==Mo&&(n._prefault=o)},Io=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Fa(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Lo=(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;Ia(o,t,r);let s=t.seen.get(e);s.ref=o},Ro=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},zo=(e,t,n,r)=>{let i=e._zod.def;Ia(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bo=new WeakSet([Object.prototype,Error.prototype]);function Vo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Ho=(e,t)=>{Ze.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Bo.has(n)||(Bo.add(n),Vo(n,`format`,e=>t=>et(e,t)),Vo(n,`flatten`,e=>t=>$e(e,t)),Vo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,g,2)}),Vo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,g,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Uo=H(`ZodError`,Ho),Wo=H(`ZodError`,Ho,void 0,{Parent:Error}),Go=nt(Wo),Ko=rt(Wo),qo=it(Wo),Jo=ot(Wo),Yo=ft(Wo),Xo=pt(Wo),Zo=mt(Wo),Qo=ht(Wo),$o=gt(Wo),es=_t(Wo),ts=vt(Wo),ns=yt(Wo);function rs(){Ue.localeError||We(Ci())}function is(){Ue.memoizer||We({memoizer:bi()})}var as=H(`ZodType`,(e,t)=>(rs(),xn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(k(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 z(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ac(e,t))},superRefine(e,t){return this.check(jc(e,t))},overwrite(e){return this.check(Ca(e))},optional(){return fc(this)},exactOptional(){return mc(this)},nullable(){return gc(this)},nullish(){return fc(gc(this))},nonoptional(e){return Sc(this,e)},array(){return qs(this)},or(e){return Xs([this,e])},and(e){return ec(this,e)},transform(e){return Ec(this,uc(e))},default(e){return vc(this,e)},prefault(e){return bc(this,e)},catch(e){return wc(this,e)},pipe(e){return Ec(this,e)},readonly(){return Oc(this)},describe(e){let t=this.clone();return Di.add(t,{description:e}),t},meta(...e){if(e.length===0)return Di.get(this);let t=this.clone();return Di.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ee(this,`~standard`,{...wn(this),jsonSchema:{input:Ja(this,`input`),output:Ja(this,`output`)}})},set"~standard"(e){Te(this,`~standard`,e)},parse:function e(t,n){return Go(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ko(this,t,n,{callee:e})},safeParse(e,t){return qo(this,e,t)},async safeParseAsync(e,t){return Jo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Te(this,`spa`,e)},validate(e,t){return lt(this,e,t)},validateAsync(e,t){return dt(this,e,t)},encode:function e(t,n){return Yo(this,t,n,{callee:e})},decode:function e(t,n){return Xo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Zo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Qo(this,t,n,{callee:e})},safeEncode(e,t){return $o(this,e,t)},safeDecode(e,t){return es(this,e,t)},async safeEncodeAsync(e,t){return ts(this,e,t)},async safeDecodeAsync(e,t){return ns(this,e,t)},toJSONSchema(e){return qa(this,{})(e)},get description(){return Di.get(this)?.description},get _def(){return this._zod.def}}),os=H(`_ZodString`,(e,t)=>{Tn.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r)},De({format:e=>oo(e).format??null,minLength:e=>oo(e).minimum??null,maxLength:e=>oo(e).maximum??null},{regex(...e){return this.check(_a(...e))},includes(...e){return this.check(ba(...e))},startsWith(...e){return this.check(xa(...e))},endsWith(...e){return this.check(Sa(...e))},min(...e){return this.check(ha(...e))},max(...e){return this.check(ma(...e))},length(...e){return this.check(ga(...e))},nonempty(...e){return this.check(ha(1,...e))},lowercase(e){return this.check(va(e))},uppercase(e){return this.check(ya(e))},trim(){return this.check(Ta())},normalize(...e){return this.check(wa(...e))},toLowerCase(){return this.check(Ea())},toUpperCase(){return this.check(Da())},slugify(){return this.check(Oa())}})),ss=H(`ZodString`,(e,t)=>{Tn.init(e,t),os.init(e,t)},{email(e){return this.check(Ai(ps,e))},url(e){return this.check(Ii(_s,e))},jwt(e){return this.check(Zi(Ns,e))},emoji(e){return this.check(Li(ys,e))},guid(e){return this.check(ji(hs,e))},uuid(e){return this.check(Mi(gs,e))},uuidv4(e){return this.check(Ni(gs,e))},uuidv6(e){return this.check(Pi(gs,e))},uuidv7(e){return this.check(Fi(gs,e))},nanoid(e){return this.check(Ri(bs,e))},cuid(e){return this.check(zi(xs,e))},cuid2(e){return this.check(Bi(Ss,e))},ulid(e){return this.check(Vi(Cs,e))},base64(e){return this.check(Ji(As,e))},base64url(e){return this.check(Yi(js,e))},xid(e){return this.check(Hi(ws,e))},ksuid(e){return this.check(Ui(Ts,e))},ipv4(e){return this.check(Wi(Es,e))},ipv6(e){return this.check(Gi(Ds,e))},cidrv4(e){return this.check(Ki(Os,e))},cidrv6(e){return this.check(qi(ks,e))},e164(e){return this.check(Xi(Ms,e))},datetime(e){return this.check(Qi(ls,e))},date(e){return this.check($i(us,e))},time(e){return this.check(ea(ds,e))},duration(e){return this.check(ta(fs,e))}});function U(e){return ki(ss,e)}var cs=H(`ZodStringFormat`,(e,t)=>{En.init(e,t),os.init(e,t)}),ls=H(`ZodISODateTime`,(e,t)=>{Gn.init(e,t),cs.init(e,t)}),us=H(`ZodISODate`,(e,t)=>{Kn.init(e,t),cs.init(e,t)}),ds=H(`ZodISOTime`,(e,t)=>{qn.init(e,t),cs.init(e,t)}),fs=H(`ZodISODuration`,(e,t)=>{Jn.init(e,t),cs.init(e,t)}),ps=H(`ZodEmail`,(e,t)=>{kn.init(e,t),cs.init(e,t)});function ms(e){return Ai(ps,e)}var hs=H(`ZodGUID`,(e,t)=>{Dn.init(e,t),cs.init(e,t)}),gs=H(`ZodUUID`,(e,t)=>{On.init(e,t),cs.init(e,t)});function W(e){return Mi(gs,e)}var _s=H(`ZodURL`,(e,t)=>{Ln.init(e,t),cs.init(e,t)});function vs(e){return Ii(_s,e)}var ys=H(`ZodEmoji`,(e,t)=>{Rn.init(e,t),cs.init(e,t)}),bs=H(`ZodNanoID`,(e,t)=>{zn.init(e,t),cs.init(e,t)}),xs=H(`ZodCUID`,(e,t)=>{Bn.init(e,t),cs.init(e,t)}),Ss=H(`ZodCUID2`,(e,t)=>{Vn.init(e,t),cs.init(e,t)}),Cs=H(`ZodULID`,(e,t)=>{Hn.init(e,t),cs.init(e,t)}),ws=H(`ZodXID`,(e,t)=>{Un.init(e,t),cs.init(e,t)}),Ts=H(`ZodKSUID`,(e,t)=>{Wn.init(e,t),cs.init(e,t)}),Es=H(`ZodIPv4`,(e,t)=>{Yn.init(e,t),cs.init(e,t)}),Ds=H(`ZodIPv6`,(e,t)=>{Qn.init(e,t),cs.init(e,t)}),Os=H(`ZodCIDRv4`,(e,t)=>{$n.init(e,t),cs.init(e,t)}),ks=H(`ZodCIDRv6`,(e,t)=>{tr.init(e,t),cs.init(e,t)}),As=H(`ZodBase64`,(e,t)=>{ir.init(e,t),cs.init(e,t)}),js=H(`ZodBase64URL`,(e,t)=>{sr.init(e,t),cs.init(e,t)}),Ms=H(`ZodE164`,(e,t)=>{cr.init(e,t),cs.init(e,t)}),Ns=H(`ZodJWT`,(e,t)=>{ur.init(e,t),cs.init(e,t)}),Ps=H(`ZodNumber`,(e,t)=>{dr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.isFinite=!0},De({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=oo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=oo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=oo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>oo(e).format??null},{gt(e,t){return this.check(da(e,t))},gte(e,t){return this.check(fa(e,t))},min(e,t){return this.check(fa(e,t))},lt(e,t){return this.check(la(e,t))},lte(e,t){return this.check(ua(e,t))},max(e,t){return this.check(ua(e,t))},int(e){return this.check(Ls(e))},safe(e){return this.check(Ls(e))},positive(e){return this.check(da(0,e))},nonnegative(e){return this.check(fa(0,e))},negative(e){return this.check(la(0,e))},nonpositive(e){return this.check(ua(0,e))},multipleOf(e,t){return this.check(pa(e,t))},step(e,t){return this.check(pa(e,t))},finite(){return this}}));function Fs(e){return na(Ps,e)}var Is=H(`ZodNumberFormat`,(e,t)=>{fr.init(e,t),Ps.init(e,t)});function Ls(e){return ia(Is,e)}var Rs=H(`ZodBoolean`,(e,t)=>{pr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r)});function zs(e){return aa(Rs,e)}var Bs=H(`ZodNull`,(e,t)=>{mr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r)});function Vs(e){return oa(Bs,e)}var Hs=H(`ZodUnknown`,(e,t)=>{hr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Us(){return sa(Hs)}var Ws=H(`ZodNever`,(e,t)=>{gr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r)});function Gs(e){return ca(Ws,e)}var Ks=H(`ZodArray`,(e,t)=>{is(),br.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ha(e,t))},nonempty(e){return this.check(ha(1,e))},max(e,t){return this.check(ma(e,t))},length(e,t){return this.check(ga(e,t))},unwrap(){return this.element}});function qs(e,t){return ka(Ks,e,t)}var Js=H(`ZodObject`,(e,t)=>{is(),Er.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),Pe(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return oc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(k(this._zod.def,{catchall:e}))},passthrough(){return this.clone(k(this._zod.def,{catchall:Us()}))},loose(){return this.clone(k(this._zod.def,{catchall:Us()}))},strict(){return this.clone(k(this._zod.def,{catchall:Gs()}))},strip(){return this.clone(k(this._zod.def,{catchall:void 0}))},extend(e){return se(this,e)},safeExtend(e){return le(this,e)},merge(e){return ue(this,e)},pick(e){return ie(this,e)},omit(e){return oe(this,e)},partial(...e){return de(dc,this,e[0])},exactPartial(...e){return de(pc,this,e[0],`exactPartial`)},required(...e){return fe(xc,this,e[0])}});function G(e,t){return new Js({type:`object`,shape:e??{},...B(t)})}var Ys=H(`ZodUnion`,(e,t)=>{Or.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),e.options=t.options});function Xs(e,t){return new Ys({type:`union`,options:e,...B(t)})}var Zs=H(`ZodDiscriminatedUnion`,(e,t)=>{Ys.init(e,t),Ar.init(e,t)});function Qs(e,t,n){return new Zs({type:`union`,options:t,discriminator:e,...B(n)})}var $s=H(`ZodIntersection`,(e,t)=>{jr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function ec(e,t){return new $s({type:`intersection`,left:e,right:t})}var tc=H(`ZodTuple`,(e,t)=>{is(),Pr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new dc({type:`optional`,innerType:e}))})}});function nc(e,t,n){let r=t instanceof xn;return new tc({type:`tuple`,items:e,rest:r?t:null,...B(r?n:t)})}var rc=H(`ZodRecord`,(e,t)=>{is(),Rr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ic(e,t,n){return!t||!t._zod?new rc({type:`record`,keyType:U(),valueType:e,...B(t)}):new rc({type:`record`,keyType:e,valueType:t,...B(n)})}var ac=H(`ZodEnum`,(e,t)=>{zr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 ac({...t,checks:[],...B(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 ac({...t,checks:[],...B(r),entries:i})}});function oc(e,t){return new ac({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...B(t)})}var sc=H(`ZodLiteral`,(e,t)=>{Br.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(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 cc(e,t){return new sc({type:`literal`,values:Array.isArray(e)?e:[e],...B(t)})}var lc=H(`ZodTransform`,(e,t)=>{is(),Vr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new He(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ce(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ce(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function uc(e){return new lc({type:`transform`,transform:e})}var dc=H(`ZodOptional`,(e,t)=>{Ur.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fc(e){return new dc({type:`optional`,innerType:e})}var pc=H(`ZodExactOptional`,(e,t)=>{Wr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`optional`,innerType:e})}var hc=H(`ZodNullable`,(e,t)=>{Gr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gc(e){return new hc({type:`nullable`,innerType:e})}var _c=H(`ZodDefault`,(e,t)=>{Kr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vc(e,t){return new _c({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():I(t)}})}var yc=H(`ZodPrefault`,(e,t)=>{Jr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e,t){return new yc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():I(t)}})}var xc=H(`ZodNonOptional`,(e,t)=>{Yr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sc(e,t){return new xc({type:`nonoptional`,innerType:e,...B(t)})}var Cc=H(`ZodCatch`,(e,t)=>{Qr.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wc(e,t){return new Cc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ie(t)})}var Tc=H(`ZodPipe`,(e,t)=>{$r.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.in=t.in,e.out=t.out});function Ec(e,t){return new Tc({type:`pipe`,in:e,out:t})}var Dc=H(`ZodReadonly`,(e,t)=>{ti.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oc(e){return new Dc({type:`readonly`,innerType:e})}var kc=H(`ZodCustom`,(e,t)=>{ri.init(e,t),as.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)});function Ac(e,t={}){return Aa(kc,e,t)}function jc(e,t){return ja(e,t)}function Mc(e){return Qi(ls,e)}function Nc(e){return ra(Ps,e)}var K=l(d(),1),Pc=l(p(),1),Fc=vs({protocol:/^https?$/}).refine(e=>!/^https?:\/\/[^/]*@/.test(e)&&!/[?#]/.test(e),`Use an HTTP(S) endpoint without embedded credentials`),Ic=G({endpoint:Xs([Fc,cc(``)]).default(``),region:U().min(1).max(100).default(`us-east-1`),bucket:U().min(3).max(255),prefix:U().max(200).regex(/^[a-zA-Z0-9/_-]*$/).default(`kanvil/`),forcePathStyle:zs().default(!0),accessKeyId:U().max(500).default(``),secretAccessKey:U().max(2e3).optional()}).strict(),Lc=oc([`none`,`apiKey`,`basic`]),Rc=G({url:Fc,auth:Lc.optional(),index:U().regex(/^[a-z0-9][a-z0-9_-]{0,100}$/),apiKey:U().max(4e3).optional(),username:U().max(500).default(``),password:U().max(2e3).optional()}).strict(),zc=Qs(`provider`,[G({provider:cc(`local`)}).strict(),Ic.extend({provider:cc(`s3`)})]),Bc=Qs(`provider`,[G({provider:cc(`postgres`)}).strict(),Rc.extend({provider:cc(`elasticsearch`)})]),Vc=G({url:vs({protocol:/^amqps?$/}).max(4e3).optional(),exchange:U().min(1).max(200).regex(/^[a-zA-Z0-9_.-]+$/).refine(e=>!e.startsWith(`amq.`),`Use an application exchange`).default(`kanvil.events`)}).strict(),Hc=Qs(`provider`,[G({provider:cc(`postgres`)}).strict(),Vc.extend({provider:cc(`rabbitmq`)})]),Uc=G({emailPasswordEnabled:zs().default(!0),ssoAutoProvision:zs().default(!1)}).strict(),Wc=G({expectedVersion:Fs().int().positive(),name:U().trim().min(1).max(100),description:U().max(500),storage:zc,search:Bc,broker:Hc.optional(),authentication:Uc.optional()}).strict();G({name:U(),description:U()});var Gc=G({id:W(),version:Fs().int(),name:U(),description:U(),authentication:Uc.default(()=>Uc.parse({})),storage:G({provider:oc([`local`,`s3`]),source:oc([`deployment`,`admin`]),settings:Ic.omit({secretAccessKey:!0}).nullable(),secretConfigured:zs(),pending:Fs().int(),status:oc([`ready`,`transferring`,`unavailable`]),error:U().nullable()}),search:G({provider:oc([`postgres`,`elasticsearch`]),source:oc([`deployment`,`admin`]),settings:Rc.omit({apiKey:!0,password:!0}).nullable(),secretConfigured:zs(),status:oc([`builtin`,`indexing`,`ready`,`unavailable`]),cursor:U(),error:U().nullable()}),broker:G({provider:oc([`postgres`,`rabbitmq`]),source:oc([`deployment`,`admin`]),settings:G({endpoint:U(),exchange:U()}).nullable(),secretConfigured:zs(),status:oc([`builtin`,`connecting`,`ready`,`unavailable`]),error:U().nullable()}),deployment:G({url:U(),oidc:G({name:U(),discoveryUrl:U(),clientId:U()}).nullable(),push:zs(),version:U()}),locations:qs(G({id:W(),bucket:U(),endpoint:U(),prefix:U(),objects:Fs().int()}))});G({data:U().max(7e5),contentType:oc([`image/png`,`image/jpeg`,`image/webp`])}).strict();var Kc=G({image:U().nullable()}),qc=[`backlog`,`todo`,`in_progress`,`in_review`,`done`,`cancelled`],Jc=[`done`,`cancelled`],Yc=[`urgent`,`high`,`medium`,`low`,`none`],Xc=[`feature`,`bug`,`chore`,`research`,`documentation`],Zc=[`low`,`med`,`high`],Qc=[`reader`,`writer`,`admin`],$c=[`default`,`red`,`orange`,`amber`,`yellow`,`lime`,`green`,`emerald`,`teal`,`cyan`,`sky`,`blue`,`indigo`,`violet`,`purple`,`fuchsia`,`pink`,`rose`,`gray`],el=U().regex(/^#[0-9a-f]{6}$/i).overwrite(e=>e.toLowerCase()),tl=Xs([oc($c),el]),nl=e=>$c.some(t=>t===e),rl=e=>el.safeParse(e).success,il=e=>e?.split(`,`).includes(`admin`)??!1,al=[`read`,`write`,`claim`,`admin`],ol=1e7,sl={backlog:`Backlog`,todo:`To do`,in_progress:`In progress`,in_review:`In review`,done:`Done`,cancelled:`Cancelled`},cl={urgent:`Urgent`,high:`High`,medium:`Medium`,low:`Low`,none:`No priority`},ll=U().min(1).max(80),ul=Mc(),dl=Mc().refine(e=>new Date(e).getUTCFullYear()>=1,`Due date must be in year 1 or later`),fl=Fs().int().positive(),pl=U().trim().min(1),ml=qs(pl.max(40)).max(30).overwrite(e=>[...new Set(e)]),hl=G({id:W(),projectId:W(),name:pl.max(40),color:tl,version:fl}),gl={limit:Nc().int().min(1).max(100).default(50),offset:Nc().int().min(0).default(0)},_l={requestId:W().optional()},vl=G({projectId:ll}),yl=vl.extend({ticketId:ll}),bl=G({q:U().trim().max(200).optional(),status:oc(qc).optional(),priority:oc(Yc).optional(),kind:oc(Xc).optional(),difficulty:oc(Zc).optional(),label:U().max(40).optional(),assigneeId:Xs([ll,cc(`none`)]).optional(),parentId:ll.optional(),archived:oc([`include`,`only`,`exclude`]).default(`exclude`),due:oc([`overdue`,`today`,`week`,`scheduled`,`none`]).optional(),sort:oc([`priority`,`updated`,`created`,`title`,`labels`,`due`,`number`,`status`,`difficulty`,`kind`,`assignee`]).default(`priority`),order:oc([`asc`,`desc`]).optional()}).strict(),xl={priority:`Priority`,updated:`Recently updated`,created:`Recently created`,title:`Title`,labels:`Labels`,due:`Due date`,number:`Ticket number`,status:`Status`,difficulty:`Difficulty`,kind:`Kind`,assignee:`Assignee`},Sl={priority:`asc`,updated:`desc`,created:`desc`,title:`asc`,labels:`asc`,due:`asc`,number:`asc`,status:`asc`,difficulty:`asc`,kind:`asc`,assignee:`asc`},Cl={overdue:`Overdue`,today:`Due today`,week:`Due this week`,scheduled:`Has a due date`,none:`No due date`},wl=G({title:pl.max(500).overwrite(e=>e.replace(/\s+/gu,` `)),description:U().max(1e5),acceptanceCriteria:U().max(5e4),status:oc(qc),priority:oc(Yc),kind:oc(Xc),difficulty:oc(Zc).nullable(),labels:ml,scopes:ml,assigneeId:U().nullable(),parentId:W().nullable(),automationReady:zs(),holdReason:U().trim().max(2e3).nullable(),dueAt:dl.nullable(),archived:zs()}).strict(),Tl=wl.partial().refine(e=>Object.keys(e).length>0,`Provide at least one change`),El=G({id:W(),slug:pl.max(80),name:pl.max(120),description:U(),version:fl,createdAt:ul,updatedAt:ul,role:oc(Qc).nullable()}),Dl=G({userId:U(),name:U(),email:U(),role:oc(Qc),image:U().nullable().optional(),source:oc([`project`,`workspace`]).optional(),inheritedRole:oc(Qc).nullable().optional()}),Ol=G({iconName:U().nullable().default(null),iconColor:oc($c).default(`default`),image:U().nullable().default(null),workspaceId:W(),visibility:oc([`workspace`,`private`]),id:W(),key:U(),name:U(),description:U(),version:fl,createdAt:ul,updatedAt:ul}),kl=wl.extend({claimRequired:zs(),id:W(),projectId:W(),key:U(),number:Fs().int().positive(),version:fl,createdBy:U(),createdAt:ul,updatedAt:ul}),Al=G({project:Ol,tickets:qs(kl),cursor:U().regex(/^\d+$/)}),jl=G({cursor:U().regex(/^\d+$/)}),Ml=G({ready:zs(),reasons:qs(G({code:U(),message:U(),ticketId:W().optional()}))}),Nl=G({id:W(),projectId:W(),ticketId:W(),actorId:U(),workerId:U(),expiresAt:ul,createdAt:ul}),Pl=G({id:W(),projectId:W(),sourceId:W(),targetId:W(),type:oc([`blocks`,`related`,`duplicate`,`causes`,`clones`,`implements`,`reviews`]),sourceKey:U().optional(),sourceTitle:U().optional(),targetKey:U().optional(),targetTitle:U().optional()}),Fl=oc([`outgoing`,`incoming`]),Il={blocks:[`Blocks`,`Is blocked by`],related:[`Related to`,`Related to`],duplicate:[`Duplicates`,`Is duplicated by`],causes:[`Causes`,`Is caused by`],clones:[`Clones`,`Is cloned by`],implements:[`Implements`,`Is implemented by`],reviews:[`Reviews`,`Is reviewed by`]},Ll=Pl.shape.type.options.flatMap(e=>(e===`related`?[`outgoing`]:Fl.options).map(t=>({value:`${e}:${t}`,label:Il[e][t===`outgoing`?0:1],type:e,direction:t})));function Rl(e){let[t,n]=nc([Pl.shape.type,Fl]).parse(U().parse(e).split(`:`));return{type:t,direction:n}}function zl(e,t){let n=e.sourceId===t,r=n?e.targetId:e.sourceId,i=(n?e.targetKey:e.sourceKey)??r,a=n?e.targetTitle:e.sourceTitle;return{id:r,label:Il[e.type][+!n],title:`${i}${a?` · ${a}`:``}`}}var Bl=G({id:W(),projectId:W(),ticketId:W(),actorId:U(),body:U(),version:fl,createdAt:ul,updatedAt:ul}),Vl=G({id:W(),projectId:W(),ticketId:W(),actorId:U(),name:U(),contentType:U(),size:Fs().int().nonnegative(),createdAt:ul}),Hl=G({kind:oc([`pull_request`,`test`,`review`,`deployment`,`device`,`other`]),title:pl.max(200),url:vs().regex(/^https?:\/\//i,`Use an HTTP or HTTPS URL`),commit:U().regex(/^[a-f0-9]{40,64}$/i).nullable().default(null),outcome:oc([`reported`,`pending`,`passed`,`failed`]).default(`reported`),note:U().max(2e4).default(``)}),Ul=Hl.extend({id:W(),projectId:W(),ticketId:W(),actorId:U(),createdAt:ul}),Wl=G({id:U().regex(/^\d+$/),projectId:W(),ticketId:W().nullable(),actorId:U(),type:U(),data:ic(U(),Us()),createdAt:ul}),Gl=G({authentication:Uc.default(()=>Uc.parse({})),name:U(),description:U().default(``),version:U(),setupRequired:zs(),oidc:G({id:U(),name:U()}).nullable(),push:zs().default(!1)}),Kl=qs(G({id:W(),readAt:ul.nullable(),event:Wl})),ql=G({inApp:zs().default(!0),push:zs().default(!1)}),Jl=G({inApp:zs(),push:zs().optional()}).strict();G({token:U().min(1).max(250)}).strict();var Yl=qs(G({id:U(),name:U().nullable(),start:U().nullable(),enabled:zs(),expiresAt:ul.nullable(),createdAt:ul,permissions:U().nullable(),metadata:U().nullable()})),Xl=G({id:U(),key:U(),name:U().nullable(),expiresAt:ul.nullable()}),Zl=G({ok:cc(!0)}),Ql={"label.created":`Label created`,"label.updated":`Label updated`,"label.deleted":`Label deleted`,"ticket.created":`Ticket created`,"ticket.updated":`Ticket updated`,"ticket.deleted":`Ticket deleted`,"ticket.claimed":`Work claimed`,"claim.renewed":`Claim renewed`,"claim.released":`Claim released`,"claim.recovered":`Claim recovered`,"comment.created":`Comment added`,"comment.updated":`Comment edited`,"comment.deleted":`Comment deleted`,"relation.added":`Relationship added`,"relation.removed":`Relationship removed`,"attachment.created":`File attached`,"attachment.deleted":`File removed`,"evidence.added":`Evidence attached`,"project.created":`Project created`,"project.updated":`Project updated`,"membership.updated":`Project access changed`};function $l(e,t=!1){let n=e.type.replaceAll(`.`,` `).replaceAll(`_`,` `),r=Ql[e.type]??n.charAt(0).toUpperCase()+n.slice(1);return!t||!e.ticketId?r:`${r} · ${typeof e.data.key==`string`?e.data.key:e.ticketId}${typeof e.data.title==`string`?` · ${e.data.title}`:``}`}var eu=e=>G({items:qs(e),total:Fs().int().nonnegative()}),tu=(e,t,n,r,i,a)=>({input:e,output:t,method:n,path:r,scope:i,description:a}),nu={list_workspaces:tu(G({}),qs(El),`GET`,`/workspaces`,`read`,`List accessible workspaces and the current membership role.`),create_workspace:tu(G({..._l,name:pl.max(120),slug:U().trim().regex(/^[a-z0-9][a-z0-9-]{1,79}$/),description:U().max(5e3).default(``)}).strict(),El,`POST`,`/workspaces`,`write`,`Create a workspace and become its administrator.`),update_workspace:tu(G({..._l,workspaceId:W(),expectedVersion:fl,name:pl.max(120),description:U().max(5e3)}).strict(),El,`PATCH`,`/workspaces/{workspaceId}`,`admin`,`Update workspace details with version checks.`),list_workspace_members:tu(G({workspaceId:W()}),qs(Dl),`GET`,`/workspaces/{workspaceId}/members`,`read`,`List members of a workspace you belong to.`),set_workspace_member:tu(G({..._l,workspaceId:W(),email:ms(),role:oc(Qc).nullable()}).strict(),Zl,`POST`,`/workspaces/{workspaceId}/members`,`admin`,`Manage workspace access; removal also revokes direct project access in this workspace.`),list_projects:tu(G({workspaceId:W().optional()}),qs(Ol.extend({openTickets:Fs().int().nonnegative(),overdueTickets:Fs().int().nonnegative()})),`GET`,`/projects`,`read`,`List projects accessible to the current identity, each with its open and overdue ticket counts.`),create_project:tu(G({..._l,workspaceId:W().optional(),visibility:oc([`workspace`,`private`]).default(`private`),key:U().trim().regex(/^[A-Z][A-Z0-9]{1,9}$/),name:pl.max(120),description:U().max(5e3).default(``)}).strict(),Ol,`POST`,`/projects`,`write`,`Create a project with a permanent ticket prefix.`),get_project:tu(vl,Ol,`GET`,`/projects/{projectId}`,`read`,`Read project details, workspace identity, and appearance.`),set_project_icon:tu(vl.extend({..._l,expectedVersion:fl,icon:Xs([G({kind:cc(`library`),name:U().regex(/^[a-z0-9-]{1,80}$/),color:oc($c).default(`default`)}).strict(),G({kind:cc(`image`),contentType:oc([`image/png`,`image/jpeg`,`image/webp`]),data:U().max(7e5)}).strict(),Vs()])}).strict(),Ol,`POST`,`/projects/{projectId}/icon`,`admin`,`Choose an installed library icon, upload an image, or reset the project icon.`),update_project:tu(vl.extend({..._l,expectedVersion:fl,visibility:oc([`workspace`,`private`]).optional(),name:pl.max(120),description:U().max(5e3)}).strict(),Ol,`PATCH`,`/projects/{projectId}`,`admin`,`Update project details without changing its prefix.`),list_members:tu(vl,qs(Dl),`GET`,`/projects/{projectId}/members`,`read`,`List project members.`),set_member:tu(vl.extend({..._l,email:ms(),role:oc(Qc).nullable()}).strict(),Zl,`POST`,`/projects/{projectId}/members`,`admin`,`Add or update an existing user's membership, or remove it with a null role.`),list_tickets:tu(vl.extend({...bl.shape,...gl}),eu(kl),`GET`,`/projects/{projectId}/tickets`,`read`,`Search tickets with server-side filters, stable ordering, and pagination.`),list_ticket_labels:tu(vl.extend({archived:bl.shape.archived}),qs(G({name:U(),count:Fs().int().nonnegative()})),`GET`,`/projects/{projectId}/labels`,`read`,`List distinct ticket labels and usage counts across the authorized project, independent of ticket pagination.`),list_project_labels:tu(vl,qs(hl.extend({count:Fs().int().nonnegative()})),`GET`,`/projects/{projectId}/labels/catalog`,`read`,`List project label definitions, colors, and ticket counts, including unused labels and archived tickets.`),create_project_label:tu(vl.extend({..._l,name:pl.max(40),color:tl.default(`gray`)}).strict(),hl,`POST`,`/projects/{projectId}/labels`,`admin`,`Create a reusable project label. Label names are unique within the project.`),update_project_label:tu(vl.extend({..._l,labelId:W(),expectedVersion:fl,name:pl.max(40),color:tl}).strict(),hl,`PATCH`,`/projects/{projectId}/labels/{labelId}`,`admin`,`Rename or recolor a project label. Renames update tickets and saved-view filters atomically.`),delete_project_label:tu(vl.extend({..._l,labelId:W(),expectedVersion:fl}).strict(),Zl,`DELETE`,`/projects/{projectId}/labels/{labelId}`,`admin`,`Delete a project label and remove it from tickets and saved-view filters atomically.`),list_label_colors:tu(G({}),qs(G({value:el,createdAt:ul})),`GET`,`/label-colors`,`read`,`List the site-wide custom label colors, newest first. A custom color joins the list when a label is saved with it.`),remove_label_color:tu(G({..._l,value:el}).strict(),Zl,`POST`,`/label-colors/remove`,`write`,`Remove a custom color from the site-wide palette; instance administrators and the person who added it may do so. Labels already using it keep their color.`),get_ticket:tu(yl,G({ticket:kl,readiness:Ml,claim:Nl.nullable(),subscribed:zs(),canReleaseClaim:zs()}),`GET`,`/projects/{projectId}/tickets/{ticketId}`,`read`,`Read a ticket by ID or key, with readiness and ownership.`),create_ticket:tu(vl.extend({..._l,title:wl.shape.title,description:U().max(1e5).default(``),acceptanceCriteria:U().max(5e4).default(``),status:oc(qc).default(`todo`),priority:oc(Yc).default(`medium`),kind:oc(Xc).default(`feature`),difficulty:oc(Zc).nullable().default(null),dueAt:dl.nullable().default(null),labels:ml.default([]),scopes:ml.default([]),assigneeId:U().nullable().default(null),parentId:W().nullable().default(null),automationReady:zs().default(!1),holdReason:U().trim().max(2e3).nullable().default(null),archived:zs().default(!1)}).strict(),kl,`POST`,`/projects/{projectId}/tickets`,`write`,`Create a ticket. Reuse requestId when retrying this write.`),update_ticket:tu(yl.extend({..._l,expectedVersion:fl,changes:Tl,claimId:W().optional()}).strict(),kl,`PATCH`,`/projects/{projectId}/tickets/{ticketId}`,`write`,`Update a ticket with optimistic concurrency. Worker completion requires its active claim.`),bulk_update_tickets:tu(vl.extend({..._l,tickets:qs(G({ticketId:ll,expectedVersion:fl})).min(1).max(100).refine(e=>new Set(e.map(e=>e.ticketId)).size===e.length,`Tickets must be unique`),changes:Tl}).strict(),qs(kl),`POST`,`/projects/{projectId}/tickets/bulk`,`write`,`Apply an atomic bulk edit using each ticket's current version.`),delete_ticket:tu(yl.extend({..._l,expectedVersion:fl}).strict(),Zl,`DELETE`,`/projects/{projectId}/tickets/{ticketId}`,`admin`,`Delete a ticket and publish a deletion event.`),search_tickets:tu(G({q:U().trim().min(1).max(200),workspaceId:W().optional(),limit:Nc().int().min(1).max(50).default(20)}).strict(),G({items:qs(G({ticket:kl,project:G({id:W(),key:U(),name:U()})}))}),`GET`,`/tickets/search`,`read`,`Search unarchived tickets by key or text across every accessible project, optionally within one workspace.`),list_eligible_tickets:tu(vl.extend(gl),eu(G({ticket:kl,readiness:Ml})),`GET`,`/projects/{projectId}/eligibility`,`read`,`Inspect eligibility and explicit blocking reasons for open tickets.`),list_relations:tu(yl,qs(Pl),`GET`,`/projects/{projectId}/tickets/{ticketId}/relations`,`read`,`List incoming and outgoing ticket relationships.`),add_relation:tu(yl.extend({..._l,targetId:W(),type:Pl.shape.type,direction:Fl.optional()}).strict(),Pl,`POST`,`/projects/{projectId}/tickets/{ticketId}/relations`,`write`,`Relate tickets while rejecting dependency cycles.`),remove_relation:tu(vl.extend({..._l,relationId:W()}).strict(),Zl,`DELETE`,`/projects/{projectId}/relations/{relationId}`,`write`,`Remove a ticket relationship.`),list_comments:tu(yl.extend(gl),eu(Bl),`GET`,`/projects/{projectId}/tickets/{ticketId}/comments`,`read`,`Read ticket discussion.`),add_comment:tu(yl.extend({..._l,body:pl.max(5e4)}).strict(),Bl,`POST`,`/projects/{projectId}/tickets/{ticketId}/comments`,`write`,`Add a comment with authenticated attribution.`),update_comment:tu(vl.extend({..._l,commentId:W(),expectedVersion:fl,body:pl.max(5e4)}).strict(),Bl,`PATCH`,`/projects/{projectId}/comments/{commentId}`,`write`,`Edit your own comment or moderate as a project administrator.`),delete_comment:tu(vl.extend({..._l,commentId:W(),expectedVersion:fl}).strict(),Zl,`DELETE`,`/projects/{projectId}/comments/{commentId}`,`write`,`Delete your own comment or moderate as a project administrator.`),list_activity:tu(yl.extend(gl),eu(Wl),`GET`,`/projects/{projectId}/tickets/{ticketId}/activity`,`read`,`Read durable ticket activity.`),upload_attachment:tu(yl.extend({..._l,name:pl.max(255).refine(e=>{for(let t of e)if(t.charCodeAt(0)<32||t.charCodeAt(0)===127)return!1;return!0},`Use a filename without control characters`),contentType:U().max(120).regex(/^[a-z0-9][a-z0-9.+-]*\/[a-z0-9][a-z0-9.+-]*$/i).default(`application/octet-stream`),data:U().max(Math.ceil(ol/3)*4)}).strict(),Vl,`POST`,`/projects/{projectId}/tickets/{ticketId}/attachments`,`write`,`Upload up to 10 MB of base64-encoded bytes. The original filename is metadata, never a filesystem path.`),list_attachments:tu(yl,qs(Vl),`GET`,`/projects/{projectId}/tickets/{ticketId}/attachments`,`read`,`List authorized attachment metadata.`),delete_attachment:tu(vl.extend({..._l,attachmentId:W()}).strict(),Zl,`DELETE`,`/projects/{projectId}/attachments/{attachmentId}`,`write`,`Remove an attachment.`),list_evidence:tu(yl,qs(Ul),`GET`,`/projects/{projectId}/tickets/{ticketId}/evidence`,`read`,`Read attributed evidence. Outcomes are reports from the submitting identity.`),add_evidence:tu(yl.extend({..._l,...Hl.shape,claimId:W().optional()}).strict(),Ul,`POST`,`/projects/{projectId}/tickets/{ticketId}/evidence`,`write`,`Attach evidence with its commit and provenance.`),claim_ticket:tu(yl.extend({..._l,workerId:pl.max(200),expectedVersion:fl,leaseSeconds:Fs().int().min(30).max(3600).default(300)}).strict(),Nl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim`,`claim`,`Atomically claim ready work. Expired claims require explicit recovery.`),renew_claim:tu(yl.extend({..._l,claimId:W(),leaseSeconds:Fs().int().min(30).max(3600).default(300)}).strict(),Nl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim/renew`,`claim`,`Renew the caller's unexpired claim.`),release_claim:tu(yl.extend({..._l,claimId:W()}).strict(),Zl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim/release`,`claim`,`Release the caller's claim.`),recover_claim:tu(yl.extend({..._l,claimId:W(),reason:pl.min(10).max(2e3),confirmedStopped:cc(!0)}).strict(),Zl,`POST`,`/projects/{projectId}/tickets/{ticketId}/claim/recover`,`admin`,`Recover an expired claim only after confirming the worker stopped.`),set_subscription:tu(yl.extend({..._l,enabled:zs()}).strict(),Zl,`POST`,`/projects/{projectId}/tickets/{ticketId}/subscription`,`read`,`Subscribe to ticket updates or unsubscribe.`),list_views:tu(vl,qs(G({id:W(),name:U(),filters:bl})),`GET`,`/projects/{projectId}/views`,`read`,`List your saved project views.`),save_view:tu(vl.extend({..._l,name:pl.max(80),filters:bl}).strict(),G({id:W()}),`POST`,`/projects/{projectId}/views`,`read`,`Save a personal filtered view.`),delete_view:tu(vl.extend({..._l,viewId:W()}).strict(),Zl,`DELETE`,`/projects/{projectId}/views/{viewId}`,`read`,`Delete your own saved view.`)},ru=G({error:G({code:U(),message:U(),details:Us().optional()})}),iu=G({status:Fs().int().min(400).max(599),code:U(),message:U()}),au=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.details=r}};function ou(e,t){return nu[e].output.parse(t)}function su(e){if(e instanceof Error&&/fetch failed|failed to fetch|network request failed|could not connect to the server/i.test(e.message))return`Could not reach Kanvil. Check your connection and retry.`;if(e instanceof Uo)return e.issues.slice(0,3).map(e=>`${e.path.join(`.`)||`Input`}: ${e.message}`).join(`; `);if(e instanceof au&&Array.isArray(e.details)){let t=qs(G({path:U(),message:U()})).safeParse(e.details);if(t.success)return t.data.slice(0,3).map(e=>`${e.path||`Input`}: ${e.message}`).join(`; `)}return e instanceof Error?e.message:typeof e==`string`?e:`The request could not be completed`}function cu(e){return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}var lu=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),uu=o(((e,t)=>{t.exports=lu()})),q=uu(),du=K.createContext(void 0),fu=e=>{let t=K.useContext(du);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},pu=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,q.jsx)(du.Provider,{value:e,children:t})),mu={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hu=new class{#e=mu;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 gu(e){setTimeout(e,0)}var _u=typeof window>`u`||`Deno`in globalThis;function vu(){}function yu(e,t){return typeof e==`function`?e(t):e}function bu(e){return typeof e==`number`&&e>=0&&e!==1/0}function xu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Su(e,t){return typeof e==`function`?e(t):e}function Cu(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Tu(o,t.options))return!1}else if(!Du(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 wu(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Eu(t.options.mutationKey)!==Eu(a))return!1}else if(!Du(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Tu(e,t){return(t?.queryKeyHashFn||Eu)(e)}function Eu(e){return JSON.stringify(e,(e,t)=>Mu(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Du(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)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Du(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Du(e[r],t[r]))return!1;return!0}return!1}var Ou=Object.prototype.hasOwnProperty;function ku(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ju(e)&&ju(t);if(!r&&!(Mu(e)&&Mu(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:Ou.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ku(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Au(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 ju(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Mu(e){if(!Nu(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Nu(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Nu(e){return Object.prototype.toString.call(e)===`[object Object]`}function Pu(e){return new Promise(t=>{hu.setTimeout(t,e)})}function Fu(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ku(e,t)}function Iu(e){return e}function Lu(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ru(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zu=Symbol();function Bu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zu?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vu(e,t){return typeof e==`function`?e(...t):!!e}function Hu(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Uu=()=>_u,Wu=()=>Uu(),Gu=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(){}},Ku=new class extends Gu{#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`}},qu=gu;function Ju(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=qu,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 Yu=Ju(),Xu=new class extends Gu{#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 Zu(e){return Math.min(1e3*2**e,3e4)}function Qu(e){return(e??`online`)!==`online`||Xu.isOnline()}var $u=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ed(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(vu);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new $u(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ku.isFocused()&&(e.networkMode===`always`||Xu.isOnline())&&e.canRun(),p=()=>Qu(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(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??(Wu()?0:3),a=e.retryDelay??Zu,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Pu(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var td=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),bu(this.gcTime)&&(this.#e=hu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wu()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(hu.clearTimeout(this.#e),this.#e=void 0)}};function nd(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=>{Hu(e,()=>t.signal,()=>n=!0)},u=Bu(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?Ru:Lu;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?id:rd,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:rd(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 rd(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 id(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ad=class extends td{#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=cd(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=cd(this.options);e.data!==void 0&&(this.setState(sd(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Fu(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(vu).catch(vu):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=>Su(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zu||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Su(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:!xu(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=Bu(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`?nd(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=ed({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof $u&&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 $u){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,...od(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...sd(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),Yu.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function od(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qu(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function sd(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function cd(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 ld=class extends Gu{#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),dd(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fd(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 Su(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&&!Au(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&pd(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Su(this.options.enabled,this.#t)!==Su(t.enabled,this.#t)||Su(this.options.staleTime,this.#t)!==Su(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Su(this.options.enabled,this.#t)!==Su(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 Au(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(vu)),t}#h(e){return!Wu()&&Su(this.options.enabled,this.#t)!==!1&&bu(e)}#g(){this.#b();let e=Su(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=xu(this.#r.dataUpdatedAt,e)+1;this.#u=hu.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Su(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=hu.setInterval(()=>{(this.options.refetchIntervalInBackground||Ku.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(hu.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(hu.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&&dd(e,t),o=i&&pd(e,n,t,r);(a||o)&&(l={...l,...od(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=Fu(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=Fu(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:md(e,t),refetch:this.refetch,isEnabled:Su(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),Au(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)})})();Yu.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 ud(e,t){return Su(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Su(t.retryOnMount,e)!==!1)}function dd(e,t){return ud(e,t)||e.state.data!==void 0&&fd(e,t,t.refetchOnMount)}function fd(e,t,n){if(Su(t.enabled,e)!==!1&&Su(t.staleTime,e)!==`static`){let r=Su(n,e);return r===`always`||r!==!1&&md(e,t)}return!1}function pd(e,t,n,r){return(e!==t||Su(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&md(e,n)}function md(e,t){return Su(t.enabled,e)!==!1&&e.isStaleByTime(Su(t.staleTime,e))}var hd=class extends td{#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||gd(),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=ed({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),Yu.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function gd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var _d=class extends Gu{#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),Au(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Eu(t.mutationKey)!==Eu(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??gd();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){Yu.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},vd=K.createContext(!1),yd=()=>K.useContext(vd),bd=vd.Provider;function xd(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Sd=K.createContext(xd()),Cd=()=>K.useContext(Sd),wd=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Vu(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Td=e=>{K.useEffect(()=>{e.clearReset()},[e])},Ed=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Vu(n,[e.error,r])),Dd=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))}},Od=(e,t)=>e?.suspense&&t.isPending,kd=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ad(e,t,n){let r=yd(),i=Cd(),a=fu(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Dd(o),wd(o,i,s),Td(i);let[l]=K.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(K.useSyncExternalStore(K.useCallback(e=>{let t=d?l.subscribe(Yu.batchCalls(e)):vu;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),K.useEffect(()=>{l.setOptions(o)},[o,l]),Od(o,u))throw kd(o,l,i);if(Ed({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function jd(e,t){return Ad(e,ld,t)}function Md(e,t){let n=fu(t),[r]=K.useState(()=>new _d(n,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);let i=K.useSyncExternalStore(K.useCallback(e=>r.subscribe(Yu.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=K.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(vu)},[r]);if(i.error&&Vu(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Nd=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Pd(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Nd(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Fd=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Id=e=>{let t=Fd(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ld=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Rd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function zd(e){return e!=null}function Bd(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Rd.width,a=e.size??e.height??Rd.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Ld(...c):Ld(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Rd[`stroke-width`])*Number(e.size??e.width??Rd.width)/Number(t.size??t.width??Rd.width):t.strokeWidth??Rd[`stroke-width`];return[`svg`,{...Object.entries(Rd).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&zd(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&zd(t.width)&&{[r(`width`)]:t.width},...`height`in t&&zd(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Vd(e,t={}){return Bd(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Hd=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ud=(0,K.createContext)({}),Wd=()=>(0,K.useContext)(Ud),Gd=(0,K.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Wd()??{},y=!!c||Hd(d),[b,x,S=[]]=Vd(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Ld(v,s),hasA11yProp:y,attributes:d});return(0,K.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,K.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Kd(e,t=[],n=[]){let r=typeof e==`string`?Pd(e,t,n):e,i=(0,K.forwardRef)(({className:e,...t},n)=>(0,K.createElement)(Gd,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Id(r.name)),i}var qd={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};qd.node;var Jd=Kd(qd),Yd={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Yd.node;var Xd=Kd(Yd),Zd={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};Zd.node;var Qd=Kd(Zd),$d={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};$d.node;var ef=Kd($d),tf={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};tf.node;var nf=Kd(tf),rf={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};rf.node;var af=Kd(rf),of={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};of.node;var sf=Kd(of),cf={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};cf.node;var lf=Kd(cf),uf={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};uf.node;var df=Kd(uf),ff={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};ff.node;var pf=Kd(ff),mf={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};mf.node;var hf=Kd(mf),gf={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};gf.node;var _f=Kd(gf),vf={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};vf.node;var yf=Kd(vf),bf={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};bf.node;var xf=Kd(bf),Sf={name:`equal`,size:24,node:[[`line`,{x1:`5`,x2:`19`,y1:`9`,y2:`9`,key:`1nwqeh`}],[`line`,{x1:`5`,x2:`19`,y1:`15`,y2:`15`,key:`g8yjpy`}]]};Sf.node;var Cf=Kd(Sf),wf={name:`eye-off`,size:24,node:[[`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`}]]};wf.node;var Tf=Kd(wf),Ef={name:`eye`,size:24,node:[[`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`}]]};Ef.node;var Df=Kd(Ef),Of={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Of.node;var kf=Kd(Of),Af={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Af.node;var jf=Kd(Af),Mf={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};Mf.node;var Nf=Kd(Mf),Pf={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Pf.node;var Ff=Kd(Pf),If={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};If.node;var Lf=Kd(If),Rf={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Rf.node;var zf=Kd(Rf),Bf=48,Vf=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Bf-t;return n},Hf=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},Uf=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Bf;n+=i>>>1^-(i&1),t[r]=n}return t},Wf=384,Gf=[],Kf=Hf(Vf(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),qf=Hf(Vf(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Jf=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Yf=(()=>{let e=Kf.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Kf[n];i<Kf[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Kf[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Kf[i];a<Kf[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Xf=Vf(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Zf=Hf(Vf(`123333359346463635126536711576`)),Qf=Vf(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),$f=Vf(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ep=Uf(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),tp=(()=>{let e=new Int32Array(319).fill(-1),t=Uf(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=Uf(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),np=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),rp=Uf(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ip=Uf(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),ap=Uf(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),op=new Int32Array(995),sp=new Int32Array(995),cp=new Int32Array(995),lp=``,up=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<rp.length;r++)for(let i of np[ap[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),up[a*2]=lp.length,up[a*2+1]=i.length,lp+=i),op[n]=rp[r],sp[n]=ip[r],cp[n]=a,n++}}var dp=Uf(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),fp=Hf(Vf(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),pp=Uf(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),mp=Vf(`ij`),hp=Vf(``),gp=Vf(`1`),_p={GROUP_COUNT:Wf,customValidatorNames:Gf,edgeStart:Kf,labelStart:qf,labelText:Jf,edgeTarget:Yf,nodeGroup:Xf,nodeVlist:tp,vlistPat:Zf,vlistOps:Qf,vlistRef:$f,vlistGroup:ep,litAnchor:op,litGroup:sp,litPool:cp,poolOffsets:up,poolText:lp,adjGid:dp,adjStart:fp,adjTgt:pp,patGid:mp,patTgt:hp,postfixLookupGroups:gp,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},vp=`line`in Error(),yp=-1,bp=-1,xp=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Sp=(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},Cp=(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=(xp(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=(xp(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,B=n.prefix??e.prefix??``,ee=B===``?``:B+`:`,te=ee.length,ne=(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$/,ie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,se=0,ce=-1,le=-1,ue=-1,de=-1,fe=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,pe=e=>/\s/.test(String.fromCharCode(e)),me=(e,t,n)=>{if(se=0,ce=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)se=1;else if(r===40&&i===41)se=2;else return;ue=t+1,de=n-1;let a=t+1;if(fe(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!fe(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ce=t+1,le=a,ue=a+1)}},he=(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},V=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ge=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_e=e=>!!e&&!Number.isNaN(Number(e)),ve=(e,t,n)=>{if(n-t<11||!he(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&&he(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&he(e,t+10,t+18,`-normal/`)},ye=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],be=`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(` `)),xe=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Se=(e,t,n,r)=>{if(e>=10){if(e>=25)return ne[e-25](t.slice(n,r));let i=e-10;if(se!==ye[i])return!1;if(ce>=0){for(let e of be[i])if(he(t,ce,le,e))return!0;return!1}switch(xe[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ue,de);return re.test(e)&&!ie.test(e)}case 3:return _e(t.slice(ue,de));case 4:return oe.test(t.slice(ue,de));default:return ae.test(t.slice(ue,de))}}switch(e){case 0:return!0;case 1:return se===0;case 2:return se===1;case 3:return se===2;case 4:return V.test(t.slice(n,r));case 5:return _e(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&&_e(t.slice(n,r-1));case 8:return ge.test(t.slice(n,r));default:return ve(t,n,r)}},Ce=new Set(typeof E==`string`?E.split(` `):E),we=(e,t,n,r,i,a)=>{let o=xp(t,n,r)^(i?2654435769: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},Te=new Map,Ee=new Map,De=2,Oe=4096,ke=(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||Ce.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=Ee.get(s);return c===void 0&&Ee.set(s,c=De++),c},Ae=new Map,je=r,Me=r+4096,Ne=()=>je++,Pe=2097152,Fe=8192,Ie=new Int32Array(Fe),Le=Array(Fe).fill(null),Re=new Int32Array(Fe),ze=new Int32Array(Fe),Be=new Uint8Array(Fe),H=0,Ve=(e,t,n,r,i,a,o,s)=>{let c=e;if(Le[e]!==null){if(Le[e|1]===null)c=e|1;else if(!(H++&3))c=e|H>>2&1;else return}Le[c]=t.slice(n,r),Ie[c]=i,Re[c]=a,ze[c]=o,Be[c]=s},He=()=>Le.fill(null),Ue=256,We=[new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue)],[Ge,Ke,qe,Je]=We,Ye=new Uint8Array(Ue),Xe=new Uint8Array(Ue),Ze=()=>{Ue*=2,We=We.map(e=>{let t=new Int32Array(Ue);return t.set(e),t}),[Ge,Ke,qe,Je]=We;let e=new Uint8Array(Ue);e.set(Ye),Ye=e,Xe=new Uint8Array(Ue)},Qe=64,$e=new Int32Array(Qe),et=new Int32Array(Qe),tt=new Int32Array(r),nt=2048,rt=21,it=new Float64Array(nt),at=new Int32Array(nt),ot=0,st=(e,t)=>{if(e===0&&t<r)return tt[t]===ot?1:(tt[t]=ot,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>rt;for(;at[i]===ot;){if(it[i]===n)return 1;i=i+1&nt-1}return it[i]=n,at[i]=ot,0},ct=(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?yp:we(Ae,e,t+1,r,0,Ne)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=et[t];if(r>n)continue;let i=$e[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;me(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(Se(d[t],e,r,n))return p[h+t]}return yp},lt=e=>{let t=e.length,n=0,c=0,u=!1;(De>Oe||Te.size>Oe)&&(Te=new Map,Ee=new Map,De=2,He()),je>Me&&(Ae=new Map,je=r,He());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&pe(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&&pe(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ue&&Ze();let _=n++;Ge[_]=p,Ke[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Ie[y]===v&&Le[y]!==null&&Le[y].length===g?t=y:Ie[y|1]===v&&Le[y|1]!==null&&Le[y|1].length===g&&(t=y|1),t>=0){let n=Le[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){qe[_]=Re[t],Je[_]=ze[t],Ye[_]=Be[t];continue}}}let b=p;if(te!==0){if(h-p<=te||!e.startsWith(ee,p)){qe[_]=yp,Ve(y,e,p,h,v,yp,0,0);continue}b=p+te}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)&&($e[0]=0,et[0]=M,R=1);let z=bp,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?bp:P,B=R),P!==bp){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=bp;else{let e=i[P],t=i[P+1],c=bp;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===Qe){Qe*=2;let e=new Int32Array(Qe);e.set($e),$e=e;let t=new Int32Array(Qe);t.set(et),et=t}$e[R]=r,et[R]=t+2,R++}}A===D&&(z=F<I?bp:P,B=R);let ne=F<I?bp:P,re,ie=!1;if(A>=0){if(ie=!0,re=ct(e,E,A,z,B),re!==yp&&re<r&&j[re]){let t=ct(e,E,D,ne,R);t!==yp&&t!==re&&(re=t,ie=!1)}else re===yp&&(re=ct(e,E,D,ne,R),ie=!1)}else re=ct(e,E,D,ne,R);let ae=0,oe=0;re===yp?qe[_]=yp:(oe=+!!ie,ae=b>=C?+!!O:we(Te,e,b,C,+!!O,e=>ke(e,O)),qe[_]=re,Ye[_]=oe,Je[_]=ae),Ve(y,e,p,h,v,re,ae,oe)}if(n===0)return``;if(n===1)return Ge[0]===0&&Ke[0]===t?e:e.slice(Ge[0],Ke[0]);if(n*k>nt){for(;n*k>nt;)nt<<=1,rt--;it=new Float64Array(nt),at=new Int32Array(nt)}if(De>=Pe||je>=Pe)throw Error(`cn: too many distinct classes in one merge`);ot=ot+1|0,ot===0&&(tt.fill(0),at.fill(0),ot=1);let f=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===yp){Xe[e]=1;continue}let n=Je[e];if(st(n,t)===1)Xe[e]=0,f=!0;else if(Xe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)st(n,x[e]);if(Ye[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&st(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Xe[m]){m++;continue}let t=Ge[m],r=Ke[m],i=m+1;for(;i<n&&Xe[i]&&Ge[i]===r+1&&e.charCodeAt(r)===32;)r=Ke[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ut=16384,dt=new Int32Array(ut*2),ft=0,pt=1,mt=Object.create(null),ht=Object.create(null),gt=new Map,_t=new Map,vt=0,yt=0,bt=()=>{ft^=ut,pt=pt+1|0,yt=0},xt=e=>{let t=mt[e];if(t!==void 0)return t;let n=Sp(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=ht[e],t!==void 0)?(mt[e]=t,t):(t=lt(e),i?(mt[e]=t,++vt>z&&(vt=0,ht=mt,mt=Object.create(null),bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},St=e=>{let t=gt.get(e);if(t!==void 0)return t;let n=Sp(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=_t.get(e),t!==void 0)?(gt.set(e,t),t):(t=lt(e),i?(gt.set(e,t),++vt>z&&(vt=0,_t=gt,gt=new Map,bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},Ct=e=>{let t=Sp(e,0,e.length),n=(t&16383)+ft;return dt[n]===(t^pt)||dt[n^ut]===(t^pt-1)||(dt[n]=t^pt,++yt>ut&&bt(),!1)},wt=z===0?lt:vp?e=>{let t=gt.get(e);return t===void 0?St(e):t}:xt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?wt(arguments[0]):wt(Ep.apply(null,arguments))},mergeString:wt,seenBefore:z===0?()=>!1:Ct,mergeUncached:lt}},wp=(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:wp(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},Tp=(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:wp(i,t);a&&(n&&(n+=` `),n+=a)}return n},Ep=function(){return Tp(arguments,!1)},Dp=256,Op=16,kp=1024,Ap=4096,jp=(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=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Ap).fill(``),l=Array(Ap).fill(``),u=Array(Ap).fill(``));let i=Sp(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(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},m=(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},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=wp(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Op&&(_.miss=Op,_.skip=kp,_.e.length=0,_.at=0);let u=_.e;u.length<Dp?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(wp(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;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(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Mp=Cp(_p),J=jp(Mp.mergeString,Mp);Mp.merge;function Np({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=K.useRef(e!==void 0),[a,o]=K.useState(()=>t);return[i&&e!==void 0?e:a,K.useCallback(e=>{i||o(e)},[])]}var Y=typeof document<`u`?K.useLayoutEffect:()=>{},Pp={...K},Fp={};function Ip(e,t){let n=K.useRef(Fp);return n.current===Fp&&(n.current=e(t)),n}var Lp=Pp.useInsertionEffect,Rp=Lp&&Lp!==Pp.useLayoutEffect?Lp:e=>e();function X(e){let t=Ip(zp).current;return t.next=e,Rp(t.effect),t.trampoline}function zp(){let e={next:void 0,callback:Bp,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Bp(){}function Vp(e,t,n,r){let i=Ip(Up).current;return Wp(i,e,t,n,r)&&Kp(i,[e,t,n,r]),i.callback}function Hp(e){let t=Ip(Up).current;return Gp(t,e)&&Kp(t,e),t.callback}function Up(){return{callback:null,cleanup:null,refs:[]}}function Wp(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Gp(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Kp(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null: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 qp=19;function Jp(e){return qp>=e}function Yp(e){if(!K.isValidElement(e))return null;let t=e,n=t.props;return(Jp(19)?n?.ref:t.ref)??null}function Xp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Zp(){}var Qp=Object.freeze([]),$p=Object.freeze({});function em(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)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function tm(e,t){return typeof e==`function`?e(t):e}function nm(e,t){return typeof e==`function`?e(t):e}var rm={};function im(e,t,n,r,i){if(!n&&!r&&!i&&!e)return om(t);let a=om(e);return t&&(a=sm(a,t)),n&&(a=sm(a,n)),r&&(a=sm(a,r)),i&&(a=sm(a,i)),a}function am(e){if(e.length===0)return rm;if(e.length===1)return om(e[0]);let t=om(e[0]);for(let n=1;n<e.length;n+=1)t=sm(t,e[n]);return t}function om(e){return dm(e)?{...e(rm)}:cm(e)}function sm(e,t){return dm(t)?t(e):lm(e,t)}function cm(e){let t={...e};for(let e in t){let n=t[e];um(e,n)&&(t[e]=pm(n))}return t}function lm(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Xp(e.style,r);break;case`className`:e[n]=hm(e.className,r);break;default:e[n]=um(n,r)?fm(e[n],r):r}}return e}function um(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 dm(e){return typeof e==`function`}function fm(e,t){return t?e?(...n)=>{let r=n[0];if(gm(r)){let i=r;mm(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:pm(t):e}function pm(e){return e&&((...t)=>{let n=t[0];return gm(n)&&mm(n),e(...t)})}function mm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function hm(e,t){return t?e?t+` `+e:t:e}function gm(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function _m(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=xm(r));let i=vm(t,n,r);if(n.enabled===!1)return null;let a=n.state??$p;return Sm(e,r,i,a)}function vm(e,t,n){let{className:r,style:i}=e,{state:a=$p,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?tm(r,a):void 0,d=l?nm(i,a):void 0,f=l?em(a,c):$p,p=l&&s?ym(s):void 0,m=l?Xp(f,p)??{}:$p;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Hp([m.ref,Yp(n),...o]):Vp(m.ref,Yp(n),o):Vp(null,null)),l?(u!==void 0&&(m.className=hm(m.className,u)),d!==void 0&&(m.style=Xp(m.style,d)),m):$p}function ym(e){return Array.isArray(e)?am(e):im(void 0,e)}var bm=Symbol.for(`react.lazy`);function xm(e){if(e?.$$typeof!==bm)return e;let t=K.Children.toArray(e)[0];return K.isValidElement(t)?t:e}function Sm(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=im(n,t.props);return e.ref=n.ref,K.cloneElement(t,e)}return Cm(e,n)}function Cm(e,t){return e===`button`?(0,K.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,K.createElement)(`img`,{alt:``,...t,key:t.key}):K.createElement(e,t)}var wm=K.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Tm(){return K.useContext(wm)}function Em(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),[,o]=K.useState(0),s=Ip(Om).current,c=Ip(Dm).current,l=K.useRef(0),u=K.useRef(!0),d=K.useRef(null),f=K.useRef(null),p=X(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=X((e,t)=>{c.set(e,t),p()}),h=X(e=>{c.delete(e),p()}),g=X(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!jm(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Mm(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Am(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=X(()=>{let[e,t]=km(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=X(e=>(s.add(e),()=>{s.delete(e)})),b=K.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,q.jsx)(wm.Provider,{value:b,children:t})}function Dm(){return new Map}function Om(){return new Set}function km(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Mm(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Am(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function jm(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Mm(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Nm(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 Pm=Nm(`https://base-ui.com/production-error`,`Base UI`),Fm=K.createContext(void 0);function Im(){let e=K.useContext(Fm);if(e===void 0)throw Error(Pm(64));return e}var Lm=`data-activation-direction`,Rm={tabActivationDirection:e=>({[Lm]:e})};function zm(e,t,n,r){let i=!1,a=!1,o=r??$p;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}}function Bm(e,t,n){let r=n??$p;return{reason:e,event:t??new Event(`base-ui`),...r}}var Vm=`none`,Hm=`trigger-press`,Um=`trigger-hover`,Wm=`trigger-focus`,Gm=`outside-press`,Km=`item-press`,qm=`close-press`,Jm=`focus-out`,Ym=`escape-key`,Xm=`list-navigation`,Zm=`keyboard`,Qm=`pointer`,$m=`cancel-open`,eh=`sibling-open`,th=`disabled`,nh=`missing`,rh=`initial`,ih=`imperative-action`,ah=`window-resize`,oh=K.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=K.useRef([]),[f,p]=K.useState(()=>new Map),[m,h]=Np({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=K.useState(()=>new Map),y=K.useRef(void 0),b=K.useCallback(e=>sh(_,e),[_]),[x,S]=K.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=ch(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;Y(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=X((e,t)=>{t.activationDirection=ch(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=X((e,t)=>{i?.(e,zm(t,void 0,void 0,{activationDirection:`none`}))}),j=X((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=K.useCallback(e=>f.get(e),[f]),N=K.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=K.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=K.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=K.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=K.useRef(!u),R=K.useRef(r),z=K.useRef(u),B=K.useRef(!1);Y(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){B.current&&m!==null&&!y.current?.isConnected&&e(null,nh);return}B.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===R.current&&(z.current=!1),z.current&&t&&m===R.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=nh;r?i=rh:t&&(i=th),e(n,i)}else r&&F!=null&&(A(m,rh),L.current=!1)},[I,g,A,F,h,_,m]);let ee=_m(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:Rm});return(0,q.jsx)(Fm.Provider,{value:P,children:(0,q.jsx)(Em,{elementsRef:d,children:ee})})});function sh(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ch(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=sh(r,e),c=sh(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}function lh(){return typeof window<`u`}function uh(e){return ph(e)?(e.nodeName||``).toLowerCase():`#document`}function dh(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fh(e){return((ph(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ph(e){return lh()?e instanceof Node||e instanceof dh(e).Node:!1}function mh(e){return lh()?e instanceof Element||e instanceof dh(e).Element:!1}function hh(e){return lh()?e instanceof HTMLElement||e instanceof dh(e).HTMLElement:!1}function gh(e){return!lh()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof dh(e).ShadowRoot}function _h(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Oh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vh(e){return/^(table|td|th)$/.test(uh(e))}function yh(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bh=/transform|translate|scale|rotate|perspective|filter/,xh=/paint|layout|strict|content/,Sh=e=>!!e&&e!==`none`,Ch;function wh(e){let t=mh(e)?Oh(e):e;return Sh(t.transform)||Sh(t.translate)||Sh(t.scale)||Sh(t.rotate)||Sh(t.perspective)||!Eh()&&(Sh(t.backdropFilter)||Sh(t.filter))||bh.test(t.willChange||``)||xh.test(t.contain||``)}function Th(e){let t=Ah(e);for(;hh(t)&&!Dh(t);){if(wh(t))return t;if(yh(t))return null;t=Ah(t)}return null}function Eh(){return Ch??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ch}function Dh(e){return/^(html|body|#document)$/.test(uh(e))}function Oh(e){return dh(e).getComputedStyle(e)}function kh(e){return mh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ah(e){if(uh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gh(e)&&e.host||fh(e);return gh(t)?t.host:t}function jh(e){let t=Ah(e);return Dh(t)?(e.ownerDocument||e).body:hh(t)&&_h(t)?t:jh(t)}function Mh(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=jh(e),i=r===e.ownerDocument?.body,a=dh(r);if(i){let e=Nh(a);return t.concat(a,a.visualViewport||[],_h(r)?r:[],e&&n?Mh(e):[])}return t.concat(r,Mh(r,[],n))}function Nh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ph(e){return e?.ownerDocument||document}function Fh(){let[,e]=K.useState({});return K.useCallback(()=>{e({})},[])}var Ih=0;function Lh(e,t=`mui`){let n=K.useRef(void 0),r=Fh(),i=e??n.current;return K.useEffect(()=>{n.current??(Ih+=1,n.current=`${t}-${Ih}`,e??r())},[e,t,r]),i}var Rh=Pp.useId;function zh(e,t){if(Rh!==void 0){let n=Rh();return e??(t?`${t}-${n}`:n)}return Lh(e,t)}function Bh(e){return zh(e,`base-ui`)}var Vh=K.createContext(void 0);function Hh(e=!1){let t=K.useContext(Vh);if(t===void 0&&!e)throw Error(Pm(16));return t}function Uh(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:K.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 Wh(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(dh(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 Gh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=K.useRef(null),s=Hh(!0),c=a??s!==void 0,{props:l}=Uh({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=K.useCallback(()=>{let e=o.current;Kh(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:K.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return im({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(mm(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Kh(r),s=!i&&qh(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(),Wh(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Wh(r,e)))},onKeyUp(e){t||(mm(e),a?.(e),e.target===e.currentTarget&&i&&c&&Kh(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Wh(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,u()})}}function Kh(e){return hh(e)&&e.tagName===`BUTTON`}function qh(e){return hh(e)&&e.tagName===`A`&&!!e.href}var Jh=`data-composite-item-active`;function Yh(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Tm(),u=K.useRef(-1),[d,f]=K.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=K.useRef(null),h=K.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function Xh(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Hh(),{ref:i,index:a}=Yh(e),o=n===a,s=K.useRef(null),c=Vp(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var Zh=K.createContext(void 0);function Qh(){let e=K.useContext(Zh);if(e===void 0)throw Error(Pm(65));return e}function $h(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:eg,platform:tg,maxTouchPoints:ng}=$h(),rg=eg.toLowerCase(),ig=tg.toLowerCase(),ag=/^i(os$|p)/.test(ig)||ig===`macintel`&&ng>1,og=`android`,sg=ig===og||rg.includes(og),cg=!ag&&ig.startsWith(`mac`);ig.startsWith(`win`),!sg&&/^(linux|chrome os)/.test(ig);var lg=cg||ag,ug=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ug&&rg.includes(`firefox`),!ug&&rg.includes(`chrom`);var dg=lg,fg=/jsdom|happydom/.test(rg);function pg(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&gh(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function mg(e,t){let n=e;for(;n;){if(mh(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(gh(n)?n.host:null)}return null}function hg(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var gg=`data-base-ui-focusable`,_g=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,vg=`ArrowLeft`,yg=`ArrowRight`,bg=`ArrowUp`,xg=`ArrowDown`,Sg=`data-starting-style`,Cg=`data-ending-style`,wg={[Sg]:``},Tg={[Cg]:``},Eg={transitionStatus(e){return e===`starting`?wg:e===`ending`?Tg:null}},Dg=`data-open`,Og=`data-closed`,kg=`data-anchor-hidden`,Ag=`data-popup-open`,jg=`data-pressed`,Mg={[Ag]:``},Ng={[Ag]:``,[jg]:``},Pg={[Dg]:``},Fg={[Og]:``},Ig={[kg]:``},Lg={open(e){return e?Mg:null}},Rg={open(e){return e?Ng:null}},zg={open(e){return e?Pg:Fg},anchorHidden(e){return e?Ig:null}},Bg={...zg,...Eg},Vg=`data-trigger-disabled`;function Hg(e,t){if(!mh(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Vg);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(Vg);return!1}function Ug(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 Wg(e){return e.matches(`html,body`)}function Gg(e){return hh(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Kg(e){return mg(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${_g}`)!=null}function qg(e){return e?e.getAttribute(`role`)===`combobox`&&Gg(e):!1}function Jg(e){if(!e||fg)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Yg(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Xg(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Xg(e,t.id,n)])}function Zg(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 Qg(e){e.preventDefault(),e.stopPropagation()}function $g(e){return`nativeEvent`in e}function e_(e){return e.pointerType===``&&e.isTrusted?!0:sg&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function t_(e){return fg?!1:!sg&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(sg||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function n_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function r_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var i_=Math.min,a_=Math.max,o_=Math.round,s_=Math.floor,c_=e=>({x:e,y:e}),l_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function u_(e,t,n){return a_(e,i_(t,n))}function d_(e,t){return typeof e==`function`?e(t):e}function f_(e){return e.split(`-`)[0]}function p_(e){return e.split(`-`)[1]}function m_(e){return e===`x`?`y`:`x`}function h_(e){return e===`y`?`height`:`width`}function g_(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function __(e){return m_(g_(e))}function v_(e,t,n){n===void 0&&(n=!1);let r=p_(e),i=__(e),a=h_(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=D_(o)),[o,D_(o)]}function y_(e){let t=D_(e);return[b_(e),t,b_(t)]}function b_(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var x_=[`left`,`right`],S_=[`right`,`left`],C_=[`top`,`bottom`],w_=[`bottom`,`top`];function T_(e,t,n){switch(e){case`top`:case`bottom`:return n?t?S_:x_:t?x_:S_;case`left`:case`right`:return t?C_:w_;default:return[]}}function E_(e,t,n,r){let i=p_(e),a=T_(f_(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(b_)))),a}function D_(e){let t=f_(e);return l_[t]+e.slice(t.length)}function O_(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function k_(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:O_(e)}function A_(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 j_(e,t){return t<0||t>=e.length}function M_(e,t){return F_(e.current,{disabledIndices:t})}function N_(e,t){return F_(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function P_(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>F_(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:j_(e,u)?-1:u,wrapped:d}}function F_(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&I_(e,a,r));return a}function I_(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!R_(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function L_(e){return e.visibility===`hidden`||e.visibility===`collapse`}function R_(e,t=e?Oh(e):null){return!e||!e.isConnected||!t||L_(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var z_=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function B_(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return gh(n)?n.host:null}function V_(e){for(let t of Array.from(e.children))if(uh(t)===`summary`)return t;return null}function H_(e,t){let n=V_(t);return!!n&&(e===n||Z(n,e))}function U_(e){let t=e?uh(e):``;return e!=null&&e.matches(z_)&&(t!==`summary`||e.parentElement!=null&&uh(e.parentElement)===`details`&&V_(e.parentElement)===e)&&(t!==`details`||V_(e)==null)&&(t!==`input`||e.type!==`hidden`)}function W_(e){if(!U_(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=B_(t)){let n=t!==e,r=uh(t)===`slot`;if(t.hasAttribute(`inert`)||n&&uh(t)===`details`&&!t.open&&!H_(e,t)||t.hasAttribute(`hidden`)||!r&&!G_(t,n))return!1}return!0}function G_(e,t){let n=Oh(e);return t?n.display!==`none`:R_(e,n)}function K_(e){let t=e.tabIndex;if(t<0){let t=uh(e);if(t===`details`||t===`audio`||t===`video`||hh(e)&&e.isContentEditable)return 0}return t}function q_(e){if(uh(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function J_(e,t){let n=q_(e);if(!n)return!0;let r=t.find(e=>{let t=q_(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=q_(e);return t?.name===n.name&&t.form===n.form})===n}function Y_(e){if(hh(e)&&uh(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return hh(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function X_(e,t){Y_(e).forEach(e=>{U_(e)&&t.push(e),X_(e,t)})}function Z_(e,t,n){Y_(e).forEach(e=>{hh(e)&&e.matches(t)&&n.push(e),Z_(e,t,n)})}function Q_(e){return W_(e)&&K_(e)>=0}function $_(e){let t=[];return X_(e,t),t.filter(W_)}function ev(e){let t=$_(e);return t.filter(e=>K_(e)>=0&&J_(e,t))}function tv(e,t){let n=ev(e),r=n.length;if(r===0)return;let i=pg(Ph(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function nv(e){return tv(Ph(e).body,1)||e}function rv(e){return tv(Ph(e).body,-1)||e}function iv(e,t,n){if(!e)return null;let r=[];X_(Ph(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(W_);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z(n,o)&&Q_(o)&&J_(o,a))return o}return r[i]}function av(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function ov(e){ev(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function sv(e){let t=[];Z_(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 cv=K.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=Im(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=Qh(),{highlightedIndex:v,onHighlightedIndexChange:y}=Hh(),b=Bh(o),{compositeProps:x,compositeRef:S,index:C}=Xh({metadata:K.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=K.useRef(!1),E=K.useRef(null),D=X(e=>{E.current?.(),E.current=e?g(e):null});Y(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=pg(Ph(e));if(t&&Z(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=Gh({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=K.useRef(!1),M=K.useRef(!1);function N(e){f(a,zm(Vm,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function F(e){w||r||h&&(!j.current||M.current)&&N(e)}function I(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=Ph(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return _m(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:F,onPointerDown:I,[Jh]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:Rm})}),lv=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})),uv=o(((e,t)=>{t.exports=lv()})),dv=uv(),fv=()=>()=>{},pv=()=>!0,mv=()=>!1;function hv(){return(0,dv.useSyncExternalStore)(fv,pv,mv)}function gv(){let[e,t]=K.useState(!1);return K.useEffect(()=>{t(!0)},[]),e}var _v=Jp(18)?hv:gv;function vv(){return!_v()}var yv=K.createContext(void 0),bv={disableStyleElements:!1};function xv(){return K.useContext(yv)??bv}function Sv(e){let{script:t}=e,{nonce:n}=xv();return vv()?(0,q.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}function Cv(e){let t=Oh(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hh(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(o_(n)!==a||o_(r)!==o)&&(n=a,r=o),{width:n,height:r}}function wv(e,t){let n=(t??dh(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}var Tv=`--active-tab-left`,Ev=`--active-tab-right`,Dv=`--active-tab-top`,Ov=`--active-tab-bottom`,kv=`--active-tab-width`,Av=`--active-tab-height`,jv,Mv={...Rm,activeTabPosition:()=>null,activeTabSize:()=>null},Nv=2,Pv=K.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=Im(),{tabsListElement:d,registerIndicatorUpdateListener:f}=Qh(),p=Fh();K.useEffect(()=>f(p),[f,p]);let m=0,h=0,g=0,_=0,v=0,y=0,b=!1;if(u!=null&&d!=null){let e=s(u);if(e!=null){b=!0;let{width:t,height:n}=Cv(e),{width:r,height:i}=Cv(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1,l=Fv(e,d);m=l.left,g=l.top;let u=(a.left-o.left)/s+d.scrollLeft-d.clientLeft,f=(a.top-o.top)/c+d.scrollTop-d.clientTop,p=Lv(e);Math.abs(u-p.x-m)<=Nv&&Math.abs(f-p.y-g)<=Nv&&(m=u,g=f),v=t,y=n,h=d.scrollWidth-m-v,_=d.scrollHeight-g-y}}let x=b?{left:m,right:h,top:g,bottom:_}:null,S=b?{width:v,height:y}:null,C=b?{[Tv]:`${m}px`,[Ev]:`${h}px`,[Dv]:`${g}px`,[Ov]:`${_}px`,[kv]:`${v}px`,[Av]:`${y}px`}:void 0,w=_m(`span`,e,{state:{orientation:c,activeTabPosition:x,activeTabSize:S,tabActivationDirection:l},ref:t,props:[{role:`presentation`,style:C,hidden:!(b&&v>0&&y>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:Mv});return u==null?null:(0,q.jsxs)(K.Fragment,{children:[w,i&&(jv||=(0,q.jsx)(Sv,{script:``}))]})});function Fv(e,t){let n=Iv(e),r=Iv(t),i=n.left-r.left-t.clientLeft,a=n.top-r.top-t.clientTop,o=Ah(e);for(;hh(o)&&o!==t&&!Dh(o);)i-=o.scrollLeft,a-=o.scrollTop,o=Ah(o);return{left:i,top:a}}function Iv(e){let t=0,n=0,r=e;for(;r!=null;){t+=r.offsetLeft,n+=r.offsetTop;let e=r.offsetParent;e!=null&&(t+=e.clientLeft,n+=e.clientTop),r=e}return{left:t,top:n}}function Lv(e){let t=dh(e).getComputedStyle(e),{x:n,y:r}=wv(e,t),i=n,a=r,{translate:o}=t;if(o&&o!==`none`){let t=o.split(` `);i+=Rv(t[0],e.offsetWidth),a+=Rv(t[1],e.offsetHeight)}return{x:i,y:a}}function Rv(e,t){if(!e)return 0;let n=parseFloat(e);return Number.isFinite(n)?e.endsWith(`%`)?n/100*t:n:0}function zv(e){return Jp(19)?e:e?`true`:void 0}function Bv(e){K.useEffect(e,Qp)}var Vv=null;globalThis.requestAnimationFrame;var Hv=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)}},Uv=class e{static create(){return new e}static request(e){return Hv.request(e)}static cancel(e){return Hv.cancel(e)}currentId=Vv;request(e){this.cancel(),this.currentId=Hv.request(()=>{this.currentId=Vv,e()})}cancel=()=>{this.currentId!==Vv&&(Hv.cancel(this.currentId),this.currentId=Vv)};disposeEffect=()=>this.cancel};function Wv(){let e=Ip(Uv.create).current;return Bv(e.disposeEffect),e}function Gv(e){return e==null?e:`current`in e?e.current:e}function Kv(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var qv=null;function Jv(e){if(!qv){let e=[];qv=e,queueMicrotask(()=>{qv=null,Pc.flushSync(()=>{for(let t of e)t()})})}qv.push(e)}function Yv(e,t=!1,n=!1){let r=Wv();return X((i,a=null)=>{r.cancel();let o=Gv(e);if(o==null)return;let s=o,c=()=>{n?Jv(()=>{a?.aborted||i()}):Pc.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Kv(s).map(e=>e.finished.then(Zp))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Kv(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Sg;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})}else r.request(l)})}function Xv(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X(a),s=Yv(r,n,i);K.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Zv(e,t=!1,n=!1,r=!1){let[i,a]=K.useState(e&&t?`idle`:void 0),[o,s]=K.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=Uv.request(()=>{a(`ending`)});return()=>{Uv.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t||i===void 0)return;let n=Uv.request(()=>{a(void 0)});return()=>{Uv.cancel(n)}},[t,e,i]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Uv.request(()=>{a(`idle`)});return()=>{Uv.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var Qv=`data-index`,$v={...Rm,...Eg},ey=K.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=Im(),p=Bh(),{ref:m,index:h}=Yh(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=Zv(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=K.useRef(null),w=_m(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:zv(!g),[Qv]:h},s],stateAttributesMapping:$v});return Xv({open:g,ref:C,onComplete(){g||y(!1)}}),Y(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null});function ty(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var ny=`ArrowUp`,ry=`ArrowDown`,iy=`ArrowLeft`,ay=`ArrowRight`,oy=new Set([ny,ry,iy,ay,`Home`,`End`]),sy=`Shift`,cy=[sy,`Control`,`Alt`,`Meta`];function ly(e){return hh(e)&&e.tagName===`INPUT`}function uy(e){return!!(ly(e)&&e.selectionStart!=null||hh(e)&&e.tagName===`TEXTAREA`)}function dy(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=fy(e,t,`left`),a=py(e),o=py(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=fy(e,t,`top`),r=py(e),i=py(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function fy(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function py(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function my(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=Qp}=e,[p,m]=K.useState(0),h=r!=null,g=K.useRef(null),_=Vp(g,c),v=K.useRef([]),y=K.useRef(!1),b=K.useRef(null),x=o??p,S=X((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];dy(g.current,t,a,n)}}),C=X(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||I_(e,x,d)?S(hy(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(I_(t,x,d)){let e=F_(t,{disabledIndices:d});j_(t,e)||S(e)}dy(g.current,r,a,n)});Y(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(I_(e,x,d)){let t=F_(e,{disabledIndices:d});j_(e,t)||S(t)}},[d,o,x,v,S]);let w=X((e,t,n)=>i?i(e,t,n,v):n),T=X(e=>{let o=e.key===`Home`||e.key===`End`;if(!oy.has(e.key)||!l&&o||gy(e,f)||!g.current)return;let s=a===`rtl`,c=s?iy:ay,p=s?ay:iy,m=n===`vertical`?ry:c,_=n===`vertical`?ny:p,y=hg(e.nativeEvent);if(y!=null&&uy(y)&&!ty(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=M_(v,d),T=N_(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=F_(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!j_(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=hg(e.nativeEvent);t&&n!=null&&uy(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function hy(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!I_(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function gy(e,t){for(let n of cy)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var _y=K.createContext(void 0);function vy(){return K.useContext(_y)?.direction??`ltr`}function yy(e){let{render:t,className:n,style:r,refs:i=Qp,props:a=Qp,state:o=$p,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=my({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:vy(),disabledIndices:v,modifierKeys:y}),k=_m(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=K.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,q.jsx)(Vh.Provider,{value:A,children:(0,q.jsx)(Em,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var by=K.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=Im(),[d,f]=K.useState(0),[p,m]=K.useState(null),h=K.useRef(new Set),g=K.useRef(new Set),_=K.useRef(null);Y(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=X(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=X(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=K.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,q.jsx)(Zh.Provider,{value:S,children:(0,q.jsx)(yy,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:Rm,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:Qp})})});function xy(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=xy(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Sy(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xy(e))&&(r&&(r+=` `),r+=t);return r}var Cy=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wy=Sy,Ty=(e,t)=>n=>{if(t?.variants==null)return wy(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=Cy(t)||Cy(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 wy(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)};function Ey({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(oh,{"data-slot":`tabs`,"data-orientation":t,className:J(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Dy=Ty(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Oy({className:e,variant:t=`default`,...n}){return(0,q.jsxs)(by,{"data-slot":`tabs-list`,"data-variant":t,className:J(`relative`,Dy({variant:t}),e),...n,children:[n.children,t===`line`&&(0,q.jsx)(Pv,{renderBeforeHydration:!0,className:`absolute bg-primary transition-[left,top,width,height] duration-200 ease-out motion-reduce:transition-none group-data-horizontal/tabs:bottom-[-5px] group-data-horizontal/tabs:left-(--active-tab-left) group-data-horizontal/tabs:h-0.5 group-data-horizontal/tabs:w-(--active-tab-width) group-data-horizontal/tabs:rounded-full group-data-vertical/tabs:top-(--active-tab-top) group-data-vertical/tabs:-left-1 group-data-vertical/tabs:h-(--active-tab-height) group-data-vertical/tabs:w-0.5 group-data-vertical/tabs:rounded-full`})]})}function ky({className:e,...t}){return(0,q.jsx)(cv,{"data-slot":`tabs-trigger`,className:J(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-[13px] font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,e),...t})}function Ay({className:e,...t}){return(0,q.jsx)(ey,{"data-slot":`tabs-content`,className:J(`flex-1 text-sm outline-none`,e),...t})}function jy(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var My=e=>{switch(e){case`success`:return Fy;case`info`:return Ly;case`warning`:return Iy;case`error`:return Ry;default:return null}},Ny=Array(12).fill(0),Py=({visible:e,className:t})=>K.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},K.createElement(`div`,{className:`sonner-spinner`},Ny.map((e,t)=>K.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Fy=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Iy=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Ly=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ry=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},K.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),zy=K.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},K.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),K.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),By=()=>{let[e,t]=K.useState(document.hidden);return K.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Vy=1,Hy=100,Uy=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Vy++,Wy=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Hy;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Uy(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],K.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Ky(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!K.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Uy(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Gy=(e,t)=>Wy.message(e,t),Ky=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,qy=Object.assign(Gy,{success:Wy.success,info:Wy.info,warning:Wy.warning,error:Wy.error,custom:Wy.custom,message:Wy.message,promise:Wy.promise,dismiss:Wy.dismiss,loading:Wy.loading},{getHistory:()=>Wy.toasts,getToasts:()=>Wy.getActiveToasts()});jy(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Jy(e){return e.label!==void 0}var Yy=3,Xy=`24px`,Zy=`16px`,Qy=4e3,$y=356,eb=14,tb=45,nb=200;function rb(...e){return e.filter(Boolean).join(` `)}function ib(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var ab=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=K.useState(null),[O,k]=K.useState(null),[A,j]=K.useState(!1),[M,N]=K.useState(!1),[P,F]=K.useState(!1),[I,L]=K.useState(!1),[R,z]=K.useState(!1),[B,ee]=K.useState(0),[te,ne]=K.useState(0),re=K.useRef(n.duration||y||Qy),ie=K.useRef(null),ae=K.useRef(null),oe=c===0,se=c+1<=o,ce=n.type,le=ce??`default`,ue=n.dismissible!==!1,de=n.className||``,fe=n.descriptionClassName||``,pe=K.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),me=K.useMemo(()=>n.closeButton??p,[n.closeButton,p]),he=K.useMemo(()=>n.duration||y||Qy,[n.duration,y]),V=K.useRef(0),ge=K.useRef(0),_e=K.useRef(0),ve=K.useRef(null),[ye,be]=b.split(`-`),xe=K.useMemo(()=>s.reduce((e,t,n)=>n>=pe?e:e+t.height,0),[s,pe]),Se=By(),Ce=K.useMemo(()=>e.swipeDirections??ib(b),[e.swipeDirections,b]),we=n.invert||t,Te=ce===`loading`;ge.current=K.useMemo(()=>pe*x+xe,[pe,xe]),K.useEffect(()=>{re.current=he},[he]),K.useEffect(()=>{j(!0)},[]),K.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),K.useLayoutEffect(()=>{if(!A)return;let e=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=K.useCallback(()=>{N(!0),ee(ge.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},nb)},[n,d,a,ge]);K.useEffect(()=>{if(n.promise&&ce===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Se?(()=>{if(_e.current<V.current){let e=new Date().getTime()-V.current;re.current-=e}_e.current=new Date().getTime()})():re.current!==1/0&&(V.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},re.current)),()=>clearTimeout(e)},[u,i,n,ce,Se,Ee]),K.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return w?.loading?K.createElement(`div`,{className:rb(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ce===`loading`},w.loading):K.createElement(Py,{className:rb(C?.loader,n?.classNames?.loader),visible:ce===`loading`})}let Oe=n.icon||w?.[ce]||My(ce);return K.createElement(`li`,{tabIndex:0,ref:ae,className:rb(_,de,C?.toast,n?.classNames?.toast,C?.[le],n?.classNames?.[le]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":R,"data-removed":M,"data-visible":se,"data-y-position":ye,"data-x-position":be,"data-index":c,"data-front":oe,"data-swiping":P,"data-dismissible":ue,"data-type":ce,"data-invert":we,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?B:ge.current}px`,"--initial-height":S?`auto`:`${te}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),ve.current=null},onPointerDown:e=>{e.button!==2&&!Te&&ue&&(ie.current=new Date,ee(ge.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),ve.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(I||!ue)return;ve.current=null;let e=Number(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?Ce.includes(e>0?`right`:`left`):Ce.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=tb||a>.11))ee(ge.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),L(!0);else{var o,s;(o=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),z(!1),F(!1),D(null)}},onPointerMove:e=>{var t,n;if(!ve.current||!ue||window.getSelection()?.toString().length>0)return;let r=e.clientY-ve.current.y,i=e.clientX-ve.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(Ce.includes(`top`)||Ce.includes(`bottom`)){if(Ce.includes(`top`)&&r<0||Ce.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(Ce.includes(`left`)||Ce.includes(`right`))){if(Ce.includes(`left`)&&i<0||Ce.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&z(!0),(t=ae.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ae.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},me&&!n.jsx&&ce!==`loading`?K.createElement(`button`,{"aria-label":T,"data-disabled":Te,"data-close-button":!0,onClick:Te||!ue?()=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:rb(C?.closeButton,n?.classNames?.closeButton)},w?.close??zy):null,(ce||n.icon||n.promise)&&n.icon!==null&&(w?.[ce]!==null||n.icon)?K.createElement(`div`,{"data-icon":``,className:rb(C?.icon,n?.classNames?.icon)},ce===`loading`?n.icon||De():n.promise?De():null,ce===`loading`?null:Oe):null,K.createElement(`div`,{"data-content":``,className:rb(C?.content,n?.classNames?.content)},K.createElement(`div`,{"data-title":``,className:rb(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?K.createElement(`div`,{"data-description":``,className:rb(v,fe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),K.isValidElement(n.cancel)?n.cancel:n.cancel&&Jy(n.cancel)?K.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Jy(n.cancel)&&ue&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:rb(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,K.isValidElement(n.action)?n.action:n.action&&Jy(n.action)?K.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Jy(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:rb(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function ob(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function sb(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Zy:Xy;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var cb=K.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Yy,toastOptions:g,dir:_=ob(),gap:v=eb,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=K.useState([]),w=K.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=K.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=K.useState([]),[O,k]=K.useState(!1),[A,j]=K.useState(!1),[M,N]=K.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=K.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=K.useRef(null),L=K.useRef(!1),R=K.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Wy.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return K.useEffect(()=>Wy.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Pc.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),K.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),K.useEffect(()=>{S.length<=1&&k(!1)},[S]),K.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),K.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),K.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?K.createElement(`ol`,{key:t,dir:_===`auto`?ob():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${$y}px`,"--gap":`${v}px`,...m,...sb(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>K.createElement(ab,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),lb=o((e=>{var t=d(),n=uv();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}})),ub=o(((e,t)=>{t.exports=lb()})),db=K.createContext(void 0);function fb(){let e=K.useContext(db);if(e===void 0)throw Error(Pm(13));return e}var pb={imageLoadingStatus:()=>null},mb=K.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=K.useState(`idle`),c={imageLoadingStatus:o},l=K.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=_m(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:pb});return(0,q.jsx)(db.Provider,{value:l,children:u})});function hb(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=K.useState(`idle`),s=o[1];return Y(()=>{if(!a)return Zp;if(!e&&!i)return s(`error`),Zp;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var gb={...pb,...Eg},_b=K.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=fb(),[f,p]=hb(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=Zv(m),v=K.useRef(null),y=K.useRef(!0);Y(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=X(e=>{i?.(e),d(e)});Y(()=>{f!==`idle`&&x(f)},[f,x]),Y(()=>()=>d(`idle`),[d]),Xv({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=_m(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:gb,enabled:C});return C?T:null}),vb=0,yb=class e{static create(){return new e}currentId=vb;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=vb,t()},e)}isStarted(){return this.currentId!==vb}clear=()=>{this.currentId!==vb&&(clearTimeout(this.currentId),this.currentId=vb)};disposeEffect=()=>this.clear};function bb(){let e=Ip(yb.create).current;return Bv(e.disposeEffect),e}var xb=K.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=fb(),[c,l]=K.useState(i===0),u=bb();return K.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),_m(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:pb,enabled:s!==`loaded`&&(i===0||c)})});function Sb({className:e,size:t=`default`,...n}){return(0,q.jsx)(mb,{"data-slot":`avatar`,"data-size":t,className:J(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function Cb({className:e,...t}){return(0,q.jsx)(_b,{"data-slot":`avatar-image`,className:J(`aspect-square size-full rounded-full object-cover`,e),...t})}function wb({className:e,...t}){return(0,q.jsx)(xb,{"data-slot":`avatar-fallback`,className:J(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function Tb({name:e,image:t,className:n}){return(0,q.jsxs)(Sb,{"aria-hidden":`true`,className:J(`size-8 overflow-hidden rounded-full text-xs`,n),children:[t&&(0,q.jsx)(Cb,{src:t,alt:``}),(0,q.jsx)(wb,{className:`rounded-full bg-primary/10 font-medium text-primary text-[length:inherit]`,children:e.trim().split(/\s+/).slice(0,2).map(e=>e.slice(0,1)).join(``).toUpperCase()||`?`})]})}function Eb({name:e,email:t,image:n}){return(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,q.jsx)(Tb,{name:e,image:n}),(0,q.jsxs)(`span`,{className:`min-w-0`,children:[(0,q.jsx)(`span`,{className:`block wrap-anywhere whitespace-normal font-medium`,children:e}),(0,q.jsx)(`span`,{className:`block break-all whitespace-normal text-xs text-muted-foreground`,children:t})]})]})}var Db=Object.create(null),Ob=e=>({}),kb=new Proxy(Db,{get(e,t){return Ob()[t]??Db[t]},has(e,t){return t in Ob()||t in Db},set(e,t,n){let r=Ob(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=Ob(!0);return delete n[t],!0},ownKeys(){let e=Ob(!0);return Object.keys(e)}});kb.NODE_ENV;function Ab(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return Ab(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Ab(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Ab(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Ab(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Ab(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Ab(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Ab(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});var jb=1,Mb=4,Nb=8,Pb=24,Fb={eterm:Mb,cons25:Mb,console:Mb,cygwin:Mb,dtterm:Mb,gnome:Mb,hurd:Mb,jfbterm:Mb,konsole:Mb,kterm:Mb,mlterm:Mb,mosh:Pb,putty:Mb,st:Mb,"rxvt-unicode-24bit":Pb,terminator:Pb,"xterm-kitty":Pb},Ib=new Map(Object.entries({APPVEYOR:Nb,BUILDKITE:Nb,CIRCLECI:Pb,DRONE:Nb,GITEA_ACTIONS:Pb,GITHUB_ACTIONS:Pb,GITLAB_CI:Nb,TRAVIS:Nb})),Lb=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Rb(){if(Ab(`FORCE_COLOR`)!==void 0)switch(Ab(`FORCE_COLOR`)){case``:case`1`:case`true`:return Mb;case`2`:return Nb;case`3`:return Pb;default:return jb}if(Ab(`NODE_DISABLE_COLORS`)!==void 0&&Ab(`NODE_DISABLE_COLORS`)!==``||Ab(`NO_COLOR`)!==void 0&&Ab(`NO_COLOR`)!==``||Ab(`TERM`)===`dumb`)return jb;if(Ab(`TMUX`))return Pb;if(`TF_BUILD`in kb&&`AGENT_NAME`in kb)return Mb;if(`CI`in kb){for(let{0:e,1:t}of Ib)if(e in kb)return t;return Ab(`CI_NAME`)===`codeship`?Nb:jb}if(`TEAMCITY_VERSION`in kb)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(Ab(`TEAMCITY_VERSION`))===null?jb:Mb;switch(Ab(`TERM_PROGRAM`)){case`iTerm.app`:return!Ab(`TERM_PROGRAM_VERSION`)||/^[0-2]\./.exec(Ab(`TERM_PROGRAM_VERSION`))!==null?Nb:Pb;case`HyperTerm`:case`MacTerm`:return Pb;case`Apple_Terminal`:return Nb}if(Ab(`COLORTERM`)===`truecolor`||Ab(`COLORTERM`)===`24bit`)return Pb;if(Ab(`TERM`)){if(/truecolor/.exec(Ab(`TERM`))!==null)return Pb;if(/^xterm-256/.exec(Ab(`TERM`))!==null)return Nb;let e=Ab(`TERM`).toLowerCase();if(Fb[e])return Fb[e];if(Lb.some(t=>t.exec(e)!==null))return Mb}return Ab(`COLORTERM`)?Mb:jb}var zb=Symbol.for(`better-auth:global`),Bb=null,Vb={},Hb=`1.7.8`;function Ub(){return globalThis[zb]||(globalThis[zb]={version:Hb,epoch:1,context:Vb},Bb=globalThis[zb]),Bb=globalThis[zb],Bb.version!==Hb&&(Bb.version=Hb,Bb.epoch++),globalThis[zb]}function Wb(){return Ub().context.endpointContextAsyncStorage?.getStore()}var Gb={reset:`\x1B[0m`,bright:`\x1B[1m`,dim:`\x1B[2m`,undim:`\x1B[22m`,underscore:`\x1B[4m`,blink:`\x1B[5m`,reverse:`\x1B[7m`,hidden:`\x1B[8m`,fg:{black:`\x1B[30m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,white:`\x1B[37m`},bg:{black:`\x1B[40m`,red:`\x1B[41m`,green:`\x1B[42m`,yellow:`\x1B[43m`,blue:`\x1B[44m`,magenta:`\x1B[45m`,cyan:`\x1B[46m`,white:`\x1B[47m`}},Kb=[`debug`,`info`,`success`,`warn`,`error`];function qb(e,t){return Kb.indexOf(t)>=Kb.indexOf(e)}var Jb={info:Gb.fg.blue,success:Gb.fg.green,warn:Gb.fg.yellow,error:Gb.fg.red,debug:Gb.fg.magenta},Yb=(e,t,n)=>{let r=new Date().toISOString();return n?`${Gb.dim}${r}${Gb.reset} ${Jb[e]}${e.toUpperCase()}${Gb.reset} ${Gb.bright}[Better Auth]:${Gb.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},Xb=(e=>{let t=e?.disabled!==!0,n=e?.level??`warn`,r=e?.disableColors===void 0?Rb()!==1:!e.disableColors,i=(i,a,o=[])=>{if(!t||!qb(n,i))return;let s=Yb(i,a,r);!e||typeof e.log!=`function`?i===`error`?console.error(s,...o):i===`warn`?console.warn(s,...o):console.log(s,...o):e.log(i===`success`?`info`:i,a,...o)};return{...Object.fromEntries(Kb.map(e=>[e,(...[t,...n])=>i(e,t,n)])),get level(){return n}}})(),Zb=()=>{let e=Wb()?.context.logger;return e&&e!==Qb?e:Xb},Qb={debug:(...e)=>Zb().debug(...e),info:(...e)=>Zb().info(...e),success:(...e)=>Zb().success(...e),warn:(...e)=>Zb().warn(...e),error:(...e)=>Zb().error(...e),get level(){return Zb().level}};function $b(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}function ex(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function tx(e){let t=e.split(`
|
|
56
56
|
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
57
|
-
at `))}function Wb(e,t){class n extends e{#e;constructor(...e){if(Hb()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Ub(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var Gb={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Wb(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:Gb[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var Kb=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},qb=47;function Jb(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===qb;)t--;return t===e.length?e:e.slice(0,t)}function Yb(e){try{return(Jb(new URL(e).pathname)||`/`)!==`/`}catch{throw new Kb(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Xb(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Kb(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Kb?t:new Kb(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Zb(e,t=`/api/auth`){if(Xb(e),Yb(e))return e;let n=Jb(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Qb(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function $b(e,t,n,r,i){if(e)return Zb(e,t);if(r!==!1){let e=_b.BETTER_AUTH_URL||_b.NEXT_PUBLIC_BETTER_AUTH_URL||_b.PUBLIC_BETTER_AUTH_URL||_b.NUXT_PUBLIC_BETTER_AUTH_URL||_b.NUXT_PUBLIC_AUTH_URL||(_b.BASE_URL===`/`?void 0:_b.BASE_URL);if(e)return Zb(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Qb(o,`proto`)&&Qb(a,`host`))try{return Zb(`${o}://${a}`,t)}catch{}if(n){let e=ex(n.url);if(!e)throw new Kb(`Could not get origin from request. Please provide a valid base URL.`);return Zb(e,t)}if(typeof window<`u`&&window.location)return Zb(window.location.origin,t)}function ex(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var tx={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},nx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,rx={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},ix=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function ax(e){return e instanceof Date&&!isNaN(e.getTime())}function ox(e){let t=ix.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return ax(f)?f:null}function sx(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in rx)return rx[s];if(!nx.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(tx).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);else{if(a&&typeof t==`string`){let e=ox(t);if(e)return e}return i?i(e,t):t}})}catch(t){if(n)throw t;return e}}function cx(e,t={strict:!0}){return sx(e,t)}var lx=[`javascript:`,`data:`,`vbscript:`];function ux(e){let t;try{t=new URL(e)}catch{return!0}return!lx.includes(t.protocol)}var dx={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&ux(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},fx=[],px=0,mx=null,hx=4,gx=globalThis.nanostoresGlobal||={epoch:0},_x=()=>{let e,t;for(;px<fx.length;){t=px,px+=hx;let n=mx?.get(fx[t]);if(n){if(!n.has(fx[t+1]))continue;n.clear()}try{fx[t](fx[t+1].value,fx[t+2],fx[t+3])}catch(t){e=t}}if(fx.length=px=0,e)throw e},vx=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{mx?.get(e)?.delete(n);for(let t=px;t<fx.length;)fx[t]===e&&fx[t+1]===n?fx.splice(t,hx):t+=hx;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){gx.epoch++;let i=!fx.length&&!0;for(let i of t)fx.push(i,n,e,r);i&&_x()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},yx=2,bx=5,xx=6,Sx=10,Cx=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Sx]||(e.events[n+Sx]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+Sx](),delete e.events[n+Sx]))}),wx=(e,t)=>Cx(e,t,yx,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),Tx=1e3,Ex=(e,t)=>Cx(e,n=>{let r=t(n);r&&e.events[xx].push(r)},bx,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[xx]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[xx])t();e.events[xx]=[]}},Tx)},()=>{e.listen=n,e.off=r}});function Dx(e,t){let n=kx(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var Ox=/(.*)\[(\d+)\]/;function kx(e){return e.split(`.`).flatMap(e=>Ax(e))}function Ax(e){if(Ox.test(e)){let[,t,n]=e.match(Ox);return[...Ax(t),n]}return[e]}function jx(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(Dx(i,e),Dx(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}function Mx(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Nx(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Nx(e[n],t[n]))return!1;return!0}if(Mx(e)&&Mx(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!Nx(e[r],t[r]))return!1;return!0}return!1}function Px(e,t){return wx(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var Fx=Symbol.for(`better-auth:auth-query`);function Ix(e){return Fx in e&&e[Fx]===!0}function Lx(e){let t=vx(e);return Object.defineProperty(t,Fx,{value:!0}),t}var Rx=Symbol.for(`better-auth:broadcast-channel`),zx=()=>Math.floor(Date.now()/1e3),Bx=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:zx()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Vx(e=`better-auth.message`){return globalThis[Rx]||(globalThis[Rx]=new Bx(e)),globalThis[Rx]}var Hx=Symbol.for(`better-auth:focus-manager`),Ux=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Wx(){return globalThis[Hx]||(globalThis[Hx]=new Ux),globalThis[Hx]}var Gx=Symbol.for(`better-auth:online-manager`),Kx=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function qx(){return globalThis[Gx]||(globalThis[Gx]=new Kx),globalThis[Gx]}var Jx=()=>Math.floor(Date.now()/1e3),Yx=5;function Xx(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||qx().isOnline,u=e=>{if(l()){if(e?.event===`storage`)t();else if(e?.event===`poll`)c.lastSessionRequest=Jx(),t();else if(e?.event===`visibilitychange`){if(Jx()-c.lastSessionRequest<Yx)return;c.lastSessionRequest=Jx(),t()}else t()}},d=e=>{Vx().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Vx().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Wx().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=qx().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Vx().setup(),c.cleanupFocusSetup=Wx().setup(),c.cleanupOnlineSetup=qx().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Zx=()=>typeof window>`u`,Qx=Tx;function $x(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function eS(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function tS(e){return!e||e.session===null&&e.user===null?null:e}function nS(e,t){return Nx(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function rS(e,t){let n=vx(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=Lx({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});Px(s,nS);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=eS(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=eS(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=tS(i),u=s.value,d=u.data!=null&&l!=null&&Nx(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+Qx,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return Ex(s,()=>{let e;Zx()||(e=setTimeout(()=>{d()},0));let r=Xx({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function iS(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function aS(e,t,n=`.`,r){if(!iS(t))return aS(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:iS(a)&&iS(i[t])?aS(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function oS(e){return(...t)=>t.reduce((t,n)=>aS(t,n,``,e),{})}var sS=oS(),cS=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},lS=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},uS=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},dS=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function fS(e){if(typeof e==`number`)return new uS({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new uS(e);case`exponential`:return new dS(e);default:throw Error(`Invalid retry strategy`)}}var pS=[`get`,`post`,`put`,`patch`,`delete`];function mS(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return pS.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var hS=e=>e===`.`||e===`..`,gS=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function _S(e,t){let n=t.get(e);if(n===void 0)return gS(e);if(hS(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function vS(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=mS(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>_S(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var yS=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},bS=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function xS(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return bS.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function SS(e){try{return JSON.parse(e),!0}catch{return!1}}function CS(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function wS(e){try{return JSON.parse(e)}catch{return e}}function TS(e){return typeof e==`function`}function ES(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&TS(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&TS(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function DS(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function OS(e){let t=new Headers(DS(e?.headers,await yS(e)));if(!t.has(`content-type`)){let n=kS(e?.body);n&&t.set(`content-type`,n)}return t}function kS(e){return CS(e)?`application/json`:null}function AS(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function jS(e,t){let{body:n}=e;return n?!CS(n)||typeof n==`string`?n:AS(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function MS(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=mS(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function NS(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var PS=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function FS(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new PS(n.issues);return n.value}function IS(e){"@babel/helpers - typeof";return IS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},IS(e)}function LS(e,t){if(IS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(IS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function RS(e){var t=LS(e,`string`);return IS(t)==`symbol`?t:t+``}function zS(e,t,n){return(t=RS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?BS(Object(n),!0).forEach(function(t){zS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var HS=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await lS(e,t),o=ES(a),s=new AbortController,c=a.signal??s.signal,l=vS(i,a),u=await OS(a),d=jS(a,u),f=MS(i,a),p=VS(VS({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=NS(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e(VS(VS({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=xS(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??wS)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await FS(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e(VS(VS({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??wS,b=await h.text(),x=SS(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:VS(VS({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e(VS(VS({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=fS(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await HS(e,VS(VS({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new cS(h.status,h.statusText,x?S:b);return{data:null,error:VS(VS({},S),{},{status:h.status,statusText:h.statusText})}},US=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=VS(VS({},n),e.query!==void 0&&{query:VS(VS({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=mS(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await FS(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=VS(VS(VS(VS({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await FS(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=VS({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=VS(VS({},t),i.query)}i=VS(VS({},i),{},{body:o.input?await FS(o.input,n?.body):n?.body,params:o.params?await FS(o.params,n?.params):n?.params})}return{url:t,options:i}}}return VS({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),WS=e=>{async function t(t,n){let r=VS(VS(VS({},e),n),{},{headers:DS(e?.headers,n?.headers),plugins:[...e?.plugins||[],US(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await HS(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await HS(t,r)}return t},GS=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},KS=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,qS=(e,t)=>{let n=`credentials`in Request.prototype,r=$b(e?.baseURL,e?.basePath,void 0,t)??GS(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=WS({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?cx(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[dx],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=rS(d,e),h=!1,g=e=>{h||e===null||(h=!0,$x(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:KS,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=sS(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function JS(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function YS(e){return e.charAt(0).toUpperCase()+e.slice(1)}var XS=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,ZS=/['\u2019]/g;function QS(e){return e.replace(ZS,``).match(XS)??[]}function $S(e){return QS(e).map(e=>e.toLowerCase()).join(`-`)}function eC(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function tC(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||JS(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map($S).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=eC(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function nC(e,t={}){let n=(0,K.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,K.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?jx(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,K.useSyncExternalStore)(a,o,Ix(e)?()=>e.init:o)}function rC(e){return`use${YS(e)}`}function iC(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=qS(e),c={};for(let[e,t]of Object.entries(r))c[rC(e)]=()=>nC(t);return tC({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var aC=`1.7.8`,oC=Vb({FAILED_TO_CREATE_USER:`Failed to create user`,USER_ALREADY_EXISTS:`User already exists.`,USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:`User already exists. Use another email.`,YOU_CANNOT_BAN_YOURSELF:`You cannot ban yourself`,YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:`You are not allowed to change users role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:`You are not allowed to create users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:`You are not allowed to list users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:`You are not allowed to list users sessions`,YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:`You are not allowed to ban users`,YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:`You are not allowed to impersonate users`,YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:`You are not allowed to revoke users sessions`,YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:`You are not allowed to delete users`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:`You are not allowed to set users password`,BANNED_USER:`You have been banned from this application`,YOU_ARE_NOT_ALLOWED_TO_GET_USER:`You are not allowed to get user`,NO_DATA_TO_UPDATE:`No data to update`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:`You are not allowed to update users`,YOU_CANNOT_REMOVE_YOURSELF:`You cannot remove yourself`,YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:`You are not allowed to set a non-existent role value`,YOU_CANNOT_IMPERSONATE_ADMINS:`You cannot impersonate admins`,INVALID_ROLE_TYPE:`Invalid role type`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL:`You are not allowed to update users email`,PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER:`Password cannot be updated through update-user. Use the set-user-password endpoint instead`});function sC(e){return{success:!1,error:`You are not allowed to access resource: ${e}`}}function cC(e){return{success:!1,error:`unauthorized to access resource "${e}"`}}function lC(e){return e===`OR`?`OR`:`AND`}function uC(e){return Array.isArray(e)}function dC(e){if(uC(e))return{actions:e,connector:`AND`};if(!e||typeof e!=`object`)throw new Kb(`Invalid access control request`);let{actions:t,connector:n}=e;return uC(t)?{actions:t,connector:lC(n)}:{actions:[],connector:lC(n)}}function fC(e,t){return typeof t==`string`&&e.includes(t)}function pC(e,{actions:t,connector:n}){return t.length===0?!1:n===`OR`?t.some(t=>fC(e,t)):t.every(t=>fC(e,t))}function mC(e){return{authorize(t,n=`AND`){let r=!1;for(let[i,a]of Object.entries(t)){let t=e[i];if(!t){if(n===`AND`)return sC(i);continue}let o=pC(t,dC(a));if(o&&(r=!0),o&&n===`OR`)return{success:!0};if(!o&&n===`AND`)return cC(i)}return r?{success:!0}:{success:!1,error:`Not authorized`}},statements:e}}function hC(e){return{newRole(e){return mC(e)},statements:e}}var gC=hC({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`impersonate-admins`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),_C=gC.newRole({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),vC=gC.newRole({user:[],session:[]}),yC={admin:_C,user:vC},bC=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||`user`).split(`,`),n=e.options?.roles||yC;for(let r of t)if(n[r]?.authorize(e.permissions)?.success)return!0;return!1},xC=e=>{let t={admin:_C,user:vC,...e?.roles};return{id:`admin-client`,version:aC,$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>bC({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions})}}),pathMethods:{"/admin/list-users":`GET`,"/admin/impersonate-user":`POST`,"/admin/stop-impersonating":`POST`},atomListeners:[{matcher:e=>e===`/admin/impersonate-user`||e===`/admin/stop-impersonating`,signal:`$sessionSignal`}],$ERROR_CODES:oC}},SC=`ba_param`;function CC(e){let t=e.getAll(SC);if(t.length)return new Set(t)}function wC(e){let t=new URLSearchParams(e);if(!t.has(`sig`))return;let n=CC(t);if(!n)return;let r=new URLSearchParams;for(let[e,i]of t.entries())(e===`sig`||e===SC||n.has(e))&&r.append(e,i);return r.toString()}var TC=`1.7.8`,EC=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;function DC(e){if(typeof e==`string`&&EC.test(e)){let t=new Date(e);if(!isNaN(t.getTime()))return t}return e}function OC(e){if(e==null)return e;if(typeof e==`string`)return DC(e);if(e instanceof Date)return e;if(Array.isArray(e))return e.map(OC);if(typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=OC(e[n]);return t}return e}function kC(e){try{return typeof e==`string`?JSON.parse(e,(e,t)=>DC(t)):e==null?null:OC(e)}catch(e){return Bb.error(`Error parsing JSON`,{error:e}),null}}var AC=()=>({id:`oauth-provider-client`,version:TC,fetchPlugins:[{id:`oauth-provider-signin`,name:`oauth-provider-signin`,description:`Adds the current page query to oauth requests`,hooks:{async onRequest(e){let t=e.headers,n=typeof e.body==`string`?t.get(`content-type`)===`application/x-www-form-urlencoded`?Object.fromEntries(new URLSearchParams(e.body)):kC(e.body??`{}`):e.body;n?.oauth_query||typeof window<`u`&&window?.location?.search&&e.method!==`GET`&&e.method!==`DELETE`&&(e.body=JSON.stringify({...n,oauth_query:wC(window.location.search)}))}}}],$InferServerPlugin:{}}),jC=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},MC=10,NC=13,PC=32,FC=6;function IC(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=``,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l!==void 0){if(e=l+e,e===``||e===`ï`||e===`ï»`){l=e;return}l=void 0,e=e.replace(/^(?:\uFEFF|\xEF\xBB\xBF)/,``)}if((h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(`
|
|
58
|
-
`)===-1&&e.indexOf(`\r`)===-1){if(c<
|
|
59
|
-
`),r=t===-1?n:n===-1||t<n?t:n;return r===-1?``:r===e.length-1&&e.charCodeAt(r)===
|
|
57
|
+
at `))}function nx(e,t){class n extends e{#e;constructor(...e){if(ex()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=tx(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var rx={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};nx(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:rx[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var ix=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},ax=47;function ox(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===ax;)t--;return t===e.length?e:e.slice(0,t)}function sx(e){try{return(ox(new URL(e).pathname)||`/`)!==`/`}catch{throw new ix(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function cx(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new ix(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof ix?t:new ix(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function lx(e,t=`/api/auth`){if(cx(e),sx(e))return e;let n=ox(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function ux(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function dx(e,t,n,r,i){if(e)return lx(e,t);if(r!==!1){let e=kb.BETTER_AUTH_URL||kb.NEXT_PUBLIC_BETTER_AUTH_URL||kb.PUBLIC_BETTER_AUTH_URL||kb.NUXT_PUBLIC_BETTER_AUTH_URL||kb.NUXT_PUBLIC_AUTH_URL||(kb.BASE_URL===`/`?void 0:kb.BASE_URL);if(e)return lx(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&ux(o,`proto`)&&ux(a,`host`))try{return lx(`${o}://${a}`,t)}catch{}if(n){let e=fx(n.url);if(!e)throw new ix(`Could not get origin from request. Please provide a valid base URL.`);return lx(e,t)}if(typeof window<`u`&&window.location)return lx(window.location.origin,t)}function fx(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var px={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},mx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,hx={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},gx=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function _x(e){return e instanceof Date&&!isNaN(e.getTime())}function vx(e){let t=gx.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return _x(f)?f:null}function yx(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in hx)return hx[s];if(!mx.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(px).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);else{if(a&&typeof t==`string`){let e=vx(t);if(e)return e}return i?i(e,t):t}})}catch(t){if(n)throw t;return e}}function bx(e,t={strict:!0}){return yx(e,t)}var xx=[`javascript:`,`data:`,`vbscript:`];function Sx(e){let t;try{t=new URL(e)}catch{return!0}return!xx.includes(t.protocol)}var Cx={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Sx(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},wx=[],Tx=0,Ex=null,Dx=4,Ox=globalThis.nanostoresGlobal||={epoch:0},kx=()=>{let e,t;for(;Tx<wx.length;){t=Tx,Tx+=Dx;let n=Ex?.get(wx[t]);if(n){if(!n.has(wx[t+1]))continue;n.clear()}try{wx[t](wx[t+1].value,wx[t+2],wx[t+3])}catch(t){e=t}}if(wx.length=Tx=0,e)throw e},Ax=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{Ex?.get(e)?.delete(n);for(let t=Tx;t<wx.length;)wx[t]===e&&wx[t+1]===n?wx.splice(t,Dx):t+=Dx;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){Ox.epoch++;let i=!wx.length&&!0;for(let i of t)wx.push(i,n,e,r);i&&kx()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},jx=2,Mx=5,Nx=6,Px=10,Fx=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Px]||(e.events[n+Px]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+Px](),delete e.events[n+Px]))}),Ix=(e,t)=>Fx(e,t,jx,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),Lx=1e3,Rx=(e,t)=>Fx(e,n=>{let r=t(n);r&&e.events[Nx].push(r)},Mx,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Nx]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Nx])t();e.events[Nx]=[]}},Lx)},()=>{e.listen=n,e.off=r}});function zx(e,t){let n=Vx(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var Bx=/(.*)\[(\d+)\]/;function Vx(e){return e.split(`.`).flatMap(e=>Hx(e))}function Hx(e){if(Bx.test(e)){let[,t,n]=e.match(Bx);return[...Hx(t),n]}return[e]}function Ux(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(zx(i,e),zx(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}function Wx(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gx(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Gx(e[n],t[n]))return!1;return!0}if(Wx(e)&&Wx(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!Gx(e[r],t[r]))return!1;return!0}return!1}function Kx(e,t){return Ix(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var qx=Symbol.for(`better-auth:auth-query`);function Jx(e){return qx in e&&e[qx]===!0}function Yx(e){let t=Ax(e);return Object.defineProperty(t,qx,{value:!0}),t}var Xx=Symbol.for(`better-auth:broadcast-channel`),Zx=()=>Math.floor(Date.now()/1e3),Qx=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Zx()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function $x(e=`better-auth.message`){return globalThis[Xx]||(globalThis[Xx]=new Qx(e)),globalThis[Xx]}var eS=Symbol.for(`better-auth:focus-manager`),tS=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function nS(){return globalThis[eS]||(globalThis[eS]=new tS),globalThis[eS]}var rS=Symbol.for(`better-auth:online-manager`),iS=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function aS(){return globalThis[rS]||(globalThis[rS]=new iS),globalThis[rS]}var oS=()=>Math.floor(Date.now()/1e3),sS=5;function cS(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||aS().isOnline,u=e=>{if(l()){if(e?.event===`storage`)t();else if(e?.event===`poll`)c.lastSessionRequest=oS(),t();else if(e?.event===`visibilitychange`){if(oS()-c.lastSessionRequest<sS)return;c.lastSessionRequest=oS(),t()}else t()}},d=e=>{$x().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=$x().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=nS().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=aS().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=$x().setup(),c.cleanupFocusSetup=nS().setup(),c.cleanupOnlineSetup=aS().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var lS=()=>typeof window>`u`,uS=Lx;function dS(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function fS(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function pS(e){return!e||e.session===null&&e.user===null?null:e}function mS(e,t){return Gx(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function hS(e,t){let n=Ax(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=Yx({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});Kx(s,mS);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=fS(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=fS(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=pS(i),u=s.value,d=u.data!=null&&l!=null&&Gx(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+uS,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return Rx(s,()=>{let e;lS()||(e=setTimeout(()=>{d()},0));let r=cS({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function gS(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function _S(e,t,n=`.`,r){if(!gS(t))return _S(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:gS(a)&&gS(i[t])?_S(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function vS(e){return(...t)=>t.reduce((t,n)=>_S(t,n,``,e),{})}var yS=vS(),bS=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},xS=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},SS=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},CS=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function wS(e){if(typeof e==`number`)return new SS({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new SS(e);case`exponential`:return new CS(e);default:throw Error(`Invalid retry strategy`)}}var TS=[`get`,`post`,`put`,`patch`,`delete`];function ES(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return TS.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var DS=e=>e===`.`||e===`..`,OS=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function kS(e,t){let n=t.get(e);if(n===void 0)return OS(e);if(DS(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function AS(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=ES(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>kS(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var jS=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},MS=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function NS(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return MS.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function PS(e){try{return JSON.parse(e),!0}catch{return!1}}function FS(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function IS(e){try{return JSON.parse(e)}catch{return e}}function LS(e){return typeof e==`function`}function RS(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&LS(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&LS(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function zS(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function BS(e){let t=new Headers(zS(e?.headers,await jS(e)));if(!t.has(`content-type`)){let n=VS(e?.body);n&&t.set(`content-type`,n)}return t}function VS(e){return FS(e)?`application/json`:null}function HS(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function US(e,t){let{body:n}=e;return n?!FS(n)||typeof n==`string`?n:HS(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function WS(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=ES(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function GS(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var KS=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function qS(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new KS(n.issues);return n.value}function JS(e){"@babel/helpers - typeof";return JS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},JS(e)}function YS(e,t){if(JS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(JS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function XS(e){var t=YS(e,`string`);return JS(t)==`symbol`?t:t+``}function ZS(e,t,n){return(t=XS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QS(Object(n),!0).forEach(function(t){ZS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var eC=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await xS(e,t),o=RS(a),s=new AbortController,c=a.signal??s.signal,l=AS(i,a),u=await BS(a),d=US(a,u),f=WS(i,a),p=$S($S({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=GS(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e($S($S({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=NS(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??IS)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await qS(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e($S($S({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??IS,b=await h.text(),x=PS(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:$S($S({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e($S($S({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=wS(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await eC(e,$S($S({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new bS(h.status,h.statusText,x?S:b);return{data:null,error:$S($S({},S),{},{status:h.status,statusText:h.statusText})}},tC=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=$S($S({},n),e.query!==void 0&&{query:$S($S({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=ES(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await qS(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=$S($S($S($S({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await qS(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=$S({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=$S($S({},t),i.query)}i=$S($S({},i),{},{body:o.input?await qS(o.input,n?.body):n?.body,params:o.params?await qS(o.params,n?.params):n?.params})}return{url:t,options:i}}}return $S({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),nC=e=>{async function t(t,n){let r=$S($S($S({},e),n),{},{headers:zS(e?.headers,n?.headers),plugins:[...e?.plugins||[],tC(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await eC(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await eC(t,r)}return t},rC=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},iC=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,aC=(e,t)=>{let n=`credentials`in Request.prototype,r=dx(e?.baseURL,e?.basePath,void 0,t)??rC(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=nC({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?bx(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Cx],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=hS(d,e),h=!1,g=e=>{h||e===null||(h=!0,dS(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:iC,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=yS(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function oC(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function sC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var cC=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,lC=/['\u2019]/g;function uC(e){return e.replace(lC,``).match(cC)??[]}function dC(e){return uC(e).map(e=>e.toLowerCase()).join(`-`)}function fC(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function pC(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||oC(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(dC).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=fC(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function mC(e,t={}){let n=(0,K.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,K.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?Ux(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,K.useSyncExternalStore)(a,o,Jx(e)?()=>e.init:o)}function hC(e){return`use${sC(e)}`}function gC(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=aC(e),c={};for(let[e,t]of Object.entries(r))c[hC(e)]=()=>mC(t);return pC({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var _C=`1.7.8`,vC=$b({FAILED_TO_CREATE_USER:`Failed to create user`,USER_ALREADY_EXISTS:`User already exists.`,USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:`User already exists. Use another email.`,YOU_CANNOT_BAN_YOURSELF:`You cannot ban yourself`,YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:`You are not allowed to change users role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:`You are not allowed to create users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:`You are not allowed to list users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:`You are not allowed to list users sessions`,YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:`You are not allowed to ban users`,YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:`You are not allowed to impersonate users`,YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:`You are not allowed to revoke users sessions`,YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:`You are not allowed to delete users`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:`You are not allowed to set users password`,BANNED_USER:`You have been banned from this application`,YOU_ARE_NOT_ALLOWED_TO_GET_USER:`You are not allowed to get user`,NO_DATA_TO_UPDATE:`No data to update`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:`You are not allowed to update users`,YOU_CANNOT_REMOVE_YOURSELF:`You cannot remove yourself`,YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:`You are not allowed to set a non-existent role value`,YOU_CANNOT_IMPERSONATE_ADMINS:`You cannot impersonate admins`,INVALID_ROLE_TYPE:`Invalid role type`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL:`You are not allowed to update users email`,PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER:`Password cannot be updated through update-user. Use the set-user-password endpoint instead`});function yC(e){return{success:!1,error:`You are not allowed to access resource: ${e}`}}function bC(e){return{success:!1,error:`unauthorized to access resource "${e}"`}}function xC(e){return e===`OR`?`OR`:`AND`}function SC(e){return Array.isArray(e)}function CC(e){if(SC(e))return{actions:e,connector:`AND`};if(!e||typeof e!=`object`)throw new ix(`Invalid access control request`);let{actions:t,connector:n}=e;return SC(t)?{actions:t,connector:xC(n)}:{actions:[],connector:xC(n)}}function wC(e,t){return typeof t==`string`&&e.includes(t)}function TC(e,{actions:t,connector:n}){return t.length===0?!1:n===`OR`?t.some(t=>wC(e,t)):t.every(t=>wC(e,t))}function EC(e){return{authorize(t,n=`AND`){let r=!1;for(let[i,a]of Object.entries(t)){let t=e[i];if(!t){if(n===`AND`)return yC(i);continue}let o=TC(t,CC(a));if(o&&(r=!0),o&&n===`OR`)return{success:!0};if(!o&&n===`AND`)return bC(i)}return r?{success:!0}:{success:!1,error:`Not authorized`}},statements:e}}function DC(e){return{newRole(e){return EC(e)},statements:e}}var OC=DC({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`impersonate-admins`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),kC=OC.newRole({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),AC=OC.newRole({user:[],session:[]}),jC={admin:kC,user:AC},MC=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||`user`).split(`,`),n=e.options?.roles||jC;for(let r of t)if(n[r]?.authorize(e.permissions)?.success)return!0;return!1},NC=e=>{let t={admin:kC,user:AC,...e?.roles};return{id:`admin-client`,version:_C,$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>MC({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions})}}),pathMethods:{"/admin/list-users":`GET`,"/admin/impersonate-user":`POST`,"/admin/stop-impersonating":`POST`},atomListeners:[{matcher:e=>e===`/admin/impersonate-user`||e===`/admin/stop-impersonating`,signal:`$sessionSignal`}],$ERROR_CODES:vC}},PC=`ba_param`;function FC(e){let t=e.getAll(PC);if(t.length)return new Set(t)}function IC(e){let t=new URLSearchParams(e);if(!t.has(`sig`))return;let n=FC(t);if(!n)return;let r=new URLSearchParams;for(let[e,i]of t.entries())(e===`sig`||e===PC||n.has(e))&&r.append(e,i);return r.toString()}var LC=`1.7.8`,RC=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;function zC(e){if(typeof e==`string`&&RC.test(e)){let t=new Date(e);if(!isNaN(t.getTime()))return t}return e}function BC(e){if(e==null)return e;if(typeof e==`string`)return zC(e);if(e instanceof Date)return e;if(Array.isArray(e))return e.map(BC);if(typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=BC(e[n]);return t}return e}function VC(e){try{return typeof e==`string`?JSON.parse(e,(e,t)=>zC(t)):e==null?null:BC(e)}catch(e){return Qb.error(`Error parsing JSON`,{error:e}),null}}var HC=()=>({id:`oauth-provider-client`,version:LC,fetchPlugins:[{id:`oauth-provider-signin`,name:`oauth-provider-signin`,description:`Adds the current page query to oauth requests`,hooks:{async onRequest(e){let t=e.headers,n=typeof e.body==`string`?t.get(`content-type`)===`application/x-www-form-urlencoded`?Object.fromEntries(new URLSearchParams(e.body)):VC(e.body??`{}`):e.body;n?.oauth_query||typeof window<`u`&&window?.location?.search&&e.method!==`GET`&&e.method!==`DELETE`&&(e.body=JSON.stringify({...n,oauth_query:IC(window.location.search)}))}}}],$InferServerPlugin:{}}),UC=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},WC=10,GC=13,KC=32,qC=6;function JC(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=``,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l!==void 0){if(e=l+e,e===``||e===`ï`||e===`ï»`){l=e;return}l=void 0,e=e.replace(/^(?:\uFEFF|\xEF\xBB\xBF)/,``)}if((h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(`
|
|
58
|
+
`)===-1&&e.indexOf(`\r`)===-1){if(c<qC&&!b(s.join(``)+e.slice(0,qC-c))){s.length=0,c=0,h=!0;return}s.push(e),c+=e.length,x();return}s.push(e);let t=s.join(``);s.length=0,c=0,y(S(t)),x()}function v(e){if(e.length===0)return e;if(g)return g=!1,e.charCodeAt(0)===WC?e.slice(1):e;let t=e.indexOf(`\r`),n=e.indexOf(`
|
|
59
|
+
`),r=t===-1?n:n===-1||t<n?t:n;return r===-1?``:r===e.length-1&&e.charCodeAt(r)===GC?(h=!1,g=!0,``):(h=!1,e.slice(r+(e.charCodeAt(r)===GC&&e.charCodeAt(r+1)===WC?2:1)))}function y(e){if(e){if(e.charCodeAt(e.length-1)===GC){if(C(e,0,e.length-1),x())return;g=!0}else b(e)?(s.push(e),c=e.length):h=!0}}function b(e){let t=e.charCodeAt(0);return t===58&&!!n||t===100&&ZC(e,`data`)||t===101&&ZC(e,`event`)||t===105&&ZC(e,`id`)||t===114&&ZC(e,`retry`)}function x(){return m?!0:t===void 0||c+d.length<=t?!1:(m=!0,s.length=0,c=0,u=void 0,d=``,f=0,p=void 0,h=!1,g=!1,r?.(new UC(`Buffered data exceeded max buffer size of ${t} characters`,{type:`max-buffer-size-exceeded`})),!0)}function S(e){let t=0;if(e.indexOf(`\r`)===-1){let n=e.indexOf(`
|
|
60
60
|
`,t);for(;n!==-1;){if(t===n){u!==void 0&&a?.(u),f>0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0,t=n+1,n=e.indexOf(`
|
|
61
|
-
`,t);continue}let r=e.charCodeAt(t);if(
|
|
62
|
-
`,t);continue}d=f===0?o:`${d}\n${o}`,f++}else
|
|
61
|
+
`,t);continue}let r=e.charCodeAt(t);if(YC(e,t,r)){let r=e.charCodeAt(t+5)===KC?t+6:t+5,o=e.slice(r,n);if(f===0&&e.charCodeAt(n+1)===WC){u!==void 0&&a?.(u),i?.({id:u,event:p,data:o}),u=void 0,d=``,p=void 0,t=n+2,n=e.indexOf(`
|
|
62
|
+
`,t);continue}d=f===0?o:`${d}\n${o}`,f++}else XC(e,t,r)?p=e.slice(e.charCodeAt(t+6)===KC?t+7:t+6,n)||void 0:C(e,t,n);if(x())return``;t=n+1,n=e.indexOf(`
|
|
63
63
|
`,t)}return e.slice(t)}for(;t<e.length;){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
64
|
-
`,t),i=-1;if(n!==-1&&r!==-1?i=n<r?n:r:n===-1?r!==-1&&(i=r):i=n===e.length-1?-1:n,i===-1)break;if(C(e,t,i),x())return``;t=i+1,e.charCodeAt(t-1)===NC&&e.charCodeAt(t)===MC&&t++}return e.slice(t)}function C(e,t,r){if(t===r){T();return}let i=e.charCodeAt(t);if(LC(e,t,i)){let n=e.charCodeAt(t+5)===PC?t+6:t+5,i=e.slice(n,r);d=f===0?i:`${d}\n${i}`,f++;return}if(RC(e,t,i)){p=e.slice(e.charCodeAt(t+6)===PC?t+7:t+6,r)||void 0;return}if(i===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let n=e.slice(e.charCodeAt(t+3)===PC?t+4:t+3,r);n.includes(`\0`)||(u=n);return}if(i===58){if(n){let i=e.slice(t,r);n(i.slice(e.charCodeAt(t+1)===PC?2:1))}return}let a=e.slice(t,r),o=a.indexOf(`:`);if(o===-1){w(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===PC?2:1;w(s,a.slice(o+c),a)}function w(e,t,n){switch(e){case`event`:p=t||void 0;break;case`data`:d=f===0?t:`${d}\n${t}`,f++;break;case`id`:t.includes(`\0`)||(u=t);break;case`retry`:/^\d+$/.test(t)?o?.(parseInt(t,10)):r?.(new jC(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:n}));break;default:r?.(new jC(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:`unknown-field`,field:e,value:t,line:n}))}}function T(){u!==void 0&&a?.(u),f>0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0}function E(e={}){if(e.consume&&s.length>0){let e=s.join(``);C(e,0,e.length)}l=``,u=void 0,d=``,f=0,p=void 0,s.length=0,c=0,m=!1,h=!1,g=!1}return{feed:_,reset:E}}function LC(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function RC(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}function zC(e,t){let n=1;for(;n<e.length&&n<t.length;){if(e.charCodeAt(n)!==t.charCodeAt(n))return!1;n++}return e.length<=t.length||e.charCodeAt(t.length)===58}function BC(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function VC(e){let t=await e.json().catch(()=>{throw new ql(e.status,`invalid_response`,`Kanvil returned an invalid response`)});if(!e.ok){let n=Gl.safeParse(t);throw new ql(e.status,n.success?n.data.error.code:`request_failed`,n.success?n.data.error.message:`Request failed (${e.status})`,n.success?n.data.error.details:void 0)}return t}function HC(e){let t=e.fetch??fetch,n=t=>{if(!t.startsWith(`/`)||t.startsWith(`//`))throw new ql(400,`invalid_path`,`Use a relative Kanvil endpoint`);let n=new URL(`${e.baseUrl.replace(/\/$/,``)}${t}`);if(n.origin!==new URL(e.baseUrl).origin)throw new ql(400,`invalid_path`,`Credentials cannot be sent to another origin`);return n},r=async(e,n)=>{try{return await t(e,n)}catch(r){if(n.signal?.aborted)throw r;return t(e,n)}},i={async request(r,i,a={}){let o=new Headers(await e.headers?.());return new Headers(a.headers).forEach((e,t)=>o.set(t,e)),i.parse(await VC(await t(n(r),{...a,headers:o,credentials:e.credentials??`include`})))},async call(t,n){let i=Wl[t],a={...i.input.parse(n)},o=i.path.replace(/\{(\w+)\}/g,(e,t)=>{let n=a[t];if(delete a[t],typeof n!=`string`)throw new ql(400,`invalid_path`,`Missing path parameter ${t}`);return encodeURIComponent(n)}),s=new URL(`${e.baseUrl.replace(/\/$/,``)}/api/v1${o}`),c=new Headers(await e.headers?.()),l={method:i.method,credentials:e.credentials??`include`,headers:c};if(i.method===`GET`)for(let[e,t]of Object.entries(a))(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)&&s.searchParams.set(e,String(t));else c.set(`Content-Type`,`application/json`),a.requestId??=(e.requestId??BC)(),l.body=JSON.stringify(a);return Jl(t,await VC(await r(s,l)))},async subscribe(r){let i=r.cursor,a=1e3;try{for(;!r.signal.aborted;){r.onState?.(`connecting`);let o=n(`/api/v1/events`);i&&o.searchParams.set(`cursor`,i),r.projectId&&o.searchParams.set(`projectId`,r.projectId);let s,c=()=>{s?.cancel().catch(()=>{})};r.signal.addEventListener(`abort`,c,{once:!0});try{let n=await t(o,{headers:new Headers(await e.headers?.()),credentials:e.credentials??`include`,signal:r.signal});if(n.status===410&&r.onReset){i=await r.onReset();continue}if(n.ok||await VC(n),!n.body)throw new ql(502,`invalid_stream`,`The event stream has no body`);s=n.body.getReader();let c=[],l=IC({maxBufferSize:1e6,onEvent:e=>c.push(e),onError:e=>{throw new ql(502,`invalid_stream`,e.message)}}),u=new TextDecoder;for(;!r.signal.aborted;){let e=await s.read();if(e.done)break;l.feed(u.decode(e.value,{stream:!0}));for(let e of c.splice(0)){if(e.event===`error`){let t=Kl.parse(JSON.parse(e.data));throw new ql(t.status,t.code,t.message)}e.event===`change`&&await r.onEvent(Ml.parse(JSON.parse(e.data))),(e.event===`checkpoint`||e.event===`change`)&&(r.onState?.(`connected`),a=1e3,e.id&&(await r.onCursor?.(e.id),i=e.id))}}}catch(e){if(r.signal.aborted)return;if(e instanceof ql&&e.status===410&&r.onReset){i=await r.onReset();continue}if(e instanceof ql&&e.status<500)throw e}finally{r.signal.removeEventListener(`abort`,c),await s?.cancel().catch(()=>{})}if(r.signal.aborted)return;r.onState?.(`offline`),await new Promise(e=>{let t=()=>{clearTimeout(n),r.signal.removeEventListener(`abort`,t),e()},n=setTimeout(t,a);r.signal.addEventListener(`abort`,t,{once:!0}),r.signal.aborted&&t()}),a=Math.min(a*2,3e4)}}finally{r.onState?.(`closed`)}}};return{...i,notificationPreferences(){return{queryKey:[`kanvil`,e.baseUrl,`notification-preferences`],queryFn:()=>i.request(`/api/v1/notifications/preferences`,Fl)}},setNotificationPreferences(e){return i.request(`/api/v1/notifications/preferences`,Fl,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Il.parse(e))})},watch(e){let t=!0;return i.subscribe({...e.projectId?{projectId:e.projectId}:{},signal:e.signal,...e.onState?{onState:e.onState}:{},onEvent:t=>e.invalidate(t),onCursor:async()=>{t&&(t=!1,await e.invalidate())},onReset:async()=>{let t=e.projectId?await i.request(`/api/v1/snapshot?projectId=${encodeURIComponent(e.projectId)}`,vl):await i.request(`/api/v1/checkpoint`,yl);return await e.invalidate(),t.cursor}})},query(t,n){return{queryKey:[`kanvil`,e.baseUrl,t,n],queryFn:()=>i.call(t,n)}},action(e){return{mutationFn:t=>i.call(e,t),networkMode:`always`,retry:!1}}}}var UC=iC({plugins:[xC(),AC()]}),WC=HC({baseUrl:window.location.origin}),GC=(0,K.createContext)({id:``,name:``,email:``,admin:!1,image:null,clearPrivateData:()=>{}}),KC=()=>(0,K.useContext)(GC);function qC(e){let t=eu();return bd({...WC.action(e),onSuccess:()=>t.invalidateQueries({queryKey:[`kanvil`]})})}var JC=(0,K.createContext)({active:void 0,workspaces:[],pending:!0,error:void 0,select:()=>{}}),YC=()=>(0,K.useContext)(JC),XC=()=>yd(WC.query(`list_workspaces`,{})),ZC=()=>yd(WC.query(`list_projects`,{}));function QC(){let{active:e}=YC();return yd({...WC.query(`list_projects`,{}),select:t=>e?t.filter(t=>t.workspaceId===e.id):[]})}var $C={list_members:[`membership.`,`project.`],list_workspace_members:[`membership.`,`project.`],list_project_labels:[`label.`,`project.`],list_label_colors:[`label.`],list_views:[`label.`,`project.`],get_project:[`project.`,`label.`]};function ew(e){return t=>{let[n,,r,i]=t.queryKey;if(n!==`kanvil`)return!1;if(typeof r!=`string`||!i||typeof i!=`object`)return!0;let a=$C[r];if(a&&!a.some(t=>e.type.startsWith(t)))return!1;let o=i;return typeof o.projectId==`string`?o.projectId===e.projectId?!e.ticketId||typeof o.ticketId!=`string`||o.ticketId===e.ticketId||o.ticketId===e.data.key:!1:!0}}function tw(e){let t=eu(),[n,r]=(0,K.useState)(`connecting`);return(0,K.useEffect)(()=>{let n=new AbortController;return WC.watch({...e?{projectId:e}:{},signal:n.signal,invalidate:e=>t.invalidateQueries(e?{predicate:ew(e)}:{queryKey:[`kanvil`]}),onState:r}).catch(()=>r(`Sign in to reconnect`)),()=>n.abort()},[t,e]),n}function nw(e){for(let t of Object.keys(localStorage))t.startsWith(`kanvil:${e}:`)&&localStorage.removeItem(t)}function rw(e,t=!0){let n=KC(),r=yd({...WC.query(`list_members`,{projectId:e}),enabled:t&&!n.admin}),i=n.admin?`admin`:r.data?.find(e=>e.userId===n.id)?.role;return{role:i,canWrite:i===`writer`||i===`admin`,canAdmin:i===`admin`}}function iw({projectId:e,actorId:t,avatar:n=!1}){let r=KC(),i=yd(WC.query(`list_members`,{projectId:e})).data?.find(e=>e.userId===t),a=t===r.id?r.name:i?.name??`Former member`,o=t===r.id?r.image:i?.image;return(0,q.jsxs)(`span`,{className:n?`inline-flex items-center gap-2`:``,title:t,children:[n&&(0,q.jsx)(pb,{name:a,image:o,className:`size-7 text-[10px]`}),t===r.id?`You`:a]})}var aw=365.2425,ow=6048e5,sw=864e5,cw=6e4,lw=525600,uw=43200,dw=1440,fw=86400;fw*7,fw*aw/12*3;var pw=Symbol.for(`constructDateFrom`);function mw(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&pw in e?e[pw](t):e instanceof Date?new e.constructor(t):new Date(t)}function hw(e,t){return mw(t||e,e)}var gw={};function _w(){return gw}function vw(e){let t=hw(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-n}function yw(e,...t){let n=mw.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function bw(e,t){let n=+hw(e)-hw(t);return n<0?-1:n>0?1:n}function xw(e){return mw(e,Date.now())}function Sw(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}var Cw={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},ww=(e,t,n)=>{let r,i=Cw[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Tw(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Ew={date:Tw({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Tw({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Tw({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Dw={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Ow=(e,t,n,r)=>Dw[e];function kw(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Aw={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:kw({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:kw({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:kw({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:kw({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:kw({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function jw(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Nw(s,e=>e.test(o)):Mw(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Mw(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Nw(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Pw(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Fw={code:`en-US`,formatDistance:ww,formatLong:Ew,formatRelative:Ow,localize:Aw,match:{ordinalNumber:Pw({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:jw({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:jw({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:jw({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:jw({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:jw({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Iw(e,t,n){let r=_w(),i=n?.locale??r.locale??Fw,a=bw(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=yw(n?.in,...a>0?[t,e]:[e,t]),l=Sw(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/cw,f=(u-(vw(c)-vw(s)))/cw,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<1440?`hour`:f<43200?`day`:f<525600?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}if(m===`day`){let e=l(f/dw);return i.formatDistance(`xDays`,e,o)}if(m===`month`){let e=l(f/uw);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}{let e=l(f/lw);return i.formatDistance(`xYears`,e,o)}}function Lw(e,t){return Iw(e,xw(e),t)}function Rw(e){return+hw(e)<Date.now()}var zw=Qy();async function Bw(e){try{if(navigator.clipboard){await navigator.clipboard.writeText(e);return}}catch{}let t=document.activeElement,n=document.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,document.body.append(n);try{if(n.select(),!document.execCommand(`copy`))throw Error(`Copy failed. Select the text and copy it manually.`)}finally{n.remove(),t instanceof HTMLElement&&t.focus()}}function Vw(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>n(Error(`The file could not be read`)),{once:!0}),r.addEventListener(`load`,()=>typeof r.result==`string`?t(r.result.slice(r.result.indexOf(`,`)+1)):n(Error(`The file could not be encoded`)),{once:!0}),r.readAsDataURL(e)})}async function Hw(e,{fit:t=`cover`,format:n=`image/jpeg`}={}){if(e.size>1e7)throw Error(`Choose an image smaller than 10 MB.`);let r=await createImageBitmap(e);try{let e=document.createElement(`canvas`);e.width=256,e.height=256;let i=e.getContext(`2d`);if(!i)throw Error(`This browser cannot resize the image.`);let a=(t===`cover`?Math.max:Math.min)(256/r.width,256/r.height),o=r.width*a,s=r.height*a;return i.drawImage(r,(256-o)/2,(256-s)/2,o,s),{contentType:n,data:await Vw(await new Promise((t,r)=>e.toBlob(e=>e?t(e):r(Error(`The image could not be prepared.`)),n,.9)))}}finally{r.close()}}function Uw(e){return e instanceof Element&&!!e.closest(`input, textarea, select, [contenteditable=""], [contenteditable="true"], [role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]`)}function Ww(e,t,{enabled:n=!0,mod:r=!1,guard:i}={}){let a=(0,K.useRef)({handler:t,guard:i});(0,K.useEffect)(()=>{a.current={handler:t,guard:i}}),(0,K.useEffect)(()=>{if(!n)return;let t=t=>{t.key!==e||t.defaultPrevented||t.repeat||(r?!(t.metaKey||t.ctrlKey):t.metaKey||t.ctrlKey||t.altKey)||(r||!Uw(t.target))&&(!a.current.guard||a.current.guard(t))&&(t.preventDefault(),a.current.handler(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}function Gw(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Kw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jw={};function Yw(e,t){return((t||Jw).jsx?qw:Kw).test(e)}var Xw=/[ \t\n\f\r]/g;function Zw(e){return typeof e==`object`?e.type===`text`&&Qw(e.value):Qw(e)}function Qw(e){return e.replace(Xw,``)===``}var $w=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};$w.prototype.normal={},$w.prototype.property={},$w.prototype.space=void 0;function eT(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new $w(n,r,t)}function tT(e){return e.toLowerCase()}var nT=class{constructor(e,t){this.attribute=t,this.property=e}};nT.prototype.attribute=``,nT.prototype.booleanish=!1,nT.prototype.boolean=!1,nT.prototype.commaOrSpaceSeparated=!1,nT.prototype.commaSeparated=!1,nT.prototype.defined=!1,nT.prototype.mustUseProperty=!1,nT.prototype.number=!1,nT.prototype.overloadedBoolean=!1,nT.prototype.property=``,nT.prototype.spaceSeparated=!1,nT.prototype.space=void 0;var rT=s({boolean:()=>aT,booleanish:()=>oT,commaOrSpaceSeparated:()=>uT,commaSeparated:()=>lT,number:()=>Q,overloadedBoolean:()=>sT,spaceSeparated:()=>cT}),iT=0,aT=dT(),oT=dT(),sT=dT(),Q=dT(),cT=dT(),lT=dT(),uT=dT();function dT(){return 2**++iT}var fT=Object.keys(rT),pT=class extends nT{constructor(e,t,n,r){let i=-1;if(super(e,t),mT(this,`space`,r),typeof n==`number`)for(;++i<fT.length;){let e=fT[i];mT(this,fT[i],(n&rT[e])===rT[e])}}};pT.prototype.defined=!0;function mT(e,t,n){n&&(e[t]=n)}function hT(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new pT(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[tT(r)]=r,n[tT(a.attribute)]=r}return new $w(t,n,e.space)}var gT=hT({properties:{ariaActiveDescendant:null,ariaAtomic:oT,ariaAutoComplete:null,ariaBusy:oT,ariaChecked:oT,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:cT,ariaCurrent:null,ariaDescribedBy:cT,ariaDetails:null,ariaDisabled:oT,ariaDropEffect:cT,ariaErrorMessage:null,ariaExpanded:oT,ariaFlowTo:cT,ariaGrabbed:oT,ariaHasPopup:null,ariaHidden:oT,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:cT,ariaLevel:Q,ariaLive:null,ariaModal:oT,ariaMultiLine:oT,ariaMultiSelectable:oT,ariaOrientation:null,ariaOwns:cT,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:oT,ariaReadOnly:oT,ariaRelevant:null,ariaRequired:oT,ariaRoleDescription:cT,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:oT,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function _T(e,t){return t in e?e[t]:t}function vT(e,t){return _T(e,t.toLowerCase())}var yT=hT({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:lT,acceptCharset:cT,accessKey:cT,action:null,allow:null,allowFullScreen:aT,allowPaymentRequest:aT,allowUserMedia:aT,alpha:aT,alt:null,as:null,async:aT,autoCapitalize:null,autoComplete:cT,autoFocus:aT,autoPlay:aT,blocking:cT,capture:null,charSet:null,checked:aT,cite:null,className:cT,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:oT,controls:aT,controlsList:cT,coords:Q|lT,crossOrigin:null,data:null,dateTime:null,decoding:null,default:aT,defer:aT,dir:null,dirName:null,disabled:aT,download:sT,draggable:oT,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:aT,formTarget:null,headers:cT,height:Q,hidden:sT,high:Q,href:null,hrefLang:null,htmlFor:cT,httpEquiv:cT,id:null,imageSizes:null,imageSrcSet:null,inert:aT,inputMode:null,integrity:null,is:null,isMap:aT,itemId:null,itemProp:cT,itemRef:cT,itemScope:aT,itemType:cT,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:aT,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:aT,muted:aT,name:null,nonce:null,noModule:aT,noValidate:aT,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:aT,optimum:Q,pattern:null,ping:cT,placeholder:null,playsInline:aT,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:aT,referrerPolicy:null,rel:cT,required:aT,reversed:aT,rows:Q,rowSpan:Q,sandbox:cT,scope:null,scoped:aT,seamless:aT,selected:aT,shadowRootClonable:aT,shadowRootCustomElementRegistry:aT,shadowRootDelegatesFocus:aT,shadowRootMode:null,shadowRootSerializable:aT,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:oT,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:aT,useMap:null,value:oT,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:cT,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:aT,declare:aT,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:aT,noHref:aT,noShade:aT,noWrap:aT,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:oT,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:aT,disablePictureInPicture:aT,disableRemotePlayback:aT,exportParts:lT,part:cT,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:vT}),bT=hT({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:uT,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:cT,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:aT,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:lT,g2:lT,glyphName:lT,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:uT,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:cT,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:uT,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:uT,rev:uT,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:uT,requiredFeatures:uT,requiredFonts:uT,requiredFormats:uT,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:uT,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:uT,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:uT,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:_T}),xT=hT({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ST=hT({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:vT}),CT=hT({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),wT={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},TT=/[A-Z]/g,ET=/-[a-z]/g,DT=/^data[-\w.:]+$/i;function OT(e,t){let n=tT(t),r=t,i=nT;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&DT.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ET,AT);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ET.test(e)){let n=e.replace(TT,kT);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=pT}return new i(r,t)}function kT(e){return`-`+e.toLowerCase()}function AT(e){return e.charAt(1).toUpperCase()}var jT=eT([gT,yT,xT,ST,CT],`html`),MT=eT([gT,bT,xT,ST,CT],`svg`);function NT(e){return e.join(` `).trim()}var PT=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
65
|
-
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),FT=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(PT());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),IT=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),LT=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(FT()),r=IT();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),RT=BT(`end`),zT=BT(`start`);function BT(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function VT(e){let t=zT(e),n=RT(e);if(t&&n)return{start:t,end:n}}function HT(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?WT(e.position):`start`in e||`end`in e?WT(e):`line`in e||`column`in e?UT(e):``}function UT(e){return GT(e&&e.line)+`:`+GT(e&&e.column)}function WT(e){return UT(e&&e.start)+`-`+UT(e&&e.end)}function GT(e){return e&&typeof e==`number`?e:1}var KT=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=HT(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};KT.prototype.file=``,KT.prototype.name=``,KT.prototype.reason=``,KT.prototype.message=``,KT.prototype.stack=``,KT.prototype.column=void 0,KT.prototype.line=void 0,KT.prototype.ancestors=void 0,KT.prototype.cause=void 0,KT.prototype.fatal=void 0,KT.prototype.place=void 0,KT.prototype.ruleId=void 0,KT.prototype.source=void 0;var qT=l(LT(),1),JT={}.hasOwnProperty,YT=new Map,XT=/[A-Z]/g,ZT=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),QT=new Set([`td`,`th`]),$T=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function eE(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=dE(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=uE(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?MT:jT,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=tE(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function tE(e,t,n){if(t.type===`element`)return nE(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return rE(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return aE(e,t,n);if(t.type===`mdxjsEsm`)return iE(e,t);if(t.type===`root`)return oE(e,t,n);if(t.type===`text`)return sE(e,t)}function nE(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=MT,e.schema=i),e.ancestors.push(t);let a=_E(e,t.tagName,!1),o=fE(e,t),s=mE(e,t);return ZT.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Zw(e)})),cE(e,o,a,t),lE(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rE(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}vE(e,t.position)}function iE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vE(e,t.position)}function aE(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=MT,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:_E(e,t.name,!0),o=pE(e,t),s=mE(e,t);return cE(e,o,a,t),lE(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function oE(e,t,n){let r={};return lE(r,mE(e,t)),e.create(t,e.Fragment,r,n)}function sE(e,t){return t.value}function cE(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function lE(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function uE(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function dE(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=zT(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function fE(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&JT.call(t.properties,i)){let a=hE(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&QT.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function pE(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else vE(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else vE(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function mE(e,t){let n=[],r=-1,i=e.passKeys?new Map:YT;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=tE(e,a,o);s!==void 0&&n.push(s)}return n}function hE(e,t,n){let r=OT(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Gw(n):NT(n)),r.property===`style`){let t=typeof n==`object`?n:gE(e,String(n));return e.stylePropertyNameCase===`css`&&(t=yE(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?wT[r.property]||r.property:r.attribute,n]}}function gE(e,t){try{return(0,qT.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new KT("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=$T+`#cannot-parse-style-attribute`,r}}function _E(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Yw(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Yw(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return JT.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);vE(e)}function vE(e,t){let n=new KT("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=$T+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function yE(e){let t={},n;for(n in e)JT.call(e,n)&&(t[bE(n)]=e[n]);return t}function bE(e){let t=e.replace(XT,xE);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function xE(e){return`-`+e.toLowerCase()}var SE={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},CE={};function wE(e,t){let n=t||CE;return TE(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function TE(e,t,n){if(DE(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return EE(e.children,t,n)}return Array.isArray(e)?EE(e,t,n):``}function EE(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=TE(e[i],t,n);return r.join(``)}function DE(e){return!!(e&&typeof e==`object`)}var OE=document.createElement(`i`);function kE(e){let t=`&`+e+`;`;OE.innerHTML=t;let n=OE.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function AE(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function jE(e,t){return e.length>0?(AE(e,e.length,0,t),e):t}var ME={}.hasOwnProperty;function NE(e){let t={},n=-1;for(;++n<e.length;)PE(t,e[n]);return t}function PE(e,t){let n;for(n in t){let r=(ME.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ME.call(r,a)||(r[a]=[]);let e=i[a];FE(r[a],Array.isArray(e)?e:e?[e]:[])}}}function FE(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);AE(e,0,0,r)}function IE(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function LE(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var RE=YE(/[A-Za-z]/),zE=YE(/[\dA-Za-z]/),BE=YE(/[#-'*+\--9=?A-Z^-~]/);function VE(e){return e!==null&&(e<32||e===127)}var HE=YE(/\d/),UE=YE(/[\dA-Fa-f]/),WE=YE(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function GE(e){return e!==null&&(e<0||e===32)}function KE(e){return e===-2||e===-1||e===32}var qE=YE(/\p{P}|\p{S}/u),JE=YE(/\s/);function YE(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function XE(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&zE(e.charCodeAt(n+1))&&zE(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function ZE(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return KE(r)?(e.enter(n),s(r)):t(r)}function s(r){return KE(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function QE(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&KE(t)?(e.enter(r),c(t)):l(t)}function c(t){return KE(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var $E={tokenize:eD};function eD(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),ZE(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var tD=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){nD(this,e,t,n,!1)}addBefore(e,t,n){nD(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function nD(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var rD={tokenize:aD},iD={tokenize:oD};function aD(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new tD;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(iD,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(iD,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new tD;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function oD(e,t,n){return ZE(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function sD(e){if(e===null||GE(e)||JE(e))return 1;if(qE(e))return 2}function cD(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var lD={name:`attention`,resolveAll:uD,tokenize:dD};function uD(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};fD(o,-a),fD(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=jE(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=jE(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=jE(r,cD(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=jE(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=jE(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),AE(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function dD(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=sD(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=sD(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function fD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var pD={name:`autolink`,tokenize:mD};function mD(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return RE(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||zE(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||zE(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||VE(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):BE(t)?(e.consume(t),l):n(t)}function u(e){return zE(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||zE(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var hD={partial:!0,tokenize:gD};function gD(e,t,n){return r;function r(t){return KE(t)?ZE(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var _D={continuation:{tokenize:yD},exit:bD,name:`blockQuote`,tokenize:vD};function vD(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return KE(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function yD(e,t,n){let r=this;return i;function i(t){return KE(t)?ZE(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(_D,t,n)(r)}}function bD(e){e.exit(`blockQuote`)}var xD={name:`characterEscape`,tokenize:SD};function SD(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return WE(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var CD={name:`characterReference`,tokenize:wD};function wD(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=zE,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=UE,u):(e.enter(`characterReferenceValue`),a=7,o=HE,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===zE&&!kE(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var TD={partial:!0,tokenize:ED};function ED(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var DD={concrete:!0,name:`codeFenced`,tokenize:OD};function OD(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),KE(t)?ZE(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(TD,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):KE(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),ZE(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&KE(t)?ZE(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(TD,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),KE(t)?ZE(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),KE(t)?ZE(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var kD={name:`codeIndented`,tokenize:jD},AD={partial:!0,tokenize:MD};function jD(e,t,n){return r;function r(t){return e.enter(`codeIndented`),QE(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):$(t)?e.attempt(AD,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function MD(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):QE(e,t,a,`linePrefix`,4,4)(o)}function a(e){return $(e)?i(e):n(e)}}var ND={name:`codeText`,previous:FD,resolve:PD,tokenize:ID};function PD(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function FD(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ID(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var LD=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&RD(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),RD(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),RD(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);RD(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);RD(this.left,t.reverse())}}}};function RD(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function zD(e){let t={},n=-1,r,i,a,o,s,c,l,u=new LD(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,BD(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return AE(e,0,1/0,u.slice(0)),!l}function BD(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var VD={resolve:UD,tokenize:WD},HD={partial:!0,tokenize:GD};function UD(e){return zD(e),e}function WD(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(HD,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function GD(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ZE(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function KD(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||VE(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||GE(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||VE(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function qD(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!KE(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function JD(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ZE(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function YD(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):KE(i)?ZE(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var XD={name:`definition`,tokenize:QD},ZD={partial:!0,tokenize:$D};function QD(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return qD.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=LE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return GE(t)?YD(e,l)(t):l(t)}function l(t){return KD(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(ZD,d,d)(t)}function d(t){return KE(t)?ZE(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function $D(e,t,n){return r;function r(t){return GE(t)?YD(e,i)(t):n(t)}function i(t){return JD(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return KE(t)?ZE(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var eO={name:`hardBreakEscape`,tokenize:tO};function tO(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var nO={name:`headingAtx`,resolve:rO,tokenize:iO};function rO(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};AE(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function iO(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||GE(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):KE(n)?ZE(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||GE(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var aO=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),oO=[`pre`,`script`,`style`,`textarea`],sO={concrete:!0,name:`htmlFlow`,resolveTo:lO,tokenize:uO},cO={partial:!0,tokenize:dO};function lO(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function uO(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):RE(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):RE(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return RE(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||GE(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&oO.includes(l)?(i=1,r.interrupt?t(s):O(s)):aO.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||zE(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return KE(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||RE(t)?(e.consume(t),b):KE(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||zE(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):KE(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):KE(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||GE(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||KE(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):KE(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(cO,R,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(TD,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return oO.includes(n)?(e.consume(t),L):O(t)}return RE(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||$(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function dO(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(hD,t,n)}}var fO={name:`htmlText`,tokenize:pO};function pO(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):RE(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):RE(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return RE(t)?(e.consume(t),S):n(t)}function S(t){return t===45||zE(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):KE(t)?(e.consume(t),C):M(t)}function w(t){return t===45||zE(t)?(e.consume(t),w):t===47||t===62||GE(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||RE(t)?(e.consume(t),E):$(t)?(o=T,N(t)):KE(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||zE(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):KE(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):KE(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||GE(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||GE(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return KE(t)?ZE(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var mO={name:`labelEnd`,resolveAll:vO,resolveTo:yO,tokenize:bO},hO={tokenize:xO},gO={tokenize:SO},_O={tokenize:CO};function vO(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&AE(e,0,e.length,n),e}function yO(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=jE(o,e.slice(i+1,i+r+3)),o=jE(o,[[`enter`,l,t]]),o=jE(o,cD(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=jE(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=jE(o,e.slice(a+1)),o=jE(o,[[`exit`,s,t]]),AE(e,i,e.length,o),e}function bO(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(LE(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(hO,u,o?u:d)(t):t===91?e.attempt(gO,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(_O,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function xO(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return GE(t)?YD(e,a)(t):a(t)}function a(t){return t===41?u(t):KD(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return GE(t)?YD(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?JD(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return GE(t)?YD(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function SO(e,t,n){let r=this;return i;function i(t){return qD.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(LE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function CO(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var wO={name:`labelStartImage`,resolveAll:mO.resolveAll,tokenize:TO};function TO(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var EO={name:`labelStartLink`,resolveAll:mO.resolveAll,tokenize:DO};function DO(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var OO={name:`lineEnding`,tokenize:kO};function kO(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),ZE(e,t,`linePrefix`)}}var AO={name:`thematicBreak`,tokenize:jO};function jO(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),KE(t)?ZE(e,s,`whitespace`)(t):s(t))}}var MO={continuation:{tokenize:IO},exit:RO,name:`list`,tokenize:FO},NO={partial:!0,tokenize:zO},PO={partial:!0,tokenize:LO};function FO(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:HE(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(AO,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return HE(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(hD,r.interrupt?n:u,e.attempt(NO,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return KE(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function IO(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(hD,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ZE(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!KE(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(PO,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,ZE(e,e.attempt(MO,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function LO(e,t,n){let r=this;return ZE(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function RO(e){e.exit(this.containerState.type)}function zO(e,t,n){let r=this;return ZE(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!KE(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var BO={name:`setextUnderline`,resolveTo:VO,tokenize:HO};function VO(e,t){let n=new tD,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function HO(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),KE(t)?ZE(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var UO={tokenize:WO};function WO(e){let t=this,n=e.attempt(hD,r,e.attempt(this.parser.constructs.flowInitial,i,ZE(e,e.attempt(this.parser.constructs.flow,i,e.attempt(VD,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var GO={resolveAll:YO()},KO=JO(`string`),qO=JO(`text`);function JO(e){return{resolveAll:YO(e===`text`?XO:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function YO(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function XO(e,t){let n=new tD,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var ZO=s({attentionMarkers:()=>ak,contentInitial:()=>$O,disable:()=>ok,document:()=>QO,flow:()=>tk,flowInitial:()=>ek,insideSpan:()=>ik,string:()=>nk,text:()=>rk}),QO={42:MO,43:MO,45:MO,48:MO,49:MO,50:MO,51:MO,52:MO,53:MO,54:MO,55:MO,56:MO,57:MO,62:_D},$O={91:XD},ek={[-2]:kD,[-1]:kD,32:kD},tk={35:nO,42:AO,45:[BO,AO],60:sO,61:BO,95:AO,96:DD,126:DD},nk={38:CD,92:xD},rk={[-5]:OO,[-4]:OO,[-3]:OO,33:wO,38:CD,42:lD,60:[pD,fO],91:EO,92:[eO,xD],93:mO,95:lD,96:ND},ik={null:[lD,GO]},ak={null:[42,95]},ok={null:[]};function sk(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=jE(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=cD(a,l.events,l),l.events):[]}function f(e,t){return lk(p(e),t)}function p(e){return ck(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&AE(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ck(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function lk(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
64
|
+
`,t),i=-1;if(n!==-1&&r!==-1?i=n<r?n:r:n===-1?r!==-1&&(i=r):i=n===e.length-1?-1:n,i===-1)break;if(C(e,t,i),x())return``;t=i+1,e.charCodeAt(t-1)===GC&&e.charCodeAt(t)===WC&&t++}return e.slice(t)}function C(e,t,r){if(t===r){T();return}let i=e.charCodeAt(t);if(YC(e,t,i)){let n=e.charCodeAt(t+5)===KC?t+6:t+5,i=e.slice(n,r);d=f===0?i:`${d}\n${i}`,f++;return}if(XC(e,t,i)){p=e.slice(e.charCodeAt(t+6)===KC?t+7:t+6,r)||void 0;return}if(i===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let n=e.slice(e.charCodeAt(t+3)===KC?t+4:t+3,r);n.includes(`\0`)||(u=n);return}if(i===58){if(n){let i=e.slice(t,r);n(i.slice(e.charCodeAt(t+1)===KC?2:1))}return}let a=e.slice(t,r),o=a.indexOf(`:`);if(o===-1){w(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===KC?2:1;w(s,a.slice(o+c),a)}function w(e,t,n){switch(e){case`event`:p=t||void 0;break;case`data`:d=f===0?t:`${d}\n${t}`,f++;break;case`id`:t.includes(`\0`)||(u=t);break;case`retry`:/^\d+$/.test(t)?o?.(parseInt(t,10)):r?.(new UC(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:n}));break;default:r?.(new UC(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:`unknown-field`,field:e,value:t,line:n}))}}function T(){u!==void 0&&a?.(u),f>0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0}function E(e={}){if(e.consume&&s.length>0){let e=s.join(``);C(e,0,e.length)}l=``,u=void 0,d=``,f=0,p=void 0,s.length=0,c=0,m=!1,h=!1,g=!1}return{feed:_,reset:E}}function YC(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function XC(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}function ZC(e,t){let n=1;for(;n<e.length&&n<t.length;){if(e.charCodeAt(n)!==t.charCodeAt(n))return!1;n++}return e.length<=t.length||e.charCodeAt(t.length)===58}function QC(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function $C(e){let t=await e.json().catch(()=>{throw new au(e.status,`invalid_response`,`Kanvil returned an invalid response`)});if(!e.ok){let n=ru.safeParse(t);throw new au(e.status,n.success?n.data.error.code:`request_failed`,n.success?n.data.error.message:`Request failed (${e.status})`,n.success?n.data.error.details:void 0)}return t}function ew(e){let t=e.fetch??fetch,n=t=>{if(!t.startsWith(`/`)||t.startsWith(`//`))throw new au(400,`invalid_path`,`Use a relative Kanvil endpoint`);let n=new URL(`${e.baseUrl.replace(/\/$/,``)}${t}`);if(n.origin!==new URL(e.baseUrl).origin)throw new au(400,`invalid_path`,`Credentials cannot be sent to another origin`);return n},r=async(e,n)=>{try{return await t(e,n)}catch(r){if(n.signal?.aborted)throw r;return t(e,n)}},i={async request(r,i,a={}){let o=new Headers(await e.headers?.());return new Headers(a.headers).forEach((e,t)=>o.set(t,e)),i.parse(await $C(await t(n(r),{...a,headers:o,credentials:e.credentials??`include`})))},async call(t,n){let i=nu[t],a={...i.input.parse(n)},o=i.path.replace(/\{(\w+)\}/g,(e,t)=>{let n=a[t];if(delete a[t],typeof n!=`string`)throw new au(400,`invalid_path`,`Missing path parameter ${t}`);return encodeURIComponent(n)}),s=new URL(`${e.baseUrl.replace(/\/$/,``)}/api/v1${o}`),c=new Headers(await e.headers?.()),l={method:i.method,credentials:e.credentials??`include`,headers:c};if(i.method===`GET`)for(let[e,t]of Object.entries(a))(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)&&s.searchParams.set(e,String(t));else c.set(`Content-Type`,`application/json`),a.requestId??=(e.requestId??QC)(),l.body=JSON.stringify(a);return ou(t,await $C(await r(s,l)))},async subscribe(r){let i=r.cursor,a=1e3;try{for(;!r.signal.aborted;){r.onState?.(`connecting`);let o=n(`/api/v1/events`);i&&o.searchParams.set(`cursor`,i),r.projectId&&o.searchParams.set(`projectId`,r.projectId);let s,c=()=>{s?.cancel().catch(()=>{})};r.signal.addEventListener(`abort`,c,{once:!0});try{let n=await t(o,{headers:new Headers(await e.headers?.()),credentials:e.credentials??`include`,signal:r.signal});if(n.status===410&&r.onReset){i=await r.onReset();continue}if(n.ok||await $C(n),!n.body)throw new au(502,`invalid_stream`,`The event stream has no body`);s=n.body.getReader();let c=[],l=JC({maxBufferSize:1e6,onEvent:e=>c.push(e),onError:e=>{throw new au(502,`invalid_stream`,e.message)}}),u=new TextDecoder;for(;!r.signal.aborted;){let e=await s.read();if(e.done)break;l.feed(u.decode(e.value,{stream:!0}));for(let e of c.splice(0)){if(e.event===`error`){let t=iu.parse(JSON.parse(e.data));throw new au(t.status,t.code,t.message)}e.event===`change`&&await r.onEvent(Wl.parse(JSON.parse(e.data))),(e.event===`checkpoint`||e.event===`change`)&&(r.onState?.(`connected`),a=1e3,e.id&&(await r.onCursor?.(e.id),i=e.id))}}}catch(e){if(r.signal.aborted)return;if(e instanceof au&&e.status===410&&r.onReset){i=await r.onReset();continue}if(e instanceof au&&e.status<500)throw e}finally{r.signal.removeEventListener(`abort`,c),await s?.cancel().catch(()=>{})}if(r.signal.aborted)return;r.onState?.(`offline`),await new Promise(e=>{let t=()=>{clearTimeout(n),r.signal.removeEventListener(`abort`,t),e()},n=setTimeout(t,a);r.signal.addEventListener(`abort`,t,{once:!0}),r.signal.aborted&&t()}),a=Math.min(a*2,3e4)}}finally{r.onState?.(`closed`)}}};return{...i,notificationPreferences(){return{queryKey:[`kanvil`,e.baseUrl,`notification-preferences`],queryFn:()=>i.request(`/api/v1/notifications/preferences`,ql)}},setNotificationPreferences(e){return i.request(`/api/v1/notifications/preferences`,ql,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Jl.parse(e))})},watch(e){let t=!0;return i.subscribe({...e.projectId?{projectId:e.projectId}:{},signal:e.signal,...e.onState?{onState:e.onState}:{},onEvent:t=>e.invalidate(t),onCursor:async()=>{t&&(t=!1,await e.invalidate())},onReset:async()=>{let t=e.projectId?await i.request(`/api/v1/snapshot?projectId=${encodeURIComponent(e.projectId)}`,Al):await i.request(`/api/v1/checkpoint`,jl);return await e.invalidate(),t.cursor}})},query(t,n){return{queryKey:[`kanvil`,e.baseUrl,t,n],queryFn:()=>i.call(t,n)}},action(e){return{mutationFn:t=>i.call(e,t),networkMode:`always`,retry:!1}}}}var tw=gC({plugins:[NC(),HC()]}),nw=ew({baseUrl:window.location.origin}),rw=(0,K.createContext)({id:``,name:``,email:``,admin:!1,image:null,clearPrivateData:()=>{}}),iw=()=>(0,K.useContext)(rw);function aw(e){let t=fu();return Md({...nw.action(e),onSuccess:()=>t.invalidateQueries({queryKey:[`kanvil`]})})}var ow=(0,K.createContext)({active:void 0,workspaces:[],pending:!0,error:void 0,select:()=>{}}),sw=()=>(0,K.useContext)(ow),cw=()=>jd(nw.query(`list_workspaces`,{})),lw=()=>jd(nw.query(`list_projects`,{}));function uw(){let{active:e}=sw();return jd({...nw.query(`list_projects`,{}),select:t=>e?t.filter(t=>t.workspaceId===e.id):[]})}var dw={list_members:[`membership.`,`project.`],list_workspace_members:[`membership.`,`project.`],list_project_labels:[`label.`,`project.`],list_label_colors:[`label.`],list_views:[`label.`,`project.`],get_project:[`project.`,`label.`]};function fw(e){return t=>{let[n,,r,i]=t.queryKey;if(n!==`kanvil`)return!1;if(typeof r!=`string`||!i||typeof i!=`object`)return!0;let a=dw[r];if(a&&!a.some(t=>e.type.startsWith(t)))return!1;let o=i;return typeof o.projectId==`string`?o.projectId===e.projectId?!e.ticketId||typeof o.ticketId!=`string`||o.ticketId===e.ticketId||o.ticketId===e.data.key:!1:!0}}function pw(e){let t=fu(),[n,r]=(0,K.useState)(`connecting`);return(0,K.useEffect)(()=>{let n=new AbortController;return nw.watch({...e?{projectId:e}:{},signal:n.signal,invalidate:e=>t.invalidateQueries(e?{predicate:fw(e)}:{queryKey:[`kanvil`]}),onState:r}).catch(()=>r(`Sign in to reconnect`)),()=>n.abort()},[t,e]),n}function mw(e){for(let t of Object.keys(localStorage))t.startsWith(`kanvil:${e}:`)&&localStorage.removeItem(t)}function hw(e,t=!0){let n=iw(),r=jd({...nw.query(`list_members`,{projectId:e}),enabled:t&&!n.admin}),i=n.admin?`admin`:r.data?.find(e=>e.userId===n.id)?.role;return{role:i,canWrite:i===`writer`||i===`admin`,canAdmin:i===`admin`}}function gw({projectId:e,actorId:t,avatar:n=!1}){let r=iw(),i=jd(nw.query(`list_members`,{projectId:e})).data?.find(e=>e.userId===t),a=t===r.id?r.name:i?.name??`Former member`,o=t===r.id?r.image:i?.image;return(0,q.jsxs)(`span`,{className:n?`inline-flex items-center gap-2`:``,title:t,children:[n&&(0,q.jsx)(Tb,{name:a,image:o,className:`size-7 text-[10px]`}),t===r.id?`You`:a]})}var _w=365.2425,vw=6048e5,yw=864e5,bw=6e4,xw=525600,Sw=43200,Cw=1440,ww=86400;ww*7,ww*_w/12*3;var Tw=Symbol.for(`constructDateFrom`);function Ew(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Tw in e?e[Tw](t):e instanceof Date?new e.constructor(t):new Date(t)}function Dw(e,t){return Ew(t||e,e)}var Ow={};function kw(){return Ow}function Aw(e){let t=Dw(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-n}function jw(e,...t){let n=Ew.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Mw(e,t){let n=+Dw(e)-Dw(t);return n<0?-1:n>0?1:n}function Nw(e){return Ew(e,Date.now())}function Pw(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}var Fw={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Iw=(e,t,n)=>{let r,i=Fw[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Lw(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Rw={date:Lw({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Lw({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Lw({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},zw={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Bw=(e,t,n,r)=>zw[e];function Vw(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Hw={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:Vw({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:Vw({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Vw({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:Vw({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:Vw({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Uw(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Gw(s,e=>e.test(o)):Ww(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Ww(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Gw(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Kw(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var qw={code:`en-US`,formatDistance:Iw,formatLong:Rw,formatRelative:Bw,localize:Hw,match:{ordinalNumber:Kw({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Uw({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Uw({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Uw({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Uw({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Uw({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Jw(e,t,n){let r=kw(),i=n?.locale??r.locale??qw,a=Mw(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=jw(n?.in,...a>0?[t,e]:[e,t]),l=Pw(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/bw,f=(u-(Aw(c)-Aw(s)))/bw,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<1440?`hour`:f<43200?`day`:f<525600?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}if(m===`day`){let e=l(f/Cw);return i.formatDistance(`xDays`,e,o)}if(m===`month`){let e=l(f/Sw);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}{let e=l(f/xw);return i.formatDistance(`xYears`,e,o)}}function Yw(e,t){return Jw(e,Nw(e),t)}function Xw(e){return+Dw(e)<Date.now()}var Zw=ub();async function Qw(e){try{if(navigator.clipboard){await navigator.clipboard.writeText(e);return}}catch{}let t=document.activeElement,n=document.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,document.body.append(n);try{if(n.select(),!document.execCommand(`copy`))throw Error(`Copy failed. Select the text and copy it manually.`)}finally{n.remove(),t instanceof HTMLElement&&t.focus()}}function $w(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>n(Error(`The file could not be read`)),{once:!0}),r.addEventListener(`load`,()=>typeof r.result==`string`?t(r.result.slice(r.result.indexOf(`,`)+1)):n(Error(`The file could not be encoded`)),{once:!0}),r.readAsDataURL(e)})}async function eT(e,{fit:t=`cover`,format:n=`image/jpeg`}={}){if(e.size>1e7)throw Error(`Choose an image smaller than 10 MB.`);let r=await createImageBitmap(e);try{let e=document.createElement(`canvas`);e.width=256,e.height=256;let i=e.getContext(`2d`);if(!i)throw Error(`This browser cannot resize the image.`);let a=(t===`cover`?Math.max:Math.min)(256/r.width,256/r.height),o=r.width*a,s=r.height*a;return i.drawImage(r,(256-o)/2,(256-s)/2,o,s),{contentType:n,data:await $w(await new Promise((t,r)=>e.toBlob(e=>e?t(e):r(Error(`The image could not be prepared.`)),n,.9)))}}finally{r.close()}}function tT(e){return e instanceof Element&&!!e.closest(`input, textarea, select, [contenteditable=""], [contenteditable="true"], [role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]`)}function nT(e,t,{enabled:n=!0,mod:r=!1,guard:i}={}){let a=(0,K.useRef)({handler:t,guard:i});(0,K.useEffect)(()=>{a.current={handler:t,guard:i}}),(0,K.useEffect)(()=>{if(!n)return;let t=t=>{t.key!==e||t.defaultPrevented||t.repeat||(r?!(t.metaKey||t.ctrlKey):t.metaKey||t.ctrlKey||t.altKey)||(r||!tT(t.target))&&(!a.current.guard||a.current.guard(t))&&(t.preventDefault(),a.current.handler(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}function rT(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var iT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oT={};function sT(e,t){return((t||oT).jsx?aT:iT).test(e)}var cT=/[ \t\n\f\r]/g;function lT(e){return typeof e==`object`?e.type===`text`&&uT(e.value):uT(e)}function uT(e){return e.replace(cT,``)===``}var dT=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};dT.prototype.normal={},dT.prototype.property={},dT.prototype.space=void 0;function fT(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new dT(n,r,t)}function pT(e){return e.toLowerCase()}var mT=class{constructor(e,t){this.attribute=t,this.property=e}};mT.prototype.attribute=``,mT.prototype.booleanish=!1,mT.prototype.boolean=!1,mT.prototype.commaOrSpaceSeparated=!1,mT.prototype.commaSeparated=!1,mT.prototype.defined=!1,mT.prototype.mustUseProperty=!1,mT.prototype.number=!1,mT.prototype.overloadedBoolean=!1,mT.prototype.property=``,mT.prototype.spaceSeparated=!1,mT.prototype.space=void 0;var hT=s({boolean:()=>_T,booleanish:()=>vT,commaOrSpaceSeparated:()=>ST,commaSeparated:()=>xT,number:()=>Q,overloadedBoolean:()=>yT,spaceSeparated:()=>bT}),gT=0,_T=CT(),vT=CT(),yT=CT(),Q=CT(),bT=CT(),xT=CT(),ST=CT();function CT(){return 2**++gT}var wT=Object.keys(hT),TT=class extends mT{constructor(e,t,n,r){let i=-1;if(super(e,t),ET(this,`space`,r),typeof n==`number`)for(;++i<wT.length;){let e=wT[i];ET(this,wT[i],(n&hT[e])===hT[e])}}};TT.prototype.defined=!0;function ET(e,t,n){n&&(e[t]=n)}function DT(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new TT(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[pT(r)]=r,n[pT(a.attribute)]=r}return new dT(t,n,e.space)}var OT=DT({properties:{ariaActiveDescendant:null,ariaAtomic:vT,ariaAutoComplete:null,ariaBusy:vT,ariaChecked:vT,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:bT,ariaCurrent:null,ariaDescribedBy:bT,ariaDetails:null,ariaDisabled:vT,ariaDropEffect:bT,ariaErrorMessage:null,ariaExpanded:vT,ariaFlowTo:bT,ariaGrabbed:vT,ariaHasPopup:null,ariaHidden:vT,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bT,ariaLevel:Q,ariaLive:null,ariaModal:vT,ariaMultiLine:vT,ariaMultiSelectable:vT,ariaOrientation:null,ariaOwns:bT,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:vT,ariaReadOnly:vT,ariaRelevant:null,ariaRequired:vT,ariaRoleDescription:bT,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:vT,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function kT(e,t){return t in e?e[t]:t}function AT(e,t){return kT(e,t.toLowerCase())}var jT=DT({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:xT,acceptCharset:bT,accessKey:bT,action:null,allow:null,allowFullScreen:_T,allowPaymentRequest:_T,allowUserMedia:_T,alpha:_T,alt:null,as:null,async:_T,autoCapitalize:null,autoComplete:bT,autoFocus:_T,autoPlay:_T,blocking:bT,capture:null,charSet:null,checked:_T,cite:null,className:bT,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:vT,controls:_T,controlsList:bT,coords:Q|xT,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_T,defer:_T,dir:null,dirName:null,disabled:_T,download:yT,draggable:vT,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_T,formTarget:null,headers:bT,height:Q,hidden:yT,high:Q,href:null,hrefLang:null,htmlFor:bT,httpEquiv:bT,id:null,imageSizes:null,imageSrcSet:null,inert:_T,inputMode:null,integrity:null,is:null,isMap:_T,itemId:null,itemProp:bT,itemRef:bT,itemScope:_T,itemType:bT,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_T,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:_T,muted:_T,name:null,nonce:null,noModule:_T,noValidate:_T,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_T,optimum:Q,pattern:null,ping:bT,placeholder:null,playsInline:_T,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_T,referrerPolicy:null,rel:bT,required:_T,reversed:_T,rows:Q,rowSpan:Q,sandbox:bT,scope:null,scoped:_T,seamless:_T,selected:_T,shadowRootClonable:_T,shadowRootCustomElementRegistry:_T,shadowRootDelegatesFocus:_T,shadowRootMode:null,shadowRootSerializable:_T,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:vT,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:_T,useMap:null,value:vT,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bT,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_T,declare:_T,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:_T,noHref:_T,noShade:_T,noWrap:_T,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:vT,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:_T,disablePictureInPicture:_T,disableRemotePlayback:_T,exportParts:xT,part:bT,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:AT}),MT=DT({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:ST,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:bT,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:_T,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xT,g2:xT,glyphName:xT,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:ST,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bT,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ST,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ST,rev:ST,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ST,requiredFeatures:ST,requiredFonts:ST,requiredFormats:ST,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:ST,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ST,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ST,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:kT}),NT=DT({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),PT=DT({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:AT}),FT=DT({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),IT={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},LT=/[A-Z]/g,RT=/-[a-z]/g,zT=/^data[-\w.:]+$/i;function BT(e,t){let n=pT(t),r=t,i=mT;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&zT.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(RT,HT);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!RT.test(e)){let n=e.replace(LT,VT);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=TT}return new i(r,t)}function VT(e){return`-`+e.toLowerCase()}function HT(e){return e.charAt(1).toUpperCase()}var UT=fT([OT,jT,NT,PT,FT],`html`),WT=fT([OT,MT,NT,PT,FT],`svg`);function GT(e){return e.join(` `).trim()}var KT=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
65
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),qT=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(KT());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),JT=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),YT=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(qT()),r=JT();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),XT=QT(`end`),ZT=QT(`start`);function QT(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function $T(e){let t=ZT(e),n=XT(e);if(t&&n)return{start:t,end:n}}function eE(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?nE(e.position):`start`in e||`end`in e?nE(e):`line`in e||`column`in e?tE(e):``}function tE(e){return rE(e&&e.line)+`:`+rE(e&&e.column)}function nE(e){return tE(e&&e.start)+`-`+tE(e&&e.end)}function rE(e){return e&&typeof e==`number`?e:1}var iE=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=eE(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};iE.prototype.file=``,iE.prototype.name=``,iE.prototype.reason=``,iE.prototype.message=``,iE.prototype.stack=``,iE.prototype.column=void 0,iE.prototype.line=void 0,iE.prototype.ancestors=void 0,iE.prototype.cause=void 0,iE.prototype.fatal=void 0,iE.prototype.place=void 0,iE.prototype.ruleId=void 0,iE.prototype.source=void 0;var aE=l(YT(),1),oE={}.hasOwnProperty,sE=new Map,cE=/[A-Z]/g,lE=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),uE=new Set([`td`,`th`]),dE=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function fE(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=CE(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=SE(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?WT:UT,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=pE(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function pE(e,t,n){if(t.type===`element`)return mE(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return hE(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return _E(e,t,n);if(t.type===`mdxjsEsm`)return gE(e,t);if(t.type===`root`)return vE(e,t,n);if(t.type===`text`)return yE(e,t)}function mE(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=WT,e.schema=i),e.ancestors.push(t);let a=kE(e,t.tagName,!1),o=wE(e,t),s=EE(e,t);return lE.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!lT(e)})),bE(e,o,a,t),xE(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function hE(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}AE(e,t.position)}function gE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);AE(e,t.position)}function _E(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=WT,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:kE(e,t.name,!0),o=TE(e,t),s=EE(e,t);return bE(e,o,a,t),xE(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function vE(e,t,n){let r={};return xE(r,EE(e,t)),e.create(t,e.Fragment,r,n)}function yE(e,t){return t.value}function bE(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xE(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function SE(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function CE(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ZT(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function wE(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&oE.call(t.properties,i)){let a=DE(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&uE.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function TE(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else AE(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else AE(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function EE(e,t){let n=[],r=-1,i=e.passKeys?new Map:sE;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=pE(e,a,o);s!==void 0&&n.push(s)}return n}function DE(e,t,n){let r=BT(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?rT(n):GT(n)),r.property===`style`){let t=typeof n==`object`?n:OE(e,String(n));return e.stylePropertyNameCase===`css`&&(t=jE(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?IT[r.property]||r.property:r.attribute,n]}}function OE(e,t){try{return(0,aE.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new iE("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=dE+`#cannot-parse-style-attribute`,r}}function kE(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=sT(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=sT(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return oE.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);AE(e)}function AE(e,t){let n=new iE("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=dE+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function jE(e){let t={},n;for(n in e)oE.call(e,n)&&(t[ME(n)]=e[n]);return t}function ME(e){let t=e.replace(cE,NE);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function NE(e){return`-`+e.toLowerCase()}var PE={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},FE={};function IE(e,t){let n=t||FE;return LE(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function LE(e,t,n){if(zE(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return RE(e.children,t,n)}return Array.isArray(e)?RE(e,t,n):``}function RE(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=LE(e[i],t,n);return r.join(``)}function zE(e){return!!(e&&typeof e==`object`)}var BE=document.createElement(`i`);function VE(e){let t=`&`+e+`;`;BE.innerHTML=t;let n=BE.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function HE(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function UE(e,t){return e.length>0?(HE(e,e.length,0,t),e):t}var WE={}.hasOwnProperty;function GE(e){let t={},n=-1;for(;++n<e.length;)KE(t,e[n]);return t}function KE(e,t){let n;for(n in t){let r=(WE.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){WE.call(r,a)||(r[a]=[]);let e=i[a];qE(r[a],Array.isArray(e)?e:e?[e]:[])}}}function qE(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);HE(e,0,0,r)}function JE(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function YE(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var XE=sD(/[A-Za-z]/),ZE=sD(/[\dA-Za-z]/),QE=sD(/[#-'*+\--9=?A-Z^-~]/);function $E(e){return e!==null&&(e<32||e===127)}var eD=sD(/\d/),tD=sD(/[\dA-Fa-f]/),nD=sD(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function rD(e){return e!==null&&(e<0||e===32)}function iD(e){return e===-2||e===-1||e===32}var aD=sD(/\p{P}|\p{S}/u),oD=sD(/\s/);function sD(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function cD(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ZE(e.charCodeAt(n+1))&&ZE(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function lD(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return iD(r)?(e.enter(n),s(r)):t(r)}function s(r){return iD(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function uD(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&iD(t)?(e.enter(r),c(t)):l(t)}function c(t){return iD(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var dD={tokenize:fD};function fD(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),lD(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var pD=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){mD(this,e,t,n,!1)}addBefore(e,t,n){mD(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function mD(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var hD={tokenize:_D},gD={tokenize:vD};function _D(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new pD;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gD,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(gD,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new pD;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vD(e,t,n){return lD(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function yD(e){if(e===null||rD(e)||oD(e))return 1;if(aD(e))return 2}function bD(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var xD={name:`attention`,resolveAll:SD,tokenize:CD};function SD(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};wD(o,-a),wD(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=UE(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=UE(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=UE(r,bD(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=UE(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=UE(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),HE(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function CD(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yD(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=yD(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function wD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var TD={name:`autolink`,tokenize:ED};function ED(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return XE(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ZE(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||ZE(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||$E(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):QE(t)?(e.consume(t),l):n(t)}function u(e){return ZE(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||ZE(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var DD={partial:!0,tokenize:OD};function OD(e,t,n){return r;function r(t){return iD(t)?lD(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var kD={continuation:{tokenize:jD},exit:MD,name:`blockQuote`,tokenize:AD};function AD(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return iD(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function jD(e,t,n){let r=this;return i;function i(t){return iD(t)?lD(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(kD,t,n)(r)}}function MD(e){e.exit(`blockQuote`)}var ND={name:`characterEscape`,tokenize:PD};function PD(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return nD(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var FD={name:`characterReference`,tokenize:ID};function ID(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=ZE,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=tD,u):(e.enter(`characterReferenceValue`),a=7,o=eD,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ZE&&!VE(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var LD={partial:!0,tokenize:RD};function RD(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var zD={concrete:!0,name:`codeFenced`,tokenize:BD};function BD(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),iD(t)?lD(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(LD,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):iD(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),lD(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&iD(t)?lD(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(LD,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),iD(t)?lD(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),iD(t)?lD(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var VD={name:`codeIndented`,tokenize:UD},HD={partial:!0,tokenize:WD};function UD(e,t,n){return r;function r(t){return e.enter(`codeIndented`),uD(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):$(t)?e.attempt(HD,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function WD(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):uD(e,t,a,`linePrefix`,4,4)(o)}function a(e){return $(e)?i(e):n(e)}}var GD={name:`codeText`,previous:qD,resolve:KD,tokenize:JD};function KD(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function qD(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function JD(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var YD=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&XD(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),XD(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),XD(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);XD(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);XD(this.left,t.reverse())}}}};function XD(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ZD(e){let t={},n=-1,r,i,a,o,s,c,l,u=new YD(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,QD(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return HE(e,0,1/0,u.slice(0)),!l}function QD(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var $D={resolve:tO,tokenize:nO},eO={partial:!0,tokenize:rO};function tO(e){return ZD(e),e}function nO(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(eO,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function rO(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),lD(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function iO(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||$E(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||rD(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||$E(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function aO(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!iD(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function oO(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),lD(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function sO(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):iD(i)?lD(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var cO={name:`definition`,tokenize:uO},lO={partial:!0,tokenize:dO};function uO(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return aO.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=YE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return rD(t)?sO(e,l)(t):l(t)}function l(t){return iO(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(lO,d,d)(t)}function d(t){return iD(t)?lD(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function dO(e,t,n){return r;function r(t){return rD(t)?sO(e,i)(t):n(t)}function i(t){return oO(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return iD(t)?lD(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var fO={name:`hardBreakEscape`,tokenize:pO};function pO(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var mO={name:`headingAtx`,resolve:hO,tokenize:gO};function hO(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};HE(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function gO(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||rD(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):iD(n)?lD(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||rD(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var _O=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),vO=[`pre`,`script`,`style`,`textarea`],yO={concrete:!0,name:`htmlFlow`,resolveTo:xO,tokenize:SO},bO={partial:!0,tokenize:CO};function xO(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SO(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):XE(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):XE(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return XE(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||rD(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&vO.includes(l)?(i=1,r.interrupt?t(s):O(s)):_O.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||ZE(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return iD(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||XE(t)?(e.consume(t),b):iD(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||ZE(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):iD(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):iD(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||rD(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||iD(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):iD(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(bO,R,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(LD,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return vO.includes(n)?(e.consume(t),L):O(t)}return XE(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||$(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function CO(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(DD,t,n)}}var wO={name:`htmlText`,tokenize:TO};function TO(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):XE(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):XE(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return XE(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ZE(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):iD(t)?(e.consume(t),C):M(t)}function w(t){return t===45||ZE(t)?(e.consume(t),w):t===47||t===62||rD(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||XE(t)?(e.consume(t),E):$(t)?(o=T,N(t)):iD(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||ZE(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):iD(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):iD(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||rD(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||rD(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return iD(t)?lD(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var EO={name:`labelEnd`,resolveAll:AO,resolveTo:jO,tokenize:MO},DO={tokenize:NO},OO={tokenize:PO},kO={tokenize:FO};function AO(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&HE(e,0,e.length,n),e}function jO(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=UE(o,e.slice(i+1,i+r+3)),o=UE(o,[[`enter`,l,t]]),o=UE(o,bD(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=UE(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=UE(o,e.slice(a+1)),o=UE(o,[[`exit`,s,t]]),HE(e,i,e.length,o),e}function MO(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(YE(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(DO,u,o?u:d)(t):t===91?e.attempt(OO,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(kO,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function NO(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return rD(t)?sO(e,a)(t):a(t)}function a(t){return t===41?u(t):iO(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return rD(t)?sO(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?oO(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return rD(t)?sO(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function PO(e,t,n){let r=this;return i;function i(t){return aO.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(YE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function FO(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var IO={name:`labelStartImage`,resolveAll:EO.resolveAll,tokenize:LO};function LO(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var RO={name:`labelStartLink`,resolveAll:EO.resolveAll,tokenize:zO};function zO(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var BO={name:`lineEnding`,tokenize:VO};function VO(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),lD(e,t,`linePrefix`)}}var HO={name:`thematicBreak`,tokenize:UO};function UO(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),iD(t)?lD(e,s,`whitespace`)(t):s(t))}}var WO={continuation:{tokenize:JO},exit:XO,name:`list`,tokenize:qO},GO={partial:!0,tokenize:ZO},KO={partial:!0,tokenize:YO};function qO(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:eD(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(HO,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return eD(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(DD,r.interrupt?n:u,e.attempt(GO,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return iD(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function JO(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(DD,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lD(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!iD(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(KO,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,lD(e,e.attempt(WO,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function YO(e,t,n){let r=this;return lD(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function XO(e){e.exit(this.containerState.type)}function ZO(e,t,n){let r=this;return lD(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!iD(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var QO={name:`setextUnderline`,resolveTo:$O,tokenize:ek};function $O(e,t){let n=new pD,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function ek(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),iD(t)?lD(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var tk={tokenize:nk};function nk(e){let t=this,n=e.attempt(DD,r,e.attempt(this.parser.constructs.flowInitial,i,lD(e,e.attempt(this.parser.constructs.flow,i,e.attempt($D,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var rk={resolveAll:sk()},ik=ok(`string`),ak=ok(`text`);function ok(e){return{resolveAll:sk(e===`text`?ck:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function sk(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ck(e,t){let n=new pD,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var lk=s({attentionMarkers:()=>_k,contentInitial:()=>dk,disable:()=>vk,document:()=>uk,flow:()=>pk,flowInitial:()=>fk,insideSpan:()=>gk,string:()=>mk,text:()=>hk}),uk={42:WO,43:WO,45:WO,48:WO,49:WO,50:WO,51:WO,52:WO,53:WO,54:WO,55:WO,56:WO,57:WO,62:kD},dk={91:cO},fk={[-2]:VD,[-1]:VD,32:VD},pk={35:mO,42:HO,45:[QO,HO],60:yO,61:QO,95:HO,96:zD,126:zD},mk={38:FD,92:ND},hk={[-5]:BO,[-4]:BO,[-3]:BO,33:IO,38:FD,42:xD,60:[TD,wO],91:RO,92:[fO,ND],93:EO,95:xD,96:GD},gk={null:[xD,rk]},_k={null:[42,95]},vk={null:[]};function yk(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=UE(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=bD(a,l.events,l),l.events):[]}function f(e,t){return xk(p(e),t)}function p(e){return bk(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&HE(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bk(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function xk(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
66
66
|
`;break;case-3:o=`\r
|
|
67
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function uk(e){let t={constructs:NE([ZO,...(e||{}).extensions||[]]),content:n($E),defined:[],document:n(rD),flow:n(UO),lazy:{},string:n(KO),text:n(qO)};return t;function n(e){return n;function n(n){return sk(t,e,n)}}}function dk(e){for(;!zD(e););return e}var fk=/[\0\t\n\r]/g;function pk(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){fk.lastIndex=c;let n=fk.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var mk=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hk(e){return e.replace(mk,gk)}function gk(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return IE(n.slice(t?2:1),t?16:10)}return kE(n)||e}var _k={}.hasOwnProperty;function vk(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),yk(n)(dk(uk(n).document().write(pk()(e,t,!0))))}function yk(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(he),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(de),blockQuote:o(oe),characterEscape:E,characterReference:E,codeFenced:o(se),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(se,s),codeText:o(ce,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(le),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ue),hardBreakEscape:o(fe),hardBreakTrailing:o(fe),htmlFlow:o(pe,s),htmlFlowData:E,htmlText:o(pe,s),htmlTextData:E,image:o(me),label:s,link:o(he),listItem:o(ge),listItemValue:p,listOrdered:o(V,f),listUnordered:o(V),paragraph:o(_e),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(de),strong:o(ve),thematicBreak:o(be)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ae,autolinkProtocol:ie,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:re,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};xk(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),_k.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||Ck).call(o,void 0,e[0])}for(r.position={start:bk(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:bk(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:bk(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+HT({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ck).call(this,e,r[0])),n.position.end=bk(e.end)}function d(){return wE(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=LE(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:bk(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=bk(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=bk(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=hk(t),n.identifier=LE(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function z(){this.data.inReference=void 0}function B(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=LE(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function te(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=IE(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=kE(t);let i=this.stack[this.stack.length-1];i.value+=r}function re(e){let t=this.stack.pop();t.position.end=bk(e.end)}function ie(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ae(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[],position:void 0}}function se(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function ce(){return{type:`inlineCode`,value:``,position:void 0}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ue(){return{type:`emphasis`,children:[],position:void 0}}function de(){return{type:`heading`,depth:0,children:[],position:void 0}}function fe(){return{type:`break`,position:void 0}}function pe(){return{type:`html`,value:``,position:void 0}}function me(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function he(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function V(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function _e(){return{type:`paragraph`,children:[],position:void 0}}function ve(){return{type:`strong`,children:[],position:void 0}}function ye(){return{type:`text`,value:``,position:void 0}}function be(){return{type:`thematicBreak`,position:void 0}}}function bk(e){return{line:e.line,column:e.column,offset:e.offset}}function xk(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?xk(e,r):Sk(e,r)}}function Sk(e,t){let n;for(n in t)if(_k.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ck(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+HT({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+HT({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+HT({start:t.start,end:t.end})+`) is still open`)}function wk(e){let t=this;t.parser=n;function n(n){return vk(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Tk(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ek(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
68
|
-
`}]}function
|
|
69
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function
|
|
67
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Sk(e){let t={constructs:GE([lk,...(e||{}).extensions||[]]),content:n(dD),defined:[],document:n(hD),flow:n(tk),lazy:{},string:n(ik),text:n(ak)};return t;function n(e){return n;function n(n){return yk(t,e,n)}}}function Ck(e){for(;!ZD(e););return e}var wk=/[\0\t\n\r]/g;function Tk(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){wk.lastIndex=c;let n=wk.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Ek=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dk(e){return e.replace(Ek,Ok)}function Ok(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return JE(n.slice(t?2:1),t?16:10)}return VE(n)||e}var kk={}.hasOwnProperty;function Ak(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),jk(n)(Ck(Sk(n).document().write(Tk()(e,t,!0))))}function jk(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(he),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(de),blockQuote:o(oe),characterEscape:E,characterReference:E,codeFenced:o(se),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(se,s),codeText:o(ce,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(le),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ue),hardBreakEscape:o(fe),hardBreakTrailing:o(fe),htmlFlow:o(pe,s),htmlFlowData:E,htmlText:o(pe,s),htmlTextData:E,image:o(me),label:s,link:o(he),listItem:o(ge),listItemValue:p,listOrdered:o(V,f),listUnordered:o(V),paragraph:o(_e),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(de),strong:o(ve),thematicBreak:o(be)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ae,autolinkProtocol:ie,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:re,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};Nk(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),kk.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||Fk).call(o,void 0,e[0])}for(r.position={start:Mk(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Mk(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Mk(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+eE({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Fk).call(this,e,r[0])),n.position.end=Mk(e.end)}function d(){return IE(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=YE(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:Mk(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Mk(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Mk(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Dk(t),n.identifier=YE(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function z(){this.data.inReference=void 0}function B(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=YE(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function te(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=JE(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=VE(t);let i=this.stack[this.stack.length-1];i.value+=r}function re(e){let t=this.stack.pop();t.position.end=Mk(e.end)}function ie(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ae(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[],position:void 0}}function se(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function ce(){return{type:`inlineCode`,value:``,position:void 0}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ue(){return{type:`emphasis`,children:[],position:void 0}}function de(){return{type:`heading`,depth:0,children:[],position:void 0}}function fe(){return{type:`break`,position:void 0}}function pe(){return{type:`html`,value:``,position:void 0}}function me(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function he(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function V(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function _e(){return{type:`paragraph`,children:[],position:void 0}}function ve(){return{type:`strong`,children:[],position:void 0}}function ye(){return{type:`text`,value:``,position:void 0}}function be(){return{type:`thematicBreak`,position:void 0}}}function Mk(e){return{line:e.line,column:e.column,offset:e.offset}}function Nk(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Nk(e,r):Pk(e,r)}}function Pk(e,t){let n;for(n in t)if(kk.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Fk(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+eE({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eE({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+eE({start:t.start,end:t.end})+`) is still open`)}function Ik(e){let t=this;t.parser=n;function n(n){return Ak(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Lk(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Rk(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
68
|
+
`}]}function zk(e,t){let n=t.value?t.value+`
|
|
69
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Bk(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vk(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hk(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=cD(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Uk(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wk(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gk(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Kk(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gk(e,t);let i={src:cD(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function qk(e,t){let n={src:cD(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Jk(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Yk(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gk(e,t);let i={href:cD(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Xk(e,t){let n={href:cD(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Zk(e,t,n){let r=e.all(t),i=n?Qk(n):$k(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
70
70
|
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
71
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function
|
|
71
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Qk(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=$k(n[r])}return t}function $k(e){return e.spread??e.children.length>1}function eA(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function tA(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nA(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rA(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iA(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ZT(t.children[1]),o=XT(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function aA(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function oA(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var sA=9,cA=32;function lA(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(uA(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(uA(t.slice(i),i>0,!1)),a.join(``)}function uA(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===sA||t===cA;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===sA||t===cA;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function dA(e,t){let n={type:`text`,value:lA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fA(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var pA={blockquote:Lk,break:Rk,code:zk,delete:Bk,emphasis:Vk,footnoteReference:Hk,heading:Uk,html:Wk,imageReference:Kk,image:qk,inlineCode:Jk,linkReference:Yk,link:Xk,listItem:Zk,list:eA,paragraph:tA,root:nA,strong:rA,table:iA,tableCell:oA,tableRow:aA,text:dA,thematicBreak:fA,toml:mA,yaml:mA,definition:mA,footnoteDefinition:mA};function mA(){}var{defineProperty:hA}=Object,gA=typeof self==`object`?self:globalThis,_A=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new gA[e](t)},vA=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?hA(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof gA[e]==`function`?_A(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(_A(a,o),i)};return r},yA=e=>vA(new Map,e)(0),bA=``,{toString:xA}={},{keys:SA,is:CA}=Object,wA=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=xA.call(e).slice(8,-1);switch(n){case`Array`:return[1,bA];case`Object`:return[2,bA];case`Date`:return[3,bA];case`RegExp`:return[4,bA];case`Map`:return[5,bA];case`Set`:return[6,bA];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},TA=([e,t])=>e===0&&(t===`function`||t===`symbol`),EA=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=wA(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&CA(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of SA(o))(e||!TA(wA(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?bA:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(TA(wA(n))||TA(wA(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!TA(wA(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},DA=(e,{json:t,lossy:n}={})=>{let r=[];return EA(!(t||n),!!t,new Map,r)(e),r},OA=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?yA(DA(e,t)):structuredClone(e):(e,t)=>yA(DA(e,t));function kA(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function AA(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function jA(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||kA,r=e.options.footnoteBackLabel||AA,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=cD(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...OA(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
72
72
|
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
73
|
-
`}]}}var
|
|
73
|
+
`}]}}var MA=(function(e){if(e==null)return LA;if(typeof e==`function`)return IA(e);if(typeof e==`object`)return Array.isArray(e)?NA(e):PA(e);if(typeof e==`string`)return FA(e);throw Error(`Expected function, string, or object as test`)});function NA(e){let t=[],n=-1;for(;++n<e.length;)t[n]=MA(e[n]);return IA(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function PA(e){let t=e;return IA(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function FA(e){return IA(t);function t(t){return t&&t.type===e}}function IA(e){return t;function t(t,n,r){return!!(RA(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function LA(){return!0}function RA(e){return typeof e==`object`&&!!e&&`type`in e}function zA(e){return e}var BA=[];function VA(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=MA(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+zA(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=BA,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=HA(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function HA(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?BA:[e]}function UA(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),VA(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var WA={}.hasOwnProperty,GA={};function KA(e,t){let n=t||GA,r=new Map,i=new Map,a={all:s,applyData:JA,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...pA,...n.handlers},one:o,options:n,patch:qA,wrap:XA};return UA(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(WA.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=OA(n);return r.children=a.all(e),r}return OA(e)}return(a.options.unknownHandler||YA)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=ZA(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=ZA(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function qA(e,t){e.position&&(t.position=$T(e))}function JA(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,OA(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function YA(e,t){let n=t.data||{},r=`value`in t&&!(WA.call(n,`hProperties`)||WA.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function XA(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
74
74
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
75
75
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
76
|
-
`}),n}function
|
|
77
|
-
`},i)),a}function VA(e,t){return e&&`run`in e?async function(n,r){let i=BA(n,{file:r,...t});await e.run(i,r)}:function(n,r){return BA(n,{file:r,...e||t})}}function HA(e){if(e)throw e}var UA=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function WA(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function GA(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?KA(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function KA(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var qA={basename:JA,dirname:YA,extname:XA,join:ZA,sep:`/`};function JA(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ej(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function YA(e){if(ej(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function XA(e){ej(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function ZA(...e){let t=-1,n;for(;++t<e.length;)ej(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:QA(n)}function QA(e){ej(e);let t=e.codePointAt(0)===47,n=$A(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function $A(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function ej(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var tj={cwd:nj};function nj(){return`/`}function rj(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ij(e){if(typeof e==`string`)e=new URL(e);else if(!rj(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return aj(e)}function aj(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var oj=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],sj=class{constructor(e){let t;t=e?rj(e)?{path:e}:typeof e==`string`||dj(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:tj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<oj.length;){let e=oj[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)oj.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?qA.basename(this.path):void 0}set basename(e){lj(e,`basename`),cj(e,`basename`),this.path=qA.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?qA.dirname(this.path):void 0}set dirname(e){uj(this.basename,`dirname`),this.path=qA.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?qA.extname(this.path):void 0}set extname(e){if(cj(e,`extname`),uj(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=qA.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){rj(e)&&(e=ij(e)),lj(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?qA.basename(this.path,this.extname):void 0}set stem(e){lj(e,`stem`),cj(e,`stem`),this.path=qA.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new KT(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function cj(e,t){if(e&&e.includes(qA.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+qA.sep+"`")}function lj(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function uj(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function dj(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var fj=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),pj={}.hasOwnProperty,mj=new class e extends fj{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=GA()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,UA.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(_j(`data`,this.frozen),this.namespace[e]=t,this):pj.call(this.namespace,e)&&this.namespace[e]||void 0:e?(_j(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=bj(e),n=this.parser||this.Parser;return hj(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),hj(`process`,this.parser||this.Parser),gj(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=bj(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Sj(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),hj(`processSync`,this.parser||this.Parser),gj(`processSync`,this.compiler||this.Compiler),this.process(e,r),yj(`processSync`,`process`,t),n;function r(e,r){t=!0,HA(e),n=r}}run(e,t,n){vj(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=bj(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),yj(`runSync`,`run`,n),r;function i(e,t){HA(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=bj(t),r=this.compiler||this.Compiler;return gj(`stringify`,r),vj(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(_j(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,UA.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];WA(o)&&WA(r)&&(r=(0,UA.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function hj(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function gj(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function _j(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vj(e){if(!WA(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function yj(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function bj(e){return xj(e)?e:new sj(e)}function xj(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Sj(e){return typeof e==`string`||Cj(e)}function Cj(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var wj=[],Tj={allowDangerousHtml:!0},Ej=/^(https?|ircs?|mailto|xmpp)$/i,Dj=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Oj(e){let t=kj(e),n=Aj(e);return jj(t.runSync(t.parse(n),n),e)}function kj(e){let t=e.rehypePlugins||wj,n=e.remarkPlugins||wj,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Tj}:Tj;return mj().use(wk).use(n).use(VA,r).use(t)}function Aj(e){let t=e.children||``,n=new sj;return typeof t==`string`?n.value=t:``+t,n}function jj(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Mj;for(let e of Dj)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return jA(e,l),eE(e,{Fragment:q.Fragment,components:i,ignoreInvalidStyle:!0,jsx:q.jsx,jsxs:q.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in SE)if(Object.hasOwn(SE,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=SE[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Mj(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ej.test(e.slice(0,t))?e:``}function Nj(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Pj(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Fj(e,t,n){let r=bA((n||{}).ignore||[]),i=Ij(t),a=-1;for(;++a<i.length;)kA(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function Ij(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Lj(e[0]),Rj(e[1])])}return t}function Lj(e){return typeof e==`string`?new RegExp(Pj(e),`g`):e}function Rj(e){return typeof e==`function`?e:function(){return e}}var zj=`phrasing`,Bj=[`autolink`,`link`,`image`,`label`];function Vj(){return{transforms:[Yj],enter:{literalAutolink:Uj,literalAutolinkEmail:Wj,literalAutolinkHttp:Wj,literalAutolinkWww:Wj},exit:{literalAutolink:Jj,literalAutolinkEmail:qj,literalAutolinkHttp:Gj,literalAutolinkWww:Kj}}}function Hj(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:zj,notInConstruct:Bj},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:zj,notInConstruct:Bj},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:zj,notInConstruct:Bj}]}}function Uj(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Wj(e){this.config.enter.autolinkProtocol.call(this,e)}function Gj(e){this.config.exit.autolinkProtocol.call(this,e)}function Kj(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function qj(e){this.config.exit.autolinkEmail.call(this,e)}function Jj(e){this.exit(e)}function Yj(e){Fj(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Xj],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Zj]],{ignore:[`link`,`linkReference`]})}function Xj(e,t,n,r,i){let a=``;if(!eM(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Qj(n)))return!1;let o=$j(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Zj(e,t,n,r){return!eM(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Qj(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function $j(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Nj(e,`(`),a=Nj(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function eM(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||JE(n)||qE(n))&&(!t||n!==47)}uM.peek=lM;function tM(){this.buffer()}function nM(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function rM(){this.buffer()}function iM(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function aM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=LE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oM(e){this.exit(e)}function sM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=LE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cM(e){this.exit(e)}function lM(){return`[`}function uM(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function dM(){return{enter:{gfmFootnoteCallString:tM,gfmFootnoteCall:nM,gfmFootnoteDefinitionLabelString:rM,gfmFootnoteDefinition:iM},exit:{gfmFootnoteCallString:aM,gfmFootnoteCall:oM,gfmFootnoteDefinitionLabelString:sM,gfmFootnoteDefinition:cM}}}function fM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:uM},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
78
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?
|
|
79
|
-
`)}function
|
|
80
|
-
`&&!e.before&&!e.after&&
|
|
81
|
-
`}function
|
|
76
|
+
`}),n}function ZA(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function QA(e,t){let n=KA(e,t),r=n.one(e,void 0),i=jA(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
77
|
+
`},i)),a}function $A(e,t){return e&&`run`in e?async function(n,r){let i=QA(n,{file:r,...t});await e.run(i,r)}:function(n,r){return QA(n,{file:r,...e||t})}}function ej(e){if(e)throw e}var tj=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function nj(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rj(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?ij(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function ij(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var aj={basename:oj,dirname:sj,extname:cj,join:lj,sep:`/`};function oj(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);fj(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function sj(e){if(fj(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function cj(e){fj(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function lj(...e){let t=-1,n;for(;++t<e.length;)fj(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:uj(n)}function uj(e){fj(e);let t=e.codePointAt(0)===47,n=dj(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function dj(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function fj(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var pj={cwd:mj};function mj(){return`/`}function hj(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function gj(e){if(typeof e==`string`)e=new URL(e);else if(!hj(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return _j(e)}function _j(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var vj=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],yj=class{constructor(e){let t;t=e?hj(e)?{path:e}:typeof e==`string`||Cj(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:pj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<vj.length;){let e=vj[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)vj.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?aj.basename(this.path):void 0}set basename(e){xj(e,`basename`),bj(e,`basename`),this.path=aj.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?aj.dirname(this.path):void 0}set dirname(e){Sj(this.basename,`dirname`),this.path=aj.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?aj.extname(this.path):void 0}set extname(e){if(bj(e,`extname`),Sj(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=aj.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){hj(e)&&(e=gj(e)),xj(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?aj.basename(this.path,this.extname):void 0}set stem(e){xj(e,`stem`),bj(e,`stem`),this.path=aj.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new iE(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function bj(e,t){if(e&&e.includes(aj.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+aj.sep+"`")}function xj(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Sj(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Cj(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var wj=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Tj={}.hasOwnProperty,Ej=new class e extends wj{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=rj()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,tj.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(kj(`data`,this.frozen),this.namespace[e]=t,this):Tj.call(this.namespace,e)&&this.namespace[e]||void 0:e?(kj(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Mj(e),n=this.parser||this.Parser;return Dj(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Dj(`process`,this.parser||this.Parser),Oj(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Mj(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Pj(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Dj(`processSync`,this.parser||this.Parser),Oj(`processSync`,this.compiler||this.Compiler),this.process(e,r),jj(`processSync`,`process`,t),n;function r(e,r){t=!0,ej(e),n=r}}run(e,t,n){Aj(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Mj(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),jj(`runSync`,`run`,n),r;function i(e,t){ej(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Mj(t),r=this.compiler||this.Compiler;return Oj(`stringify`,r),Aj(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(kj(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,tj.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];nj(o)&&nj(r)&&(r=(0,tj.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Dj(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Oj(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function kj(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Aj(e){if(!nj(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function jj(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mj(e){return Nj(e)?e:new yj(e)}function Nj(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Pj(e){return typeof e==`string`||Fj(e)}function Fj(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ij=[],Lj={allowDangerousHtml:!0},Rj=/^(https?|ircs?|mailto|xmpp)$/i,zj=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Bj(e){let t=Vj(e),n=Hj(e);return Uj(t.runSync(t.parse(n),n),e)}function Vj(e){let t=e.rehypePlugins||Ij,n=e.remarkPlugins||Ij,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Lj}:Lj;return Ej().use(Ik).use(n).use($A,r).use(t)}function Hj(e){let t=e.children||``,n=new yj;return typeof t==`string`?n.value=t:``+t,n}function Uj(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Wj;for(let e of zj)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return UA(e,l),fE(e,{Fragment:q.Fragment,components:i,ignoreInvalidStyle:!0,jsx:q.jsx,jsxs:q.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in PE)if(Object.hasOwn(PE,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=PE[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Wj(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Rj.test(e.slice(0,t))?e:``}function Gj(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Kj(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function qj(e,t,n){let r=MA((n||{}).ignore||[]),i=Jj(t),a=-1;for(;++a<i.length;)VA(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function Jj(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Yj(e[0]),Xj(e[1])])}return t}function Yj(e){return typeof e==`string`?new RegExp(Kj(e),`g`):e}function Xj(e){return typeof e==`function`?e:function(){return e}}var Zj=`phrasing`,Qj=[`autolink`,`link`,`image`,`label`];function $j(){return{transforms:[sM],enter:{literalAutolink:tM,literalAutolinkEmail:nM,literalAutolinkHttp:nM,literalAutolinkWww:nM},exit:{literalAutolink:oM,literalAutolinkEmail:aM,literalAutolinkHttp:rM,literalAutolinkWww:iM}}}function eM(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Zj,notInConstruct:Qj},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Zj,notInConstruct:Qj},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Zj,notInConstruct:Qj}]}}function tM(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function nM(e){this.config.enter.autolinkProtocol.call(this,e)}function rM(e){this.config.exit.autolinkProtocol.call(this,e)}function iM(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function aM(e){this.config.exit.autolinkEmail.call(this,e)}function oM(e){this.exit(e)}function sM(e){qj(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cM],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,lM]],{ignore:[`link`,`linkReference`]})}function cM(e,t,n,r,i){let a=``;if(!fM(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!uM(n)))return!1;let o=dM(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function lM(e,t,n,r){return!fM(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function uM(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function dM(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Gj(e,`(`),a=Gj(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function fM(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||oD(n)||aD(n))&&(!t||n!==47)}SM.peek=xM;function pM(){this.buffer()}function mM(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function hM(){this.buffer()}function gM(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function _M(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=YE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vM(e){this.exit(e)}function yM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=YE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bM(e){this.exit(e)}function xM(){return`[`}function SM(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function CM(){return{enter:{gfmFootnoteCallString:pM,gfmFootnoteCall:mM,gfmFootnoteDefinitionLabelString:hM,gfmFootnoteDefinition:gM},exit:{gfmFootnoteCallString:_M,gfmFootnoteCall:vM,gfmFootnoteDefinitionLabelString:yM,gfmFootnoteDefinition:bM}}}function wM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:SM},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
78
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?EM:TM))),s(),o}}function TM(e,t,n){return t===0?e:EM(e,t,n)}function EM(e,t,n){return(n?``:` `)+e}var DM=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];MM.attention=NM,MM.peek=PM;function OM(){return{canContainEols:[`delete`],enter:{strikethrough:AM},exit:{strikethrough:jM}}}function kM(){return{handlers:{delete:MM},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:DM}]}}function AM(e){this.enter({type:`delete`,children:[],position:void 0},e)}function jM(e){this.exit(e)}function MM(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function NM(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function PM(){return`~`}function FM(e){return e.length}function IM(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||FM,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=LM(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=RM(r[d]);else{let e=RM(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
79
|
+
`)}function LM(e){return e==null?``:String(e)}function RM(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var zM=MA([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function BM(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),VM);return i(),o}function VM(e,t,n){return`>`+(n?``:` `)+e}function HM(e,t){return UM(e,t.inConstruct,!0)&&!UM(e,t.notInConstruct,!1)}function UM(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function WM(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
80
|
+
`&&!e.before&&!e.after&&HM(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
81
|
+
`}function GM(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function KM(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function qM(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function JM(e,t,n,r){let i=qM(n),a=e.value||``;if(KM(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,YM);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(GM(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
82
82
|
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
83
83
|
`),a&&(u+=o.move(a+`
|
|
84
|
-
`)),u+=o.move(s),c(),u}function
|
|
85
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function
|
|
84
|
+
`)),u+=o.move(s),c(),u}function YM(e,t,n){return(n?``:` `)+e}function XM(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ZM(e,t,n,r){let i=XM(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
85
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function QM(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}$M.attention=eN,$M.peek=tN;function $M(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function eN(e,t){return{construct:`emphasis`,markers:QM(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function tN(e,t,n){return n.options.emphasis||`*`}function nN(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function rN(e,t){let n=!1;return UA(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&IE(e)&&(t.options.setext||n))}function iN(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(rN(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
86
86
|
`,after:`
|
|
87
87
|
`});return r(),t(),o+`
|
|
88
88
|
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
89
89
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
90
|
-
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=
|
|
90
|
+
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=nN(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}aN.peek=oN;function aN(e){return e.value||``}function oN(){return`<`}sN.peek=cN;function sN(e,t,n,r){let i=XM(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function cN(){return`!`}lN.peek=uN;function lN(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function uN(){return`!`}dN.peek=fN;function dN(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function fN(){return"`"}function pN(e,t){let n=IE(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}mN.peek=hN;function mN(e,t,n,r){let i=XM(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(pN(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function hN(e,t,n){return pN(e,n)?`<`:`[`}gN.peek=_N;function gN(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function _N(){return`[`}function vN(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yN(e){let t=vN(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bN(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function xN(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function SN(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?bN(n):vN(n),s=e.ordered?o===`.`?`)`:`.`:yN(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),xN(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function CN(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wN(e,t,n,r){let i=CN(n),a=n.bulletCurrent||vN(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function TN(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function EN(e,t,n,r){if(!e.children.some(function(e){return zM(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function DN(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ON.attention=kN,ON.peek=AN;function ON(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function kN(e,t){return{construct:`strong`,markers:DN(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function AN(e,t,n){return n.options.strong||`*`}function jN(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function MN(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function NN(e,t,n){let r=(xN(n)+(n.options.ruleSpaces?` `:``)).repeat(MN(n));return n.options.ruleSpaces?r.slice(0,-1):r}var PN={blockquote:BM,break:WM,code:JM,definition:ZM,emphasis:$M,hardBreak:WM,heading:iN,html:aN,image:sN,imageReference:lN,inlineCode:dN,link:mN,linkReference:gN,list:SN,listItem:wN,paragraph:TN,root:EN,strong:ON,text:jN,thematicBreak:NN};function FN(){return{enter:{table:IN,tableData:BN,tableHeader:BN,tableRow:RN},exit:{codeText:VN,table:LN,tableData:zN,tableHeader:zN,tableRow:zN}}}function IN(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function LN(e){this.exit(e),this.data.inTable=void 0}function RN(e){this.enter({type:`tableRow`,children:[]},e)}function zN(e){this.exit(e)}function BN(e){this.enter({type:`tableCell`,children:[]},e)}function VN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,HN));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function HN(e,t){return t===`|`?t:e}function UN(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
91
91
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
92
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return wM(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=SN.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function MN(){return{exit:{taskListCheckValueChecked:PN,taskListCheckValueUnchecked:PN,paragraph:FN}}}function NN(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:IN}}}function PN(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function FN(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function IN(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=SN.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function LN(){return[Vj(),dM(),gM(),CN(),MN()]}function RN(e){return{extensions:[Hj(),fM(e),_M(),jN(e),NN()]}}var zN={tokenize:$N,partial:!0},BN={tokenize:eP,partial:!0},VN={tokenize:tP,partial:!0},HN={tokenize:nP,partial:!0},UN={tokenize:rP,partial:!0},WN={name:`wwwAutolink`,tokenize:ZN,previous:iP},GN={name:`protocolAutolink`,tokenize:QN,previous:aP},KN={name:`emailAutolink`,tokenize:XN,previous:oP},qN={};function JN(){return{text:qN}}for(var YN=48;YN<123;)qN[YN]=KN,YN++,YN===58?YN=65:YN===91&&(YN=97);qN[43]=KN,qN[45]=KN,qN[46]=KN,qN[95]=KN,qN[72]=[KN,GN],qN[104]=[KN,GN],qN[87]=[KN,WN],qN[119]=[KN,WN];function XN(e,t,n){let r=this,i,a;return o;function o(t){return!sP(t)||!oP.call(r,r.previous)||cP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return sP(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(UN,u,l)(t):t===45||t===95||zE(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&RE(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ZN(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!iP.call(r,r.previous)||cP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(zN,e.attempt(BN,e.attempt(VN,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function QN(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&aP.call(r,r.previous)&&!cP(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(RE(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||VE(t)||GE(t)||JE(t)||qE(t)?n(t):e.attempt(BN,e.attempt(VN,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function $N(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function eP(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(HN,c,s)(t):t===null||GE(t)||JE(t)||t!==45&&qE(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function tP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(HN,t,a)(o):o===null||GE(o)||JE(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function nP(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||GE(o)||JE(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||GE(e)||JE(e)?t(e):r(e)}function a(e){return RE(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):RE(t)?(e.consume(t),o):n(t)}}function rP(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return zE(e)?n(e):t(e)}}function iP(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||GE(e)}function aP(e){return!RE(e)}function oP(e){return!(e===47||sP(e))}function sP(e){return e===43||e===45||e===46||e===95||zE(e)}function cP(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var lP={tokenize:_P,partial:!0};function uP(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:mP,continuation:{tokenize:hP},exit:gP}},text:{91:{name:`gfmFootnoteCall`,tokenize:pP},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:dP,resolveTo:fP}}}}function dP(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=LE(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function fP(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function pP(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||GE(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(LE(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return GE(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function mP(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||GE(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=LE(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return GE(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),ZE(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function hP(e,t,n){return e.check(hD,t,e.attempt(lP,t,n))}function gP(e){e.exit(`gfmFootnoteDefinition`)}function _P(e,t,n){let r=this;return ZE(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function vP(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&AE(o,o.length,0,cD(s,e.slice(r+1,n),t)),AE(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),AE(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=sD(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=sD(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var yP=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){bP(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function bP(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function xP(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function SP(){return{flow:{null:{name:`table`,tokenize:CP,resolveAll:wP}}}}function CP(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):KE(t)?ZE(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||GE(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,KE(t)?ZE(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return KE(t)?ZE(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return KE(t)?ZE(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):KE(n)?ZE(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||GE(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function wP(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new yP;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(EP(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=TP(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=TP(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=TP(f,t,o,i,n,d)):(o[0]=o[1],d=TP(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&EP(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=xP(t.events,n))}return e}function TP(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},DP(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=DP(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=DP(t.events,n[2]),a=DP(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},DP(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function EP(e,t,n,r,i){let a=[],o=DP(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function DP(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var OP={name:`tasklistCheck`,tokenize:AP};function kP(){return{text:{91:OP}}}function AP(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return GE(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):KE(r)?e.check({tokenize:jP},t,n)(r):n(r)}}function jP(e,t,n){return ZE(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function MP(e){return NE([JN(),uP(),vP(e),SP(),kP()])}var NP={};function PP(e){let t=this,n=e||NP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(MP(n)),a.push(LN()),o.push(RN(n))}var FP={path:`M82 352.8h521.8l181.3.2 8.4.3h2.4A14 14 0 0 1 807 358c2.2 3.9 2.3 7.5 2.4 11.9.4 6 .7 9.6 4.6 14.1 7 3.4 13.2 3.4 20.8 3.3h22.8l28.4-.3h3.8l51.2-1h3.4q112.6-2.8 224.8-15.1l3.4-.4 6.4-.7c14.4-1.6 14.4-1.6 19 .7 2.1 2.7 3 4.6 3.3 8.1-1 9.3-7 17.9-12.3 25.4l-2 2.8a224 224 0 0 1-21 24.2l-2.3 2.4a174 174 0 0 1-20 17.4C1071 510.9 971 540.2 855.3 566.6c-70.4 16-70.4 16-97.3 36.4l-2.5 1.8A100 100 0 0 0 715 677l-.2 3c-.8 32.3 13 61.3 34.2 85l1.9 2.1c31.3 33.5 80.1 49.2 122.7 61.7l6.7 2 3.5 1A31 31 0 0 1 899 844l1.9 4.8 1 3 1.1 3.2 1.3 3.6 6.7 19.6 1.1 3.5a17 17 0 0 1-.2 12c-3 3.7-6.7 5-11.4 5.6h-514l-28.5-.1H227.8c-18-.1-18-.1-23-3.1-2.9-3.3-3-5.5-3-9.8a49 49 0 0 1 3.5-13.8l4.3-13.1c3.6-11.1 7.5-20.8 18.2-26.8 5-2.2 10.4-3.5 15.7-4.8 44-12 87.7-29.3 121.5-60.8l2.5-2.2c21.2-20 33.5-49.3 34.8-78.3.6-27.7-8.4-53.3-26.3-74.5l-2.5-3c-10.3-12-23-20.9-36.5-29l-1.8-1.1c-29.6-18.1-64.5-26.8-97.5-36.6l-3-.9-14-4.1-5.2-1.5-2.2-.6A34 34 0 0 1 193 521a267 267 0 0 1-9.8-23.3l-1.4-3.6c-2.2-3.7-4-5.1-7.8-7.1-5.2-1.2-10.3-1.2-15.6-1.2l-46.8-.7-32.7-.5h-2.7a24 24 0 0 1-17.6-7c-3.8-6.2-3.9-12.3-3.9-19.4v-33l-.1-49.8c0-6.9.9-13.7 5.7-18.8 7-4 13.7-3.9 21.6-3.8`,viewBox:`31 329 1194 594`,bounds:{x:55,y:353,width:1146,height:546}},IP=K.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Nh({disabled:i,focusableWhenDisabled:a,native:o});return am(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),LP=py(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-[13px] font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-7 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`outline`,size:`default`}});function RP(e){return K.isValidElement(e)}function zP({className:e,variant:t=`outline`,size:n=`default`,render:r,...i}){if(RP(r)&&r.type!==`button`){let{nativeButton:a,focusableWhenDisabled:o,children:s,...c}=i;return K.cloneElement(r,{...c,"data-slot":`button`,className:J(LP({variant:t,size:n,className:e}),typeof r.props.className==`string`?r.props.className:void 0)},...s===void 0?[]:[s])}return(0,q.jsx)(IP,{"data-slot":`button`,className:J(LP({variant:t,size:n,className:e})),render:r,...i})}var BP=`data-valid`,VP=`data-invalid`,HP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},UP={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},WP={valid(e){return e===null?null:e?{[BP]:``}:{[VP]:``}}},GP={invalid:void 0,name:void 0,validityData:{state:HP,errors:[],error:``,value:``,initialValue:null},setValidityData:zp,disabled:void 0,setTouched:zp,setDirty:zp,setFilled:zp,setFocused:zp,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:UP,registerFieldControl:zp,validation:{getValidationProps:(e,t=Vp)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:zp,getInputControl:()=>null,commit:async()=>{},change:zp}},KP=K.createContext(GP);function qP(e=!0){let t=K.useContext(KP);if(t.setValidityData===zp&&!e)throw Error(Sm(28));return t}var JP=K.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:zp,validationMode:`onSubmit`,submitCountRef:{current:0}});function YP(){return K.useContext(JP)}var XP=K.createContext({controlId:void 0,registerControlId:zp,resetControlId:zp,labelId:void 0,setLabelId:zp,messageIds:[],setMessageIds:zp,getDescriptionProps:e=>e});function ZP(){return K.useContext(XP)}function QP(e,t,n,r=!0,i,a){let[o,s]=K.useState(),c=Oh(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return Y(()=>{let i=e||t||l||!r?void 0:$P(n.current,c);o!==i&&s(i)}),u}function $P(e,t){let n=eF(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function eF(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function tF(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=ZP(),o=Oh(),s=wp(()=>Symbol()),c=K.useRef(!1),l=K.useRef(!1),u=X(()=>{c.current&&i!==zp&&(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===zp){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}var nF=K.createContext({disabled:!1});function rF(){return K.useContext(nF)}function iF(e,t,n){let{setFocused:r,focusOwnerRef:i}=qP(),a=X(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Y(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function aF(e,t,n,r,i=!0,a){let{registerFieldControl:o}=qP(),s=wp(()=>Symbol());Y(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function oF(e,t){let n=K.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var sF=K.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=qP(),{clearErrors:S,elementRef:C,submitCountRef:w}=YP(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=ZP(),k=tF({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=X(()=>x.inputRef.current?.value);aF(x.inputRef,k,j,M,!T,a),Y(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),oF(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=K.useRef(null),P=iF(T,N),F=cb();return am(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=Dm(km,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:WP})}),cF=K.forwardRef(function(e,t){return(0,q.jsx)(sF,{ref:t,...e})});function lF({className:e,type:t,...n}){return(0,q.jsx)(cF,{type:t,"data-slot":`input`,className:J(`h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-[13px] dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function uF({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:J(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function dF({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:J(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var fF=py(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function pF({className:e,align:t=`inline-start`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:J(fF({align:t}),e),onClick:e=>{e.target instanceof Element&&e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var mF=py(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function hF({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,q.jsx)(zP,{type:t,"data-size":r,variant:n,className:J(mF({size:r}),e),...i})}function gF({className:e,...t}){return(0,q.jsx)(lF,{"data-slot":`input-group-control`,className:J(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function _F({className:e,...t}){return(0,q.jsx)(uF,{"data-slot":`input-group-control`,className:J(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function vF({className:e,...t}){return(0,q.jsx)(`label`,{"data-slot":`label`,className:J(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var yF=K.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return am(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function bF({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(yF,{"data-slot":`separator`,orientation:t,className:J(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}function xF({className:e,...t}){return(0,q.jsx)(`fieldset`,{"data-slot":`field-set`,className:J(`flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function SF({className:e,variant:t=`legend`,...n}){return(0,q.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:J(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n})}var CF=py(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function wF({className:e,orientation:t=`vertical`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:J(CF({orientation:t}),e),...n})}function TF({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`field-content`,className:J(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,e),...t})}function EF({className:e,...t}){return(0,q.jsx)(vF,{"data-slot":`field-label`,className:J(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function DF({className:e,...t}){return(0,q.jsx)(`p`,{"data-slot":`field-description`,className:J(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function OF({className:e,children:t,errors:n,...r}){let i=(0,K.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,q.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,q.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,q.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:J(`text-sm font-normal text-destructive`,e),...r,children:i}):null}var kF={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},AF={...kF,position:`fixed`,margin:0,top:0,left:0},jF={...kF,position:`absolute`};function MF(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var NF=`data-checked`,PF=`data-unchecked`;function FF(e){return{checked(t){return e.indeterminate?{}:t?{[NF]:``}:{[PF]:``}},...WP}}var IF=K.createContext(void 0);function LF(){return K.useContext(IF)}var RF=K.createContext(void 0);function zF(){let e=K.useContext(RF);if(e===void 0)throw Error(Sm(14));return e}var BF=`data-parent`,VF=K.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:b,...x}=e,{clearErrors:S}=YP(),{disabled:C,name:w,setDirty:T,setFilled:E,setTouched:D,state:O,validationMode:k,validityData:A,validation:j}=qP(),M=rF(),{labelId:N,registerControlId:P,getDescriptionProps:F}=ZP(),I=LF(),L=I?.allValues===void 0?void 0:I.parent,R=L!==void 0,z=C||M.disabled||I?.disabled||o,B=w??d,ee=v??B,te=Oh(),ne=I?.registerControlId!==P,re=tF({id:c||void 0,enabled:ne}),ie=y?re:te,ae={};R&&(p?ae=L.getParentProps():ee!==void 0&&(ae=L.getChildProps(ee)));let{checked:oe=n,indeterminate:se=l,onCheckedChange:ce,...le}=ae,ue=I?.value,de=K.useRef(null),fe=iF(z,de),{getButtonProps:pe,buttonRef:me}=Nh({disabled:z,native:y}),he=I?.validation??j,[V,ge]=xp({controlled:ee!==void 0&&ue!==void 0&&!p?ue.includes(ee):oe,default:i,name:`Checkbox`,state:`checked`}),_e=R?!!oe:V,ve=R&&se||l;aF(de,te,V,void 0,!I&&!z,d);let ye=L?.registerChildId,be=K.useRef(null),xe=he.registerInput,Se=I?ee:void 0,Ce=K.useCallback(e=>xe(e,{controlRef:de,value:Se}),[xe,Se]),we=kp(u,be,p?void 0:Ce),Te=QP(a,N,be,!y,re,x[`aria-label`]);Y(()=>{be.current&&(be.current.indeterminate=ve),I||E(V)},[V,ve,I,E]),oF(V,()=>{I||(S(B),T(V!==A.initialValue),he.change(V))});let Ee=Kp({checked:V,disabled:z,form:s,name:p?void 0:B,id:y?void 0:re,required:g,ref:we,style:B?jF:AF,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=Dm(km,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(ce?.(t,n),!n.isCanceled&&(ge(t),ee!==void 0&&I!==void 0&&!p&&!R))){let e=t?[...I.value,ee]:I.value.filter(e=>e!==ee);I.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){de.current?.focus()}},v===void 0?Vp:{value:(I?V&&v:v)||``},F,e=>he.getValidationProps(z,e));K.useEffect(()=>{if(!L||ee===void 0)return;let e=L.disabledStatesRef.current;return e.set(ee,z),()=>{e.delete(ee)}},[L,z,ee]);let De=K.useMemo(()=>({...O,checked:_e,disabled:z,readOnly:m,required:g,indeterminate:ve}),[O,_e,z,m,g,ve]),Oe=FF(De),ke=am(`span`,e,{state:De,ref:[me,de,t],props:[{id:ie,role:`checkbox`,"aria-checked":ve?`mixed`:_e,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Te,[BF]:p?``:void 0,onFocus(){fe(!0)},onBlur(){let e=be.current;e&&(D(!0),fe(!1),k===`onBlur`&&he.commit(I?ue:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=be.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),$m(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||MF(t)?.click()})},onClick(e){if(m||z)return;e.preventDefault();let t=be.current;t&&Mh(t,e)}},x,le,pe,F,e=>he.getValidationProps(z,e)],stateAttributesMapping:Oe}),Ae=ke.props.id;return Y(()=>{if(ye&&!p&&ee!==void 0&&Ae!==void 0)return ye(ee,Ae)},[ye,p,ee,Ae]),(0,q.jsxs)(RF.Provider,{value:De,children:[ke,!V&&!I&&B&&!p&&_!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,form:s,name:B,value:_,disabled:z}),(0,q.jsx)(`input`,{...Ee,suppressHydrationWarning:!0})]})}),HF=K.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=zF(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=zv(c),f=K.useRef(null),p={...s,transitionStatus:u};Rv({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...FF(s),...mg},h=a||l,g=am(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function UF({className:e,...t}){return(0,q.jsx)(VF,{"data-slot":`checkbox`,className:J(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,q.jsx)(HF,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none data-checked:animate-in data-checked:zoom-in-50 data-checked:duration-150 motion-reduce:animate-none [&>svg]:size-3.5`,children:t.indeterminate?(0,q.jsx)(yf,{}):(0,q.jsx)(Hd,{})})})}function WF(e){let t=K.useRef(!0);t.current&&(t.current=!1,e())}function GF(e){let[t,n]=K.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function KF(e){let t=wp(qF,e).current;return t.next=e,Y(t.effect),t}function qF(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var JF=[],YF=void 0;function XF(){return YF}function ZF(e){JF.push(e)}function QF(e){let t=(t,n)=>{let r=wp(eI).current,i;try{YF=r;for(let e of JF)e.before(r);i=e(t,n);for(let e of JF)e.after(r);r.didInitialize=!0}finally{YF=void 0}return i};return t.displayName=e.displayName||e.name,t}function $F(e){return K.forwardRef(QF(e))}function eI(){return{didInitialize:!1}}var tI=Ip(19)?iI:aI;function nI(e,t,n,r,i){return tI(e,t,n,r,i)}function rI(e,t,n,r,i){let a=K.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,$_.useSyncExternalStore)(e.subscribe,a,a)}ZF({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,$_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function iI(e,t,n,r,i){let a=XF();if(!a)return rI(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 aI(e,t,n,r,i){return(0,zw.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var oI=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 nI(this,e,t,n,r)}},sI=class extends oI{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){K.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){K.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{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 K.useDebugValue(e),nI(this,this.selectors[e],t,n,r)}useContextCallback(e,t){K.useDebugValue(e);let n=X(t??zp);this.context[e]=n}useStateSetter(e){let t=K.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)}})}};function cI(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function lI(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function uI(e,t){return t!=null&&!Wg(t)?0:typeof e==`function`?e():e}function dI(e,t,n){let r=uI(e,n);return typeof r==`number`?r:r?.[t]}function fI(e){return typeof e==`function`?e():e}function pI(e,t){return t||e===`click`||e===`mousedown`}function mI(e){return e?.includes(`mouse`)&&e!==`mousedown`}var hI=K.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new sb,currentIdRef:{current:null},currentContextRef:{current:null}});function gI(e,t){e.current=t.current}function _I(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=K.useRef(n),a=K.useRef(n),o=K.useRef(null),s=K.useRef(null),c=cb();return Y(()=>{a.current=n,o.current?i.current={open:dI(i.current,`open`),close:dI(n,`close`)}:i.current=n},[n,o,i,a]),(0,q.jsx)(hI.Provider,{value:K.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function vI(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=K.useContext(hI),[d,f]=K.useState(!1),p=K.useRef(n);return Y(()=>{p.current=n},[n]),Y(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),Y(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:dI(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,Dm(km))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),Y(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,gI(a,s),u.clear()}},[c,i,a,r,s,u]),K.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}var yI=K.forwardRef(function(e,t){let[n,r]=K.useState();Y(()=>{$h&&Qh&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:AF,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function bI(e){return`data-base-ui-${e}`}var xI=0;function SI(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(xI);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),zp;let o=requestAnimationFrame(a);return xI=o,()=>{xI===o&&(cancelAnimationFrame(o),xI=0)}}var CI=`data-base-ui-inert`,wI=new WeakMap,TI=new WeakSet,EI=new WeakMap,DI=0;function OI(e){return e?ih(e)?e.host:OI(e.parentNode):null}var kI=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=OI(t);return e.contains(n)?n:null}).filter(e=>e!=null),AI=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},jI=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Qm(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function MI(e,t,n,{mark:r=!0}){let i=kI(t,e),a=r?jI(t,AI(i),new Set(i)):[],o=[],s=[];if(n){let e=kI(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);jI(t,AI(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(wI.get(e)||0)+1;wI.set(e,r),o.push(e),r===1&&n&&TI.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(EI.get(e)||0)+1;EI.set(e,t),s.push(e),t===1&&e.setAttribute(CI,``)}),DI+=1,()=>{o.forEach(e=>{let t=(wI.get(e)||0)-1;wI.set(e,t),t||(TI.has(e)||e.removeAttribute(`aria-hidden`),TI.delete(e))}),r&&s.forEach(e=>{let t=(EI.get(e)||0)-1;EI.set(e,t),t||e.removeAttribute(CI)}),--DI,DI||(wI=new WeakMap,TI=new WeakSet,EI=new WeakMap)}}function NI(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Sh(e[0]).body;return MI(e,i,n,{mark:r})}var PI={style:{transition:`none`}},FI=`data-base-ui-click-trigger`,II={fallbackAxisSide:`none`},LI={fallbackAxisSide:`end`},RI={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zI=K.createContext(null),BI=()=>K.useContext(zI),VI=bI(`portal`);function HI(e={}){let{ref:t,container:n,componentProps:r=Vp,elementProps:i}=e,a=Dh(),o=BI()?.portalNode,[s,c]=K.useState(null),[l,u]=K.useState(null),d=X(e=>{e!==null&&u(e)}),f=K.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(th(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=am(`div`,r,{ref:[t,d],props:[{id:a,[VI]:``},i]}),m=s&&p?Pc.createPortal(p,s):null;return{node:l,nodeId:K.isValidElement(p)?p.props.id:void 0,subtree:m}}var UI=K.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}=HI({container:o,ref:t,componentProps:e,elementProps:c}),f=K.useRef(null),p=K.useRef(null),m=K.useRef(null),h=K.useRef(null),[g,_]=K.useState(null),v=K.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;K.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&q_(e)&&(e.type===`focusin`?v.current&&=(Y_(l),!1):(J_(l),v.current=!0))}return cI(lI(l,`focusin`,e,!0),lI(l,`focusout`,e,!0))},[l,y]),Y(()=>{l&&b===!0&&v.current&&(Y_(l),v.current=!1)},[b,l]);let S=K.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,q.jsxs)(K.Fragment,{children:[d,(0,q.jsxs)(zI.Provider,{value:S,children:[x&&l&&(0,q.jsx)(yI,{"data-type":`outside`,ref:f,onFocus:e=>{q_(e,l)?m.current?.focus():G_(g?g.domReference:null)?.focus()}}),x&&l&&(0,q.jsx)(`span`,{role:s,"aria-owns":u,style:RI}),l&&Pc.createPortal(a,l),x&&l&&(0,q.jsx)(yI,{"data-type":`outside`,ref:p,onFocus:e=>{q_(e,l)?h.current?.focus():(W_(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Dm(`focus-out`,e.nativeEvent)))}})]})]})});function WI(){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 GI=class{nodesRef={current:[]};events=WI();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)}},KI=K.createContext(null),qI=K.createContext(null),JI=()=>K.useContext(KI)?.id||null,YI=e=>{let t=K.useContext(qI);return e??t};function XI(e){let t=Dh(),n=YI(e),r=JI();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ZI(e){let{children:t,id:n}=e,r=JI();return(0,q.jsx)(KI.Provider,{value:K.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function QI(e){let{children:t,externalTree:n}=e,r=wp(()=>n??new GI).current;return(0,q.jsx)(qI.Provider,{value:r,children:t})}function $I(e,t){let n=$m(rg(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Hg(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var eL=20,tL=[];function nL(){tL=tL.filter(e=>e.deref()?.isConnected)}function rL(e){nL(),e&&Qm(e)!==`body`&&(tL.push(new WeakRef(e)),tL.length>eL&&(tL=tL.slice(-20)))}function iL(){return nL(),tL[tL.length-1]?.deref()}function aL(e){return e?B_(e)?e:H_(e)[0]||e:null}function oL(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=V_(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return B_(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 sL(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=X(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Fg(_)&&S,w=KF(i),T=KF(a),E=KF(o),D=KF(u),O=KF(g),k=YI(m),A=BI(),j=K.useRef(!1),M=K.useRef(!1),N=K.useRef(!1),P=K.useRef(null),F=K.useRef(``),I=K.useRef(``),L=K.useRef(null),R=K.useRef(null),z=kp(L,p,A?.beforeInsideRef),B=kp(R,A?.afterInsideRef),ee=cb(),te=cb(),ne=Mv(),re=A!=null,ie=Lg(v),ae=X((e=ie)=>e?H_(e):[]),oe=X(()=>h?.().filter(e=>e!=null)??[]);K.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(ie,tg(Sh(ie)))&&ae().length===0&&!C&&Bg(e)}return lI(Sh(ie),`keydown`,e)},[r,ie,c,C,ae]),K.useEffect(()=>{if(r||!g)return;let e=Sh(ie);function t(){N.current=!1}function n(e){let t=rg(e),n=oe(),r=Z(v,t)||Z(_,t)||Z(A?.portalNode,t)||n.some(e=>e===t||Z(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,ng(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,te.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return cI(lI(e,`pointerdown`,n,!0),lI(e,`pointerup`,t,!0),lI(e,`pointercancel`,t,!0),lI(e,`keydown`,i,!0),t)},[r,v,_,ie,g,A,te,oe]),K.useEffect(()=>{if(r||!l)return;let e=Sh(ie);function n(){M.current=!0,te.start(0,()=>{M.current=!1})}function i(e){let t=rg(e);B_(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=rg(n);c&&r==null&&a!=null&&Z(v,a)&&rL(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=oe(),p=r?.hasAttribute(bI(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Nv(f),Nv(d)].includes(r),m=!(Z(_,r)||Z(v,r)||Z(r,v)||Z(A?.portalNode,r)||u.some(e=>e===r||Z(e,r))||l.hasMatchingElement(e=>Z(e,r))||p||k&&(Rg(k.nodesRef.current,o).find(e=>Z(e.context?.elements.floating,r)||Z(e.context?.elements.domReference,r))||zg(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,Lg(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&ie&&oL(ie),s&&i!==_&&!E_(a)&&tg(e)===e.body){if(rh(ie)&&(ie.focus(),s===`popup`)){ne.request(()=>{ie.focus()});return}let e=ae(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ie;rh(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==iL())&&(j.current=!0,t.setOpen(!1,Dm(Im,n)))})}function o(){N.current||(b.current.insideReactTree=!0,ee.start(0,()=>{b.current.insideReactTree=!1}))}let u=rh(_)?_:null;if(v||u)return cI(u&&lI(u,`focusout`,a),u&&lI(u,`pointerdown`,n),v&&lI(v,`focusin`,i),v&&lI(v,`focusout`,a),v&&A&&lI(v,`focusout`,o,!0))},[r,_,v,ie,c,k,A,t,l,s,ae,C,x,b,ee,te,ne,d,f,oe]),K.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${bI(`portal`)}]`)||[]),t=(k?zg(k.nodesRef.current,x()):[]).find(e=>Fg(e.context?.elements.domReference||null))?.context?.elements.domReference,n=NI([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...oe(),t,Nv(f),Nv(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=NI([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,oe]),Y(()=>{if(!g||r||!rh(ie))return;F.current=``,I.current=``;let e=Sh(ie),t=tg(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Z(ie,t))return;let i=null,a=()=>(i??=ae(ie),i[0]||ie),o;o=r===!0||r===null?a():Nv(r),o||=a();let s=Z(ie,tg(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&Hg(c);SI(o,{sync:l,preventScroll:o===ie,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=tg(e);return!(t!==o&&Z(ie,t))}})})},[r,g,ie,ae,w,D,O,b]);let se=K.useRef(null);Y(()=>{if(r||!ie){se.current=null;return}se.current&&=(se.current.cancelled=!0,null);let e=Sh(ie),t=tg(e),n=D.current==null;rL(t);function i(e){if(e.open||(F.current=$I(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(bI(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Hg(e.nativeEvent)||Ug(e.nativeEvent))j.current=!1;else{let e=!1;Sh(ie).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Qm(t)!==`body`?t:null,s=n?o||a:a||o;return s||=iL()||null,typeof i==`boolean`?s:Nv(i)||s||null}return()=>{y.off(`openchange`,i);let t=tg(e),n=oe(),r=Z(v,t)||n.some(e=>e===t||Z(e,t))||k&&Rg(k.nodesRef.current,x(),!1).some(e=>Z(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};se.current=l,queueMicrotask(()=>{se.current===l&&(se.current=null);let n=aL(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&rh(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,ie,T,E,D,y,k,_,x,oe]),Y(()=>{if(!Qh||g||!v)return;let e=tg(Sh(v));rh(e)&&Ng(e)&&Z(v,e)&&e.blur()},[g,v]),Y(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),Y(()=>{if(!r&&ie)return oL(ie),()=>{queueMicrotask(nL)}},[r,ie]);let ce=!r&&(!c||!C)&&(re||c);return(0,q.jsxs)(K.Fragment,{children:[ce&&(0,q.jsx)(yI,{"data-type":`inside`,ref:z,onFocus:e=>{if(c){let e=ae();SI(e[e.length-1])}else A?.portalNode&&(j.current=!1,q_(e,A.portalNode)?W_(_)?.focus():Nv(f??A.beforeOutsideRef)?.focus())}}),n,ce&&(0,q.jsx)(yI,{"data-type":`inside`,ref:B,onFocus:e=>{c?SI(ae()[0]):A?.portalNode&&(l&&(j.current=!0),q_(e,A.portalNode)?G_(_)?.focus():Nv(d??A.afterOutsideRef)?.focus())}})]})}function cL(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Am}=t,l=e.context.dataRef,u=K.useRef(void 0),d=Mv(),f=cb(),p=K.useMemo(()=>{function t(t,n,r,i){let a=Dm(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Wg(e.pointerType,!0)&&Ug(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Wg(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=rg(s),p=Ng(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;r===`mousedown`&&o?u.current=void 0:Wg(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return K.useMemo(()=>n?{reference:p}:Vp,[n,p])}function lL(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function uL(e){return e!=null&&e.clientX!=null}function dL(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=K.useRef(!1),l=K.useRef(null),[u,d]=K.useState(),[f,p]=K.useState([]),m=X(t=>{e.set(`positionReference`,t)}),h=X((t,n,i)=>{c.current||(!s.current.openEvent||uL(s.current.openEvent))&&e.set(`positionReference`,lL(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=X(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=Wg(u)?a:i;K.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=$m(a);function r(t){let n=rg(t);Z(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||uL(s.current.openEvent)?l.current=lI(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),K.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),K.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),K.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=K.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return K.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function fL(){return!1}function pL(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function mL(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=fL,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=YI(c),m=X(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=X(()=>a),{escapeKey:v,outsidePress:y}=pL(s),b=K.useRef(!1),x=K.useRef(!1),S=K.useRef(!1),C=K.useRef(!1),w=K.useRef(!1),T=K.useRef(``),E=K.useRef(null),D=cb(),O=cb(),k=cb(),A=X(()=>{O.clear(),d.current.insideReactTree=!1}),j=X(e=>{let t=d.current.floatingContext?.nodeId;return(p?Rg(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=X(t=>jg(t,e.select(`floatingElement`))||jg(t,e.select(`domReferenceElement`))),N=X(t=>{o()&&e.setOpen(!1,Dm(Am,t.nativeEvent))}),P=X(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Vg(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=Dm(Lm,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=X(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=X(t=>{if(!l||!n||t.button!==0)return;let r=rg(t.nativeEvent);Z(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=X(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});K.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),K.useEffect(()=>A,[A]),K.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new sb,i=Sh(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(Qh?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&Rg(p.nodesRef.current,t).some(t=>jg(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=rg(n),i=`[${bI(`inert`)}]`,a=nh(r)?r.getRootNode():null,o=Array.from((ih(a)?a:Sh(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z(e,r))))return;let c=nh(r)?r:null;for(;c&&!hh(c);){let e=vh(c);if(hh(e)||!nh(e))break;c=e}if(!(o.length&&nh(r)&&!Mg(r)&&!Z(r,e.select(`floatingElement`))&&o.every(e=>!Z(c,e)))){if(rh(r)&&!(`touches`in n)){let e=hh(r),t=gh(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!Hg(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}(typeof h!=`function`||h(n))&&(j(`__outsidePressBubbles`)||(e.setOpen(!1,Dm(Nm,n)),A()))}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=rg(e);if(!n)return;let r=lI(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function z(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function B(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function ee(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function te(e){L(e,ee)}function ne(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function re(e){L(e,ne)}let ie=cI(r&&cI(lI(i,`keydown`,P),lI(i,`compositionstart`,a),lI(i,`compositionend`,o)),g&&cI(lI(i,`click`,z,!0),lI(i,`pointerdown`,z,!0),lI(i,`pointerup`,B,!0),lI(i,`pointercancel`,B,!0),lI(i,`mousedown`,z,!0),lI(i,`mouseup`,B,!0),lI(i,`touchstart`,R,{capture:!0,passive:!0}),lI(i,`touchmove`,te,{capture:!0,passive:!0}),lI(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{ie(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=K.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=K.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return K.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function hL(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),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};nh(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 gL(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=X(i),{mounted:c,setMounted:l,transitionStatus:u}=zv(t,!1,!1,o),d=!t&&r;Y(()=>{t&&s(!1)},[t,s]);let f=K.useRef(c),p=K.useRef(!1),m=Ch(),h=()=>{f.current=!1,l(!1),a()};Y(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=X(()=>{f.current&&(t?(p.current=!0,m()):h())});return Rv({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var _L={tabIndex:-1,[ig]:``};function vL(e){return t=>t!==`touch`||e.current}function yL(e,t=!1){let n=Dh(),r=JI()!=null,i=wp(()=>e(n,r)).current;return hL({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function bL({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function xL(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function SL(e,t){let n=K.useRef(null);return X(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),xL(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),xL(t))})}function CL(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 wL(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function TL(e,t,n,r={}){let i=n.reason,a=i===jm,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=wL(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=CL(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Pc.flushSync(l):l()}function EL(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=SL(e,n),o=X(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=X(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function DL(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=K.useRef(null),i=e.useState(`open`);Y(()=>{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=Dm(km);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 OL(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=gL({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 wp(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function kL(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:Vp,inactiveTriggerProps:Vp,popupProps:Vp})},[e])}function AL(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var jL=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}},ML={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},NL=class extends sI{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:WI(),nested:n,triggerElements:i},ML),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Gg(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)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function PL(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new NL({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:Vp,inactiveTriggerProps:Vp,popupProps:Vp}}var FL=e=>e.triggerIdProp??e.activeTriggerId,IL=e=>e.openProp??e.open,LL=e=>(e.popupElement?.id??e.floatingId)||void 0;function RL(e,t){return t!==void 0&&IL(e)&&FL(e)===t}function zL(e,t){return RL(e,t)?!0:t!==void 0&&IL(e)&&FL(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var BL={open:IL,mounted:e=>e.mounted,transitionStatus:e=>IL(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:FL,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:LL,isTriggerActive:(e,t)=>t!==void 0&&FL(e)===t,isOpenedByTrigger:(e,t)=>RL(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&FL(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>zL(e,t)?LL(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function VL(e){let t=K.useCallback(t=>e===void 0?zp:e.subscribeStore(t),[e]),n=K.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,$_.useSyncExternalStore)(t,n,()=>e?.serverStore)}function HL(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Dh(),a=JI()!=null,o=wp(()=>new NL({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new jL,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=nh(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var UL=Xh&&Qh;function WL(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=K.useRef(!1),s=K.useRef(null),c=K.useRef(!0),l=cb();K.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=$m(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&rh(t)&&t===tg(Sh(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return cI(lI(r,`blur`,i),UL&&lI(r,`keydown`,a,!0),UL&&lI(r,`pointerdown`,l,!0))},[e,n]),K.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);nh(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=K.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=rg(n.nativeEvent);if(nh(a)){if(UL&&!n.relatedTarget){if(!c.current&&!Ng(a))return}else if(!Ig(a))return}let u=Ag(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,Dm(Mm,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,Dm(Mm,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=nh(r)&&r.hasAttribute(bI(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=tg(Sh(t));(r||n!==t)&&(Z(a.current.floatingContext?.refs.floating.current,n)||Z(t,n)||o||Ag(r??n,e.context.triggerElements)||e.setOpen(!1,Dm(Mm,i)))})}}},[a,r,e,l]);return K.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var GL=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new sb;restTimeout=new sb;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},KL=new WeakMap;function qL(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&KL.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),KL.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function JL(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=KL.get(n);a&&a!==e&&qL(a),qL(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,KL.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function YL(e){let t=e.context.dataRef.current,n=wp(()=>t.hoverInteractionState??GL.create()).current;return t.hoverInteractionState||=n,Ov(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function XL(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=YI(),u=JI(),d=YL(e),f=cb(),p=X(()=>pI(c.current.openEvent?.type,d.interactedInside)),m=X(()=>mI(c.current.openEvent?.type)),h=X(()=>{qL(d)});Y(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),K.useEffect(()=>h,[h]),Y(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&nh(s)&&o){let e=s,t=o,n=Sh(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??ng(e,`[data-rootownerid]`)??n.body;return JL(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),K.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Rg(l.nodesRef.current,u).length>0)}function a(t){let n=dI(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Dm(jm,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=rg(e);Pg(t)?d.interactedInside=ng(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ag(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&nh(o)&&Rg(l.nodesRef.current,r,!1).some(e=>Z(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,Dm(jm,n)),l.events.emit(`floating.closed`,n)})}let y=o;return cI(y&&lI(y,`mouseenter`,g),y&&lI(y,`mouseleave`,_),y&&lI(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var ZL={current:null};function QL(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ZL,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=YI(l),v=YL(e),y=K.useRef(!1),b=KF(i),x=KF(r),S=KF(o),C=KF(n),w=KF(p),T=KF(f),E=X(()=>pI(h.current.openEvent?.type,v.interactedInside)),D=X(()=>w.current?.()!==!1),O=X((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Z(t,n);if(!nh(r))return!1;let a=r;return i.hasMatchingElement(e=>Z(e,a))&&(!t||!Z(t,a))}),k=X(()=>{v.handler&&=(Sh(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=X(()=>{qL(v)});return u&&(v.handleCloseOptions=i?.__options),K.useEffect(()=>k,[k]),K.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===jm,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),K.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=dI(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,Dm(jm,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,Dm(jm,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!nh(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!Wg(v.pointerType))return;let n=fI(S.current),r=dI(x.current,`open`,v.pointerType),i=rg(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(nh(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Z(t,i)){c=t;break}}nh(o)&&nh(s)&&!e.context.triggerElements.hasElement(o)&&Z(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&nh(c)&&nh(s)&&Z(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,Dm(jm,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,Dm(jm,t,c))}):g&&D()&&e.setOpen(!0,Dm(jm,t,c)))}function o(n){if(E()){A();return}k();let r=Sh(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ag(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!Z(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){Z(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?lI(r,`mouseout`,l):void 0;return s?cI(lI(r,`mousemove`,i,{once:!0}),lI(r,`mouseenter`,i),lI(r,`mouseleave`,o),f):cI(lI(r,`mouseenter`,i),lI(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),K.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!Wg(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;JL(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=fI(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,Dm(jm,n,r))}v.pointerType===`touch`?Pc.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function $L(e){return Qh&&e.movementX===0&&e.movementY===0}function eR(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function tR(e,t){return eR(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function nR(e,t,n){return eR(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function rR(e,t,n){return eR(t,n?e===og:e===sg,e===lg)}function iR(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:eR(t,n?e===sg:e===og,e===cg)}function aR(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=Lg(E),A=Fg(D),j=KF(k),M=JI(),N=YI(x),P=K.useRef(f),F=K.useRef(o??-1),I=K.useRef(null),L=K.useRef(!0),R=X(e=>{i(F.current===-1?null:F.current,e)}),z=K.useRef(!!E),B=K.useRef(T),ee=K.useRef(!1),te=K.useRef(!1),ne=K.useRef(null),re=KF(h),ie=KF(T),ae=KF(o),oe=KF(b),se=Mv(),ce=Mv(),le=X(()=>{se.cancel();function e(e){d||(ne.current=SI(e,{sync:ee.current,preventScroll:!0}))}let t=n.current[F.current],r=te.current;t&&e(t),(ee.current?e=>e():e=>se.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),he&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{O.current.orientation=g},[O,g]),Y(()=>{T||(I.current=null),(!T||f!==`auto`)&&(P.current=f)},[T,f]),Y(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(te.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),Y(()=>{if(a){if(!T)ee.current=!1;else if(E){if(r==null){if(ee.current=!1,ae.current!=null)return;if(z.current&&(F.current=-1,le()),(!B.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||nR(I.current,_,u)||l?b_(n):x_(n),I.current=null,R())};t()}}else y_(n.current,r)||(F.current=r,le(),te.current=!1)}}},[a,T,E,r,ae,l,n,_,u,R,le,ce]),Y(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=tg(Sh(D??t??null)),r=e.some(e=>e.context&&Z(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Y(()=>{B.current=T,z.current=!!E});let ue=r!=null,de=X(e=>{if(!ie.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),fe=X(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),pe=X(()=>b_(n,re.current)),me=X(t=>{if(L.current=!1,ee.current=!0,t.which===229||!ie.current&&t.currentTarget===j.current)return;if(l&&iR(t.key,g,u,w)){tR(t.key,fe())||Bg(t),e.setOpen(!1,Dm(Rm,t.nativeEvent));let n=S?.current??D;rh(n)&&n.focus();return}r!=null&&r!==F.current&&!y_(n.current,r)&&(F.current=r);let i=F.current,a=b_(n,h),o=x_(n,h);if(A||(t.key===`Home`&&(Bg(t),F.current=a,R(t)),t.key===`End`&&(Bg(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(tR(t.key,g)){Bg(t);let e=tg(t.currentTarget.ownerDocument);if(T&&!d&&Z(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Z(t,e))){F.current=nR(t.key,g,u)?a:o,R(t),r===F.current&&le();return}let{index:l,wrapped:f}=S_(n.current,i,{decrement:!nR(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ee.current=!1),F.current=l,R(t)}}),he=K.useMemo(()=>({onFocus(e){ee.current=!0,de(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){$L(e)||(ee.current=!0,te.current=!1,p&&de(e))},onPointerLeave(e){if(!ie.current||!L.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&oe.current&&(ne.current?.(),ne.current=null,F.current=-1,R(e),!d)){let e=j.current,t=tg(Sh(e));e&&Z(e,t)&&e.focus({preventScroll:!0})}}}),[de,ie,j,p,n,R,oe,d]),V=K.useMemo(()=>d&&T&&ue&&{"aria-activedescendant":`${y}-${r}`},[d,T,ue,y,r]),ge=K.useMemo(()=>({...A?{}:V,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=rg(t.nativeEvent);if(n&&!Z(j.current,n))return;Bg(t);let r=Dm(Im,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&rh(i)&&i.focus()}else me(t)},onPointerMove(e){$L(e)||(L.current=!0)}}),[V,me,j,A,e,T,d,D,S]),_e=K.useMemo(()=>{function t(t){e.setOpen(!0,Dm(Rm,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Hg(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&Ug(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=rR(n.key,fe(),u),o=tR(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Ng(n.currentTarget)))return me(n);if(r||m||!i){if(s){let e=tR(n.key,fe());I.current=l&&e?null:n.key}l?a&&(Bg(n),r?(F.current=pe(),R(n),d&&j.current?.focus()):t(n)):o&&(ae.current!=null&&(F.current=ae.current),Bg(n),!r&&m?t(n):me(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[me,f,pe,l,R,e,m,g,_,fe,u,ae,d,j]),ve=K.useMemo(()=>({...V,..._e}),[V,_e]);return K.useMemo(()=>a?{reference:ve,floating:ge,item:he,trigger:_e}:{},[a,ve,ge,_e,he])}function oR(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=X(s),f=e.useState(`open`),p=cb(),m=K.useRef(``),h=K.useRef(u??i??-1),g=K.useRef(null),_=X(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!E_(n)||n?.matches(`:disabled`)?!1:o==null||!w_(Bp,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Bg(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Bg(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=X(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Z(r,n)||Z(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Y(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=K.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return K.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var sR=.1,cR=sR*sR,lR=.5;function uR(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function dR(e,t,n,r,i,a,o,s,c,l){let u=!1;return uR(e,t,n,r,i,a)&&(u=!u),uR(e,t,i,a,o,s)&&(u=!u),uR(e,t,o,s,c,l)&&(u=!u),uR(e,t,c,l,n,r)&&(u=!u),u}function fR(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function pR(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 mR(e={}){let{blockPointerEvents:t=!1}=e,n=new sb,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*cR;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=rg(r),g=r.type===`mouseleave`,_=Z(u,h),v=Z(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&nh(r.relatedTarget)&&Z(u,r.relatedTarget))return;function y(){return!!(s&&Rg(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=pR(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=pR(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=pR(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=pR(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!fR(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?lR/2:lR*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+lR+1,o=C||T?S.bottom-lR:S.top,s=C?T?S.bottom-lR:S.top:S.bottom-lR;M=dR(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?lR/2:lR*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-lR,o=C||T?S.top+lR:S.bottom,s=C?T?S.top+lR:S.bottom:S.top+lR;M=dR(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?lR/2:lR*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+lR+1,o=w||E?S.right-lR:S.left,s=w?E?S.right-lR:S.left:S.right-lR;M=dR(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?lR/2:lR*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-lR,o=w||E?S.left+lR:S.right,s=w?E?S.left+lR:S.right:S.left+lR;M=dR(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 hR(e,t,n){let{reference:r,floating:i}=e,a=i_(t),o=a_(t),s=r_(o),c=e_(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=t_(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function gR(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}=$g(t,e),p=__(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=v_(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=v_(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 _R=50,vR=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:gR},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=hR(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<_R&&(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}=hR(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},yR=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}=$g(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=e_(r),_=i_(o),v=e_(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[h_(o)]:s_(o)),x=p!==`none`;!d&&x&&b.push(...m_(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=o_(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`||_===i_(t)||T.every(e=>i_(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=i_(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{}}}},bR=new Set([`left`,`top`]);async function xR(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=e_(n),s=t_(n),c=i_(n)===`y`,l=bR.has(o)?-1:1,u=a&&c?-1:1,d=$g(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 SR=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 xR(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}}}}},CR=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}=$g(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=i_(i),p=n_(f),m=u[p],h=u[f],g=(e,t)=>Qg(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}}}}}},wR=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}=$g(e,t),u={x:n,y:r},d=i_(i),f=n_(d),p=u[f],m=u[d],h=$g(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=bR.has(e_(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}}}},TR=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}=$g(e,t),c=await i.detectOverflow(t,s),l=e_(n),u=t_(n),d=i_(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=Kg(p-c[m],g),y=Kg(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*qg(c.left,c.right):S=p-2*qg(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 ER(e){let t=gh(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rh(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Jg(n)!==a||Jg(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function DR(e){return nh(e)?e:e.contextElement}function OR(e){let t=DR(e);if(!rh(t))return Xg(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ER(t),o=(a?Jg(n.width):n.width)/r,s=(a?Jg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var kR=Xg(0);function AR(e){let t=$m(e);return!mh()||!t.visualViewport?kR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jR(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$m(e)}function MR(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=DR(e),o=Xg(1);t&&(r?nh(r)&&(o=OR(r)):o=OR(e));let s=jR(a,n,r)?AR(a):Xg(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=$m(a),t=nh(r)?$m(r):r,n=e,i=xh(n);for(;i&&t!==n;){let e=OR(i),t=i.getBoundingClientRect(),r=gh(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=$m(i),i=xh(n)}}return v_({width:u,height:d,x:c,y:l})}function NR(e,t){let n=_h(e).scrollLeft;return t?t.left+n:MR(eh(e)).left+n}function PR(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-NR(e,n),y:n.top+t.scrollTop}}function FR(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=eh(r),s=t?sh(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Xg(1),u=Xg(0),d=rh(r);if((d||!a)&&((Qm(r)!==`body`||ah(o))&&(c=_h(r)),d)){let e=MR(r);l=OR(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?PR(o,c):Xg(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 IR(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function LR(e){let t=_h(e),n=e.ownerDocument.body,r=qg(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=qg(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+NR(e),o=-t.scrollTop;return gh(n).direction===`rtl`&&(a+=qg(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var RR=25;function zR(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=$m(e),a=eh(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!mh()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(NR(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<=RR&&(s-=o)}return{width:s,height:c,x:l,y:u}}function BR(e,t){let n=MR(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=OR(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function VR(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=zR(e,n,t);else if(t===`document`)r=LR(eh(e));else if(nh(t))r=BR(t,n);else{let n=AR(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return v_(r)}function HR(e,t){let n=t.get(e);if(n)return n;let r=bh(e,[],!1).filter(e=>nh(e)&&Qm(e)!==`body`),i=null,a=gh(e).position===`fixed`,o=a?vh(e):e;for(;nh(o)&&!hh(o);){let e=gh(o),t=fh(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=vh(o)}return t.set(e,r),r}function UR(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?sh(t)?[]:HR(t,this._c):[].concat(n),r],o=VR(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=VR(t,a[e],i);s=qg(n.top,s),c=Kg(n.right,c),l=Kg(n.bottom,l),u=qg(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function WR(e){let{width:t,height:n}=ER(e);return{width:t,height:n}}function GR(e,t,n){let r=rh(t),i=eh(t),a=n===`fixed`,o=MR(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Xg(0);if((r||!a)&&((Qm(t)!==`body`||ah(i))&&(s=_h(t)),r)){let e=MR(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=NR(i));let l=i&&!r&&!a?PR(i,s):Xg(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 KR(e){return gh(e).position===`static`}function qR(e,t){if(!rh(e)||gh(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return eh(e)===n&&(n=n.ownerDocument.body),n}function JR(e,t){let n=$m(e);if(sh(e))return n;if(!rh(e)){let t=vh(e);for(;t&&!hh(t);){if(nh(t)&&!KR(t))return t;t=vh(t)}return n}let r=qR(e,t);for(;r&&oh(r)&&KR(r);)r=qR(r,t);return r&&hh(r)&&KR(r)&&!fh(r)?n:r||ph(e)||n}var YR=async function(e){let t=this.getOffsetParent||JR,n=this.getDimensions,r=await n(e.floating);return{reference:GR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XR(e){return gh(e).direction===`rtl`}var ZR={convertOffsetParentRelativeRectToViewportRelativeRect:FR,getDocumentElement:eh,getClippingRect:UR,getOffsetParent:JR,getElementRects:YR,getClientRects:IR,getDimensions:WR,getScale:OR,isElement:nh,isRTL:XR};function QR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $R(e,t,n){let r=null,i,a=eh(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=Yg(d),h=Yg(a.clientWidth-(u+f)),g=Yg(a.clientHeight-(d+p)),_=Yg(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:qg(0,Kg(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!QR(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=$m(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function ez(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=DR(e),u=i||a?[...l?bh(l):[],...t?bh(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?$R(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?MR(e):null;c&&g();function g(){let t=MR(e);h&&!QR(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 tz=SR,nz=CR,rz=yR,iz=TR,az=wR,oz=(e,t,n)=>{let r=new Map,i=n??{},a={...ZR,...i.platform,_c:r};return vR(e,t,{...i,platform:a})},sz=typeof document<`u`?K.useLayoutEffect:function(){};function cz(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(!cz(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)&&!cz(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function lz(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uz(e,t){let n=lz(e);return Math.round(t*n)/n}function dz(e){let t=K.useRef(e);return sz(()=>{t.current=e}),t}function fz(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]=K.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=K.useState(r);cz(f,r)||p(r);let[m,h]=K.useState(null),[g,_]=K.useState(null),v=K.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=K.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=K.useRef(null),C=K.useRef(null),w=K.useRef(u),T=c!=null,E=dz(c),D=dz(i),O=dz(l),k=K.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),oz(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!cz(w.current,t)&&(w.current=t,Pc.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);sz(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=K.useRef(!1);sz(()=>(A.current=!0,()=>{A.current=!1}),[]),sz(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=K.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=K.useMemo(()=>({reference:b,floating:x}),[b,x]),N=K.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=uz(M.floating,u.x),r=uz(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...lz(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return K.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var pz=(e,t)=>{let n=tz(e);return{name:n.name,fn:n.fn,options:[e,t]}},mz=(e,t)=>{let n=nz(e);return{name:n.name,fn:n.fn,options:[e,t]}},hz=(e,t)=>({fn:az(e).fn,options:[e,t]}),gz=(e,t)=>{let n=rz(e);return{name:n.name,fn:n.fn,options:[e,t]}},_z=(e,t)=>{let n=iz(e);return{name:n.name,fn:n.fn,options:[e,t]}},vz=K.createContext(void 0),yz=K.createContext(void 0);function bz(){let e=K.useContext(vz);if(e===void 0)throw Error(Sm(60));return e}function xz(){let e=K.useContext(yz);if(e===void 0)throw Error(Sm(61));return e}function Sz(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Cz=(e,t)=>Object.is(e,t);function wz(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Tz(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Sz(e,t,(e,t)=>wz(e,t,n)):e!==t}function Ez(e,t,n){return e?e.some(e=>e!==void 0&&wz(t,e,n)):!1}function Dz(e,t,n){return e?e.findIndex(e=>e!==void 0&&wz(e,t,n)):-1}function Oz(e,t){if(t!==Cz)return n=>Ez(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function kz(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(Oz(t,n)):Dz(e,t,n);return i===-1?null:i}function Az(e,t,n,r,i,a){return Ez(r,t,i)?a!=null&&e>a&&Ez(r,n[a],i)?a:e:e===a?kz(n,r,i,!0):a}function jz(e,t,n){return e.filter(e=>!wz(t,e,n))}function Mz(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Nz(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Pz(e){return Nz(e?.[0])}function Fz(e){return Pz(e)?e.flatMap(e=>e.items):e}function Iz(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Pz(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Lz(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Mz(e)}function Rz(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Mz(e.value):Mz(e)}function zz(e,t,n){function r(){return Lz(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=Fz(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Bz(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,q.jsx)(K.Fragment,{children:zz(r,t,n)},i)),e),[])}var Vz={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Rz(t,r)!==``},hasNullItemLabel:(e,t)=>t?Iz(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>wz(t,e,n)):wz(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Hz(e){let t=K.useRef(``),n=K.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:K.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Uz(e,t){let{onClick:n,onPointerDown:r}=Hz(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(qh?`touch`:``))}));return K.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Wz(e){let[t,n]=K.useState(null),r=Uz(e,n);return oF(e,t=>{t&&!e&&n(null)}),K.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Gz(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Kz(e,t){return Math.max(0,e-t)}function qz(e,t){if(t<=0)return 0;let n=Gz(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 Jz(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=Cz,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=YP(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=qP(),F=tF({id:t}),I=M||d,L=j??c,[R,z]=xp({controlled:n,default:y?r??Bp:r,name:`Select`,state:`value`}),[B,ee]=xp({controlled:a,default:o,name:`Select`,state:`open`}),te=K.useRef([]),ne=K.useRef([]),re=K.useRef(null),ie=K.useRef(null),ae=K.useRef(0),oe=K.useRef(null),se=K.useRef([]),ce=K.useRef(!1),le=K.useRef(null),ue=K.useRef(null),de=K.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=K.useRef(!1),pe=K.useRef(R),{openMethod:me,triggerProps:he}=Wz(B),V=wp(()=>new sI({id:F,labelId:void 0,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:B,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Vp,triggerProps:Vp,itemRoot:{props:Vp,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:zp,setOpen:zp,handleScrollArrowVisibility:zp,onOpenChangeComplete:zp,listRef:te,popupRef:re,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:oe,valuesRef:se,labelsRef:ne,typingRef:ce,selectionRef:de,firstItemTextRef:le,selectedItemTextRef:ue,alignItemWithTriggerActiveRef:fe,initialValueRef:pe},Vz)).current,[ge,_e]=K.useState(!1),{mounted:ve,transitionStatus:ye,forceUnmount:be}=gL({open:B,ref:re,preventUnmountOnClose:ge,setPreventUnmountOnClose:_e,onUnmount(){V.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),xe=V.useState(`activeIndex`),Se=V.useState(`selectedIndex`),Ce=V.useState(`triggerElement`),we=V.useState(`positionerElement`),Te=GF(me),Ee=me??Te,De=K.useMemo(()=>y?``:Rz(R,x),[y,R,x]),Oe=K.useMemo(()=>y&&Array.isArray(R)?R.map(e=>Rz(e,x)):Rz(R,x),[y,R,x]);aF(KF(Ce),F,R,X(()=>Oe),!I,c);let ke=y?Array.isArray(R)&&R.length>0:R!=null&&De!==``;Y(()=>{A(ke)},[ke,A]),Y(function(){let e=kz(se.current,R,S,y);e===null&&(ue.current=null),!B&&V.set(`selectedIndex`,e)},[y,B,R,S,V]),oF(R,()=>{T(L),E(Tz(R,k.initialValue,S)),N.change(R)});let Ae=X((e,t)=>{let n=t,r=wL(n);s?.(e,n),!t.isCanceled&&(e||_e(r()),ee(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(R)))});K.useImperativeHandle(h,()=>({unmount:be,close:()=>{V.state.open&&Ae(!1,Dm(Km))}}),[be,Ae,V]);let je=X((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),Me=X(e=>{let t=Kz(e.scrollHeight,e.clientHeight),n=qz(e.scrollTop,t),r=n>0,i=n<t;V.set(`scrollUpArrowVisible`,r),V.set(`scrollDownArrowVisible`,i)}),Ne=HL({open:B,onOpenChange:Ae,elements:{reference:Ce,floating:we}}),Pe=cL(Ne,{enabled:!I,event:`mousedown`}),Fe=mL(Ne),Ie=aR(Ne,{enabled:!I,listRef:te,activeIndex:xe,selectedIndex:Se,disabledIndices:Bp,onNavigate(e){(e!==null||B)&&V.set(`activeIndex`,e)},focusItemOnHover:C}),Le=oR(Ne,{enabled:!I&&(B||!f&&!y),listRef:ne,activeIndex:xe,selectedIndex:Se,disabledIndices:e=>Uv(te.current[e]),onMatch(e){B?V.set(`activeIndex`,e):je(se.current[e],Dm(km))},onTyping(e){ce.current=e}}),Re=K.useMemo(()=>Kp(Le.reference,Ie.reference,Fe.reference,Pe.reference,he),[Pe.reference,Le.reference,Ie.reference,Fe.reference,he]),ze=K.useMemo(()=>Kp(_L,Le.floating,Ie.floating,Fe.floating),[Le.floating,Ie.floating,Fe.floating]),Be=Ie.item??Vp,H=K.useMemo(()=>({props:Be,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S}),[Be,y,I,f,S]);V.useContextCallback(`setValue`,je),V.useContextCallback(`setOpen`,Ae),V.useContextCallback(`handleScrollArrowVisibility`,Me),V.useContextCallback(`onOpenChangeComplete`,_),WF(()=>{V.update({popupProps:ze,triggerProps:Re,itemRoot:H})}),V.useSyncedValues({id:F,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,value:R,open:B,mounted:ve,transitionStatus:ye,popupProps:ze,triggerProps:Re,itemRoot:H,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Ee});let Ve=kp(g,N.inputRef),He=y?void 0:L,Ue=K.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=Rz(e,x);return(0,q.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,q.jsxs)(vz.Provider,{value:V,children:[(0,q.jsx)(yz.Provider,{value:Ne,children:w}),(0,q.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){V.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=Dm(km,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=se.current.findIndex(t=>Rz(t,x).toLowerCase()===e||Lz(t,b).toLowerCase()===e);r===-1&&(r=se.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=se.current[r];i!=null&&je(i,n)}V.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&He==null?`${F}-hidden-input`:void 0,form:l,name:He,autoComplete:u,value:De,disabled:I,required:p&&!(y&&ke),readOnly:f,ref:Ve,style:L?jF:AF,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ue]})}function Yz(e,t){return e??t}var Xz=5;function Zz(e,t){let n=Qz(t);return e.clientX>=n.left-Xz&&e.clientX<=n.right+Xz&&e.clientY>=n.top-Xz&&e.clientY<=n.bottom+Xz}function Qz(e){let t=e.getBoundingClientRect(),n=$m(e);if(eg)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var $z=`data-popup-side`,eB=400,tB={...Eg,...WP,popupSide:e=>e?{[$z]:e}:null,value:()=>null},nB=K.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=qP(),{labelId:m}=ZP(),h=bz(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,b=h.useState(`open`),x=h.useState(`mounted`),S=h.useState(`value`),C=h.useState(`triggerProps`),w=h.useState(`positionerElement`),T=h.useState(`listElement`),E=h.useState(`popupSide`),D=h.useState(`id`),O=h.useState(`labelId`),k=h.useState(`hasSelectedValue`),A=x&&w?E:null,j=i??D,M=Yz(m,O);tF({id:i});let N=KF(w),P=K.useRef(null),F=iF(y,P),{getButtonProps:I,buttonRef:L}=Nh({disabled:y,native:o}),R=h.useStateSetter(`triggerElement`),z=cb(),B=cb(),ee=cb();K.useEffect(()=>{if(b)return ee.start(eB,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[b,h,B,ee]);let te=Kp(C,{id:j,role:`combobox`,"aria-expanded":b,"aria-haspopup":`listbox`,"aria-controls":b?T?.id??Lg(w)?.id:void 0,"aria-labelledby":M,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){F(!0),b&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,Dm(km,e.nativeEvent)),z.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){Z(w,e.relatedTarget)||(l(!0),F(!1),u===`onBlur`&&d.commit(S))},onMouseDown(e){if(b)return;let t=Sh(e.currentTarget);function n(e){if(!P.current)return;let t=e.target;Z(P.current,t)||Z(N.current,t)||Zz(e,P.current)||h.context.setOpen(!1,Dm(Vm,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),ne=d.getValidationProps(y,te);ne.role=`combobox`;let re={...f,open:b,disabled:y,value:S,readOnly:g,popupSide:A,placeholder:!k};return am(`button`,e,{ref:[t,P,L,R],state:re,stateAttributesMapping:tB,props:ne})}),rB={value:()=>null},iB=K.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=bz(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?Bz(l,u,d):zz(l,u,d)),am(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:rB})}),aB=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return am(`span`,e,{state:{open:bz().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Tg})}),oB=K.forwardRef(function(e,t){let n=bz(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,q.jsx)(UI,{ref:t,...e}):null});function sB(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]=K.useState(null),d=K.useRef(null),f=YI(n),p=K.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=fz({...e,elements:{...p,...l&&{reference:l}}}),h=K.useCallback(e=>{let t=nh(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=K.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=K.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=K.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Y(()=>{o&&(d.current=o)},[o]),Y(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),K.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var cB=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}=$g(e,t)||{};if(l==null)return{};let d=__(u),f={x:n,y:r},p=a_(i),m=r_(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=Qg(D,k,O),j=!c.arrow&&t_(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}}}),lB=(e,t)=>{let{name:n,fn:r}=cB(e);return{name:n,fn:r,options:[e,t]}},uB={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}}}},dB={sideX:`left`,sideY:`top`},fB=`--available-width`,pB=`--available-height`,mB=`--anchor-width`,hB=`--anchor-height`,gB=`--transform-origin`,_B=fB,vB=pB;function yB(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 bB(e,t,n){let{rects:r,placement:i}=e;return{side:yB(t,e_(i),n),align:t_(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function xB(e){return SB(e,sB)}function SB(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=X(O),A=O?k:n,j=KF(n),M=KF(g),N=oy()===`rtl`,[P,F]=K.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?e_(P):null,R=P&&I?t_(P)||`center`:null,z=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],B=R||o,ee=B===`center`?z:`${z}-${B}`,te=l;typeof te==`number`?te={top:te,right:te,bottom:te,left:te}:te&&={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0};let ne=+(i===`bottom`),re=+(i===`top`),ie=+(i===`right`),ae=+(i===`left`),oe={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:te},se=K.useRef(null),ce=KF(a),le=KF(s),ue=typeof a==`function`?0:a,de=typeof s==`function`?0:s,fe=[];p&&fe.push(p),fe.push(pz(e=>{let t=bB(e,i,N),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof le.current==`function`?le.current(t):le.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ue,de,N,i]));let pe=w===`none`&&C!==`shift`,me=!pe&&(u||E||C===`shift`),he=C===`none`?null:gz({...oe,padding:{top:te.top+1+ne,right:te.right+1+ae,bottom:te.bottom+1+re,left:te.left+1+ie},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),V=pe?null:mz({...oe,rootBoundary:D,mainAxis:w!==`none`,crossAxis:me,limiter:u||E?void 0:hz(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=i_(e_(e.placement)),i=r===`y`?t:n,a=r===`y`?te.left+te.right:te.top+te.bottom;return{offset:i/2+a/2}})},[oe,u,E,D,te,w]);C===`shift`||w===`shift`||B===`center`?fe.push(V,he):fe.push(he,V),fe.push(_z({...oe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(_B,`${t}px`),i.setProperty(vB,`${n}px`);let a=$m(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(mB,`${u}px`),i.setProperty(hB,`${d}px`)}}),lB(e=>({element:se.current||Sh(e.elements.floating).createElement(`div`),padding:se.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=e_(r),u=t_(r),d=i_(l)===`y`,f=se.current,p=typeof a==`function`?a(bB(e,i,N)):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 me&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(gB,d?`${m} ${h}`:`${h} ${m}`),{}}},uB,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ge=K.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:_e,elements:ve,x:ye,y:be,middlewareData:xe,update:Se,placement:Ce,context:we,isPositioned:Te,floatingStyles:Ee}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:fe,strategy:r,whileElementsMounted:m?void 0:(...e)=>ez(...e,ge),nodeId:y,externalTree:S}),{sideX:De,sideY:Oe}=xe.adaptiveOrigin||dB,ke=Te?r:`fixed`,Ae=K.useMemo(()=>{let e;return e=Te?b?{position:ke,[De]:ye,[Oe]:be}:{...Ee,position:ke}:{position:ke,top:0,left:0},e[_B]=`100vw`,e[vB]=`100vh`,Te||(e.opacity=0),e},[b,ke,De,ye,Oe,be,Ee,Te]),je=K.useRef(null);Y(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(CB(t)?t.current:t)||null;n!==je.current&&(_e.setPositionReference(n),je.current=n)},[g,_e,A,j]),K.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&CB(e)&&e.current!==je.current&&(_e.setPositionReference(e.current),je.current=e.current)},[g,_e,A,j]),K.useEffect(()=>{if(m&&g&&ve.reference&&ve.floating)return ez(ve.reference,ve.floating,Se,ge)},[m,g,ve,Se,ge]);let Me=e_(Ce),Ne=yB(i,Me,N),Pe=t_(Ce)||`center`,Fe=!!xe.hide?.referenceHidden;Y(()=>{x&&g&&Te&&(Me!==z||I&&Pe!==B)&&F(Ce)},[x,I,g,Te,Ce,Me,Pe,z,B]);let Ie=K.useMemo(()=>({position:`absolute`,top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),Le=xe.arrow?.centerOffset!==0;return K.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ie,arrowRef:se,arrowUncentered:Le,side:Ne,align:Pe,physicalSide:Me,anchorHidden:Fe,refs:_e,context:we,isPositioned:Te,update:Se}),[Ae,Ie,se,Le,Ne,Pe,Me,Fe,_e,we,Te,Se])}function CB(e){return e!=null&&`current`in e}var wB=K.createContext(void 0);function TB(){let e=K.useContext(wB);if(!e)throw Error(Sm(59));return e}var EB=K.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,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function DB(e,t){e&&Object.assign(e.style,t)}var OB={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function kB(e){return e===`starting`?PI:Vp}function AB(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),am(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},kB(r),i],stateAttributesMapping:Dg})}var jB={},MB={},NB=``;function PB(e,t){return ah(e)?e:t}function FB(e,t,n){return/hidden|clip/.test(e.getComputedStyle(PB(t,n)).overflowY)}function IB(e){if(typeof document>`u`)return!1;let t=Sh(e);return $m(t).innerWidth-t.documentElement.clientWidth>0}function LB(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Sh(e),n=t.documentElement,r=t.body,i=PB(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 RB(e){let t=Sh(e),n=t.documentElement,r=t.body,i=PB(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 zB(e){let t=Sh(e),n=t.documentElement,r=t.body,i=$m(n),a=0,o=0,s=!1,c=jv.create();if(Qh&&(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,jB={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},NB=n.style.scrollBehavior,MB={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=PB(n,r);s=LB(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(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,jB),Object.assign(r.style,MB),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=NB)}function d(){u(),c.request(l)}l();let f=lI(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var BB=new class{lockCount=0;restore=null;timeoutLock=sb.create();timeoutUnlock=sb.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=Sh(e),n=t.documentElement,r=t.body,i=$m(n);if(FB(i,n,r)){let t=new i.MutationObserver(()=>{FB(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=qh||!IB(e);this.restore=a?RB(e):zB(e)}};function VB(e=!0,t=null){Y(()=>{if(e)return BB.acquire(t)},[e,t])}var HB=20;function UB(e,t,n,r){let[i,a]=K.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=Sh(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-HB)},[e,t,n]),VB(e&&(!t||i),r)}var WB={position:`fixed`},GB=K.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=II,style:_,...v}=e,y=bz(),b=xz(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=K.useRef(null),j=K.useRef(null),[M,N]=K.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),K.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),UB((P||C)&&x,T===`touch`,E,D);let F=xB({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?WB:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Y(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=AB(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=K.useRef(0),ee=X(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=Dm(km);if(t!==0&&!y.state.multiple&&w!==null&&Dz(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&Dz(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>Dz(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};DB(E,e),DB(y.context.popupRef.current,e)}}),te=K.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,q.jsx)(mm,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ee,children:(0,q.jsxs)(wB.Provider,{value:te,children:[S&&C&&(0,q.jsx)(EB,{inert:Dv(!x),cutout:D}),z]})})}),KB=`base-ui-disable-scrollbar`,qB={className:KB,getElement(e){return(0,q.jsx)(`style`,{nonce:e,href:KB,precedence:`base-ui:low`,children:`.${KB}{scrollbar-width:none}.${KB}::-webkit-scrollbar{display:none}`})}},JB=K.createContext(void 0);function YB(e){let t=K.useContext(JB);if(t===void 0&&!e)throw Error(Sm(69));return t}var XB=`--transform-origin`,ZB={...Dg,...mg},QB=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=bz(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=xz(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=TB(),_=YB(!0)!=null,v=oy(),{nonce:y,disableStyleElements:b}=lv(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=K.useRef(!1),j=K.useRef(!1),M=K.useRef({}),N=Mv(),P=X(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=tV(O),i=nV(O.getBoundingClientRect().height,`y`,r),a=Sh(O),o=$m(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=$B(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=eV(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=Gz(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=Gz(g,0,eV(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});K.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),Rv({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Y(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Y(()=>{S||m||(j.current=!1,A.current=!1,DB(O,M.current))},[S,m,O]),Y(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(XB),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=aV(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=$m(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=Sh(D),c=tV(D),l=rV(D.getBoundingClientRect(),c),d=rV(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=$B(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=rV(n.getBoundingClientRect(),c);T=rV(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${Gz(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=eV(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&Qh;if(B||ee){DB(O,M.current),g(!1);return}let te=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=eV(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=Gz(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(XB,`50% ${i}%`)}(te===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),K.useEffect(()=>{if(!m||!O||!S)return;let e=$m(O);function t(e){s.context.setOpen(!1,Dm(qm,e))}return lI(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&Jv.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:OB},className:!k&&m?qB.className:void 0},L=am(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:ZB,props:[T,I,kB(E),o]});return(0,q.jsxs)(K.Fragment,{children:[!b&&qB.getElement(y),(0,q.jsx)(sL,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})});function $B(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function eV(e){return Kz(e.scrollHeight,e.clientHeight)}function tV(e){return ZR.getScale(e)}function nV(e,t,n){return e/n[t]}function rV(e,t){return v_({x:nV(e.x,`x`,t),y:nV(e.y,`y`,t),width:nV(e.width,`x`,t),height:nV(e.height,`y`,t)})}var iV=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function aV(e){let{style:t}=e,n={};for(let[e,r]of iV)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of iV){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var oV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=bz(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=TB(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:OB},className:u&&d!==`touch`?qB.className:void 0};return am(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),sV=K.createContext(void 0);function cV(){let e=K.useContext(sV);if(!e)throw Error(Sm(57));return e}var lV=K.memo(K.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=K.useRef(null),d=Lh({guess:!0,label:o,textRef:u}),f=bz(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=d.index,w=K.useRef(null);Y(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Y(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=Az(C,a,f.context.valuesRef.current,e,_,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&wz(a,e,_),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,_,f,a]);let T=K.useRef(`mouse`),E=K.useRef(!1),{getButtonProps:D,buttonRef:O}=Nh({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:v,selected:x,highlighted:y};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?jz(n,a,_):[...n,a];f.context.setValue(r,Dm(Pm,e))}else f.context.setValue(a,Dm(Pm,e)),f.context.setOpen(!1,Dm(Pm,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Hg(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!E.current;E.current=!1,!(v||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),v||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=am(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=K.useMemo(()=>({selected:x,index:C,textRef:u,selectedByFocus:S}),[x,C,u,S]);return(0,q.jsx)(sV.Provider,{value:P,children:N})})),uV=K.memo(K.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=K.useRef(null),{transitionStatus:l,setMounted:u}=zv(o),d=am(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:mg});return Rv({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),dV=K.forwardRef(function(e,t){let{selected:n}=cV();return e.keepMounted||n?(0,q.jsx)(uV,{...e,selected:n,ref:t}):null}),fV=K.memo(K.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=cV(),a=bz(),{render:o,className:s,style:c,...l}=e;return am(`div`,e,{ref:[K.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),pV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=bz(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=TB(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=cb(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=zv(g);Y(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),Rv({open:g,ref:v,onComplete(){g||x(!1)}});let S=am(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=Kz(e.scrollHeight,e.clientHeight),r=qz(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=mV(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:mg});return y||o?S:null});function mV(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?qz(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?qz(l.offsetTop+l.offsetHeight-r+i,a):a}var hV=K.forwardRef(function(e,t){return(0,q.jsx)(pV,{...e,ref:t,direction:`down`})}),gV=K.forwardRef(function(e,t){return(0,q.jsx)(pV,{...e,ref:t,direction:`up`})}),_V=Jz;function vV({className:e,...t}){return(0,q.jsx)(iB,{"data-slot":`select-value`,className:J(`flex flex-1 text-left`,e),...t})}function yV({className:e,size:t=`default`,children:n,...r}){return(0,q.jsxs)(nB,{"data-slot":`select-trigger`,"data-size":t,className:J(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-[13px] whitespace-nowrap transition-colors outline-none select-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,q.jsx)(aB,{render:(0,q.jsx)(Wd,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function bV({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,q.jsx)(oB,{children:(0,q.jsx)(GB,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,q.jsxs)(QB,{"data-slot":`select-content`,"data-align-trigger":o,className:J(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground border border-border/70 shadow-float duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,q.jsx)(SV,{}),(0,q.jsx)(oV,{children:t}),(0,q.jsx)(CV,{})]})})})}function xV({className:e,children:t,...n}){return(0,q.jsxs)(lV,{"data-slot":`select-item`,className:J(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,q.jsx)(fV,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,q.jsx)(dV,{render:(0,q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,q.jsx)(Hd,{className:`pointer-events-none`})})]})}function SV({className:e,...t}){return(0,q.jsx)(gV,{"data-slot":`select-scroll-up-button`,className:J(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(Kd,{})})}function CV({className:e,...t}){return(0,q.jsx)(hV,{"data-slot":`select-scroll-down-button`,className:J(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(Wd,{})})}var wV=K.createContext(void 0);function TV(e){let t=K.useContext(wV);if(!e&&t===void 0)throw Error(Sm(27));return t}var EV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=TV(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return am(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Og,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),DV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=TV(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Nh({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Dm(Fm,e.nativeEvent))}return am(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),OV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=TV(),c=Oh(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),am(`p`,e,{ref:t,props:[{id:c},o]})}),kV=K.createContext(void 0);function AV(){let e=K.useContext(kV);if(e===void 0)throw Error(Sm(26));return e}var jV=`--nested-dialogs`,MV=`data-nested-dialog-open`,NV={...Dg,...mg,nestedDialogOpen(e){return e?{[MV]:``}:null}},PV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=TV(),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`);AV(),Rv({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?vL(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=am(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,..._L,hidden:!m,onKeyDown(e){Jv.has(e.key)&&e.stopPropagation()},style:{[jV]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:NV});return(0,q.jsx)(sL,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),FV=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=TV(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,q.jsx)(kV.Provider,{value:n,children:(0,q.jsxs)(UI,{ref:t,...r,children:[a&&o===!0&&(0,q.jsx)(EB,{ref:i.context.internalBackdropRef,inert:Dv(!s)}),e.children]})}):null});function IV({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]=K.useState(0),[d,f]=K.useState(0),p=l===0,m=mL(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=rg(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Z(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return VB(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),Y(()=>{!r&&!i&&(u(0),f(0))},[r,i]),Y(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),kL(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var LV={...BL,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},RV=class extends sI{constructor(e,t,n){let r=new jL,i=zV(e,r,t,n);super(i,BV(r),LV)}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(CL(this.state,e,t.trigger)))}};function zV(e,t,n,r=!1){return{...PL(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 BV(e){return{popupRef:K.createRef(),backdropRef:K.createRef(),internalBackdropRef:K.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function VV(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:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=TV(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=yL((e,t)=>new RV({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);AL(b,x),DL(b);let{forceUnmount:w}=OL(x,b);K.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,Dm(Km))}),[w,b]);let T=x||S||u!=null;return(0,q.jsxs)(wV.Provider,{value:b,children:[u&&(0,q.jsx)(bL,{handle:u,store:b}),T&&(0,q.jsx)(IV,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var HV=QF(function(e){return VV(`dialog`,e)}),UV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=TV(),c=Oh(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),am(`h2`,e,{ref:t,props:[{id:c},o]})}),WV=$F(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=TV(!0),f=VL(l)??d;if(!f)throw Error(Sm(79));let p=Oh(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=K.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=EL(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=Nh({disabled:a,native:o}),S=cL(m),C=Uz(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},T=f.useState(`triggerProps`,y);return am(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,T,C,{[FI]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:Tg})});function GV({...e}){return(0,q.jsx)(HV,{"data-slot":`dialog`,...e})}function KV({...e}){return(0,q.jsx)(WV,{"data-slot":`dialog-trigger`,...e})}function qV({...e}){return(0,q.jsx)(FV,{"data-slot":`dialog-portal`,...e})}function JV({...e}){return(0,q.jsx)(DV,{"data-slot":`dialog-close`,...e})}function YV({className:e,...t}){return(0,q.jsx)(EV,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function XV({className:e,children:t,showCloseButton:n=!0,...r}){let i=K.useRef(null);return(0,q.jsxs)(qV,{children:[(0,q.jsx)(YV,{}),(0,q.jsxs)(PV,{ref:i,"data-slot":`dialog-content`,initialFocus:()=>i.current?.querySelector(`input:not([type=hidden]):not([disabled]), textarea:not([disabled]), select:not([disabled]), [role=combobox]:not([disabled])`)??i.current,className:J(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground border border-border/70 shadow-overlay duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,q.jsxs)(DV,{"data-slot":`dialog-close`,render:(0,q.jsx)(zP,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,q.jsx)(Df,{}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function ZV({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2`,e),...t})}function QV({className:e,showCloseButton:t=!1,children:n,...r}){return(0,q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,q.jsx)(DV,{render:(0,q.jsx)(zP,{variant:`outline`}),children:`Close`})]})}function $V({className:e,...t}){return(0,q.jsx)(UV,{"data-slot":`dialog-title`,className:J(`font-heading text-base leading-none font-medium`,e),...t})}function eH({className:e,...t}){return(0,q.jsx)(OV,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function tH(e){return VV(`alert-dialog`,e)}var nH=WV;function rH({...e}){return(0,q.jsx)(tH,{"data-slot":`alert-dialog`,...e})}function iH({...e}){return(0,q.jsx)(nH,{"data-slot":`alert-dialog-trigger`,...e})}function aH({...e}){return(0,q.jsx)(FV,{"data-slot":`alert-dialog-portal`,...e})}function oH({className:e,...t}){return(0,q.jsx)(EV,{"data-slot":`alert-dialog-overlay`,className:J(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function sH({className:e,size:t=`default`,...n}){return(0,q.jsxs)(aH,{children:[(0,q.jsx)(oH,{}),(0,q.jsx)(PV,{"data-slot":`alert-dialog-content`,"data-size":t,className:J(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground border border-border/70 shadow-overlay duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function cH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:J(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function lH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:J(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function uH({className:e,...t}){return(0,q.jsx)(UV,{"data-slot":`alert-dialog-title`,className:J(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function dH({className:e,...t}){return(0,q.jsx)(OV,{"data-slot":`alert-dialog-description`,className:J(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function fH({className:e,...t}){return(0,q.jsx)(zP,{"data-slot":`alert-dialog-action`,className:J(e),...t})}function pH({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,q.jsx)(DV,{"data-slot":`alert-dialog-cancel`,className:J(e),render:(0,q.jsx)(zP,{variant:t,size:n}),...r})}var mH=K.createContext(void 0);function hH(e){let t=K.useContext(mH);if(t===void 0&&!e)throw Error(Sm(72));return t}var gH={...BL,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},_H=class extends sI{constructor(e,t,n){let r=new jL;super(vH(e,r,t,n),yH(r),gH)}setOpen=(e,t)=>{TL(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Dm(Am,e))}};function vH(e,t,n,r=!1){return{...PL(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function yH(e){return{popupRef:K.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var bH=QF(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=yL((e,t)=>new _H({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),DL(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=OL(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=K.useRef(null);Y(()=>{m&&t&&p.setOpen(!1,Dm(Um))},[m,t,p]),Y(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Y(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),K.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,Dm(Km))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,q.jsxs)(mH.Provider,{value:p,children:[l&&(0,q.jsx)(bL,{handle:l,store:p}),T&&(0,q.jsx)(xH,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function xH({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=mL(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=dL(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=K.useMemo(()=>Kp(a.reference,i.reference),[a.reference,i.reference]);return kL(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Vp}),null}var SH=K.createContext(void 0);function CH(){return K.useContext(SH)}var wH=`data-base-ui-tooltip-trigger`;function TH(e){let t=rg(e);return nh(t)?t:null}var EH=$F(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=hH(!0),m=VL(a)??p;if(!m)throw Error(Sm(82));let h=Oh(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=K.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=EL(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=CH(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=vI(v,{open:_}),O=YL(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=KF(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=K.useRef(!1),F=cb(),I=K.useRef(void 0);function L(){return D&&w.current!=null?0:c??C??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=ng(e,`[${wH}]`);return n!==null&&n!==t&&Z(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let B=QL(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?mR():null,restMs:L,delay(){return u==null&&D?{close:dI(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),ee=WL(v,{enabled:!A}).reference,te=e=>{let t=P.current,n=TH(e),r=z(n),i=y.current,a=i&&n&&Z(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,Dm(jm,e));else if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&Wg(I.current)){let t=()=>{!P.current&&!j.current&&!m.select(`open`)&&m.setOpen(!0,Dm(jm,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},ne=m.useState(`appliedTriggerProps`,S||M!==`none`);return am(`button`,e,{state:{open:_},ref:[t,x,y],props:[B,ee,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){R(TH(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[kg]:A?``:void 0,[wH]:A?void 0:``},f],stateAttributesMapping:Tg})}),DH=K.createContext(void 0);function OH(){let e=K.useContext(DH);if(e===void 0)throw Error(Sm(70));return e}var kH=K.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=HI({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,q.jsxs)(K.Fragment,{children:[l,c&&Pc.createPortal(n,c)]})}),AH=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return hH().useState(`mounted`)||n?(0,q.jsx)(DH.Provider,{value:n,children:(0,q.jsx)(kH,{ref:t,...r})}):null}),jH=K.createContext(void 0);function MH(){let e=K.useContext(jH);if(e===void 0)throw Error(Sm(71));return e}var NH=K.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=LI,style:g,..._}=e,v=hH(),y=OH(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=xB({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=AB(e,K.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,q.jsx)(jH.Provider,{value:D,children:O})}),PH=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=hH(),{side:s,align:c}=MH(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Rv({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),XL(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return am(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[_L,f,kB(d),a],stateAttributesMapping:Og})}),FH=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=K.useMemo(()=>({open:t,close:n}),[t,n]);return(0,q.jsx)(SH.Provider,{value:t,children:(0,q.jsx)(_I,{delay:i,timeoutMs:r,children:e.children})})};function IH({delay:e=0,...t}){return(0,q.jsx)(FH,{"data-slot":`tooltip-provider`,delay:e,...t})}function LH({...e}){return(0,q.jsx)(bH,{"data-slot":`tooltip`,...e})}function RH({...e}){return(0,q.jsx)(EH,{"data-slot":`tooltip-trigger`,...e})}function zH({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,q.jsx)(AH,{children:(0,q.jsx)(NH,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,q.jsx)(PH,{"data-slot":`tooltip-content`,className:J(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md border border-border/70 bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-float has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:a})})})}function BH(e){return am(e.defaultTagName??`div`,e,e)}var VH=py(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-1.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-all focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function HH({className:e,variant:t=`default`,render:n,...r}){return BH({defaultTagName:`span`,props:Kp({className:J(VH({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function UH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`skeleton`,className:J(`animate-pulse rounded-md bg-muted`,e),...t})}function WH({className:e,...t}){return(0,q.jsx)(_f,{"data-slot":`spinner`,"aria-hidden":`true`,className:J(`size-4 animate-spin`,e),...t})}var GH=py(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function KH({className:e,variant:t,...n}){return(0,q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:J(GH({variant:t}),e),...n})}function qH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-title`,className:J(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function JH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-description`,className:J(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function YH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty`,className:J(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function XH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-header`,className:J(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var ZH=py(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function QH({className:e,variant:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:J(ZH({variant:t,className:e})),...n})}function $H({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-title`,className:J(`font-heading text-sm font-medium tracking-tight`,e),...t})}function eU(){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`svg`,{className:`brand-mark h-5 w-7 shrink-0 text-primary`,viewBox:FP.viewBox,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:FP.path,fill:`currentColor`})}),(0,q.jsx)(`span`,{className:`brand-word text-sm font-semibold tracking-tight group-data-[collapsible=icon]:hidden`,children:`Kanvil`})]})}var tU=`relative mb-4 min-w-0 [&>[data-slot=field-label]]:text-xs [&>[data-slot=field-label]]:font-medium [&>[data-slot=field-label]]:text-muted-foreground`,nU=e=>Fy.error(Yl(e));function rU({label:e,children:t,...n}){return(0,q.jsxs)(LH,{children:[(0,q.jsx)(RH,{render:(0,q.jsx)(zP,{variant:`ghost`,size:`icon`,"aria-label":e,...n}),children:t}),(0,q.jsx)(zH,{children:e})]})}function iU({label:e,...t}){let n=(0,K.useId)(),[r,i]=(0,K.useState)(!1);return(0,q.jsxs)(wF,{className:tU,children:[(0,q.jsx)(EF,{htmlFor:n,children:e}),t.type===`password`?(0,q.jsxs)(dF,{children:[(0,q.jsx)(gF,{...t,id:n,type:r?`text`:`password`}),(0,q.jsx)(pF,{align:`inline-end`,children:(0,q.jsx)(hF,{size:`icon-sm`,"aria-label":`${r?`Hide`:`Show`} ${e.toLowerCase()}`,title:`${r?`Hide`:`Show`} ${e.toLowerCase()}`,disabled:t.disabled,onClick:()=>i(e=>!e),children:r?(0,q.jsx)(pf,{}):(0,q.jsx)(hf,{})})})]}):(0,q.jsx)(lF,{...t,id:n})]})}function aU({label:e,...t}){let n=(0,K.useId)();return(0,q.jsxs)(wF,{className:tU,children:[(0,q.jsx)(EF,{htmlFor:n,children:e}),(0,q.jsx)(uF,{...t,id:n})]})}function oU({label:e,children:t,className:n,layout:r=`field`,labelHidden:i=!1,...a}){let o=(0,K.useId)(),s=K.Children.toArray(t).flatMap(e=>(0,K.isValidElement)(e)?[{value:e.props.value,label:e.props.children}]:[]);return(0,q.jsxs)(wF,{className:J(tU,r===`property`&&`mb-0 grid grid-cols-[72px_minmax(0,1fr)] items-center gap-2`,n),children:[(0,q.jsx)(EF,{htmlFor:o,className:J(r===`property`&&`text-xs font-normal text-muted-foreground`,i&&`sr-only`),children:e}),(0,q.jsxs)(_V,{items:s,defaultValue:s[0]?.value??``,...a,children:[(0,q.jsx)(yV,{id:o,className:J(`w-full`,r===`property`&&`h-auto min-h-8 border-transparent bg-transparent shadow-none hover:bg-muted dark:bg-transparent`),children:(0,q.jsx)(vV,{})}),(0,q.jsx)(bV,{alignItemWithTrigger:!1,children:t})]})]})}function sU({label:e,description:t,className:n,...r}){let i=(0,K.useId)(),a=n===`sr-checkbox`;return(0,q.jsxs)(wF,{orientation:`horizontal`,className:J(`my-2 min-h-7 w-auto`,a&&`my-0 min-h-4 justify-center`),children:[(0,q.jsx)(UF,{...r,id:i,"aria-describedby":t?[r[`aria-describedby`],`${i}-description`].filter(Boolean).join(` `):r[`aria-describedby`]}),t?(0,q.jsxs)(TF,{children:[(0,q.jsx)(EF,{htmlFor:i,className:J(`font-normal`,a&&`sr-only`),children:e}),(0,q.jsx)(DF,{id:`${i}-description`,className:`text-xs`,children:t})]}):(0,q.jsx)(EF,{htmlFor:i,className:J(`font-normal`,a&&`sr-only`),children:e})]})}function cU({error:e}){return e?(0,q.jsxs)(KH,{variant:`destructive`,className:`my-3`,children:[(0,q.jsx)(Jd,{}),(0,q.jsx)(JH,{children:Yl(e)})]}):null}function lU(){return(0,q.jsxs)(`div`,{role:`status`,className:`space-y-4 py-5`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:`Loading…`}),(0,q.jsx)(UH,{className:`h-6 w-40`}),(0,q.jsx)(UH,{className:`h-12 w-full`}),(0,q.jsx)(UH,{className:`h-12 w-full`}),(0,q.jsx)(UH,{className:`h-12 w-3/4`})]})}function uU({title:e,icon:t=Qd,children:n,className:r}){return(0,q.jsxs)(YH,{className:J(`relative isolate overflow-hidden py-20`,r),children:[(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:FP.viewBox,className:`pointer-events-none absolute top-1/2 left-1/2 -z-10 h-52 w-auto -translate-x-1/2 -translate-y-1/2 text-foreground/[0.07] dark:text-foreground/[0.09]`,children:(0,q.jsx)(`path`,{d:FP.path,fill:`none`,stroke:`currentColor`,strokeWidth:5})}),(0,q.jsxs)(XH,{children:[(0,q.jsx)(QH,{variant:`icon`,children:(0,q.jsx)(t,{})}),(0,q.jsx)($H,{children:e})]}),n]})}var dU={backlog:{icon:Qd,color:`text-muted-foreground`},todo:{icon:af,color:`text-muted-foreground`},in_progress:{icon:ef,color:`text-primary`},in_review:{icon:sf,color:`text-[var(--warning)]`},done:{icon:Xd,color:`text-[var(--success)]`},cancelled:{icon:nf,color:`text-muted-foreground`}},fU={urgent:{icon:xf,color:`text-destructive`},high:{icon:Rd,color:`text-[var(--warning)]`},medium:{icon:df,color:`text-foreground`},low:{icon:Id,color:`text-primary`},none:{icon:yf,color:`text-muted-foreground`}};function pU({property:e,value:t,iconOnly:n=!1}){let{icon:r,color:i,label:a}=e===`status`?{...dU[t],label:Yc[t]}:{...fU[t],label:Xc[t]},o=e===`priority`&&t!==`none`?`${a} priority`:a;return(0,q.jsxs)(HH,{variant:`outline`,className:J(e===`status`?`status rounded-full bg-current/8 px-2 text-xs whitespace-nowrap`:`h-6 border-transparent bg-transparent px-0 text-xs`,`gap-1.5 border-transparent font-normal`,i),"data-priority":e===`priority`?t:void 0,role:n?`img`:void 0,"aria-label":n?o:void 0,title:n?o:void 0,children:[(0,q.jsx)(r,{className:e===`status`?`size-3.5`:`size-4.5`,strokeWidth:e===`status`?2:2.5,"aria-hidden":`true`}),!n&&a]})}var mU={a:({children:e,...t})=>(0,q.jsx)(`a`,{...t,target:`_blank`,rel:`noreferrer`,children:e})};function hU({children:e}){return(0,q.jsx)(`div`,{className:`markdown`,children:(0,q.jsx)(Oj,{remarkPlugins:[PP],components:mU,children:e})})}var gU=(0,K.createContext)(null),_U=()=>(0,K.useContext)(gU),vU={default:`max-h-[90dvh] overflow-y-auto p-6 sm:max-w-2xl`,composer:`flex max-h-[calc(100dvh-2rem)] w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl has-[[data-expanded=true]]:h-[calc(100dvh-1rem)] has-[[data-expanded=true]]:w-[calc(100%-1rem)] has-[[data-expanded=true]]:sm:max-w-[calc(100%-1rem)] max-sm:h-dvh max-sm:w-full max-sm:max-w-none max-sm:rounded-none`};function yU({title:e,description:t,trigger:n,children:r,open:i,onOpenChange:a,busy:o=!1,size:s=`default`}){let[c,l]=(0,K.useState)(!1),u=o||c;return(0,q.jsx)(gU,{value:l,children:(0,q.jsxs)(GV,{...i===void 0?{}:{open:i},onOpenChange:(e,t)=>{!e&&u?t.cancel():a?.(e)},children:[n&&(0,q.jsx)(KV,{render:(0,q.jsx)(zP,{variant:`outline`}),children:n}),(0,q.jsxs)(XV,{showCloseButton:!u,className:vU[s],"aria-describedby":void 0,children:[(0,q.jsxs)(ZV,{className:J(`mb-2`,s===`composer`&&`m-0 shrink-0 border-b px-5 py-3 pr-24`),children:[(0,q.jsx)($V,{className:J(`mb-0`,s===`composer`?`text-sm`:`text-lg`),children:e}),t&&(0,q.jsx)(eH,{children:t})]}),r]})]})})}function bU({error:e,pending:t=!1,submitLabel:n,pendingLabel:r,onCancel:i,cancelLabel:a=`Cancel`,submitDisabled:o=!1,children:s}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(cU,{error:e}),(0,q.jsxs)(xU,{children:[s,i&&(0,q.jsx)(zP,{disabled:t,onClick:i,children:a}),(0,q.jsxs)(zP,{type:`submit`,variant:`default`,disabled:t||o,children:[t&&(0,q.jsx)(WH,{}),t&&r?r:n]})]})]})}function xU({children:e,className:t}){return(0,q.jsx)(QV,{className:J(`mt-4`,t),children:e})}function SU({label:e,description:t,onConfirm:n,danger:r=!1,icon:i,disabled:a=!1,open:o,onOpenChange:s,trigger:c=!0}){let[l,u]=(0,K.useState)(!1),d=o??l,f=s??u,[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)();return(0,q.jsxs)(rH,{open:d,onOpenChange:f,children:[c&&(0,q.jsx)(iH,{render:i?(0,q.jsx)(rU,{label:e,disabled:a}):(0,q.jsx)(zP,{variant:r?`destructive`:`outline`,disabled:a}),children:i??e}),(0,q.jsxs)(sH,{children:[(0,q.jsxs)(cH,{children:[(0,q.jsx)(uH,{children:e}),(0,q.jsx)(dH,{children:t})]}),(0,q.jsx)(cU,{error:h}),(0,q.jsxs)(lH,{children:[(0,q.jsx)(pH,{disabled:p,children:`Cancel`}),(0,q.jsx)(fH,{variant:r?`destructive`:`default`,disabled:p,onClick:()=>{m(!0),g(void 0),n().then(()=>f(!1)).catch(g).finally(()=>m(!1))},children:p?`Working…`:e})]})]})]})}function CU({value:e,className:t}){let n=new Date(e);return(0,q.jsx)(`time`,{dateTime:e,title:Xl(e),className:t,children:Lw(n,{addSuffix:!0})})}function wU({value:e,open:t=!0,className:n}){if(!e)return null;let r=t&&Rw(new Date(e));return(0,q.jsxs)(`span`,{className:J(`inline-flex items-center gap-1.5`,r?`text-destructive`:`text-muted-foreground`,n),children:[(0,q.jsx)(Bd,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,q.jsx)(CU,{value:e})]})}function TU({title:e,children:t}){return(0,q.jsxs)(`header`,{className:`mb-4 flex min-h-8 flex-wrap items-center justify-between gap-3`,children:[typeof e==`string`?(0,q.jsx)(`h1`,{className:`m-0 text-base`,children:e}):e,t]})}function EU({title:e,description:t,action:n,compact:r=!1}){return(0,q.jsxs)(`header`,{className:J(`mb-4 flex flex-wrap items-start justify-between gap-3`,r&&`mb-3 items-center gap-2 [&_[data-slot=button]]:h-7 [&_[data-slot=button]]:text-xs`),children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:J(`mb-0 text-sm`,r&&`text-[11px] font-medium tracking-[0.08em] text-muted-foreground uppercase`),children:e}),t&&(0,q.jsx)(`p`,{className:`mt-1.5 mb-0 max-w-xl text-sm text-muted-foreground`,children:t})]}),n]})}function DU({label:e,value:t,onChange:n,placeholder:r=`Search…`,shortcut:i,defaultOpen:a=!1,className:o}){let[s,c]=(0,K.useState)(()=>a||t.length>0),l=(0,K.useRef)(null),u=s||t.length>0;return Ww(i??``,()=>{c(!0),l.current?.focus()},{enabled:!!i}),(0,q.jsxs)(`div`,{role:`search`,"data-expanded":u,className:J(`group/search flex min-w-0 items-center`,u&&`flex-1`,o),children:[(0,q.jsx)(rU,{label:e,size:`icon-sm`,"aria-expanded":u,title:i?`${e} (${i})`:void 0,className:J(`transition-colors`,u&&`text-foreground`),onClick:()=>{c(!0),l.current?.focus()},children:(0,q.jsx)(Tf,{})}),(0,q.jsxs)(`div`,{className:J(`flex items-center overflow-hidden transition-[width,opacity] duration-200 ease-out motion-reduce:transition-none`,u?`w-full max-w-56 opacity-100`:`w-0 opacity-0`),children:[(0,q.jsx)(`input`,{ref:l,type:`search`,"aria-label":e,placeholder:r,value:t,tabIndex:u?0:-1,onChange:e=>n(e.target.value),onBlur:()=>{t||c(a)},onKeyDown:e=>{(e.key===`Escape`||e.key===`Enter`)&&(e.preventDefault(),e.currentTarget.blur())},className:`h-8 min-w-0 flex-1 border-0 border-b border-border bg-transparent px-1 text-sm transition-colors outline-none placeholder:text-muted-foreground focus:border-foreground [&::-webkit-search-cancel-button]:hidden`}),t&&(0,q.jsx)(rU,{label:`Clear ${e.toLowerCase()}`,size:`icon-xs`,onClick:()=>{n(``),c(a)},children:(0,q.jsx)(Df,{})})]})]})}function OU({label:e,value:t,size:n=`icon`,className:r}){let[i,a]=(0,K.useState)(!1);return(0,q.jsx)(rU,{label:e,size:n,className:J(`text-muted-foreground hover:text-foreground`,r),onClick:()=>{Bw(t).then(()=>{a(!0),setTimeout(()=>a(!1),1500),Fy.success(`${t} copied`)}).catch(nU)},children:i?(0,q.jsx)(Hd,{className:`text-(--success)`}):(0,q.jsx)(lf,{})})}function kU({label:e,value:t,inline:n=!1}){let r=(0,K.useId)(),i=(0,q.jsxs)(`div`,{role:`group`,"aria-label":n?e:void 0,"aria-labelledby":n?void 0:r,className:J(`flex min-w-0 items-center gap-3`,!n&&`justify-between`),children:[(0,q.jsx)(`code`,{className:`min-w-0 text-xs break-all`,children:t}),(0,q.jsx)(OU,{label:`Copy ${e.toLowerCase()}`,value:t,size:n?`icon-sm`:`icon`})]});return n?i:(0,q.jsxs)(`div`,{className:`mb-4 min-w-0`,children:[(0,q.jsx)(`span`,{id:r,className:`mb-1 block text-xs text-muted-foreground`,children:e}),i]})}function AU(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=K.useRef(null),o=K.useRef(null),s=Lv(r);Y(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Y(()=>{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 jU(e,t){function n(n,r,i){let a=n.currentTarget;Pc.flushSync(()=>{e.setOpen(!1,Dm(Im,n.nativeEvent,a))}),K_(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&&q_(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function MU(e,t){let n=e.get(t);return typeof n==`string`?n:``}function NU(e){if(e.key!==`Enter`||!e.ctrlKey&&!e.metaKey||e.nativeEvent.isComposing||e.defaultPrevented)return;let t=e.currentTarget;t.querySelector(`button[type="submit"]:disabled`)||(e.preventDefault(),t.requestSubmit())}export{EV as $,Nc as $a,Lu as $i,QC as $n,km as $r,UF as $t,KH as A,Xl as Aa,Qd as Ai,Ww as An,Qh as Ar,yL as At,kH as B,El as Ba,hd as Bi,sw as Bn,Sh as Br,XI as Bt,EU as C,ul as Ca,Tf as Ci,YP as Cn,Og as Cr,TL as Ct,tU as D,Yl as Da,sf as Di,zP as Dn,Z as Dr,DL as Dt,pU as E,dl as Ea,lf as Ei,WP as En,mg as Er,CL as Et,BH as F,Rc as Fa,Rd as Fi,yw as Fn,Nh as Fr,mL as Ft,ZV as G,Dl as Ga,pd as Gi,WC as Gn,Vm as Gr,FI as Gt,JV as H,Xc as Ha,gd as Hi,iw as Hn,nh as Hr,YI as Ht,LH as I,hl as Ia,Id as Ii,vw as In,Mh as Ir,cL as It,HV as J,ll as Ja,sd as Ji,ZC as Jn,Im as Jr,yI as Jt,$V as K,Bc as Ka,dd as Ki,UC as Kn,Fm as Kr,II as Kt,zH as L,Pl as La,Pd as Li,_w as Ln,Ah as Lr,sL as Lt,qH as M,Nl as Ma,Kd as Mi,Bw as Mn,Rh as Mr,EL as Mt,WH as N,Gc as Na,Wd as Ni,Hw as Nn,Lh as Nr,SL as Nt,nU as O,Al as Oa,nf as Oi,LP as On,rg as Or,OL as Ot,HH as P,Wc as Pa,Hd as Pi,Fw as Pn,Ih as Pr,hL as Pt,DV as Q,cl as Qa,Ru as Qi,rw as Qn,Rm as Qr,$F as Qt,IH as R,zl as Ra,bd as Ri,hw as Rn,Oh as Rr,ZI as Rt,DU as S,Ll as Sa,Df as Si,ZP as Sn,Bg as Sr,bL as St,aU as T,$c as Ta,_f as Ti,HP as Tn,Tg as Tr,vL as Tt,XV as U,Vc as Ua,fd as Ui,GC as Un,rh as Ur,GI as Ut,GV as V,Lc as Va,_d as Vi,ow as Vn,vh as Vr,JI as Vt,eH as W,Tl as Wa,md as Wi,JC as Wn,hh as Wr,UI as Wt,PV as X,Fc as Xa,Zu as Xi,tw as Xn,Pm as Xr,sI as Xt,FV as Y,Yc as Ya,rd as Yi,KC as Yn,Km as Yr,lI as Yt,OV as Z,fl as Za,qu as Zi,qC as Zn,zm as Zr,QF as Zt,hU as _,Ql as _a,X as _i,aF as _n,s as _o,Yv as _r,VL as _t,eU as a,wu as aa,Am as ai,OF as an,ms as ao,cb as ar,EB as at,TU as b,Ic as ba,xp as bi,tF as bn,Lv as br,jL as bt,OU as c,ou as ca,Sm as ci,xF as cn,G as co,Fy as cr,Wz as ct,uU as d,uu as da,am as di,vF as dn,Xs as do,gy as dr,mR as dt,Pu as ea,Nm as ei,AF as en,Mc as eo,YC as er,xV as et,cU as f,vu as fa,Kp as fi,dF as fn,vs as fo,_y as fr,oR as ft,lU as g,eu as ga,kp as gi,oF as gn,o as go,Jv as gr,WL as gt,iU as h,tu as ha,zp as hi,lF as hn,d as ho,oy as hr,XL as ht,AU as i,pu as ia,jm as ii,DF as in,Qs as io,sb as ir,kB as it,JH as j,Kc as ja,Xd as ji,Vw as jn,Xh as jr,AL as jt,_U as k,Vl as ka,ef as ki,FP as kn,$h as kr,kL as kt,kU as l,hu as la,mm as li,bF as ln,ic as lo,my as lr,Uz as lt,rU as m,ru as ma,Vp as mi,_F as mn,p as mo,sy as mr,QL as mt,NU as n,su as na,Hm as ni,wF as nn,qs as no,pb as nr,UB as nt,sU as o,fu as oa,Dm as oi,EF as on,cc as oo,Qy as or,xB as ot,bU as p,Du as pa,Bp as pi,pF as pn,W as po,py as pr,aR as pt,UV as q,qc as qa,cd as qi,nw as qn,Lm as qr,LI as qt,jU as r,mu as ra,Mm as ri,TF as rn,zs as ro,mb as rr,AB as rt,SU as s,du as sa,Om as si,SF as sn,Fs as so,Xy as sr,Zz as st,MU as t,Nu as ta,Bm as ti,jF as tn,oc as to,XC as tr,YB as tt,wU as u,_u as ua,lm as ui,yF as un,U as uo,vy as ur,Mz as ut,yU as v,ql as va,wp as vi,iF as vn,l as vo,zv as vr,PL as vt,oU as w,zc as wa,Cf as wi,qP as wn,Eg as wr,wL as wt,CU as x,Rl as xa,J as xi,QP as xn,Dv as xr,_L as xt,xU as y,Jc as ya,Y as yi,rF as yn,Rv as yr,BL as yt,RH as z,Wl as za,yd as zi,mw as zn,Dh as zr,QI as zt};
|
|
92
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return IM(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=PN.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function WN(){return{exit:{taskListCheckValueChecked:KN,taskListCheckValueUnchecked:KN,paragraph:qN}}}function GN(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:JN}}}function KN(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function qN(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function JN(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=PN.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function YN(){return[$j(),CM(),OM(),FN(),WN()]}function XN(e){return{extensions:[eM(),wM(e),kM(),UN(e),GN()]}}var ZN={tokenize:dP,partial:!0},QN={tokenize:fP,partial:!0},$N={tokenize:pP,partial:!0},eP={tokenize:mP,partial:!0},tP={tokenize:hP,partial:!0},nP={name:`wwwAutolink`,tokenize:lP,previous:gP},rP={name:`protocolAutolink`,tokenize:uP,previous:_P},iP={name:`emailAutolink`,tokenize:cP,previous:vP},aP={};function oP(){return{text:aP}}for(var sP=48;sP<123;)aP[sP]=iP,sP++,sP===58?sP=65:sP===91&&(sP=97);aP[43]=iP,aP[45]=iP,aP[46]=iP,aP[95]=iP,aP[72]=[iP,rP],aP[104]=[iP,rP],aP[87]=[iP,nP],aP[119]=[iP,nP];function cP(e,t,n){let r=this,i,a;return o;function o(t){return!yP(t)||!vP.call(r,r.previous)||bP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return yP(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(tP,u,l)(t):t===45||t===95||ZE(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&XE(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function lP(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!gP.call(r,r.previous)||bP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(ZN,e.attempt(QN,e.attempt($N,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function uP(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&_P.call(r,r.previous)&&!bP(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(XE(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||$E(t)||rD(t)||oD(t)||aD(t)?n(t):e.attempt(QN,e.attempt($N,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function dP(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function fP(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(eP,c,s)(t):t===null||rD(t)||oD(t)||t!==45&&aD(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function pP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(eP,t,a)(o):o===null||rD(o)||oD(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function mP(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||rD(o)||oD(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||rD(e)||oD(e)?t(e):r(e)}function a(e){return XE(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):XE(t)?(e.consume(t),o):n(t)}}function hP(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ZE(e)?n(e):t(e)}}function gP(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rD(e)}function _P(e){return!XE(e)}function vP(e){return!(e===47||yP(e))}function yP(e){return e===43||e===45||e===46||e===95||ZE(e)}function bP(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var xP={tokenize:kP,partial:!0};function SP(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:EP,continuation:{tokenize:DP},exit:OP}},text:{91:{name:`gfmFootnoteCall`,tokenize:TP},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:CP,resolveTo:wP}}}}function CP(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=YE(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function wP(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function TP(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||rD(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(YE(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return rD(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function EP(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||rD(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=YE(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return rD(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),lD(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function DP(e,t,n){return e.check(DD,t,e.attempt(xP,t,n))}function OP(e){e.exit(`gfmFootnoteDefinition`)}function kP(e,t,n){let r=this;return lD(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function AP(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&HE(o,o.length,0,bD(s,e.slice(r+1,n),t)),HE(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),HE(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=yD(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=yD(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var jP=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){MP(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function MP(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function NP(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function PP(){return{flow:{null:{name:`table`,tokenize:FP,resolveAll:IP}}}}function FP(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):iD(t)?lD(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||rD(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,iD(t)?lD(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return iD(t)?lD(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return iD(t)?lD(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):iD(n)?lD(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||rD(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function IP(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new jP;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(RP(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=LP(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=LP(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=LP(f,t,o,i,n,d)):(o[0]=o[1],d=LP(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&RP(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=NP(t.events,n))}return e}function LP(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},zP(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=zP(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=zP(t.events,n[2]),a=zP(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},zP(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function RP(e,t,n,r,i){let a=[],o=zP(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function zP(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var BP={name:`tasklistCheck`,tokenize:HP};function VP(){return{text:{91:BP}}}function HP(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return rD(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):iD(r)?e.check({tokenize:UP},t,n)(r):n(r)}}function UP(e,t,n){return lD(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function WP(e){return GE([oP(),SP(),AP(e),PP(),VP()])}var GP={};function KP(e){let t=this,n=e||GP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(WP(n)),a.push(YN()),o.push(XN(n))}var qP={path:`M82 352.8h521.8l181.3.2 8.4.3h2.4A14 14 0 0 1 807 358c2.2 3.9 2.3 7.5 2.4 11.9.4 6 .7 9.6 4.6 14.1 7 3.4 13.2 3.4 20.8 3.3h22.8l28.4-.3h3.8l51.2-1h3.4q112.6-2.8 224.8-15.1l3.4-.4 6.4-.7c14.4-1.6 14.4-1.6 19 .7 2.1 2.7 3 4.6 3.3 8.1-1 9.3-7 17.9-12.3 25.4l-2 2.8a224 224 0 0 1-21 24.2l-2.3 2.4a174 174 0 0 1-20 17.4C1071 510.9 971 540.2 855.3 566.6c-70.4 16-70.4 16-97.3 36.4l-2.5 1.8A100 100 0 0 0 715 677l-.2 3c-.8 32.3 13 61.3 34.2 85l1.9 2.1c31.3 33.5 80.1 49.2 122.7 61.7l6.7 2 3.5 1A31 31 0 0 1 899 844l1.9 4.8 1 3 1.1 3.2 1.3 3.6 6.7 19.6 1.1 3.5a17 17 0 0 1-.2 12c-3 3.7-6.7 5-11.4 5.6h-514l-28.5-.1H227.8c-18-.1-18-.1-23-3.1-2.9-3.3-3-5.5-3-9.8a49 49 0 0 1 3.5-13.8l4.3-13.1c3.6-11.1 7.5-20.8 18.2-26.8 5-2.2 10.4-3.5 15.7-4.8 44-12 87.7-29.3 121.5-60.8l2.5-2.2c21.2-20 33.5-49.3 34.8-78.3.6-27.7-8.4-53.3-26.3-74.5l-2.5-3c-10.3-12-23-20.9-36.5-29l-1.8-1.1c-29.6-18.1-64.5-26.8-97.5-36.6l-3-.9-14-4.1-5.2-1.5-2.2-.6A34 34 0 0 1 193 521a267 267 0 0 1-9.8-23.3l-1.4-3.6c-2.2-3.7-4-5.1-7.8-7.1-5.2-1.2-10.3-1.2-15.6-1.2l-46.8-.7-32.7-.5h-2.7a24 24 0 0 1-17.6-7c-3.8-6.2-3.9-12.3-3.9-19.4v-33l-.1-49.8c0-6.9.9-13.7 5.7-18.8 7-4 13.7-3.9 21.6-3.8`,viewBox:`31 329 1194 594`,bounds:{x:55,y:353,width:1146,height:546}},JP=K.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Gh({disabled:i,focusableWhenDisabled:a,native:o});return _m(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),YP=Ty(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-[13px] font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-7 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`outline`,size:`default`}});function XP(e){return K.isValidElement(e)}function ZP({className:e,variant:t=`outline`,size:n=`default`,render:r,...i}){if(XP(r)&&r.type!==`button`){let{nativeButton:a,focusableWhenDisabled:o,children:s,...c}=i;return K.cloneElement(r,{...c,"data-slot":`button`,className:J(YP({variant:t,size:n,className:e}),typeof r.props.className==`string`?r.props.className:void 0)},...s===void 0?[]:[s])}return(0,q.jsx)(JP,{"data-slot":`button`,className:J(YP({variant:t,size:n,className:e})),render:r,...i})}var QP=`data-valid`,$P=`data-invalid`,eF={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},tF={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},nF={valid(e){return e===null?null:e?{[QP]:``}:{[$P]:``}}},rF={invalid:void 0,name:void 0,validityData:{state:eF,errors:[],error:``,value:``,initialValue:null},setValidityData:Zp,disabled:void 0,setTouched:Zp,setDirty:Zp,setFilled:Zp,setFocused:Zp,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:tF,registerFieldControl:Zp,validation:{getValidationProps:(e,t=$p)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Zp,getInputControl:()=>null,commit:async()=>{},change:Zp}},iF=K.createContext(rF);function aF(e=!0){let t=K.useContext(iF);if(t.setValidityData===Zp&&!e)throw Error(Pm(28));return t}var oF=K.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Zp,validationMode:`onSubmit`,submitCountRef:{current:0}});function sF(){return K.useContext(oF)}var cF=K.createContext({controlId:void 0,registerControlId:Zp,resetControlId:Zp,labelId:void 0,setLabelId:Zp,messageIds:[],setMessageIds:Zp,getDescriptionProps:e=>e});function lF(){return K.useContext(cF)}function uF(e,t,n,r=!0,i,a){let[o,s]=K.useState(),c=Bh(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return Y(()=>{let i=e||t||l||!r?void 0:dF(n.current,c);o!==i&&s(i)}),u}function dF(e,t){let n=fF(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function fF(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function pF(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=lF(),o=Bh(),s=Ip(()=>Symbol()),c=K.useRef(!1),l=K.useRef(!1),u=X(()=>{c.current&&i!==Zp&&(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===Zp){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}var mF=K.createContext({disabled:!1});function hF(){return K.useContext(mF)}function gF(e,t,n){let{setFocused:r,focusOwnerRef:i}=aF(),a=X(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Y(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function _F(e,t,n,r,i=!0,a){let{registerFieldControl:o}=aF(),s=Ip(()=>Symbol());Y(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function vF(e,t){let n=K.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var yF=K.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=aF(),{clearErrors:S,elementRef:C,submitCountRef:w}=sF(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=lF(),k=pF({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=X(()=>x.inputRef.current?.value);_F(x.inputRef,k,j,M,!T,a),Y(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),vF(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=K.useRef(null),P=gF(T,N),F=bb();return _m(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=zm(Vm,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:nF})}),bF=K.forwardRef(function(e,t){return(0,q.jsx)(yF,{ref:t,...e})});function xF({className:e,type:t,...n}){return(0,q.jsx)(bF,{type:t,"data-slot":`input`,className:J(`h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-[13px] dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function SF({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:J(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function CF({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:J(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var wF=Ty(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function TF({className:e,align:t=`inline-start`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:J(wF({align:t}),e),onClick:e=>{e.target instanceof Element&&e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var EF=Ty(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function DF({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,q.jsx)(ZP,{type:t,"data-size":r,variant:n,className:J(EF({size:r}),e),...i})}function OF({className:e,...t}){return(0,q.jsx)(xF,{"data-slot":`input-group-control`,className:J(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function kF({className:e,...t}){return(0,q.jsx)(SF,{"data-slot":`input-group-control`,className:J(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function AF({className:e,...t}){return(0,q.jsx)(`label`,{"data-slot":`label`,className:J(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var jF=K.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return _m(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function MF({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(jF,{"data-slot":`separator`,orientation:t,className:J(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}function NF({className:e,...t}){return(0,q.jsx)(`fieldset`,{"data-slot":`field-set`,className:J(`flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function PF({className:e,variant:t=`legend`,...n}){return(0,q.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:J(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n})}var FF=Ty(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function IF({className:e,orientation:t=`vertical`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:J(FF({orientation:t}),e),...n})}function LF({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`field-content`,className:J(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,e),...t})}function RF({className:e,...t}){return(0,q.jsx)(AF,{"data-slot":`field-label`,className:J(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function zF({className:e,...t}){return(0,q.jsx)(`p`,{"data-slot":`field-description`,className:J(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function BF({className:e,children:t,errors:n,...r}){let i=(0,K.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,q.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,q.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,q.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:J(`text-sm font-normal text-destructive`,e),...r,children:i}):null}var VF={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},HF={...VF,position:`fixed`,margin:0,top:0,left:0},UF={...VF,position:`absolute`};function WF(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var GF=`data-checked`,KF=`data-unchecked`;function qF(e){return{checked(t){return e.indeterminate?{}:t?{[GF]:``}:{[KF]:``}},...nF}}var JF=K.createContext(void 0);function YF(){return K.useContext(JF)}var XF=K.createContext(void 0);function ZF(){let e=K.useContext(XF);if(e===void 0)throw Error(Pm(14));return e}var QF=`data-parent`,$F=K.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:b,...x}=e,{clearErrors:S}=sF(),{disabled:C,name:w,setDirty:T,setFilled:E,setTouched:D,state:O,validationMode:k,validityData:A,validation:j}=aF(),M=hF(),{labelId:N,registerControlId:P,getDescriptionProps:F}=lF(),I=YF(),L=I?.allValues===void 0?void 0:I.parent,R=L!==void 0,z=C||M.disabled||I?.disabled||o,B=w??d,ee=v??B,te=Bh(),ne=I?.registerControlId!==P,re=pF({id:c||void 0,enabled:ne}),ie=y?re:te,ae={};R&&(p?ae=L.getParentProps():ee!==void 0&&(ae=L.getChildProps(ee)));let{checked:oe=n,indeterminate:se=l,onCheckedChange:ce,...le}=ae,ue=I?.value,de=K.useRef(null),fe=gF(z,de),{getButtonProps:pe,buttonRef:me}=Gh({disabled:z,native:y}),he=I?.validation??j,[V,ge]=Np({controlled:ee!==void 0&&ue!==void 0&&!p?ue.includes(ee):oe,default:i,name:`Checkbox`,state:`checked`}),_e=R?!!oe:V,ve=R&&se||l;_F(de,te,V,void 0,!I&&!z,d);let ye=L?.registerChildId,be=K.useRef(null),xe=he.registerInput,Se=I?ee:void 0,Ce=K.useCallback(e=>xe(e,{controlRef:de,value:Se}),[xe,Se]),we=Vp(u,be,p?void 0:Ce),Te=uF(a,N,be,!y,re,x[`aria-label`]);Y(()=>{be.current&&(be.current.indeterminate=ve),I||E(V)},[V,ve,I,E]),vF(V,()=>{I||(S(B),T(V!==A.initialValue),he.change(V))});let Ee=im({checked:V,disabled:z,form:s,name:p?void 0:B,id:y?void 0:re,required:g,ref:we,style:B?UF:HF,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=zm(Vm,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(ce?.(t,n),!n.isCanceled&&(ge(t),ee!==void 0&&I!==void 0&&!p&&!R))){let e=t?[...I.value,ee]:I.value.filter(e=>e!==ee);I.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){de.current?.focus()}},v===void 0?$p:{value:(I?V&&v:v)||``},F,e=>he.getValidationProps(z,e));K.useEffect(()=>{if(!L||ee===void 0)return;let e=L.disabledStatesRef.current;return e.set(ee,z),()=>{e.delete(ee)}},[L,z,ee]);let De=K.useMemo(()=>({...O,checked:_e,disabled:z,readOnly:m,required:g,indeterminate:ve}),[O,_e,z,m,g,ve]),Oe=qF(De),ke=_m(`span`,e,{state:De,ref:[me,de,t],props:[{id:ie,role:`checkbox`,"aria-checked":ve?`mixed`:_e,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Te,[QF]:p?``:void 0,onFocus(){fe(!0)},onBlur(){let e=be.current;e&&(D(!0),fe(!1),k===`onBlur`&&he.commit(I?ue:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=be.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),dh(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||WF(t)?.click()})},onClick(e){if(m||z)return;e.preventDefault();let t=be.current;t&&Wh(t,e)}},x,le,pe,F,e=>he.getValidationProps(z,e)],stateAttributesMapping:Oe}),Ae=ke.props.id;return Y(()=>{if(ye&&!p&&ee!==void 0&&Ae!==void 0)return ye(ee,Ae)},[ye,p,ee,Ae]),(0,q.jsxs)(XF.Provider,{value:De,children:[ke,!V&&!I&&B&&!p&&_!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,form:s,name:B,value:_,disabled:z}),(0,q.jsx)(`input`,{...Ee,suppressHydrationWarning:!0})]})}),eI=K.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=ZF(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Zv(c),f=K.useRef(null),p={...s,transitionStatus:u};Xv({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...qF(s),...Eg},h=a||l,g=_m(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function tI({className:e,...t}){return(0,q.jsx)($F,{"data-slot":`checkbox`,className:J(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,q.jsx)(eI,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none data-checked:animate-in data-checked:zoom-in-50 data-checked:duration-150 motion-reduce:animate-none [&>svg]:size-3.5`,children:t.indeterminate?(0,q.jsx)(jf,{}):(0,q.jsx)(ef,{})})})}function nI(e){let t=K.useRef(!0);t.current&&(t.current=!1,e())}function rI(e){let[t,n]=K.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function iI(e){let t=Ip(aI,e).current;return t.next=e,Y(t.effect),t}function aI(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var oI=[],sI=void 0;function cI(){return sI}function lI(e){oI.push(e)}function uI(e){let t=(t,n)=>{let r=Ip(fI).current,i;try{sI=r;for(let e of oI)e.before(r);i=e(t,n);for(let e of oI)e.after(r);r.didInitialize=!0}finally{sI=void 0}return i};return t.displayName=e.displayName||e.name,t}function dI(e){return K.forwardRef(uI(e))}function fI(){return{didInitialize:!1}}var pI=Jp(19)?gI:_I;function mI(e,t,n,r,i){return pI(e,t,n,r,i)}function hI(e,t,n,r,i){let a=K.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,dv.useSyncExternalStore)(e.subscribe,a,a)}lI({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,dv.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function gI(e,t,n,r,i){let a=cI();if(!a)return hI(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 _I(e,t,n,r,i){return(0,Zw.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var vI=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 mI(this,e,t,n,r)}},yI=class extends vI{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){K.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){K.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{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 K.useDebugValue(e),mI(this,this.selectors[e],t,n,r)}useContextCallback(e,t){K.useDebugValue(e);let n=X(t??Zp);this.context[e]=n}useStateSetter(e){let t=K.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)}})}};function bI(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function xI(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function SI(e,t){return t!=null&&!n_(t)?0:typeof e==`function`?e():e}function CI(e,t,n){let r=SI(e,n);return typeof r==`number`?r:r?.[t]}function wI(e){return typeof e==`function`?e():e}function TI(e,t){return t||e===`click`||e===`mousedown`}function EI(e){return e?.includes(`mouse`)&&e!==`mousedown`}var DI=K.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new yb,currentIdRef:{current:null},currentContextRef:{current:null}});function OI(e,t){e.current=t.current}function kI(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=K.useRef(n),a=K.useRef(n),o=K.useRef(null),s=K.useRef(null),c=bb();return Y(()=>{a.current=n,o.current?i.current={open:CI(i.current,`open`),close:CI(n,`close`)}:i.current=n},[n,o,i,a]),(0,q.jsx)(DI.Provider,{value:K.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function AI(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=K.useContext(DI),[d,f]=K.useState(!1),p=K.useRef(n);return Y(()=>{p.current=n},[n]),Y(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),Y(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:CI(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,zm(Vm))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),Y(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,OI(a,s),u.clear()}},[c,i,a,r,s,u]),K.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}var jI=K.forwardRef(function(e,t){let[n,r]=K.useState();Y(()=>{dg&&ug&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:HF,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function MI(e){return`data-base-ui-${e}`}var NI=0;function PI(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(NI);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Zp;let o=requestAnimationFrame(a);return NI=o,()=>{NI===o&&(cancelAnimationFrame(o),NI=0)}}var FI=`data-base-ui-inert`,II=new WeakMap,LI=new WeakSet,RI=new WeakMap,zI=0;function BI(e){return e?gh(e)?e.host:BI(e.parentNode):null}var VI=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=BI(t);return e.contains(n)?n:null}).filter(e=>e!=null),HI=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},UI=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{uh(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function WI(e,t,n,{mark:r=!0}){let i=VI(t,e),a=r?UI(t,HI(i),new Set(i)):[],o=[],s=[];if(n){let e=VI(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);UI(t,HI(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(II.get(e)||0)+1;II.set(e,r),o.push(e),r===1&&n&&LI.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(RI.get(e)||0)+1;RI.set(e,t),s.push(e),t===1&&e.setAttribute(FI,``)}),zI+=1,()=>{o.forEach(e=>{let t=(II.get(e)||0)-1;II.set(e,t),t||(LI.has(e)||e.removeAttribute(`aria-hidden`),LI.delete(e))}),r&&s.forEach(e=>{let t=(RI.get(e)||0)-1;RI.set(e,t),t||e.removeAttribute(FI)}),--zI,zI||(II=new WeakMap,LI=new WeakSet,RI=new WeakMap)}}function GI(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Ph(e[0]).body;return WI(e,i,n,{mark:r})}var KI={style:{transition:`none`}},qI=`data-base-ui-click-trigger`,JI={fallbackAxisSide:`none`},YI={fallbackAxisSide:`end`},XI={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ZI=K.createContext(null),QI=()=>K.useContext(ZI),$I=MI(`portal`);function eL(e={}){let{ref:t,container:n,componentProps:r=$p,elementProps:i}=e,a=zh(),o=QI()?.portalNode,[s,c]=K.useState(null),[l,u]=K.useState(null),d=X(e=>{e!==null&&u(e)}),f=K.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ph(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=_m(`div`,r,{ref:[t,d],props:[{id:a,[$I]:``},i]}),m=s&&p?Pc.createPortal(p,s):null;return{node:l,nodeId:K.isValidElement(p)?p.props.id:void 0,subtree:m}}var tL=K.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}=eL({container:o,ref:t,componentProps:e,elementProps:c}),f=K.useRef(null),p=K.useRef(null),m=K.useRef(null),h=K.useRef(null),[g,_]=K.useState(null),v=K.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;K.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&av(e)&&(e.type===`focusin`?v.current&&=(sv(l),!1):(ov(l),v.current=!0))}return bI(xI(l,`focusin`,e,!0),xI(l,`focusout`,e,!0))},[l,y]),Y(()=>{l&&b===!0&&v.current&&(sv(l),v.current=!1)},[b,l]);let S=K.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,q.jsxs)(K.Fragment,{children:[d,(0,q.jsxs)(ZI.Provider,{value:S,children:[x&&l&&(0,q.jsx)(jI,{"data-type":`outside`,ref:f,onFocus:e=>{av(e,l)?m.current?.focus():rv(g?g.domReference:null)?.focus()}}),x&&l&&(0,q.jsx)(`span`,{role:s,"aria-owns":u,style:XI}),l&&Pc.createPortal(a,l),x&&l&&(0,q.jsx)(jI,{"data-type":`outside`,ref:p,onFocus:e=>{av(e,l)?h.current?.focus():(nv(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,zm(`focus-out`,e.nativeEvent)))}})]})]})});function nL(){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 rL=class{nodesRef={current:[]};events=nL();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)}},iL=K.createContext(null),aL=K.createContext(null),oL=()=>K.useContext(iL)?.id||null,sL=e=>{let t=K.useContext(aL);return e??t};function cL(e){let t=zh(),n=sL(e),r=oL();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function lL(e){let{children:t,id:n}=e,r=oL();return(0,q.jsx)(iL.Provider,{value:K.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function uL(e){let{children:t,externalTree:n}=e,r=Ip(()=>n??new rL).current;return(0,q.jsx)(aL.Provider,{value:r,children:t})}function dL(e,t){let n=dh(hg(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(e_(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var fL=20,pL=[];function mL(){pL=pL.filter(e=>e.deref()?.isConnected)}function hL(e){mL(),e&&uh(e)!==`body`&&(pL.push(new WeakRef(e)),pL.length>fL&&(pL=pL.slice(-20)))}function gL(){return mL(),pL[pL.length-1]?.deref()}function _L(e){return e?Q_(e)?e:ev(e)[0]||e:null}function vL(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=$_(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Q_(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 yL(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=X(()=>b.current.floatingContext?.nodeId),S=i===!1,C=qg(_)&&S,w=iI(i),T=iI(a),E=iI(o),D=iI(u),O=iI(g),k=sL(m),A=QI(),j=K.useRef(!1),M=K.useRef(!1),N=K.useRef(!1),P=K.useRef(null),F=K.useRef(``),I=K.useRef(``),L=K.useRef(null),R=K.useRef(null),z=Vp(L,p,A?.beforeInsideRef),B=Vp(R,A?.afterInsideRef),ee=bb(),te=bb(),ne=Wv(),re=A!=null,ie=Yg(v),ae=X((e=ie)=>e?ev(e):[]),oe=X(()=>h?.().filter(e=>e!=null)??[]);K.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(ie,pg(Ph(ie)))&&ae().length===0&&!C&&Qg(e)}return xI(Ph(ie),`keydown`,e)},[r,ie,c,C,ae]),K.useEffect(()=>{if(r||!g)return;let e=Ph(ie);function t(){N.current=!1}function n(e){let t=hg(e),n=oe(),r=Z(v,t)||Z(_,t)||Z(A?.portalNode,t)||n.some(e=>e===t||Z(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,mg(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,te.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return bI(xI(e,`pointerdown`,n,!0),xI(e,`pointerup`,t,!0),xI(e,`pointercancel`,t,!0),xI(e,`keydown`,i,!0),t)},[r,v,_,ie,g,A,te,oe]),K.useEffect(()=>{if(r||!l)return;let e=Ph(ie);function n(){M.current=!0,te.start(0,()=>{M.current=!1})}function i(e){let t=hg(e);Q_(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=hg(n);c&&r==null&&a!=null&&Z(v,a)&&hL(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=oe(),p=r?.hasAttribute(MI(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Gv(f),Gv(d)].includes(r),m=!(Z(_,r)||Z(v,r)||Z(r,v)||Z(A?.portalNode,r)||u.some(e=>e===r||Z(e,r))||l.hasMatchingElement(e=>Z(e,r))||p||k&&(Xg(k.nodesRef.current,o).find(e=>Z(e.context?.elements.floating,r)||Z(e.context?.elements.domReference,r))||Zg(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,Yg(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&ie&&vL(ie),s&&i!==_&&!R_(a)&&pg(e)===e.body){if(hh(ie)&&(ie.focus(),s===`popup`)){ne.request(()=>{ie.focus()});return}let e=ae(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ie;hh(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==gL())&&(j.current=!0,t.setOpen(!1,zm(Jm,n)))})}function o(){N.current||(b.current.insideReactTree=!0,ee.start(0,()=>{b.current.insideReactTree=!1}))}let u=hh(_)?_:null;if(v||u)return bI(u&&xI(u,`focusout`,a),u&&xI(u,`pointerdown`,n),v&&xI(v,`focusin`,i),v&&xI(v,`focusout`,a),v&&A&&xI(v,`focusout`,o,!0))},[r,_,v,ie,c,k,A,t,l,s,ae,C,x,b,ee,te,ne,d,f,oe]),K.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${MI(`portal`)}]`)||[]),t=(k?Zg(k.nodesRef.current,x()):[]).find(e=>qg(e.context?.elements.domReference||null))?.context?.elements.domReference,n=GI([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...oe(),t,Gv(f),Gv(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=GI([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,oe]),Y(()=>{if(!g||r||!hh(ie))return;F.current=``,I.current=``;let e=Ph(ie),t=pg(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Z(ie,t))return;let i=null,a=()=>(i??=ae(ie),i[0]||ie),o;o=r===!0||r===null?a():Gv(r),o||=a();let s=Z(ie,pg(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&e_(c);PI(o,{sync:l,preventScroll:o===ie,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=pg(e);return!(t!==o&&Z(ie,t))}})})},[r,g,ie,ae,w,D,O,b]);let se=K.useRef(null);Y(()=>{if(r||!ie){se.current=null;return}se.current&&=(se.current.cancelled=!0,null);let e=Ph(ie),t=pg(e),n=D.current==null;hL(t);function i(e){if(e.open||(F.current=dL(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(MI(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(e_(e.nativeEvent)||t_(e.nativeEvent))j.current=!1;else{let e=!1;Ph(ie).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&uh(t)!==`body`?t:null,s=n?o||a:a||o;return s||=gL()||null,typeof i==`boolean`?s:Gv(i)||s||null}return()=>{y.off(`openchange`,i);let t=pg(e),n=oe(),r=Z(v,t)||n.some(e=>e===t||Z(e,t))||k&&Xg(k.nodesRef.current,x(),!1).some(e=>Z(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};se.current=l,queueMicrotask(()=>{se.current===l&&(se.current=null);let n=_L(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&hh(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,ie,T,E,D,y,k,_,x,oe]),Y(()=>{if(!ug||g||!v)return;let e=pg(Ph(v));hh(e)&&Gg(e)&&Z(v,e)&&e.blur()},[g,v]),Y(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),Y(()=>{if(!r&&ie)return vL(ie),()=>{queueMicrotask(mL)}},[r,ie]);let ce=!r&&(!c||!C)&&(re||c);return(0,q.jsxs)(K.Fragment,{children:[ce&&(0,q.jsx)(jI,{"data-type":`inside`,ref:z,onFocus:e=>{if(c){let e=ae();PI(e[e.length-1])}else A?.portalNode&&(j.current=!1,av(e,A.portalNode)?nv(_)?.focus():Gv(f??A.beforeOutsideRef)?.focus())}}),n,ce&&(0,q.jsx)(jI,{"data-type":`inside`,ref:B,onFocus:e=>{c?PI(ae()[0]):A?.portalNode&&(l&&(j.current=!0),av(e,A.portalNode)?rv(_)?.focus():Gv(d??A.afterOutsideRef)?.focus())}})]})}function bL(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Hm}=t,l=e.context.dataRef,u=K.useRef(void 0),d=Wv(),f=bb(),p=K.useMemo(()=>{function t(t,n,r,i){let a=zm(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=n_(e.pointerType,!0)&&t_(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||n_(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=hg(s),p=Gg(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;r===`mousedown`&&o?u.current=void 0:n_(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return K.useMemo(()=>n?{reference:p}:$p,[n,p])}function xL(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function SL(e){return e!=null&&e.clientX!=null}function CL(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=K.useRef(!1),l=K.useRef(null),[u,d]=K.useState(),[f,p]=K.useState([]),m=X(t=>{e.set(`positionReference`,t)}),h=X((t,n,i)=>{c.current||(!s.current.openEvent||SL(s.current.openEvent))&&e.set(`positionReference`,xL(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=X(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=n_(u)?a:i;K.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=dh(a);function r(t){let n=hg(t);Z(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||SL(s.current.openEvent)?l.current=xI(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),K.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),K.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),K.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=K.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return K.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function wL(){return!1}function TL(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function EL(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=wL,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=sL(c),m=X(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=X(()=>a),{escapeKey:v,outsidePress:y}=TL(s),b=K.useRef(!1),x=K.useRef(!1),S=K.useRef(!1),C=K.useRef(!1),w=K.useRef(!1),T=K.useRef(``),E=K.useRef(null),D=bb(),O=bb(),k=bb(),A=X(()=>{O.clear(),d.current.insideReactTree=!1}),j=X(e=>{let t=d.current.floatingContext?.nodeId;return(p?Xg(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=X(t=>Ug(t,e.select(`floatingElement`))||Ug(t,e.select(`domReferenceElement`))),N=X(t=>{o()&&e.setOpen(!1,zm(Hm,t.nativeEvent))}),P=X(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=$g(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=zm(Ym,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=X(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=X(t=>{if(!l||!n||t.button!==0)return;let r=hg(t.nativeEvent);Z(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=X(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});K.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),K.useEffect(()=>A,[A]),K.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new yb,i=Ph(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(ug?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&Xg(p.nodesRef.current,t).some(t=>Ug(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=hg(n),i=`[${MI(`inert`)}]`,a=mh(r)?r.getRootNode():null,o=Array.from((gh(a)?a:Ph(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z(e,r))))return;let c=mh(r)?r:null;for(;c&&!Dh(c);){let e=Ah(c);if(Dh(e)||!mh(e))break;c=e}if(!(o.length&&mh(r)&&!Wg(r)&&!Z(r,e.select(`floatingElement`))&&o.every(e=>!Z(c,e)))){if(hh(r)&&!(`touches`in n)){let e=Dh(r),t=Oh(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!e_(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}(typeof h!=`function`||h(n))&&(j(`__outsidePressBubbles`)||(e.setOpen(!1,zm(Gm,n)),A()))}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=hg(e);if(!n)return;let r=xI(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function z(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function B(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function ee(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function te(e){L(e,ee)}function ne(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function re(e){L(e,ne)}let ie=bI(r&&bI(xI(i,`keydown`,P),xI(i,`compositionstart`,a),xI(i,`compositionend`,o)),g&&bI(xI(i,`click`,z,!0),xI(i,`pointerdown`,z,!0),xI(i,`pointerup`,B,!0),xI(i,`pointercancel`,B,!0),xI(i,`mousedown`,z,!0),xI(i,`mouseup`,B,!0),xI(i,`touchstart`,R,{capture:!0,passive:!0}),xI(i,`touchmove`,te,{capture:!0,passive:!0}),xI(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{ie(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=K.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=K.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return K.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function DL(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),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};mh(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 OL(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=X(i),{mounted:c,setMounted:l,transitionStatus:u}=Zv(t,!1,!1,o),d=!t&&r;Y(()=>{t&&s(!1)},[t,s]);let f=K.useRef(c),p=K.useRef(!1),m=Fh(),h=()=>{f.current=!1,l(!1),a()};Y(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=X(()=>{f.current&&(t?(p.current=!0,m()):h())});return Xv({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var kL={tabIndex:-1,[gg]:``};function AL(e){return t=>t!==`touch`||e.current}function jL(e,t=!1){let n=zh(),r=oL()!=null,i=Ip(()=>e(n,r)).current;return DL({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function ML({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function NL(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function PL(e,t){let n=K.useRef(null);return X(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),NL(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),NL(t))})}function FL(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 IL(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function LL(e,t,n,r={}){let i=n.reason,a=i===Um,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=IL(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=FL(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Pc.flushSync(l):l()}function RL(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=PL(e,n),o=X(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=X(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function zL(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=K.useRef(null),i=e.useState(`open`);Y(()=>{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=zm(Vm);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 BL(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=OL({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 Ip(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function VL(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:$p,inactiveTriggerProps:$p,popupProps:$p})},[e])}function HL(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var UL=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}},WL={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},GL=class extends yI{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:nL(),nested:n,triggerElements:i},WL),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&r_(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)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function KL(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new GL({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:$p,inactiveTriggerProps:$p,popupProps:$p}}var qL=e=>e.triggerIdProp??e.activeTriggerId,JL=e=>e.openProp??e.open,YL=e=>(e.popupElement?.id??e.floatingId)||void 0;function XL(e,t){return t!==void 0&&JL(e)&&qL(e)===t}function ZL(e,t){return XL(e,t)?!0:t!==void 0&&JL(e)&&qL(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var QL={open:JL,mounted:e=>e.mounted,transitionStatus:e=>JL(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:qL,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:YL,isTriggerActive:(e,t)=>t!==void 0&&qL(e)===t,isOpenedByTrigger:(e,t)=>XL(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&qL(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ZL(e,t)?YL(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function $L(e){let t=K.useCallback(t=>e===void 0?Zp:e.subscribeStore(t),[e]),n=K.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,dv.useSyncExternalStore)(t,n,()=>e?.serverStore)}function eR(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=zh(),a=oL()!=null,o=Ip(()=>new GL({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new UL,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=mh(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var tR=cg&&ug;function nR(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=K.useRef(!1),s=K.useRef(null),c=K.useRef(!0),l=bb();K.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=dh(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&hh(t)&&t===pg(Ph(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return bI(xI(r,`blur`,i),tR&&xI(r,`keydown`,a,!0),tR&&xI(r,`pointerdown`,l,!0))},[e,n]),K.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);mh(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=K.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=hg(n.nativeEvent);if(mh(a)){if(tR&&!n.relatedTarget){if(!c.current&&!Gg(a))return}else if(!Jg(a))return}let u=Hg(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,zm(Wm,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,zm(Wm,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=mh(r)&&r.hasAttribute(MI(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=pg(Ph(t));(r||n!==t)&&(Z(a.current.floatingContext?.refs.floating.current,n)||Z(t,n)||o||Hg(r??n,e.context.triggerElements)||e.setOpen(!1,zm(Wm,i)))})}}},[a,r,e,l]);return K.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var rR=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new yb;restTimeout=new yb;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},iR=new WeakMap;function aR(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&iR.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),iR.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function oR(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=iR.get(n);a&&a!==e&&aR(a),aR(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,iR.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function sR(e){let t=e.context.dataRef.current,n=Ip(()=>t.hoverInteractionState??rR.create()).current;return t.hoverInteractionState||=n,Bv(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function cR(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=sL(),u=oL(),d=sR(e),f=bb(),p=X(()=>TI(c.current.openEvent?.type,d.interactedInside)),m=X(()=>EI(c.current.openEvent?.type)),h=X(()=>{aR(d)});Y(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),K.useEffect(()=>h,[h]),Y(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&mh(s)&&o){let e=s,t=o,n=Ph(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??mg(e,`[data-rootownerid]`)??n.body;return oR(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),K.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Xg(l.nodesRef.current,u).length>0)}function a(t){let n=CI(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,zm(Um,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=hg(e);Kg(t)?d.interactedInside=mg(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Hg(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&mh(o)&&Xg(l.nodesRef.current,r,!1).some(e=>Z(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,zm(Um,n)),l.events.emit(`floating.closed`,n)})}let y=o;return bI(y&&xI(y,`mouseenter`,g),y&&xI(y,`mouseleave`,_),y&&xI(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var lR={current:null};function uR(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=lR,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=sL(l),v=sR(e),y=K.useRef(!1),b=iI(i),x=iI(r),S=iI(o),C=iI(n),w=iI(p),T=iI(f),E=X(()=>TI(h.current.openEvent?.type,v.interactedInside)),D=X(()=>w.current?.()!==!1),O=X((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Z(t,n);if(!mh(r))return!1;let a=r;return i.hasMatchingElement(e=>Z(e,a))&&(!t||!Z(t,a))}),k=X(()=>{v.handler&&=(Ph(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=X(()=>{aR(v)});return u&&(v.handleCloseOptions=i?.__options),K.useEffect(()=>k,[k]),K.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===Um,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),K.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=CI(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,zm(Um,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,zm(Um,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!mh(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!n_(v.pointerType))return;let n=wI(S.current),r=CI(x.current,`open`,v.pointerType),i=hg(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(mh(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Z(t,i)){c=t;break}}mh(o)&&mh(s)&&!e.context.triggerElements.hasElement(o)&&Z(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&mh(c)&&mh(s)&&Z(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,zm(Um,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,zm(Um,t,c))}):g&&D()&&e.setOpen(!0,zm(Um,t,c)))}function o(n){if(E()){A();return}k();let r=Ph(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Hg(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!Z(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){Z(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?xI(r,`mouseout`,l):void 0;return s?bI(xI(r,`mousemove`,i,{once:!0}),xI(r,`mouseenter`,i),xI(r,`mouseleave`,o),f):bI(xI(r,`mouseenter`,i),xI(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),K.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!n_(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;oR(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=wI(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,zm(Um,n,r))}v.pointerType===`touch`?Pc.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function dR(e){return ug&&e.movementX===0&&e.movementY===0}function fR(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function pR(e,t){return fR(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function mR(e,t,n){return fR(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function hR(e,t,n){return fR(t,n?e===vg:e===yg,e===xg)}function gR(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:fR(t,n?e===yg:e===vg,e===bg)}function _R(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=Yg(E),A=qg(D),j=iI(k),M=oL(),N=sL(x),P=K.useRef(f),F=K.useRef(o??-1),I=K.useRef(null),L=K.useRef(!0),R=X(e=>{i(F.current===-1?null:F.current,e)}),z=K.useRef(!!E),B=K.useRef(T),ee=K.useRef(!1),te=K.useRef(!1),ne=K.useRef(null),re=iI(h),ie=iI(T),ae=iI(o),oe=iI(b),se=Wv(),ce=Wv(),le=X(()=>{se.cancel();function e(e){d||(ne.current=PI(e,{sync:ee.current,preventScroll:!0}))}let t=n.current[F.current],r=te.current;t&&e(t),(ee.current?e=>e():e=>se.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),he&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{O.current.orientation=g},[O,g]),Y(()=>{T||(I.current=null),(!T||f!==`auto`)&&(P.current=f)},[T,f]),Y(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(te.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),Y(()=>{if(a){if(!T)ee.current=!1;else if(E){if(r==null){if(ee.current=!1,ae.current!=null)return;if(z.current&&(F.current=-1,le()),(!B.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||mR(I.current,_,u)||l?M_(n):N_(n),I.current=null,R())};t()}}else j_(n.current,r)||(F.current=r,le(),te.current=!1)}}},[a,T,E,r,ae,l,n,_,u,R,le,ce]),Y(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=pg(Ph(D??t??null)),r=e.some(e=>e.context&&Z(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Y(()=>{B.current=T,z.current=!!E});let ue=r!=null,de=X(e=>{if(!ie.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),fe=X(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),pe=X(()=>M_(n,re.current)),me=X(t=>{if(L.current=!1,ee.current=!0,t.which===229||!ie.current&&t.currentTarget===j.current)return;if(l&&gR(t.key,g,u,w)){pR(t.key,fe())||Qg(t),e.setOpen(!1,zm(Xm,t.nativeEvent));let n=S?.current??D;hh(n)&&n.focus();return}r!=null&&r!==F.current&&!j_(n.current,r)&&(F.current=r);let i=F.current,a=M_(n,h),o=N_(n,h);if(A||(t.key===`Home`&&(Qg(t),F.current=a,R(t)),t.key===`End`&&(Qg(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(pR(t.key,g)){Qg(t);let e=pg(t.currentTarget.ownerDocument);if(T&&!d&&Z(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Z(t,e))){F.current=mR(t.key,g,u)?a:o,R(t),r===F.current&&le();return}let{index:l,wrapped:f}=P_(n.current,i,{decrement:!mR(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ee.current=!1),F.current=l,R(t)}}),he=K.useMemo(()=>({onFocus(e){ee.current=!0,de(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){dR(e)||(ee.current=!0,te.current=!1,p&&de(e))},onPointerLeave(e){if(!ie.current||!L.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&oe.current&&(ne.current?.(),ne.current=null,F.current=-1,R(e),!d)){let e=j.current,t=pg(Ph(e));e&&Z(e,t)&&e.focus({preventScroll:!0})}}}),[de,ie,j,p,n,R,oe,d]),V=K.useMemo(()=>d&&T&&ue&&{"aria-activedescendant":`${y}-${r}`},[d,T,ue,y,r]),ge=K.useMemo(()=>({...A?{}:V,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=hg(t.nativeEvent);if(n&&!Z(j.current,n))return;Qg(t);let r=zm(Jm,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&hh(i)&&i.focus()}else me(t)},onPointerMove(e){dR(e)||(L.current=!0)}}),[V,me,j,A,e,T,d,D,S]),_e=K.useMemo(()=>{function t(t){e.setOpen(!0,zm(Xm,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&e_(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&t_(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=hR(n.key,fe(),u),o=pR(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Gg(n.currentTarget)))return me(n);if(r||m||!i){if(s){let e=pR(n.key,fe());I.current=l&&e?null:n.key}l?a&&(Qg(n),r?(F.current=pe(),R(n),d&&j.current?.focus()):t(n)):o&&(ae.current!=null&&(F.current=ae.current),Qg(n),!r&&m?t(n):me(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[me,f,pe,l,R,e,m,g,_,fe,u,ae,d,j]),ve=K.useMemo(()=>({...V,..._e}),[V,_e]);return K.useMemo(()=>a?{reference:ve,floating:ge,item:he,trigger:_e}:{},[a,ve,ge,_e,he])}function vR(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=X(s),f=e.useState(`open`),p=bb(),m=K.useRef(``),h=K.useRef(u??i??-1),g=K.useRef(null),_=X(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!R_(n)||n?.matches(`:disabled`)?!1:o==null||!I_(Qp,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Qg(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Qg(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=X(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Z(r,n)||Z(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Y(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=K.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return K.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var yR=.1,bR=yR*yR,xR=.5;function SR(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function CR(e,t,n,r,i,a,o,s,c,l){let u=!1;return SR(e,t,n,r,i,a)&&(u=!u),SR(e,t,i,a,o,s)&&(u=!u),SR(e,t,o,s,c,l)&&(u=!u),SR(e,t,c,l,n,r)&&(u=!u),u}function wR(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function TR(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 ER(e={}){let{blockPointerEvents:t=!1}=e,n=new yb,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*bR;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=hg(r),g=r.type===`mouseleave`,_=Z(u,h),v=Z(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&mh(r.relatedTarget)&&Z(u,r.relatedTarget))return;function y(){return!!(s&&Xg(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=TR(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=TR(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=TR(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=TR(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!wR(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?xR/2:xR*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+xR+1,o=C||T?S.bottom-xR:S.top,s=C?T?S.bottom-xR:S.top:S.bottom-xR;M=CR(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?xR/2:xR*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-xR,o=C||T?S.top+xR:S.bottom,s=C?T?S.top+xR:S.bottom:S.top+xR;M=CR(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?xR/2:xR*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+xR+1,o=w||E?S.right-xR:S.left,s=w?E?S.right-xR:S.left:S.right-xR;M=CR(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?xR/2:xR*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-xR,o=w||E?S.left+xR:S.right,s=w?E?S.left+xR:S.right:S.left+xR;M=CR(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 DR(e,t,n){let{reference:r,floating:i}=e,a=g_(t),o=__(t),s=h_(o),c=f_(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=p_(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function OR(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}=d_(t,e),p=k_(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=A_(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=A_(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 kR=50,AR=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:OR},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=DR(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<kR&&(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}=DR(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},jR=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}=d_(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=f_(r),_=g_(o),v=f_(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[D_(o)]:y_(o)),x=p!==`none`;!d&&x&&b.push(...E_(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=v_(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`||_===g_(t)||T.every(e=>g_(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=g_(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{}}}},MR=new Set([`left`,`top`]);async function NR(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=f_(n),s=p_(n),c=g_(n)===`y`,l=MR.has(o)?-1:1,u=a&&c?-1:1,d=d_(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 PR=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 NR(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}}}}},FR=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}=d_(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=g_(i),p=m_(f),m=u[p],h=u[f],g=(e,t)=>u_(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}}}}}},IR=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}=d_(e,t),u={x:n,y:r},d=g_(i),f=m_(d),p=u[f],m=u[d],h=d_(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=MR.has(f_(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}}}},LR=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}=d_(e,t),c=await i.detectOverflow(t,s),l=f_(n),u=p_(n),d=g_(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=i_(p-c[m],g),y=i_(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*a_(c.left,c.right):S=p-2*a_(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 RR(e){let t=Oh(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hh(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=o_(n)!==a||o_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function zR(e){return mh(e)?e:e.contextElement}function BR(e){let t=zR(e);if(!hh(t))return c_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=RR(t),o=(a?o_(n.width):n.width)/r,s=(a?o_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var VR=c_(0);function HR(e){let t=dh(e);return!Eh()||!t.visualViewport?VR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UR(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===dh(e)}function WR(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=zR(e),o=c_(1);t&&(r?mh(r)&&(o=BR(r)):o=BR(e));let s=UR(a,n,r)?HR(a):c_(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=dh(a),t=mh(r)?dh(r):r,n=e,i=Nh(n);for(;i&&t!==n;){let e=BR(i),t=i.getBoundingClientRect(),r=Oh(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=dh(i),i=Nh(n)}}return A_({width:u,height:d,x:c,y:l})}function GR(e,t){let n=kh(e).scrollLeft;return t?t.left+n:WR(fh(e)).left+n}function KR(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-GR(e,n),y:n.top+t.scrollTop}}function qR(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=fh(r),s=t?yh(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=c_(1),u=c_(0),d=hh(r);if((d||!a)&&((uh(r)!==`body`||_h(o))&&(c=kh(r)),d)){let e=WR(r);l=BR(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?KR(o,c):c_(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 JR(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function YR(e){let t=kh(e),n=e.ownerDocument.body,r=a_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=a_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+GR(e),o=-t.scrollTop;return Oh(n).direction===`rtl`&&(a+=a_(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var XR=25;function ZR(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=dh(e),a=fh(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Eh()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(GR(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<=XR&&(s-=o)}return{width:s,height:c,x:l,y:u}}function QR(e,t){let n=WR(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=BR(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $R(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ZR(e,n,t);else if(t===`document`)r=YR(fh(e));else if(mh(t))r=QR(t,n);else{let n=HR(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return A_(r)}function ez(e,t){let n=t.get(e);if(n)return n;let r=Mh(e,[],!1).filter(e=>mh(e)&&uh(e)!==`body`),i=null,a=Oh(e).position===`fixed`,o=a?Ah(e):e;for(;mh(o)&&!Dh(o);){let e=Oh(o),t=wh(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ah(o)}return t.set(e,r),r}function tz(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?yh(t)?[]:ez(t,this._c):[].concat(n),r],o=$R(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=$R(t,a[e],i);s=a_(n.top,s),c=i_(n.right,c),l=i_(n.bottom,l),u=a_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function nz(e){let{width:t,height:n}=RR(e);return{width:t,height:n}}function rz(e,t,n){let r=hh(t),i=fh(t),a=n===`fixed`,o=WR(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=c_(0);if((r||!a)&&((uh(t)!==`body`||_h(i))&&(s=kh(t)),r)){let e=WR(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=GR(i));let l=i&&!r&&!a?KR(i,s):c_(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 iz(e){return Oh(e).position===`static`}function az(e,t){if(!hh(e)||Oh(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return fh(e)===n&&(n=n.ownerDocument.body),n}function oz(e,t){let n=dh(e);if(yh(e))return n;if(!hh(e)){let t=Ah(e);for(;t&&!Dh(t);){if(mh(t)&&!iz(t))return t;t=Ah(t)}return n}let r=az(e,t);for(;r&&vh(r)&&iz(r);)r=az(r,t);return r&&Dh(r)&&iz(r)&&!wh(r)?n:r||Th(e)||n}var sz=async function(e){let t=this.getOffsetParent||oz,n=this.getDimensions,r=await n(e.floating);return{reference:rz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cz(e){return Oh(e).direction===`rtl`}var lz={convertOffsetParentRelativeRectToViewportRelativeRect:qR,getDocumentElement:fh,getClippingRect:tz,getOffsetParent:oz,getElementRects:sz,getClientRects:JR,getDimensions:nz,getScale:BR,isElement:mh,isRTL:cz};function uz(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dz(e,t,n){let r=null,i,a=fh(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=s_(d),h=s_(a.clientWidth-(u+f)),g=s_(a.clientHeight-(d+p)),_=s_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:a_(0,i_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!uz(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=dh(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function fz(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=zR(e),u=i||a?[...l?Mh(l):[],...t?Mh(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?dz(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?WR(e):null;c&&g();function g(){let t=WR(e);h&&!uz(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 pz=PR,mz=FR,hz=jR,gz=LR,_z=IR,vz=(e,t,n)=>{let r=new Map,i=n??{},a={...lz,...i.platform,_c:r};return AR(e,t,{...i,platform:a})},yz=typeof document<`u`?K.useLayoutEffect:function(){};function bz(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(!bz(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)&&!bz(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xz(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sz(e,t){let n=xz(e);return Math.round(t*n)/n}function Cz(e){let t=K.useRef(e);return yz(()=>{t.current=e}),t}function wz(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]=K.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=K.useState(r);bz(f,r)||p(r);let[m,h]=K.useState(null),[g,_]=K.useState(null),v=K.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=K.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=K.useRef(null),C=K.useRef(null),w=K.useRef(u),T=c!=null,E=Cz(c),D=Cz(i),O=Cz(l),k=K.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),vz(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!bz(w.current,t)&&(w.current=t,Pc.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);yz(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=K.useRef(!1);yz(()=>(A.current=!0,()=>{A.current=!1}),[]),yz(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=K.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=K.useMemo(()=>({reference:b,floating:x}),[b,x]),N=K.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Sz(M.floating,u.x),r=Sz(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xz(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return K.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Tz=(e,t)=>{let n=pz(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ez=(e,t)=>{let n=mz(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dz=(e,t)=>({fn:_z(e).fn,options:[e,t]}),Oz=(e,t)=>{let n=hz(e);return{name:n.name,fn:n.fn,options:[e,t]}},kz=(e,t)=>{let n=gz(e);return{name:n.name,fn:n.fn,options:[e,t]}},Az=K.createContext(void 0),jz=K.createContext(void 0);function Mz(){let e=K.useContext(Az);if(e===void 0)throw Error(Pm(60));return e}function Nz(){let e=K.useContext(jz);if(e===void 0)throw Error(Pm(61));return e}function Pz(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Fz=(e,t)=>Object.is(e,t);function Iz(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Lz(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Pz(e,t,(e,t)=>Iz(e,t,n)):e!==t}function Rz(e,t,n){return e?e.some(e=>e!==void 0&&Iz(t,e,n)):!1}function zz(e,t,n){return e?e.findIndex(e=>e!==void 0&&Iz(e,t,n)):-1}function Bz(e,t){if(t!==Fz)return n=>Rz(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function Vz(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(Bz(t,n)):zz(e,t,n);return i===-1?null:i}function Hz(e,t,n,r,i,a){return Rz(r,t,i)?a!=null&&e>a&&Rz(r,n[a],i)?a:e:e===a?Vz(n,r,i,!0):a}function Uz(e,t,n){return e.filter(e=>!Iz(t,e,n))}function Wz(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Gz(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Kz(e){return Gz(e?.[0])}function qz(e){return Kz(e)?e.flatMap(e=>e.items):e}function Jz(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Kz(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Yz(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Wz(e)}function Xz(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Wz(e.value):Wz(e)}function Zz(e,t,n){function r(){return Yz(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=qz(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Qz(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,q.jsx)(K.Fragment,{children:Zz(r,t,n)},i)),e),[])}var $z={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Xz(t,r)!==``},hasNullItemLabel:(e,t)=>t?Jz(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Iz(t,e,n)):Iz(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function eB(e){let t=K.useRef(``),n=K.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:K.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function tB(e,t){let{onClick:n,onPointerDown:r}=eB(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(ag?`touch`:``))}));return K.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function nB(e){let[t,n]=K.useState(null),r=tB(e,n);return vF(e,t=>{t&&!e&&n(null)}),K.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function rB(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function iB(e,t){return Math.max(0,e-t)}function aB(e,t){if(t<=0)return 0;let n=rB(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 oB(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=Fz,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=sF(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=aF(),F=pF({id:t}),I=M||d,L=j??c,[R,z]=Np({controlled:n,default:y?r??Qp:r,name:`Select`,state:`value`}),[B,ee]=Np({controlled:a,default:o,name:`Select`,state:`open`}),te=K.useRef([]),ne=K.useRef([]),re=K.useRef(null),ie=K.useRef(null),ae=K.useRef(0),oe=K.useRef(null),se=K.useRef([]),ce=K.useRef(!1),le=K.useRef(null),ue=K.useRef(null),de=K.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=K.useRef(!1),pe=K.useRef(R),{openMethod:me,triggerProps:he}=nB(B),V=Ip(()=>new yI({id:F,labelId:void 0,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:B,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:$p,triggerProps:$p,itemRoot:{props:$p,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:Zp,setOpen:Zp,handleScrollArrowVisibility:Zp,onOpenChangeComplete:Zp,listRef:te,popupRef:re,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:oe,valuesRef:se,labelsRef:ne,typingRef:ce,selectionRef:de,firstItemTextRef:le,selectedItemTextRef:ue,alignItemWithTriggerActiveRef:fe,initialValueRef:pe},$z)).current,[ge,_e]=K.useState(!1),{mounted:ve,transitionStatus:ye,forceUnmount:be}=OL({open:B,ref:re,preventUnmountOnClose:ge,setPreventUnmountOnClose:_e,onUnmount(){V.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),xe=V.useState(`activeIndex`),Se=V.useState(`selectedIndex`),Ce=V.useState(`triggerElement`),we=V.useState(`positionerElement`),Te=rI(me),Ee=me??Te,De=K.useMemo(()=>y?``:Xz(R,x),[y,R,x]),Oe=K.useMemo(()=>y&&Array.isArray(R)?R.map(e=>Xz(e,x)):Xz(R,x),[y,R,x]);_F(iI(Ce),F,R,X(()=>Oe),!I,c);let ke=y?Array.isArray(R)&&R.length>0:R!=null&&De!==``;Y(()=>{A(ke)},[ke,A]),Y(function(){let e=Vz(se.current,R,S,y);e===null&&(ue.current=null),!B&&V.set(`selectedIndex`,e)},[y,B,R,S,V]),vF(R,()=>{T(L),E(Lz(R,k.initialValue,S)),N.change(R)});let Ae=X((e,t)=>{let n=t,r=IL(n);s?.(e,n),!t.isCanceled&&(e||_e(r()),ee(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(R)))});K.useImperativeHandle(h,()=>({unmount:be,close:()=>{V.state.open&&Ae(!1,zm(ih))}}),[be,Ae,V]);let je=X((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),Me=X(e=>{let t=iB(e.scrollHeight,e.clientHeight),n=aB(e.scrollTop,t),r=n>0,i=n<t;V.set(`scrollUpArrowVisible`,r),V.set(`scrollDownArrowVisible`,i)}),Ne=eR({open:B,onOpenChange:Ae,elements:{reference:Ce,floating:we}}),Pe=bL(Ne,{enabled:!I,event:`mousedown`}),Fe=EL(Ne),Ie=_R(Ne,{enabled:!I,listRef:te,activeIndex:xe,selectedIndex:Se,disabledIndices:Qp,onNavigate(e){(e!==null||B)&&V.set(`activeIndex`,e)},focusItemOnHover:C}),Le=vR(Ne,{enabled:!I&&(B||!f&&!y),listRef:ne,activeIndex:xe,selectedIndex:Se,disabledIndices:e=>ty(te.current[e]),onMatch(e){B?V.set(`activeIndex`,e):je(se.current[e],zm(Vm))},onTyping(e){ce.current=e}}),Re=K.useMemo(()=>im(Le.reference,Ie.reference,Fe.reference,Pe.reference,he),[Pe.reference,Le.reference,Ie.reference,Fe.reference,he]),ze=K.useMemo(()=>im(kL,Le.floating,Ie.floating,Fe.floating),[Le.floating,Ie.floating,Fe.floating]),Be=Ie.item??$p,H=K.useMemo(()=>({props:Be,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S}),[Be,y,I,f,S]);V.useContextCallback(`setValue`,je),V.useContextCallback(`setOpen`,Ae),V.useContextCallback(`handleScrollArrowVisibility`,Me),V.useContextCallback(`onOpenChangeComplete`,_),nI(()=>{V.update({popupProps:ze,triggerProps:Re,itemRoot:H})}),V.useSyncedValues({id:F,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,value:R,open:B,mounted:ve,transitionStatus:ye,popupProps:ze,triggerProps:Re,itemRoot:H,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Ee});let Ve=Vp(g,N.inputRef),He=y?void 0:L,Ue=K.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=Xz(e,x);return(0,q.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,q.jsxs)(Az.Provider,{value:V,children:[(0,q.jsx)(jz.Provider,{value:Ne,children:w}),(0,q.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){V.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=zm(Vm,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=se.current.findIndex(t=>Xz(t,x).toLowerCase()===e||Yz(t,b).toLowerCase()===e);r===-1&&(r=se.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=se.current[r];i!=null&&je(i,n)}V.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&He==null?`${F}-hidden-input`:void 0,form:l,name:He,autoComplete:u,value:De,disabled:I,required:p&&!(y&&ke),readOnly:f,ref:Ve,style:L?UF:HF,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ue]})}function sB(e,t){return e??t}var cB=5;function lB(e,t){let n=uB(t);return e.clientX>=n.left-cB&&e.clientX<=n.right+cB&&e.clientY>=n.top-cB&&e.clientY<=n.bottom+cB}function uB(e){let t=e.getBoundingClientRect(),n=dh(e);if(fg)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var dB=`data-popup-side`,fB=400,pB={...Rg,...nF,popupSide:e=>e?{[dB]:e}:null,value:()=>null},mB=K.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=aF(),{labelId:m}=lF(),h=Mz(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,b=h.useState(`open`),x=h.useState(`mounted`),S=h.useState(`value`),C=h.useState(`triggerProps`),w=h.useState(`positionerElement`),T=h.useState(`listElement`),E=h.useState(`popupSide`),D=h.useState(`id`),O=h.useState(`labelId`),k=h.useState(`hasSelectedValue`),A=x&&w?E:null,j=i??D,M=sB(m,O);pF({id:i});let N=iI(w),P=K.useRef(null),F=gF(y,P),{getButtonProps:I,buttonRef:L}=Gh({disabled:y,native:o}),R=h.useStateSetter(`triggerElement`),z=bb(),B=bb(),ee=bb();K.useEffect(()=>{if(b)return ee.start(fB,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[b,h,B,ee]);let te=im(C,{id:j,role:`combobox`,"aria-expanded":b,"aria-haspopup":`listbox`,"aria-controls":b?T?.id??Yg(w)?.id:void 0,"aria-labelledby":M,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){F(!0),b&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,zm(Vm,e.nativeEvent)),z.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){Z(w,e.relatedTarget)||(l(!0),F(!1),u===`onBlur`&&d.commit(S))},onMouseDown(e){if(b)return;let t=Ph(e.currentTarget);function n(e){if(!P.current)return;let t=e.target;Z(P.current,t)||Z(N.current,t)||lB(e,P.current)||h.context.setOpen(!1,zm($m,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),ne=d.getValidationProps(y,te);ne.role=`combobox`;let re={...f,open:b,disabled:y,value:S,readOnly:g,popupSide:A,placeholder:!k};return _m(`button`,e,{ref:[t,P,L,R],state:re,stateAttributesMapping:pB,props:ne})}),hB={value:()=>null},gB=K.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Mz(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?Qz(l,u,d):Zz(l,u,d)),_m(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:hB})}),_B=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return _m(`span`,e,{state:{open:Mz().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Lg})}),vB=K.forwardRef(function(e,t){let n=Mz(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,q.jsx)(tL,{ref:t,...e}):null});function yB(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]=K.useState(null),d=K.useRef(null),f=sL(n),p=K.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=wz({...e,elements:{...p,...l&&{reference:l}}}),h=K.useCallback(e=>{let t=mh(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=K.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=K.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=K.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Y(()=>{o&&(d.current=o)},[o]),Y(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),K.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var bB=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}=d_(e,t)||{};if(l==null)return{};let d=k_(u),f={x:n,y:r},p=__(i),m=h_(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=u_(D,k,O),j=!c.arrow&&p_(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}}}),xB=(e,t)=>{let{name:n,fn:r}=bB(e);return{name:n,fn:r,options:[e,t]}},SB={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}}}},CB={sideX:`left`,sideY:`top`},wB=`--available-width`,TB=`--available-height`,EB=`--anchor-width`,DB=`--anchor-height`,OB=`--transform-origin`,kB=wB,AB=TB;function jB(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 MB(e,t,n){let{rects:r,placement:i}=e;return{side:jB(t,f_(i),n),align:p_(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function NB(e){return PB(e,yB)}function PB(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=X(O),A=O?k:n,j=iI(n),M=iI(g),N=vy()===`rtl`,[P,F]=K.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?f_(P):null,R=P&&I?p_(P)||`center`:null,z=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],B=R||o,ee=B===`center`?z:`${z}-${B}`,te=l;typeof te==`number`?te={top:te,right:te,bottom:te,left:te}:te&&={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0};let ne=+(i===`bottom`),re=+(i===`top`),ie=+(i===`right`),ae=+(i===`left`),oe={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:te},se=K.useRef(null),ce=iI(a),le=iI(s),ue=typeof a==`function`?0:a,de=typeof s==`function`?0:s,fe=[];p&&fe.push(p),fe.push(Tz(e=>{let t=MB(e,i,N),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof le.current==`function`?le.current(t):le.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ue,de,N,i]));let pe=w===`none`&&C!==`shift`,me=!pe&&(u||E||C===`shift`),he=C===`none`?null:Oz({...oe,padding:{top:te.top+1+ne,right:te.right+1+ae,bottom:te.bottom+1+re,left:te.left+1+ie},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),V=pe?null:Ez({...oe,rootBoundary:D,mainAxis:w!==`none`,crossAxis:me,limiter:u||E?void 0:Dz(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=g_(f_(e.placement)),i=r===`y`?t:n,a=r===`y`?te.left+te.right:te.top+te.bottom;return{offset:i/2+a/2}})},[oe,u,E,D,te,w]);C===`shift`||w===`shift`||B===`center`?fe.push(V,he):fe.push(he,V),fe.push(kz({...oe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(kB,`${t}px`),i.setProperty(AB,`${n}px`);let a=dh(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(EB,`${u}px`),i.setProperty(DB,`${d}px`)}}),xB(e=>({element:se.current||Ph(e.elements.floating).createElement(`div`),padding:se.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=f_(r),u=p_(r),d=g_(l)===`y`,f=se.current,p=typeof a==`function`?a(MB(e,i,N)):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 me&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(OB,d?`${m} ${h}`:`${h} ${m}`),{}}},SB,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ge=K.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:_e,elements:ve,x:ye,y:be,middlewareData:xe,update:Se,placement:Ce,context:we,isPositioned:Te,floatingStyles:Ee}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:fe,strategy:r,whileElementsMounted:m?void 0:(...e)=>fz(...e,ge),nodeId:y,externalTree:S}),{sideX:De,sideY:Oe}=xe.adaptiveOrigin||CB,ke=Te?r:`fixed`,Ae=K.useMemo(()=>{let e;return e=Te?b?{position:ke,[De]:ye,[Oe]:be}:{...Ee,position:ke}:{position:ke,top:0,left:0},e[kB]=`100vw`,e[AB]=`100vh`,Te||(e.opacity=0),e},[b,ke,De,ye,Oe,be,Ee,Te]),je=K.useRef(null);Y(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(FB(t)?t.current:t)||null;n!==je.current&&(_e.setPositionReference(n),je.current=n)},[g,_e,A,j]),K.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&FB(e)&&e.current!==je.current&&(_e.setPositionReference(e.current),je.current=e.current)},[g,_e,A,j]),K.useEffect(()=>{if(m&&g&&ve.reference&&ve.floating)return fz(ve.reference,ve.floating,Se,ge)},[m,g,ve,Se,ge]);let Me=f_(Ce),Ne=jB(i,Me,N),Pe=p_(Ce)||`center`,Fe=!!xe.hide?.referenceHidden;Y(()=>{x&&g&&Te&&(Me!==z||I&&Pe!==B)&&F(Ce)},[x,I,g,Te,Ce,Me,Pe,z,B]);let Ie=K.useMemo(()=>({position:`absolute`,top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),Le=xe.arrow?.centerOffset!==0;return K.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ie,arrowRef:se,arrowUncentered:Le,side:Ne,align:Pe,physicalSide:Me,anchorHidden:Fe,refs:_e,context:we,isPositioned:Te,update:Se}),[Ae,Ie,se,Le,Ne,Pe,Me,Fe,_e,we,Te,Se])}function FB(e){return e!=null&&`current`in e}var IB=K.createContext(void 0);function LB(){let e=K.useContext(IB);if(!e)throw Error(Pm(59));return e}var RB=K.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,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function zB(e,t){e&&Object.assign(e.style,t)}var BB={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function VB(e){return e===`starting`?KI:$p}function HB(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),_m(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},VB(r),i],stateAttributesMapping:zg})}var UB={},WB={},GB=``;function KB(e,t){return _h(e)?e:t}function qB(e,t,n){return/hidden|clip/.test(e.getComputedStyle(KB(t,n)).overflowY)}function JB(e){if(typeof document>`u`)return!1;let t=Ph(e);return dh(t).innerWidth-t.documentElement.clientWidth>0}function YB(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Ph(e),n=t.documentElement,r=t.body,i=KB(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 XB(e){let t=Ph(e),n=t.documentElement,r=t.body,i=KB(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 ZB(e){let t=Ph(e),n=t.documentElement,r=t.body,i=dh(n),a=0,o=0,s=!1,c=Uv.create();if(ug&&(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,UB={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},GB=n.style.scrollBehavior,WB={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=KB(n,r);s=YB(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(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,UB),Object.assign(r.style,WB),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=GB)}function d(){u(),c.request(l)}l();let f=xI(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var QB=new class{lockCount=0;restore=null;timeoutLock=yb.create();timeoutUnlock=yb.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=Ph(e),n=t.documentElement,r=t.body,i=dh(n);if(qB(i,n,r)){let t=new i.MutationObserver(()=>{qB(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=ag||!JB(e);this.restore=a?XB(e):ZB(e)}};function $B(e=!0,t=null){Y(()=>{if(e)return QB.acquire(t)},[e,t])}var eV=20;function tV(e,t,n,r){let[i,a]=K.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=Ph(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-eV)},[e,t,n]),$B(e&&(!t||i),r)}var nV={position:`fixed`},rV=K.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=JI,style:_,...v}=e,y=Mz(),b=Nz(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=K.useRef(null),j=K.useRef(null),[M,N]=K.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),K.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),tV((P||C)&&x,T===`touch`,E,D);let F=NB({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?nV:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Y(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=HB(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=K.useRef(0),ee=X(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=zm(Vm);if(t!==0&&!y.state.multiple&&w!==null&&zz(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&zz(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>zz(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};zB(E,e),zB(y.context.popupRef.current,e)}}),te=K.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,q.jsx)(Em,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ee,children:(0,q.jsxs)(IB.Provider,{value:te,children:[S&&C&&(0,q.jsx)(RB,{inert:zv(!x),cutout:D}),z]})})}),iV=`base-ui-disable-scrollbar`,aV={className:iV,getElement(e){return(0,q.jsx)(`style`,{nonce:e,href:iV,precedence:`base-ui:low`,children:`.${iV}{scrollbar-width:none}.${iV}::-webkit-scrollbar{display:none}`})}},oV=K.createContext(void 0);function sV(e){let t=K.useContext(oV);if(t===void 0&&!e)throw Error(Pm(69));return t}var cV=`--transform-origin`,lV={...zg,...Eg},uV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=Mz(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=Nz(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=LB(),_=sV(!0)!=null,v=vy(),{nonce:y,disableStyleElements:b}=xv(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=K.useRef(!1),j=K.useRef(!1),M=K.useRef({}),N=Wv(),P=X(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=pV(O),i=mV(O.getBoundingClientRect().height,`y`,r),a=Ph(O),o=dh(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=dV(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=fV(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=rB(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=rB(g,0,fV(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});K.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),Xv({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Y(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Y(()=>{S||m||(j.current=!1,A.current=!1,zB(O,M.current))},[S,m,O]),Y(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(cV),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=_V(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=dh(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=Ph(D),c=pV(D),l=hV(D.getBoundingClientRect(),c),d=hV(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=dV(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=hV(n.getBoundingClientRect(),c);T=hV(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${rB(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=fV(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&ug;if(B||ee){zB(O,M.current),g(!1);return}let te=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=fV(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=rB(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(cV,`50% ${i}%`)}(te===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),K.useEffect(()=>{if(!m||!O||!S)return;let e=dh(O);function t(e){s.context.setOpen(!1,zm(ah,e))}return xI(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&oy.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:BB},className:!k&&m?aV.className:void 0},L=_m(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:lV,props:[T,I,VB(E),o]});return(0,q.jsxs)(K.Fragment,{children:[!b&&aV.getElement(y),(0,q.jsx)(yL,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})});function dV(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function fV(e){return iB(e.scrollHeight,e.clientHeight)}function pV(e){return lz.getScale(e)}function mV(e,t,n){return e/n[t]}function hV(e,t){return A_({x:mV(e.x,`x`,t),y:mV(e.y,`y`,t),width:mV(e.width,`x`,t),height:mV(e.height,`y`,t)})}var gV=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function _V(e){let{style:t}=e,n={};for(let[e,r]of gV)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of gV){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var vV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Mz(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=LB(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:BB},className:u&&d!==`touch`?aV.className:void 0};return _m(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),yV=K.createContext(void 0);function bV(){let e=K.useContext(yV);if(!e)throw Error(Pm(57));return e}var xV=K.memo(K.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=K.useRef(null),d=Yh({guess:!0,label:o,textRef:u}),f=Mz(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=d.index,w=K.useRef(null);Y(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Y(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=Hz(C,a,f.context.valuesRef.current,e,_,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Iz(a,e,_),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,_,f,a]);let T=K.useRef(`mouse`),E=K.useRef(!1),{getButtonProps:D,buttonRef:O}=Gh({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:v,selected:x,highlighted:y};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?Uz(n,a,_):[...n,a];f.context.setValue(r,zm(Km,e))}else f.context.setValue(a,zm(Km,e)),f.context.setOpen(!1,zm(Km,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&e_(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!E.current;E.current=!1,!(v||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),v||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=_m(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=K.useMemo(()=>({selected:x,index:C,textRef:u,selectedByFocus:S}),[x,C,u,S]);return(0,q.jsx)(yV.Provider,{value:P,children:N})})),SV=K.memo(K.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=K.useRef(null),{transitionStatus:l,setMounted:u}=Zv(o),d=_m(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:Eg});return Xv({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),CV=K.forwardRef(function(e,t){let{selected:n}=bV();return e.keepMounted||n?(0,q.jsx)(SV,{...e,selected:n,ref:t}):null}),wV=K.memo(K.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=bV(),a=Mz(),{render:o,className:s,style:c,...l}=e;return _m(`div`,e,{ref:[K.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),TV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=Mz(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=LB(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=bb(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=Zv(g);Y(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),Xv({open:g,ref:v,onComplete(){g||x(!1)}});let S=_m(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=iB(e.scrollHeight,e.clientHeight),r=aB(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=EV(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:Eg});return y||o?S:null});function EV(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?aB(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?aB(l.offsetTop+l.offsetHeight-r+i,a):a}var DV=K.forwardRef(function(e,t){return(0,q.jsx)(TV,{...e,ref:t,direction:`down`})}),OV=K.forwardRef(function(e,t){return(0,q.jsx)(TV,{...e,ref:t,direction:`up`})}),kV=oB;function AV({className:e,...t}){return(0,q.jsx)(gB,{"data-slot":`select-value`,className:J(`flex flex-1 text-left`,e),...t})}function jV({className:e,size:t=`default`,children:n,...r}){return(0,q.jsxs)(mB,{"data-slot":`select-trigger`,"data-size":t,className:J(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-[13px] whitespace-nowrap transition-colors outline-none select-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,q.jsx)(_B,{render:(0,q.jsx)(nf,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function MV({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,q.jsx)(vB,{children:(0,q.jsx)(rV,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,q.jsxs)(uV,{"data-slot":`select-content`,"data-align-trigger":o,className:J(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground border border-border/70 shadow-float duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,q.jsx)(PV,{}),(0,q.jsx)(vV,{children:t}),(0,q.jsx)(FV,{})]})})})}function NV({className:e,children:t,...n}){return(0,q.jsxs)(xV,{"data-slot":`select-item`,className:J(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,q.jsx)(wV,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,q.jsx)(CV,{render:(0,q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,q.jsx)(ef,{className:`pointer-events-none`})})]})}function PV({className:e,...t}){return(0,q.jsx)(OV,{"data-slot":`select-scroll-up-button`,className:J(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(af,{})})}function FV({className:e,...t}){return(0,q.jsx)(DV,{"data-slot":`select-scroll-down-button`,className:J(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(nf,{})})}var IV=K.createContext(void 0);function LV(e){let t=K.useContext(IV);if(!e&&t===void 0)throw Error(Pm(27));return t}var RV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=LV(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return _m(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Bg,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),zV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=LV(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Gh({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,zm(qm,e.nativeEvent))}return _m(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),BV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=LV(),c=Bh(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),_m(`p`,e,{ref:t,props:[{id:c},o]})}),VV=K.createContext(void 0);function HV(){let e=K.useContext(VV);if(e===void 0)throw Error(Pm(26));return e}var UV=`--nested-dialogs`,WV=`data-nested-dialog-open`,GV={...zg,...Eg,nestedDialogOpen(e){return e?{[WV]:``}:null}},KV=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=LV(),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`);HV(),Xv({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?AL(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=_m(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...kL,hidden:!m,onKeyDown(e){oy.has(e.key)&&e.stopPropagation()},style:{[UV]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:GV});return(0,q.jsx)(yL,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),qV=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=LV(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,q.jsx)(VV.Provider,{value:n,children:(0,q.jsxs)(tL,{ref:t,...r,children:[a&&o===!0&&(0,q.jsx)(RB,{ref:i.context.internalBackdropRef,inert:zv(!s)}),e.children]})}):null});function JV({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]=K.useState(0),[d,f]=K.useState(0),p=l===0,m=EL(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=hg(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Z(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return $B(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),Y(()=>{!r&&!i&&(u(0),f(0))},[r,i]),Y(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),VL(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var YV={...QL,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},XV=class extends yI{constructor(e,t,n){let r=new UL,i=ZV(e,r,t,n);super(i,QV(r),YV)}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(FL(this.state,e,t.trigger)))}};function ZV(e,t,n,r=!1){return{...KL(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 QV(e){return{popupRef:K.createRef(),backdropRef:K.createRef(),internalBackdropRef:K.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function $V(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:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=LV(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=jL((e,t)=>new XV({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);HL(b,x),zL(b);let{forceUnmount:w}=BL(x,b);K.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,zm(ih))}),[w,b]);let T=x||S||u!=null;return(0,q.jsxs)(IV.Provider,{value:b,children:[u&&(0,q.jsx)(ML,{handle:u,store:b}),T&&(0,q.jsx)(JV,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var eH=uI(function(e){return $V(`dialog`,e)}),tH=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=LV(),c=Bh(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),_m(`h2`,e,{ref:t,props:[{id:c},o]})}),nH=dI(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=LV(!0),f=$L(l)??d;if(!f)throw Error(Pm(79));let p=Bh(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=K.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=RL(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=Gh({disabled:a,native:o}),S=bL(m),C=tB(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},T=f.useState(`triggerProps`,y);return _m(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,T,C,{[qI]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:Lg})});function rH({...e}){return(0,q.jsx)(eH,{"data-slot":`dialog`,...e})}function iH({...e}){return(0,q.jsx)(nH,{"data-slot":`dialog-trigger`,...e})}function aH({...e}){return(0,q.jsx)(qV,{"data-slot":`dialog-portal`,...e})}function oH({...e}){return(0,q.jsx)(zV,{"data-slot":`dialog-close`,...e})}function sH({className:e,...t}){return(0,q.jsx)(RV,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function cH({className:e,children:t,showCloseButton:n=!0,...r}){let i=K.useRef(null);return(0,q.jsxs)(aH,{children:[(0,q.jsx)(sH,{}),(0,q.jsxs)(KV,{ref:i,"data-slot":`dialog-content`,initialFocus:()=>i.current?.querySelector(`input:not([type=hidden]):not([disabled]), textarea:not([disabled]), select:not([disabled]), [role=combobox]:not([disabled])`)??i.current,className:J(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground border border-border/70 shadow-overlay duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,q.jsxs)(zV,{"data-slot":`dialog-close`,render:(0,q.jsx)(ZP,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,q.jsx)(zf,{}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function lH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2`,e),...t})}function uH({className:e,showCloseButton:t=!1,children:n,...r}){return(0,q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,q.jsx)(zV,{render:(0,q.jsx)(ZP,{variant:`outline`}),children:`Close`})]})}function dH({className:e,...t}){return(0,q.jsx)(tH,{"data-slot":`dialog-title`,className:J(`font-heading text-base leading-none font-medium`,e),...t})}function fH({className:e,...t}){return(0,q.jsx)(BV,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function pH(e){return $V(`alert-dialog`,e)}var mH=nH;function hH({...e}){return(0,q.jsx)(pH,{"data-slot":`alert-dialog`,...e})}function gH({...e}){return(0,q.jsx)(mH,{"data-slot":`alert-dialog-trigger`,...e})}function _H({...e}){return(0,q.jsx)(qV,{"data-slot":`alert-dialog-portal`,...e})}function vH({className:e,...t}){return(0,q.jsx)(RV,{"data-slot":`alert-dialog-overlay`,className:J(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function yH({className:e,size:t=`default`,...n}){return(0,q.jsxs)(_H,{children:[(0,q.jsx)(vH,{}),(0,q.jsx)(KV,{"data-slot":`alert-dialog-content`,"data-size":t,className:J(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground border border-border/70 shadow-overlay duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function bH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:J(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function xH({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:J(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function SH({className:e,...t}){return(0,q.jsx)(tH,{"data-slot":`alert-dialog-title`,className:J(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function CH({className:e,...t}){return(0,q.jsx)(BV,{"data-slot":`alert-dialog-description`,className:J(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function wH({className:e,...t}){return(0,q.jsx)(ZP,{"data-slot":`alert-dialog-action`,className:J(e),...t})}function TH({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,q.jsx)(zV,{"data-slot":`alert-dialog-cancel`,className:J(e),render:(0,q.jsx)(ZP,{variant:t,size:n}),...r})}var EH=K.createContext(void 0);function DH(e){let t=K.useContext(EH);if(t===void 0&&!e)throw Error(Pm(72));return t}var OH={...QL,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},kH=class extends yI{constructor(e,t,n){let r=new UL;super(AH(e,r,t,n),jH(r),OH)}setOpen=(e,t)=>{LL(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,zm(Hm,e))}};function AH(e,t,n,r=!1){return{...KL(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function jH(e){return{popupRef:K.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var MH=uI(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=jL((e,t)=>new kH({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),zL(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=BL(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=K.useRef(null);Y(()=>{m&&t&&p.setOpen(!1,zm(th))},[m,t,p]),Y(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Y(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),K.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,zm(ih))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,q.jsxs)(EH.Provider,{value:p,children:[l&&(0,q.jsx)(ML,{handle:l,store:p}),T&&(0,q.jsx)(NH,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function NH({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=EL(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=CL(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=K.useMemo(()=>im(a.reference,i.reference),[a.reference,i.reference]);return VL(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??$p}),null}var PH=K.createContext(void 0);function FH(){return K.useContext(PH)}var IH=`data-base-ui-tooltip-trigger`;function LH(e){let t=hg(e);return mh(t)?t:null}var RH=dI(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=DH(!0),m=$L(a)??p;if(!m)throw Error(Pm(82));let h=Bh(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=K.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=RL(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=FH(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=AI(v,{open:_}),O=sR(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=iI(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=K.useRef(!1),F=bb(),I=K.useRef(void 0);function L(){return D&&w.current!=null?0:c??C??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=mg(e,`[${IH}]`);return n!==null&&n!==t&&Z(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let B=uR(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?ER():null,restMs:L,delay(){return u==null&&D?{close:CI(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),ee=nR(v,{enabled:!A}).reference,te=e=>{let t=P.current,n=LH(e),r=z(n),i=y.current,a=i&&n&&Z(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,zm(Um,e));else if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&n_(I.current)){let t=()=>{!P.current&&!j.current&&!m.select(`open`)&&m.setOpen(!0,zm(Um,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},ne=m.useState(`appliedTriggerProps`,S||M!==`none`);return _m(`button`,e,{state:{open:_},ref:[t,x,y],props:[B,ee,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){R(LH(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Vg]:A?``:void 0,[IH]:A?void 0:``},f],stateAttributesMapping:Lg})}),zH=K.createContext(void 0);function BH(){let e=K.useContext(zH);if(e===void 0)throw Error(Pm(70));return e}var VH=K.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=eL({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,q.jsxs)(K.Fragment,{children:[l,c&&Pc.createPortal(n,c)]})}),HH=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return DH().useState(`mounted`)||n?(0,q.jsx)(zH.Provider,{value:n,children:(0,q.jsx)(VH,{ref:t,...r})}):null}),UH=K.createContext(void 0);function WH(){let e=K.useContext(UH);if(e===void 0)throw Error(Pm(71));return e}var GH=K.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=YI,style:g,..._}=e,v=DH(),y=BH(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=NB({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=HB(e,K.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,q.jsx)(UH.Provider,{value:D,children:O})}),KH=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=DH(),{side:s,align:c}=WH(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Xv({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),cR(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return _m(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[kL,f,VB(d),a],stateAttributesMapping:Bg})}),qH=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=K.useMemo(()=>({open:t,close:n}),[t,n]);return(0,q.jsx)(PH.Provider,{value:t,children:(0,q.jsx)(kI,{delay:i,timeoutMs:r,children:e.children})})};function JH({delay:e=0,...t}){return(0,q.jsx)(qH,{"data-slot":`tooltip-provider`,delay:e,...t})}function YH({...e}){return(0,q.jsx)(MH,{"data-slot":`tooltip`,...e})}function XH({...e}){return(0,q.jsx)(RH,{"data-slot":`tooltip-trigger`,...e})}function ZH({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,q.jsx)(HH,{children:(0,q.jsx)(GH,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,q.jsx)(KH,{"data-slot":`tooltip-content`,className:J(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md border border-border/70 bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-float has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:a})})})}function QH(e){return _m(e.defaultTagName??`div`,e,e)}var $H=Ty(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-1.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-all focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function eU({className:e,variant:t=`default`,render:n,...r}){return QH({defaultTagName:`span`,props:im({className:J($H({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function tU({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`skeleton`,className:J(`animate-pulse rounded-md bg-muted`,e),...t})}function nU({className:e,...t}){return(0,q.jsx)(kf,{"data-slot":`spinner`,"aria-hidden":`true`,className:J(`size-4 animate-spin`,e),...t})}var rU=Ty(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function iU({className:e,variant:t,...n}){return(0,q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:J(rU({variant:t}),e),...n})}function aU({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-title`,className:J(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function oU({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-description`,className:J(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function sU({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty`,className:J(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function cU({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-header`,className:J(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var lU=Ty(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function uU({className:e,variant:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:J(lU({variant:t,className:e})),...n})}function dU({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-title`,className:J(`font-heading text-sm font-medium tracking-tight`,e),...t})}function fU(){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`svg`,{className:`brand-mark h-5 w-7 shrink-0 text-primary`,viewBox:qP.viewBox,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:qP.path,fill:`currentColor`})}),(0,q.jsx)(`span`,{className:`brand-word text-sm font-semibold tracking-tight group-data-[collapsible=icon]:hidden`,children:`Kanvil`})]})}var pU=`relative mb-4 min-w-0 [&>[data-slot=field-label]]:text-xs [&>[data-slot=field-label]]:font-medium [&>[data-slot=field-label]]:text-muted-foreground`,mU=e=>qy.error(su(e));function hU({label:e,children:t,...n}){return(0,q.jsxs)(YH,{children:[(0,q.jsx)(XH,{render:(0,q.jsx)(ZP,{variant:`ghost`,size:`icon`,"aria-label":e,...n}),children:t}),(0,q.jsx)(ZH,{children:e})]})}function gU({label:e,...t}){let n=(0,K.useId)(),[r,i]=(0,K.useState)(!1);return(0,q.jsxs)(IF,{className:pU,children:[(0,q.jsx)(RF,{htmlFor:n,children:e}),t.type===`password`?(0,q.jsxs)(CF,{children:[(0,q.jsx)(OF,{...t,id:n,type:r?`text`:`password`}),(0,q.jsx)(TF,{align:`inline-end`,children:(0,q.jsx)(DF,{size:`icon-sm`,"aria-label":`${r?`Hide`:`Show`} ${e.toLowerCase()}`,title:`${r?`Hide`:`Show`} ${e.toLowerCase()}`,disabled:t.disabled,onClick:()=>i(e=>!e),children:r?(0,q.jsx)(Tf,{}):(0,q.jsx)(Df,{})})})]}):(0,q.jsx)(xF,{...t,id:n})]})}function _U({label:e,...t}){let n=(0,K.useId)();return(0,q.jsxs)(IF,{className:pU,children:[(0,q.jsx)(RF,{htmlFor:n,children:e}),(0,q.jsx)(SF,{...t,id:n})]})}function vU({label:e,children:t,className:n,layout:r=`field`,labelHidden:i=!1,...a}){let o=(0,K.useId)(),s=K.Children.toArray(t).flatMap(e=>(0,K.isValidElement)(e)?[{value:e.props.value,label:e.props.children}]:[]);return(0,q.jsxs)(IF,{className:J(pU,r===`property`&&`mb-0 grid grid-cols-[72px_minmax(0,1fr)] items-center gap-2`,n),children:[(0,q.jsx)(RF,{htmlFor:o,className:J(r===`property`&&`text-xs font-normal text-muted-foreground`,i&&`sr-only`),children:e}),(0,q.jsxs)(kV,{items:s,defaultValue:s[0]?.value??``,...a,children:[(0,q.jsx)(jV,{id:o,className:J(`w-full`,r===`property`&&`h-auto min-h-8 border-transparent bg-transparent shadow-none hover:bg-muted dark:bg-transparent`),children:(0,q.jsx)(AV,{})}),(0,q.jsx)(MV,{alignItemWithTrigger:!1,children:t})]})]})}function yU({label:e,description:t,className:n,...r}){let i=(0,K.useId)(),a=n===`sr-checkbox`;return(0,q.jsxs)(IF,{orientation:`horizontal`,className:J(`my-2 min-h-7 w-auto`,a&&`my-0 min-h-4 justify-center`),children:[(0,q.jsx)(tI,{...r,id:i,"aria-describedby":t?[r[`aria-describedby`],`${i}-description`].filter(Boolean).join(` `):r[`aria-describedby`]}),t?(0,q.jsxs)(LF,{children:[(0,q.jsx)(RF,{htmlFor:i,className:J(`font-normal`,a&&`sr-only`),children:e}),(0,q.jsx)(zF,{id:`${i}-description`,className:`text-xs`,children:t})]}):(0,q.jsx)(RF,{htmlFor:i,className:J(`font-normal`,a&&`sr-only`),children:e})]})}function bU({error:e}){return e?(0,q.jsxs)(iU,{variant:`destructive`,className:`my-3`,children:[(0,q.jsx)(sf,{}),(0,q.jsx)(oU,{children:su(e)})]}):null}function xU(){return(0,q.jsxs)(`div`,{role:`status`,className:`space-y-4 py-5`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:`Loading…`}),(0,q.jsx)(tU,{className:`h-6 w-40`}),(0,q.jsx)(tU,{className:`h-12 w-full`}),(0,q.jsx)(tU,{className:`h-12 w-full`}),(0,q.jsx)(tU,{className:`h-12 w-3/4`})]})}function SU({title:e,icon:t=df,children:n,className:r}){return(0,q.jsxs)(sU,{className:J(`relative isolate overflow-hidden py-20`,r),children:[(0,q.jsxs)(cU,{className:`w-full`,children:[(0,q.jsx)(uU,{variant:`icon`,children:(0,q.jsx)(t,{})}),(0,q.jsxs)(dU,{className:`relative w-full`,children:[(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:qP.viewBox,className:`pointer-events-none absolute top-1/2 left-1/2 -z-10 h-auto w-full -translate-x-[44.2%] -translate-y-[59.2%] text-foreground/[0.07] dark:text-foreground/[0.09]`,children:(0,q.jsx)(`path`,{d:qP.path,fill:`none`,stroke:`currentColor`,strokeWidth:5})}),e]})]}),n]})}var CU={backlog:{icon:df,color:`text-muted-foreground`},todo:{icon:_f,color:`text-muted-foreground`},in_progress:{icon:pf,color:`text-primary`},in_review:{icon:yf,color:`text-[var(--warning)]`},done:{icon:lf,color:`text-[var(--success)]`},cancelled:{icon:hf,color:`text-muted-foreground`}},wU={urgent:{icon:Nf,color:`text-destructive`},high:{icon:Xd,color:`text-[var(--warning)]`},medium:{icon:Cf,color:`text-foreground`},low:{icon:Jd,color:`text-primary`},none:{icon:jf,color:`text-muted-foreground`}};function TU({property:e,value:t,iconOnly:n=!1}){let{icon:r,color:i,label:a}=e===`status`?{...CU[t],label:sl[t]}:{...wU[t],label:cl[t]},o=e===`priority`&&t!==`none`?`${a} priority`:a;return(0,q.jsxs)(eU,{variant:`outline`,className:J(e===`status`?`status rounded-full bg-current/8 px-2 text-xs whitespace-nowrap`:`h-6 border-transparent bg-transparent px-0 text-xs`,`gap-1.5 border-transparent font-normal`,i),"data-priority":e===`priority`?t:void 0,role:n?`img`:void 0,"aria-label":n?o:void 0,title:n?o:void 0,children:[(0,q.jsx)(r,{className:e===`status`?`size-3.5`:`size-4.5`,strokeWidth:e===`status`?2:2.5,"aria-hidden":`true`}),!n&&a]})}var EU={a:({children:e,...t})=>(0,q.jsx)(`a`,{...t,target:`_blank`,rel:`noreferrer`,children:e})};function DU({children:e}){return(0,q.jsx)(`div`,{className:`markdown`,children:(0,q.jsx)(Bj,{remarkPlugins:[KP],components:EU,children:e})})}var OU=(0,K.createContext)(null),kU=()=>(0,K.useContext)(OU),AU={default:`max-h-[90dvh] overflow-y-auto p-6 sm:max-w-2xl`,composer:`flex max-h-[calc(100dvh-2rem)] w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl has-[[data-expanded=true]]:h-[calc(100dvh-1rem)] has-[[data-expanded=true]]:w-[calc(100%-1rem)] has-[[data-expanded=true]]:sm:max-w-[calc(100%-1rem)] max-sm:h-dvh max-sm:w-full max-sm:max-w-none max-sm:rounded-none`};function jU({title:e,description:t,trigger:n,children:r,open:i,onOpenChange:a,busy:o=!1,size:s=`default`}){let[c,l]=(0,K.useState)(!1),u=o||c;return(0,q.jsx)(OU,{value:l,children:(0,q.jsxs)(rH,{...i===void 0?{}:{open:i},onOpenChange:(e,t)=>{!e&&u?t.cancel():a?.(e)},children:[n&&(0,q.jsx)(iH,{render:(0,q.jsx)(ZP,{variant:`outline`}),children:n}),(0,q.jsxs)(cH,{showCloseButton:!u,className:AU[s],"aria-describedby":void 0,children:[(0,q.jsxs)(lH,{className:J(`mb-2`,s===`composer`&&`m-0 shrink-0 border-b px-5 py-3 pr-24`),children:[(0,q.jsx)(dH,{className:J(`mb-0`,s===`composer`?`text-sm`:`text-lg`),children:e}),t&&(0,q.jsx)(fH,{children:t})]}),r]})]})})}function MU({error:e,layout:t=`dialog`,pending:n=!1,submitLabel:r,pendingLabel:i,onCancel:a,cancelLabel:o=`Cancel`,submitDisabled:s=!1,children:c}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(bU,{error:e}),(0,q.jsxs)(NU,{className:t===`inline`?`mx-0 mb-0 rounded-none border-0 bg-transparent px-0`:``,children:[c,a&&(0,q.jsx)(ZP,{disabled:n,onClick:a,children:o}),(0,q.jsxs)(ZP,{type:`submit`,variant:`default`,disabled:n||s,children:[n&&(0,q.jsx)(nU,{}),n&&i?i:r]})]})]})}function NU({children:e,className:t}){return(0,q.jsx)(uH,{className:J(`mt-4`,t),children:e})}function PU({label:e,description:t,onConfirm:n,danger:r=!1,icon:i,disabled:a=!1,open:o,onOpenChange:s,trigger:c=!0}){let[l,u]=(0,K.useState)(!1),d=o??l,f=s??u,[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)();return(0,q.jsxs)(hH,{open:d,onOpenChange:f,children:[c&&(0,q.jsx)(gH,{render:i?(0,q.jsx)(hU,{label:e,disabled:a}):(0,q.jsx)(ZP,{variant:r?`destructive`:`outline`,disabled:a}),children:i??e}),(0,q.jsxs)(yH,{children:[(0,q.jsxs)(bH,{children:[(0,q.jsx)(SH,{children:e}),(0,q.jsx)(CH,{children:t})]}),(0,q.jsx)(bU,{error:h}),(0,q.jsxs)(xH,{children:[(0,q.jsx)(TH,{disabled:p,children:`Cancel`}),(0,q.jsx)(wH,{variant:r?`destructive`:`default`,disabled:p,onClick:()=>{m(!0),g(void 0),n().then(()=>f(!1)).catch(g).finally(()=>m(!1))},children:p?`Working…`:e})]})]})]})}function FU({value:e,className:t}){let n=new Date(e);return(0,q.jsx)(`time`,{dateTime:e,title:cu(e),className:t,children:Yw(n,{addSuffix:!0})})}function IU({value:e,open:t=!0,className:n}){if(!e)return null;let r=t&&Xw(new Date(e));return(0,q.jsxs)(`span`,{className:J(`inline-flex items-center gap-1.5`,r?`text-destructive`:`text-muted-foreground`,n),children:[(0,q.jsx)(Qd,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,q.jsx)(FU,{value:e})]})}function LU({title:e,children:t}){return(0,q.jsxs)(`header`,{className:`mb-4 flex min-h-8 flex-wrap items-center justify-between gap-3`,children:[typeof e==`string`?(0,q.jsx)(`h1`,{className:`m-0 text-base`,children:e}):e,t]})}function RU({title:e,description:t,action:n,compact:r=!1}){return(0,q.jsxs)(`header`,{className:J(`mb-4 flex flex-wrap items-start justify-between gap-3`,r&&`mb-3 items-center gap-2 [&_[data-slot=button]]:h-7 [&_[data-slot=button]]:text-xs`),children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:J(`mb-0 text-sm`,r&&`text-[11px] font-medium tracking-[0.08em] text-muted-foreground uppercase`),children:e}),t&&(0,q.jsx)(`p`,{className:`mt-1.5 mb-0 max-w-xl text-sm text-muted-foreground`,children:t})]}),n]})}function zU({label:e,value:t,onChange:n,placeholder:r=`Search…`,shortcut:i,defaultOpen:a=!1,className:o}){let[s,c]=(0,K.useState)(()=>a||t.length>0),l=(0,K.useRef)(null),u=s||t.length>0;return nT(i??``,()=>{c(!0),l.current?.focus()},{enabled:!!i}),(0,q.jsxs)(`div`,{role:`search`,"data-expanded":u,className:J(`group/search flex min-w-0 items-center`,u&&`flex-1`,o),children:[(0,q.jsx)(hU,{label:e,size:`icon-sm`,"aria-expanded":u,title:i?`${e} (${i})`:void 0,className:J(`transition-colors`,u&&`text-foreground`),onClick:()=>{c(!0),l.current?.focus()},children:(0,q.jsx)(Lf,{})}),(0,q.jsxs)(`div`,{className:J(`flex items-center overflow-hidden transition-[width,opacity] duration-200 ease-out motion-reduce:transition-none`,u?`w-full max-w-56 opacity-100`:`w-0 opacity-0`),children:[(0,q.jsx)(`input`,{ref:l,type:`search`,"aria-label":e,placeholder:r,value:t,tabIndex:u?0:-1,onChange:e=>n(e.target.value),onBlur:()=>{t||c(a)},onKeyDown:e=>{(e.key===`Escape`||e.key===`Enter`)&&(e.preventDefault(),e.currentTarget.blur())},className:`h-8 min-w-0 flex-1 border-0 border-b border-border bg-transparent px-1 text-sm transition-colors outline-none placeholder:text-muted-foreground focus:border-foreground [&::-webkit-search-cancel-button]:hidden`}),t&&(0,q.jsx)(hU,{label:`Clear ${e.toLowerCase()}`,size:`icon-xs`,onClick:()=>{n(``),c(a)},children:(0,q.jsx)(zf,{})})]})]})}function BU({label:e,value:t,size:n=`icon`,className:r}){let[i,a]=(0,K.useState)(!1);return(0,q.jsx)(hU,{label:e,size:n,className:J(`text-muted-foreground hover:text-foreground`,r),onClick:()=>{Qw(t).then(()=>{a(!0),setTimeout(()=>a(!1),1500),qy.success(`${t} copied`)}).catch(mU)},children:i?(0,q.jsx)(ef,{className:`text-(--success)`}):(0,q.jsx)(xf,{})})}function VU({label:e,value:t,inline:n=!1}){let r=(0,K.useId)(),i=(0,q.jsxs)(`div`,{role:`group`,"aria-label":n?e:void 0,"aria-labelledby":n?void 0:r,className:J(`flex min-w-0 items-center gap-3`,!n&&`justify-between`),children:[(0,q.jsx)(`code`,{className:`min-w-0 text-xs break-all`,children:t}),(0,q.jsx)(BU,{label:`Copy ${e.toLowerCase()}`,value:t,size:n?`icon-sm`:`icon`})]});return n?i:(0,q.jsxs)(`div`,{className:`mb-4 min-w-0`,children:[(0,q.jsx)(`span`,{id:r,className:`mb-1 block text-xs text-muted-foreground`,children:e}),i]})}function HU(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=K.useRef(null),o=K.useRef(null),s=Yv(r);Y(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Y(()=>{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 UU(e,t){function n(n,r,i){let a=n.currentTarget;Pc.flushSync(()=>{e.setOpen(!1,zm(Jm,n.nativeEvent,a))}),iv(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&&av(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function WU(e,t){let n=e.get(t);return typeof n==`string`?n:``}function GU(e){if(e.key!==`Enter`||!e.ctrlKey&&!e.metaKey||e.nativeEvent.isComposing||e.defaultPrevented)return;let t=e.currentTarget;t.querySelector(`button[type="submit"]:disabled`)||(e.preventDefault(),t.requestSubmit())}export{RV as $,Gc as $a,Yu as $i,uw as $n,Vm as $r,tI as $t,iU as A,cu as Aa,df as Ai,nT as An,ug as Ar,jL as At,VH as B,Rl as Ba,Dd as Bi,yw as Bn,Ph as Br,cL as Bt,RU as C,Sl as Ca,Lf as Ci,sF as Cn,Bg as Cr,LL as Ct,pU as D,su as Da,yf as Di,ZP as Dn,Z as Dr,zL as Dt,TU as E,Cl as Ea,xf as Ei,nF as En,Eg as Er,FL as Et,QH as F,Xc as Fa,Xd as Fi,jw as Fn,Gh as Fr,EL as Ft,lH as G,zl as Ga,Td as Gi,nw as Gn,$m as Gr,qI as Gt,oH as H,cl as Ha,Od as Hi,gw as Hn,mh as Hr,sL as Ht,YH as I,Dl as Ia,Jd as Ii,Aw as In,Wh as Ir,bL as It,eH as J,xl as Ja,yd as Ji,lw as Jn,Jm as Jr,jI as Jt,dH as K,Qc as Ka,Cd as Ki,tw as Kn,qm as Kr,JI as Kt,ZH as L,Kl as La,Kd as Li,kw as Ln,Hh as Lr,yL as Lt,aU as M,Gl as Ma,af as Mi,Qw as Mn,Xh as Mr,RL as Mt,nU as N,rl as Na,nf as Ni,eT as Nn,Yh as Nr,PL as Nt,mU as O,Hl as Oa,hf as Oi,YP as On,hg as Or,BL as Ot,eU as P,nl as Pa,ef as Pi,qw as Pn,Jh as Pr,DL as Pt,zV as Q,bl as Qa,Xu as Qi,hw as Qn,Xm as Qr,dI as Qt,JH as R,Zl as Ra,Md as Ri,Dw as Rn,Bh as Rr,lL as Rt,zU as S,Yl as Sa,zf as Si,lF as Sn,Qg as Sr,ML as St,_U as T,dl as Ta,kf as Ti,eF as Tn,Lg as Tr,AL as Tt,cH as U,$c as Ua,wd as Ui,rw as Un,hh as Ur,rL as Ut,rH as V,Yc as Va,kd as Vi,vw as Vn,Ah as Vr,oL as Vt,fH as W,Ll as Wa,Ed as Wi,ow as Wn,Dh as Wr,tL as Wt,KV as X,qc as Xa,ld as Xi,pw as Xn,Km as Xr,yI as Xt,qV as Y,sl as Ya,hd as Yi,iw as Yn,ih as Yr,xI as Yt,BV as Z,wl as Za,ad as Zi,aw as Zn,Zm as Zr,uI as Zt,DU as _,uu as _a,X as _i,_F as _n,o as _o,sy as _r,$L as _t,fU as a,Iu as aa,Hm as ai,BF as an,oc as ao,bb as ar,RB as at,LU as b,Jc as ba,Np as bi,pF as bn,Yv as br,UL as bt,BU as c,vu as ca,Pm as ci,NF as cn,ms as co,qy as cr,nB as ct,SU as d,Su as da,_m as di,AF as dn,G as do,Oy as dr,ER as dt,Ku as ea,Gm as ei,HF as en,Wc as eo,sw as er,NV as et,bU as f,Au as fa,im as fi,CF as fn,ic as fo,ky as fr,vR as ft,xU as g,fu as ga,Vp as gi,vF as gn,d as go,oy as gr,nR as gt,gU as h,pu as ha,Zp as hi,xF as hn,p as ho,vy as hr,cR as ht,HU as i,Tu as ia,Um as ii,zF as in,Mc as io,yb as ir,VB as it,oU as j,il as ja,lf as ji,$w as jn,cg as jr,HL as jt,kU as k,$l as ka,pf as ki,qP as kn,dg as kr,VL as kt,VU as l,Du as la,Em as li,MF as ln,cc as lo,Ey as lr,tB as lt,hU as m,hu as ma,$p as mi,kF as mn,W as mo,yy as mr,uR as mt,GU as n,yu as na,eh as ni,IF as nn,Lc as no,Tb as nr,tV as nt,yU as o,wu as oa,zm as oi,RF as on,qs as oo,ub as or,NB as ot,MU as p,zu as pa,Qp as pi,TF as pn,U as po,Ty as pr,_R as pt,tH as q,al as qa,bd as qi,mw as qn,Ym as qr,YI as qt,UU as r,Eu as ra,Wm as ri,LF as rn,Nc as ro,Eb as rr,HB as rt,PU as s,Cu as sa,Bm as si,PF as sn,zs as so,cb as sr,lB as st,WU as t,Gu as ta,Qm as ti,UF as tn,Kc as to,cw as tr,sV as tt,IU as u,ku as ua,xm as ui,jF as un,Fs as uo,Ay as ur,Wz as ut,jU as v,au as va,Ip as vi,gF as vn,s as vo,Zv as vr,KL as vt,vU as w,Zc as wa,Ff as wi,aF as wn,Rg as wr,IL as wt,FU as x,Xl as xa,J as xi,uF as xn,zv as xr,kL as xt,NU as y,ol as ya,Y as yi,hF as yn,l as yo,Xv as yr,QL as yt,XH as z,nu as za,jd as zi,Ew as zn,zh as zr,uL as zt};
|