@shllg/emend 0.2.0 → 0.3.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/README.md +2 -1
- package/dist/emend.mjs +21082 -19217
- package/dist/publish-worker.mjs +4181 -3998
- package/dist/skills/emend-publish/SKILL.md +15 -7
- package/dist/skills/emend-review/SKILL.md +5 -2
- package/dist/skills/emend-review/references/manifest.md +5 -2
- package/dist/web/assets/App-BGSrPzZU.js +4 -0
- package/dist/web/assets/DiffPane-CnM0c-g-.js +238 -0
- package/dist/web/assets/{app-BrSxOaSi.js → app-CnDYJ1G1.js} +2 -2
- package/dist/web/assets/app-DXKT0r1-.css +2 -0
- package/dist/web/assets/diff-counts-aavca3cx.js +95 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/assets/App-DPbforeN.js +0 -4
- package/dist/web/assets/DiffPane-Ck50eAdK.js +0 -238
- package/dist/web/assets/app-RgxpbwFB.css +0 -2
- package/dist/web/assets/diff-counts-MdwymqCR.js +0 -95
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,A as n,B as r,C as i,D as a,E as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,M as m,N as h,O as g,P as _,Q as v,R as y,S as b,T as x,U as S,V as C,W as w,X as T,Y as ee,Z as te,_ as ne,a as E,b as re,c as D,d as O,et as ie,f as ae,g as oe,h as k,i as se,j as ce,k as le,l as ue,m as de,n as fe,nt as pe,o as A,p as j,q as me,r as he,rt as ge,s as _e,t as ve,tt as ye,u as be,v as xe,w as Se,x as M,y as Ce,z as we}from"./jsx-runtime-BwolrYx8.js";function Te(){let e=this._zod;return e.message??=JSON.stringify(e.def,p,2),e.message}function Ee(e){this._zod.message=e}var De={get:Te,set:Ee,enumerable:!0,configurable:!0},Oe={value:void 0,enumerable:!1},ke=new WeakSet([Object.prototype,Error.prototype]),Ae=A(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Oe.value=t,Object.defineProperty(e,"issues",Oe),Oe.value=void 0,Object.defineProperty(e,"message",De);let n=Object.getPrototypeOf(e);ke.has(n)||(ke.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function je(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Me(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?je(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ne(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Pe(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Fe=e=>{let t=(n,r,i,o)=>{let s=i?{...i,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new se;if(c.issues.length){let n=new((o?.Err)??e)(c.issues.map(e=>a(e,s,_e())));throw oe(n,o?.callee??t),n}return c.value};return t},Ie=e=>{let t=async(n,r,i,o)=>{let s=i?{...i,async:!0}:{async:!0},c=n._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let n=new((o?.Err)??e)(c.issues.map(e=>a(e,s,_e())));throw oe(n,o?.callee??t),n}return c.value};return t},Le=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new se;return a.issues.length?Re(e,a.issues,i):{success:!0,data:a.value}};function Re(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>a(e,n,_e()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var ze=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Re(e,a.issues,i):{success:!0,data:a.value}},Be=Symbol.for(`zod.compile.invalid`),Ve=Symbol.for(`zod.compile.fallback`),He=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Be)return!0;if(r.definite===!0&&n===void 0)return!1}return Ue(e,t,n)});function Ue(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ve]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new se;return a.issues.length===0}var We=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Ge=e=>{let t=Fe(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Pe(n,a))};return n},Ke=e=>{let t=Fe(e),n=(e,r,i,a)=>t(e,r,i,Pe(n,a));return n},qe=e=>{let t=Ie(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Pe(n,a))};return n},Je=e=>{let t=Ie(e),n=async(e,r,i,a)=>await t(e,r,i,Pe(n,a));return n},Ye=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Le(e)(t,n,i)},Xe=e=>(t,n,r)=>Le(e)(t,n,r),Ze=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ze(e)(t,n,i)},Qe=e=>async(t,n,r)=>ze(e)(t,n,r),$e=/^[cC][0-9a-z]{6,}$/,et=/^[0-9a-z]+$/,tt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,nt=/^[0-9a-vA-V]{20}$/,rt=/^[A-Za-z0-9]{27}$/,it=/^[a-zA-Z0-9_-]{21}$/;function at(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,st=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ct=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ut=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function dt(){return new RegExp(ut,`u`)}var ft=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,mt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ht=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_t=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,vt=/^https?$/,yt=/^\+[1-9]\d{6,14}$/,bt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function xt(e){return RegExp(`^${e}$`)}var St=xt(bt);function Ct(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wt(e){return RegExp(`^${Ct(e)}$`)}function Tt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ct({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ct({precision:e.precision})}`:n;return RegExp(`^${bt}T(?:${r})$`)}var Et=/^[\s\S]{0,}$/,Dt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ot=/^-?\d+$/,kt=/^-?\d+(?:\.\d+)?$/,At=/^(?:true|false)$/i,jt=/^[^A-Z]*$/,Mt=/^[^a-z]*$/,Nt=A(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Pt=e=>{let t=e.value;return!C(t)&&t.length!==void 0},Ft={number:`number`,bigint:`bigint`,object:`date`},It=A(`$ZodCheckLessThan`,(e,t)=>{Nt.init(e,t);let n=Ft[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Ft[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Lt=A(`$ZodCheckGreaterThan`,(e,t)=>{Nt.init(e,t);let n=Ft[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Ft[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rt=A(`$ZodCheckMultipleOf`,(e,t)=>{Nt.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):g(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),zt=A(`$ZodCheckNumberFormat`,(e,t)=>{Nt.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=be[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Bt=A(`$ZodCheckMaxLength`,(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=r=>{let i=r.value,a=i.length;if((typeof i==`string`&&a>t.maximum?Ce(i):a)<=t.maximum)return;let o=n(i);r.issues.push({origin:o,code:`too_big`,maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Vt=A(`$ZodCheckMinLength`,(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=r=>{let i=r.value,a=i.length;if((typeof i==`string`&&a>=t.minimum&&a<t.minimum*2?Ce(i):a)>=t.minimum)return;let o=n(i);r.issues.push({origin:o,code:`too_small`,minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ht=A(`$ZodCheckLengthEquals`,(e,t)=>{var r;Nt.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=r=>{let i=r.value,a=i.length,o=typeof i==`string`&&a>=t.length&&a<=t.length*2?Ce(i):a;if(o===t.length)return;let s=n(i),c=o>t.length;r.issues.push({origin:s,...c?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ut=A(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Nt.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Wt=A(`$ZodCheckRegex`,(e,t)=>{Ut.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gt=A(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=jt,Ut.init(e,t)}),Kt=A(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Mt,Ut.init(e,t)}),qt=A(`$ZodCheckIncludes`,(e,t)=>{Nt.init(e,t);let n=Se(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Jt=A(`$ZodCheckStartsWith`,(e,t)=>{Nt.init(e,t);let n=RegExp(`^${Se(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Yt=A(`$ZodCheckEndsWith`,(e,t)=>{Nt.init(e,t);let n=RegExp(`.*${Se(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Xt=A(`$ZodCheckOverwrite`,(e,t)=>{Nt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Zt=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
-
`)}\n};`)(...Object.values(this.closed))}},Qt={major:4,minor:6,patch:7},N=A(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Qt;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=O(t),a;for(let o of n){if(o._zod.def.when){if(x(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new se;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(de(t.issues,n,e),i||=O(t,n))});else{if(t.issues.length===n)continue;de(t.issues,n,e),i||=O(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(O(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new se;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new se;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return ce(this,`~standard`,tn(this))},set"~standard"(e){w(this,`~standard`,e)}}),$t=(e,t)=>e.issues.length?{issues:e.issues.map(e=>a(e,t,_e()))}:{value:e.value};async function en(e,t){let n={async:!0};return $t(await e._zod.run({value:t,issues:[]},n),n)}function tn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return $t(r,n)}catch{}return en(e,t)},vendor:`zod`,version:1}}var nn=A(`$ZodString`,(e,t)=>{N.init(e,t),e._zod.pattern=t.pattern??Et,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),P=A(`$ZodStringFormat`,(e,t)=>{Ut.init(e,t),nn.init(e,t)}),rn=A(`$ZodGUID`,(e,t)=>{t.pattern??=st,P.init(e,t)}),an=A(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ct(e)}else t.pattern??=ct();P.init(e,t)}),on=A(`$ZodEmail`,(e,t)=>{t.pattern??=lt,P.init(e,t)});function sn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function cn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?sn(e)||2:ln(e,t)}function ln(e,t){if(!t.normalize&&t.protocol?.source===vt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var un=/[\t\n\r]/g;function dn(e){return e.replace(un,``)}function fn(e,t){return t.lastIndex=0,t.test(e.hostname)}function pn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var mn=A(`$ZodURL`,(e,t)=>{P.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=cn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=dn(r);return}t.hostname&&!fn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!pn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:dn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),hn=A(`$ZodEmoji`,(e,t)=>{t.pattern??=dt(),P.init(e,t)}),gn=A(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?it:at(t.length),P.init(e,t)}),_n=A(`$ZodCUID`,(e,t)=>{t.pattern??=$e,P.init(e,t)}),vn=A(`$ZodCUID2`,(e,t)=>{t.pattern??=et,P.init(e,t)}),yn=A(`$ZodULID`,(e,t)=>{t.pattern??=tt,P.init(e,t)}),bn=A(`$ZodXID`,(e,t)=>{t.pattern??=nt,P.init(e,t)}),xn=A(`$ZodKSUID`,(e,t)=>{t.pattern??=rt,P.init(e,t)}),Sn=A(`$ZodISODateTime`,(e,t)=>{t.pattern??=Tt(t),P.init(e,t)}),Cn=A(`$ZodISODate`,(e,t)=>{t.pattern??=St,P.init(e,t)}),wn=A(`$ZodISOTime`,(e,t)=>{t.pattern??=wt(t),P.init(e,t)}),Tn=A(`$ZodISODuration`,(e,t)=>{t.pattern??=ot,P.init(e,t)}),En=A(`$ZodIPv4`,(e,t)=>{t.pattern??=ft,P.init(e,t)}),Dn=/^[0-9a-fA-F:.]+$/;function On(e){return Dn.test(e)?sn(`http://[${e}]`):!1}var kn=A(`$ZodIPv6`,(e,t)=>{t.pattern??=pt,P.init(e,t),e._zod.check=n=>{On(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),An=A(`$ZodCIDRv4`,(e,t)=>{t.pattern??=mt,P.init(e,t)});function jn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:On(n)}var Mn=A(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ht,P.init(e,t),e._zod.check=n=>{jn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Nn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Pn=/^[0-9a-zA-Z+/]*={0,2}$/,Fn=A(`$ZodBase64`,(e,t)=>{t.pattern??=Pn,P.init(e,t),e._zod.check=n=>{Nn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),In=/^[A-Za-z0-9_-]*$/;function Ln(e){if(!In.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Nn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Rn=A(`$ZodBase64URL`,(e,t)=>{t.pattern??=In,P.init(e,t),e._zod.check=n=>{Ln(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),zn=A(`$ZodE164`,(e,t)=>{t.pattern??=yt,P.init(e,t)});function Bn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Vn=A(`$ZodJWT`,(e,t)=>{P.init(e,t),e._zod.check=n=>{Bn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Hn=A(`$ZodNumber`,(e,t)=>{N.init(e,t),e._zod.pattern=kt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Un=A(`$ZodNumberFormat`,(e,t)=>{zt.init(e,t),Hn.init(e,t)}),Wn=A(`$ZodBoolean`,(e,t)=>{N.init(e,t),e._zod.pattern=At,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Gn=A(`$ZodUnknown`,(e,t)=>{N.init(e,t),e._zod.parse=e=>e}),Kn=A(`$ZodNever`,(e,t)=>{N.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function qn(e,t){let n=ye(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of ye(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,de(n.issues,t,e),n}}return i(n,a)}}var Jn=e=>Array.isArray(e)?e.length:-1;function Yn(e,t,n){e.issues.length&&t.issues.push(...d(n,e.issues)),t.value[n]=e.value}var Xn=A(`$ZodArray`,(e,t)=>{N.init(e,t);let n=D.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Yn(t,r,e)));else if(Yn(c,r,e),s&&c.issues.length!==0&&O(c))break}return o.length?Promise.all(o).then(()=>r):r},qn(e,Jn)});function Zn(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...d(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Qn=[];function $n(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Qn,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=S(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function er(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(O(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Zn(e,n,i,t,d,f))):Zn(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var tr=A(`$ZodObject`,(e,t)=>{N.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=k(()=>$n(t));M(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||j(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=h,o=t.catchall,s,c=D.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(O(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Zn(n,t,e,r,a,o))):Zn(s,t,e,r,a,o)}return o?er(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),nr=A(`$ZodObjectJIT`,(e,t)=>{tr.init(e,t);let n=e._zod.parse,r=k(()=>$n(t)),a=D.memoizer,o=t=>{let n=r.value,o=n.symbolKeys,s=new Zt([`payload`,`ctx`],{shape:t,inst:e,memo:a,syms:o}),c=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
4
|
-
let ${e}_ab = false;
|
|
5
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
-
const iss = ${e}.issues[i];
|
|
7
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
-
payload.issues.push(iss);
|
|
9
|
-
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
-
}
|
|
11
|
-
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
-
payload.value = newResult;
|
|
13
|
-
return payload;
|
|
14
|
-
}`;s.write(`const input = payload.value;`);let u=Object.create(null),d=0;for(let e of n.allKeys)u[e]=`key_${d++}`;s.write(a?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=u[e],r=typeof e==`symbol`?`syms[${o.indexOf(e)}]`:i(e),a=`${r} in input`,d=t[e],f=d?._zod?.optin,p=f!==void 0,m=d?._zod?.optout===`optional`;if(s.write(`const ${n} = ${c(r)};`),p&&m){let e=f===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;s.write(`
|
|
15
|
-
const ${n}_present = ${a};
|
|
16
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
-
if (${n}.issues.length) {${l(n,r)}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (${e}) {
|
|
21
|
-
newResult[${r}] = ${n}.value;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
`)}else p?(s.write(`
|
|
26
|
-
if (${n}.issues.length) {${l(n,r)}
|
|
27
|
-
}
|
|
28
|
-
`),f===`defaulted`?s.write(`newResult[${r}] = ${n}.value;`):s.write(`
|
|
29
|
-
if (${n}.value !== undefined || ${a}) {
|
|
30
|
-
newResult[${r}] = ${n}.value;
|
|
31
|
-
}
|
|
32
|
-
`)):s.write(`
|
|
33
|
-
const ${n}_present = ${a};
|
|
34
|
-
if (${n}.issues.length) {${l(n,r)}
|
|
35
|
-
}
|
|
36
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
-
payload.issues.push({
|
|
38
|
-
code: "invalid_type",
|
|
39
|
-
expected: "nonoptional",
|
|
40
|
-
input: undefined,
|
|
41
|
-
path: [${r}]
|
|
42
|
-
});
|
|
43
|
-
if (ctx && ctx.abortEarly) {
|
|
44
|
-
payload.value = newResult;
|
|
45
|
-
return payload;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (${n}_present) {
|
|
50
|
-
newResult[${r}] = ${n}.value;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
`)}return s.write(`payload.value = newResult;`),s.write(`return payload;`),s.compile()},s,c=h,l=!D.jitless,u=l&&ae.value,d=t.catchall,f;e._zod.parse=(i,a)=>{f??=r.value;let p=i.value;return c(p)?l&&u&&a?.async===!1&&a.jitless!==!0?(s||=o(t.shape),i=s(i,a),d?er([],p,i,a,f,e,a?.abortEarly===!0):i):n(i,a):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function rr(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=>!O(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=>a(e,r,_e())))}),t)}var ir=A(`$ZodUnion`,(e,t)=>{N.init(e,t),M(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),M(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),M(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)))}),M(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=>ne(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=>rr(t,r,e,i)):rr(o,r,e,i)}});function ar(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 or=A(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,ir.init(e,t);let n=e._zod.parse;M(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)||j(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=te(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=k(()=>ar(t));e._zod.parse=(i,a)=>{let o=i.value;if(!h(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)}}),sr=A(`$ZodIntersection`,(e,t)=>{N.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])=>lr(e,t,n)):lr(e,i,a)}});function cr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(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=cr(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=cr(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 lr(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=cr(t.value,n.value);if(!c.valid){if(O(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ur=A(`$ZodRecord`,(e,t)=>{N.init(e,t);let n=D.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!_(o))return r.issues.push({expected:`record`,code:`invalid_type`,input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let l=new Set;for(let n of c)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(l.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let c=t.keyType._zod.run({value:n,issues:[]},i);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(c.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>a(e,i,_e())),input:n,path:[n],inst:e});continue}let u=c.value;if(u===`__proto__`)continue;let f=t.valueType._zod.run({value:o[n],issues:[]},i);f instanceof Promise?s.push(f.then(e=>{e.issues.length&&r.issues.push(...d(n,e.issues)),r.value[u]=e.value})):(f.issues.length&&r.issues.push(...d(n,f.issues)),r.value[u]=f.value)}let u;for(let e in o)if(!l.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=o[e]}else u??=[],u.push(e)}u&&u.length>0&&r.issues.push({code:`unrecognized_keys`,input:o,inst:e,keys:u,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let l;for(let n of Reflect.ownKeys(o)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(o,n))continue;let u=t.keyType._zod.run({value:n,issues:[]},i);if(u instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&kt.test(n)&&u.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&&(u=e)}if(u.issues.length){t.mode===`loose`?r.value[n]=o[n]:c?(l??=[],l.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:u.issues.map(e=>a(e,i,_e())),input:n,path:[n],inst:e});continue}let f=u.value;if(f===`__proto__`)continue;let p=t.valueType._zod.run({value:o[n],issues:[]},i);p instanceof Promise?s.push(p.then(e=>{e.issues.length&&r.issues.push(...d(n,e.issues)),r.value[f]=e.value})):(p.issues.length&&r.issues.push(...d(n,p.issues)),r.value[f]=p.value)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:o,inst:e,keys:l,continue:!0})}return s.length?Promise.all(s).then(()=>r):r}}),dr=A(`$ZodEnum`,(e,t)=>{N.init(e,t);let n=le(t.entries),r=new Set(n);e._zod.values=r,M(e,`pattern`,e=>{let t=le(e.def.entries).filter(e=>T.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Se(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}}),fr=A(`$ZodLiteral`,(e,t)=>{N.init(e,t);let n=new Set(t.values);e._zod.values=n,M(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Se(e):e?Se(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}}),pr=A(`$ZodTransform`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,D.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new E(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 se;return n.value=i,n}});function mr(e,t){return e.value=t.issues.length?void 0:t.value,e}var hr=A(`$ZodOptional`,(e,t)=>{N.init(e,t),M(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,M(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),M(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ne(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=>mr(e,t)):mr(e,r)}return t.innerType._zod.run(e,n)}}),gr=A(`$ZodExactOptional`,(e,t)=>{hr.init(e,t),M(e,`values`,e=>e.def.innerType._zod.values),M(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),_r=A(`$ZodNullable`,(e,t)=>{N.init(e,t),M(e,`optin`,e=>e.def.innerType._zod.optin),M(e,`optout`,e=>e.def.innerType._zod.optout),M(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ne(t.source)}|null)$`):void 0}),M(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)}),vr=A(`$ZodDefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,M(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=>yr(e,t)):yr(r,t)}});function yr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var br=A(`$ZodPrefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,M(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))}),xr=A(`$ZodNonOptional`,(e,t)=>{N.init(e,t),M(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=>Sr(t,e)):Sr(i,e)}});function Sr(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 Cr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>a(e,r,_e()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var wr=A(`$ZodCatch`,(e,t)=>{N.init(e,t),M(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),M(e,`optout`,e=>e.def.innerType._zod.optout),M(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=>Cr(e,r,t,n)):Cr(e,r,t,n)}}),Tr=A(`$ZodPipe`,(e,t)=>{N.init(e,t),M(e,`values`,e=>e.def.in._zod.values),M(e,`optin`,e=>e.def.in._zod.optin),M(e,`optout`,e=>e.def.out._zod.optout),M(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=>Er(e,t.in,n)):Er(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Er(e,t.out,n)):Er(r,t.out,n)}});function Er(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 Dr=A(`$ZodReadonly`,(e,t)=>{N.init(e,t),M(e,`propValues`,e=>e.def.innerType._zod.propValues),M(e,`values`,e=>e.def.innerType._zod.values),M(e,`optin`,e=>e.def.innerType?._zod?.optin),M(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(Or):Or(r)}});function Or(e){return e.memo||(e.value=Object.freeze(e.value)),e}function kr(e){let t=e._zod.def,n=t.pattern,r=!!t.format?.includes(`int`),i,a;for(let e of t.checks??[]){let t=e._zod.def;t.pattern&&(n=t.pattern),r||=!!t.format?.includes(`int`);let o=t.minimum??t.length,s=t.maximum??t.length;o!==void 0&&(i===void 0||o>i)&&(i=o),s!==void 0&&(a===void 0||s<a)&&(a=s)}if(n)return n.source;if(i!==void 0&&a!==void 0&&i>a)return`(?!)`;if(i!==void 0||a!==void 0)return Dt({minimum:i,maximum:a}).source;let o=e._zod.pattern;return(r&&o===kt?Ot:o)?.source}function Ar(e){let t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){let e=r._zod.pattern?.source,t=Ar(r);return n&&e&&t&&t!==e?n.replace(ne(e),()=>ne(t)):n}if(t.options){let e=t.options.map(Ar);if(e.every(Boolean))return`^(${e.map(e=>ne(e)).join(`|`)})$`}return kr(e)}var jr=A(`$ZodTemplateLiteral`,(e,t)=>{N.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){let t=Ar(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(ne(t))}else if(e===null||ee.has(typeof e))n.push(Se(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Mr=A(`$ZodCustom`,(e,t)=>{Nt.init(e,t),N.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=>Nr(t,n,r,e));Nr(i,n,r,e)}});function Nr(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(s(e))}}var Pr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Fr=`~memo`,Ir=[];function Lr(e){return typeof e==`object`&&!!e}function Rr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var zr=new WeakMap,Br=0,Vr=1,Hr=2;function Ur(e,t,n){let r=zr.get(e);if(r!==void 0)return r?Hr:Br;if(t.has(e))return Hr;t.add(e);let i=Br,a=e=>{if(i!==Hr&&e?._zod){let r=Ur(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Br;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Vr:o.value?._zod?Ur(o.value,t,n):Br;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=te(c);s(e?o(e,!0):Vr),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?Ur(r,t,!1):Vr);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),Wr(e,i)}function Wr(e,t){return t!==Vr&&zr.set(e,t===Hr),t}function Gr(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Kr,qr=[],Jr={alloc(e,t,n){let r=Kr;if(!r)return n;Kr=void 0;let i={value:n,issues:null};return r.set(t.value,i),qr.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`&&Xr(n,e.value))throw new Pr;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=Ur(e,new Set,!1);if(i===Br)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Hr||r?n=!0:r=!0}let l=s.value;if(!Lr(l))return t(s,c);let u=c[Fr];u||(u={buckets:new WeakMap,backEdges:void 0},c[Fr]=u);let d;i===c?d=a:(d=Gr(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(...Rr(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Kr=d;let p=qr.length,m=t(s,c);Kr=void 0;let h=qr.length>p?qr.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Rr(e.issues):Ir),e)):(h&&(h.issues=m.issues.length?Rr(m.issues):Ir),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Yr(){return Jr}function Xr(e,t){let n=e[Fr]?.backEdges;return n!==void 0&&Lr(t)&&n.has(t)}var Zr=()=>{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(c(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ge(e.values[0])}`:`Invalid option: expected one of ${u(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`:``}: ${u(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 Qr(){return{localeError:Zr()}}var $r,ei=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 ti(){return new ei}($r=globalThis).__zod_globalRegistry??($r.__zod_globalRegistry=ti());var ni=globalThis.__zod_globalRegistry;function ri(e){return e.checks&&=[...e.checks],e}function ii(e,t){return new e(ri({type:`string`,...r(t)}))}function ai(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...r(t)})}function oi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...r(t)})}function si(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...r(t)})}function ci(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...r(t)})}function li(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...r(t)})}function ui(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...r(t)})}function di(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...r(t)})}function fi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...r(t)})}function pi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...r(t)})}function mi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...r(t)})}function hi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...r(t)})}function gi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...r(t)})}function _i(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...r(t)})}function vi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...r(t)})}function yi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...r(t)})}function bi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...r(t)})}function xi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...r(t)})}function Si(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...r(t)})}function Ci(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...r(t)})}function wi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...r(t)})}function Ti(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...r(t)})}function Ei(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...r(t)})}function Di(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...r(t)})}function Oi(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...r(t)})}function ki(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...r(t)})}function Ai(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...r(t)})}function ji(e,t){return new e(ri({type:`number`,checks:[],...r(t)}))}function Mi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...r(t)})}function Ni(e,t){return new e({type:`boolean`,...r(t)})}function Pi(e){return new e({type:`unknown`})}function Fi(e,t){return new e({type:`never`,...r(t)})}function Ii(e,t){return new It({check:`less_than`,...r(t),value:e,inclusive:!1})}function Li(e,t){return new It({check:`less_than`,...r(t),value:e,inclusive:!0})}function Ri(e,t){return new Lt({check:`greater_than`,...r(t),value:e,inclusive:!1})}function zi(e,t){return new Lt({check:`greater_than`,...r(t),value:e,inclusive:!0})}function Bi(e,t){return new Rt({check:`multiple_of`,...r(t),value:e})}function Vi(e,t){return new Bt({check:`max_length`,...r(t),maximum:e})}function Hi(e,t){return new Vt({check:`min_length`,...r(t),minimum:e})}function Ui(e,t){return new Ht({check:`length_equals`,...r(t),length:e})}function Wi(e,t){return new Wt({check:`string_format`,format:`regex`,...r(t),pattern:e})}function Gi(e){return new Gt({check:`string_format`,format:`lowercase`,...r(e)})}function Ki(e){return new Kt({check:`string_format`,format:`uppercase`,...r(e)})}function qi(e,t){return new qt({check:`string_format`,format:`includes`,...r(t),includes:e})}function Ji(e,t){return new Jt({check:`string_format`,format:`starts_with`,...r(t),prefix:e})}function Yi(e,t){return new Yt({check:`string_format`,format:`ends_with`,...r(t),suffix:e})}function Xi(e){return new Xt({check:`overwrite`,tx:e})}function Zi(e){return Xi(t=>t.normalize(e))}function Qi(){return Xi(e=>e.trim())}function $i(){return Xi(e=>e.toLowerCase())}function ea(){return Xi(e=>e.toUpperCase())}function ta(){return Xi(e=>pe(e))}function na(e,t,n){return new e({type:`array`,element:t,...r(n)})}function ra(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...r(n)})}function ia(e,t){let n=aa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(s(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(s(r))}},e(t.value,t)),t);return n}function aa(e,t){let n=new Nt({check:`custom`,...r(t)});return n._zod.check=e,n}function oa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&j(e,t,n[t]);return e}function sa(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??ni,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 ca(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 la(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,la(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&oa(o.schema,c),t.io===`input`&&ya(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 ua(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function da(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}/${ua(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+ua(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
|
-
|
|
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 fa(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;fa(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 pa=new Set([`type`,`properties`,`required`,`additionalProperties`]),ma=[`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 ga(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!pa.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))}let i=e.length===1?e[0]:ga(e)??{allOf:e};j(n,r,i)}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 _a(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of pa)if(t in e)return;let n=t.filter(e=>ma.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ga(t);else{let e=n[0],i=ma.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=>ga([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,oa(e,r))}function va(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)):oa(i,s),oa(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())fa(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)??[])_a(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)}oa(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,j(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:xa(t,`input`,e.processors),output:xa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ya(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 ya(r.element,n);if(r.type===`set`)return ya(r.valueType,n);if(r.type===`lazy`)return ya(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 ya(r.innerType,n);if(r.type===`intersection`)return ya(r.left,n)||ya(r.right,n);if(r.type===`record`||r.type===`map`)return ya(r.keyType,n)||ya(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ya(r.in,n)||ya(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ya(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ya(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ya(e,n))return!0;return!!(r.rest&&ya(r.rest,n))}return!1}var ba=(e,t={})=>n=>{let r=sa({...n,processors:t});return la(e,r),da(r,e),va(r,e)},xa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=sa({...i??{},target:a,io:t,processors:n});return la(e,o),da(o,e),va(o,e)},Sa=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ca=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},wa=(e,t)=>{Sa(e,`minimum`,t),Ca(e,`maximum`,t)},Ta=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ea=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Da=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Oa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ka=(e,t)=>Sa(e,`minimum`,t.minimum),Aa=(e,t)=>Ca(e,`maximum`,t.maximum),ja=e=>(t,n)=>{Oa(t,n.format);let[r,i]=e[n.format];Sa(t,`minimum`,r),Ca(t,`maximum`,i)},Ma={greater_than:(e,t)=>Sa(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ca(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ta(e,t.value),number_format:ja(be),bigint_format:ja(ue),min_length:ka,max_length:Aa,length_equals:(e,t)=>wa(e,t.length),min_size:ka,max_size:Aa,size_equals:(e,t)=>wa(e,t.size),string_format:(e,t)=>{Oa(e,t.format),t.pattern&&Ea(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)=>Da(e,t.mime)};function Na(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ma[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Sa(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Sa(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ca(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ca(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ta(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Da(t,i.mime);for(let e of i.patterns??[])Ea(t,e);return t}var Pa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Fa=new Map([[Pn,gt],[In,_t]]),Ia=e=>Fa.get(e)??e,La=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Na(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Pa[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(Ia);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}))])}},Ra=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Na(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)):ca(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}))])}},za=(e,t,n,r)=>{n.type=`boolean`},Ba=(e,t,n,r)=>{n.not={}},Va=(e,t,n,r)=>{let i=e._zod.def,a=le(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)},Ha=(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(ca(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(ca(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}},Ua=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Wa=(e,t,n,r)=>{ca(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ga=(e,t,n,r)=>{ca(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Na(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=la(a.element,t,{...r,path:[...r.path,`items`]})};function qa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?qa(t.out):t.type===`catch`?qa(t.innerType):e._zod.optin}var Ja=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ca(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)j(i.properties,e,la(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`?qa(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=la(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ya=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>la(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Xa=(e,t,n,r)=>{let i=e._zod.def,a=la(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=la(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)};function Za(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=Za(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=>Za(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`)?kt:Ot).source)),p}var Qa=new WeakMap;function $a(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 Qa.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Za(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 eo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Na(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=la(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)j(i.patternProperties,Ia(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=la(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Qa.get(t);n||(n=[],Qa.set(t,n),t.deferred.push(()=>$a(t))),n.push(e)}i.additionalProperties=la(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&qa(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))}},to=(e,t,n,r)=>{let i=e._zod.def,a=la(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`}]},no=(e,t,n,r)=>{let i=e._zod.def;la(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ro=Symbol();function io(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ca(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ro):JSON.parse(o)}var ao=(e,t,n,r)=>{let i=e._zod.def;la(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=io(i.defaultValue,e,t,n,r);o!==ro&&(n.default=o)},oo=(e,t,n,r)=>{let i=e._zod.def;la(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=io(i.defaultValue,e,t,n,r);o!==ro&&(n._prefault=o)},so=(e,t,n,r)=>{let i=e._zod.def;la(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ca(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},co=(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;la(o,t,r);let s=t.seen.get(e);s.ref=o},lo=(e,t,n,r)=>{let i=e._zod.def;la(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},uo=(e,t,n,r)=>{let i=e._zod.def;la(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fo=new WeakSet([Object.prototype,Error.prototype]);function po(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 mo=A(`ZodError`,(e,t)=>{Ae.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);fo.has(n)||(fo.add(n),po(n,`format`,e=>t=>Ne(e,t)),po(n,`flatten`,e=>t=>Me(e,t)),po(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,p,2)}),po(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,p,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ho=Fe(mo),go=Ie(mo),_o=Le(mo),vo=ze(mo),yo=Ge(mo),bo=Ke(mo),xo=qe(mo),So=Je(mo),Co=Ye(mo),wo=Xe(mo),To=Ze(mo),Eo=Qe(mo);function Do(){D.localeError||_e(Qr())}function Oo(){D.memoizer||_e({memoizer:Yr()})}var F=A(`ZodType`,(e,t)=>(Do(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(we(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 xe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ks(e,t))},superRefine(e,t){return this.check(qs(e,t))},overwrite(e){return this.check(Xi(e))},optional(){return Es(this)},exactOptional(){return Os(this)},nullable(){return As(this)},nullish(){return Es(As(this))},nonoptional(e){return Is(this,e)},array(){return B(this)},or(e){return ms([this,e])},and(e){return vs(this,e)},transform(e){return Bs(this,ws(e))},default(e){return Ms(this,e)},prefault(e){return Ps(this,e)},catch(e){return Rs(this,e)},pipe(e){return Bs(this,e)},readonly(){return Hs(this)},describe(e){let t=this.clone();return ni.add(t,{description:e}),t},meta(...e){if(e.length===0)return ni.get(this);let t=this.clone();return ni.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 ce(this,`~standard`,{...tn(this),jsonSchema:{input:xa(this,`input`),output:xa(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return ho(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await go(this,t,n,{callee:e})},safeParse(e,t){return _o(this,e,t)},async safeParseAsync(e,t){return vo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(this,`spa`,e)},validate(e,t){return He(this,e,t)},validateAsync(e,t){return We(this,e,t)},encode:function e(t,n){return yo(this,t,n,{callee:e})},decode:function e(t,n){return bo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await So(this,t,n,{callee:e})},safeEncode(e,t){return Co(this,e,t)},safeDecode(e,t){return wo(this,e,t)},async safeEncodeAsync(e,t){return To(this,e,t)},async safeDecodeAsync(e,t){return Eo(this,e,t)},toJSONSchema(e){return ba(this,{})(e)},get description(){return ni.get(this)?.description},get _def(){return this._zod.def}}),ko=A(`_ZodString`,(e,t)=>{nn.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>La(e,t,n,r)},b({format:e=>Na(e).format??null,minLength:e=>Na(e).minimum??null,maxLength:e=>Na(e).maximum??null},{regex(...e){return this.check(Wi(...e))},includes(...e){return this.check(qi(...e))},startsWith(...e){return this.check(Ji(...e))},endsWith(...e){return this.check(Yi(...e))},min(...e){return this.check(Hi(...e))},max(...e){return this.check(Vi(...e))},length(...e){return this.check(Ui(...e))},nonempty(...e){return this.check(Hi(1,...e))},lowercase(e){return this.check(Gi(e))},uppercase(e){return this.check(Ki(e))},trim(){return this.check(Qi())},normalize(...e){return this.check(Zi(...e))},toLowerCase(){return this.check($i())},toUpperCase(){return this.check(ea())},slugify(){return this.check(ta())}})),Ao=A(`ZodString`,(e,t)=>{nn.init(e,t),ko.init(e,t)},{email(e){return this.check(ai(Fo,e))},url(e){return this.check(di(Ro,e))},jwt(e){return this.check(Ei(es,e))},emoji(e){return this.check(fi(Bo,e))},guid(e){return this.check(oi(Io,e))},uuid(e){return this.check(si(Lo,e))},uuidv4(e){return this.check(ci(Lo,e))},uuidv6(e){return this.check(li(Lo,e))},uuidv7(e){return this.check(ui(Lo,e))},nanoid(e){return this.check(pi(Vo,e))},cuid(e){return this.check(mi(Ho,e))},cuid2(e){return this.check(hi(Uo,e))},ulid(e){return this.check(gi(Wo,e))},base64(e){return this.check(Ci(Zo,e))},base64url(e){return this.check(wi(Qo,e))},xid(e){return this.check(_i(Go,e))},ksuid(e){return this.check(vi(Ko,e))},ipv4(e){return this.check(yi(qo,e))},ipv6(e){return this.check(bi(Jo,e))},cidrv4(e){return this.check(xi(Yo,e))},cidrv6(e){return this.check(Si(Xo,e))},e164(e){return this.check(Ti($o,e))},datetime(e){return this.check(Di(jo,e))},date(e){return this.check(Oi(Mo,e))},time(e){return this.check(ki(No,e))},duration(e){return this.check(Ai(Po,e))}});function I(e){return ii(Ao,e)}var L=A(`ZodStringFormat`,(e,t)=>{P.init(e,t),ko.init(e,t)}),jo=A(`ZodISODateTime`,(e,t)=>{Sn.init(e,t),L.init(e,t)}),Mo=A(`ZodISODate`,(e,t)=>{Cn.init(e,t),L.init(e,t)}),No=A(`ZodISOTime`,(e,t)=>{wn.init(e,t),L.init(e,t)}),Po=A(`ZodISODuration`,(e,t)=>{Tn.init(e,t),L.init(e,t)}),Fo=A(`ZodEmail`,(e,t)=>{on.init(e,t),L.init(e,t)}),Io=A(`ZodGUID`,(e,t)=>{rn.init(e,t),L.init(e,t)}),Lo=A(`ZodUUID`,(e,t)=>{an.init(e,t),L.init(e,t)});function R(e){return si(Lo,e)}var Ro=A(`ZodURL`,(e,t)=>{mn.init(e,t),L.init(e,t)});function zo(e){return di(Ro,e)}var Bo=A(`ZodEmoji`,(e,t)=>{hn.init(e,t),L.init(e,t)}),Vo=A(`ZodNanoID`,(e,t)=>{gn.init(e,t),L.init(e,t)}),Ho=A(`ZodCUID`,(e,t)=>{_n.init(e,t),L.init(e,t)}),Uo=A(`ZodCUID2`,(e,t)=>{vn.init(e,t),L.init(e,t)}),Wo=A(`ZodULID`,(e,t)=>{yn.init(e,t),L.init(e,t)}),Go=A(`ZodXID`,(e,t)=>{bn.init(e,t),L.init(e,t)}),Ko=A(`ZodKSUID`,(e,t)=>{xn.init(e,t),L.init(e,t)}),qo=A(`ZodIPv4`,(e,t)=>{En.init(e,t),L.init(e,t)}),Jo=A(`ZodIPv6`,(e,t)=>{kn.init(e,t),L.init(e,t)}),Yo=A(`ZodCIDRv4`,(e,t)=>{An.init(e,t),L.init(e,t)}),Xo=A(`ZodCIDRv6`,(e,t)=>{Mn.init(e,t),L.init(e,t)}),Zo=A(`ZodBase64`,(e,t)=>{Fn.init(e,t),L.init(e,t)}),Qo=A(`ZodBase64URL`,(e,t)=>{Rn.init(e,t),L.init(e,t)}),$o=A(`ZodE164`,(e,t)=>{zn.init(e,t),L.init(e,t)}),es=A(`ZodJWT`,(e,t)=>{Vn.init(e,t),L.init(e,t)}),ts=A(`ZodNumber`,(e,t)=>{Hn.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r),e.isFinite=!0},b({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Na(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Na(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Na(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Na(e).format??null},{gt(e,t){return this.check(Ri(e,t))},gte(e,t){return this.check(zi(e,t))},min(e,t){return this.check(zi(e,t))},lt(e,t){return this.check(Ii(e,t))},lte(e,t){return this.check(Li(e,t))},max(e,t){return this.check(Li(e,t))},int(e){return this.check(z(e))},safe(e){return this.check(z(e))},positive(e){return this.check(Ri(0,e))},nonnegative(e){return this.check(zi(0,e))},negative(e){return this.check(Ii(0,e))},nonpositive(e){return this.check(Li(0,e))},multipleOf(e,t){return this.check(Bi(e,t))},step(e,t){return this.check(Bi(e,t))},finite(){return this}}));function ns(e){return ji(ts,e)}var rs=A(`ZodNumberFormat`,(e,t)=>{Un.init(e,t),ts.init(e,t)});function z(e){return Mi(rs,e)}var is=A(`ZodBoolean`,(e,t)=>{Wn.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r)});function as(e){return Ni(is,e)}var os=A(`ZodUnknown`,(e,t)=>{Gn.init(e,t),F.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ss(){return Pi(os)}var cs=A(`ZodNever`,(e,t)=>{Kn.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function ls(e){return Fi(cs,e)}var us=A(`ZodArray`,(e,t)=>{Oo(),Xn.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Hi(e,t))},nonempty(e){return this.check(Hi(1,e))},max(e,t){return this.check(Vi(e,t))},length(e,t){return this.check(Ui(e,t))},unwrap(){return this.element}});function B(e,t){return na(us,e,t)}var ds=A(`ZodObject`,(e,t)=>{Oo(),nr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),m(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return H(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(we(this._zod.def,{catchall:e}))},passthrough(){return this.clone(we(this._zod.def,{catchall:ss()}))},loose(){return this.clone(we(this._zod.def,{catchall:ss()}))},strict(){return this.clone(we(this._zod.def,{catchall:ls()}))},strip(){return this.clone(we(this._zod.def,{catchall:void 0}))},extend(e){return o(this,e)},safeExtend(e){return t(this,e)},merge(e){return y(this,e)},pick(e){return me(this,e)},omit(e){return l(this,e)},partial(...e){return f(Ts,this,e[0])},exactPartial(...e){return f(Ds,this,e[0],`exactPartial`)},required(...e){return v(Fs,this,e[0])}});function V(e,t){return new ds({type:`object`,shape:e??{},...r(t)})}function fs(e,t){return new ds({type:`object`,shape:e,catchall:ls(),...r(t)})}var ps=A(`ZodUnion`,(e,t)=>{ir.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.options=t.options});function ms(e,t){return new ps({type:`union`,options:e,...r(t)})}var hs=A(`ZodDiscriminatedUnion`,(e,t)=>{ps.init(e,t),or.init(e,t)});function gs(e,t,n){return new hs({type:`union`,options:t,discriminator:e,...r(n)})}var _s=A(`ZodIntersection`,(e,t)=>{sr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function vs(e,t){return new _s({type:`intersection`,left:e,right:t})}var ys=A(`ZodRecord`,(e,t)=>{Oo(),ur.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function bs(e,t,n){return!t||!t._zod?new ys({type:`record`,keyType:I(),valueType:e,...r(t)}):new ys({type:`record`,keyType:e,valueType:t,...r(n)})}var xs=A(`ZodEnum`,(e,t)=>{dr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{let a={};for(let r of e)if(n.has(r))a[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new xs({...t,checks:[],...r(i),entries:a})},e.exclude=(e,i)=>{let a={...t.entries};for(let t of e)if(n.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new xs({...t,checks:[],...r(i),entries:a})}});function H(e,t){return new xs({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...r(t)})}var Ss=A(`ZodLiteral`,(e,t)=>{fr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(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 U(e,t){return new Ss({type:`literal`,values:Array.isArray(e)?e:[e],...r(t)})}var Cs=A(`ZodTransform`,(e,t)=>{Oo(),pr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new E(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(s(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(s(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ws(e){return new Cs({type:`transform`,transform:e})}var Ts=A(`ZodOptional`,(e,t)=>{hr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Es(e){return new Ts({type:`optional`,innerType:e})}var Ds=A(`ZodExactOptional`,(e,t)=>{gr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Os(e){return new Ds({type:`optional`,innerType:e})}var ks=A(`ZodNullable`,(e,t)=>{_r.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function As(e){return new ks({type:`nullable`,innerType:e})}var js=A(`ZodDefault`,(e,t)=>{vr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ms(e,t){return new js({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var Ns=A(`ZodPrefault`,(e,t)=>{br.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ps(e,t){return new Ns({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var Fs=A(`ZodNonOptional`,(e,t)=>{xr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Is(e,t){return new Fs({type:`nonoptional`,innerType:e,...r(t)})}var Ls=A(`ZodCatch`,(e,t)=>{wr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rs(e,t){return new Ls({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:re(t)})}var zs=A(`ZodPipe`,(e,t)=>{Tr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.in=t.in,e.out=t.out});function Bs(e,t){return new zs({type:`pipe`,in:e,out:t})}var Vs=A(`ZodReadonly`,(e,t)=>{Dr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hs(e){return new Vs({type:`readonly`,innerType:e})}var Us=A(`ZodTemplateLiteral`,(e,t)=>{jr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r)});function Ws(e,t){return new Us({type:`template_literal`,parts:e,...r(t)})}var Gs=A(`ZodCustom`,(e,t)=>{Mr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function Ks(e,t={}){return ra(Gs,e,t)}function qs(e,t){return ia(e,t)}function Js(e){return Di(jo,e)}var W=e(he(),1),G=ve(),Ys=W.createContext(void 0),Xs=e=>{let t=W.useContext(Ys);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Zs=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(Ys.Provider,{value:e,children:t})),Qs={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},$s=new class{#e=Qs;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 ec(e){setTimeout(e,0)}var tc=typeof window>`u`||`Deno`in globalThis;function nc(){}function rc(e,t){return typeof e==`function`?e(t):e}function ic(e){return typeof e==`number`&&e>=0&&e!==1/0}function ac(e,t){return Math.max(e+(t||0)-Date.now(),0)}function oc(e,t){return typeof e==`function`?e(t):e}function sc(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==lc(o,t.options))return!1}else if(!dc(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 cc(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(uc(t.options.mutationKey)!==uc(a))return!1}else if(!dc(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function lc(e,t){return(t?.queryKeyHashFn||uc)(e)}function uc(e){return JSON.stringify(e,(e,t)=>gc(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function dc(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(!dc(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!dc(e[r],t[r]))return!1;return!0}return!1}var fc=Object.prototype.hasOwnProperty;function pc(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=hc(e)&&hc(t);if(!r&&!(gc(e)&&gc(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:fc.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=pc(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function mc(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 hc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gc(e){if(!_c(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!(!_c(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function _c(e){return Object.prototype.toString.call(e)===`[object Object]`}function vc(e){return new Promise(t=>{$s.setTimeout(t,e)})}function yc(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:pc(e,t)}function bc(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function xc(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Sc=Symbol();function Cc(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Sc?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wc(e,t){return typeof e==`function`?e(...t):!!e}function Tc(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 Ec=()=>tc,Dc=()=>Ec(),Oc=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(){}},kc=new class extends Oc{#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`}},Ac=ec;function jc(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ac,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 Mc=jc(),Nc=new class extends Oc{#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 Pc(e){return Math.min(1e3*2**e,3e4)}function Fc(e){return(e??`online`)!==`online`||Nc.isOnline()}var Ic=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Lc(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(nc);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ic(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>kc.isFocused()&&(e.networkMode===`always`||Nc.isOnline())&&e.canRun(),p=()=>Fc(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??(Dc()?0:3),a=e.retryDelay??Pc,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),vc(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 Rc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ic(this.gcTime)&&(this.#e=$s.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Dc()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&($s.clearTimeout(this.#e),this.#e=void 0)}};function zc(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=>{Tc(e,()=>t.signal,()=>n=!0)},u=Cc(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?xc:bc;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Vc:Bc,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]===void 0?r.initialPageParam:o[0]:Bc(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 Bc(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 Vc(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Hc=class extends Rc{#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=Gc(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=Gc(this.options);e.data!==void 0&&(this.setState(Wc(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=yc(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(nc).catch(nc):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=>oc(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>oc(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:!ac(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=Cc(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`?zc(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=Lc({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ic&&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 Ic){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,...Uc(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Wc(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),Mc.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Uc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fc(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Wc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Gc(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 Kc=class extends Oc{#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),Jc(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yc(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 oc(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&&!mc(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Xc(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||oc(this.options.enabled,this.#t)!==oc(t.enabled,this.#t)||oc(this.options.staleTime,this.#t)!==oc(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||oc(this.options.enabled,this.#t)!==oc(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 mc(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(t).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(nc)),t}#h(e){return!Dc()&&oc(this.options.enabled,this.#t)!==!1&&ic(e)}#g(){this.#b();let e=oc(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ac(this.#r.dataUpdatedAt,e)+1;this.#u=$s.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return oc(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=$s.setInterval(()=>{(this.options.refetchIntervalInBackground||kc.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&($s.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&($s.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&&Jc(e,t),o=i&&Xc(e,n,t,r);(a||o)&&(l={...l,...Uc(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=yc(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=yc(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:Zc(e,t),refetch:this.refetch,isEnabled:oc(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),mc(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)})})();Mc.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 qc(e,t){return oc(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||oc(t.retryOnMount,e)!==!1)}function Jc(e,t){return qc(e,t)||e.state.data!==void 0&&Yc(e,t,t.refetchOnMount)}function Yc(e,t,n){if(oc(t.enabled,e)!==!1&&oc(t.staleTime,e)!==`static`){let r=oc(n,e);return r===`always`||r!==!1&&Zc(e,t)}return!1}function Xc(e,t,n,r){return(e!==t||oc(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Zc(e,n)}function Zc(e,t){return oc(t.enabled,e)!==!1&&e.isStaleByTime(oc(t.staleTime,e))}var Qc=class extends Rc{#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||$c(),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=Lc({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),Mc.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function $c(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var el=class extends Oc{#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),mc(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&uc(t.mutationKey)!==uc(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??$c();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){Mc.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)})})}},tl=W.createContext(!1),nl=()=>W.useContext(tl);tl.Provider;function rl(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var il=W.createContext(rl()),al=()=>W.useContext(il),ol=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?wc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},sl=e=>{W.useEffect(()=>{e.clearReset()},[e])},cl=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||wc(n,[e.error,r])),ll=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))}},ul=(e,t)=>e?.suspense&&t.isPending,dl=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function fl(e,t,n){let r=nl(),i=al(),a=Xs(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ll(o),ol(o,i,s),sl(i);let[l]=W.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(W.useSyncExternalStore(W.useCallback(e=>{let t=d?l.subscribe(Mc.batchCalls(e)):nc;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),W.useEffect(()=>{l.setOptions(o)},[o,l]),ul(o,u))throw dl(o,l,i);if(cl({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function pl(e,t){return fl(e,Kc,t)}function ml(e,t){let n=Xs(t),[r]=W.useState(()=>new el(n,e));W.useEffect(()=>{r.setOptions(e)},[r,e]);let i=W.useSyncExternalStore(W.useCallback(e=>r.subscribe(Mc.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=W.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(nc)},[r]);if(i.error&&wc(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var hl=W.createContext(null);function gl(e){return W.useContext(hl)}var _l=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function vl(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:_l(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var yl=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},bl=e=>{let t=yl(e);return t.charAt(0).toUpperCase()+t.slice(1)},xl=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Sl={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 Cl(e){return e!=null}function wl(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Sl.width,a=e.size??e.height??Sl.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?xl(...c):xl(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Sl[`stroke-width`])*Number(e.size??e.width??Sl.width)/Number(t.size??t.width??Sl.width):t.strokeWidth??Sl[`stroke-width`];return[`svg`,{...Object.entries(Sl).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Cl(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Cl(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Cl(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 Tl(e,t={}){return wl(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var El=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Dl=(0,W.createContext)({}),Ol=()=>(0,W.useContext)(Dl),kl=(0,W.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=``}=Ol()??{},y=!!c||El(d),[b,x,S=[]]=Tl(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:xl(v,s),hasA11yProp:y,attributes:d});return(0,W.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function K(e,t=[],n=[]){let r=typeof e==`string`?vl(e,t,n):e,i=(0,W.forwardRef)(({className:e,...t},n)=>(0,W.createElement)(kl,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=bl(r.name)),i}var Al={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Al.node;var jl=K(Al),Ml={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Ml.node;var Nl=K(Ml),Pl={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Pl.node;var Fl=K(Pl),Il={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Il.node;var Ll=K(Il),Rl={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Rl.node;var zl=K(Rl),Bl={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Bl.node;var Vl=K(Bl),Hl={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Hl.node;var Ul=K(Hl),Wl={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Wl.node;var Gl=K(Wl),Kl={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Kl.node;var ql=K(Kl),Jl={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};Jl.node;var Yl=K(Jl),Xl={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Xl.node;var Zl=K(Xl),Ql={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Ql.node;var $l=K(Ql),eu={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};eu.node;var tu=K(eu),nu={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};nu.node;var ru=K(nu),iu={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};iu.node;var au=K(iu),ou={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};ou.node;var su=K(ou),cu={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};cu.node;var lu=K(cu),uu={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};uu.node;var du=K(uu),fu={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};fu.node;var pu=K(fu),mu={name:`reply`,size:24,node:[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]};mu.node;var hu=K(mu),gu={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};gu.node;var _u=K(gu),vu={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};vu.node;var yu=K(vu),bu={name:`square-dashed-text`,size:24,node:[[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 14v1`,key:`169vum`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M9 3h1`,key:`1yesri`}]],aliases:[`text-selection`,`text-select`]};bu.node;var xu=K(bu),Su={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Su.node;var Cu=K(Su),wu={name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]};wu.node;var Tu=K(wu),Eu={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};Eu.node;var Du=K(Eu),Ou={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Ou.node;var ku=K(Ou),Au=e(fe(),1);function ju(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=ju(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Mu(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ju(e))&&(r&&(r+=` `),r+=t);return r}var Nu=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Pu=(e,t)=>({classGroupId:e,validator:t}),Fu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Iu=`-`,Lu=[],Ru=`arbitrary..`,zu=e=>{let t=Hu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Vu(e);let n=e.split(Iu);return Bu(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Nu(i,t):t:i||Lu}return n[e]||Lu}}},Bu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Bu(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Iu):e.slice(t).join(Iu),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Vu=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ru+r:void 0})(),Hu=e=>{let{theme:t,classGroups:n}=e;return Uu(n,t)},Uu=(e,t)=>{let n=Fu();for(let r in e){let i=e[r];Wu(i,n,r,t)}return n},Wu=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Gu(i,t,n,r)}},Gu=(e,t,n,r)=>{typeof e==`string`?Ku(e,t,n):typeof e==`function`?qu(e,t,n,r):Ju(e,t,n,r)},Ku=(e,t,n)=>{let r=e===``?t:Yu(t,e);r.classGroupId=n},qu=(e,t,n,r)=>{Xu(e)?Wu(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Pu(n,e)))},Ju=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Wu(o,Yu(t,a),n,r)}},Yu=(e,t)=>{let n=e,r=t.split(Iu),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Fu(),n.nextPart.set(t,i)),n=i}return n},Xu=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Zu=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Qu=`!`,$u=`:`,ed=[],td=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),nd=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===$u){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Qu)?(c=s.slice(0,-1),l=!0):s.startsWith(Qu)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return td(t,l,c,u)};if(t){let e=t+$u,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):td(ed,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},rd=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},id=e=>({cache:Zu(e.cacheSize),parseClassName:nd(e),sortModifiers:rd(e),postfixLookupClassGroupIds:ad(e),...zu(e)}),ad=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},od=/\s+/,sd=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(od),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Qu:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},cd=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ld(n))&&(i&&(i+=` `),i+=r);return i},ld=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ld(e[r]))&&(n&&(n+=` `),n+=t);return n},ud=(e,...t)=>{let n,r,i,a,o=o=>(n=id(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=sd(e,n);return i(e,a),a};return a=o,(...e)=>a(cd(...e))},dd=[],fd=e=>{let t=t=>t[e]||dd;return t.isThemeGetter=!0,t.themeKey=e,t},pd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,md=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hd=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_d=/\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$/,vd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,yd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xd=e=>hd.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),Sd=e=>!!e&&Number.isInteger(Number(e)),Cd=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),wd=e=>gd.test(e),Td=()=>!0,Ed=e=>_d.test(e)&&!vd.test(e),Dd=()=>!1,Od=e=>yd.test(e),kd=e=>bd.test(e),Ad=e=>!J(e)&&!Y(e),jd=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Md=e=>qd(e,Zd,Dd),J=e=>pd.test(e),Nd=e=>qd(e,Qd,Ed),Pd=e=>qd(e,$d,q),Fd=e=>qd(e,tf,Td),Id=e=>qd(e,ef,Dd),Ld=e=>qd(e,Yd,Dd),Rd=e=>qd(e,Xd,kd),zd=e=>qd(e,nf,Od),Y=e=>md.test(e),Bd=e=>Jd(e,Qd),Vd=e=>Jd(e,ef),Hd=e=>Jd(e,Yd),Ud=e=>Jd(e,Zd),Wd=e=>Jd(e,Xd),Gd=e=>Jd(e,nf,!0),Kd=e=>Jd(e,tf,!0),qd=(e,t,n)=>{let r=pd.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Jd=(e,t,n=!1)=>{let r=md.exec(e);return r?r[1]?t(r[1]):n:!1},Yd=e=>e===`position`||e===`percentage`,Xd=e=>e===`image`||e===`url`,Zd=e=>e===`length`||e===`size`||e===`bg-size`,Qd=e=>e===`length`,$d=e=>e===`number`,ef=e=>e===`family-name`,tf=e=>e===`number`||e===`weight`,nf=e=>e===`shadow`,rf=()=>{let e=fd(`color`),t=fd(`font`),n=fd(`text`),r=fd(`font-weight`),i=fd(`tracking`),a=fd(`leading`),o=fd(`breakpoint`),s=fd(`container`),c=fd(`spacing`),l=fd(`radius`),u=fd(`shadow`),d=fd(`inset-shadow`),f=fd(`text-shadow`),p=fd(`drop-shadow`),m=fd(`blur`),h=fd(`perspective`),g=fd(`aspect`),_=fd(`ease`),v=fd(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[xd,`full`,`auto`,...w()],ee=()=>[Sd,`none`,`subgrid`,Y,J],te=()=>[`auto`,{span:[`full`,Sd,Y,J]},Sd,Y,J],ne=()=>[Sd,`auto`,Y,J],E=()=>[`auto`,`min`,`max`,`fr`,Y,J],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...w()],ie=()=>[xd,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[s,xd,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[xd,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,Y,J],se=()=>[...b(),Hd,Ld,{position:[Y,J]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,Ud,Md,{size:[Y,J]}],ue=()=>[Cd,Bd,Nd],de=()=>[``,`none`,`full`,l,Y,J],fe=()=>[``,q,Bd,Nd],pe=()=>[`solid`,`dashed`,`dotted`,`double`],A=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],j=()=>[q,Cd,Hd,Ld],me=()=>[``,`none`,m,Y,J],he=()=>[`none`,q,Y,J],ge=()=>[`none`,q,Y,J],_e=()=>[q,Y,J],ve=()=>[xd,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[wd],breakpoint:[wd],color:[Td],container:[wd],"drop-shadow":[wd],ease:[`in`,`out`,`in-out`],font:[Ad],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[wd],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[wd],shadow:[wd],spacing:[`px`,q],text:[wd],"text-shadow":[wd],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,xd,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[jd],columns:[{columns:[q,`auto`,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Sd,`auto`,Y,J]}],basis:[{basis:[xd,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,xd,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[Sd,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ie()]}],"font-size":[{text:[`base`,n,Bd,Nd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Kd,Fd]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Cd,J]}],"font-family":[{font:[Vd,Id,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,J]}],"line-clamp":[{"line-clamp":[q,`none`,Y,Pd]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...pe(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,Nd]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[q,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Sd,Y,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Sd,Y,J],radial:[``,Y,J],conic:[``,Sd,Y,J]},Wd,Rd]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...pe(),`hidden`,`none`]}],"divide-style":[{divide:[...pe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...pe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,Bd,Nd]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`inner`,`none`,u,Gd,zd]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,Gd,zd]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:fe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[q,Nd]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,Gd,zd]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...A(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":A()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:me()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Gd,zd]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,q,Y,J]}],"hue-rotate":[{"hue-rotate":[q,Y,J]}],invert:[{invert:[``,q,Y,J]}],saturate:[{saturate:[q,Y,J]}],sepia:[{sepia:[``,q,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[q,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[q,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,q,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,q,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[q,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[q,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,q,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[q,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[q,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":[`scale-3d`],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":[`translate-none`],zoom:[{zoom:[Sd,Y,J]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,J]}],fill:[{fill:[`none`,...k()]}],"stroke-w":[{stroke:[q,Bd,Nd,Pd]}],stroke:[{stroke:[`none`,...k()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},af=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(of(e,`cacheSize`,t),of(e,`prefix`,n),of(e,`experimentalParseClassName`,r),sf(e.theme,a.theme),sf(e.classGroups,a.classGroups),sf(e.conflictingClassGroups,a.conflictingClassGroups),sf(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),of(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),of(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),cf(e.theme,i.theme),cf(e.classGroups,i.classGroups),cf(e.conflictingClassGroups,i.conflictingClassGroups),cf(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),lf(e,i,`postfixLookupClassGroups`),lf(e,i,`orderSensitiveModifiers`),e),of=(e,t,n)=>{n!==void 0&&(e[t]=n)},sf=(e,t)=>{if(t)for(let n in t)of(e,n,t[n])},cf=(e,t)=>{if(t)for(let n in t)lf(e,t,n)},lf=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},uf=((e,...t)=>typeof e==`function`?ud(rf,e,...t):ud(()=>af(rf(),e),...t))({extend:{theme:{text:[`11`,`12`,`13`,`14`,`15`,`16`,`18`,`20`,`24`,`30`,`40`],shadow:[`1`,`2`,`3`,`inset`]},classGroups:{"font-stretch":[{"font-stretch":[`mono`]}]}}});function df(...e){return uf(Mu(e))}var ff=`focus-visible:outline-none focus-visible:shadow-(--focus-ring)`;function pf(e,t,n,r=!1){if(n){if(e===`Home`)return 0;if(e===`End`)return n-1;if(e===`ArrowRight`||r&&e===`ArrowDown`)return(t+1)%n;if(e===`ArrowLeft`||r&&e===`ArrowUp`)return(t-1+n)%n}}function mf({icon:e,size:t=16,strokeWidth:n=1.75,label:r,className:i,...a}){return(0,G.jsx)(e,{...a,size:t,strokeWidth:n,className:df(`shrink-0`,i),"aria-hidden":!r||void 0,role:r?`img`:void 0,"aria-label":r})}var hf=Object.defineProperty,gf=(e,t)=>hf(e,`name`,{value:t,configurable:!0});function _f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}gf(_f,`setRef`);function vf(...e){return t=>{let n=!1,r=e.map(e=>{let r=_f(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():_f(e[t],null)}}}}gf(vf,`composeRefs`);function yf(...e){return W.useCallback(vf(...e),e)}gf(yf,`useComposedRefs`);var bf=Object.defineProperty,xf=(e,t)=>bf(e,`name`,{value:t,configurable:!0});function Sf(e){let t=W.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Pf(r),W.Children.forEach(r,e=>{if(Af(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Mf(n)&&typeof Rf==`function`;)n=Rf(n._payload);a=Df(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=W.cloneElement(a,void 0,s):!o&&W.Children.count(r)===1&&W.isValidElement(r)&&(a=r);let c=a?kf(a):void 0,l=yf(n,c);if(!a){if(r||r===0)throw Error(o?Lf(e):If(e));return r}let u=Of(i,a.props??{});return a.type!==W.Fragment&&(u.ref=n?l:c),W.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}xf(Sf,`createSlot`);var Cf=Sf(`Slot`),wf=Symbol.for(`radix.slottable`);function Tf(e){let t=xf(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=wf,t}xf(Tf,`createSlottable`);var Ef=Tf(`Slottable`),Df=xf((e,t)=>`child`in e.props?W.isValidElement(t)?W.cloneElement(t,void 0,e.props.children(t.props.children)):null:W.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Of(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Ff(a,i))}return{...e,...n}}xf(Of,`mergeProps`);function kf(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}xf(kf,`getElementRef`);function Af(e){return W.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===wf}xf(Af,`isSlottable`);var jf=Symbol.for(`react.lazy`);function Mf(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===jf&&`_payload`in e&&Nf(e._payload)}xf(Mf,`isLazyComponent`);function Nf(e){return typeof e==`object`&&!!e&&`then`in e}xf(Nf,`isPromiseLike`);function Pf(e){let t=e;for(;Mf(t)&&typeof Rf==`function`;)t=Rf(t._payload);return t}xf(Pf,`useUnwrappedLazy`);function Ff(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}xf(Ff,`concatAriaDescribedby`);var If=xf(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Lf=xf(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Rf=W.use,zf=Object.defineProperty,Bf=(e,t)=>zf(e,`name`,{value:t,configurable:!0}),Vf=!!(typeof window<`u`&&window.document&&window.document.createElement);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return Bf(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Bf(X,`composeEventHandlers`);function Hf(e){if(!Vf)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Bf(Hf,`getOwnerWindow`);function Uf(e){if(!Vf)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Bf(Uf,`getOwnerDocument`);function Wf(e,t=!1){let{activeElement:n}=Uf(e);if(!n?.nodeName)return null;if(Gf(n)&&n.contentDocument)return Wf(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Uf(n).getElementById(e);if(t)return t}}return n}Bf(Wf,`getActiveElement`);function Gf(e){return e.tagName===`IFRAME`}Bf(Gf,`isFrame`);var Kf=Object.defineProperty,qf=(e,t)=>Kf(e,`name`,{value:t,configurable:!0});function Jf(e,t){let n=W.createContext(t);n.displayName=e+`Context`;let r=qf(e=>{let{children:t,...r}=e,i=W.useMemo(()=>r,Object.values(r));return(0,G.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=W.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return qf(i,`useContext`),[r,i]}qf(Jf,`createContext`);function Yf(e,t=[]){let n=[];function r(t,r){let i=W.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=qf(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=W.useMemo(()=>o,Object.values(o));return(0,G.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=W.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return qf(s,`useContext`),[o,s]}qf(r,`createContext`);let i=qf(()=>{let t=n.map(e=>W.createContext(e));return qf(function(n){let r=n?.[e]||t;return W.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Xf(i,...t)]}qf(Yf,`createContextScope`);function Xf(...e){let t=e[0];if(e.length===1)return t;let n=qf(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return qf(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return W.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}qf(Xf,`composeContextScopes`);var Zf=Object.defineProperty,Qf=(e,t)=>Zf(e,`name`,{value:t,configurable:!0}),$f=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Sf(`Primitive.${t}`),r=W.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,G.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ep(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}Qf(ep,`dispatchDiscreteCustomEvent`);var tp=globalThis?.document?W.useLayoutEffect:()=>{},np=Object.defineProperty,rp=(e,t)=>np(e,`name`,{value:t,configurable:!0}),ip=W.useInsertionEffect;function ap(e){let t=W.useRef(e);return typeof ip==`function`?ip(()=>{t.current=e}):tp(()=>{t.current=e}),W.useMemo(()=>((...e)=>t.current?.(...e)),[])}rp(ap,`useCallbackRef`);var op=Object.defineProperty,sp=(e,t)=>op(e,`name`,{value:t,configurable:!0}),cp=`dismissableLayer.update`,lp=`dismissableLayer.pointerDownOutside`,up=`dismissableLayer.focusOutside`,dp,fp=W.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),pp=W.forwardRef(sp(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=W.useContext(fp),[d,f]=W.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=W.useState({}),h=yf(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=W.useRef(!1),C=gp(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:W.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=_p(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,ee=ap(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return W.useEffect(()=>{if(T)return p.addEventListener(`keydown`,ee,{capture:!0}),()=>p.removeEventListener(`keydown`,ee,{capture:!0})},[p,T,ee]),W.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(dp=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),vp(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=dp))}},[d,p,n,u]),W.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),vp())},[d,u]),W.useEffect(()=>{let e=sp(()=>m({}),`handleUpdate`);return document.addEventListener(cp,e),()=>document.removeEventListener(cp,e)},[]),(0,G.jsx)($f.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:X(e.onFocusCapture,w.onFocusCapture),onBlurCapture:X(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function mp(){let e=W.useContext(fp),[t,n]=W.useState(null);return W.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}sp(mp,`useDismissableLayerSurface`);var hp=sp(()=>!0,`IS_TRUE`);function gp(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=hp}=t,s=ap(e),c=W.useRef(!1),l=W.useRef(!1),u=W.useRef(new Map),d=W.useRef(()=>{});return W.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}sp(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}sp(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}sp(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}sp(p,`handleInteractionBubble`);let m=sp(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||yp(lp,s,p,{discrete:!0})};if(sp(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:sp(()=>c.current=!0,`onPointerDownCapture`)}}sp(gp,`usePointerDownOutside`);function _p(e,t=globalThis?.document){let n=ap(e),r=W.useRef(!1);return W.useEffect(()=>{let e=sp(e=>{e.target&&!r.current&&yp(up,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:sp(()=>r.current=!0,`onFocusCapture`),onBlurCapture:sp(()=>r.current=!1,`onBlurCapture`)}}sp(_p,`useFocusOutside`);function vp(){let e=new CustomEvent(cp);document.dispatchEvent(e)}sp(vp,`dispatchUpdate`);function yp(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ep(i,a):i.dispatchEvent(a)}sp(yp,`handleAndDispatchCustomEvent`);var bp=Object.defineProperty,xp=(e,t)=>bp(e,`name`,{value:t,configurable:!0}),Sp=`focusScope.autoFocusOnMount`,Cp=`focusScope.autoFocusOnUnmount`,wp={bubbles:!1,cancelable:!0},Tp=W.forwardRef(xp(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=W.useState(null),u=ap(a),d=ap(o),f=W.useRef(null),p=yf(t,l),m=W.useRef(i);W.useEffect(()=>{m.current=i});let h=W.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=W.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;W.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:Ip(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||Ip(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ip(c)};xp(e,`handleFocusIn`),xp(t,`handleFocusOut`),xp(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),W.useEffect(()=>{if(c){Lp.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Sp,wp);c.addEventListener(Sp,u),c.dispatchEvent(t),t.defaultPrevented||(Ap(Bp(Mp(c)),{select:!0}),document.activeElement===e&&Ip(c))}return()=>{c.removeEventListener(Sp,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Cp,wp);c.addEventListener(Cp,d),c.dispatchEvent(r),r.defaultPrevented||Ip(e??t.body,{select:!0}),c.removeEventListener(Cp,d),Lp.remove(g)},0)}}},[c,u,d,g]);let _=W.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=jp(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ip(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ip(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,G.jsx)($f.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),Ep=W.createContext(null);function Dp({registry:e,children:t}){return e?(0,G.jsx)(Ep.Provider,{value:e,children:t}):t}xp(Dp,`FocusScopeBranchProvider`);function Op(){let[e,t]=W.useState([]);return{nodes:e,registry:W.useMemo(()=>({add:xp(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:xp(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}xp(Op,`useFocusScopeBranchRegistry`);function kp(e){let t=W.useContext(Ep);W.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}xp(kp,`useFocusScopeBranch`);function Ap(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ip(r,{select:t}),document.activeElement!==n)return}xp(Ap,`focusFirst`);function jp(e){let t=Mp(e);return[Np(t,e),Np(t.reverse(),e)]}xp(jp,`getTabbableEdges`);function Mp(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:xp(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}xp(Mp,`getTabbableCandidates`);function Np(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Pp(r,{upTo:t})))return r}xp(Np,`findVisible`);function Pp(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}xp(Pp,`isHidden`);function Fp(e){return e.tagName===`INPUT`&&typeof e.select==`function`}xp(Fp,`isSelectableInput`);function Ip(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Fp(e)&&t&&e.select()}}xp(Ip,`focus`);var Lp=Rp();function Rp(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=zp(e,t),e.unshift(t)},remove(t){e=zp(e,t),e[0]?.resume()}}}xp(Rp,`createFocusScopesStack`);function zp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}xp(zp,`arrayRemove`);function Bp(e){return e.filter(e=>e.tagName!==`A`)}xp(Bp,`removeLinks`);var Vp=Object.defineProperty,Hp=(e,t)=>Vp(e,`name`,{value:t,configurable:!0}),Up=W.useId||(()=>void 0),Wp=0;function Gp(e){let[t,n]=W.useState(Up());return tp(()=>{e||n(e=>e??String(Wp++))},[e]),e||(t?`radix-${t}`:``)}Hp(Gp,`useId`);var Kp=[`top`,`right`,`bottom`,`left`],qp=Math.min,Jp=Math.max,Yp=Math.round,Xp=Math.floor,Zp=e=>({x:e,y:e}),Qp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function $p(e,t,n){return Jp(e,qp(t,n))}function em(e,t){return typeof e==`function`?e(t):e}function tm(e){return e.split(`-`)[0]}function nm(e){return e.split(`-`)[1]}function rm(e){return e===`x`?`y`:`x`}function im(e){return e===`y`?`height`:`width`}function am(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function om(e){return rm(am(e))}function sm(e,t,n){n===void 0&&(n=!1);let r=nm(e),i=om(e),a=im(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=gm(o)),[o,gm(o)]}function cm(e){let t=gm(e);return[lm(e),t,lm(t)]}function lm(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var um=[`left`,`right`],dm=[`right`,`left`],fm=[`top`,`bottom`],pm=[`bottom`,`top`];function mm(e,t,n){switch(e){case`top`:case`bottom`:return n?t?dm:um:t?um:dm;case`left`:case`right`:return t?fm:pm;default:return[]}}function hm(e,t,n,r){let i=nm(e),a=mm(tm(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(lm)))),a}function gm(e){let t=tm(e);return Qp[t]+e.slice(t.length)}function _m(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vm(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_m(e)}function ym(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 bm(e,t,n){let{reference:r,floating:i}=e,a=am(t),o=om(t),s=im(o),c=tm(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=nm(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function xm(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}=em(t,e),p=vm(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ym(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=ym(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 Sm=50,Cm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xm},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bm(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<Sm&&(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}=bm(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},wm=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}=em(e,t)||{};if(l==null)return{};let d=vm(u),f={x:n,y:r},p=om(i),m=im(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=qp(d[_],T),te=qp(d[v],T),ne=C-h[m]-te,E=C/2-h[m]/2+w,re=$p(ee,E,ne),D=!c.arrow&&nm(i)!=null&&E!==re&&a.reference[m]/2-(E<ee?ee:te)-h[m]/2<0,O=D?E<ee?E-ee:E-ne:0;return{[p]:f[p]+O,data:{[p]:re,centerOffset:E-re-O,...D&&{alignmentOffset:O}},reset:D}}}),Tm=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}=em(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=tm(r),_=am(o),v=tm(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[gm(o)]:cm(o)),x=p!==`none`;!d&&x&&b.push(...hm(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=sm(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`||_===am(t)||T.every(e=>am(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=am(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Em(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Dm(e){return Kp.some(t=>e[t]>=0)}var Om=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=em(e,t);switch(i){case`referenceHidden`:{let e=Em(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Dm(e)}}}case`escaped`:{let e=Em(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Dm(e)}}}default:return{}}}}},km=new Set([`left`,`top`]);async function Am(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=tm(n),s=nm(n),c=am(n)===`y`,l=km.has(o)?-1:1,u=a&&c?-1:1,d=em(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 jm=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 Am(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}}}}},Mm=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}=em(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=am(i),p=rm(f),m=u[p],h=u[f],g=(e,t)=>$p(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}}}}}},Nm=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}=em(e,t),u={x:n,y:r},d=am(i),f=rm(d),p=u[f],m=u[d],h=em(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=km.has(tm(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}}}},Pm=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}=em(e,t),c=await i.detectOverflow(t,s),l=tm(n),u=nm(n),d=am(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=qp(p-c[m],g),y=qp(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*Jp(c.left,c.right):S=p-2*Jp(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 Fm(){return typeof window<`u`}function Im(e){return zm(e)?(e.nodeName||``).toLowerCase():`#document`}function Lm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rm(e){return((zm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function zm(e){return Fm()?e instanceof Node||e instanceof Lm(e).Node:!1}function Bm(e){return Fm()?e instanceof Element||e instanceof Lm(e).Element:!1}function Vm(e){return Fm()?e instanceof HTMLElement||e instanceof Lm(e).HTMLElement:!1}function Hm(e){return!Fm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Lm(e).ShadowRoot}function Um(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=eh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Wm(e){return/^(table|td|th)$/.test(Im(e))}function Gm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Km=/transform|translate|scale|rotate|perspective|filter/,qm=/paint|layout|strict|content/,Jm=e=>!!e&&e!==`none`,Ym;function Xm(e){let t=Bm(e)?eh(e):e;return Jm(t.transform)||Jm(t.translate)||Jm(t.scale)||Jm(t.rotate)||Jm(t.perspective)||!Qm()&&(Jm(t.backdropFilter)||Jm(t.filter))||Km.test(t.willChange||``)||qm.test(t.contain||``)}function Zm(e){let t=nh(e);for(;Vm(t)&&!$m(t);){if(Xm(t))return t;if(Gm(t))return null;t=nh(t)}return null}function Qm(){return Ym??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ym}function $m(e){return/^(html|body|#document)$/.test(Im(e))}function eh(e){return Lm(e).getComputedStyle(e)}function th(e){return Bm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nh(e){if(Im(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Hm(e)&&e.host||Rm(e);return Hm(t)?t.host:t}function rh(e){let t=nh(e);return $m(t)?(e.ownerDocument||e).body:Vm(t)&&Um(t)?t:rh(t)}function ih(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rh(e),i=r===e.ownerDocument?.body,a=Lm(r);if(i){let e=ah(a);return t.concat(a,a.visualViewport||[],Um(r)?r:[],e&&n?ih(e):[])}return t.concat(r,ih(r,[],n))}function ah(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oh(e){let t=eh(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Vm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Yp(n)!==a||Yp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sh(e){return Bm(e)?e:e.contextElement}function ch(e){let t=sh(e);if(!Vm(t))return Zp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=oh(t),o=(a?Yp(n.width):n.width)/r,s=(a?Yp(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var lh=Zp(0);function uh(e){let t=Lm(e);return!Qm()||!t.visualViewport?lh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dh(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Lm(e)}function fh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sh(e),o=Zp(1);t&&(r?Bm(r)&&(o=ch(r)):o=ch(e));let s=dh(a,n,r)?uh(a):Zp(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=Lm(a),t=Bm(r)?Lm(r):r,n=e,i=ah(n);for(;i&&t!==n;){let e=ch(i),t=i.getBoundingClientRect(),r=eh(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=Lm(i),i=ah(n)}}return ym({width:u,height:d,x:c,y:l})}function ph(e,t){let n=th(e).scrollLeft;return t?t.left+n:fh(Rm(e)).left+n}function mh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ph(e,n),y:n.top+t.scrollTop}}function hh(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Rm(r),s=t?Gm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Zp(1),u=Zp(0),d=Vm(r);if((d||!a)&&((Im(r)!==`body`||Um(o))&&(c=th(r)),d)){let e=fh(r);l=ch(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?mh(o,c):Zp(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 gh(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _h(e){let t=th(e),n=e.ownerDocument.body,r=Jp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Jp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ph(e),o=-t.scrollTop;return eh(n).direction===`rtl`&&(a+=Jp(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var vh=25;function yh(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Lm(e),a=Rm(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Qm()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ph(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<=vh&&(s-=o)}return{width:s,height:c,x:l,y:u}}function bh(e,t){let n=fh(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ch(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xh(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=yh(e,n,t);else if(t===`document`)r=_h(Rm(e));else if(Bm(t))r=bh(t,n);else{let n=uh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ym(r)}function Sh(e,t){let n=t.get(e);if(n)return n;let r=ih(e,[],!1).filter(e=>Bm(e)&&Im(e)!==`body`),i=null,a=eh(e).position===`fixed`,o=a?nh(e):e;for(;Bm(o)&&!$m(o);){let e=eh(o),t=Xm(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=nh(o)}return t.set(e,r),r}function Ch(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Gm(t)?[]:Sh(t,this._c):[].concat(n),r],o=xh(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=xh(t,a[e],i);s=Jp(n.top,s),c=qp(n.right,c),l=qp(n.bottom,l),u=Jp(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function wh(e){let{width:t,height:n}=oh(e);return{width:t,height:n}}function Th(e,t,n){let r=Vm(t),i=Rm(t),a=n===`fixed`,o=fh(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Zp(0);if((r||!a)&&((Im(t)!==`body`||Um(i))&&(s=th(t)),r)){let e=fh(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ph(i));let l=i&&!r&&!a?mh(i,s):Zp(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 Eh(e){return eh(e).position===`static`}function Dh(e,t){if(!Vm(e)||eh(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Rm(e)===n&&(n=n.ownerDocument.body),n}function Oh(e,t){let n=Lm(e);if(Gm(e))return n;if(!Vm(e)){let t=nh(e);for(;t&&!$m(t);){if(Bm(t)&&!Eh(t))return t;t=nh(t)}return n}let r=Dh(e,t);for(;r&&Wm(r)&&Eh(r);)r=Dh(r,t);return r&&$m(r)&&Eh(r)&&!Xm(r)?n:r||Zm(e)||n}var kh=async function(e){let t=this.getOffsetParent||Oh,n=this.getDimensions,r=await n(e.floating);return{reference:Th(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ah(e){return eh(e).direction===`rtl`}var jh={convertOffsetParentRelativeRectToViewportRelativeRect:hh,getDocumentElement:Rm,getClippingRect:Ch,getOffsetParent:Oh,getElementRects:kh,getClientRects:gh,getDimensions:wh,getScale:ch,isElement:Bm,isRTL:Ah};function Mh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nh(e,t,n){let r=null,i,a=Rm(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=Xp(d),h=Xp(a.clientWidth-(u+f)),g=Xp(a.clientHeight-(d+p)),_=Xp(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Jp(0,qp(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Mh(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=Lm(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ph(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=sh(e),u=i||a?[...l?ih(l):[],...t?ih(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nh(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?fh(e):null;c&&g();function g(){let t=fh(e);h&&!Mh(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 Fh=jm,Ih=Mm,Lh=Tm,Rh=Pm,zh=Om,Bh=wm,Vh=Nm,Hh=(e,t,n)=>{let r=new Map,i=n??{},a={...jh,...i.platform,_c:r};return Cm(e,t,{...i,platform:a})},Uh=typeof document<`u`?W.useLayoutEffect:function(){};function Wh(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(!Wh(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)&&!Wh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Gh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kh(e,t){let n=Gh(e);return Math.round(t*n)/n}function qh(e){let t=W.useRef(e);return Uh(()=>{t.current=e}),t}function Jh(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]=W.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=W.useState(r);Wh(f,r)||p(r);let[m,h]=W.useState(null),[g,_]=W.useState(null),v=W.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=W.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=W.useRef(null),C=W.useRef(null),w=W.useRef(u),T=c!=null,ee=qh(c),te=qh(i),ne=qh(l),E=W.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),Hh(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};re.current&&!Wh(w.current,t)&&(w.current=t,Au.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);Uh(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=W.useRef(!1);Uh(()=>(re.current=!0,()=>{re.current=!1}),[]),Uh(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,E);E()}},[b,x,E,ee,T]);let D=W.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),O=W.useMemo(()=>({reference:b,floating:x}),[b,x]),ie=W.useMemo(()=>{let e={position:n,left:0,top:0};if(!O.floating)return e;let t=Kh(O.floating,u.x),r=Kh(O.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Gh(O.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,O.floating,u.x,u.y]);return W.useMemo(()=>({...u,update:E,refs:D,elements:O,floatingStyles:ie}),[u,E,D,O,ie])}var Yh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Bh({element:r.current,padding:i}).fn(n):r?Bh({element:r,padding:i}).fn(n):{}}}},Xh=(e,t)=>{let n=Fh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zh=(e,t)=>{let n=Ih(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qh=(e,t)=>({fn:Vh(e).fn,options:[e,t]}),$h=(e,t)=>{let n=Lh(e);return{name:n.name,fn:n.fn,options:[e,t]}},eg=(e,t)=>{let n=Rh(e);return{name:n.name,fn:n.fn,options:[e,t]}},tg=(e,t)=>{let n=zh(e);return{name:n.name,fn:n.fn,options:[e,t]}},ng=(e,t)=>{let n=Yh(e);return{name:n.name,fn:n.fn,options:[e,t]}},rg=Object.defineProperty,ig=(e,t)=>rg(e,`name`,{value:t,configurable:!0});function ag(e){let[t,n]=W.useState(void 0);return tp(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}ig(ag,`useSize`);var og=Object.defineProperty,sg=(e,t)=>og(e,`name`,{value:t,configurable:!0}),cg={Partial:`partial`,Always:`always`},lg={Optimized:`optimized`,Always:`always`},ug=`Popper`,[dg,fg]=Yf(ug),[pg,mg]=dg(ug),hg=sg(e=>{let{__scopePopper:t,children:n}=e,[r,i]=W.useState(null),[a,o]=W.useState(void 0);return(0,G.jsx)(pg,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),gg=`PopperAnchor`,_g=W.forwardRef(sg(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=mg(gg,n),o=W.useRef(null),s=a.onAnchorChange,c=yf(t,W.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=W.useRef(null);W.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&wg(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,G.jsx)($f.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),vg=`PopperContent`,[yg,bg]=dg(vg),xg=W.forwardRef(sg(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=cg.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=lg.Optimized,onPlaced:m,...h}=e,g=mg(vg,n),[_,v]=W.useState(null),y=yf(t,v),[b,x]=W.useState(null),S=ag(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},te=Array.isArray(l)?l:[l],ne=te.length>0,E={padding:ee,boundary:te.filter(Sg),altBoundary:ne},{refs:re,floatingStyles:D,placement:O,isPositioned:ie,middlewareData:ae}=Jh({strategy:`fixed`,placement:T,whileElementsMounted:sg((...e)=>Ph(...e,{animationFrame:p===lg.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Xh({mainAxis:i+w,alignmentAxis:o}),c&&Zh({mainAxis:!0,crossAxis:!1,...d===cg.Partial?{limiter:Qh()}:{},...E}),c&&$h({...E}),eg({...E,apply:sg(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&ng({element:b,padding:s}),Cg({arrowWidth:C,arrowHeight:w}),f&&tg(ne?{strategy:`referenceHidden`,...E}:{strategy:`referenceHidden`,padding:E.padding,altBoundary:E.altBoundary})]}),oe=g.setPlacementState;tp(()=>(oe(O),()=>{oe(void 0)}),[O,oe]);let[k,se]=wg(O),ce=ap(m);tp(()=>{ie&&ce?.()},[ie,ce]);let le=ae.arrow?.x,ue=ae.arrow?.y,de=ae.arrow?.centerOffset!==0,[fe,pe]=W.useState();return tp(()=>{_&&pe(window.getComputedStyle(_).zIndex)},[_]),(0,G.jsx)(`div`,{ref:re.setFloating,"data-radix-popper-content-wrapper":``,style:{...D,transform:ie?D.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:fe,"--radix-popper-transform-origin":[ae.transformOrigin?.x,ae.transformOrigin?.y].join(` `),...ae.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,G.jsx)(yg,{scope:n,placedSide:k,placedAlign:se,onArrowChange:x,arrowX:le,arrowY:ue,shouldHideArrow:de,children:(0,G.jsx)($f.div,{"data-side":k,"data-align":se,...h,ref:y,style:{...h.style,animation:ie?h.style?.animation:`none`}})})})},`PopperContent`));function Sg(e){return e!==null}sg(Sg,`isNotNull`);var Cg=sg(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=wg(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function wg(e){let[t,n=`center`]=e.split(`-`);return[t,n]}sg(wg,`getSideAndAlignFromPlacement`);var Tg=Object.defineProperty,Eg=W.forwardRef(((e,t)=>Tg(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=W.useState(!1);tp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Au.createPortal((0,G.jsx)($f.div,{...r,ref:t}),o):null},`Portal`)),Dg=Object.defineProperty,Og=(e,t)=>Dg(e,`name`,{value:t,configurable:!0});function kg(e,t){return W.useReducer((e,n)=>t[e][n]??e,e)}Og(kg,`useStateMachine`);var Ag=Og(e=>{let{present:t,children:n}=e,r=jg(t),i=typeof n==`function`?n({present:r.isPresent}):W.Children.only(n),a=Ng(r.ref,Fg(i));return typeof n==`function`||r.isPresent?W.cloneElement(i,{ref:a}):null},`Presence`);function jg(e){let[t,n]=W.useState(),r=W.useRef(null),i=W.useRef(e),a=W.useRef(`none`),o=W.useRef(void 0),[s,c]=kg(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return W.useEffect(()=>{s===`mounted`?(a.current=o.current??Pg(r.current),o.current=void 0):a.current=`none`},[s]),tp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Pg(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),tp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Og(a=>{let o=Pg(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Og(e=>{e.target===t&&(a.current=Pg(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:W.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Pg(t)}else r.current=null;n(e)},[])}}Og(jg,`usePresence`);function Mg(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Og(Mg,`setRef`);function Ng(...e){let t=W.useRef(e);return t.current=e,W.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Mg(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Mg(n[e],null)}}},[])}Og(Ng,`useStableComposedRefs`);function Pg(e){return e?.animationName||`none`}Og(Pg,`getAnimationName`);function Fg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Og(Fg,`getElementRef`);var Ig=Object.defineProperty,Lg=(e,t)=>Ig(e,`name`,{value:t,configurable:!0}),Rg=W.useEffectEvent,zg=W.useInsertionEffect;function Bg(e){if(typeof Rg==`function`)return Rg(e);let t=W.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof zg==`function`?zg(()=>{t.current=e}):tp(()=>{t.current=e}),W.useMemo(()=>((...e)=>t.current?.(...e)),[])}Lg(Bg,`useEffectEvent`);var Vg=Object.defineProperty,Hg=(e,t)=>Vg(e,`name`,{value:t,configurable:!0}),Ug=W.useInsertionEffect||tp;function Wg({prop:e,defaultProp:t,onChange:n=Hg(()=>{},`onChange`),caller:r}){let[i,a,o]=Gg({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,W.useCallback(t=>{if(s){let n=Kg(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Hg(Wg,`useControllableState`);function Gg({defaultProp:e,onChange:t}){let[n,r]=W.useState(e),i=W.useRef(n),a=W.useRef(t);return Ug(()=>{a.current=t},[t]),W.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Hg(Gg,`useUncontrolledState`);function Kg(e){return typeof e==`function`}Hg(Kg,`isFunction`);var qg=Symbol(`RADIX:SYNC_STATE`);function Jg(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Bg(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=W.useReducer((t,n)=>{if(n.type===qg)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=W.useRef(p);W.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=W.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return W.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:qg,state:i})},[i,d.state,c]),[h,f]}Hg(Jg,`useControllableStateReducer`);var Yg=Object.defineProperty,Xg=(e,t)=>Yg(e,`name`,{value:t,configurable:!0}),Zg=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Qg=W.forwardRef(Xg(function(e,t){return(0,G.jsx)($f.span,{...e,ref:t,style:{...Zg,...e.style}})},`VisuallyHidden`)),$g=Object.defineProperty,e_=(e,t)=>$g(e,`name`,{value:t,configurable:!0}),[t_,n_]=Yf(`Tooltip`,[fg]),r_=fg(),i_=`TooltipProvider`,a_=700,o_=`tooltip.open`,[s_,c_]=t_(i_),l_=e_(e=>{let{__scopeTooltip:t,delayDuration:n=a_,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=W.useRef(!0),s=W.useRef(!1),c=W.useRef(0);return W.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,G.jsx)(s_,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:W.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:W.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:W.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),u_=`Tooltip`,[d_,f_]=t_(u_),p_=e_(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=c_(u_,e.__scopeTooltip),l=r_(t),[u,d]=W.useState(null),[f,p]=W.useState(void 0),m=Gp(),h=W.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=W.useRef(!1),[y,b]=Wg({prop:r,defaultProp:i??!1,onChange:e_(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(o_))):c.onClose(),a?.(e)},`onChange`),caller:u_}),x=W.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=W.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=W.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=W.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);W.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,G.jsx)(hg,{...l,children:(0,G.jsx)(d_,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:W.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:W.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),m_=`TooltipTrigger`,h_=W.forwardRef(e_(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=f_(m_,n),o=c_(m_,n),s=r_(n),c=yf(t,W.useRef(null),a.onTriggerChange),l=W.useRef(!1),u=W.useRef(!1),d=W.useCallback(()=>l.current=!1,[]);return W.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,G.jsx)(_g,{asChild:!0,...s,children:(0,G.jsx)($f.button,{"aria-describedby":a.open?j_(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:X(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:X(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:X(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:X(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:X(e.onBlur,a.onClose),onClick:X(e.onClick,a.onClose)})})},`TooltipTrigger`)),g_=`TooltipPortal`,[__,v_]=t_(g_,{forceMount:void 0}),y_=e_(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=f_(g_,t);return(0,G.jsx)(__,{scope:t,forceMount:n,children:(0,G.jsx)(Ag,{present:n||a.open,children:(0,G.jsx)(Eg,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),b_=`TooltipContent`,x_=W.forwardRef(e_(function(e,t){let n=v_(b_,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=f_(b_,e.__scopeTooltip);return(0,G.jsx)(Ag,{present:r||o.open,children:o.disableHoverableContent?(0,G.jsx)(w_,{side:i,...a,ref:t}):(0,G.jsx)(S_,{side:i,...a,ref:t})})},`TooltipContent`)),S_=W.forwardRef(e_(function(e,t){let n=f_(b_,e.__scopeTooltip),r=c_(b_,e.__scopeTooltip),i=W.useRef(null),a=yf(t,i),[o,s]=W.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=W.useCallback(()=>{s(null),d(!1)},[d]),p=W.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=E_(r,T_(r,n.getBoundingClientRect())),a=D_(t.getBoundingClientRect()),o=k_([...i,...a]);s(o),d(!0)},[d]);return W.useEffect(()=>()=>f(),[f]),W.useEffect(()=>{if(c&&u){let e=e_(e=>p(e,u),`handleTriggerLeave`),t=e_(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),W.useEffect(()=>{if(o){let e=e_(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!O_(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,G.jsx)(w_,{...e,ref:a})},`TooltipContentHoverable`)),C_=Tf(`TooltipContent`),w_=W.forwardRef(e_(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=f_(b_,n),u=r_(n),{onClose:d}=l,[f,p]=W.useState(null),m=yf(t,p);kp(f),W.useEffect(()=>(document.addEventListener(o_,d),()=>document.removeEventListener(o_,d)),[d]),W.useEffect(()=>{if(l.trigger){let e=e_(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return tp(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,G.jsx)(pp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,G.jsxs)(xg,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,G.jsx)(C_,{children:r}),i?(0,G.jsx)(Qg,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function T_(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}e_(T_,`getExitSideFromRect`);function E_(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}e_(E_,`getPaddedExitPoints`);function D_(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}e_(D_,`getPointsFromRect`);function O_(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}e_(O_,`isPointInPolygon`);function k_(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),A_(t)}e_(k_,`getHull`);function A_(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}e_(A_,`getHullPresorted`);function j_(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}e_(j_,`concatAriaDescribedby`);function M_({className:e,...t}){return(0,G.jsx)(`kbd`,{...t,className:df(`inline-grid h-[18px] min-w-[18px] place-items-center rounded-[4px] border border-b-2 border-line-2 bg-surface px-1 font-mono text-[10px] font-medium leading-none font-stretch-mono text-fg-2`,e)})}var N_=(0,W.createContext)(!1);function P_(e){return(0,G.jsx)(N_.Provider,{value:!0,children:(0,G.jsx)(l_,{delayDuration:350,...e})})}function F_({content:e,kbd:t,side:n=`top`,open:r,children:i}){let a=(0,W.useContext)(N_),o=(0,G.jsxs)(p_,{open:r,delayDuration:350,children:[(0,G.jsx)(h_,{asChild:!0,children:i}),(0,G.jsx)(y_,{children:(0,G.jsxs)(x_,{side:n,sideOffset:6,className:`z-(--z-tooltip) flex animate-[em-tooltip_var(--dur-1)_var(--ease-out)] items-center gap-1.5 whitespace-nowrap rounded-sm bg-inverse px-2 py-1 font-sans text-12 font-normal leading-(--lh-snug) text-fg-inverse data-[side=bottom]:[--tooltip-offset:-2px]`,children:[e,t&&(0,G.jsx)(M_,{className:`border-[oklch(from_var(--n-500)_0.6_c_h_/_0.5)] bg-transparent text-inherit`,children:t})]})})]});return a?o:(0,G.jsx)(P_,{children:o})}function I_({label:e,icon:t,size:n=`md`,variant:r=`ghost`,pressed:i,badge:a,asChild:o=!1,tooltip:s=!0,children:c,className:l,type:u,disabled:d,onClickCapture:f,...p}){let m=o?Cf:`button`,h=(0,W.useId)(),g=a!=null&&a!==0,_=(0,G.jsxs)(m,{...p,type:u??(o?void 0:`button`),disabled:o?void 0:d,"aria-disabled":d||p[`aria-disabled`],"aria-label":e,"aria-labelledby":[p[`aria-labelledby`],g&&h].filter(Boolean).join(` `)||void 0,"aria-pressed":i,tabIndex:o&&d?-1:p.tabIndex,onClickCapture:e=>{d?(e.preventDefault(),e.stopPropagation()):f?.(e)},className:df(`relative inline-grid shrink-0 place-items-center rounded-md border border-transparent bg-transparent text-fg-2 no-underline transition-[background,color] duration-(--dur-1) ease-(--ease-out) [-webkit-tap-highlight-color:transparent] [&:not(:disabled):not([aria-disabled=true])]:hover:bg-hover [&:not(:disabled):not([aria-disabled=true])]:hover:text-fg-1 [&:not(:disabled):not([aria-disabled=true])]:active:bg-active [&:not(:disabled):not([aria-disabled=true])]:active:text-fg-1 aria-pressed:bg-active aria-pressed:text-fg-1 aria-expanded:bg-active aria-expanded:text-fg-1 disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45`,ff,n===`sm`?`size-7 rounded-sm`:n===`lg`?`size-10`:`size-8`,r===`secondary`&&`border-line-2 bg-surface shadow-1`,l),children:[(0,G.jsx)(mf,{icon:t,size:n===`sm`?14:n===`lg`?18:16}),o&&(0,G.jsx)(Ef,{children:c}),g&&(0,G.jsxs)(`span`,{id:h,className:`sr-only`,children:[e,`, `,a]}),g&&(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-0.5 right-0.5 h-3.5 min-w-3.5 rounded-md bg-accent px-[3px] text-center font-sans text-[9px] leading-[14px] font-semibold text-accent-fg`,children:a})]});return s?(0,G.jsx)(F_,{content:e,children:_}):_}var Z={inboxItems:200,agentReviews:100,importRevisions:1e3,importThreads:1e3,importComments:1e4,importSends:1e3,importDeliveries:1e3,importRows:5e4,importRenderedBytes:1073741824,importDerivedBytes:67108864,importPlacementBytes:1073741824,publicJsonBytes:4096,commentBodyChars:2e4,instructionChars:4e3,quoteChars:2e3,prefixSuffixChars:32,diffContextLines:3,titleChars:200,headingsPerDoc:1024,headingTextChars:200,headingIdChars:256,diffSideBytes:1048576,markdownDocBytes:1048576,htmlDocBytes:8388608,assetBytes:8388608,htmlDocWithAssetsBytes:20971520,revisionBytes:268435456,blocksPerRevision:1e5,renderedBytesPerRevision:268435456,filesPerRevision:1e4,mediaPerRevision:50,agentNotesPerFile:8,agentNotesPerRevision:64,pathChars:4096,pathSegmentChars:255,topicsPerReview:200,summaryChars:2e3,blastScopeChars:32,blastNoteChars:2e3,writeupSectionBytes:1048576,writeupBytes:2097152,targetLines:1e3,targetTextChars:65536,contextLineChars:2e3,commentsPerHandoff:5e3,handoffBytes:16777216,waitingTakesPerOwner:32,historyPerComment:500,instructionsPerHandoff:100,versionChars:64,featuresCount:64,featureChars:64,errorMessageChars:1e3,publishJsonBytes:8388608,requestJsonBytes:1048576},L_=H([`diff`,`doc`,`asset`]),R_=H([`added`,`modified`,`deleted`,`renamed`,`mode-changed`]),z_=H([`binary`,`oversized`]),Q=I().min(1).max(Z.pathChars).refine(e=>e.isWellFormed(),`path must be well-formed UTF-16`).refine(e=>e.split(`/`).every(e=>e.length<=Z.pathSegmentChars),`path segment exceeds the character limit`).refine(e=>!e.startsWith(`/`)&&!/^[a-z]:/i.test(e)&&!e.includes(`\\`)&&!Array.from(e).some(e=>e.charCodeAt(0)<32||e.charCodeAt(0)===127)&&!/[\u0080-\u009f\u061c\u200b-\u200f\u202a-\u202e\u2060\u2066-\u206f\ufeff]/u.test(e)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&![`.git`,`git~1`].includes(e.toLowerCase().replace(/[. ]+$/,``))),`expected a relative path without traversal or control characters`),B_=I().regex(/^[a-z0-9][a-z0-9-]{0,63}$/),V_={slug:`other`,title:`Other changes`},H_=V({slug:B_,title:I().min(1).max(Z.titleChars).refine(e=>/\S/.test(e),`title must not be blank`),importance:ns().min(0).max(100),summary:I().max(Z.summaryChars),attention:H([`critical`,`review`,`skim`]).optional(),door:H([`one-way`,`two-way`]).optional(),blastRadius:V({scope:I().max(Z.blastScopeChars).regex(/^\S+$/,`scope must be one word`),note:I().max(Z.blastNoteChars).refine(e=>/\S/.test(e),`note must not be empty`)}).optional()}),U_=V({side:H([`old`,`new`]),start:z().positive(),end:z().positive(),summary:I().min(1).max(160).refine(e=>e.trim().length>0,`summary must not be blank`).refine(e=>!/[\r\n\u0085\u2028\u2029]/.test(e),`summary must be one line`),rationale:I().max(1200).refine(e=>e.trim().length>0,`rationale must not be blank`).optional(),ref:I().length(1).regex(/^[A-Z]$/).optional()}).refine(e=>e.end>=e.start,{path:[`end`],message:`end must not precede start`}),W_=U_.safeExtend({id:R()}),G_=B(U_).max(Z.agentNotesPerFile);function K_(e,t){let n=0,r=new Set;for(let[i,a]of e.entries()){n+=a.notes?.length??0;for(let[e,n]of(a.notes??[]).entries()){if(!n.ref)continue;let o=`${a.topic??V_.slug}:${n.ref}`;r.has(o)&&t.addIssue({code:`custom`,path:[`files`,i,`notes`,e,`ref`],message:`${a.path}: note ${e}: duplicate ref ${n.ref} in topic`}),r.add(o)}}n>Z.agentNotesPerRevision&&t.addIssue({code:`custom`,path:[`files`],message:`too many agent notes in revision`})}I().length(43).regex(/^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/),V({api:U(1),version:I().min(1).max(Z.versionChars),features:B(I().max(Z.featureChars)).max(Z.featuresCount)}),V({revision:z().positive(),paths:B(Q).min(1).max(Z.filesPerRevision),viewed:as()}),fs({}),V({stopping:U(!0)}),V({purpose:H([`device`,`machine`]).default(`device`)});var q_=I().length(47).regex(/^emp_[A-Za-z0-9_-]{43}$/),J_=I().min(8).max(9).regex(/^[0-9A-HJKMNP-TV-ZILO]{4}-?[0-9A-HJKMNP-TV-ZILO]{4}$/i).transform(e=>e.toUpperCase().replaceAll(`-`,``).replaceAll(/[IL]/g,`1`).replaceAll(`O`,`0`)),Y_=ms([V({secret:q_,code:ls().optional()}),V({code:J_,secret:ls().optional()})]),X_=V({url:zo({protocol:/^https?$/}).max(Z.pathChars).refine(e=>{let t=new URL(e);return t.pathname===`/pair`&&e.endsWith(`/pair${t.hash}`)&&!t.search&&!t.username&&!t.password&&q_.safeParse(t.hash.slice(1)).success}),code:I().regex(/^[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}$/),expiresAt:Js()});ms(Y_.options.map(e=>e.extend({instance:V({id:R(),name:I().regex(/^[a-zA-Z0-9 ._()/;-]*$/).trim().min(1).max(200)})}))),V({token:I().regex(/^em_[A-Za-z0-9_-]{43}$/),hub:V({id:R(),name:I(),url:zo({protocol:/^https?$/})})}),H([`admin`,`agent`,`reviewer`]),H([`pairings:create`,`devices:manage`,`server:stop`,`publish`,`take`,`reply`,`read`,`comment`,`send`]);var Z_=V({items:B(V({id:R(),kind:H([`browser`,`machine`]),name:I(),createdAt:Js(),lastSeenAt:Js().nullable(),current:as()}))}),Q_=I().min(1).max(Z.titleChars).refine(e=>/\S/.test(e),`title must not be blank`),$_=B(V({level:ms([U(2),U(3)]),text:I().max(Z.headingTextChars),id:I().min(1).max(Z.headingIdChars).optional()})).max(Z.headingsPerDoc),ev=V({error:V({code:H(Object.keys({internal:500,unauthorized:401,forbidden:403,bad_host:403,bad_origin:403,not_found:404,unknown_review:404,invalid_request:400,invalid_target:400,empty_send:400,blob_mismatch:400,blob_missing:400,wrong_origin:400,stale_revision:409,comment_frozen:409,unsent_comments:409,review_moved:409,review_closed:409,invalid_state:409,instance_attached:409,publish_conflict:409,too_large:413,client_outdated:426,rate_limited:429})),message:I().max(Z.errorMessageChars)})}),tv=H([`publish`,`send`,`thread`,`waiting`,`claimed`,`confirmed`,`viewed`,`snooze`,`unsnooze`,`retire`,`reopen`,`delete`]),nv=`ping`,rv=4e4,iv={reviewId:R(),revision:z().positive()},av=gs(`type`,[V({type:U(`publish`),...iv}),V({type:U(`send`),...iv,sendId:R()}),V({type:U(`thread`),...iv,threadId:R(),commentId:R().optional()}),V({type:U(`waiting`),...iv}),V({type:U(`claimed`),...iv}),V({type:U(`confirmed`),...iv,deliveryId:R()}),V({type:U(`viewed`),reviewId:R()}),V({type:U(`snooze`),...iv}),V({type:U(`unsnooze`),...iv}),V({type:U(`retire`),...iv}),V({type:U(`reopen`),...iv}),V({type:U(`delete`),...iv})]),ov=e=>new Map(e.map(e=>[e.id,e]));function sv(e,t){let n=new Map;for(let r of e){let e=t(r);if(e===null)continue;let i=n.get(e);i?i.push(r):n.set(e,[r])}return n}function cv(e){let t=new Map(e.revisions.map(e=>[e.id,{row:e,topics:[],files:[],writeups:[],threads:[],diffPaths:new Map,docPaths:new Map,anyPaths:new Map,topicSlugs:new Set}]));for(let n of e.topics){let e=t.get(n.revisionId);e?.topics.push(n),e?.topicSlugs.add(n.slug)}for(let n of e.files){let e=t.get(n.revisionId);e&&(e.files.push(n),e.anyPaths.set(n.path,n),(n.role===`diff`?e.diffPaths:e.docPaths).set(n.path,n))}for(let n of e.writeups)t.get(n.revisionId)?.writeups.push(n);for(let n of e.threads)t.get(n.createdRevisionId)?.threads.push(n);return{revisions:t,files:ov(e.files),threads:ov(e.threads),sends:ov(e.sends),deliveries:ov(e.deliveries),commentsBySend:sv(e.comments,e=>e.sendId),sendsByDelivery:sv(e.sends,e=>e.deliveryId),assetsByDoc:sv(e.docAssets,e=>e.docId),notesByFile:sv(e.agentNotes??[],e=>e.fileId)}}var lv=new WeakMap;function uv(e){let t=lv.get(e);return t||(t=cv(e),lv.set(e,t)),t}var dv={perRevision:8,urlChars:2048,labelChars:60},fv=/[\s\p{Cc}\p{Cf}]/u;function pv(e){if(e.length>dv.urlChars||fv.test(e)||!/^https:\/\//i.test(e))return null;try{let t=new URL(e);return t.protocol!==`https:`||t.username!==``||t.password!==``||t.hostname===``?null:t}catch{return null}}var mv=I().refine(e=>pv(e)!==null,`expected an https URL`),hv=/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?::\d{1,5})?$/,gv=/^[A-Za-z0-9._-]+$/,_v=I().refine(e=>{let t=pv(e);if(t===null||t.search!==``||t.hash!==``||t.host!==t.host.toLowerCase())return!1;let[n=``,...r]=e.slice(8).split(`/`);return!hv.test(n)||r.length!==2?!1:r.every(e=>gv.test(e)&&e!==`.`&&e!==`..`)&&t.pathname===`/${r.join(`/`)}`},`expected https://host/owner/name`),vv=B(V({url:mv,label:I().min(1).max(dv.labelChars).refine(e=>e.trim()!==``&&!/[\p{Cc}\p{Cf}]/u.test(e),`label must be plain visible text`),kind:H([`pr`,`issue`,`other`]).optional()})).max(dv.perRevision);V({links:vv.optional(),repoUrl:_v.optional()});var yv=new TextEncoder,bv=I().refine(e=>yv.encode(e).byteLength<=Z.writeupSectionBytes,`writeup section exceeds the UTF-8 byte limit`),xv=V({overview:bv,tldr:bv,decisions:bv.nullable(),glossary:bv.optional(),topics:bs(B_,V({why:bv,example:bv.optional(),body:bv.optional()})).refine(e=>Object.keys(e).length<=Z.topicsPerReview,`too many writeup topics`).transform(e=>Object.assign(Object.create(null),e))}).refine(e=>{let t=[e.overview,e.tldr,e.decisions,e.glossary];for(let n of Object.values(e.topics))t.push(n.why,n.example,n.body);return t.reduce((e,t)=>e+yv.encode(t??``).byteLength,0)<=Z.writeupBytes},`writeup exceeds the total UTF-8 byte limit`),Sv=I().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/,`expected a full commit hash`),Cv=I().min(1).max(Z.pathChars).refine(e=>e.isWellFormed(),`source must be well-formed UTF-16`).refine(e=>!Array.from(e).some(e=>e.charCodeAt(0)<32||e.charCodeAt(0)===127),`source must not contain control characters`),wv=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`]),Tv=V({version:U(1),title:I().min(1).max(Z.titleChars).refine(e=>/\S/.test(e),`title must not be blank`),base:Sv.optional(),head:ms([Sv,U(`worktree`)]).optional(),main:ms([U(`writeup`),Q]).optional(),topics:B(H_).max(Z.topicsPerReview),files:B(V({path:Q,role:H([`diff`,`doc`]),topic:B_.optional(),source:Cv.optional(),title:Q_.optional(),notes:G_.optional()}).refine(e=>e.role===`doc`||e.title===void 0,{path:[`title`],message:`only doc files have titles`}).refine(e=>e.role===`diff`||e.notes===void 0,{path:[`notes`],message:`only diff files have agent notes`})).max(Z.filesPerRevision),media:B(V({path:Q,source:Cv.optional()})).max(Z.mediaPerRevision).optional(),writeup:xv,links:vv.optional(),repoUrl:_v.nullable().optional().catch(void 0)}).superRefine((e,t)=>{K_(e.files,t),e.main!==void 0&&e.main!==`writeup`&&!e.files.some(t=>t.role===`doc`&&t.path===e.main)&&t.addIssue({code:`custom`,path:[`main`],message:`main is not a doc of this revision`}),e.base===void 0!=(e.head===void 0)&&t.addIssue({code:`custom`,path:[e.base===void 0?`base`:`head`],message:`base and head must be supplied together`});let n=new Set;for(let[r,i]of e.topics.entries())i.slug===V_.slug&&t.addIssue({code:`custom`,path:[`topics`,r,`slug`],message:`topic slug other is reserved`}),n.has(i.slug)&&t.addIssue({code:`custom`,path:[`topics`,r,`slug`],message:`duplicate topic slug`}),n.add(i.slug);let r=new Set;for(let[i,a]of e.files.entries()){let e=`${a.role}:${a.path}`;r.has(e)&&t.addIssue({code:`custom`,path:[`files`,i,`path`],message:`duplicate file path`}),r.add(e),a.topic!==void 0&&!n.has(a.topic)&&t.addIssue({code:`custom`,path:[`files`,i,`topic`],message:`file topic is not declared`})}let i=new Set(e.files.filter(e=>e.role===`doc`).map(e=>e.path)),a=new Set;for(let[n,r]of(e.media??[]).entries()){let e=e=>t.addIssue({code:`custom`,path:[`media`,n,`path`],message:e});wv.has(r.path.split(`.`).at(-1)?.toLowerCase()??``)||e(`media must be an image file`),r.path.split(`/`).some(e=>e.startsWith(`.`))&&e(`media path must not be hidden`),r.path.includes(`:`)&&e(`media path must not contain a colon`),a.has(r.path)&&e(`duplicate media path`),a.add(r.path),i.has(r.path)&&e(`media path is already a doc`)}for(let r of Object.keys(e.writeup.topics))n.has(r)||t.addIssue({code:`custom`,path:[`writeup`,`topics`,r],message:`writeup topic is not declared`})}),Ev=new Set(`js mjs css png jpg jpeg gif svg webp avif ico bmp woff woff2 ttf otf mp4 webm ogg mp3 wav m4a`.split(` `)),Dv=I().length(64).regex(/^[0-9a-f]{64}$/),Ov=V({path:Q,title:Q_.optional(),oldPath:Q.nullable(),role:L_,status:R_.optional(),topic:B_.optional(),oldBlob:Dv.nullable(),newBlob:Dv.nullable(),flag:z_.nullable(),parent:Q.optional(),assets:B(Q).max(Z.filesPerRevision).optional(),notes:G_.optional()}).refine(e=>e.role===`doc`||e.title===void 0,{path:[`title`],message:`only doc files have titles`}).refine(e=>e.role===`diff`||e.notes===void 0,{path:[`notes`],message:`only diff files have agent notes`}),kv=V({reviewId:R().optional(),reviewKey:Dv,repo:V({key:Dv,name:I().min(1).max(Z.titleChars)}).nullable(),branch:I().min(1).max(Z.pathChars).nullable(),title:Tv.shape.title,base:Tv.shape.base.unwrap().nullable(),head:Tv.shape.head.unwrap().nullable(),main:Tv.shape.main,topics:B(H_).max(Z.topicsPerReview+1),writeup:xv,links:vv.optional(),repoUrl:_v.optional(),files:B(Ov).max(Z.filesPerRevision)}).superRefine((e,t)=>{K_(e.files,t),e.main!==void 0&&e.main!==`writeup`&&!e.files.some(t=>t.role===`doc`&&t.path===e.main)&&t.addIssue({code:`custom`,path:[`main`],message:`main is not a doc of this revision`});let n=e=>t.addIssue({code:`custom`,message:e});e.base===null!=(e.head===null)&&n(`base and head must be supplied together`);let r=new Set(e.topics.map(e=>e.slug));r.size!==e.topics.length&&n(`duplicate topic slug`),e.topics.filter(e=>e.slug!==V_.slug).length>Z.topicsPerReview&&n(`too many topics`);let i=e.topics.find(e=>e.slug===V_.slug);i&&(i.importance!==100||i.title!==V_.title||e.topics.at(-1)!==i)&&n(`Other changes must rank last`);let a=new Set(e.files.map(e=>`${e.role===`diff`?`diff`:`doc`}:${e.path}`)),o=new Map(e.files.filter(e=>e.role!==`diff`).map(e=>[e.path,e]));a.size!==e.files.length&&n(`duplicate file path in namespace`);let s=new Set(e.files.flatMap(e=>e.assets??[])),c=0;for(let t of e.files){if(t.topic&&!r.has(t.topic)&&n(`file topic is not declared`),t.role===`doc`&&/\.html?$/i.test(t.path)){t.assets||n(`HTML docs must list their assets`);let e=t.path.slice(0,t.path.lastIndexOf(`/`)+1);new Set(t.assets).size!==t.assets?.length&&n(`duplicate HTML asset reference`);for(let r of t.assets??[])o.get(r)?.role===`asset`&&r.startsWith(e)||n(`HTML assets must be request assets inside the doc folder`)}else t.assets!==void 0&&n(`only HTML docs list assets`);if(t.role===`asset`&&t.parent===void 0)c++,(!wv.has(t.path.split(`.`).at(-1)?.toLowerCase()??``)||t.path.split(`/`).some(e=>e.startsWith(`.`)))&&n(`media must be a visible image file`),t.path.includes(`:`)&&n(`media path must not contain a colon`),(t.topic!==void 0||t.assets!==void 0||t.notes!==void 0)&&n(`media has no topic, assets or notes`),s.has(t.path)&&n(`media is already a doc asset`);else if(t.role===`asset`){let e=t.parent?o.get(t.parent):void 0;e?.role===`doc`&&/\.html?$/i.test(e.path)||n(`asset parent must be an HTML doc`);let r=e?.path.slice(0,e.path.lastIndexOf(`/`)+1);Ev.has(t.path.split(`.`).at(-1)?.toLowerCase()??``)&&r!==void 0&&t.path.startsWith(r)&&!t.path.split(`/`).some(e=>e.startsWith(`.`))||n(`asset must be a visible allowed file inside its parent folder`)}else t.parent!==void 0&&n(`only assets have a parent`);t.role!==`diff`&&(t.oldBlob!==null||t.oldPath!==null||t.newBlob===null||t.flag!==null)&&n(`docs and assets require one unflagged new blob`),t.flag!==null&&(t.oldBlob!==null||t.newBlob!==null)&&n(`flagged files have no blobs`)}c>Z.mediaPerRevision&&n(`too many media files`);for(let t of Object.keys(e.writeup.topics))r.has(t)||n(`writeup topic is not declared`)}),Av=H([`fix-clear`,`explain`,`fix-all`]),jv={"fix-clear":`Fix what's clear, ask about the rest`,explain:`Explain only, change nothing`,"fix-all":`Fix everything`},Mv=`fix-clear`,Nv=gs(`kind`,[V({revision:z().positive(),kind:U(`go`),mode:Av.optional(),instruction:I().max(Z.instructionChars).refine(e=>e.isWellFormed(),`instruction must be well-formed UTF-16`).optional()}),V({revision:z().positive(),kind:U(`approve`),mode:ls().optional(),instruction:ls().optional()})]);V({sendId:R()});var Pv=I().max(Z.pathChars).regex(/^(?:overview|tldr|decisions|glossary|t-[a-z0-9][a-z0-9-]{0,63}-(?:why|example|body)|doc-[0-9a-f]{8})-[0-9a-f]{8}(?:-(?:[2-9]|[1-9][0-9]+))?$/),Fv={quote:I().min(1).max(Z.quoteChars),prefix:I().max(Z.prefixSuffixChars),suffix:I().max(Z.prefixSuffixChars)},Iv=V({kind:U(`writeup-span`),blockId:Pv,...Fv}),Lv=V({kind:U(`doc-span`),path:Q,blockId:Pv,...Fv}),Rv=V({kind:U(`html-span`),path:Q,...Fv}),zv=V({kind:U(`lines`),path:Q,side:H([`old`,`new`]),start:z().positive(),end:z().positive(),lines:B(I().max(Z.targetTextChars)).max(Z.targetLines),before:B(I().max(Z.contextLineChars)).max(Z.diffContextLines),after:B(I().max(Z.contextLineChars)).max(Z.diffContextLines)}).superRefine((e,t)=>{e.end<e.start&&t.addIssue({code:`custom`,path:[`end`],message:`end must be at least start`}),e.lines.length!==e.end-e.start+1&&t.addIssue({code:`custom`,path:[`lines`],message:`lines must match the inclusive range length`}),[e.lines,e.before,e.after].reduce((e,t)=>e+t.reduce((e,t)=>e+t.length,0),0)>Z.targetTextChars&&t.addIssue({code:`custom`,path:[`lines`],message:`target text exceeds the combined character limit`})}),Bv=V({kind:U(`file`),path:Q}),Vv=V({kind:U(`topic`),slug:B_}),Hv=V({kind:U(`review`)}),Uv=gs(`kind`,[Iv,Lv,Rv,zv,Bv,Vv,Hv]),Wv=H([`open`,`sent`,`answered`,`resolved`]),Gv=H([`fixed`,`explained`,`held`,`declined`]),Kv=I().min(1).max(Z.commentBodyChars).refine(e=>e.isWellFormed(),`comment body must be well-formed UTF-16`).refine(e=>/\S/.test(e),`comment body must not be blank`);V({outcome:Gv,body:Kv}),V({revision:z().positive(),target:Uv,body:Kv}),V({body:Kv}),V({threadId:R(),commentId:R()}),V({commentId:R()}),V({commentId:R(),threadId:R(),state:Wv});var qv=R(),Jv=Js(),Yv={id:qv},Xv={...Yv,revisionId:qv},Zv={...Yv,reviewId:qv},Qv={createdAt:Jv,updatedAt:Jv},$v=V({review:V({...Yv,originInstanceId:qv,reviewKey:Dv,repo:kv.shape.repo,branch:kv.shape.branch,title:kv.shape.title,state:H([`open`,`approved`,`settled`]),approvedRevision:qv.nullable(),...Qv}),revisions:B(V({...Zv,seq:z().positive(),base:kv.shape.base,head:kv.shape.head,main:ms([U(`writeup`),Q]).nullable(),writeupEmpty:as(),createdAt:Jv})).min(1),topics:B(H_.extend(Xv)),files:B(V({...Xv,path:Q,oldPath:Q.nullable(),role:L_,status:R_.nullable(),topicSlug:B_.nullable(),ord:z().min(0).max(Z.filesPerRevision-1),oldBlob:Dv.nullable(),newBlob:Dv.nullable(),renderedBlob:Dv.nullable(),title:Q_.nullable().optional(),flag:z_.nullable(),parentDocId:qv.nullable()})),docAssets:B(V({revisionId:qv,docId:qv,assetId:qv})),agentNotes:B(W_.safeExtend({fileId:qv,ord:z().min(0).max(Z.agentNotesPerFile-1)})).max(Z.importRevisions*Z.agentNotesPerRevision).optional(),writeups:B(V({...Xv,sourceBlob:Dv,renderedBlob:Dv})),threads:B(V({...Zv,target:Uv,state:Wv,createdRevisionId:qv,...Qv})),comments:B(V({...Zv,threadId:qv,author:H([`user`,`agent`]),body:Kv,outcome:Gv.nullable(),sendId:qv.nullable(),...Qv}).refine(e=>e.author===`user`?e.outcome===null:e.outcome!==null&&e.sendId===null)),sends:B(V({...Zv,revisionId:qv,kind:H([`go`,`approve`]),mode:Av.nullable(),instruction:Nv.options[0].shape.instruction.unwrap().nullable(),deliveryId:qv.nullable(),setAsideAt:Jv.nullable(),createdAt:Jv}).refine(e=>e.kind===`go`?e.mode!==null:e.mode===null&&e.instruction===null)),deliveries:B(V({...Zv,leaseUntil:Jv,confirmedAt:Jv.nullable(),createdAt:Jv}))});$v.extend({revisions:$v.shape.revisions.max(Z.importRevisions),threads:$v.shape.threads.max(Z.importThreads),comments:$v.shape.comments.max(Z.importComments),sends:$v.shape.sends.max(Z.importSends),deliveries:$v.shape.deliveries.max(Z.importDeliveries),writeups:$v.shape.writeups.max(Z.importRevisions)}).superRefine((e,t)=>{let n=e=>t.addIssue({code:`custom`,message:e}),r=[e.review,...e.revisions,...e.topics,...e.files,...e.agentNotes??[],...e.writeups,...e.threads,...e.comments,...e.sends,...e.deliveries];new Set(r.map(e=>e.id)).size!==r.length&&n(`duplicate row id`);let i=uv(e),{revisions:a,threads:o,files:s,sends:c,deliveries:l}=i;for(let t of e.agentNotes??[])s.get(t.fileId)?.role!==`diff`&&n(`agent note must reference a diff file`);for(let[e,t]of i.notesByFile)t.length>Z.agentNotesPerFile&&n(`too many agent notes in file`),new Set(t.map(e=>e.ord)).size!==t.length&&n(`duplicate agent note order`),s.has(e)||n(`missing agent note file`);for(let t of[...e.revisions,...e.threads,...e.comments,...e.sends,...e.deliveries])t.reviewId!==e.review.id&&n(`foreign review reference`);for(let t of[...e.files,...e.topics,...e.writeups,...e.sends,...e.docAssets])a.has(t.revisionId)||n(`missing revision`);for(let t of e.threads)a.has(t.createdRevisionId)||n(`missing thread creation revision`);for(let t of e.comments)o.has(t.threadId)||n(`missing comment thread`),t.sendId===null||c.has(t.sendId)&&c.get(t.sendId)?.kind===`go`||n(`missing comment Go`);for(let t of e.sends){t.deliveryId!==null&&!l.has(t.deliveryId)&&n(`missing delivery`);let e=i.commentsBySend.get(t.id)??[];e.length>Z.commentsPerHandoff&&n(`too many comments in Send`),t.kind===`go`&&!e.length&&!t.instruction?.trim()&&n(`empty Send`);for(let r of e)(a.get(o.get(r.threadId)?.createdRevisionId??``)?.row.seq??0)>(a.get(t.revisionId)?.row.seq??0)&&n(`Send precedes thread`)}for(let t of e.deliveries)i.sendsByDelivery.has(t.id)||n(`delivery has no Send`);e.review.approvedRevision!==null&&!a.has(e.review.approvedRevision)&&n(`missing approved revision`),e.review.state===`approved`!=(e.review.approvedRevision!==null)&&n(`inconsistent approval`);let u=e=>{new Set(e).size!==e.length&&n(`duplicate relationship`)};u(e.docAssets.map(e=>`${e.docId}:${e.assetId}`));for(let t of e.docAssets){let e=s.get(t.docId),r=s.get(t.assetId);e?.revisionId===t.revisionId&&r?.revisionId===t.revisionId&&e?.role===`doc`&&/\.html?$/i.test(e.path)&&r?.role===`asset`||n(`invalid doc asset association`)}for(let t of e.files){let e=t.parentDocId===null?void 0:s.get(t.parentDocId);t.parentDocId===null||t.role===`asset`&&e?.role===`doc`&&e.revisionId===t.revisionId&&/\.html?$/i.test(e.path)||n(`invalid parent doc`)}for(let[r,o]of e.revisions.entries()){o.seq!==r+1&&n(`revisions must be complete and in sequence order`);let e=a.get(o.id);e&&(K_(e.files.map(e=>({path:e.path,topic:e.topicSlug??void 0,notes:i.notesByFile.get(e.id)})),t),u(e.files.map(e=>String(e.ord))),e.files.length>Z.filesPerRevision&&n(`too many files`),e.topics.length>Z.topicsPerReview+1&&n(`too many topics`),e.writeups.length!==1&&n(`revision requires one writeup`))}}),V({skipped:as(),deleted:as().optional()}),ms([fs({until:Js()}),fs({untilRevision:U(!0)})]),fs({discardUnsent:as().optional()});var ey=H([`block-gone`,`ambiguous`,`topic-gone`,`file-gone`,`lines-gone`,`not-placed`]),ty=V({start:z().nonnegative(),end:z().positive()}).refine(e=>e.end>e.start,{path:[`end`],message:`span end must be after start`}),ny=gs(`kind`,[ty.safeExtend({kind:U(`writeup-span`),blockId:Pv}),ty.safeExtend({kind:U(`doc-span`),path:Q,blockId:Pv}),ty.safeExtend({kind:U(`html-span`),path:Q}),V({kind:U(`lines`),path:Q,side:H([`old`,`new`]),start:z().positive(),end:z().positive()}).refine(e=>e.end>=e.start,{path:[`end`],message:`line end must be at least start`}),Bv,Vv,Hv]),ry=gs(`status`,[V({status:U(`placed`),location:ny}),V({status:U(`unplaced`),reason:ey})]);V({reviewId:R(),revision:z().positive(),url:zo({protocol:/^https?$/}).max(Z.pathChars),placed:z().nonnegative(),unplaced:z().nonnegative(),unrendered:B(Q).max(Z.filesPerRevision).default([])});var iy=H([`open`,`approved`,`settled`]),ay=H([`active`,`snoozed`,`done`]),oy=V({id:R(),title:kv.shape.title,origin:V({id:R(),name:I()}),repo:Dv.nullable(),branch:kv.shape.branch,state:iy,newestRevision:z().positive(),unsentCount:z().nonnegative(),openThreads:z().nonnegative(),agentWaiting:as(),pendingSend:as(),updatedAt:Js(),movedTo:zo({protocol:/^https?$/}).nullable(),list:ay,snoozed:as(),snoozedUntil:Js().nullable(),releasedAt:Js().nullable(),pickedUpAt:Js().nullable(),kind:H([`review`,`publish`])}),sy=V({items:B(oy).max(Z.inboxItems*ay.options.length)});V({items:B(V({id:R(),title:kv.shape.title,state:iy,updatedAt:Js(),url:zo({protocol:/^https?$/}).max(Z.pathChars)})).max(Z.agentReviews)});var cy=oy.extend({importedAt:Js().nullable().default(null),revisions:B(V({seq:z().positive(),createdAt:Js()}))}),ly=new TextEncoder,uy=I().max(Z.renderedBytesPerRevision).refine(e=>e.length<=Z.renderedBytesPerRevision&&ly.encode(e).byteLength<=Z.renderedBytesPerRevision,`rendered text exceeds the UTF-8 byte budget`),dy=e=>ly.encode(JSON.stringify(e)).byteLength,fy=ms([H([`overview`,`tldr`,`decisions`,`glossary`]),Ws([`t-`,B_,`-`,H([`why`,`example`,`body`])])]),py=V({id:Pv,section:ms([fy,I().regex(/^doc-[0-9a-f]{8}$/)]),kind:H([`heading`,`paragraph`,`item`,`code`,`table`,`quote`,`diagram`]),html:uy,text:uy,source:uy.optional()}),my=V({sections:B(V({key:fy,label:I().max(Z.titleChars+10),topic:B_.nullable(),blocks:B(py).max(Z.blocksPerRevision)})).max(4+3*Z.topicsPerReview)}).refine(e=>e.sections.reduce((e,t)=>e+t.blocks.length,0)<=Z.blocksPerRevision,`writeup exceeds the rendered block count budget`).refine(e=>dy(e)<=Z.renderedBytesPerRevision,`writeup exceeds the rendered JSON byte budget`),hy=V({id:R(),path:Q,oldPath:Q.nullable(),role:L_,status:R_.nullable(),topic:B_.nullable(),order:z().min(0).max(Z.filesPerRevision-1),mediaType:I(),flag:z_.nullable(),hasOld:as(),hasNew:as(),viewed:H([`viewed`,`stale`]).optional(),viewedOn:z().positive().optional(),notes:B(W_).max(Z.agentNotesPerFile).optional()}),gy=V({id:R(),target:Uv,state:Wv,placement:ry,createdOn:z().positive(),comments:B(V({id:R(),author:H([`user`,`agent`]),body:Kv,html:I().nullable().optional(),outcome:Gv.optional(),sent:as(),sentOn:z().positive().nullable()}))}),_y=I().refine(e=>{let t=/^\/content\/[A-Za-z0-9_-]+\/(.+)$/.exec(e);if(!t?.[1])return!1;try{let e=t[1].split(`/`).map(decodeURIComponent).join(`/`);return Q.safeParse(e).success&&e.split(`/`).map(encodeURIComponent).join(`/`)===t[1]}catch{return!1}},`expected a percent-encoded content path`),vy=I().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),yy=V({seq:z().positive(),base:vy.nullable(),head:ms([vy,U(`worktree`)]).nullable(),main:ms([U(`writeup`),Q]).nullable(),writeupEmpty:as(),topics:B(H_).max(Z.topicsPerReview+1),files:B(hy).max(Z.filesPerRevision),writeup:my,links:vv.optional(),repoUrl:_v.nullable().optional(),docs:B(gs(`kind`,[V({path:Q,kind:U(`markdown`),title:Q_.optional(),headings:$_.optional(),blocks:B(py).max(Z.blocksPerRevision).refine(e=>dy(e)<=Z.renderedBytesPerRevision,`doc exceeds the rendered JSON byte budget`)}),V({path:Q,kind:U(`html`),contentUrl:_y,title:Q_.optional(),headings:$_.optional()})])).max(Z.filesPerRevision),threads:B(gy),changedBlocks:B(V({blockId:Pv,revision:z().positive()}))}).refine(e=>e.writeup.sections.reduce((e,t)=>e+t.blocks.length,0)+e.docs.reduce((e,t)=>e+(t.kind===`markdown`?t.blocks.length:0),0)<=Z.blocksPerRevision,`revision exceeds the rendered block count budget`).refine(e=>{let t=dy(e.writeup);for(let n of e.docs)if((n.title!==void 0||n.headings!==void 0)&&(t+=dy({title:n.title,headings:n.headings})),n.kind===`markdown`&&n.blocks.length&&(t+=dy(n.blocks)),t>Z.renderedBytesPerRevision)return!1;return t<=Z.renderedBytesPerRevision},`revision exceeds the rendered JSON byte budget`);V({accepts:B(H([`closed`])).max(4).optional(),waitSeconds:ns().min(0).max(25).default(0),maxBytes:z().min(65536).max(Z.handoffBytes).optional()});var by=V({id:R(),threadId:R(),target:Uv,placement:ry,body:Kv,historyTrimmed:as().optional().describe(`Some history was left out, by the per-comment cap or the byte budget`),history:B(V({author:H([`user`,`agent`]),body:Kv,outcome:Gv.optional()})).max(Z.historyPerComment).describe(`The newest eligible entries before this comment, in oldest-first insertion order`)});gs(`kind`,[V({kind:U(`go`),reviewId:R(),deliveryId:R(),revision:z().positive(),sentOn:z().positive(),mode:Av,modeLabel:H(Object.values(jv)),instructions:B(I().max(Z.instructionChars)).max(Z.instructionsPerHandoff),approvalSetAside:as(),comments:B(by).max(Z.commentsPerHandoff)}).superRefine((e,t)=>{e.modeLabel!==jv[e.mode]&&t.addIssue({code:`custom`,path:[`modeLabel`],message:`modeLabel must match mode`}),e.sentOn>e.revision&&t.addIssue({code:`custom`,path:[`sentOn`],message:`sentOn cannot be newer than revision`})}),V({kind:U(`approve`),reviewId:R(),deliveryId:R(),revision:z().positive()}),V({kind:U(`pending`),reviewId:R(),waitedSeconds:ns().nonnegative()}),V({kind:U(`closed`),reviewId:R(),deliveryId:R(),revision:z().positive(),reason:H([`retired`,`snoozed`]),until:Js().nullable()}).superRefine((e,t)=>{e.reason===`retired`&&e.until!==null&&t.addIssue({code:`custom`,path:[`until`],message:`until must be null when retired`})})]);var xy=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t}};async function Sy(e,t,n=!0){let r=await fetch(e,{...t,credentials:`same-origin`});if(!r.ok){let e=ev.safeParse(await r.json().catch(()=>null));throw r.status===401&&n&&window.location.assign(`/pair`),new xy(r.status,e.success?e.data.error.code:`unknown`,e.success?e.data.error.message:`The request failed. Try again.`)}return r}async function Cy(e,t,n){return t.parse(await(await Sy(e,{signal:n})).json())}async function wy(e,t){await Sy(e,{method:`HEAD`,signal:t})}async function Ty(e,t,n){await Sy(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}})}async function Ey(e){await Sy(`/api/v1/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)},!1)}async function Dy(e,t){return(await Sy(e,{signal:t})).text()}async function Oy(e,t,n){let r=await Sy(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});return n.parse(await r.json())}var ky=new WeakMap,Ay=new Set([`file`,`file-diff`,`file-counts`]);function jy(e){return typeof e.queryKey[0]==`string`&&Ay.has(e.queryKey[0])&&e.state.status===`success`}function My(e,t=[],n={}){let r=ky.get(e);r||(r={keys:new Set,settled:!1},ky.set(e,r));for(let e of t)r.keys.add(e.join(`:`));if(n.opened&&(r.openedAt=Date.now()),r.settled||=!!n.settled,r.timer!==void 0)return;let i=r;i.timer=setTimeout(()=>{let t=new Set(i.keys),n=i.openedAt,r=i.settled;if(i.keys.clear(),i.openedAt=void 0,i.settled=!1,i.timer=void 0,n!==void 0)e.invalidateQueries({predicate:e=>!jy(e)&&(e.state.dataUpdatedAt<n||t.has(e.queryKey.slice(0,2).join(`:`)))},{cancelRefetch:r});else for(let n of t)e.invalidateQueries({queryKey:n.split(`:`)})},200)}var Ny=new Map,Py=0,Fy,Iy=0;function Ly(){Fy&&clearTimeout(Fy.timer),Fy=void 0,document.removeEventListener(`focusin`,Ry,!0),document.removeEventListener(`pointerdown`,Ly,!0),document.removeEventListener(`keydown`,Ly,!0)}function Ry(e){Fy&&e.target!==Fy.focused&&Ly()}function zy(){Iy++,Ly()}function By(e){let t=Ny.get(e),n=Fy;!n||n.key!==e||!t?.node.isConnected||t.mounted<=n.mounted||n.focused.isConnected||document.activeElement&&document.activeElement!==document.body||(n.focused=t.node,t.node.focus({preventScroll:!0}),Fy===n&&document.activeElement===t.node&&Ly())}function Vy(e,t,n,r,i){let a=JSON.stringify([e,t,n,r]),o=(0,W.useRef)(Iy);return(0,W.useLayoutEffect)(()=>{i&&(o.current=Iy)},[i]),{ref:(0,W.useCallback)(e=>{if(!e)return;let t={node:e,mounted:++Py};return Ny.set(a,t),queueMicrotask(()=>By(a)),()=>{Ny.get(a)===t&&Ny.delete(a)}},[a]),returnFocus:(e=!1)=>{if(o.current!==Iy)return null;Ly();let t=Ny.get(a);return t?.node.isConnected?(t.node.focus({preventScroll:!0}),e&&document.activeElement===t.node&&(Fy={key:a,focused:t.node,mounted:Py,timer:setTimeout(Ly,1e3)},document.addEventListener(`focusin`,Ry,!0),document.addEventListener(`pointerdown`,Ly,!0),document.addEventListener(`keydown`,Ly,!0)),t.node):null}}}var Hy=`emend.layout.v1`,Uy=H([`split`,`tabs`]),Wy=V({inboxWidth:ns().min(220).max(520).catch(280),readingShare:ns().min(0).max(1).catch(.42),pane:V({desktop:Uy.catch(`split`),tablet:Uy.catch(`tabs`)}).catch({desktop:`split`,tablet:`tabs`}),reading:H([`standard`,`focus`]).catch(`standard`),diffStyle:H([`split`,`unified`]).catch(`split`),wrap:as().catch(!1),notes:as().catch(!0),details:V({phone:as().catch(!1),tablet:as().catch(!0),desktop:as().catch(!0)}).catch({phone:!1,tablet:!0,desktop:!0}),inboxCollapsed:as().catch(!1),proseSize:ms([U(15),U(16),U(17),U(18)]).catch(16),codeSize:ms([U(11),U(12),U(13),U(14)]).catch(12)}),Gy=Wy.parse({});function Ky(e){try{return Wy.parse(JSON.parse(e??`{}`))}catch{return Wy.parse({})}}function qy(e){try{return localStorage.getItem(e)}catch{return}}function Jy(){let e=qy(Hy),t=e==null?Wy.parse({diffStyle:qy(`emend.diff.layout`)??void 0,wrap:qy(`emend.diff.wrap`)===`true`,inboxCollapsed:qy(`emend.inbox.collapsed`)===`true`}):Ky(e),n=new Set,r=()=>{for(let e of n)e()},i=()=>{try{let n=JSON.stringify(t);localStorage.setItem(Hy,n),e=n}catch{}};e===null&&i();let a=()=>{let n=qy(Hy);return n!==void 0&&n!==e&&(e=n,t=Ky(n)),t},o=()=>{let e=t;a()!==e&&r()},s=e=>{if(e.key===null||e.key===`emend.layout.v1`){try{if(e.storageArea&&e.storageArea!==localStorage)return}catch{return}a(),r()}};return{getSnapshot:a,subscribe(e){return n.size===0&&window.addEventListener(`storage`,s),n.add(e),o(),()=>{n.delete(e),n.size===0&&window.removeEventListener(`storage`,s)}},update(e){let n={...a(),...e};n.inboxWidth=Math.min(520,Math.max(220,n.inboxWidth)),n.readingShare=Math.min(1,Math.max(0,n.readingShare)),t=Wy.parse({...n,proseSize:Math.round(Math.min(18,Math.max(15,n.proseSize))),codeSize:Math.round(Math.min(14,Math.max(11,n.codeSize)))}),i(),r()}}}var Yy=Jy();function Xy(){return(0,W.useSyncExternalStore)(Yy.subscribe,Yy.getSnapshot,()=>Gy)}function Zy(e){let t=(0,W.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]);return(0,W.useSyncExternalStore)(t,()=>window.matchMedia(e).matches,()=>!1)}function Qy(){let e=Zy(`(min-width: 1280px)`),t=Zy(`(min-width: 768px)`);return e?`desktop`:t?`tablet`:`phone`}function $y(){let{inboxCollapsed:e}=Xy();return[e,e=>Yy.update({inboxCollapsed:e})]}function eb(){let e=Qy(),{details:t}=Xy();return[t[e],t=>Yy.update({details:{...Yy.getSnapshot().details,[e]:t}})]}function tb(){let e=Qy(),{pane:t}=Xy();return e===`phone`?`tabs`:t[e]}var nb={primary:`bg-accent text-accent-fg border-[color-mix(in_oklch,var(--ochre-600)_55%,transparent)] shadow-[inset_0_1px_0_oklch(from_var(--n-0)_1_0_0_/_0.35),var(--shadow-1)] [&:not(:disabled):not([aria-disabled=true])]:hover:text-accent-fg [&:not(:disabled):not([aria-disabled=true])]:hover:bg-accent-hover [&:not(:disabled):not([aria-disabled=true])]:active:bg-accent-press`,secondary:`bg-surface text-fg-1 border-line-2 shadow-1 [&:not(:disabled):not([aria-disabled=true])]:hover:bg-sunken [&:not(:disabled):not([aria-disabled=true])]:hover:border-line-strong [&:not(:disabled):not([aria-disabled=true])]:active:bg-active`,ghost:`bg-transparent text-fg-2 [&:not(:disabled):not([aria-disabled=true])]:hover:bg-hover [&:not(:disabled):not([aria-disabled=true])]:hover:text-fg-1 [&:not(:disabled):not([aria-disabled=true])]:active:bg-active`,approve:`bg-surface text-success-fg border-[color-mix(in_oklch,var(--success-solid)_45%,var(--border-2))] shadow-1 [&:not(:disabled):not([aria-disabled=true])]:hover:bg-success-bg [&:not(:disabled):not([aria-disabled=true])]:active:bg-active`,danger:`bg-transparent text-danger-fg border-line-2 [&:not(:disabled):not([aria-disabled=true])]:hover:bg-danger-bg [&:not(:disabled):not([aria-disabled=true])]:hover:border-[color-mix(in_oklch,var(--danger-solid)_40%,var(--border-2))] [&:not(:disabled):not([aria-disabled=true])]:active:bg-active`},rb={sm:`h-7 gap-[5px] rounded-sm px-[9px] text-12`,md:`h-8 gap-1.5 px-3`,lg:`h-10 gap-2 px-4 text-14`};function ib({asChild:e=!1,variant:t=`secondary`,size:n=`md`,icon:r,iconRight:i,loading:a=!1,disabled:o=!1,fullWidth:s=!1,kbd:c,children:l,className:u,type:d,onClickCapture:f,...p}){let m=e?Cf:`button`,h=o||a,g=n===`sm`?14:16;return(0,G.jsxs)(m,{...p,type:d??(e?void 0:`button`),disabled:e?void 0:h,"aria-disabled":h||p[`aria-disabled`],"aria-busy":a||p[`aria-busy`],tabIndex:e&&h?-1:p.tabIndex,onClickCapture:e=>{h?(e.preventDefault(),e.stopPropagation()):f?.(e)},className:df(`inline-flex select-none items-center justify-center whitespace-nowrap rounded-md border border-transparent font-sans text-13 font-medium no-underline transition-[background,border-color,color] duration-(--dur-1) ease-(--ease-out) [-webkit-tap-highlight-color:transparent] [&:not(:disabled):not([aria-disabled=true])]:active:translate-y-[0.5px] disabled:cursor-not-allowed disabled:opacity-48 aria-disabled:cursor-not-allowed aria-disabled:opacity-48`,ff,nb[t],rb[n],`leading-(--lh-snug)`,s&&`w-full`,u),children:[a?(0,G.jsx)(mf,{icon:ru,size:g,className:`animate-[em-spin_900ms_linear_infinite]`}):r?(0,G.jsx)(mf,{icon:r,size:g}):null,(0,G.jsx)(Ef,{children:l}),i&&(0,G.jsx)(mf,{icon:i,size:g}),c&&(0,G.jsx)(`kbd`,{className:`rounded-xs bg-[oklch(from_var(--bg-overlay)_l_c_h_/_0.08)] px-1 py-px font-mono text-11 font-medium leading-(--lh-snug) font-stretch-mono text-inherit opacity-75`,children:c})]})}var ab=Object.defineProperty,ob=(e,t)=>ab(e,`name`,{value:t,configurable:!0});function sb(e){let t=e+`CollectionProvider`,[n,r]=Yf(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ob(e=>{let{scope:t,children:n}=e,r=W.useRef(null),a=W.useRef(new Map).current;return(0,G.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Sf(s),l=W.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=yf(t,a(s,n).collectionRef);return(0,G.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Sf(u),p=W.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=W.useRef(null),s=yf(t,o),c=a(u,n);return W.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,G.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return W.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ob(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}ob(sb,`createCollection`);var cb=new WeakMap,lb=class e extends Map{static{ob(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],cb.set(this,!0)}set(e,t){return cb.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=fb(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ub(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ub(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ub(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ub(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=db(e,t);return n===-1?void 0:e[n]}ob(ub,`at`);function db(e,t){let n=e.length,r=fb(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ob(db,`toSafeIndex`);function fb(e){return e!==e||e===0?0:Math.trunc(e)}ob(fb,`toSafeInteger`);function pb(e){let t=e+`CollectionProvider`,[n,r]=Yf(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=ob(({state:e,...t})=>e?(0,G.jsx)(u,{...t,state:e}):(0,G.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=ob(e=>{let t=_();return(0,G.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=ob(e=>{let{scope:t,children:n,state:r}=e,a=W.useRef(null),[s,c]=W.useState(null),l=yf(a,c),[u,d]=r,f=W.useRef(new lb),p=W.useCallback(()=>{let e=f.current;return gb(e)||e.sort(_b),e},[]);return W.useEffect(()=>{if(!s)return;let e=vb(()=>{d(e=>{let t=e.toSorted(_b);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,G.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,G.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=Sf(d),p=W.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=yf(t,a(d,n).collectionElementRef);return(0,G.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Sf(m),g=W.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=W.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=W.useRef(i);mb(l.current,i)||(l.current=i);let u=l.current,d=yf(t,W.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);tp(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=W.useRef(null);return W.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new lb(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(_b)}))}),W.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new lb(t);return n.delete(e.element),n})},[s]),(0,G.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return W.useState(new lb)}ob(_,`useInitCollection`);function v(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}ob(v,`useCollection`);function y(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return ob(y,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useGetCollection:y,useInitCollection:_}]}ob(pb,`createCollection`);function mb(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ob(mb,`shallowEqual`);function hb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ob(hb,`isElementPreceding`);function gb(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}ob(gb,`isInDocumentOrder`);function _b(e,t){return!e[1].element||!t[1].element?0:hb(e[1].element,t[1].element)?-1:1}ob(_b,`sortByDocumentPosition`);function vb(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ob(vb,`getChildListObserver`);var yb=Object.defineProperty,bb=(e,t)=>yb(e,`name`,{value:t,configurable:!0}),xb={LTR:`ltr`,RTL:`rtl`},Sb=W.createContext(void 0);function Cb(e){let t=W.useContext(Sb);return e||t||xb.LTR}bb(Cb,`useDirection`);var wb=Object.defineProperty,Tb=(e,t)=>wb(e,`name`,{value:t,configurable:!0}),Eb=0,Db=null;function Ob(e){return kb(),e.children}Tb(Ob,`FocusGuards`);function kb(){W.useEffect(()=>{Db||={start:Ab(),end:Ab()};let{start:e,end:t}=Db;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Eb++,()=>{Eb===1&&(Db?.start.remove(),Db?.end.remove(),Db=null),Eb=Math.max(0,Eb-1)}},[])}Tb(kb,`useFocusGuards`);function Ab(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Tb(Ab,`createFocusGuard`);var jb=Object.defineProperty,Mb=(e,t)=>jb(e,`name`,{value:t,configurable:!0}),Nb=!1;function Pb(){let[e,t]=W.useState(Nb);return W.useEffect(()=>{Nb||(Nb=!0,t(!0))},[]),e}Mb(Pb,`useIsHydrated`);var Fb=W.useSyncExternalStore;function Ib(){return()=>{}}Mb(Ib,`subscribe`);function Lb(){return Fb(Ib,()=>!0,()=>!1)}Mb(Lb,`useIsHydratedModern`);var Rb=typeof Fb==`function`?Lb:Pb,zb=Object.defineProperty,Bb=(e,t)=>zb(e,`name`,{value:t,configurable:!0}),Vb=`rovingFocusGroup.onEntryFocus`,Hb={bubbles:!1,cancelable:!0},Ub=`RovingFocusGroup`,[Wb,Gb,Kb]=sb(Ub),[qb,Jb]=Yf(Ub,[Kb]),Yb={Vertical:`vertical`,Horizontal:`horizontal`},Xb={LTR:`ltr`,RTL:`rtl`},[Zb,Qb]=qb(Ub),$b=W.forwardRef(Bb(function(e,t){return(0,G.jsx)(Wb.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,G.jsx)(Wb.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,G.jsx)(ex,{...e,ref:t})})})},`RovingFocusGroup`)),ex=W.forwardRef(Bb(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=W.useRef(null),p=yf(t,f),m=Cb(a),[h,g]=Wg({prop:o,defaultProp:s??null,onChange:c,caller:Ub}),[_,v]=W.useState(!1),y=ap(l),b=Gb(n),x=W.useRef(!1),[S,C]=W.useState(0);return W.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Vb,y),()=>e.removeEventListener(Vb,y)},[y]),(0,G.jsx)(Zb,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:W.useCallback(e=>g(e),[g]),onItemShiftTab:W.useCallback(()=>v(!0),[]),onFocusableItemAdd:W.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:W.useCallback(()=>C(e=>e-1),[]),children:(0,G.jsx)($f.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:X(e.onMouseDown,()=>{x.current=!0}),onFocus:X(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Vb,Hb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);ox([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:X(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),tx=`RovingFocusGroupItem`,nx=W.forwardRef(Bb(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Gp(),l=a||c,u=Qb(tx,n),d=u.currentTabStopId===l,f=Gb(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Rb();return tp(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),W.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,G.jsx)(Wb.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,G.jsx)($f.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:X(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:X(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ax(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?sx(n,r+1):n.slice(r+1)}setTimeout(()=>ox(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),rx={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ix(e,t){return t===Xb.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Bb(ix,`getDirectionAwareKey`);function ax(e,t,n){let r=ix(e.key,n);if(!(t===Yb.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Yb.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return rx[r]}Bb(ax,`getFocusIntent`);function ox(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Bb(ox,`focusFirst`);function sx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Bb(sx,`wrapArray`);var cx=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},lx=new WeakMap,ux=new WeakMap,dx={},fx=0,px=function(e){return e&&(e.host||px(e.parentNode))},mx=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=px(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},hx=function(e,t,n,r){var i=mx(t,Array.isArray(e)?e:[e]);dx[n]||(dx[n]=new WeakMap);var a=dx[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(lx.get(e)||0)+1,l=(a.get(e)||0)+1;lx.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ux.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),fx++,function(){o.forEach(function(e){var t=lx.get(e)-1,i=a.get(e)-1;lx.set(e,t),a.set(e,i),t||(ux.has(e)||e.removeAttribute(r),ux.delete(e)),i||e.removeAttribute(n)}),fx--,fx||(lx=new WeakMap,lx=new WeakMap,ux=new WeakMap,dx={})}},gx=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||cx(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),hx(r,i,n,`aria-hidden`)):function(){return null}},_x=function(){return _x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_x.apply(this,arguments)};function vx(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function yx(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var bx=`right-scroll-bar-position`,xx=`width-before-scroll-bar`,Sx=`with-scroll-bars-hidden`,Cx=`--removed-body-scroll-bar-size`;function wx(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Tx(e,t){var n=(0,W.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ex=typeof window<`u`?W.useLayoutEffect:W.useEffect,Dx=new WeakMap;function Ox(e,t){var n=Tx(t||null,function(t){return e.forEach(function(e){return wx(e,t)})});return Ex(function(){var t=Dx.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||wx(e,null)}),i.forEach(function(e){r.has(e)||wx(e,a)})}Dx.set(n,e)},[e]),n}function kx(e){return e}function Ax(e,t){t===void 0&&(t=kx);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function jx(e){e===void 0&&(e={});var t=Ax(null);return t.options=_x({async:!0,ssr:!1},e),t}var Mx=function(e){var t=e.sideCar,n=vx(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return W.createElement(r,_x({},n))};Mx.isSideCarExport=!0;function Nx(e,t){return e.useMedium(t),Mx}var Px=jx(),Fx=function(){},Ix=W.forwardRef(function(e,t){var n=W.useRef(null),r=W.useState({onScrollCapture:Fx,onWheelCapture:Fx,onTouchMoveCapture:Fx}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=vx(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ox([n,t]),C=_x(_x({},b),i);return W.createElement(W.Fragment,null,u&&W.createElement(x,{sideCar:Px,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?W.cloneElement(W.Children.only(s),_x(_x({},C),{ref:S})):W.createElement(v,_x({},C,{className:c,ref:S}),s))});Ix.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ix.classNames={fullWidth:xx,zeroRight:bx};var Lx=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Rx(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Lx();return t&&e.setAttribute(`nonce`,t),e}function zx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Bx(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Vx=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rx())&&(zx(t,n),Bx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hx=function(){var e=Vx();return function(t,n){W.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ux=function(){var e=Hx();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Wx={left:0,top:0,right:0,gap:0},Gx=function(e){return parseInt(e||``,10)||0},Kx=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Gx(n),Gx(r),Gx(i)]},qx=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Wx;var t=Kx(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Jx=Ux(),Yx=`data-scroll-locked`,Xx=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
56
|
-
.${Sx} {
|
|
57
|
-
overflow: hidden ${r};
|
|
58
|
-
padding-right: ${s}px ${r};
|
|
59
|
-
}
|
|
60
|
-
body[${Yx}] {
|
|
61
|
-
overflow: hidden ${r};
|
|
62
|
-
overscroll-behavior: contain;
|
|
63
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
64
|
-
padding-left: ${i}px;
|
|
65
|
-
padding-top: ${a}px;
|
|
66
|
-
padding-right: ${o}px;
|
|
67
|
-
margin-left:0;
|
|
68
|
-
margin-top:0;
|
|
69
|
-
margin-right: ${s}px ${r};
|
|
70
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.${bx} {
|
|
74
|
-
right: ${s}px ${r};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.${xx} {
|
|
78
|
-
margin-right: ${s}px ${r};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.${bx} .${bx} {
|
|
82
|
-
right: 0 ${r};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.${xx} .${xx} {
|
|
86
|
-
margin-right: 0 ${r};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
body[${Yx}] {
|
|
90
|
-
${Cx}: ${s}px;
|
|
91
|
-
}
|
|
92
|
-
`},Zx=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Qx=function(){W.useEffect(function(){return document.body.setAttribute(Yx,(Zx()+1).toString()),function(){var e=Zx()-1;e<=0?document.body.removeAttribute(Yx):document.body.setAttribute(Yx,e.toString())}},[])},$x=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Qx();var a=W.useMemo(function(){return qx(i)},[i]);return W.createElement(Jx,{styles:Xx(a,!t,i,n?``:`!important`)})},eS=!1;if(typeof window<`u`)try{var tS=Object.defineProperty({},"passive",{get:function(){return eS=!0,!0}});window.addEventListener(`test`,tS,tS),window.removeEventListener(`test`,tS,tS)}catch{eS=!1}var nS=eS?{passive:!1}:!1,rS=function(e){return e.tagName===`TEXTAREA`},iS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!rS(e)&&n[t]===`visible`)},aS=function(e){return iS(e,`overflowY`)},oS=function(e){return iS(e,`overflowX`)},sS=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),uS(e,r)){var i=dS(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cS=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},lS=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},uS=function(e,t){return e===`v`?aS(t):oS(t)},dS=function(e,t){return e===`v`?cS(t):lS(t)},fS=function(e,t){return e===`h`&&t===`rtl`?-1:1},pS=function(e,t,n,r,i){var a=fS(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=dS(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&uS(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},mS=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hS=function(e){return[e.deltaX,e.deltaY]},gS=function(e){return e&&`current`in e?e.current:e},_S=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vS=function(e){return`
|
|
93
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
94
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
95
|
-
`},yS=0,bS=[];function xS(e){var t=W.useRef([]),n=W.useRef([0,0]),r=W.useRef(),i=W.useState(yS++)[0],a=W.useState(Ux)[0],o=W.useRef(e);W.useEffect(function(){o.current=e},[e]),W.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=yx([e.lockRef.current],(e.shards||[]).map(gS),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=W.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=mS(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=sS(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=sS(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return pS(h,t,e,h===`h`?s:c,!0)},[]),c=W.useCallback(function(e){var n=e;if(bS.length&&bS[bS.length-1]===a){var r=`deltaY`in n?hS(n):mS(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&_S(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(gS).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=W.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:SS(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=W.useCallback(function(e){n.current=mS(e),r.current=void 0},[]),d=W.useCallback(function(t){l(t.type,hS(t),t.target,s(t,e.lockRef.current))},[]),f=W.useCallback(function(t){l(t.type,mS(t),t.target,s(t,e.lockRef.current))},[]);W.useEffect(function(){return bS.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,nS),document.addEventListener(`touchmove`,c,nS),document.addEventListener(`touchstart`,u,nS),function(){bS=bS.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,nS),document.removeEventListener(`touchmove`,c,nS),document.removeEventListener(`touchstart`,u,nS)}},[]);var p=e.removeScrollBar,m=e.inert;return W.createElement(W.Fragment,null,m?W.createElement(a,{styles:vS(i)}):null,p?W.createElement($x,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function SS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var CS=Nx(Px,xS),wS=W.forwardRef(function(e,t){return W.createElement(Ix,_x({},e,{ref:t,sideCar:CS}))});wS.classNames=Ix.classNames;var TS=Object.defineProperty,$=(e,t)=>TS(e,`name`,{value:t,configurable:!0}),ES=[`Enter`,` `],DS=[`ArrowDown`,`PageUp`,`Home`],OS=[`ArrowUp`,`PageDown`,`End`],kS=[...DS,...OS];[...ES],[...ES];var AS=`Menu`,[jS,MS,NS]=sb(AS),[PS,FS]=Yf(AS,[NS,fg,Jb]),IS=fg(),LS=Jb(),[RS,zS]=PS(AS),[BS,VS]=PS(AS),HS=$(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=IS(t),[c,l]=W.useState(null),u=W.useRef(!1),d=ap(a),f=Cb(i);return W.useEffect(()=>{let e=$(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=$(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),W.useEffect(()=>{if(!n)return;let e=$(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,G.jsx)(hg,{...s,children:(0,G.jsx)(RS,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,G.jsx)(BS,{scope:t,onClose:W.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),US=W.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e,i=IS(n);return(0,G.jsx)(_g,{...i,...r,ref:t})},`MenuAnchor`)),WS=`MenuPortal`,[GS,KS]=PS(WS,{forceMount:void 0}),qS=$(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=zS(WS,t);return(0,G.jsx)(GS,{scope:t,forceMount:n,children:(0,G.jsx)(Ag,{present:n||a.open,children:(0,G.jsx)(Eg,{asChild:!0,container:i,children:r})})})},`MenuPortal`),JS=`MenuContent`,[YS,XS]=PS(JS),ZS=W.forwardRef($(function(e,t){let n=KS(JS,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=zS(JS,e.__scopeMenu),o=VS(JS,e.__scopeMenu);return(0,G.jsx)(jS.Provider,{scope:e.__scopeMenu,children:(0,G.jsx)(Ag,{present:r||a.open,children:(0,G.jsx)(jS.Slot,{scope:e.__scopeMenu,children:o.modal?(0,G.jsx)(QS,{...i,ref:t}):(0,G.jsx)($S,{...i,ref:t})})})})},`MenuContent`)),QS=W.forwardRef($(function(e,t){let n=zS(JS,e.__scopeMenu),r=W.useRef(null),i=yf(t,r);return W.useEffect(()=>{let e=r.current;if(e)return gx(e)},[]),(0,G.jsx)(tC,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),$S=W.forwardRef($(function(e,t){let n=zS(JS,e.__scopeMenu);return(0,G.jsx)(tC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),eC=Sf(`MenuContent.ScrollLock`),tC=W.forwardRef($(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=zS(JS,n),_=VS(JS,n),v=IS(n),y=LS(n),b=MS(n),[x,S]=W.useState(null),C=W.useRef(null),[w,T]=W.useState(null);kp(w);let{nodes:ee,registry:te}=Op(),ne=!!(i||m),E=yf(t,C,g.onContentChange,T),re=W.useRef(0),D=W.useRef(``),O=W.useRef(0),ie=W.useRef(null),ae=W.useRef(`right`),oe=W.useRef(0),k=W.useMemo(()=>m?[C,...ee.map(e=>({current:e}))]:[],[C,ee,m]),se=m?wS:W.Fragment,ce=m?{as:eC,allowPinchZoom:!0,shards:k}:void 0,le=$(e=>{let t=D.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=TC(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){D.current=e,window.clearTimeout(re.current),e!==``&&(re.current=window.setTimeout(()=>s(``),1e3))}$(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);W.useEffect(()=>()=>window.clearTimeout(re.current),[]),kb();let ue=W.useCallback(e=>ae.current===ie.current?.side&&DC(e,ie.current?.area),[]);return(0,G.jsx)(YS,{scope:n,searchRef:D,onItemEnter:W.useCallback(e=>{ue(e)&&e.preventDefault()},[ue]),onItemLeave:W.useCallback(e=>{ue(e)||(C.current?.focus(),S(null))},[ue]),onTriggerLeave:W.useCallback(e=>{ue(e)&&e.preventDefault()},[ue]),pointerGraceTimerRef:O,onPointerGraceIntentChange:W.useCallback(e=>{ie.current=e},[]),children:(0,G.jsx)(Dp,{registry:ne?te:null,children:(0,G.jsx)(se,{...ce,children:(0,G.jsx)(Tp,{asChild:!0,trapped:i,branches:ee,onMountAutoFocus:X(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,G.jsx)(pp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,G.jsx)($b,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:X(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,G.jsx)(xg,{role:`menu`,"aria-orientation":`vertical`,"data-state":bC(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:E,style:{outline:`none`,...h.style},onKeyDown:X(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&le(e.key));let i=C.current;if(e.target!==i||!kS.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);OS.includes(e.key)&&a.reverse(),CC(a)}),onBlur:X(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(re.current),D.current=``)}),onPointerMove:X(e.onPointerMove,OC(e=>{let t=e.target,n=oe.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>oe.current?`right`:`left`;ae.current=t,oe.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),nC=W.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,G.jsx)($f.div,{role:`group`,...r,ref:t})},`MenuGroup`)),rC=W.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,G.jsx)($f.div,{...r,ref:t})},`MenuLabel`)),iC=`MenuItem`,aC=`menu.itemSelect`,oC=W.forwardRef($(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=W.useRef(null),o=VS(iC,e.__scopeMenu),s=XS(iC,e.__scopeMenu),c=yf(t,a),l=W.useRef(!1),u=$(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(aC,{bubbles:!0,cancelable:!0});e.addEventListener(aC,e=>r?.(e),{once:!0}),ep(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,G.jsx)(sC,{...i,ref:c,disabled:n,onClick:X(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:X(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:X(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&ES.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),sC=W.forwardRef($(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=XS(iC,n),s=LS(n),c=W.useRef(null),l=yf(t,c),[u,d]=W.useState(!1),[f,p]=W.useState(``);return W.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,G.jsx)(jS.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,G.jsx)(nx,{asChild:!0,...s,focusable:!r,children:(0,G.jsx)($f.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:X(e.onPointerMove,OC(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:X(e.onPointerLeave,OC(e=>o.onItemLeave(e))),onFocus:X(e.onFocus,()=>d(!0)),onBlur:X(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[cC,lC]=PS(`MenuRadioGroup`,{value:void 0,onValueChange:$(()=>{},`onValueChange`)}),uC=W.forwardRef($(function(e,t){let{value:n,onValueChange:r,...i}=e,a=ap(r);return(0,G.jsx)(cC,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,G.jsx)(nC,{...i,ref:t})})},`MenuRadioGroup`)),dC=`MenuRadioItem`,fC=W.forwardRef($(function(e,t){let{value:n,...r}=e,i=lC(dC,e.__scopeMenu),a=n===i.value;return(0,G.jsx)(mC,{scope:e.__scopeMenu,checked:a,children:(0,G.jsx)(oC,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":SC(a),onSelect:X(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),pC=`MenuItemIndicator`,[mC,hC]=PS(pC,{checked:!1}),gC=W.forwardRef($(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=hC(pC,n);return(0,G.jsx)(Ag,{present:r||xC(a.checked)||a.checked===!0,children:(0,G.jsx)($f.span,{...i,ref:t,"data-state":SC(a.checked)})})},`MenuItemIndicator`)),_C=W.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,G.jsx)($f.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[vC,yC]=PS(`MenuSub`);function bC(e){return e?`open`:`closed`}$(bC,`getOpenState`);function xC(e){return e===`indeterminate`}$(xC,`isIndeterminate`);function SC(e){return xC(e)?`indeterminate`:e?`checked`:`unchecked`}$(SC,`getCheckedState`);function CC(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}$(CC,`focusFirst`);function wC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$(wC,`wrapArray`);function TC(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=wC(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}$(TC,`getNextMatch`);function EC(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}$(EC,`isPointInPolygon`);function DC(e,t){return t?EC({x:e.clientX,y:e.clientY},t):!1}$(DC,`isPointerInGraceArea`);function OC(e){return t=>t.pointerType===`mouse`?e(t):void 0}$(OC,`whenMouse`);var kC=Object.defineProperty,AC=(e,t)=>kC(e,`name`,{value:t,configurable:!0}),jC=`DropdownMenu`,[MC,NC]=Yf(jC,[FS]),PC=FS(),[FC,IC]=MC(jC),LC=AC(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=PC(t),l=W.useRef(null),[u,d]=Wg({prop:i,defaultProp:a??!1,onChange:o,caller:jC});return(0,G.jsx)(FC,{scope:t,triggerId:Gp(),triggerRef:l,contentId:Gp(),open:u,onOpenChange:d,onOpenToggle:W.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,G.jsx)(HS,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),RC=`DropdownMenuTrigger`,zC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=IC(RC,n),o=PC(n),s=yf(t,a.triggerRef);return(0,G.jsx)(US,{asChild:!0,...o,children:(0,G.jsx)($f.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:X(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:X(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),BC=AC(e=>{let{__scopeDropdownMenu:t,...n}=e,r=PC(t);return(0,G.jsx)(qS,{...r,...n})},`DropdownMenuPortal`),VC=`DropdownMenuContent`,HC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=IC(VC,n),a=PC(n),o=W.useRef(!1);return(0,G.jsx)(ZS,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:X(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),UC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=PC(n);return(0,G.jsx)(rC,{...i,...r,ref:t})},`DropdownMenuLabel`)),WC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=PC(n);return(0,G.jsx)(oC,{...i,...r,ref:t})},`DropdownMenuItem`)),GC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=PC(n);return(0,G.jsx)(uC,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),KC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=PC(n);return(0,G.jsx)(fC,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),qC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=PC(n);return(0,G.jsx)(gC,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),JC=W.forwardRef(AC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=PC(n);return(0,G.jsx)(_C,{...i,...r,ref:t})},`DropdownMenuSeparator`));function YC({label:e,trigger:t,align:n=`right`,size:r=`md`,items:i,defaultOpen:a,triggerRef:o}){let s=(0,W.useRef)(null);return(0,G.jsxs)(LC,{defaultOpen:a,children:[(0,G.jsx)(zC,{asChild:!0,"aria-label":e,ref:o,children:t??(0,G.jsx)(I_,{label:e,icon:ql,size:r})}),(0,G.jsx)(BC,{children:(0,G.jsx)(HC,{onCloseAutoFocus:()=>{let e=s.current;s.current=null,e?.()},align:n===`left`?`start`:`end`,sideOffset:4,collisionPadding:8,className:df(`relative z-[calc(var(--z-sheet)+2)] max-h-(--radix-dropdown-menu-content-available-height) min-w-52 animate-[em-fade_var(--dur-1)_var(--ease-out)] overflow-y-auto rounded-lg border border-line-1 bg-raised p-1 shadow-3`,i.some(e=>`radioGroup`in e)&&`min-w-60`),children:i.map((e,t)=>`radioGroup`in e?(0,G.jsx)(GC,{value:e.radioGroup.value,onValueChange:e.radioGroup.onValueChange,"aria-label":e.radioGroup.label,className:e.radioGroup.segmented?`mx-2 mb-2 flex gap-0.5 rounded-md border border-line-1 bg-sunken p-0.5`:void 0,onKeyDownCapture:t=>{if(!e.radioGroup.segmented)return;let n=e.radioGroup.items.filter(e=>!e.disabled),r=[...t.currentTarget.querySelectorAll(`[role="menuitemradio"]:not([data-disabled])`)],i=document.activeElement,a=i instanceof HTMLElement?r.indexOf(i):-1,o=pf(t.key,a,n.length);if(o===void 0)return;t.preventDefault(),t.stopPropagation();let s=n[o];s&&(e.radioGroup.onValueChange(s.value),r[o]?.focus())},children:e.radioGroup.items.map(t=>(0,G.jsxs)(KC,{value:t.value,disabled:t.disabled,onSelect:e.radioGroup.segmented?e=>e.preventDefault():void 0,className:df(`flex min-h-8 items-start gap-2.5 rounded-[6px] px-2.5 py-2 font-sans text-13 font-medium leading-(--lh-snug) text-fg-1 data-highlighted:bg-hover data-disabled:pointer-events-none data-disabled:opacity-45 [@media(pointer:coarse)]:min-h-11`,ff,e.radioGroup.segmented&&`min-h-7 flex-1 justify-center px-2 py-1 text-fg-3 data-[state=checked]:bg-raised data-[state=checked]:text-fg-1 data-[state=checked]:shadow-1`),children:[!e.radioGroup.segmented&&(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`,children:(0,G.jsx)(qC,{children:(0,G.jsx)(mf,{icon:Ll,size:14})})}),(0,G.jsxs)(`span`,{className:df(`flex min-w-0 flex-1 flex-col gap-0.5`,e.radioGroup.segmented&&`items-center`),children:[(0,G.jsx)(`span`,{className:`flex items-center gap-1.5`,children:t.label}),t.hint&&(0,G.jsx)(`span`,{className:`text-fg-3 [font:var(--type-meta)]`,children:t.hint})]})]},t.value))},t):`separator`in e?(0,G.jsx)(JC,{className:`-mx-1 my-1 h-px bg-line-1`},t):`heading`in e?(0,G.jsx)(UC,{className:`px-2.5 pt-2 pb-1 font-mono text-11 font-medium leading-(--lh-snug) font-stretch-mono tracking-(--tracking-label) text-fg-3 uppercase`,children:e.heading},t):(0,G.jsxs)(WC,{asChild:e.asChild,disabled:e.disabled,onSelect:e.opensDialog?()=>{s.current=e.onSelect??null}:e.onSelect,title:e.title,className:df(`flex h-8 w-full items-center gap-2.5 rounded-[6px] border-0 bg-transparent px-2.5 text-left font-sans text-13 font-medium leading-(--lh-snug) font-[450] text-fg-1 no-underline hover:text-fg-1 data-highlighted:bg-hover data-disabled:pointer-events-none data-disabled:opacity-45 [@media(pointer:coarse)]:h-11 [&>svg]:text-fg-3`,ff,r===`lg`&&`h-11`,e.danger&&`text-danger-fg hover:text-danger-fg [&>svg]:text-danger-fg`),children:[e.icon&&(0,G.jsx)(mf,{icon:e.icon}),(0,G.jsx)(Ef,{children:e.asChild?e.children:(0,G.jsx)(`span`,{children:e.label})}),e.hint&&(0,G.jsx)(`span`,{className:`ml-auto font-sans text-12 font-normal leading-(--lh-snug) text-fg-3`,children:e.hint}),e.kbd&&(0,G.jsx)(M_,{className:`ml-auto`,children:e.kbd})]},t))})})]})}function XC({options:e,value:t,onChange:n,size:r=`md`,label:i,className:a}){let o=(0,W.useRef)(new Map),s=(0,W.useId)(),c=e.filter(e=>!e.disabled),l=c.some(e=>e.value===t)?t:c[0]?.value;return(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":i,className:df(`inline-flex gap-0.5 rounded-md border border-line-1 bg-sunken p-0.5`,a),children:e.map(e=>{let i=e.disabled&&e.title?`${s}-${e.value}`:void 0,a=(0,G.jsxs)(`button`,{ref:t=>{t?o.current.set(e.value,t):o.current.delete(e.value)},type:`button`,role:`radio`,"aria-checked":e.value===t,tabIndex:e.value===l?0:-1,title:i?void 0:e.title,"aria-describedby":i,disabled:e.disabled,onClick:()=>n?.(e.value),onKeyDown:t=>{let r=pf(t.key,c.indexOf(e),c.length,!0);if(r===void 0)return;t.preventDefault();let i=c[r];i&&(o.current.get(i.value)?.focus(),n?.(i.value))},className:df(`inline-flex h-[26px] items-center gap-1.5 rounded-sm border-0 bg-transparent px-2.5 font-sans text-13 font-medium leading-(--lh-snug) text-fg-3 transition-[background,color] duration-(--dur-1) hover:text-fg-1 aria-checked:bg-raised aria-checked:text-fg-1 aria-checked:shadow-1`,ff,`disabled:cursor-not-allowed disabled:opacity-48 disabled:hover:text-fg-3`,i&&`pointer-events-none`,r===`sm`&&`h-[22px] px-2 text-12 leading-(--lh-snug)`),children:[e.icon&&(0,G.jsx)(mf,{icon:e.icon,size:14}),e.label]},e.value);return i?(0,G.jsxs)(`span`,{title:e.title,className:`inline-flex cursor-not-allowed`,children:[a,(0,G.jsx)(`span`,{id:i,className:`sr-only`,children:e.title})]},e.value):a})})}var ZC=`emend.draft.`,QC=`emend.instruction.`,$C=new Map,ew=new Set,tw=new Map,nw=new Set,rw=new Set;function iw(){for(let e of rw)e()}window.addEventListener(`storage`,e=>{try{if(e.storageArea&&e.storageArea!==localStorage)return}catch{}if(e.key===null)$C.clear();else if(e.key.startsWith(ZC)||e.key.startsWith(QC))$C.set(e.key,e.newValue);else return;iw()});function aw(e,t,n){let r=Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t)));return`emend.draft.${e}.${JSON.stringify(r)}${n?`.reply.${n}`:``}`}function ow(e,t){return`${ZC}${e}.edit.${t}`}function sw(e){return`${QC}${e}`}function cw(e){let t=[],n=`${ZC}${e}.`;try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);t?.startsWith(n)&&uw(t)}}catch{}for(let[e,r]of $C){if(!e.startsWith(n)||r===null)continue;let i=e.slice(n.length),a=/^edit\.([0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})$/i.exec(i);if(a){t.push({key:e,target:null,commentId:a[1]});continue}if(!r)continue;let o=/\.reply\.([0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})$/i.exec(i);try{let n=Uv.parse(JSON.parse(o?i.slice(0,o.index):i));t.push({key:e,target:n,threadId:o?.[1]})}catch{t.push({key:e,target:null})}}return t}function lw(e){return rw.add(e),()=>{rw.delete(e)}}function uw(e){if(!$C.has(e))try{let t=localStorage.getItem(e);$C.set(e,t)}catch{}return $C.get(e)??``}function dw(e){return uw(e),$C.get(e)!=null}function fw(e){return!!uw(e).trim()}function pw(e,t){$C.set(e,t);try{localStorage.setItem(e,t)}catch{try{localStorage.removeItem(e)}catch{}}iw()}function mw(e){$C.set(e,null);try{localStorage.removeItem(e)}catch{}iw()}function hw(e,t){let n=$C.get(e),r=null;try{r=localStorage.getItem(e)}catch{}return n!=null&&n!==t?(pw(e,n),!1):r!=null&&r!==t?($C.set(e,r),iw(),!1):(mw(e),!0)}function gw(){let e=!1;for(let[t,n]of $C)if(n?.trim()){try{if(localStorage.getItem(t)===n)continue}catch{}e=!0;break}return{saving:ew.size>0||tw.size>0,sending:nw.size>0,unstored:e}}function _w(e){return ew.has(e)}function vw(e){return(tw.get(e)??0)>0}function yw(e){return nw.has(e)}function bw(e){return!nw.has(e)&&(nw.add(e),iw(),!0)}function xw(e){nw.delete(e),iw()}function Sw(e){return tw.set(e,(tw.get(e)??0)+1),iw(),()=>{let t=(tw.get(e)??1)-1;t?tw.set(e,t):tw.delete(e),iw()}}function Cw(e){return!ew.has(e)&&(ew.add(e),iw(),!0)}function ww(e){ew.delete(e),iw()}var Tw=Object.defineProperty,Ew=(e,t)=>Tw(e,`name`,{value:t,configurable:!0}),Dw=`Dialog`,[Ow,kw]=Yf(Dw),[Aw,jw]=Ow(Dw),Mw=Ew(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=W.useRef(null),c=W.useRef(null),{nodes:l,registry:u}=Op(),[d,f]=Wg({prop:r,defaultProp:i??!1,onChange:a,caller:Dw}),[p,m]=W.useState(0),[h,g]=W.useState(0);return(0,G.jsx)(Aw,{scope:t,triggerRef:s,contentRef:c,contentId:Gp(),titleId:Gp(),descriptionId:Gp(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:W.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Nw=`DialogTrigger`,Pw=W.forwardRef(Ew(function(e,t){let{__scopeDialog:n,...r}=e,i=jw(Nw,n),a=yf(t,i.triggerRef);return(0,G.jsx)($f.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":$w(i.open),...r,ref:a,onClick:X(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Fw=`DialogPortal`,[Iw,Lw]=Ow(Fw,{forceMount:void 0}),Rw=Ew(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=jw(Fw,t);return(0,G.jsx)(Iw,{scope:t,forceMount:n,children:W.Children.map(r,e=>(0,G.jsx)(Ag,{present:n||a.open,children:(0,G.jsx)(Eg,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),zw=`DialogOverlay`,Bw=W.forwardRef(Ew(function(e,t){let n=Lw(zw,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jw(zw,e.__scopeDialog);return a.modal?(0,G.jsx)(Ag,{present:r||a.open,children:(0,G.jsx)(Hw,{...i,ref:t})}):null},`DialogOverlay`)),Vw=Sf(`DialogOverlay.RemoveScroll`),Hw=W.forwardRef(Ew(function(e,t){let{__scopeDialog:n,...r}=e,i=jw(zw,n),a=yf(t,mp());return(0,G.jsx)(wS,{as:Vw,allowPinchZoom:!0,shards:W.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,G.jsx)($f.div,{"data-state":$w(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Uw=`DialogContent`,Ww=W.forwardRef(Ew(function(e,t){let n=Lw(Uw,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jw(Uw,e.__scopeDialog);return(0,G.jsx)(Ag,{present:r||a.open,children:a.modal?(0,G.jsx)(Gw,{...i,ref:t}):(0,G.jsx)(Kw,{...i,ref:t})})},`DialogContent`)),Gw=W.forwardRef(Ew(function(e,t){let n=jw(Uw,e.__scopeDialog),r=W.useRef(null),i=yf(t,n.contentRef,r);return W.useEffect(()=>{let e=r.current;if(e)return gx(e)},[]),(0,G.jsx)(qw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Kw=W.forwardRef(Ew(function(e,t){let n=jw(Uw,e.__scopeDialog),r=W.useRef(!1),i=W.useRef(!1);return(0,G.jsx)(qw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),qw=W.forwardRef(Ew(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=jw(Uw,n);return kb(),(0,G.jsx)(Dp,{registry:l.branchRegistry,children:(0,G.jsx)(Tp,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,G.jsx)(pp,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Qw(o,l.descriptionId):o,"data-state":$w(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Jw=W.forwardRef(Ew(function(e,t){let{__scopeDialog:n,...r}=e,i=jw(`DialogTitle`,n),{setTitleCount:a}=i;return tp(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,G.jsx)($f.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Yw=W.forwardRef(Ew(function(e,t){let{__scopeDialog:n,...r}=e,i=jw(`DialogDescription`,n),{setDescriptionCount:a}=i;return tp(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,G.jsx)($f.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Xw=`DialogClose`,Zw=W.forwardRef(Ew(function(e,t){let{__scopeDialog:n,...r}=e,i=jw(Xw,n);return(0,G.jsx)($f.button,{type:`button`,...r,ref:t,onClick:X(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Qw(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ew(Qw,`concatAriaDescribedby`);function $w(e){return e?`open`:`closed`}Ew($w,`getState`);var eT=`fixed inset-0 z-(--z-sheet) animate-[em-fade_var(--dur-2)_var(--ease-out)] bg-overlay`;function tT(e){return e.target instanceof Element&&e.target.closest(`[data-emend-toast]`)!==null}function nT({title:e,description:t,actions:n,children:r,open:i,onOpenChange:a,onInteractOutside:o,returnFocus:s,preferReturnFocus:c=!1}){let l=(0,W.useRef)(null),u=(0,W.useRef)(null);return(0,G.jsx)(Mw,{open:i,onOpenChange:a,children:(0,G.jsxs)(Rw,{children:[(0,G.jsx)(Bw,{className:eT}),(0,G.jsxs)(Ww,{ref:l,role:`alertdialog`,onInteractOutside:e=>{tT(e)?e.preventDefault():o?.(e)},onOpenAutoFocus:e=>{u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let t=l.current?.querySelector(`[data-autofocus]`);t&&(e.preventDefault(),t.focus())},onCloseAutoFocus:e=>{let t=(c&&s?.current?.isConnected?s.current:null)??(u.current?.isConnected?u.current:s?.current);t&&(e.preventDefault(),t.focus())},className:`fixed top-1/2 left-1/2 z-[calc(var(--z-sheet)+1)] flex max-h-[85dvh] w-[min(440px,92%)] -translate-x-1/2 -translate-y-1/2 animate-[em-fade_var(--dur-2)_var(--ease-out)] flex-col overflow-y-auto rounded-xl border border-line-1 bg-surface shadow-3`,children:[(0,G.jsxs)(`div`,{className:`px-5 pt-5 pb-1`,children:[(0,G.jsx)(Jw,{className:`m-0 mb-1.5 font-sans text-18 font-semibold leading-(--lh-snug) text-fg-1`,children:e}),(0,G.jsx)(Yw,{className:`m-0 font-sans text-14 font-normal leading-(--lh-body) text-pretty text-fg-2`,children:t}),r]}),(0,G.jsx)(`div`,{className:`flex justify-end gap-2 px-5 pt-4 pb-5`,children:n})]})]})})}var rT=new WeakMap;function iT(e){let t=0,n=[],r=new Set,i=new Map,a=e=>{n=e;for(let e of r)e()};return e.getQueryCache().subscribe(e=>{if(e.type!==`updated`||e.action.type!==`success`||e.action.manual)return;let[t,r,o]=e.query.queryKey;if(t!==`revision`)return;let s=i.get(`${r}:${o}`);if(s===void 0)return;i.delete(`${r}:${o}`);let c=n.filter(e=>!(e.reviewId===r&&e.body.revision===o&&e.status===`success`&&e.settled!==void 0&&s>e.settled));c.length!==n.length&&a(c)}),{subscribe(e){return r.add(e),()=>{r.delete(e)}},snapshot:()=>n,start(e,r){let i=++t;return a([...n,{id:i,reviewId:e,body:r,status:`pending`}]),i},settle(e,r){let i=n.find(t=>t.id===e);if(!i)return;let o=++t,s=new Set(i.body.paths);a(n.flatMap(t=>{if(t.id===e)return[{...t,settled:o,status:r?`error`:`success`,...r?{error:r,failedPaths:t.body.paths}:{}}];if(!r&&t.reviewId===i.reviewId&&t.id<e&&t.status===`error`){let e=t.failedPaths?.filter(e=>!s.has(e))??[];return e.length?[{...t,failedPaths:e}]:[]}return[t]}))},dismiss(e){a(n.filter(t=>t.id!==e||t.status!==`error`))},async fetch(e,n,r,a){let o=++t,s=await a();return r.aborted||i.set(`${e}:${n}`,o),s}}}function aT(e){let t=rT.get(e);return t||(t=iT(e),rT.set(e,t)),t}function oT(e,t,n=`${t}s`){return e===1?t:n}function sT(e){return e.normalize(`NFC`).replace(/[\p{White_Space}]+/gu,` `).trim()}function cT(e,t){if(t.length===0||t.length>e.length)return[];let n=Array(t.length).fill(0),r=0;for(let e=1;e<t.length;e++){for(;r>0&&t[e]!==t[r];)r=n[r-1]??0;t[e]===t[r]&&r++,n[e]=r}let i=[];r=0;for(let a=0;a<e.length;a++){for(;r>0&&e[a]!==t[r];)r=n[r-1]??0;if(e[a]===t[r]&&r++,r===t.length){if(i.push(a-t.length+1),i.length===2)break;r=n[r-1]??0}}return i}function lT(e,t,n){let r=sT(e.text);if(!Number.isInteger(t)||!Number.isInteger(n)||t<0||n<=t||n>r.length||n-t>Z.quoteChars)throw RangeError(`Span offsets must select a nonempty quote within the normalized block and quote limit`);return{blockId:e.id,quote:r.slice(t,n),prefix:r.slice(Math.max(0,t-Z.prefixSuffixChars),t),suffix:r.slice(n,n+Z.prefixSuffixChars)}}function uT(e,t,n=!0){let r=n?t.prefix+t.quote+t.suffix:t.quote,i=n?t.prefix.length:0;return cT(e,r).map(e=>({start:e+i,end:e+i+t.quote.length}))}function dT(e,t){let n=(e,n)=>({status:`placed`,location:t.kind===`doc-span`?{kind:t.kind,path:t.path,blockId:e.id,...n}:{kind:t.kind,blockId:e.id,...n}}),r=e.find(e=>e.id===t.blockId);if(r){let e=sT(r.text);if(r.kind===`diagram`)return n(r,{start:0,end:e.length});let i=uT(e,t,!1),a=i.length===1?i:uT(e,t);if(a.length===1&&a[0])return n(r,a[0])}let i;for(let r of e)for(let e of uT(sT(r.text),t)){if(i)return{status:`unplaced`,reason:`ambiguous`};i=n(r,e)}return i??{status:`unplaced`,reason:`block-gone`}}function fT(e,t){if(e.seq!==t.revision)return e;let n=new Set(t.paths);return{...e,files:e.files.map(e=>{if(e.role!==`diff`||!n.has(e.path))return e;let{viewed:r,viewedOn:i,...a}=e;return t.viewed?{...a,viewed:`viewed`,viewedOn:t.revision}:a})}}function pT(e){let t=aT(Xs()),n=(0,W.useSyncExternalStore)(t.subscribe,t.snapshot);return(0,W.useMemo)(()=>n.filter(t=>t.reviewId===e),[n,e])}function mT(e){let t=aT(Xs());return{errors:pT(e).filter(e=>e.status===`error`),dismiss:t.dismiss}}function hT(e,t){let n=pT(e);return(0,W.useMemo)(()=>t&&n.reduce((e,t)=>t.status===`error`?e:fT(e,t.body),t),[t,n])}function gT(e){let t=Xs(),n=aT(t);return ml({scope:{id:`viewed:${e}`},mutationFn:t=>Ty(`/api/v1/reviews/${encodeURIComponent(e)}/viewed`,`PUT`,t),onMutate:t=>n.start(e,t),onSettled:(r,i,a,o)=>{o!==void 0&&n.settle(o,i),My(t,[[`revision`,e]],{settled:!0})}})}function _T(e){return e instanceof xy&&e.code===`stale_revision`?`This page is out of date. Reload to see the newest revision.`:e instanceof xy?e.message:`The request failed. Try again.`}function vT(e){let t=Xs();return ml({mutationFn:async n=>{let r=`/api/v1/reviews/${encodeURIComponent(e)}`;n.action===`delete`?(await Ty(r,`DELETE`),t.invalidateQueries({queryKey:[`inbox`]})):(await Ty(`${r}/${n.action}`,`POST`,`body`in n?n.body:void 0),t.invalidateQueries({queryKey:[`review`,e]}),t.invalidateQueries({queryKey:[`inbox`]}))},onError:n=>{n instanceof xy&&n.code===`unsent_comments`&&(t.invalidateQueries({queryKey:[`review`,e]}),t.invalidateQueries({queryKey:[`inbox`]}))}})}function yT(e,t,n){let r=e=>n===`approve`?{...e,state:`approved`,list:`done`}:{...e,unsentCount:0,pendingSend:!0};e.setQueryData([`review`,t],e=>e?.id===t?r(e):e),e.setQueryData([`inbox`],e=>Array.isArray(e?.items)?{...e,items:e.items.map(e=>e.id===t?r(e):e)}:e)}function bT(e,t){let n=Xs(),r=(0,W.useSyncExternalStore)(lw,()=>t?_w(t):!1),i=ml({mutationFn:async({path:t,method:r=`POST`,body:i,draft:a,deleteDraft:o,refresh:s=`await`,accepted:c})=>{if(a&&!Cw(a.key))throw Error(`This draft is already saving.`);let l=a||o?Sw(e):void 0;try{let l;try{try{l=await Ty(t,r,i)}catch(t){throw s===`background`&&(n.invalidateQueries({queryKey:[`review`,e]}).catch(()=>void 0),n.invalidateQueries({queryKey:[`inbox`]}).catch(()=>void 0)),t}c&&yT(n,e,c),a&&hw(a.key,a.text),o&&mw(o)}finally{a&&ww(a.key)}let u=Promise.all([n.invalidateQueries({queryKey:[`revision`,e]}),n.invalidateQueries({queryKey:[`review`,e]}),n.invalidateQueries({queryKey:[`inbox`]})]);return s===`background`?u.catch(()=>void 0):await u,l}finally{l?.()}}});return{...i,isPending:r||i.isPending}}function xT(e){return e.filter(e=>e.slug!==V_.slug).map((e,t)=>({topic:e,rank:t+1}))}function ST(e){return e.kind===`lines`||e.kind===`file`||e.kind===`topic`}function CT(e,t){let n=e.filter(e=>e.role===`diff`?t.kind===`file`?t.path===e.path:t.kind===`lines`?t.side===`old`?e.hasOld&&e.status!==`added`&&t.path===(e.oldPath??e.path):t.side===`new`&&e.hasNew&&t.path===e.path:!1:!1);return n.length===1?n[0]:void 0}function wT(e,t=[]){switch(e.kind){case`writeup-span`:{let n=/^t-(.+)-(?:why|example|body)-[\da-f]{8}(?:-\d+)?$/.exec(e.blockId)?.[1],r=t.find(e=>e.slug===n)?.title??Object.entries({overview:`Overview`,tldr:`TL;DR`,decisions:`Decisions`,glossary:`Glossary`}).find(([t])=>e.blockId.startsWith(`${t}-`))?.[1];return{label:r?`Writeup · ${r}`:`Writeup`,icon:xu}}case`doc-span`:case`html-span`:return{label:e.path,icon:xu};case`lines`:return{label:`${e.path} · ${oT(e.end-e.start+1,`line`)} ${e.start===e.end?e.start:`${e.start}–${e.end}`}${e.side===`old`?` (old)`:``}`,icon:Yl};case`file`:return{label:e.path,icon:Zl};case`topic`:{let n=t.find(t=>t.slug===e.slug),r=xT(t).find(t=>t.topic.slug===e.slug)?.rank;return{label:`Topic${r?` ${String(r).padStart(2,`0`)}`:``} · ${n?.title??e.slug}`,icon:tu}}case`review`:return{label:`Whole review`,icon:lu}}}function TT(e){let t=new Map;for(let n of e.topics.toSorted((e,t)=>e.importance-t.importance))t.set(n.slug,{topic:n,files:[]});let n=t.get(V_.slug)??{topic:{...V_,importance:0,summary:``},files:[]};n.topic={...n.topic,title:V_.title},t.delete(V_.slug);for(let r of e.files.filter(e=>e.role===`diff`).toSorted((e,t)=>e.order-t.order))(t.get(r.topic??``)??n).files.push(r);return(n.files.length||e.topics.some(e=>e.slug===V_.slug))&&t.set(V_.slug,n),t}var ET={added:{letter:`A`,color:`text-success-fg`},modified:{letter:`M`,color:`text-warning-fg`},deleted:{letter:`D`,color:`text-danger-fg`},renamed:{letter:`R`,color:`text-info-fg`},"mode-changed":{letter:`T`,color:`text-fg-3`}};function DT({status:e}){let t=e&&ET[e],n=e?.replaceAll(`-`,` `);return t?(0,G.jsxs)(`span`,{title:n,className:`shrink-0 font-mono text-11 font-semibold font-stretch-mono ${t.color}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:t.letter}),(0,G.jsx)(`span`,{className:`sr-only`,children:n})]}):null}function OT({count:e}){return e>0?(0,G.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1`,title:`${e} ${oT(e,`thread`)}`,children:[(0,G.jsx)(mf,{icon:lu,size:12}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:e}),(0,G.jsxs)(`span`,{className:`sr-only`,children:[e,` `,oT(e,`thread`)]})]}):null}function kT({rank:e,current:t=!1}){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`inline-grid h-5 min-w-[22px] shrink-0 place-items-center rounded-sm px-1 font-mono text-11 font-semibold leading-none font-stretch-mono tabular-nums ${t?`bg-topic-solid text-topic-on-solid`:`bg-topic-bg text-topic-fg`}`,children:String(e).padStart(2,`0`)})}function AT({state:e,viewedOn:t,label:n,showLabel:r=!1,disabled:i,onToggle:a}){let o=e===`viewed`,s=e===`stale`,c=`Viewed in revision ${t??`unknown`}; this revision differs. Mark ${n} as viewed`;return(0,G.jsxs)(`button`,{type:`button`,className:`em-viewed-mark`,"aria-pressed":o,"aria-label":s?c:`${o?`Unmark`:`Mark`} ${n} as viewed`,title:s?c:o?`Viewed. Click to unmark`:`Mark as viewed`,"data-stale":s||void 0,disabled:i,onClick:a,children:[(0,G.jsx)(`span`,{className:`em-viewed-mark__box`,"aria-hidden":`true`,children:o?(0,G.jsx)(mf,{icon:Ll,size:11}):s?(0,G.jsx)(mf,{icon:_u,size:10}):null}),s?(0,G.jsx)(`span`,{className:`em-viewed-mark__stale`,children:`changed`}):r?(0,G.jsx)(`span`,{children:`Viewed`}):null]})}function jT(e){(0,W.useEffect)(()=>{let t=typeof window>`u`?void 0:window.visualViewport;if(!e||!t)return;let n=0,r=0,i=[`--keyboard-inset`,`--visual-height`,`--sheet-safe-bottom`],a=()=>{if(n=0,t.scale>1.01){for(let t of i)e.style.removeProperty(t);r=0;return}let a=Math.max(0,Math.round(window.innerHeight-t.height-t.offsetTop));if(e.style.setProperty(`--keyboard-inset`,`${a}px`),e.style.setProperty(`--visual-height`,`${Math.round(t.height)}px`),a>0?e.style.setProperty(`--sheet-safe-bottom`,`0px`):e.style.removeProperty(`--sheet-safe-bottom`),a===r||(r=a,a===0))return;let o=document.activeElement;o instanceof HTMLElement&&o!==e&&e.contains(o)&&o.scrollIntoView({block:`nearest`})},o=()=>{n||=requestAnimationFrame(a)};return t.addEventListener(`resize`,o),t.addEventListener(`scroll`,o),o(),()=>{t.removeEventListener(`resize`,o),t.removeEventListener(`scroll`,o),n&&cancelAnimationFrame(n);for(let t of i)e.style.removeProperty(t)}},[e])}var MT={right:`inset-y-0 right-0 w-[min(400px,92%)] rounded-l-xl border-l border-line-1 animate-[em-sheet-right_var(--dur-3)_var(--ease-out)]`,left:`inset-y-0 left-0 w-[min(340px,92%)] rounded-r-xl border-r border-line-1 animate-[em-sheet-left_var(--dur-3)_var(--ease-out)]`,bottom:`inset-x-0 bottom-[var(--keyboard-inset,0px)] max-h-[calc(var(--visual-height,100dvh)*0.85)] rounded-t-xl pb-[var(--sheet-safe-bottom,env(safe-area-inset-bottom))] animate-[em-sheet-up_var(--dur-3)_var(--ease-out)]`};function NT({side:e=`right`,title:t,description:n,footer:r,trigger:i,children:a,open:o,onOpenChange:s,onInteractOutside:c,initialFocus:l,returnFocus:u,onClosed:d}){let f=(0,W.useRef)(null),p=(0,W.useRef)(null),[m,h]=(0,W.useState)(null),g=(0,W.useCallback)(e=>{f.current=e,h(e)},[]);return jT(e===`bottom`?m:null),(0,G.jsxs)(Mw,{open:o,onOpenChange:s,children:[i&&(0,G.jsx)(Pw,{asChild:!0,children:i}),(0,G.jsxs)(Rw,{children:[(0,G.jsx)(Bw,{className:eT}),(0,G.jsxs)(Ww,{ref:g,onInteractOutside:e=>{tT(e)?e.preventDefault():c?.(e)},onOpenAutoFocus:e=>{p.current=!i&&o!==void 0&&document.activeElement instanceof HTMLElement?document.activeElement:null,e.preventDefault(),(l?.current??f.current)?.focus()},onCloseAutoFocus:e=>{let t=u?.()??p.current;!i&&t?.isConnected&&(e.preventDefault(),t.focus({preventScroll:!0})),d?.()},...n?{}:{"aria-describedby":void 0},className:df(`fixed z-[calc(var(--z-sheet)+1)] flex flex-col bg-surface text-fg-1 shadow-3`,MT[e]),children:[e===`bottom`&&(0,G.jsx)(`div`,{"data-sheet-grab":!0,"aria-hidden":`true`,className:`mx-auto mt-2 h-1 w-9 shrink-0 rounded-[2px] bg-line-2`}),(0,G.jsxs)(`header`,{className:`flex min-h-[52px] shrink-0 items-center gap-2 border-b border-line-1 py-1.5 pr-2 pl-4`,children:[(0,G.jsx)(Jw,{className:`m-0 flex-1 font-sans text-15 font-semibold leading-(--lh-snug) text-fg-1`,children:t}),(0,G.jsx)(Zw,{asChild:!0,children:(0,G.jsx)(I_,{label:`Close`,icon:ku,size:e===`bottom`?`lg`:`md`,tooltip:!1})})]}),(0,G.jsxs)(`div`,{className:`relative min-h-0 flex-1 space-y-4 overflow-auto p-4`,children:[n&&(0,G.jsx)(Yw,{className:`m-0 font-sans text-14 font-normal leading-(--lh-body) text-fg-2`,children:n}),a]}),r&&(0,G.jsx)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-line-1 px-4 py-3`,children:r})]})]})]})}var PT=new Set,FT=new Map,IT=new Set,LT=`emend-comment`,RT=`emend-comment-active`;function zT(){return typeof CSS<`u`&&!!CSS.highlights&&typeof Highlight<`u`&&typeof Intl<`u`&&typeof Intl?.Segmenter==`function`}function BT(){let e=new Set;for(let[t,n]of FT){let r=t.contains(t.ownerDocument.activeElement);t.classList.contains(`em-card`)&&t.toggleAttribute(`data-focus-within`,r);let i=n.hovered||r;i&&n.threadId!==null&&e.add(n.threadId),i!==n.active&&(n.active=i,n.onActivity?.(i))}IT=e}function VT(){let e=new Set(IT);for(let t of PT)t.activeThreadId&&e.add(t.activeThreadId);return e}function HT(){for(let e of[LT,RT])try{CSS.highlights.delete(e)}catch{}}function UT(){if(!zT())return;if(BT(),!PT.size){HT();return}let e=VT();try{let t=new Highlight,n=new Highlight;n.priority=1;for(let r of PT)for(let i of r.blocks)try{for(let[r,a]of i)(e.has(r)?n:t).add(a)}catch{for(let e of i.values())t.delete(e),n.delete(e)}CSS.highlights.set(LT,t),CSS.highlights.set(RT,n)}catch{HT()}}function WT(e){if(!zT())return;let t={blocks:e};return PT.add(t),UT(),{setActiveThread(e){t.activeThreadId!==e&&(t.activeThreadId=e,UT())},unregister(){PT.delete(t),UT()}}}function GT(){let e=VT();BT();let t=VT();(e.size!==t.size||[...t].some(t=>!e.has(t)))&&UT()}function KT(e,t,n){if(!e.classList.contains(`em-card`)&&(t===null||!zT())&&!n)return;let r={threadId:t,hovered:!1,active:!1,onActivity:n};FT.size||document.addEventListener(`focusin`,GT,!0),FT.set(e,r);let i=e=>{e.pointerType!==`touch`&&(r.hovered=!0,GT())},a=()=>{r.hovered=!1,GT()},o=t=>{t.relatedTarget instanceof Node&&e.contains(t.relatedTarget)||(GT(),e.removeAttribute(`data-focus-within`))};return e.addEventListener(`pointerenter`,i),e.addEventListener(`pointerleave`,a),e.addEventListener(`focusout`,o),GT(),()=>{e.removeEventListener(`pointerenter`,i),e.removeEventListener(`pointerleave`,a),e.removeEventListener(`focusout`,o),FT.delete(e),e.removeAttribute(`data-focus-within`),r.active&&n?.(!1),FT.size||document.removeEventListener(`focusin`,GT,!0),GT()}}var qT=(0,W.createContext)(null),JT=new Map,YT=new Map,XT=new Set,ZT=0;function QT(){ZT++;for(let e of XT)e()}function $T(e){return XT.size||document.addEventListener(`focusin`,iE),XT.add(e),()=>{XT.delete(e),XT.size||document.removeEventListener(`focusin`,iE)}}var eE=()=>ZT;function tE(e){let t=JT.get(e);return t||(t={members:new Map,cards:new Set},JT.set(e,t)),t}function nE(){let e=!1;for(let[t,n]of JT)n.handoff&&(n.claim===n.handoff&&(n.claim=void 0),n.handoff=void 0,n.cards.size||n.members.size||n.claim||n.release||JT.delete(t),e=!0);e&&QT()}function rE(e){let t=!1;for(let[n,{claim:r}]of JT){if(!r?.pendingFocus)continue;let i=n!==e&&r.pendingFocus!==e;!!r.focusCancelled!==i&&(r.focusCancelled=i,t=!0)}t&&QT()}function iE(e){(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&rE(e.target)}function aE(e,t){let n=YT.get(e);n&&(n.dismissed=!1),rE(),nE();let r=tE(e);r.release=void 0,r.claim={surface:t},r.replyOpen=!0,QT()}function oE(e){let t=JT.get(e);t&&t.replyOpen!==!1&&(t.replyOpen=!1,t.claim=void 0,t.handoff=void 0,QT())}function sE(e){let t=(0,W.useId)();(0,W.useSyncExternalStore)($T,eE,eE);let n=JT.get(e)?.replyOpen??fw(e);return(0,W.useLayoutEffect)(()=>{let n=tE(e);n.release=void 0,n.cards.add(t),n.replyOpen??=fw(e),QT();let r=lw(()=>{_w(e)&&!dw(e)&&oE(e)});return()=>{if(r(),n.cards.delete(t),!n.cards.size){let t={};n.release=t,queueMicrotask(()=>{n.release===t&&(n.release=void 0,n.replyOpen=void 0,n.members.size||n.claim||n.handoff||JT.get(e)!==n||JT.delete(e),QT())})}QT()}},[e,t]),{open:n,close:()=>oE(e)}}function cE(e){return!YT.get(e)?.dismissed}function lE(e){let t=(0,W.useId)();return(0,W.useSyncExternalStore)($T,eE,eE),(0,W.useLayoutEffect)(()=>{let n=YT.get(e)??{dismissed:!1,cards:new Set};return YT.set(e,n),n.cards.add(t),()=>{n.cards.delete(t),n.cards.size||YT.delete(e)}},[e,t]),{open:cE(e),close:()=>{let t=YT.get(e);t&&(t.dismissed=!0),QT()}}}function uE(e,t){return(0,W.useSyncExternalStore)($T,eE,eE),(typeof e==`string`?[e]:e).map(e=>JT.get(e)?.claim).find(e=>e?.surface===t&&!e.id)}function dE(e,t,n,r,i){let a=(0,W.useContext)(qT),o=(0,W.useId)(),s=(0,W.useRef)(null),c=(0,W.useRef)(void 0);(0,W.useSyncExternalStore)($T,eE,eE),(0,W.useLayoutEffect)(()=>{let n=tE(e);return n.members.set(o,t),n.handoff&&=(n.claim={surface:t,id:o},void 0),QT(),()=>{if(n.members.delete(o),n.claim?.id===o){if(s.current&&document.activeElement===s.current){let t=n.claim;n.handoff=t,setTimeout(()=>{n.handoff===t&&(n.handoff=void 0,n.claim===t&&(n.claim=void 0),n.cards.size||n.members.size||n.release||JT.get(e)!==n||JT.delete(e),QT())},0)}else n.claim=void 0}n.cards.size||n.release||n.handoff||n.members.size||n.claim&&n.claim.surface!==t||JT.delete(e),QT()}},[e,t,o]);let l=JT.get(e),u=l?.claim,d=u?u.id?u.id===o:u.surface===t&&[...l?.members.values()??[]].filter(e=>e===t).length<=1:(l?.members.size??0)<=1;return(0,W.useLayoutEffect)(()=>{if(d&&u?.pendingFocus&&s.current&&(u.pendingFocus=s.current),!d||!u||u.focusCancelled||c.current===u||!s.current)return;let e=s.current.closest(`.em-composer`);if(t===`diff`&&a&&!a({target:n,elementId:r?`diff-thread-${r}`:void 0,commentId:i,element:e??void 0}))u.pendingFocus=s.current;else if(!(t===`diff`&&s.current.closest(`[hidden]`))){if(u.pendingFocus=void 0,u.id||(u.id=o,QT()),c.current=u,t!==`diff`||!a){let t=s.current.closest(`[data-thread-card], [data-diff-section]`);t?t.scrollIntoView?.({block:`center`}):e?.scrollIntoView?.({block:`nearest`})}s.current.focus({preventScroll:!0})}}),{owns:d,claim:()=>{if(rE(e),nE(),l?.claim?.id===o||d&&l?.claim?.surface===t)return;let n=tE(e);n.claim={surface:t,id:o},QT()},input:s}}function fE(e,t){let n=e.slice(0,t);return/[\uD800-\uDBFF]$/.test(n)?n.slice(0,-1):n}function pE(e){return{blockId:e.id,quote:fE(sT(e.text),Z.quoteChars),prefix:``,suffix:``}}function mE(e,t){if(e.isCollapsed||e.rangeCount!==1)return{error:`empty`};let n=e.getRangeAt(0),r=e=>(e instanceof Element?e:e.parentElement)?.closest(`[data-block-id]`),i=r(n.startContainer),a=r(n.endContainer);if(!i||!a||!t.contains(i)||!t.contains(a))return{error:`empty`};if(i!==a)return{error:`cross-block`};let o=i.dataset.blockId,s=i.dataset.blockText;if(!o||s===void 0)return{error:`empty`};if(i.dataset.blockKind===`diagram`)return sT(s)?pE({id:o,text:s}):{error:`empty`};let c=sT(n.toString());if(c.length>Z.quoteChars)return{error:`too-long`};if(c.length===0||!c.isWellFormed())return{error:`empty`};let l=n.cloneRange();l.selectNodeContents(i),l.setEnd(n.endContainer,n.endOffset);let u=sT(l.toString()).length,d=u-c.length;if(d<0||sT(s).slice(d,u)!==c)return{error:`empty`};let f=lT({id:o,text:s,html:``,kind:`paragraph`,section:``},d,u);return/^[\uDC00-\uDFFF]/.test(f.prefix)&&(f.prefix=f.prefix.slice(1)),f.suffix=fE(f.suffix,Z.prefixSuffixChars),f}function hE(){let e=new Map,t={deletions:new Map,additions:new Map,unified:new Map},n=new Set,r,i=()=>{if(!r)return;let i=new Set;for(let{side:n,start:a,end:o}of e.values())for(let e=a;e<=o;e++){let a=r.getLineIndex(e,n);if(!a?.every(e=>Number.isSafeInteger(e)&&e>=0))continue;let o=a.join(`,`),s=t[n].get(o)??t.unified.get(o);s&&i.add(s)}for(let e of n)i.has(e)||e.removeAttribute(`data-comment-active`);for(let e of i)n.has(e)||e.setAttribute(`data-comment-active`,``);n=i};return{setActive(t,n){n?e.set(t,n):e.delete(t),i()},postRender:((e,a,o)=>{for(let e of n)e.removeAttribute(`data-comment-active`);n.clear();for(let e of Object.values(t))e.clear();if(r=o!==`unmount`&&e.shadowRoot?a:void 0,r){for(let n of e.shadowRoot?.querySelectorAll(`[data-column-number][data-line-index]`)??[]){let e=n.getAttribute(`data-line-index`)??``,r=n.closest(`[data-deletions], [data-additions], [data-unified]`);r?.hasAttribute(`data-deletions`)?t.deletions.set(e,n):r?.hasAttribute(`data-additions`)?t.additions.set(e,n):r?.hasAttribute(`data-unified`)&&t.unified.set(e,n)}i()}})}}var gE=(0,W.createContext)(null);function _E(e,t){let n=(0,W.useContext)(gE),{kind:r,side:i,start:a,end:o}=t??{};return(0,W.useLayoutEffect)(()=>()=>queueMicrotask(GT),[]),(0,W.useCallback)(t=>{if(!t)return;let s=r===`lines`&&(i===`old`||i===`new`)&&a!==void 0&&o!==void 0&&Number.isSafeInteger(a)&&Number.isSafeInteger(o)&&a>0&&o>=a&&o-a<Z.targetLines?{side:i===`old`?`deletions`:`additions`,start:a,end:o}:null;return KT(t,e,n&&s?e=>n.setActive(t,e?s:null):void 0)},[e,n,r,i,a,o])}function vE({reviewId:e,revision:t,target:n,topics:r,threadId:i,commentId:a,storageKey:o,onSaved:s,onCancel:c,onDismiss:l,returnFocus:u,surface:d=`reading`,wrap:f,placeholder:p=!0,embedded:m=!1}){let h=o??(a?ow(e,a):aw(e,n,i)),g=dE(h,d,n,i,a),_=Qy()===`phone`,v=(0,W.useRef)(!1);(0,W.useLayoutEffect)(()=>{if(v.current=!1,_)return lw(()=>{_w(h)&&!dw(h)&&(v.current=!0)})},[h,_]);let y=c?()=>{v.current=!1,!a&&!uw(h).trim()&&mw(h),c()}:void 0;if(!g.owns)return p?(0,G.jsx)(ib,{variant:`ghost`,size:`sm`,"data-composer-placeholder":!0,onClick:g.claim,onFocus:g.claim,children:a?`Edit`:i?`Reply`:`Comment`}):null;let b=(0,G.jsx)(yE,{inputRef:g.input,onFocus:g.claim,storageKey:h,reviewId:e,revision:t,target:n,topics:r,phone:_,embedded:m,threadId:i,commentId:a,onSaved:s,onCancel:y,onDismiss:l??y},h);return _?(0,G.jsx)(NT,{side:`bottom`,title:a?`Edit comment`:i?`Reply`:`New comment`,open:!0,initialFocus:g.input,returnFocus:()=>u?.(v.current)??null,onOpenChange:e=>{!e&&!_w(h)&&(l??y)?.()},children:b}):f?f(b):b}function yE({phone:e,embedded:t,inputRef:n,onFocus:r,storageKey:i,reviewId:a,revision:o,target:s,topics:c,threadId:l,commentId:u,onSaved:d,onCancel:f,onDismiss:p}){let m=(0,W.useSyncExternalStore)(lw,()=>uw(i)),h=(0,W.useId)(),g=bT(a,i),{label:_,icon:v}=wT(s,c),y=u?`Save changes`:`Save comment`,b=/Mac|iPhone|iPad|iPod/.test(navigator.platform)?`⌘↵`:`Ctrl ↵`,x=t&&!e,S=_E(null,!x&&!e?s:null);return(0,G.jsxs)(`form`,{ref:S,className:`em-composer ${e?`em-composer--sheet`:x?`em-composer--inline`:`em-card`}`,"data-state":`draft`,"data-reply":x&&!u?``:void 0,onKeyDown:t=>{t.key===`Escape`&&p&&!e&&(t.preventDefault(),t.stopPropagation(),!g.isPending&&!_w(i)&&p()),t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&!t.nativeEvent.isComposing&&t.nativeEvent.keyCode!==229&&(t.preventDefault(),t.currentTarget.requestSubmit())},onSubmit:e=>{e.preventDefault(),!(!m.trim()||m.length>Z.commentBodyChars||g.isPending||_w(i))&&g.mutate({path:u?`/api/v1/comments/${encodeURIComponent(u)}`:l?`/api/v1/threads/${encodeURIComponent(l)}/comments`:`/api/v1/reviews/${encodeURIComponent(a)}/threads`,method:u?`PATCH`:`POST`,body:u||l?{body:m}:{revision:o,target:s,body:m},draft:{key:i,text:m}},{onSuccess:()=>{dw(i)||d?.()}})},children:[!x&&(0,G.jsxs)(`header`,{className:`em-card__head`,children:[(0,G.jsxs)(`span`,{className:`em-card__target em-composer__target`,title:_,children:[(0,G.jsx)(mf,{icon:v,size:13}),(0,G.jsxs)(`span`,{children:[u?`Edit · `:l?`Reply · `:``,_]})]}),(0,G.jsx)(`span`,{className:`em-card__pill`,"data-state":`draft`,children:u?`Editing`:l?`Reply`:`New comment`})]}),(0,G.jsxs)(`div`,{className:`em-card__body`,children:[!x&&`quote`in s&&(0,G.jsx)(`p`,{className:`em-thread-quote line-clamp-3`,children:(0,G.jsx)(`mark`,{children:s.quote})}),(0,G.jsx)(`label`,{htmlFor:h,className:`sr-only`,children:u?`Edit comment`:l?`Reply`:`Comment`}),(0,G.jsx)(`textarea`,{ref:n,onFocus:r,id:h,"data-reply-composer":l?!0:void 0,className:`em-composer__input`,placeholder:u?void 0:`Comment. Saved as unsent until you press Send.`,maxLength:Z.commentBodyChars,value:m,onChange:e=>{pw(i,fE(e.target.value,Z.commentBodyChars))}}),g.error&&(0,G.jsx)(`p`,{role:`alert`,children:_T(g.error)})]}),(0,G.jsxs)(`div`,{className:`em-card__foot em-composer__foot`,children:[(0,G.jsxs)(`span`,{className:`em-composer__hint`,children:[(0,G.jsx)(mf,{icon:au,size:12}),`Draft kept in this browser`]}),f&&(0,G.jsx)(ib,{variant:`ghost`,size:e?`lg`:`sm`,disabled:g.isPending,onClick:f,children:`Cancel`}),(0,G.jsx)(ib,{type:`submit`,variant:`primary`,size:e?`lg`:`sm`,kbd:e?void 0:b,"aria-label":y,disabled:!m.trim()||m.length>Z.commentBodyChars||g.isPending,children:y})]})]})}function bE(e){let t=gl({warn:!1}),n=(0,W.useCallback)(e=>t?.subscribe(`onResolved`,e)??(()=>{}),[t]);return(0,W.useSyncExternalStore)(n,()=>t?.state.location.hash===e)}function xE({source:e}){return(0,G.jsx)(SE,{source:e},e)}function SE({source:e}){let t=(0,W.useRef)(!1),n=(0,W.useRef)(null),[r,i]=(0,W.useState)(160);return(0,W.useEffect)(()=>{let e=e=>{if(!n.current?.contentWindow||e.source!==n.current.contentWindow)return;let t=e.data;!t||typeof t!=`object`||!(`type`in t)||t.type!==`size`||!(`height`in t)||typeof t.height!=`number`||!Number.isFinite(t.height)||t.height<1||t.height>1e4||i(t.height)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]),(0,G.jsxs)(`div`,{className:`relative space-y-2 overflow-auto rounded-md bg-sunken p-3.5`,children:[(0,G.jsx)(`iframe`,{ref:n,title:`Diagram`,loading:`lazy`,src:`/mermaid-frame.html`,sandbox:`allow-scripts`,className:`w-full border-0 bg-transparent`,style:{height:r},onLoad:()=>{t.current||(t.current=!0,n.current?.contentWindow?.postMessage({type:`render`,source:e},`*`))}}),(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-fg-3 [font:var(--type-meta)]`,children:`Diagram source`}),(0,G.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap break-words font-mono text-12 font-stretch-mono text-fg-2`,children:e})]})]})}function CE({html:e}){return(0,G.jsx)(`div`,{className:`em-prose em-comment-html`,dangerouslySetInnerHTML:{__html:e}})}function wE({block:e}){let t={id:`block-${e.id}`,"data-block-id":e.id,"data-block-kind":e.kind,"data-block-text":e.text};return e.kind===`diagram`?(0,G.jsx)(`div`,{...t,children:(0,G.jsx)(xE,{source:e.source??e.text})}):(0,G.jsx)(`div`,{...t,className:`em-prose`,dangerouslySetInnerHTML:{__html:e.html}})}var TE=(0,W.createContext)(null);function EE(e){let t=(0,W.useContext)(TE);(0,W.useLayoutEffect)(()=>{if(e)return t?.()},[t,e])}function DE({revision:e}){return(0,G.jsxs)(`span`,{className:`inline-flex h-5 items-center gap-[5px] whitespace-nowrap rounded-sm bg-changed-bg pr-[7px] pl-1.5 font-mono text-[10.5px] font-medium leading-none font-stretch-mono text-changed-fg`,children:[(0,G.jsx)(mf,{icon:_u,size:11}),(0,G.jsxs)(`span`,{"aria-hidden":`true`,children:[`Changed in rev `,e]}),(0,G.jsxs)(`span`,{className:`sr-only`,children:[`Changed in revision `,e]})]})}var OE={fixed:{icon:Ll,label:`Fixed`,colors:`bg-outcome-fixed-bg text-outcome-fixed-fg`},explained:{icon:lu,label:`Explained`,colors:`bg-outcome-explained-bg text-outcome-explained-fg`},held:{icon:du,label:`Held`,colors:`bg-outcome-held-bg text-outcome-held-fg`},declined:{icon:Nl,label:`Declined`,colors:`bg-outcome-declined-bg text-outcome-declined-fg`}};function kE({outcome:e}){let{icon:t,label:n,colors:r}=OE[e];return(0,G.jsxs)(`span`,{className:`inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-sm pr-[7px] pl-[5px] text-11 font-semibold leading-none ${r}`,children:[(0,G.jsx)(mf,{icon:t,size:12,strokeWidth:2.25}),n]})}function AE(e){return e.comments.some(e=>e.author===`user`&&e.sent===!1)?`unsent`:e.state}var jE={unsent:`Unsent`,open:`Open`,sent:`Sent`,answered:`Answered`,resolved:`Resolved`},ME={unsent:`border-[1.5px] border-dashed border-thread-open`,open:`bg-thread-open`,sent:`bg-thread-sent`,answered:`bg-thread-answered`,resolved:`border-[1.5px] border-thread-resolved`};function NE({state:e}){return(0,G.jsxs)(`span`,{className:`em-card__pill`,"data-state":e,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`size-[7px] shrink-0 rounded-full ${ME[e]}`}),jE[e]]})}function PE(e,t,n,r){return`/r/${encodeURIComponent(e)}?rev=${t}&tab=${r?`docs&doc=${encodeURIComponent(r)}`:`writeup`}#block-${encodeURIComponent(n)}`}function FE(e,t){let n=0,r=0;for(let t of e.comments)t.author===`user`&&t.sentOn!==null&&(n=Math.max(n,t.sentOn)),t.author===`agent`&&(r=n);return r>0&&r<t}function IE(e,t,n,r){if(t.placement.status!==`placed`)return;let i=t.placement.location;if(i.kind===`review`)return;let a=new URLSearchParams;n.rev!==void 0&&a.set(`rev`,String(n.rev));let o=`thread-${t.id}`;return i.kind===`writeup-span`?a.set(`tab`,`writeup`):i.kind===`doc-span`||i.kind===`html-span`?(a.set(`tab`,`docs`),a.set(`doc`,i.path),i.kind===`html-span`&&a.set(`thread`,t.id)):(a.set(`tab`,r?`diff`:n.tab??`comments`),n.doc&&a.set(`doc`,n.doc),o=`diff-thread-${t.id}`),`/r/${encodeURIComponent(e)}?${a}#${encodeURIComponent(o)}`}var LE={"block-gone":`The block this comment was on is gone.`,ambiguous:`The quoted text now appears more than once.`,"topic-gone":`The topic this comment was on is gone.`,"file-gone":`The file this comment was on is no longer in the diff.`,"lines-gone":`The lines this comment was on are gone.`,"not-placed":`This comment has no place in this revision.`};function RE({reviewId:e,revision:t,thread:n,changedBlocks:r,topics:i,showInPlace:a,surface:o=`reading`}){let s=n.placement.status===`placed`?n.placement.location:null,c=_E(n.id,o===`diff`?s:null),l=`${o===`diff`?`diff-thread`:`thread`}-${n.id}`,u=bE(l),d=bT(e),f=aw(e,n.target,n.id),p=[f,...n.comments.map(t=>ow(e,t.id))],m=uE(p,o),{open:h,close:g}=sE(f),_=Vy(e,n.id,o,`reply`,h),[v,y]=(0,W.useState)(()=>o===`comments`&&n.state===`resolved`&&!p.some(e=>uw(e).trim()));(0,W.useEffect)(()=>{m&&y(!1)},[m]);let b=s&&`blockId`in s?r.find(e=>e.blockId===s.blockId):void 0,x=b&&s&&`blockId`in s&&FE(n,b.revision),{label:S,icon:C}=wT(n.target,i),w=n.state===`resolved`,T=v&&w;EE(h&&!T);let ee=!w&&n.comments.some(e=>e.author===`agent`||e.sent);return(0,G.jsxs)(`article`,{ref:c,"data-thread-card":!0,id:l,className:`em-card em-thread`,"data-state":AE(n),"data-jump":u?``:void 0,"data-resolved":w?``:void 0,"data-collapsed":T?``:void 0,children:[(0,G.jsxs)(`header`,{className:`em-card__head em-thread__head`,children:[(0,G.jsxs)(`span`,{className:`em-card__target`,title:S,children:[(0,G.jsx)(mf,{icon:C,size:13}),(0,G.jsx)(`span`,{children:S})]}),x&&(0,G.jsx)(`a`,{href:PE(e,t,s.blockId,s.kind===`doc-span`?s.path:void 0),children:(0,G.jsx)(DE,{revision:b.revision})}),(0,G.jsx)(NE,{state:AE(n)}),o===`comments`&&a&&!x&&(0,G.jsx)(I_,{asChild:!0,size:`sm`,icon:jl,label:`Show in place`,children:(0,G.jsx)(`a`,{href:a,children:(0,G.jsx)(`span`,{className:`sr-only`,children:`Show in place`})})}),o===`comments`&&w&&(0,G.jsx)(I_,{size:`sm`,icon:T?zl:Vl,label:T?`Expand thread`:`Collapse thread`,"aria-expanded":!T,onClick:()=>y(!T)})]}),!T&&(0,G.jsxs)(G.Fragment,{children:[n.placement.status===`unplaced`&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-line-1 bg-warning-bg px-3 py-2 text-warning-fg [font:var(--type-meta)]`,children:[(0,G.jsx)(mf,{icon:Tu,size:14,className:`mt-px`}),(0,G.jsxs)(`span`,{children:[LE[n.placement.reason],n.createdOn!==t&&(0,G.jsxs)(G.Fragment,{children:[` `,`Made on`,` `,(0,G.jsxs)(`a`,{className:`underline`,href:`/r/${encodeURIComponent(e)}?rev=${n.createdOn}&tab=comments&thread=${encodeURIComponent(n.id)}#thread-${encodeURIComponent(n.id)}`,children:[`revision `,n.createdOn]}),`.`]})]})]}),(0,G.jsxs)(`div`,{className:`em-card__body`,children:[`quote`in n.target&&(0,G.jsx)(`p`,{className:`em-thread-quote`,children:(0,G.jsx)(`mark`,{children:n.target.quote})}),(0,G.jsx)(`ol`,{className:`em-thread__comments`,children:n.comments.map(r=>(0,G.jsx)(zE,{comment:r,reviewId:e,revision:t,thread:n,topics:i,surface:o},r.id))}),d.error&&(0,G.jsx)(`p`,{role:`alert`,children:_T(d.error)})]}),(ee||w||h)&&(0,G.jsxs)(`footer`,{className:`em-card__foot`,"data-reply-open":h?``:void 0,children:[(ee||w)&&(0,G.jsxs)(`div`,{className:h?`em-card__foot`:`contents`,children:[ee&&!h&&(0,G.jsx)(ib,{ref:_.ref,variant:`ghost`,size:`sm`,icon:hu,onClick:()=>{aE(f,o)},children:`Reply`}),(0,G.jsx)(ib,{variant:`ghost`,size:`sm`,icon:w?yu:Ll,disabled:d.isPending,onClick:()=>d.mutate({path:`/api/v1/threads/${encodeURIComponent(n.id)}/${w?`reopen`:`resolve`}`}),children:w?`Reopen`:`Resolve`})]}),h&&(0,G.jsx)(vE,{embedded:!0,surface:o,reviewId:e,revision:t,target:n.target,topics:i,threadId:n.id,onSaved:g,onCancel:g,returnFocus:_.returnFocus})]})]})]})}function zE({comment:e,reviewId:t,revision:n,thread:r,topics:i,surface:a=`reading`}){let o=ow(t,e.id),s=(0,W.useSyncExternalStore)(lw,()=>dw(o)),{open:c,close:l}=lE(o),u=s&&c,[d,f]=(0,W.useState)(!1),p=Vy(t,r.id,a,e.id,u),m=bT(t,o),h=e.author===`agent`,g=!h&&!e.sent;return EE(g&&u),(0,G.jsxs)(`li`,{className:`em-comment`,"data-agent":h?``:void 0,children:[(0,G.jsx)(`span`,{className:`em-comment__avatar`,children:(0,G.jsx)(mf,{icon:h?Fl:Du,size:13})}),(0,G.jsxs)(`header`,{className:`em-comment__head`,children:[(0,G.jsx)(`span`,{className:`em-comment__name`,children:h?`Agent`:`You`}),h&&e.outcome&&(0,G.jsx)(kE,{outcome:e.outcome}),g&&(0,G.jsxs)(`span`,{className:`ml-auto flex gap-0.5`,children:[!u&&(0,G.jsx)(I_,{ref:p.ref,label:`Edit`,icon:pu,size:`sm`,disabled:m.isPending,onClick:()=>{dw(o)||pw(o,e.body),aE(o,a)}}),(0,G.jsx)(I_,{label:`Delete`,icon:Cu,size:`sm`,disabled:m.isPending,onClick:()=>f(!0)}),(0,G.jsx)(nT,{open:d,onOpenChange:e=>{m.isPending||f(e)},title:`Delete this comment?`,description:`It has not been sent yet. This cannot be undone.`,actions:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ib,{"data-autofocus":!0,disabled:m.isPending,onClick:()=>f(!1),children:`Cancel`}),(0,G.jsx)(ib,{variant:`danger`,disabled:m.isPending,onClick:()=>m.mutate({path:`/api/v1/comments/${encodeURIComponent(e.id)}`,method:`DELETE`,deleteDraft:o},{onSuccess:()=>{f(!1)}}),children:`Delete`})]}),children:m.error&&(0,G.jsx)(`p`,{role:`alert`,children:_T(m.error)})})]})]}),(0,G.jsxs)(`div`,{children:[g&&u?(0,G.jsx)(vE,{embedded:!0,surface:a,reviewId:t,revision:n,target:r.target,topics:i,commentId:e.id,onCancel:()=>{mw(o),l()},onDismiss:()=>{uw(o)===e.body&&mw(o),l()},returnFocus:p.returnFocus}):typeof e.html==`string`?(0,G.jsx)(CE,{html:e.html}):(0,G.jsx)(`p`,{className:`em-comment__body`,children:e.body}),m.error&&!d&&(0,G.jsx)(`p`,{role:`alert`,children:_T(m.error)})]})]})}function BE({attention:e}){return e?(0,G.jsx)(`span`,{className:`em-topic-chip`,"data-attention":e,children:e.toUpperCase()}):null}function VE({topic:e}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(BE,{attention:e.attention}),e.door&&(0,G.jsx)(`span`,{className:`em-topic-chip`,"data-door":e.door,children:e.door.toUpperCase()})]})}function HE({topic:e,note:t=!1,blast:n=!0}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(BE,{attention:e.attention}),e.door&&(0,G.jsx)(`span`,{className:e.door===`one-way`?`font-medium text-warning-fg`:void 0,children:e.door===`one-way`?`One-way door`:`Two-way door`}),n&&(0,G.jsx)(UE,{topic:e,note:t})]})}function UE({topic:e,note:t=!1}){return e.blastRadius?(0,G.jsxs)(`span`,{className:`min-w-0 wrap-anywhere`,children:[`Blast radius`,` `,(0,G.jsx)(`span`,{className:`font-mono text-[11.5px] font-stretch-mono text-fg-2`,children:e.blastRadius.scope}),t&&e.blastRadius.note&&(0,G.jsxs)(G.Fragment,{children:[` · `,e.blastRadius.note]})]}):null}var WE=[`diff-counts`],GE=new Map;function KE(){let e=Xs(),{data:t}=pl({queryKey:WE,queryFn:Sc,initialData:()=>new Map,staleTime:1/0,gcTime:1/0}),n=(0,W.useCallback)((t,n)=>{e.setQueryData(WE,(e=new Map)=>{let r=e.get(t);return r?.additions===n.additions&&r.deletions===n.deletions?e:new Map(e).set(t,n)})},[e]);return{counts:t??GE,onParsed:n}}export{vw as $,Cu as $t,wT as A,dc as An,gy as At,sT as B,Z_ as Bt,AT as C,Oc as Cn,wy as Ct,TT as D,cc as Dn,sy as Dt,DT as E,lc as En,hy as Et,pT as F,ns as Fn,jv as Ft,mw as G,I_ as Gt,aT as H,Q as Ht,mT as I,V as In,av as It,ow as J,mf as Jt,hw as K,F_ as Kt,gT as L,bs as Ln,tv as Lt,_T as M,Sc as Mn,zv as Mt,vT as N,Zs as Nn,Mv as Nt,ST as O,sc as On,cy as Ot,bT as P,Xs as Pn,Av as Pt,sw as Q,ku as Qt,hT as R,I as Rn,nv as Rt,NT as S,kc as Sn,Dy as St,OT as T,uc as Tn,Oy as Tt,nT as U,V_ as Ut,oT as V,X_ as Vt,bw as W,Z as Wt,dw as X,ff as Xt,xw as Y,df as Yt,fw as Z,pf as Zt,aE as _,pl as _n,jy as _t,RE as a,Zl as an,gw as at,WT as b,Nc as bn,Ty as bt,DE as c,Gl as cn,ib as ct,bE as d,Ll as dn,tb as dt,xu as en,yw as et,vE as f,Fl as fn,eb as ft,mE as g,ml as gn,zy as gt,pE as h,hl as hn,Xy as ht,VE as i,$l as in,lw as it,xT as j,oc as jn,Rv as jt,CT as k,nc as kn,yy as kt,TE as l,Ul as ln,$y as lt,hE as m,gl as mn,Yy as mt,UE as n,lu as nn,uw as nt,IE as o,Yl as on,XC as ot,gE as p,K as pn,Gy as pt,aw as q,P_ as qt,HE as r,su as rn,pw as rt,AE as s,ql as sn,YC as st,KE as t,pu as tn,cw as tt,wE as u,zl as un,Qy as ut,cE as v,Qc as vn,My as vt,kT as w,rc as wn,Ey as wt,zT as x,Mc as xn,Cy as xt,qT as y,Hc as yn,xy as yt,dT as z,ss as zn,rv as zt};
|